mapsetup.s 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. ***********************************
  2. **** DISPLAY SETUP WINDOW ****
  3. ***********************************
  4. display_setup_window
  5. bsr set_original_colours
  6. move.l current_map_ptr,a1
  7. move.l (a1),map_backup_details
  8. move.l 4(a1),map_backup_details+4
  9. move.w 8(a1),map_backup_details+8
  10. move.l #map_block_type8,a0
  11. move.b #0,button_start(a0)
  12. move.l #map_block_type16,a0
  13. move.b #0,button_start(a0)
  14. move.l #map_block_type32,a0
  15. move.b #0,button_start(a0)
  16. move.l #data_sizeb,a0
  17. move.b #0,button_start(a0)
  18. move.l #data_sizew,a0
  19. move.b #0,button_start(a0)
  20. cmp.w #0,Map_Datasize(a1)
  21. bne.s sized_is_word
  22. move.l #data_sizeb,a0
  23. move.b #1,button_start(a0)
  24. bra.s check_block_butts
  25. sized_is_word
  26. move.l #data_sizew,a0
  27. move.b #1,button_start(a0)
  28. check_block_butts
  29. cmp.w #8,Map_Block_size(a1)
  30. bne.s not_block_8
  31. move.l #map_block_type8,a0
  32. move.b #1,button_start(a0)
  33. bra.s set_up_no_planes
  34. not_block_8
  35. cmp.w #16,Map_Block_Size(a1)
  36. bne.s not_block_16
  37. move.l #map_block_type16,a0
  38. move.b #1,button_start(a0)
  39. bra.s set_up_no_planes
  40. not_block_16
  41. move.l #map_block_type32,a0
  42. move.b #1,button_start(a0)
  43. *put tick into planes box
  44. set_up_no_planes
  45. move.b #0,map_planes1+button_start ;init buttons
  46. move.b #0,map_planes2+button_start
  47. move.b #0,map_planes3+button_start
  48. move.b #0,map_planes4+button_start
  49. move.b #0,map_planes5+button_start
  50. move.b #0,map_planes6+button_start
  51. move.b #0,map_planes7+button_start
  52. move.b #0,map_planes8+button_start
  53. move.w map_planes(a1),d0
  54. subq.w #1,d0
  55. asl.w #2,d0
  56. move.l #map_plane_ticks,a0
  57. move.l (a0,d0),a0
  58. move.b #1,button_start(a0)
  59. move.l #Setup_Request_Window,a0
  60. bsr create_window
  61. move.l #Setup_Request_Window,a0 ; write in filename
  62. move.l #setupstr1,a1
  63. move.w #2,d2
  64. move.w #6,d0
  65. move.w #6,d1
  66. bsr Write_Text
  67. bsr display_map_sizes
  68. move.l #setup_buttons,a0
  69. bsr display_button_list
  70. rts
  71. ***********************************
  72. **** REMOVE SETUP WINDOW ****
  73. ***********************************
  74. remove_setup_window
  75. move.l #setup_buttons,a0
  76. bsr remove_button_list
  77. move.l #Setup_Request_Window,a0
  78. bsr destroy_window
  79. bsr set_current_page_colours
  80. rts
  81. ***********************************
  82. **** CHANGE MAP SETUP ****
  83. ***********************************
  84. change_map_setup
  85. bsr remove_setup_window
  86. bsr convert_new_map
  87. rts
  88. ***********************************
  89. **** CANCEL SETUP WINDOW ****
  90. ***********************************
  91. cancel_setup_window
  92. bsr remove_setup_window
  93. move.l current_map_ptr,a1
  94. move.l map_backup_details,(a1)
  95. move.l map_backup_details+4,4(a1)
  96. move.w map_backup_details+8,8(a1)
  97. rts
  98. ***********************************
  99. **** DISPLAY MAP SIZES ****
  100. ***********************************
  101. display_map_sizes
  102. move.l #Setup_Request_Window,a0 ; write in filename
  103. move.w #2,d2
  104. move.w #116,d0
  105. move.w #51,d1
  106. move.l current_map_ptr,a1
  107. move.w Map_XSize(a1),d3
  108. move.w #1,d4
  109. bsr Write_num
  110. move.l #Setup_Request_Window,a0 ; write in filename
  111. move.w #2,d2
  112. move.w #116,d0
  113. move.w #71,d1
  114. move.l current_map_ptr,a1
  115. move.w Map_ySize(a1),d3
  116. move.w #1,d4
  117. bsr Write_num
  118. rts
  119. ***********************************
  120. **** DELETE MAP SIZES ****
  121. ***********************************
  122. delete_map_sizes
  123. move.l #Setup_Request_Window,a0 ; write in filename
  124. move.w #2,d2
  125. move.w #116,d0
  126. move.w #51,d1
  127. move.l current_map_ptr,a1
  128. move.w Map_XSize(a1),d3
  129. move.w #0,d4
  130. bsr Write_num
  131. move.l #Setup_Request_Window,a0 ; write in filename
  132. move.w #2,d2
  133. move.w #116,d0
  134. move.w #71,d1
  135. move.l current_map_ptr,a1
  136. move.w Map_ySize(a1),d3
  137. move.w #0,d4
  138. bsr Write_num
  139. rts
  140. ***********************************
  141. **** UP X ROUTINE ****
  142. ***********************************
  143. up_x_routine
  144. bsr delete_map_sizes
  145. move.l current_map_ptr,a0
  146. cmp.w #10000,map_xsize(a0)
  147. beq.s no_change_x
  148. addq.w #1,map_xsize(a0)
  149. no_change_x
  150. bsr display_map_sizes
  151. rts
  152. ***********************************
  153. **** UP Y ROUTINE ****
  154. ***********************************
  155. up_y_routine
  156. bsr delete_map_sizes
  157. move.l current_map_ptr,a0
  158. cmp.w #10000,map_ysize(a0)
  159. beq.s no_change_y
  160. addq.w #1,map_ysize(a0)
  161. no_change_y
  162. bsr display_map_sizes
  163. rts
  164. ***********************************
  165. **** DOWN X ROUTINE ****
  166. ***********************************
  167. down_x_routine
  168. bsr delete_map_sizes
  169. move.l current_map_ptr,a0
  170. cmp.w #1,map_xsize(a0)
  171. beq.s no_change_xd
  172. subq.w #1,map_xsize(a0)
  173. no_change_xd
  174. bsr display_map_sizes
  175. rts
  176. ***********************************
  177. **** DOWN Y ROUTINE ****
  178. ***********************************
  179. down_y_routine
  180. bsr delete_map_sizes
  181. move.l current_map_ptr,a0
  182. cmp.w #1,map_ysize(a0)
  183. beq.s no_change_yd
  184. subq.w #1,map_ysize(a0)
  185. no_change_yd
  186. bsr display_map_sizes
  187. rts
  188. ***********************************
  189. **** CHANGE PLANES ****
  190. ***********************************
  191. change_planes
  192. move.l clicked_button,a0
  193. move.l current_map_ptr,a2
  194. moveq #0,d0
  195. move.b button_data(a0),d0
  196. move.w map_planes(a2),d1
  197. move.l #map_plane_ticks,a1
  198. subq.w #1,d1
  199. asl.w #2,d1
  200. move.l (a1,d1.w),a0
  201. cmp.w map_planes(a2),d0
  202. bne.s no_reset_planes
  203. move.b #DEPRESSED,button_start(a0)
  204. bra.s redisplay_buttons
  205. no_reset_planes
  206. move.b #NOT_DEPRESSED,button_start(a0)
  207. move.w d0,map_planes(a2)
  208. redisplay_buttons
  209. bsr remove_button
  210. bsr display_button
  211. no_change_planes
  212. rts
  213. ***********************************
  214. **** CHANGE BLOCK SIZE ****
  215. ***********************************
  216. change_block_size
  217. move.l clicked_button,a0
  218. moveq #0,d0
  219. move.b button_data(a0),d0
  220. move.l current_map_ptr,a1
  221. cmp.w map_block_size(a1),d0
  222. bne.s no_reset_same_button
  223. cmp.w #8,d0
  224. bne.s rcheck16
  225. move.l #map_block_type8,a0
  226. move.b #DEPRESSED,button_start(a0)
  227. bra.s show_block_button
  228. rcheck16
  229. cmp.w #16,d0
  230. bne.s rcheck32
  231. move.l #map_block_type16,a0
  232. move.b #DEPRESSED,button_start(a0)
  233. bra.s show_block_button
  234. rcheck32
  235. move.l #map_block_type32,a0
  236. move.b #DEPRESSED,button_start(a0)
  237. bra.s show_block_button
  238. no_reset_same_button
  239. cmp.w #8,map_block_size(a1)
  240. bne.s check16
  241. move.l #map_block_type8,a0
  242. move.b #NOT_DEPRESSED,button_start(a0)
  243. bra.s show_block_button
  244. check16
  245. cmp.w #16,map_block_size(a1)
  246. bne.s check32
  247. move.l #map_block_type16,a0
  248. move.b #NOT_DEPRESSED,button_start(a0)
  249. bra.s show_block_button
  250. check32
  251. move.l #map_block_type32,a0
  252. move.b #NOT_DEPRESSED,button_start(a0)
  253. show_block_button
  254. bsr remove_button
  255. bsr display_button
  256. move.w d0,map_block_size(a1)
  257. rts
  258. ***********************************
  259. **** CHANGE DATA SIZE ****
  260. ***********************************
  261. change_DATA_size
  262. move.l clicked_button,a0
  263. moveq #0,d0
  264. move.b button_data(a0),d0
  265. move.l current_map_ptr,a1
  266. cmp.w map_datasize(a1),d0
  267. bne.s no_reset_size_button
  268. cmp.w #0,d0
  269. bne.s rcheckw
  270. move.l #data_sizeb,a0
  271. move.b #DEPRESSED,button_start(a0)
  272. bra.s show_size_button
  273. rcheckw
  274. cmp.w #1,d0
  275. bne.s show_size_button
  276. move.l #data_sizew,a0
  277. move.b #DEPRESSED,button_start(a0)
  278. bra.s show_size_button
  279. no_reset_size_button
  280. cmp.w #0,map_datasize(a1)
  281. bne.s checkw
  282. move.l #data_sizeb,a0
  283. move.b #NOT_DEPRESSED,button_start(a0)
  284. bra.s show_size_button
  285. checkw
  286. cmp.w #1,map_datasize(a1)
  287. bne.s show_size_button
  288. move.l #data_sizew,a0
  289. move.b #NOT_DEPRESSED,button_start(a0)
  290. show_size_button
  291. bsr remove_button
  292. bsr display_button
  293. move.w d0,map_datasize(a1)
  294. rts
  295. rsreset
  296. Map_Block_Size rs.w 1
  297. Map_XSize rs.w 1
  298. Map_YSize rs.w 1
  299. Map_Planes rs.w 1
  300. Map_DataSize rs.w 1
  301. Map_Mem rs.l 1
  302. Map_Alien_Mem rs.l 1
  303. Map_allocdatasize rs.w 1
  304. Map_allocx rs.w 1
  305. Map_allocy rs.w 1
  306. Map_X_Val rs.w 1
  307. Map_Y_Val rs.w 1
  308. map_Details
  309. dc.w 16
  310. dc.w 20
  311. dc.w 16
  312. dc.w 4
  313. dc.w 0
  314. dc.l 0
  315. dc.l 0
  316. dc.w 0
  317. dc.w 0
  318. dc.w 0
  319. dc.w 0
  320. dc.w 0
  321. Map_Details2
  322. dc.w 16
  323. dc.w 20
  324. dc.w 16
  325. dc.w 4
  326. dc.w 0
  327. dc.l 0
  328. dc.l 0
  329. dc.w 0
  330. dc.w 0
  331. dc.w 0
  332. dc.w 0
  333. dc.w 0
  334. map_backup_details
  335. ds.w 5
  336. current_map_ptr dc.l map_details
  337. setupstr1 dc.b -2,10,"Block Size 8",$a
  338. dc.b " 16",$a
  339. dc.b " 32",$a,$a
  340. dc.b "Map X Size ",$a,$a
  341. dc.b "Map Y Size ",$a
  342. dc.b $a
  343. dc.b "No. Of Planes 1 2",$a
  344. dc.b " 3 4",$a
  345. dc.b " 5 6",$a
  346. dc.b " 7 8",$a
  347. dc.b " Data Size B",$a
  348. dc.b " W"
  349. dc.b 0
  350. EVEN
  351. Setup_Request_Window
  352. dc.w 240
  353. dc.w 191
  354. dc.w 40
  355. dc.w 0
  356. dc.l 0
  357. dc.l 0
  358. dc.b "MAP SETUP",0
  359. even
  360. setup_buttons
  361. dc.l setup_ok_button,setup_cancel_button
  362. dc.l mapx_up_button,mapx_down_button
  363. dc.l mapy_up_button,mapy_down_button
  364. map_block_ticks
  365. dc.l map_block_type8,map_block_type16
  366. dc.l map_block_type32
  367. map_plane_ticks
  368. dc.l map_planes1,map_planes2,map_planes3
  369. dc.l map_planes4,map_planes5,map_planes6
  370. dc.l map_planes7,map_planes8
  371. dc.l data_sizeb,data_sizew,-1
  372. setup_Ok_Button
  373. dc.w 32
  374. dc.w 135+26
  375. dc.w WINDOW ;frame type
  376. dc.b CUSTOM_BUTTON ;standard
  377. dc.b NOT_DEPRESSED
  378. dc.b 0
  379. dc.b 0 ;not used
  380. dc.l ok_custom_button
  381. dc.l 0 ;not used
  382. dc.l change_map_setup
  383. dc.b 0
  384. even
  385. setup_cancel_Button
  386. dc.w 32+80
  387. dc.w 135+26
  388. dc.w WINDOW ;frame type
  389. dc.b CUSTOM_BUTTON ;standard
  390. dc.b NOT_DEPRESSED
  391. dc.b 0
  392. dc.b 0 ;not used
  393. dc.l cancel_custom_button
  394. dc.l 0 ;not used
  395. dc.l cancel_setup_window
  396. dc.b 0
  397. even
  398. mapx_Up_Button
  399. dc.w 136+30
  400. dc.w 50
  401. dc.w WINDOW ;frame type
  402. dc.b CUSTOM_BUTTON+HOLD_BUTTON ;standard
  403. dc.b NOT_DEPRESSED
  404. dc.b 0
  405. dc.b 0 ;not used
  406. dc.l arrow_up
  407. dc.l 0 ;not used
  408. dc.l up_x_routine
  409. dc.b 0
  410. EVEN
  411. mapx_down_Button
  412. dc.w 136+48
  413. dc.w 50
  414. dc.w WINDOW ;frame type
  415. dc.b CUSTOM_BUTTON+HOLD_BUTTON ;standard
  416. dc.b NOT_DEPRESSED
  417. dc.b 0
  418. dc.b 0 ;not used
  419. dc.l arrow_down
  420. dc.l 0 ;not used
  421. dc.l down_x_routine
  422. dc.b 0
  423. EVEN
  424. mapy_Up_Button
  425. dc.w 136+30
  426. dc.w 70
  427. dc.w WINDOW ;frame type
  428. dc.b CUSTOM_BUTTON+HOLD_BUTTON ;standard
  429. dc.b NOT_DEPRESSED
  430. dc.b 0
  431. dc.b 0 ;not used
  432. dc.l arrow_up
  433. dc.l 0 ;not used
  434. dc.l up_y_routine
  435. dc.b 0
  436. EVEN
  437. mapy_down_Button
  438. dc.w 136+48
  439. dc.w 70
  440. dc.w WINDOW ;frame type
  441. dc.b CUSTOM_BUTTON+HOLD_BUTTON ;standard
  442. dc.b NOT_DEPRESSED
  443. dc.b 0
  444. dc.b 0 ;not used
  445. dc.l arrow_down
  446. dc.l 0 ;not used
  447. dc.l down_y_routine
  448. dc.b 0
  449. EVEN
  450. map_block_type8
  451. dc.w 158
  452. dc.w 6
  453. dc.w WINDOW ;frame type
  454. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  455. dc.b NOT_DEPRESSED
  456. dc.b 8
  457. dc.b 0 ;not used
  458. dc.l tick_box_button ;not used
  459. dc.l 0 ;not used
  460. dc.l change_block_size
  461. dc.b 0
  462. EVEN
  463. map_block_type16
  464. dc.w 158
  465. dc.w 6+11
  466. dc.w WINDOW ;frame type
  467. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  468. dc.b NOT_DEPRESSED
  469. dc.b 16
  470. dc.b 0 ;not used
  471. dc.l tick_box_button ;not used
  472. dc.l 0 ;not used
  473. dc.l change_block_size
  474. dc.b 0
  475. EVEN
  476. map_block_type32
  477. dc.w 158
  478. dc.w 6+22
  479. dc.w WINDOW ;frame type
  480. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  481. dc.b NOT_DEPRESSED
  482. dc.b 32
  483. dc.b 0 ;not used
  484. dc.l tick_box_button ;not used
  485. dc.l 0 ;not used
  486. dc.l change_block_size
  487. dc.b 0
  488. EVEN
  489. map_planes1
  490. dc.w 158
  491. dc.w 84+11
  492. dc.w WINDOW ;frame type
  493. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  494. dc.b NOT_DEPRESSED
  495. dc.b 1
  496. dc.b 0 ;not used
  497. dc.l tick_box_button ;not used
  498. dc.l 0 ;not used
  499. dc.l change_planes
  500. dc.b 0
  501. EVEN
  502. map_planes2
  503. dc.w 158+28
  504. dc.w 84+11
  505. dc.w WINDOW ;frame type
  506. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  507. dc.b NOT_DEPRESSED
  508. dc.b 2
  509. dc.b 0 ;not used
  510. dc.l tick_box_button ;not used
  511. dc.l 0 ;not used
  512. dc.l change_planes
  513. dc.b 0
  514. EVEN
  515. map_planes3
  516. dc.w 158
  517. dc.w 84+22
  518. dc.w WINDOW ;frame type
  519. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  520. dc.b NOT_DEPRESSED
  521. dc.b 3
  522. dc.b 0 ;not used
  523. dc.l tick_box_button ;not used
  524. dc.l 0 ;not used
  525. dc.l change_planes
  526. dc.b 0
  527. EVEN
  528. map_planes4
  529. dc.w 158+28
  530. dc.w 84+22
  531. dc.w WINDOW ;frame type
  532. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  533. dc.b NOT_DEPRESSED
  534. dc.b 4
  535. dc.b 0 ;not used
  536. dc.l tick_box_button ;not used
  537. dc.l 0 ;not used
  538. dc.l change_planes
  539. dc.b 0
  540. EVEN
  541. map_planes5
  542. dc.w 158
  543. dc.w 84+33
  544. dc.w WINDOW ;frame type
  545. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  546. dc.b NOT_DEPRESSED
  547. dc.b 5
  548. dc.b 0 ;not used
  549. dc.l tick_box_button ;not used
  550. dc.l 0 ;not used
  551. dc.l change_planes
  552. dc.b 0
  553. EVEN
  554. map_planes6
  555. dc.w 158+28
  556. dc.w 84+33
  557. dc.w WINDOW ;frame type
  558. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  559. dc.b NOT_DEPRESSED
  560. dc.b 6
  561. dc.b 0 ;not used
  562. dc.l tick_box_button ;not used
  563. dc.l 0 ;not used
  564. dc.l change_planes
  565. dc.b 0
  566. EVEN
  567. map_planes7
  568. dc.w 158
  569. dc.w 84+44
  570. dc.w WINDOW ;frame type
  571. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  572. dc.b NOT_DEPRESSED
  573. dc.b 7
  574. dc.b 0 ;not used
  575. dc.l tick_box_button ;not used
  576. dc.l 0 ;not used
  577. dc.l change_planes
  578. dc.b 0
  579. EVEN
  580. map_planes8
  581. dc.w 158+28
  582. dc.w 84+44
  583. dc.w WINDOW ;frame type
  584. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  585. dc.b NOT_DEPRESSED
  586. dc.b 8
  587. dc.b 0 ;not used
  588. dc.l tick_box_button ;not used
  589. dc.l 0 ;not used
  590. dc.l change_planes
  591. dc.b 0
  592. EVEN
  593. data_sizeb
  594. dc.w 158
  595. dc.w 84+55
  596. dc.w WINDOW ;frame type
  597. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  598. dc.b NOT_DEPRESSED
  599. dc.b 0
  600. dc.b 0 ;not used
  601. dc.l tick_box_button ;not used
  602. dc.l 0 ;not used
  603. dc.l change_data_size
  604. dc.b 0
  605. EVEN
  606. data_sizew
  607. dc.w 158
  608. dc.w 84+66
  609. dc.w WINDOW ;frame type
  610. dc.b CUSTOM_BUTTON+TOGGLE_BUTTON
  611. dc.b NOT_DEPRESSED
  612. dc.b 1
  613. dc.b 0 ;not used
  614. dc.l tick_box_button ;not used
  615. dc.l 0 ;not used
  616. dc.l change_data_size
  617. dc.b 0
  618. EVEN