new_button_routines.s 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. *****************************************************************
  2. * MODULE TITLE :button_routines *
  3. * *
  4. * DESCRIPTION :Button display and handling software *
  5. * *
  6. * *
  7. * *
  8. * NAME DATE *
  9. * *
  10. * LIST OF ROUTINES :setup_button_list *
  11. * check_for_call_routine *
  12. * check_to_see_hit *
  13. * draw_buttons *
  14. * delete_buttons *
  15. * display_button *
  16. * remove_button *
  17. * display_button_list *
  18. * remove_button_list *
  19. * *
  20. *****************************************************************
  21. NOT_DEPRESSED equ 0
  22. DEPRESSED equ 1
  23. CUSTOM_BUTTON equ 1
  24. STANDARD_BUTTON equ 0
  25. TOGGLE_BUTTON equ 2
  26. HOLD_BUTTON equ 4
  27. NO_WAIT_BUTTON equ 8
  28. BUTTON_WIDTH equ 112
  29. BUTTON_HEIGHT equ 16
  30. OFFSET equ 3 ;to position in middle of button
  31. EDGE equ 4 ;bass relief edge size
  32. **************************************
  33. ***** SETUP BUTTON LIST *****
  34. **************************************
  35. setup_button_list
  36. move.l #$FFFFFFFF,button_list
  37. move.l #$FFFFFFFF,button_delete_list
  38. move.l #$FFFFFFFF,button_draw_list
  39. move.w #0,button_counter
  40. rts
  41. **************************************
  42. ***** CHECK FOR CALL ROUTINE *****
  43. **************************************
  44. check_for_call_routine
  45. cmp.l #$ffffffff,jump_routine
  46. beq.s end_call_routine
  47. move.l jump_routine,a0
  48. jsr (a0)
  49. end_call_routine
  50. move.l #$ffffffff,jump_routine
  51. rts
  52. jump_routine
  53. dc.l $ffffffff
  54. **************************************
  55. ***** CHECK TO SEE HIT *****
  56. **************************************
  57. check_to_see_hit
  58. cmp.w #1,mouse_button_ind
  59. bne button_not_down
  60. move.l clicked_button,a0 ;
  61. move.b button_type(a0),d0 ;
  62. btst #2,d0 ;
  63. beq.s not_a_hold_button ;
  64. btst #6,$bfe001 ;
  65. bne.s has_been_released ;
  66. btst #3,d0
  67. bne.s execute_button_proc
  68. cmp.w #0,button_wait_counter
  69. beq execute_button_proc
  70. subq.w #1,button_wait_counter
  71. bra quit_check_buttons
  72. execute_button_proc
  73. move.l button_proc(a0),jump_routine
  74. bra quit_check_buttons ;
  75. not_a_hold_button ;
  76. btst #6,$bfe001
  77. beq quit_check_buttons
  78. has_been_released ;
  79. move.w #0,mouse_button_ind
  80. move.l clicked_button,a1
  81. btst #1,button_type(a1) ;toggle button test
  82. bne.s jump_to_button_routine
  83. move.b #0,button_clicked(a1)
  84. move.l button_draw_ptr,a2
  85. move.l button_delete_ptr,a3
  86. move.l a1,(a2)+
  87. move.l a1,(a3)+
  88. move.l #$ffffffff,(a2)
  89. move.l #$ffffffff,(a3)
  90. move.l a2,button_draw_ptr
  91. move.l a3,button_delete_ptr
  92. jump_to_button_routine
  93. btst #2,button_type(a1) ;
  94. beq.s not_hold_button ;
  95. cmp.w #0,button_wait_counter
  96. bne.s not_hold_button ;give nice feel to hold button
  97. move.w #BUTTON_HOLD_WAIT,button_wait_counter
  98. move.l #$ffffffff,jump_routine ;
  99. bra quit_check_buttons ;
  100. not_hold_button
  101. move.w #BUTTON_HOLD_WAIT,button_wait_counter ;
  102. move.l button_proc(a1),jump_routine
  103. bra quit_check_buttons
  104. button_not_down
  105. btst #6,$bfe001 ;test only
  106. beq check_hits_by_user ;frig for editor only
  107. move.w #0,left_first
  108. bra quit_check_buttons
  109. check_hits_by_user
  110. move.l #button_list,a0
  111. check_buttons_loop
  112. cmp.l #$ffffffff,(a0)
  113. beq quit_check_buttons
  114. move.l (a0),a1
  115. move.w button_x(a1),d0
  116. move.w button_y(a1),d1
  117. test_current_window
  118. cmp.w #MAIN_BUTTON_SCREEN,current_frame ;jiggery pokery
  119. bne.s window_up
  120. cmp.w #MAIN_SCREEN,frame_type(a1)
  121. beq.s check_button_frame_type
  122. window_up
  123. move.w frame_type(a1),d7
  124. cmp.w current_frame,d7
  125. bne not_a_hit
  126. check_button_frame_type
  127. cmp.w #WINDOW,frame_type(a1) ;is button in window
  128. bne.s not_test_in_window
  129. cmp.w #0,window_count ;any windows up??
  130. beq.s check_that_button
  131. move.l window_list_ptr,a3
  132. move.l -(a3),a4
  133. cmp.l button_window(a1),a4
  134. bne not_a_hit
  135. move.w window_x(a4),d2
  136. add.w d2,d0
  137. add.w #BORDER_X,d0 ;allow for border
  138. add.w window_y(a4),d1
  139. add.w #BORDER_Y,d1 ;allow for window y border
  140. bra.s check_that_button
  141. not_test_in_window
  142. cmp.w #MAIN_BUTTON_SCREEN,frame_type(a1)
  143. bne.s check_that_button
  144. ***--- STUFF TO ALLOW MYLES FULLSCREEN MODE
  145. tst.w fullscreen_mode
  146. beq.s not_in_fc_mode
  147. bra not_a_hit
  148. not_in_fc_mode
  149. ***---
  150. add.w #BUTTON_WINDOW_OFFSET,d1
  151. check_that_button
  152. move.w d0,d2
  153. move.w d1,d3
  154. btst #0,button_type(a1) ;standard button test
  155. beq normal_check_button
  156. ***else get details***
  157. move.l button_custom(a1),a2
  158. add.w custom_button_x_size(a2),d2
  159. add.w custom_button_y_size(a2),d3
  160. bra.s check_for_click_in_button
  161. normal_check_button
  162. add.w #BUTTON_WIDTH,d2
  163. add.w #BUTTON_HEIGHT,d3
  164. check_for_click_in_button
  165. move.w mouse_x,d7
  166. ***--- Another frig for fullscreen mode
  167. cmp.w #MAIN_BUTTON_SCREEN,frame_type(a1)
  168. beq.s .skip
  169. btst #INTB_HIRES,screen_mode
  170. bne.s asr_needed
  171. beq.s no_asr_needed
  172. .skip
  173. ***---
  174. cmp.w #BUTTON_WINDOW_OFFSET,mouse_y
  175. ble.s no_asr_needed
  176. asr_needed asl.w #1,d7
  177. no_asr_needed
  178. cmp.w d7,d0
  179. bgt.s not_a_hit
  180. cmp.w d7,d2
  181. blt.s not_a_hit
  182. cmp.w mouse_y,d1
  183. bgt.s not_a_hit
  184. cmp.w mouse_y,d3
  185. blt.s not_a_hit
  186. move.l a1,clicked_button
  187. move.w #1,mouse_button_ind
  188. cmp.b #1,button_clicked(a1)
  189. beq.s button_already_down
  190. move.b #1,button_clicked(a1)
  191. bra.s put_button_in_list
  192. button_already_down
  193. move.b #0,button_clicked(a1)
  194. put_button_in_list
  195. move.l button_draw_ptr,a2
  196. move.l button_delete_ptr,a3
  197. move.l a1,(a2)+
  198. move.l a1,(a3)+
  199. move.l #$ffffffff,(a2)
  200. move.l #$ffffffff,(a3)
  201. move.l a2,button_draw_ptr
  202. move.l a3,button_delete_ptr
  203. bra.s quit_check_buttons
  204. not_a_hit
  205. add.l #4,a0
  206. bra check_buttons_loop
  207. quit_check_buttons
  208. rts
  209. *delete buttons should always be run before draw buttons
  210. **************************************
  211. ***** DRAW BUTTONS *****
  212. **************************************
  213. *takes in the draw button list and draws these, clearing
  214. *the list as it goes. It is done like this (and for delete)
  215. *because then it will be synced up proper;y
  216. draw_buttons
  217. ifnd hard_only
  218. bsr own_the_blitter
  219. endc
  220. move.l #button_draw_list,a0
  221. draw_buttons_loop
  222. cmp.l #$ffffffff,(a0)
  223. beq quit_draw_buttons
  224. *****DRAW BLITS****
  225. move.l #button_window_struct,a4 ;default structure
  226. move.l screen_mem(a4),a2 ;default place to draw
  227. move.l (a0),a1
  228. cmp.w #WINDOW,frame_type(a1) ;are we drawing in window?
  229. bne.s not_window_button
  230. move.l window_list_ptr,a3
  231. move.l -(a3),a4
  232. move.l screen_mem(a4),a2 ;replace place to draw
  233. move.l #main_screen_struct,a4
  234. not_window_button
  235. moveq #0,d0
  236. moveq #0,d1
  237. move.w button_x(a1),d0
  238. move.w button_y(a1),d1
  239. move.w screen_x_size(a4),d4
  240. asr.w #3,d4
  241. mulu d4,d1 ;y pos
  242. add.l d1,a2
  243. move.w d0,d1
  244. andi.w #$000f,d1
  245. andi.w #$fff0,d0
  246. asr.w #3,d0
  247. move.l a2,a5 ;save for later
  248. add.l d0,a2 ;x pos
  249. ror.w #4,d1 ;shift
  250. or.w #$0dfc,d1 ;or blit
  251. btst.b #0,button_type(a1) ;standard button test
  252. beq.s normal_button
  253. *******get details about custom button
  254. move.l button_custom(a1),a5
  255. cmp.b #0,button_clicked(a1)
  256. beq.s unclicked_custom_butt
  257. tst.l custom_button_click_graphics(a5)
  258. beq do_next_button ;null graphics button
  259. move.l custom_button_click_graphics(a5),a3
  260. bra.s calc_custom_blit_details
  261. unclicked_custom_butt
  262. tst.l custom_button_graphics(a5)
  263. beq do_next_button ;null graphics button
  264. move.l custom_button_graphics(a5),a3
  265. calc_custom_blit_details
  266. move.w custom_planes(a5),d4
  267. subq.w #1,d4
  268. move.w custom_button_height(a5),d3 ;calc custom blit size
  269. asl.w #6,d3
  270. move.w custom_button_width(a5),d0
  271. add.w #16,d0
  272. asr.w #4,d0
  273. add.w d0,d3
  274. moveq #0,d6
  275. move.w screen_x_size(a4),d0 ;calculate custom modulus
  276. asr.w #3,d0
  277. move.w custom_button_width(a5),d7
  278. asr.w #3,d7
  279. move.w d7,d6
  280. addq.w #2,d7
  281. sub.w d7,d0
  282. mulu.w custom_button_height(a5),d6
  283. bra.s blit_on_button
  284. normal_button
  285. cmp.b #0,button_clicked(a1)
  286. beq.s unclicked_butt
  287. move.l #button_clicked_plane1,a3
  288. bra.s draw_the_butt
  289. unclicked_butt
  290. move.l #button_plane1,a3
  291. draw_the_butt
  292. move.w #3-1,d4 ;number of planes for normal_button
  293. move.w #BUTTON_HEIGHT,d3 ;calc blit size
  294. asl.w #6,d3
  295. move.w #BUTTON_WIDTH+16,d0
  296. asr.w #4,d0
  297. add.w d0,d3
  298. move.w screen_x_size(a4),d0 ;calculate modulus
  299. asr.w #3,d0
  300. sub.w #(BUTTON_WIDTH+16)/8,d0
  301. move.l #BUTTON_WIDTH/8*BUTTON_HEIGHT,d6
  302. blit_on_button
  303. btst #14,DMACONR(a6)
  304. bne.s blit_on_button
  305. move.l a3,bltapt(a6)
  306. move.l a2,bltdpt(a6)
  307. move.l a2,bltbpt(a6)
  308. move.w d0,bltdmod(a6)
  309. move.w d0,bltbmod(a6)
  310. move.w #-2,bltamod(a6)
  311. move.w d1,bltcon0(a6)
  312. clr.w bltcon1(a6)
  313. move.l #$ffff0000,bltafwm(a6)
  314. move.w d3,bltsize(a6)
  315. add.l d6,a3
  316. moveq #0,d7
  317. move.w screen_x_size(a4),d7
  318. asr.w #3,d7
  319. mulu screen_y_size(a4),d7
  320. add.l d7,a2
  321. dbra d4,blit_on_button
  322. btst.b #0,button_type(a1) ;custom button test
  323. bne do_next_button
  324. ***a5 contains y position on screen
  325. moveq #0,d7
  326. move.w screen_x_size(a4),d7
  327. asr.w #3,d7
  328. mulu #OFFSET,d7
  329. add.l d7,a5
  330. move.l a1,a3
  331. add.l #button_text,a3
  332. move.l a3,a2 ;**used to be a4 but i want to keep a4
  333. moveq #0,d7
  334. count_letters
  335. cmp.b #0,(a2)+
  336. beq.s counted_letters
  337. addq.w #1,d7
  338. bra.s count_letters
  339. counted_letters
  340. mulu #FONT_PIX_WIDTH,d7
  341. move.w #BUTTON_WIDTH-(EDGE*2),d6
  342. sub.w d7,d6
  343. asr.w #1,d6
  344. moveq #0,d0
  345. move.w button_x(a1),d7
  346. add.w #EDGE,d7 ;start in a bit
  347. add.w d6,d7 ;to centre text
  348. draw_in_text
  349. move.w d7,d0
  350. move.l a5,a2
  351. moveq #0,d1
  352. move.w d0,d1
  353. andi.w #$000f,d0
  354. andi.w #$fff0,d1
  355. ror.w #4,d0
  356. or.w #$0d0c,d0 ;not and b
  357. asr.w #3,d1
  358. add.l d1,a2
  359. moveq #0,d4
  360. move.b (a3)+,d4
  361. beq.s do_next_button
  362. movem.l a5,-(sp)
  363. move.l #button_font,a5
  364. sub.w #32,d4
  365. mulu #FONT_HEIGHT*4,d4 ;get letter in font
  366. add.l d4,a5
  367. blit_on_text
  368. btst #14,DMACONR(a6)
  369. bne.s blit_on_text
  370. move.l a5,bltapt(a6)
  371. move.l a2,bltdpt(a6)
  372. move.l a2,bltbpt(a6)
  373. move.w screen_x_size(a4),d4
  374. asr.w #3,d4
  375. subq.w #4,d4
  376. move.w d4,bltdmod(a6)
  377. move.w d4,bltbmod(a6)
  378. clr.w bltamod(a6)
  379. move.w d0,bltcon0(a6)
  380. clr.w bltcon1(a6)
  381. move.l #$ffffffff,bltafwm(a6)
  382. move.w #11<<6+2,bltsize(a6)
  383. movem.l (sp)+,a5
  384. add.w #FONT_PIX_WIDTH,d7
  385. bra.s draw_in_text
  386. do_next_button
  387. addq.l #4,a0
  388. bra draw_buttons_loop
  389. quit_draw_buttons
  390. move.l #$ffffffff,button_draw_list
  391. move.l #button_draw_list,button_draw_ptr
  392. ifnd hard_only
  393. bsr disown_the_blitter
  394. endc
  395. rts
  396. **************************************
  397. ***** DELETE BUTTONS *****
  398. **************************************
  399. delete_buttons
  400. ifnd hard_only
  401. bsr own_the_blitter
  402. endc
  403. move.l #button_delete_list,a0
  404. delete_buttons_loop
  405. cmp.l #$ffffffff,(a0)
  406. beq quit_delete_buttons
  407. *****CLEAR BLITS****
  408. move.l #button_window_struct,a4
  409. move.l screen_mem(a4),a2
  410. move.l (a0),a1
  411. cmp.w #WINDOW,frame_type(a1) ;are we checking in window?
  412. bne.s delete_not_window_button
  413. move.l window_list_ptr,a3
  414. move.l -(a3),a4
  415. move.l window_start(a4),a2 ;replace default drawing position
  416. move.l #main_screen_struct,a4
  417. delete_not_window_button
  418. moveq #0,d0
  419. moveq #0,d1
  420. move.w button_x(a1),d0
  421. move.w button_y(a1),d1
  422. move.w screen_x_size(a4),d3
  423. asr.w #3,d3
  424. mulu d3,d1 ;y pos
  425. add.l d1,a2
  426. move.w d0,d1
  427. andi.w #$000f,d1
  428. andi.w #$fff0,d0
  429. asr.w #3,d0
  430. add.l d0,a2 ;x pos
  431. ror.w #4,d1 ;shift
  432. or.w #$0d0c,d1 ;not a and b
  433. btst.b #0,button_type(a1) ;standard button test
  434. beq.s normal_delete_button
  435. *******get details about custom button
  436. move.l button_custom(a1),a5 ;get our pointer
  437. cmp.b #0,button_clicked(a1)
  438. beq delete_unclicked_custom_butt
  439. tst.l custom_button_graphics(a5)
  440. beq delete_next_button ;null graphics button
  441. move.l custom_button_graphics(a5),a3
  442. bra delete_calc_custom_blit_details
  443. delete_unclicked_custom_butt
  444. tst.l custom_button_click_graphics(a5)
  445. beq delete_next_button ;null graphics button
  446. move.l custom_button_click_graphics(a5),a3
  447. delete_calc_custom_blit_details
  448. move.w custom_planes(a5),d4
  449. subq.w #1,d4
  450. move.w custom_button_height(a5),d3 ;calc custom blit size
  451. asl.w #6,d3
  452. move.w custom_button_width(a5),d0
  453. add.w #16,d0
  454. asr.w #4,d0
  455. add.w d0,d3
  456. moveq #0,d6
  457. move.w screen_x_size(a4),d0 ;calculate custom modulus
  458. asr.w #3,d0
  459. move.w custom_button_width(a5),d7
  460. asr.w #3,d7
  461. move.w d7,d6
  462. addq.w #2,d7
  463. sub.w d7,d0
  464. mulu.w custom_button_height(a5),d6
  465. bra.s delete_on_button
  466. normal_delete_button
  467. cmp.b #0,button_clicked(a1)
  468. beq.s delete_clicked_butt
  469. move.l #button_plane1,a3
  470. bra.s delete_the_butt
  471. delete_clicked_butt
  472. move.l #button_clicked_plane1,a3
  473. delete_the_butt
  474. moveq #3-1,d4 ;number of planes for normal_button
  475. move.w #BUTTON_HEIGHT,d3
  476. asl.w #6,d3
  477. move.w #BUTTON_WIDTH+16,d0
  478. asr.w #4,d0
  479. add.w d0,d3
  480. move.w screen_x_size(a4),d0
  481. asr.w #3,d0
  482. sub.w #(BUTTON_WIDTH+16)/8,d0
  483. move.l #(BUTTON_WIDTH/8)*BUTTON_HEIGHT,d6
  484. delete_on_button
  485. btst #14,DMACONR(a6)
  486. bne.s delete_on_button
  487. move.l a3,bltapt(a6)
  488. move.l a2,bltdpt(a6)
  489. move.l a2,bltbpt(a6)
  490. move.w d0,bltdmod(a6)
  491. move.w d0,bltbmod(a6)
  492. move.w #-2,bltamod(a6)
  493. move.w d1,bltcon0(a6)
  494. clr.w bltcon1(a6)
  495. move.l #$ffff0000,bltafwm(a6)
  496. move.w d3,bltsize(a6)
  497. add.l d6,a3
  498. moveq #0,d7
  499. move.w screen_x_size(a4),d7
  500. asr.w #3,d7
  501. mulu screen_y_size(a4),d7
  502. add.l d7,a2
  503. dbra d4,delete_on_button
  504. delete_next_button
  505. addq.l #4,a0
  506. bra delete_buttons_loop
  507. quit_delete_buttons
  508. move.l #$ffffffff,button_delete_list
  509. move.l #button_delete_list,button_delete_ptr
  510. ifnd hard_only
  511. bsr disown_the_blitter
  512. endc
  513. rts
  514. **************************************
  515. ***** DISPLAY BUTTON *****
  516. **************************************
  517. display_button
  518. *send button pointer in a0
  519. movem.l a0-a3/d0/d7,-(sp)
  520. cmp.w #99,button_counter
  521. beq.s no_more_buttons_available
  522. move.l button_head_ptr,a1
  523. move.l button_draw_ptr,a2
  524. move.b button_start(a0),d7
  525. move.b d7,button_clicked(a0) ;reset
  526. move.l window_list_ptr,a3
  527. move.l -(a3),button_window(a0)
  528. move.l a0,(a1)+
  529. move.l a0,(a2)+
  530. move.l #$ffffffff,(a2)
  531. move.l #$ffffffff,(a1)
  532. move.l a2,button_draw_ptr
  533. move.l a1,button_head_ptr
  534. add.w #1,button_counter
  535. moveq #0,d0
  536. bra.s quit_display_button
  537. no_more_buttons_available
  538. moveq #-1,d0
  539. quit_display_button
  540. movem.l (sp)+,a0-a3/d0/d7
  541. rts
  542. **************************************
  543. ***** REMOVE BUTTON *****
  544. **************************************
  545. remove_button
  546. *send button in a0
  547. movem.l a0-a4/d0,-(sp)
  548. moveq #-1,d0
  549. move.l #button_list,a1
  550. move.l a1,a2
  551. check_for_button
  552. cmp.l #$ffffffff,(a1)
  553. beq.s quit_remove_button
  554. cmp.l (a1),a0
  555. beq.s found_button
  556. move.l (a1)+,(a2)+
  557. bra.s check_for_button
  558. found_button
  559. move.l button_delete_ptr,a4
  560. cmp.b #1,button_clicked(a0)
  561. beq.s set_to_zero
  562. move.b #1,button_clicked(a0)
  563. bra.s move_into_delete
  564. set_to_zero
  565. move.b #0,button_clicked(a0)
  566. move_into_delete
  567. move.l a0,(a4)+
  568. move.l #$ffffffff,(a4)
  569. move.l a4,button_delete_ptr
  570. moveq #0,d0 ;found ok
  571. sub.w #1,button_counter
  572. addq.l #4,a1
  573. bra.s check_for_button
  574. quit_remove_button
  575. move.l #-1,(a2)
  576. move.l a2,button_head_ptr
  577. movem.l (sp)+,a0-a4/d0
  578. rts
  579. **************************************
  580. ***** DISPLAY BUTTON LIST *****
  581. **************************************
  582. display_button_list
  583. *list in a0
  584. movem.l d0-d7/a1-a6,-(sp)
  585. move.l a0,a1
  586. insert_loop
  587. move.l (a1)+,a0
  588. cmp.l #$ffffffff,a0
  589. beq.s done_all_list
  590. bsr display_button
  591. bra.s insert_loop
  592. done_all_list
  593. movem.l (sp)+,d0-d7/a1-a6
  594. rts
  595. **************************************
  596. ***** REMOVE BUTTON LIST *****
  597. **************************************
  598. remove_button_list
  599. *list in a0
  600. movem.l d0-d7/a1-a6,-(sp)
  601. move.l a0,a1
  602. insert_loop2
  603. move.l (a1)+,a0
  604. cmp.l #$ffffffff,a0
  605. beq.s done_all_remove_list
  606. bsr remove_button
  607. bra.s insert_loop2
  608. done_all_remove_list
  609. movem.l (sp)+,d0-d7/a1-a6
  610. rts
  611. Force_Buttons
  612. bsr delete_buttons
  613. bsr draw_buttons
  614. rts
  615. *button details
  616. FIRST_ROW equ 0
  617. SECOND_ROW equ 16
  618. THIRD_ROW equ 32
  619. FOURTH_ROW equ 48
  620. BUTTON_1 equ 0
  621. BUTTON_2 equ 112
  622. BUTTON_3 equ 224
  623. BUTTON_4 equ 336
  624. BUTTON_5 equ 448
  625. MAIN_BUTTON_SCREEN equ 0
  626. WINDOW equ 1
  627. MAIN_SCREEN equ 2
  628. BUTTON_HOLD_WAIT EQU 10
  629. **************B U T T O N S T R U C T U R E *****************
  630. rsreset
  631. button_x rs.w 1
  632. button_y rs.w 1
  633. frame_type rs.w 1 ;specifies which buttons to search through
  634. button_type rs.b 1 ;0- standard, 1-custon
  635. button_start rs.b 1 ;0 or 1, 1 = down already
  636. button_data rs.b 1 ;associated button data
  637. button_clicked rs.b 1
  638. button_custom rs.l 1 ;if custom = pointer to custom struct
  639. button_window rs.l 1 ;if custom not required
  640. button_proc rs.l 1
  641. button_text rs.b 1 ;not if custom
  642. even
  643. **************C U S T O M B U T T O N S T R U C T U R E *****************
  644. rsreset
  645. custom_button_width rs.w 1
  646. custom_button_height rs.w 1
  647. custom_button_x_size rs.w 1
  648. custom_button_y_size rs.w 1
  649. custom_planes rs.w 1
  650. custom_button_graphics rs.l 1
  651. custom_button_click_graphics rs.l 1
  652. current_frame
  653. dc.w 0
  654. mouse_button_ind
  655. dc.w 0
  656. clicked_button
  657. dc.l 0
  658. button_list
  659. ds.l 100
  660. button_draw_list
  661. ds.l 100
  662. button_delete_list
  663. ds.l 100
  664. button_head_ptr
  665. dc.l button_list
  666. button_draw_ptr
  667. dc.l button_draw_list
  668. button_delete_ptr
  669. dc.l button_delete_list
  670. button_wait_counter
  671. dc.w BUTTON_HOLD_WAIT
  672. button_counter
  673. dc.w 0