hex_screen_routines.s 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ********************************
  2. ***** CREATE HEX WINDOW *****
  3. ********************************
  4. create_hex_window
  5. *send pointer in a0
  6. move.l a0,mem_position
  7. move.l #hex_window,a0
  8. bsr create_window
  9. move.l #hex_button_list,a0
  10. bsr display_button_list
  11. bsr display_hex_text
  12. rts
  13. ********************************
  14. ***** DISPLAY HEX TEXT *****
  15. ********************************
  16. display_hex_text
  17. move.l mem_position,a0
  18. move.w #10-1,d0
  19. move.l #hex_text_list,a1
  20. write_hex_text
  21. move.b #"$",(a1)+
  22. move.l a0,d1
  23. swap d1
  24. bsr fill_hex
  25. swap d1
  26. bsr fill_hex
  27. move.b #" ",(a1)+
  28. move.b #":",(a1)+
  29. move.b #" ",(a1)+
  30. move.b #"$",(a1)+
  31. move.l (a0)+,d1
  32. swap d1
  33. bsr fill_hex
  34. swap d1
  35. bsr fill_hex
  36. add.l #1,a1
  37. dbra d0,write_hex_text
  38. move.l #hex_window,a0
  39. move.l #hex_text_list,a1
  40. move.w #3,d0
  41. move.w #3,d1
  42. move.w #2,d2
  43. bsr write_text
  44. rts
  45. ********************************
  46. ***** FILL HEX *****
  47. ********************************
  48. fill_hex
  49. movem.l d1,-(sp)
  50. move.w #4-1,d3
  51. get_nybble
  52. rol.w #4,d1
  53. move.w d1,d4
  54. andi.w #$000f,d4
  55. cmp.w #9,d4
  56. bgt.s add_up_to_hex
  57. add.w #48,d4
  58. bra.s do_next_nyb
  59. add_up_to_hex
  60. add.w #55,d4
  61. do_next_nyb
  62. move.b d4,(a1)+
  63. dbra d3,get_nybble
  64. movem.l (sp)+,d1
  65. rts
  66. ********************************
  67. ***** DELETE HEX WINDOW *****
  68. ********************************
  69. delete_hex_window
  70. move.l #hex_window,a0
  71. move.w #0,d0
  72. move.w #0,d1
  73. move.w #18,d2
  74. move.w #120,d3
  75. bsr clear_word_chunk
  76. rts
  77. ********************************
  78. ***** SCROLL WINDOW UP *****
  79. ********************************
  80. scroll_window_up
  81. sub.l #4,mem_position
  82. bsr delete_hex_window
  83. bsr display_hex_text
  84. rts
  85. ********************************
  86. ***** SCROLL WINDOW DOWN *****
  87. ********************************
  88. scroll_window_down
  89. add.l #4,mem_position
  90. bsr delete_hex_window
  91. bsr display_hex_text
  92. rts
  93. ********************************
  94. ***** QUIT HEX ROUTINE *****
  95. ********************************
  96. quit_hex_routine
  97. move.l #hex_button_list,a0
  98. bsr remove_button_list
  99. bsr destroy_window
  100. rts
  101. mem_position
  102. dc.l 0
  103. hex_window
  104. dc.w 320
  105. dc.w 160
  106. dc.w 96
  107. dc.w 20
  108. dc.l 0
  109. dc.l 0
  110. dc.b "HEX DUMP",0
  111. EVEN
  112. hex_text_list
  113. dc.b " ",$a
  114. dc.b " ",$a
  115. dc.b " ",$a
  116. dc.b " ",$a
  117. dc.b " ",$a
  118. dc.b " ",$a
  119. dc.b " ",$a
  120. dc.b " ",$a
  121. dc.b " ",$a
  122. dc.b " ",0
  123. EVEN