home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_24_1988_Transactor_Publishing.d64 / geosdemo_mads < prev    next >
Text File  |  2023-02-26  |  9KB  |  625 lines

  1. ;
  2. ;put"geosdemo/mads"
  3. ;
  4. ;f.g.kostella 12/10/87
  5. ;
  6. * = $0304
  7. ;
  8. ;zpage pseudoregisters
  9. ;
  10. r0 = $02
  11. r0l = $02
  12. r0h = $03
  13. r1 = $04
  14. r1l = $04
  15. r1h = $05
  16. r11 = $18
  17. r11l = $18
  18. r11h = $19
  19. ;
  20. ;geos routines
  21. ;
  22. domenu = $c151
  23. redomenu = $c193
  24. dopreviousme = $c190 ;dopreviousmenu
  25. gotofirstmen = $c1bd ;gotofirstmenu
  26. drawline = $c130
  27. setpattern = $c139
  28. drawpoint = $c133
  29. rectangle = $c124
  30. i.rectangle = $c19f
  31. framerectang = $c127 ;framerectangle
  32. i.framerecta = $c1a2 ;i.framerectangle
  33. bitmapup = $c124
  34. i.bitmapup = $c1ab
  35. doicons = $c15a
  36. dodlgbox = $c256
  37. rstrfrmdialo = $c2bf ;rstrfrmdialog
  38. putstring = $c148
  39. i.putstring = $c1ae
  40. putdecimal = $c184
  41. enterdesktop = $c22c
  42. ;
  43. stringfaultv = $84ab ;stringfaultvector
  44. sysdbdata = $851d
  45. ;
  46. ;------------------------------
  47. ;header block starts at $0304
  48. ;ram based assemblers may need
  49. ;to change start address.
  50. ;------------------------------
  51. ;-assemble the header block here-
  52. ;            -note-
  53. ;1st 4 bytes commented out here
  54. ;they will be placed in the
  55. ;geos file header by "maketogeos"
  56. ;.byte 0,255 ; 1 sector
  57. ;.byte 3,21  ; 3x21 icon
  58. ;--------------------------------
  59. ;define icon to appear on desk top
  60. .byte $bf ;$80 (straight bitmap) + 63 data bytes
  61. .byte %11111111,%11111111,%11111000
  62. .byte %10000000,%00000000,%00001000
  63. .byte %10000000,%00000000,%00001000
  64. .byte %10011101,%11011101,%11001111
  65. .byte %10001001,%00010000,%10001111
  66. .byte %10001001,%11001000,%10001111
  67. .byte %10001001,%00000100,%10001111
  68. .byte %10001001,%11011100,%10001111
  69. .byte %10000000,%00000000,%00001111
  70. .byte %10000000,%00000000,%00001111
  71. .byte %10011101,%11010001,%11001111
  72. .byte %10010000,%10010001,%00001111
  73. .byte %10011100,%10010001,%11001111
  74. .byte %10010000,%10010001,%00001111
  75. .byte %10010001,%11011101,%11001111
  76. .byte %10000000,%00000000,%00001111
  77. .byte %10000000,%00000000,%00001111
  78. .byte %11111111,%11111111,%11111111
  79. .byte %00011111,%11111111,%11111111
  80. .byte %00011111,%11111111,%11111111
  81. .byte %00011111,%11111111,%11111111
  82. ;
  83. .byte $83 ;c64 filetype usr
  84. .byte 6 ;application
  85. .byte 0 ;geos seq file
  86. ;
  87. .word startaddress ;load start addr
  88. .word endofcode ;load end addr
  89. .word startjump ;start addr jump
  90. ;
  91. .byte 'filename    v1.1' ;perm name string
  92. .byte 0,0,0,0 ;
  93. .byte 'author name     '
  94. ;
  95. ;the rest of the header block
  96. ;is not used in this file
  97. ;
  98. ; ------------------------------
  99. ;ram based assemblers change addr
  100. * =$0400
  101. ; ------------------------------
  102. ;
  103. startaddress =* ;save start
  104. startjump =*
  105. ;
  106. ;   clean screen
  107. lda #0
  108. jsr setpattern
  109. jsr i.rectangle
  110. .byte 0
  111. .byte 199
  112. .word 0
  113. .word 319
  114. lda #$ff
  115. jsr framerectang
  116. ;
  117. ;1 icon required at all times, so
  118. ;
  119. ldx #<dumbicondata ;dummy until
  120. ldy #>dumbicondata ;we need one
  121. stx r0l
  122. sty r0h
  123. jsr doicons
  124. ;  menus
  125. ldx #<ourmenu
  126. ldy #>ourmenu
  127. stx r0l
  128. sty r0h
  129. lda #1
  130. jsr domenu
  131. ; that's all!, rts to main loop
  132. rts
  133. ;==============================
  134. dumbicondata =*
  135. .byte 1 ;# of icons
  136. .word 319 ;leave mouse x pos,
  137. .byte 199 ;y pos
  138. ;
  139. .word 0 ;icon bitmap addr
  140. .byte 36,1 ;h pos.byte(/8),v pos. pixel
  141. .byte 1,1 ;w+h
  142. .word 0 ;dispatch rtn
  143. ;===============================
  144. ;... menu structure...
  145. ourmenu =*
  146. .byte 0 ;main top
  147. .byte 13 ;main bottom
  148. .word 0 ;main left
  149. .word 80 ;main right
  150. .byte 2 ;horz ($00) or'ed w/ # menu items
  151. ;
  152. .word filemenutext
  153. .byte $80 ;sub menu constant
  154. .word filemenu ;rtn
  155. ;
  156. .word operatetext
  157. .byte $80
  158. .word operatemenu
  159. ;
  160. ;text for main selections
  161. filemenutext .byte 'file'
  162. .byte 0
  163. operatetext .byte 'operations'
  164. .byte 0
  165. ;
  166. ;..submenus...
  167. ;
  168. filemenu =*
  169. .byte 13
  170. .byte 27
  171. .word 0
  172. .word 33
  173. .byte $81 ;vert ored w/ # items
  174. ;
  175. .word filequittext
  176. .byte 0 ;menu action
  177. .word doexit ;rtn
  178. ;
  179. filequittext .byte 'quit'
  180. .byte 0
  181. ;
  182. doexit =*
  183. jmp enterdesktop
  184. ;
  185. operatemenu =*
  186. .byte 13,55 ;top,bot
  187. .word 23,80 ;left,right
  188. .byte $83 ;vertical or'd w/ #
  189. ;
  190. .word op0text
  191. .byte 0 ;menu action
  192. .word op0rtn
  193. ;
  194. .word op1text
  195. .byte 0
  196. .word mover
  197. ;
  198. .word op2text
  199. .byte 0
  200. .word sizer
  201. ;
  202. op0text .byte 'pattern'
  203. .byte 0
  204. op1text .byte 'mover'
  205. .byte 0
  206. op2text .byte 'sizer'
  207. .byte 0
  208. ;-------------------------
  209. ourpattern .word 0
  210. ;
  211. op0rtn =*
  212. jsr gotofirstmen
  213. ;
  214. lda ourpattern
  215. and #%00011111
  216. sta ourpattern
  217. jsr setpattern
  218. jsr i.rectangle
  219. .byte 13
  220. .byte 199
  221. .word 0
  222. .word 319
  223. lda #$ff
  224. jsr framerectang
  225. ;
  226. jsr i.putstring
  227. .word 92
  228. .byte 10
  229. .byte 'pattern:   '
  230. .byte 0
  231. ;
  232. ldx #132
  233. ldy #0
  234. stx r11l
  235. sty r11h
  236. ldy #10
  237. sty r1+1
  238. ldx ourpattern
  239. ldy #0
  240. stx r0
  241. sty r0+1
  242. lda #%11000000
  243. jsr putdecimal
  244. ;
  245. inc ourpattern
  246. rts
  247. ;
  248. ;---------------------------
  249. ;values used to add to pos bytes
  250. dbtop .byte 0
  251. dbbottom .byte 0
  252. dbleft .byte 0
  253. dbright .byte 0
  254. ;=====
  255. mover =*
  256. jsr gotofirstmen
  257. ;
  258. dodbagain =*
  259. jsr clearadder
  260. ldx #<ourdbtable
  261. ldy #>ourdbtable
  262. stx r0l
  263. sty r0h
  264. jsr dodlgbox
  265. lda r0 ;returned by db
  266. bmi doourrtns
  267. ;  its 'ok'
  268. rts
  269. ;
  270. doourrtns =*
  271. cmp #$82
  272. bcs ourrtns1
  273. lda #2
  274. sta dbtop
  275. sta dbbottom
  276. jsr dbsubtract
  277. jmp ourrtns4
  278. ;
  279. ourrtns1 =*
  280. cmp #$83
  281. bcs ourrtns2
  282. lda #2
  283. sta dbleft
  284. sta dbright
  285. jsr dbsubtract
  286. jmp ourrtns4
  287. ;
  288. ourrtns2 =*
  289. cmp #$84
  290. bcs ourrtns3
  291. lda #2
  292. sta dbtop
  293. sta dbbottom
  294. jsr dbadd
  295. jmp ourrtns4
  296. ;
  297. ourrtns3 =*
  298. lda #2
  299. sta dbleft
  300. sta dbright
  301. jsr dbadd
  302. ;
  303. ourrtns4 =*
  304. jsr displayvals
  305. jmp dodbagain
  306. ;
  307. ;-----------------------------
  308. ;use the same db, process
  309. ;the results differently
  310. ;
  311. sizer =*
  312. jsr gotofirstmen
  313. ;
  314. dodbagainz =*
  315. jsr clearadder
  316. ldx #<ourdbtable
  317. ldy #>ourdbtable
  318. stx r0l
  319. sty r0h
  320. jsr dodlgbox
  321. lda r0 ;returned by db
  322. bmi doourrtnsz
  323. rts
  324. ;
  325. doourrtnsz =*
  326. cmp #$82
  327. bcs ourrtns1z
  328. lda #2
  329. sta dbtop
  330. jsr dbsubtract
  331. jsr clearadder
  332. lda #2
  333. sta dbbottom
  334. jsr dbadd
  335. jmp ourrtns4z
  336. ;
  337. ourrtns1z =*
  338. cmp #$83
  339. bcs ourrtns2z
  340. lda #2
  341. sta dbleft
  342. jsr dbsubtract
  343. jsr clearadder
  344. lda #2
  345. sta dbright
  346. jsr dbadd
  347. jmp ourrtns4z
  348. ;
  349. ourrtns2z =*
  350. cmp #$84
  351. bcs ourrtns3z
  352. lda #2
  353. sta dbtop
  354. jsr dbadd
  355. jsr clearadder
  356. lda #2
  357. sta dbbottom
  358. jsr dbsubtract
  359. jmp ourrtns4z
  360. ;
  361. ourrtns3z =*
  362. lda #2
  363. sta dbleft
  364. jsr dbadd
  365. jsr clearadder
  366. lda #2
  367. sta dbright
  368. jsr dbsubtract
  369. ;
  370. ourrtns4z =*
  371. jsr displayvals
  372. jmp dodbagainz
  373. ;
  374. ;----------db subs--------------
  375. ;
  376. clearadder =*
  377. lda #0
  378. sta dbtop
  379. sta dbbottom
  380. sta dbleft
  381. sta dbright
  382. rts
  383. ;
  384. dbsubtract =*
  385. sec
  386. lda ourdbtable+1 ;top of db
  387. sbc dbtop
  388. sta ourdbtable+1
  389. sec
  390. lda ourdbtable+2 ;bot of db
  391. sbc dbbottom
  392. sta ourdbtable+2
  393. sec
  394. lda ourdbtable+3 ;left of db
  395. sbc dbleft
  396. sta ourdbtable+3
  397. lda ourdbtable+4
  398. sbc #0
  399. sta ourdbtable+4
  400. sec
  401. lda ourdbtable+5 ;rightt of db
  402. sbc dbright
  403. sta ourdbtable+5
  404. lda ourdbtable+6
  405. sbc #0
  406. sta ourdbtable+6
  407. rts
  408. ;
  409. dbadd =*
  410. clc
  411. lda ourdbtable+1 ;top of db
  412. adc dbtop
  413. sta ourdbtable+1
  414. clc
  415. lda ourdbtable+2 ;bot of db
  416. adc dbbottom
  417. sta ourdbtable+2
  418. clc
  419. lda ourdbtable+3 ;left of db
  420. adc dbleft
  421. sta ourdbtable+3
  422. lda ourdbtable+4
  423. adc #0
  424. sta ourdbtable+4
  425. clc
  426. lda ourdbtable+5 ;rightt of db
  427. adc dbright
  428. sta ourdbtable+5
  429. lda ourdbtable+6
  430. adc #0
  431. sta ourdbtable+6
  432. rts
  433. ;
  434. ;
  435. displayvals =*
  436. ;
  437. lda #0
  438. jsr setpattern
  439. jsr i.rectangle
  440. .byte 1
  441. .byte 11
  442. .word 239
  443. .word 318
  444. ;
  445. ldx #210
  446. ldy #0
  447. stx r11l
  448. sty r11h
  449. ldy #10
  450. sty r1h
  451. ldx ourdbtable+1
  452. ldy #0
  453. stx r0l
  454. sty r0h
  455. lda #%11000000
  456. jsr putdecimal
  457. ;
  458. ldx #235
  459. ldy #0
  460. stx r11l
  461. sty r11h
  462. ldx ourdbtable+2
  463. ldy #0
  464. stx r0
  465. sty r0h
  466. lda #%11000000
  467. jsr putdecimal
  468. ;
  469. ldx #4
  470. ldy #1
  471. stx r11l
  472. sty r11h
  473. ldx ourdbtable+3
  474. ldy ourdbtable+4
  475. stx r0
  476. sty r0h
  477. lda #%11000000
  478. jsr putdecimal
  479. ;
  480. ldx #29
  481. ldy #1
  482. stx r11l
  483. sty r11h
  484. ldx ourdbtable+5
  485. ldy ourdbtable+6
  486. stx r0
  487. sty r0h
  488. lda #%11000000
  489. jsr putdecimal
  490. rts
  491. ;------------------------------
  492. ourdbtable =*
  493. ;
  494. .byte $01 ;pos/shadow patrn
  495. ;
  496. .byte 50 ;top
  497. .byte 86 ;bott
  498. .word 48 ;left
  499. .word 120 ;right
  500. ;
  501. .byte 1 ;ok
  502. .byte 1 ;x byt
  503. .byte 16 ;y pixel
  504. ;
  505. .byte $12 ;user icon
  506. .byte 1 ;x offset
  507. .byte 4 ;y offset
  508. .word dbicon1 ;addr of icon table
  509. ;
  510. .byte $12
  511. .byte 3,4
  512. .word dbicon2
  513. ;
  514. .byte $12
  515. .byte 5,4
  516. .word dbicon3
  517. ;
  518. .byte $12
  519. .byte 7,4
  520. .word dbicon4
  521. ;
  522. .byte 0 ;end
  523. ;--------------------------
  524. ;db user icon tables, graphics
  525. ;& service routines for mover
  526. ;
  527. dbicon1 =*
  528. .word dbi1bitmap ;addr of picture data
  529. .byte 0,0 ;x,y-already set!
  530. .byte 1 ;bytes wide
  531. .byte 8 ;pixels hi
  532. .word dbi1rtn ;addr of svc rtn
  533. ;
  534. dbi1bitmap =*
  535. ;
  536. .byte $88 ;format 2, use the next 8 bytes
  537. .byte %11111111
  538. .byte %11100111
  539. .byte %11000011
  540. .byte %10000001
  541. .byte %11100111
  542. .byte %11100111
  543. .byte %11100111
  544. .byte %11111111
  545. ;
  546. dbi1rtn =*
  547. ;
  548. lda #$81
  549. sta sysdbdata
  550. ;  and get out
  551. jmp rstrfrmdialo
  552. ; -------------------------
  553. dbicon2 =*
  554. .word dbi2bitmap
  555. .byte 0,0,1,8
  556. .word dbi2rtn
  557. ;
  558. dbi2bitmap =*
  559. .byte $88
  560. .byte %11111111
  561. .byte %11101111
  562. .byte %11001111
  563. .byte %10000001
  564. .byte %10000001
  565. .byte %11001111
  566. .byte %11101111
  567. .byte %11111111
  568. ;
  569. dbi2rtn =*
  570. lda #$82
  571. sta sysdbdata
  572. jmp rstrfrmdialo
  573. ;
  574. ;
  575. dbicon3 =*
  576. .word dbi3bitmap
  577. .byte 0,0,1,8
  578. .word dbi3rtn
  579. ;
  580. dbi3bitmap =*
  581. .byte $88
  582. .byte %11111111
  583. .byte %11100111
  584. .byte %11100111
  585. .byte %11100111
  586. .byte %10000001
  587. .byte %11000011
  588. .byte %11100111
  589. .byte %11111111
  590. ;
  591. dbi3rtn =*
  592. ;
  593. lda #$83
  594. sta sysdbdata
  595. jmp rstrfrmdialo
  596. ; -------------------------
  597. ;
  598. ;
  599. dbicon4 =*
  600. .word dbi4bitmap
  601. .byte 0,0,1,8
  602. .word dbi4rtn
  603. ;
  604. dbi4bitmap =*
  605. ;
  606. .byte $88
  607. .byte %11111111
  608. .byte %11110111
  609. .byte %11110011
  610. .byte %10000001
  611. .byte %10000001
  612. .byte %11110011
  613. .byte %11110111
  614. .byte %11111111
  615. ;
  616. dbi4rtn =*
  617. lda #$84
  618. sta sysdbdata
  619. jmp rstrfrmdialo
  620. ;
  621. endofcode =*
  622. .end
  623. ;
  624. thats all folks!!
  625.