info_routines.s 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. **************************************
  2. **** DISPLAY INFO WINDOW ****
  3. **************************************
  4. display_info_window
  5. move.l #info_window,a0
  6. bsr create_window
  7. move.l #quit_info_button,a0
  8. jsr display_button
  9. move.l #info_window,a0
  10. move.l #info_text,a1
  11. move.w #5,d0
  12. move.w #3,d1
  13. move.w #1,d2
  14. move.w #1,d3
  15. bsr write_text
  16. rts
  17. **************************************
  18. **** REMOVE INFO WINDOW ****
  19. **************************************
  20. remove_info_window
  21. move.l #quit_info_button,a0
  22. jsr remove_button
  23. bsr destroy_window
  24. rts
  25. *********************************
  26. *** DISPLAY ERROR ****
  27. *********************************
  28. Display_Error
  29. bsr set_original_colours
  30. move.l #error_window,a0
  31. bsr create_window
  32. move.l #ok_button,a0
  33. jsr display_button
  34. movem.l a6,-(sp)
  35. move.l dosbase,a6
  36. jsr -132(a6)
  37. movem.l (sp)+,a6
  38. bsr get_error_message
  39. move.l #error_window,a0
  40. moveq #10,d0
  41. moveq #10,d1
  42. moveq #2,d2
  43. bsr write_text
  44. rts
  45. *********************************
  46. *** ERROR ROUTINE ****
  47. *********************************
  48. Error_Routine
  49. *send error in d0
  50. move.l d0,-(sp)
  51. bsr set_original_colours
  52. move.l #error_window,a0
  53. bsr create_window
  54. move.l #ok_button,a0
  55. jsr display_button
  56. move.l (sp)+,d0
  57. bsr get_error_message
  58. move.l #error_window,a0
  59. moveq #20,d0
  60. moveq #10,d1
  61. moveq #2,d2
  62. bsr write_text
  63. rts
  64. *********************************
  65. *** GET ERROR MESSAGE ****
  66. *********************************
  67. Get_Error_Message
  68. *returns pointer to string in a1
  69. *error numin d0
  70. move.l #error_list,a0
  71. error_search
  72. cmp.w #-1,(a0)
  73. beq.s no_error_found
  74. cmp.w (a0),d0
  75. bne.s not_the_error
  76. move.l 2(a0),a1
  77. rts
  78. not_the_error
  79. addq.l #6,a0
  80. bra.s error_search
  81. no_error_found
  82. move.l #no_error,a1
  83. rts
  84. *********************************
  85. *** REMOVE ERROR WINDOW ****
  86. *********************************
  87. Remove_Error_Window
  88. move.l #ok_button,a0
  89. jsr remove_button
  90. bsr destroy_window
  91. bsr set_current_page_colours
  92. rts
  93. error_list
  94. dc.w 103
  95. dc.l e1
  96. dc.w 204
  97. dc.l e2
  98. dc.w 205
  99. dc.l e3
  100. dc.w 210
  101. dc.l e4
  102. dc.w 211
  103. dc.l e5
  104. dc.w 213
  105. dc.l e6
  106. dc.w 214
  107. dc.l e7
  108. dc.w 221
  109. dc.l e8
  110. dc.w 225
  111. dc.l e9
  112. dc.w 226
  113. dc.l e10
  114. dc.w 1000
  115. dc.l e11
  116. dc.w 1001
  117. dc.l e12
  118. dc.w 1002
  119. dc.l e13
  120. dc.w 2000
  121. dc.l e14
  122. dc.w 3000
  123. dc.l e15
  124. dc.w 4000
  125. dc.l e16
  126. dc.w 5000
  127. dc.l e17
  128. dc.w 5001
  129. dc.l e18
  130. dc.w -1
  131. e1
  132. dc.b "INSUFFICIENT FREE STORE.",0
  133. EVEN
  134. e2
  135. dc.b "DIRECTORY NOT FOUND.",0
  136. EVEN
  137. e3
  138. dc.b "OBJECT NOT FOUND.",0
  139. EVEN
  140. e4
  141. dc.b "INVALID STREAM COMPONENT NAME.",0
  142. EVEN
  143. e5
  144. dc.b "INVALID OBJECT LOCK.",0
  145. EVEN
  146. e6
  147. dc.b "DISK NOT VALIDATED.",0
  148. EVEN
  149. e7
  150. dc.b "DISK WRITE PROTECTED.",0
  151. EVEN
  152. e8
  153. dc.b "DISK FULL.",0
  154. EVEN
  155. e9
  156. dc.b "NOT A DOS DISK.",0
  157. EVEN
  158. e10
  159. dc.b "NO DISK IN DRIVE.",0
  160. EVEN
  161. e11
  162. dc.b "NOT AN IFF FILE.",0
  163. EVEN
  164. e12
  165. dc.b "CANNOT ALLOCATE FILE MEM.",0
  166. EVEN
  167. e13
  168. dc.b "CANNOT ALLOCATE PIC MEM.",0
  169. EVEN
  170. e14
  171. dc.b "SCANNER NOT CONNECTED!",0
  172. EVEN
  173. e15
  174. dc.b "NOT A MUSIC DATA FILE!",0
  175. EVEN
  176. e16
  177. dc.b "NOT AN EDITOR MAP FILE!",0
  178. EVEN
  179. e17
  180. dc.b "NOT A EDITOR BUFFER FILE!",0
  181. EVEN
  182. e18
  183. dc.b "DATA SIZE INCOMPATIBLE ",0
  184. EVEN
  185. no_error
  186. dc.b "NOT A VALID ERROR.",0
  187. EVEN
  188. *********WINDOW SETUPS
  189. error_window
  190. dc.w 320
  191. dc.w 44+32
  192. dc.w 0
  193. dc.w 80
  194. dc.l 0
  195. dc.l 0
  196. dc.b "ERROR",0
  197. EVEN
  198. ok_button
  199. dc.w BUTTON_2-16
  200. dc.w THIRD_ROW
  201. dc.w WINDOW ;frame type
  202. dc.b STANDARD_BUTTON ;standard
  203. dc.b NOT_DEPRESSED
  204. dc.b 0
  205. dc.b 0 ;not used
  206. dc.l 0 ;not used
  207. dc.l 0 ;not used
  208. dc.l remove_error_window
  209. dc.b "OK",0
  210. EVEN
  211. info_window
  212. dc.w 200
  213. dc.w 180
  214. dc.w 60
  215. dc.w 10
  216. dc.l 0
  217. dc.l 0
  218. dc.b "INFO",0
  219. EVEN
  220. quit_info_button
  221. dc.w 55
  222. dc.w 140
  223. dc.w WINDOW ;frame type
  224. dc.b CUSTOM_BUTTON ;standard
  225. dc.b NOT_DEPRESSED
  226. dc.b 0
  227. dc.b 0 ;not used
  228. dc.l ok_custom_button
  229. dc.l 0 ;not used
  230. dc.l remove_info_window
  231. dc.b 0
  232. even
  233. info_text
  234. dc.b $a,$a,-2,8
  235. dc.b " Glen Cumming's",$a
  236. dc.b " Map Editor ",$a,-2,9
  237. dc.b " ",$a,-2,10
  238. dc.b " Internal use ",$a,-2,11
  239. dc.b " only. ",$a,$a,-2,9
  240. dc.b " v1.0 ",$a
  241. dc.b " ",$a,-2,10
  242. dc.b " (c) 1992 ",0
  243. EVEN