Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.73 KB | None | 0 0
  1. ;===============================================================================
  2. ; Program Information
  3. ;===============================================================================
  4.  
  5. ; Program: Collect2
  6. ; Program by: Darrell Spice, Jr
  7. ; Last Update: May 2, 2015
  8. ;
  9. ; Super simple game of "collect the boxes" used to show how to develop
  10. ; a DPC+ with ARM Atari 2600 homebrew game.
  11. ;
  12. ; See readme.txt for build instructions
  13.  
  14.  
  15.  
  16. ;===============================================================================
  17. ; Change Log
  18. ;===============================================================================
  19.  
  20. ; 2015.03.29 - initial version.
  21. ; 2015.04.04 - "menu" and "game" screens.
  22. ; new ECHO statements, copy/paste output to custom/define_dasm.h
  23. ; to keep 6507 and ARM code in sync with memory usage
  24. ; 2015.04.16 - functional main menu
  25. ; 2015.04.25 - score/timer display, ARM run time diagnostic info
  26. ; 2015.05.02 - beginnings of Arena Kernel
  27.  
  28.  
  29.  
  30. ;===============================================================================
  31. ; Initialize dasm
  32. ;===============================================================================
  33.  
  34. PROCESSOR 6502
  35. include vcs.h
  36. include macro.h
  37. include DPCplus.h
  38.  
  39.  
  40.  
  41. ;===============================================================================
  42. ; Define constants
  43. ;===============================================================================
  44.  
  45. ; which ARM function to run
  46. ARM_INIT = 0
  47. ARM_OS = 1
  48. ARM_VB = 2
  49. ARM_MENU_OS = 3
  50. ARM_MENU_VB = 4
  51.  
  52. ; NTSC color values. ARM code will do on-the-fly conversion for PAL and SECAM
  53. GREY = $00
  54. YELLOW = $10
  55. ORANGE = $20
  56. RED_ORANGE = $30
  57. RED = $40
  58. PURPLE = $50
  59. VIOLET = $60
  60. BLUE = $80
  61. CYAN = $B0
  62. GREEN = $C0
  63. WHITE = $0E
  64. HAIR = $F4
  65. FACE = $4C
  66.  
  67. ; controls spacing in main menu
  68. MM_TITLE_GAP = 25
  69. MM_OPTION_GAP = 20
  70. MM_START_GAP = 20
  71. MM_LOGO_GAP = 25
  72.  
  73. ; aliases for menu kernel
  74. DS_MENU_CONTROL = DF0DATA
  75. DS_TWO_COLORS = DF1DATA
  76. DS_GRP0A = DF2DATA
  77. DS_GRP1A = DF3DATA
  78. DS_GRP0B = DF4DATA
  79. DS_GRP1B = DF5DATA
  80. DS_GRP0C = DF6DATA
  81. DS_GRP1C = DF7DATA
  82.  
  83. ; aliases for score kernel
  84. DS_LEFTSCOREA = DF0DATA
  85. DS_LEFTSCOREB = DF1DATA
  86. DS_TIMERA = DF2DATA
  87. DS_TIMERB = DF3DATA
  88. DS_RIGHTSCOREA = DF4DATA
  89. DS_RIGHTSCOREB = DF5DATA
  90. DS_ST_COLORS = DF6DATA
  91.  
  92. ; aliases for arena kernel
  93. DS_GRP0 = DF0DATA
  94. DS_GRP1 = DF1DATA
  95. DS_COLUP0 = DF2DATA
  96. DS_COLUP1 = DF3DATA
  97. DS_PF0 = DF0FRACDATA
  98. DS_PF1 = DF1FRACDATA
  99. DS_PF2 = DF2FRACDATA
  100.  
  101.  
  102.  
  103.  
  104. ;===============================================================================
  105. ; Define custom Macros
  106. ;===============================================================================
  107.  
  108. MAC BANKS_AND_VECTORS
  109. ; allocate space for the bankswitch hotspots and set the 6502 vectors
  110. RORG $FFF6
  111. SelectBank0 .byte $00
  112. SelectBank1 .byte $00
  113. SelectBank2 .byte $00
  114. SelectBank3 .byte $00
  115. SelectBank4 .byte $00
  116. SelectBank5 .byte $00
  117. ; .word InitSystem ; NMI - overlaps with SelectBank4 and 5
  118. .word InitSystem ; RESET
  119. .word InitSystem ; IRQ
  120. ENDM
  121.  
  122.  
  123. MAC CALL_ARM_CODE
  124. ; saves function to call (passed in Y), controller info, switches, etc.
  125. ; for the ARM code, the runs the specified ARM code
  126. CallArmCode:
  127. ldx #<DS_ToARM
  128. stx DF0LOW
  129. ldx #>DS_ToARM
  130. stx DF0HI
  131. sty DF0WRITE ; Y holds which function to call
  132. ldx SWCHA ; read state of both joysticks
  133. stx DF0WRITE ; save in ARMswcha
  134. ldx SWCHB ; read state of console switches
  135. stx DF0WRITE ; save in ARMswchb
  136. ldx INPT4 ; read state of left joystick firebutton
  137. stx DF0WRITE ; save in ARMinpt4
  138. ldx INPT5 ; read state of right joystick firebutton
  139. stx DF0WRITE ; save in ARMinpt5
  140. ldx TimeLeftVB ; Time remaining in VB (only tracked for game screen)
  141. stx DF0WRITE ; save in ARMvbtime
  142. ldx TimeLeftOS ; Time remaining in OS (only tracked for game screen)
  143. stx DF0WRITE ; save in ARMostime
  144. ldx #$FF
  145. stx CALLFUNCTION ; runs main() in the C code
  146. rts
  147. ENDM
  148.  
  149. MAC POSITION_OBJECT
  150. ; sets X position of any object. X holds which object, A holds position
  151. PosObject: ; A holds X value
  152. sec ; 2
  153. sta WSYNC ; X holds object, 0=P0, 1=P1, 2=M0, 3=M1, 4=Ball
  154. DivideLoop
  155. sbc #15 ; 2
  156. bcs DivideLoop ; 2 4
  157. eor #7 ; 2 6
  158. asl ; 2 8
  159. asl ; 2 10
  160. asl ; 2 12
  161. asl ; 2 14
  162. sta.wx HMP0,X ; 5 19
  163. sta RESP0,X ; 4 23 <- set object position
  164. SLEEP12: rts ; 6 29
  165. ENDM
  166.  
  167.  
  168.  
  169.  
  170. ;===============================================================================
  171. ; Define Zero Page RAM Usage
  172. ;----------------------------------------
  173. ; ZP RAM variables can only be seen by the 6507 CPU.
  174. ; C variables can only be seen by the ARM CPU.
  175. ; The 4K Display Data bank is used for any variables both CPUs need access to.
  176. ;===============================================================================
  177.  
  178. SEG.U VARS
  179. ORG $80
  180. LoopCounter: ds 1
  181. Sleep5: ds 1
  182. TimeLeftOS: ds 1
  183. TimeLeftVB: ds 1
  184. LeftScoreColor: ds 1
  185.  
  186. echo "----",($00FE - *) , "bytes of RAM left (space reserved for 2 byte stack)"
  187.  
  188.  
  189.  
  190.  
  191. ;===============================================================================
  192. ; Define Start of Cartridge
  193. ;----------------------------------------
  194. ; DPC+ cartridges must start with the Harmony/Melody driver. The driver is the
  195. ; ARM code that emulates the DPC+ coprocessor.
  196. ;===============================================================================
  197.  
  198. SEG CODE
  199. ORG $0000
  200.  
  201. HM_DRIVER:
  202. INCBIN DPCplus20121020.arm
  203. ; calculate size as all following ORGs must compensate for the driver size
  204. HM_DRIVER_SIZE = * - HM_DRIVER
  205.  
  206.  
  207.  
  208.  
  209. ;===============================================================================
  210. ; Bank 0 to 3 - ARM user code
  211. ;----------------------------------------
  212. ; The ARM code must start in bank 0 and will grow upward from there.
  213. ; Banks 0 thru 4 may be used for ARM code.
  214. ; DO NOT make space for DPC+ registers as is done in banks for 6507 code.
  215. ;===============================================================================
  216.  
  217. ; the Atari banks of ROM begin *after* the Harmony/Melody driver, so we
  218. ; need to adjust ORG to compensate for the size of the DPC+ driver.
  219. ORG $0000 + HM_DRIVER_SIZE
  220. RORG $0000
  221.  
  222. ; include the custom ARM code. This must be compiled before compiling
  223. ; the 6507 code by executing the MAKE command in the custom directory.
  224. INCBIN custom/bin/custom2.bin
  225.  
  226. ; value used in this echo depends upon how many banks are allocated
  227. ; for the ARM code - $1000 per bank, so $4000 for banks 0-3
  228. echo "------",($4000 - *) , "bytes of ARM stationary data space left"
  229.  
  230.  
  231.  
  232.  
  233. ;===============================================================================
  234. ; Bank 4 - 6507 code
  235. ;----------------------------------------
  236. ; I normally allocate banks 0-4 for ARM code, and just use bank 5 for all the
  237. ; 6507 code, but for this example I'll use bank 4 for the menu routines in order
  238. ; to include an example of DPC+'s bankswitching.
  239. ;===============================================================================
  240.  
  241. ORG $4000 + HM_DRIVER_SIZE
  242. RORG $F000
  243.  
  244. ; you can store 128 bytes of data here that's accessible to the ARM
  245. ; chip, but not the 6507.
  246.  
  247. echo "------",($F080 - *), " bytes free for BANK 4 'DPC+ overlap' ARM data storage"
  248.  
  249. ;allocate the first $80 bytes of each 6507 bank for the DPC+ registers
  250. ORG $4080 + HM_DRIVER_SIZE
  251. RORG $F080
  252. ;----------------------------------------
  253. ; Routines that are the same in both banks
  254. ;----------------------------------------
  255.  
  256. CALL_ARM_CODE
  257. POSITION_OBJECT
  258.  
  259. SwitchBanks:
  260. cmp SelectBank5 ; after switching to bank 5 the JMP will be OSwaitGame
  261. jmp OSwaitMenu
  262.  
  263.  
  264. ;----------------------------------------
  265. ; Two Color Graphic routine
  266. ;----------------------------------------
  267. ; This works by using a "negative" image when drawing the players, just like a
  268. ; stencil. The players are colored black while the background is the color that
  269. ; creates the image. The second color is achieved by using the playfield and/or
  270. ; ball.
  271. ;
  272. ; The missiles (also black) and setting the screen & playfield to black is
  273. ; used to hide the screen and playfield on either side of the 48 pixel image.
  274. ShowTwoColorGraphic:
  275. sty LoopCounter
  276.  
  277. S2CGloop:
  278. ;---------------------------------------
  279. sta WSYNC
  280. dec Sleep5 ; 5 5 ; time for DPC+ 3 voice music update
  281. Lda #<DS_GRP0A ; 2 7
  282. sta GRP0 ; 3 10
  283. lda #<DS_GRP1A ; 2 12
  284. sta GRP1 ; 3 15
  285. lda #<DS_GRP0B ; 2 17
  286. sta GRP0 ; 3 20
  287. ldx DS_GRP0C ; 4 24
  288. ldy DS_GRP1C ; 4 28
  289. lda #<DS_TWO_COLORS ; 2 30
  290. sta.w COLUPF ; 4 34
  291. lda #<DS_TWO_COLORS ; 2 36
  292. sta COLUBK ; 3 39
  293. lda #<DS_GRP1B ; 2 41
  294. sta GRP1 ; 3 44
  295. stx GRP0 ; 3 47
  296. sty GRP1 ; 3 50
  297. sty GRP0 ; 3 53
  298. ldx #0 ; 2 55
  299. stx COLUBK ; 3 58
  300. stx COLUPF ; 3 61
  301. dec LoopCounter ; 5 66
  302. bne S2CGloop ; 3 69 <- OK if page crossed
  303. stx PF0 ; 3 72
  304. stx PF1 ; 3 75
  305. ;---------------------------------------
  306. stx GRP0 ; 3 78/2
  307. stx GRP1 ; 3 5
  308. stx GRP0 ; 3 8
  309. rts ; 6 14
  310.  
  311. ;----------------------------------------
  312. ; menu loop
  313. ;----------------------------------------
  314. ;Loop:
  315. ; OverScan - process joysticks, console switches, etc.
  316. ; VerticalSync - trigger vertical sync
  317. ; VerticalBlank - update menu datastream
  318. ; Kernel - draw menu using datastream
  319. ; goto Loop
  320. ;----------------------------------------
  321.  
  322. OverScanMenu:
  323. sta WSYNC ; Wait for SYNC (halts CPU until end of scanline)
  324. ldx #2 ; LoaD Accumulator with 2 so D1=1
  325. stx VBLANK ; STore Accumulator to VBLANK, D1=1 turns image output off
  326.  
  327. ; set the timer so the total number of scanlines ends up being 262
  328. ldx #35
  329. stx TIM64T
  330.  
  331. ldy #ARM_MENU_OS
  332. jsr CallArmCode ; run MenuOverscan() in the ARM code
  333.  
  334. ; after CallArmCode, Data Fetcher 0 is pointing at ARMmode, so we don't need
  335. ; to set DF0LOW and DF0HI in order to retrieve the value
  336. lda #<DF0DATA
  337. bne OSwaitMenu ; 0 = game active, 1 = menu active
  338. jmp SwitchBanks ; show the game
  339.  
  340. OSwaitMenu:
  341. sta WSYNC ; Wait for SYNC (halts CPU until end of scanline)
  342. lda INTIM ; Check the Timer
  343. bne OSwaitMenu ; Branch if its Not Equal to 0
  344.  
  345. VerticalSyncMenu:
  346. ldy #2 ; LoaD Accumulator with 2 so D1=1
  347. ldx #47 ; (47 * 64) / 76 = 40, used to set timer
  348. sta WSYNC ; Wait for SYNC (halts CPU until end of scanline)
  349. sty VSYNC ; Y D1=1, turns on Vertical Sync signal
  350. stx TIM64T ; set timer to go off in 40 scanlines
  351. sta WSYNC ; Wait for Sync - halts CPU until end of 1st scanline of VSYNC
  352. sta WSYNC ; wait until end of 2nd scanline of VSYNC
  353. ldy #0 ; LoaD Y with 0 so D1=0
  354. sta WSYNC ; wait until end of 3rd scanline of VSYNC
  355. sty VSYNC ; Y D1=0, turns off Vertical Sync signal
  356.  
  357. VerticalBlankMenu:
  358. ldy #ARM_MENU_VB
  359. jsr CallArmCode ; run MenuVerticalBlank() in the ARM code
  360.  
  361. ldy #%00110011
  362. sty ENAM0 ; turns on missile0
  363. sty ENAM1 ; turns on missile1
  364. sty ENABL ; turns on ball
  365. sty NUSIZ0 ; set player0 to triplicate, missile0 to 8x
  366. sty NUSIZ1 ; set player1 to triplicate, missile1 to 8x
  367. ldy #%00100000 ; set ball size to 4x
  368. sty CTRLPF
  369. ldx #1
  370. stx VDELP0 ; turn on vertical delay for 48 pixel routine
  371. stx VDELP1 ; turn on vertical delay for 48 pixel routine
  372.  
  373. ; position players and missiles for two color 48 pixel routine
  374. ; the Kernel will reposition the ball for each menu entry
  375. PositionMMobjects:
  376. ldx #3
  377. pmmoLoop:
  378. lda MMobjectPosition,x
  379. jsr PosObject
  380. dex
  381. bpl pmmoLoop
  382. sta WSYNC
  383. sta HMOVE
  384.  
  385. ldx #<MenuOptionsDatastream
  386. stx DF0LOW
  387. ldx #>MenuOptionsDatastream
  388. stx DF0HI
  389. ldx #0
  390. stx COLUP0
  391. stx COLUP1
  392. stx COLUPF
  393.  
  394. KernelMenu:
  395. sta WSYNC
  396. lda INTIM
  397. bne KernelMenu
  398. stx VBLANK
  399.  
  400. MMloop:
  401. ; set position of datastreams 1-7 for current menu entry
  402. ldx #6
  403. MMloop2:
  404. lda #<DS_MENU_CONTROL
  405. sta DF1LOW,x
  406. lda #<DS_MENU_CONTROL
  407. sta DF1HI,x
  408. dex
  409. bpl MMloop2
  410.  
  411. ; playfield is used for the second color
  412. lda #<DS_MENU_CONTROL
  413. sta PF0
  414. lda #<DS_MENU_CONTROL
  415. sta PF1
  416. lda #<DS_MENU_CONTROL
  417. sta PF2
  418.  
  419. ; position the ball, also used for the second color
  420. sta HMCLR
  421. ldx #4
  422. lda #<DS_MENU_CONTROL
  423. jsr PosObject
  424. sta WSYNC
  425. sta HMOVE
  426.  
  427. ; get number of rows for menu entry, then show it
  428. ldy DS_MENU_CONTROL
  429. jsr ShowTwoColorGraphic
  430.  
  431. ; get the vertical spacing after current menu entry
  432. lda #<DS_MENU_CONTROL
  433. bmi MMdone ; negative value means we're done drawing the menu
  434. beq MMloop ; no delay, start loop right now
  435. tay
  436. MMloop3:
  437. sta WSYNC
  438. dey
  439. bne MMloop3
  440. beq MMloop
  441.  
  442.  
  443. MMdone:
  444. sta WSYNC
  445. ldx #0
  446. stx ENAM0
  447. stx ENAM1
  448. stx ENABL
  449. stx PF0
  450. stx PF1
  451. stx PF2
  452.  
  453. ldx #MM_LOGO_GAP
  454. SLgap:
  455. sta WSYNC
  456. dex
  457. bpl SLgap
  458.  
  459. ;----------------------------------------
  460. ; SpiceWare logo
  461. ;----------------------------------------
  462. ; Drawn with a normal 48 pixel routine, but the first and last scanlines have
  463. ; extra code to draw the extended lines. The top line is extended to the right
  464. ; using just the playfield. The bottom line is extended to the left using the
  465. ; playfield and missile0.
  466. ;----------------------------------------
  467. ShowSpiceWareLogo:
  468. ldx #5
  469. SSWL0:
  470. lda SWLlo,x
  471. sta DF2LOW,x
  472. lda SWLhi,x
  473. sta DF2HI,x
  474. dex
  475. bpl SSWL0
  476. ldx #WHITE
  477. stx COLUP0
  478. stx COLUP1
  479. stx COLUPF
  480.  
  481. ldy #7
  482. sty LoopCounter
  483.  
  484. ; draw 1st line of logo with line extended to right
  485. sta WSYNC
  486. lda #<DS_GRP0A ; 2 2
  487. sta GRP0 ; 3 5
  488. lda #<DS_GRP1A ; 2 7
  489. sta GRP1 ; 3 10
  490. lda #<DS_GRP0B ; 2 12
  491. sta GRP0 ; 3 15
  492. lda #<DS_GRP1B ; 2 17
  493. ldx DS_GRP0C ; 4 21
  494. ldy DS_GRP1C ; 4 25
  495. jsr SLEEP12 ;12 37
  496. SLEEP 4 ; 4 41
  497. sta GRP1 ; 3 44 <- time critical
  498. stx GRP0 ; 3 47
  499. sty GRP1 ; 3 50
  500. sty GRP0 ; 3 53
  501. sty PF1 ; 3 56 ; Y = $FF, extends line on right
  502. sty PF2 ; 3 59 ; Y = $FF, extends line on right
  503.  
  504. SSWL1:
  505. sta WSYNC
  506. ldy #0 ; 2 2
  507. sty PF1 ; 3 5 ; make sure extended line is off
  508. sty PF2 ; 3 8
  509. lda #<DS_GRP0A ; 2 10
  510. sta GRP0 ; 3 13
  511. lda #<DS_GRP1A ; 2 15
  512. sta GRP1 ; 3 18
  513. lda #<DS_GRP0B ; 2 20
  514. sta GRP0 ; 3 23
  515. lda #<DS_GRP1B ; 2 25
  516. ldx DS_GRP0C ; 4 29
  517. ldy DS_GRP1C ; 4 33
  518. SLEEP 3 ; 3 36
  519. dec LoopCounter ; 5 41
  520. sta GRP1 ; 3 44 <- time critical
  521. stx GRP0 ; 3 47
  522. sty GRP1 ; 3 50
  523. sty GRP0 ; 3 53
  524. bne SSWL1 ; 3 56
  525. ; 2 55 if not taken
  526.  
  527. ; draw last line of logo with line extended to the left
  528. lda #<DS_GRP0A ; 2 57
  529. sta GRP0 ; 3 60 ; for next line
  530. ldx DS_GRP1A ; 4 64
  531. stx GRP1 ; 3 67 ; for next line
  532. sta PF0 ; 3 70 ; A = $FF, extends line on left
  533. sta PF1 ; 3 73 ; A = $FF, extends line on left
  534. sta ENAM0 ; 3 76/0; A = $FF, extends line on left
  535. ldx #1 ; 2 2
  536. stx CTRLPF ; 3 5 ; reflect playfield, gives extra time to clear PF0 and PF1
  537. lda #<DS_GRP0B ; 2 7
  538. sta GRP0 ; 3 10
  539. lda #<DS_GRP1B ; 2 12
  540. ldx DS_GRP0C ; 4 16
  541. jsr SLEEP12 ;12 28
  542. SLEEP 9 ; 9 37
  543. ldy DS_GRP1C ; 4 40
  544. sta GRP1 ; 3 44 <- time critical
  545. stx GRP0 ; 3 47
  546. sty GRP1 ; 3 50
  547. sty GRP0 ; 3 53
  548. ldy #0 ; 2 55
  549. sty PF1 ; 3 58
  550. sty PF0 ; 3 61
  551. stx GRP1 ; 3 67
  552. stx GRP0 ; 3 70
  553. EndShowSpiceWareLogo:
  554.  
  555. jmp OverScanMenu
  556.  
  557.  
  558. MMobjectPosition: ; These are the player and missile X positions required by
  559. ; the Two Color Kernel.
  560. ; The Ball object is repositioned for each menu entry
  561. .byte $38 ; Player 0
  562. .byte $40 ; Player 1
  563. .byte 17 ; Missile 0 - to hide color run-over on the left
  564. .byte 105 ; Missile 1 - to hide color run-over on the right
  565.  
  566. SWLlo: .byte <SpiceWareLogoA
  567. .byte <SpiceWareLogoB
  568. .byte <SpiceWareLogoC
  569. .byte <SpiceWareLogoD
  570. .byte <SpiceWareLogoE
  571. .byte <SpiceWareLogoF
  572.  
  573. SWLhi: .byte >SpiceWareLogoA
  574. .byte >SpiceWareLogoB
  575. .byte >SpiceWareLogoC
  576. .byte >SpiceWareLogoD
  577. .byte >SpiceWareLogoE
  578. .byte >SpiceWareLogoF
  579.  
  580. Font:
  581. .byte %11011101 ; bit 7 of TimerB bleeds into bit 7 of RightScoreB
  582. .byte %10101010 ; so font is design to not use bit 7
  583. .byte %10101010
  584. .byte %10101010
  585. .byte %10101010
  586. .byte %10101010
  587. .byte %11011101
  588.  
  589. .byte %11011101
  590. .byte %10011001
  591. .byte %11011101
  592. .byte %11011101
  593. .byte %11011101
  594. .byte %11011101
  595. .byte %10001000
  596.  
  597. .byte %10011001
  598. .byte %11101110
  599. .byte %11101110
  600. .byte %11011101
  601. .byte %10111011
  602. .byte %10111011
  603. .byte %10001000
  604.  
  605. .byte %10011001
  606. .byte %11101110
  607. .byte %11101110
  608. .byte %11011101
  609. .byte %11101110
  610. .byte %11101110
  611. .byte %10011001
  612.  
  613. .byte %11101110
  614. .byte %10101010
  615. .byte %10101010
  616. .byte %10001000
  617. .byte %11101110
  618. .byte %11101110
  619. .byte %11101110
  620.  
  621. .byte %10001000
  622. .byte %10111011
  623. .byte %10111011
  624. .byte %10011001
  625. .byte %11101110
  626. .byte %11101110
  627. .byte %10011001
  628.  
  629. .byte %11001100
  630. .byte %10111011
  631. .byte %10111011
  632. .byte %10011001
  633. .byte %10101010
  634. .byte %10101010
  635. .byte %11011101
  636.  
  637. .byte %10001000
  638. .byte %11101110
  639. .byte %11101110
  640. .byte %11011101
  641. .byte %11011101
  642. .byte %10111011
  643. .byte %10111011
  644.  
  645. .byte %11011101
  646. .byte %10101010
  647. .byte %10101010
  648. .byte %11011101
  649. .byte %10101010
  650. .byte %10101010
  651. .byte %11011101
  652.  
  653. .byte %11011101
  654. .byte %10101010
  655. .byte %10101010
  656. .byte %11001100
  657. .byte %11101110
  658. .byte %11101110
  659. .byte %10011001
  660.  
  661. .byte %11011101
  662. .byte %10101010
  663. .byte %10101010
  664. .byte %10001000
  665. .byte %10101010
  666. .byte %10101010
  667. .byte %10101010
  668.  
  669. .byte %10111011 ; in a 3 pixel font B is difficult to discern from 8,
  670. .byte %10111011 ; so use lowercase for better visibility
  671. .byte %10111011
  672. .byte %10011001
  673. .byte %10101010
  674. .byte %10101010
  675. .byte %10011001
  676.  
  677. .byte %11011101
  678. .byte %10101010
  679. .byte %10111011
  680. .byte %10111011
  681. .byte %10111011
  682. .byte %10101010
  683. .byte %11011101
  684.  
  685. .byte %11101110 ; in a 3 pixel font D is difficult to discern from 8,
  686. .byte %11101110 ; so use lowercase for better visibility
  687. .byte %11101110
  688. .byte %11001100
  689. .byte %10101010
  690. .byte %10101010
  691. .byte %11001100
  692.  
  693. .byte %10001000
  694. .byte %10111011
  695. .byte %10111011
  696. .byte %10011001
  697. .byte %10111011
  698. .byte %10111011
  699. .byte %10001000
  700.  
  701. .byte %10001000
  702. .byte %10111011
  703. .byte %10111011
  704. .byte %10011001
  705. .byte %10111011
  706. .byte %10111011
  707. .byte %10111011
  708.  
  709. Space = (*-Font)/7
  710. .byte %11111111
  711. .byte %11111111
  712. .byte %11111111
  713. .byte %11111111
  714. .byte %11111111
  715. .byte %11111111
  716. .byte %11111111
  717.  
  718. Colon = (*-Font)/7
  719. .byte %11111111
  720. .byte %11111111
  721. .byte %11011101
  722. .byte %11111111
  723. .byte %11011101
  724. .byte %11111111
  725. .byte %11111111
  726.  
  727. VB = (*-Font)/7
  728. .byte %11111111
  729. .byte %11111111
  730. .byte %10101001
  731. .byte %10101010
  732. .byte %10101001
  733. .byte %10101010
  734. .byte %11011001
  735.  
  736. OS = (*-Font)/7
  737. .byte %11111111
  738. .byte %11111111
  739. .byte %11011100
  740. .byte %10101011
  741. .byte %10101101
  742. .byte %10101110
  743. .byte %11011001
  744.  
  745.  
  746. echo "------",($FFF6 - *) , "bytes of BANK 4 ROM left"
  747. ORG $4FF6 + HM_DRIVER_SIZE
  748. BANKS_AND_VECTORS
  749.  
  750.  
  751.  
  752.  
  753. ;===============================================================================
  754. ; Bank 5 - 6507 code
  755. ;----------------------------------------
  756. ; Game screen routines are in this bank.
  757. ;===============================================================================
  758.  
  759. ORG $5000 + HM_DRIVER_SIZE
  760. RORG $F000
  761.  
  762. ; you can store 128 bytes of data here that's accessible to the ARM
  763. ; chip, but not the 6507.
  764.  
  765. echo "------",($F080 - *), " bytes free for BANK 4 'DPC+ overlap' ARM data storage"
  766.  
  767. ;allocate the first $80 bytes of each 6507 bank for the DPC+ registers
  768. ORG $5080 + HM_DRIVER_SIZE
  769. RORG $F080
  770. ;----------------------------------------
  771. ; Routines that are the same in both banks
  772. ;----------------------------------------
  773.  
  774. CALL_ARM_CODE
  775. POSITION_OBJECT
  776.  
  777. SwitchBanks:
  778. cmp SelectBank4 ; after switching to bank 4 the JMP will be OSwaitMenu
  779. jmp OSwaitGame
  780.  
  781. ;----------------------------------------
  782. ; Initialize System
  783. ;----------------------------------------
  784.  
  785. InitSystem:
  786. CLEAN_START
  787.  
  788. ;----------------------------------------
  789. ; FASTFETCH mode
  790. ;----------------------------------------
  791. ; Here we turn on FASTFETCH mode, which lets us access DPC+ registers using:
  792. ; lda #<DF0DATA ; 2 cycle instruction
  793. ;
  794. ; instead of:
  795. ; lda DF0DATA ; 4 cycle instruction
  796. ;
  797. ; NOTE: This program never turns off FASTFETCH mode, so don't use LDA # for
  798. ; anything except accessing DPC+ registers.
  799. ;----------------------------------------
  800. ldx #0
  801. stx FASTFETCH
  802.  
  803. ldy #ARM_INIT
  804. jsr CallArmCode ; run Initialize() in the ARM code
  805.  
  806. ;----------------------------------------
  807. ; main program loop
  808. ;----------------------------------------
  809. ;Loop:
  810. ; OverScan - process joysticks, console switches, etc
  811. ; VerticalSync - trigger vertical sync
  812. ; VerticalBlank - run sprite multiplexer and populate the datastreams
  813. ; Kernel - draw screen using datastreams
  814. ; goto Loop
  815. ;----------------------------------------
  816.  
  817. OverScan:
  818. sta WSYNC ; Wait for SYNC (halts CPU until end of scanline)
  819. ldy #2 ; LoaD Y with 2 so D1=1
  820. sty VBLANK ; STore Y to VBLANK, D1=1 turns image output off
  821.  
  822. ; set the timer so the total number of scanlines ends up being 262
  823. ldy #35
  824. sty TIM64T
  825.  
  826. ldy #ARM_OS
  827. jsr CallArmCode ; run OverScan() in the ARM code
  828.  
  829. ; after CallArmCode Data Fetcher 0 is pointing at ARMmode, so we don't need
  830. ; to set DF0LOW and DF0HI in order to retrieve the value
  831. lda #<DF0DATA ; retreives ARMmode
  832. beq OSwaitGame ; 0 = game active, 1 = menu active
  833. jmp SwitchBanks ; show the menu
  834.  
  835. OSwaitGame:
  836. lda INTIM
  837. sta TimeLeftOS
  838. OSwaitLoop:
  839. sta WSYNC ; Wait for SYNC (halts CPU until end of scanline)
  840. lda INTIM ; Check the Timer
  841. bne OSwaitLoop ; Branch if its Not Equal to 0
  842.  
  843.  
  844. VerticalSync:
  845. ldy #2 ; LoaD Y with 2 so D1=1
  846. ldx #47 ; (47 * 64) / 76 = 40, used to set timer
  847. sta WSYNC ; Wait for SYNC (halts CPU until end of scanline)
  848. sty VSYNC ; Y D1=1, turns on Vertical Sync signal
  849. stx TIM64T ; set timer to go off in 40 scanlines
  850. sta WSYNC ; Wait for Sync - halts CPU until end of 1st scanline of VSYNC
  851. sta WSYNC ; wait until end of 2nd scanline of VSYNC
  852. ldy #0 ; 2 2 LoaD Y with 0 so D1=0
  853. sty GRP0 ; 3 5 clear all objects
  854. sty GRP1 ; 3 8
  855. sty GRP0 ; 3 11
  856. sty ENABL ; 3 14
  857. sty ENAM0 ; 3 17
  858. sty ENAM1 ; 3 20
  859. sty PF1 ; 3 23
  860. sty PF2 ; 3 26
  861. sty NUSIZ0 ; 3 29 - set players to just 1 copy at 1x size
  862. sty NUSIZ1 ; 3 32
  863. sty VDELP1 ; 3 35 - player1 doesn't use VDEL in the Arena kernel
  864. iny ; 2 37
  865. sty VDELP0 ; 3 40 - player0 uses Vertical Delay in the Arena Kernel
  866. sta WSYNC ; wait until end of 3rd scanline of VSYNC
  867. sty VSYNC ; Y D1=0, turns off Vertical Sync signal
  868.  
  869.  
  870. VerticalBlank:
  871.  
  872. ldy #ARM_VB
  873. jsr CallArmCode ; run VerticalBlank() in the ARM code
  874.  
  875. ; set datafetcher 0 so we can retreive variables updated by the ARM code
  876. ldx #<DS_FromARM
  877. stx DF0LOW
  878. ldx #>DS_FromARM
  879. stx DF0HI
  880.  
  881. PrepPlayfield:
  882. lda #<DF0DATA ; read value in ARMcolupf
  883. sta COLUPF ; set playfield color
  884. ldx #2
  885. ldy #256/8
  886. PPFloop:
  887. lda PFDSlow,x
  888. sta DF0FRACLOW,x
  889. lda PFDShi,x
  890. sta DF0FRACHI,x
  891. tya
  892. sta DF0FRACINC,x
  893. dex
  894. bpl PPFloop
  895.  
  896. PrepDataStreams:
  897. ldx #3
  898. PDSloop:
  899. lda DSlow,x
  900. sta DF0LOW,x
  901. lda DShi,x
  902. sta DF0HI,x
  903. dex
  904. bpl PDSloop
  905.  
  906. PositionPlayers:
  907. ldx #1
  908. PPloop:
  909. lda PlayerPos,x
  910. jsr PosObject
  911. dex
  912. bpl PPloop
  913. sta WSYNC
  914. sta HMOVE
  915.  
  916. ldx #8*22 ; use X for KernelLoop counter
  917. lda INTIM
  918. sta TimeLeftVB
  919. ArenaKernel:
  920. sta WSYNC
  921. lda INTIM ; 4 4
  922. bne ArenaKernel ; 2 6 - 3 7 if taken
  923. sta VBLANK ; 3 9 - Accumulator D1=0, turns off Vertical Blank signal (image output on)
  924. lda #<DS_GRP0 ; 2 11
  925. sta GRP0 ; 3 14 - @any, for next scanline as VDELP0 is on
  926.  
  927. ArenaLoop:
  928. sta WSYNC
  929. lda #<DS_GRP1 ; 2 2
  930. sta GRP1 ; 3 5 - @0-22, also triggers update of GRP0
  931. lda #<DS_COLUP0 ; 2 7
  932. sta COLUP0 ; 3 10 - @0-22
  933. lda #<DS_COLUP1 ; 2 12
  934. sta COLUP1 ; 3 15 - @0-22
  935. lda #<DS_PF0 ; 2 17
  936. sta PF0 ; 3 20 - @0-22
  937. lda #<DS_PF1 ; 2 22
  938. sta PF1 ; 3 25 - @71-28
  939. lda #<DS_PF2 ; 2 27
  940. sta PF2 ; 3 30 - @0-39
  941. lda #<DS_GRP0 ; 2 32
  942. sta GRP0 ; 3 35 - @any, for next scanline as VDELP0 is on
  943. dex ; 2 37
  944. bne ArenaLoop ; 2 39 - 3 40 if taken
  945.  
  946. ScoreKernel:
  947. sta WSYNC
  948. ldx #0
  949. stx PF0
  950. stx PF1
  951. stx PF2
  952. stx GRP0
  953. stx GRP1
  954. stx GRP0
  955. sta WSYNC
  956. sta WSYNC
  957. sta WSYNC
  958. sta WSYNC
  959. sta WSYNC
  960. sta WSYNC
  961. ldx #0 ; 2 2
  962. stx GRP0 ; 3 5 turn off display
  963. stx GRP1 ; 3 8
  964. stx PF0 ; 3 11
  965. stx COLUBK ; 3 14
  966. stx COLUPF ; 3 17
  967. stx COLUP0 ; 3 20
  968. stx COLUP1 ; 3 23
  969. inx ; 2 25
  970. stx VDELP0 ; 3 28 turn on vertical delay for player 0
  971. stx VDELP1 ; 3 31 turn on vertical delay for player 1
  972. stx RESP0 ; 3 34 roughly position player0
  973. stx RESP1 ; 3 37 roughly position player1
  974. ldx #<LeftScoreA ; 2 39 prep datastreams for score and timer
  975. stx DF0LOW ; 4 43
  976. ldx #<LeftScoreB ; 2 45
  977. stx DF1LOW ; 4 49
  978. ldx #<TimerA ; 2 51
  979. stx DF2LOW ; 4 55
  980. ldx #<TimerB ; 2 57
  981. stx DF3LOW ; 4 61
  982. ldx #$FF ; 2 63 $fx = shift right 1
  983. stx HMP0 ; 3 67 fine tune player0 postion
  984. inx ; 2 69 $0x = no shift
  985. stx HMP1 ; 3 72 fine tune player1 postion
  986. ldx #<RightScoreA ; 2 74
  987. SLEEP 2 ; 2 76
  988. stx HMOVE ; 3 3 reposition players
  989. stx DF4LOW ; 4 7
  990. ldx #<RightScoreB ; 2 9
  991. stx DF5LOW ; 4 13
  992. ldx #%00000110 ; 2 15 set for 3 copies medium spacing
  993. stx NUSIZ0 ; 4 19
  994. stx NUSIZ1 ; 3 22
  995. ldx #<ScoreTimerColors ; 2 24
  996. stx DF6LOW ; 3 27
  997. ldx #>LeftScoreA ; 2 29
  998. stx DF0HI ; 4 33
  999. stx DF1HI ; 4 37 space savings trick - all these
  1000. stx DF2HI ; 4 41 datastreams were purposely located on
  1001. stx DF3HI ; 4 45 the same page as LeftScoreA
  1002. stx DF4HI ; 4 49
  1003. stx DF5HI ; 4 53
  1004. stx DF6HI ; 4 57
  1005. ldx #7 ; 2 59
  1006. stx LoopCounter ; 3 62
  1007. lda #<DS_ST_COLORS ; 2 64
  1008. sta LeftScoreColor ; 3 67
  1009. ldx #%00000011 ; 2 69
  1010. stx PF1 ; 3 72
  1011. ldx #%11000011 ; 2 74
  1012. stx PF2 ; 3 77/1
  1013. ldx DS_ST_COLORS ; 4 5 X holds Timer Color during ScoreLoop
  1014. ldy DS_ST_COLORS ; 4 9 Y holds Right Score Color
  1015. bne SL_Start ; 3 12 always branchs as Y is not 0
  1016.  
  1017. ScoreLoop:
  1018. sta WSYNC
  1019. lda LeftScoreColor ; 3 3
  1020. sta COLUPF ; 3 6
  1021. lda #<DS_LEFTSCOREB ; 2 8
  1022. sta GRP1 ; 3 11 LeftScoreA now visible in GRP0
  1023. lda #<DS_TIMERA ; 2 13
  1024. sta GRP0 ; 3 16 LeftScoreB now visible in GRP1
  1025. lda #<DS_TIMERB ; 2 18
  1026. SLEEP 18 ;18 36
  1027. sta GRP1 ; 3 39 TimerA now visible in GRP0
  1028. stx COLUPF ; 3 42 set timer color
  1029. lda #<DS_RIGHTSCOREA ; 2 44
  1030. sta GRP0 ; 3 47 TimerB now visible in GRP1
  1031. lda #<DS_RIGHTSCOREB ; 2 49
  1032. sty COLUPF ; 3 52
  1033. sta GRP1 ; 3 55 RightScoreA now visible in GRP0
  1034. SL_Start:
  1035. ; NOTE: the following update of GRP0 is 1 pixel late so the contents of
  1036. ; bit 7 of TimerB are displayed instead of the contents of
  1037. ; bit 7 of RightScoreB. We'll work around this late update
  1038. ; by not using bit 7 in the font.
  1039. lda #<DS_LEFTSCOREA ; 2 57
  1040. sta GRP0 ; 3 60 RightScoreB now visible in GRP1
  1041. dec LoopCounter ; 5 65
  1042. bpl ScoreLoop ; 2 67 3 68 if taken
  1043.  
  1044. jmp OverScan ; 3 70
  1045.  
  1046. PFDSlow:
  1047. .byte <ArenaPF0
  1048. .byte <ArenaPF1
  1049. .byte <ArenaPF2
  1050.  
  1051. PFDShi:
  1052. .byte >ArenaPF0
  1053. .byte >ArenaPF1
  1054. .byte >ArenaPF2
  1055.  
  1056. DSlow:
  1057. .byte <Player0DataStream
  1058. .byte <Player1DataStream
  1059. .byte <Color0DataStream
  1060. .byte <Color1DataStream
  1061.  
  1062. DShi:
  1063. .byte >Player0DataStream
  1064. .byte >Player1DataStream
  1065. .byte >Color0DataStream
  1066. .byte >Color1DataStream
  1067.  
  1068. PlayerPos:
  1069. .byte 6
  1070. .byte 146
  1071.  
  1072. echo "------",($FFF6 - *) , "bytes of BANK 5 ROM left"
  1073. ORG $5FF6 + HM_DRIVER_SIZE
  1074. BANKS_AND_VECTORS
  1075.  
  1076.  
  1077.  
  1078.  
  1079. ;===============================================================================
  1080. ; Display Data
  1081. ;----------------------------------------
  1082. ; The Display Data bank is copied into RAM when DPC+ initializes the cartridge.
  1083. ; This allows us to manipulate the data during run-time, but have a known
  1084. ; starting state when the Atari is first turned on.
  1085. ;
  1086. ; Unlike normal Atari VCS/2600 sprite definitions, the sprite data in the
  1087. ; Display Data bank is stored right-side-up.
  1088. ;
  1089. ; NOTE: The initial contents of Display Data is stored in ROM and can be
  1090. ; accessed by ARM routines. This can prove handy for saving ROM
  1091. ;===============================================================================
  1092. ORG $6000 + HM_DRIVER_SIZE
  1093. RORG $0000
  1094.  
  1095. LeftScoreA:
  1096. .byte %11111111
  1097. .byte %00000000
  1098. .byte %11111111
  1099. .byte %00000000
  1100. .byte %11111111
  1101. .byte %00000000
  1102. .byte %11111111
  1103.  
  1104. LeftScoreB:
  1105. .byte %11111111
  1106. .byte %00000000
  1107. .byte %11111111
  1108. .byte %00000000
  1109. .byte %11111111
  1110. .byte %00000000
  1111. .byte %11111111
  1112.  
  1113. TimerA:
  1114. .byte %00000000
  1115. .byte %11111111
  1116. .byte %00000000
  1117. .byte %11111111
  1118. .byte %00000000
  1119. .byte %11111111
  1120. .byte %00000000
  1121.  
  1122. TimerB:
  1123. .byte %00000000
  1124. .byte %11111111
  1125. .byte %00000000
  1126. .byte %11111111
  1127. .byte %00000000
  1128. .byte %11111111
  1129. .byte %00000000
  1130.  
  1131. RightScoreA:
  1132. .byte %11111111
  1133. .byte %00000000
  1134. .byte %11111111
  1135. .byte %00000000
  1136. .byte %11111111
  1137. .byte %00000000
  1138. .byte %11111111
  1139.  
  1140. RightScoreB:
  1141. .byte %11111111
  1142. .byte %00000000
  1143. .byte %11111111
  1144. .byte %00000000
  1145. .byte %11111111
  1146. .byte %00000000
  1147. .byte %11111111
  1148.  
  1149.  
  1150. ScoreTimerColors
  1151. .byte BLUE + 4
  1152. .byte WHITE
  1153. .byte GREEN + 4
  1154.  
  1155. ArenaPF0: ; PF0 is drawn in reverse order, and only the upper nybble
  1156. .byte %11110000
  1157. .byte %00010000
  1158. .byte %00010000
  1159. .byte %00010000
  1160. .byte %00010000
  1161. .byte %00010000
  1162. .byte %00010000
  1163. .byte %00010000
  1164. .byte %00010000
  1165. .byte %00010000
  1166. .byte %00010000
  1167. .byte %00010000
  1168. .byte %00010000
  1169. .byte %00010000
  1170. .byte %00010000
  1171. .byte %00010000
  1172. .byte %00010000
  1173. .byte %00010000
  1174. .byte %00010000
  1175. .byte %00010000
  1176. .byte %00010000
  1177. .byte %11110000
  1178.  
  1179. ArenaPF1: ; PF1 is drawn in expected order
  1180. .byte %11111111 ; Arena 1
  1181. .byte %00000000
  1182. .byte %00000000
  1183. .byte %00000000
  1184. .byte %00011100
  1185. .byte %00000000
  1186. .byte %00000000
  1187. .byte %11000000
  1188. .byte %01000000
  1189. .byte %01000000
  1190. .byte %01000001
  1191. .byte %01000001
  1192. .byte %01000000
  1193. .byte %01000000
  1194. .byte %11000000
  1195. .byte %00000000
  1196. .byte %00000000
  1197. .byte %00011100
  1198. .byte %00000000
  1199. .byte %00000000
  1200. .byte %00000000
  1201. .byte %11111111
  1202.  
  1203. ArenaPF2: ; PF2 is drawn in reverse order
  1204. .byte %11111111 ; Arena 1
  1205. .byte %10000000
  1206. .byte %00000000
  1207. .byte %00000000
  1208. .byte %00000000
  1209. .byte %00000000
  1210. .byte %00011100
  1211. .byte %00000100
  1212. .byte %00000000
  1213. .byte %00000000
  1214. .byte %00000000
  1215. .byte %00000000
  1216. .byte %00000000
  1217. .byte %00000000
  1218. .byte %00000100
  1219. .byte %00011100
  1220. .byte %00000000
  1221. .byte %00000000
  1222. .byte %00000000
  1223. .byte %00000000
  1224. .byte %10000000
  1225. .byte %11111111
  1226.  
  1227. Player0DataStream:
  1228. ds 8, 0 ; top Arena border
  1229. .byte %11111111 ; alignment test
  1230. ;ds 71, 0
  1231. ds 30, 0
  1232. .byte %00000001 ; 1 invader
  1233. .byte %01000010 ; 2
  1234. .byte %10100100 ; 3
  1235. .byte %10011000 ; 4
  1236. .byte %01111110 ; 5
  1237. .byte %01101011 ; 6
  1238. .byte %01111110 ; 7
  1239. .byte %01111110 ; 8
  1240. .byte %01000010 ; 9
  1241. .byte %11100111 ; 10
  1242. ds 31,0
  1243. .byte %00010000 ; 1 left player
  1244. .byte %00010000 ; 2
  1245. .byte %00010000 ; 3
  1246. .byte %00111000 ; 4
  1247. .byte %00111000 ; 5
  1248. .byte %01011000 ; 6
  1249. .byte %01010100 ; 7
  1250. .byte %01010000 ; 8
  1251. .byte %00010000 ; 9
  1252. .byte %00010000 ; 10
  1253. .byte %00010000 ; 11
  1254. .byte %00010000 ; 12
  1255. .byte %00010000 ; 13
  1256. .byte %00010000 ; 14
  1257. .byte %00010000 ; 15
  1258. .byte %00011000 ; 16
  1259. ds 29, 0
  1260. .byte %11111100 ; 1 tank
  1261. .byte %11111100 ; 2
  1262. .byte %11111100 ; 3
  1263. .byte %11111100 ; 4
  1264. .byte %00111000 ; 5
  1265. .byte %00111000 ; 6
  1266. .byte %00111111 ; 7
  1267. .byte %00111111 ; 8
  1268. .byte %00111000 ; 9
  1269. .byte %00111000 ; 10
  1270. .byte %11111100 ; 11
  1271. .byte %11111100 ; 12
  1272. .byte %11111100 ; 13
  1273. .byte %11111100 ; 14
  1274. ds 28,0
  1275. .byte %11111111 ; alignment test
  1276. ds 8,0 ; bottom Arena border
  1277. echo "Player0DataStream Size = ", [* - Player0DataStream]d
  1278.  
  1279. Player1DataStream:
  1280. ds 8, 0 ; top Arena border
  1281. .byte %11111111 ; alignment test
  1282. ds 30, 0
  1283. .byte %00111100 ; 1 invader
  1284. .byte %01111110 ; 2
  1285. .byte %01011010 ; 3
  1286. .byte %11111111 ; 4
  1287. .byte %10100101 ; 5
  1288. .byte %10011001 ; 6
  1289. .byte %10011001 ; 7
  1290. .byte %10100101 ; 8
  1291. .byte %10100101 ; 9
  1292. .byte %10100101 ; 10
  1293. ds 31,0
  1294. .byte %00001000 ; 1 right player
  1295. .byte %00001000 ; 2
  1296. .byte %00001000 ; 3
  1297. .byte %00011100 ; 4
  1298. .byte %00011100 ; 5
  1299. .byte %00011010 ; 6
  1300. .byte %00101010 ; 7
  1301. .byte %00001010 ; 8
  1302. .byte %00001000 ; 9
  1303. .byte %00001000 ; 10
  1304. .byte %00001000 ; 11
  1305. .byte %00001000 ; 12
  1306. .byte %00001000 ; 13
  1307. .byte %00001000 ; 14
  1308. .byte %00001000 ; 15
  1309. .byte %00011000 ; 16
  1310. ds 29, 0
  1311. .byte %00111111 ; 1 tank
  1312. .byte %00111111 ; 2
  1313. .byte %00111111 ; 3
  1314. .byte %00111111 ; 4
  1315. .byte %00011100 ; 5
  1316. .byte %00011100 ; 6
  1317. .byte %11111100 ; 7
  1318. .byte %11111100 ; 8
  1319. .byte %00011100 ; 9
  1320. .byte %00011100 ; 10
  1321. .byte %00111111 ; 11
  1322. .byte %00111111 ; 12
  1323. .byte %00111111 ; 13
  1324. .byte %00111111 ; 14
  1325. ds 28,0
  1326.  
  1327. .byte %11111111 ; alignment test
  1328. ds 8,0 ; bottom Arena border
  1329. echo "Player1DataStream Size = ", [* - Player1DataStream]d
  1330.  
  1331. Color0DataStream:
  1332. ds 8, WHITE ; top Arena border
  1333. .byte WHITE ; alignment test
  1334. ds 30, WHITE
  1335. ds 10, YELLOW+4 ; invader
  1336. ds 31, WHITE
  1337. .byte HAIR ; 1 left player
  1338. .byte FACE ; 2
  1339. .byte FACE ; 3
  1340. .byte BLUE+2 ; 4
  1341. .byte WHITE -2 ; 5
  1342. .byte WHITE -2 ; 6
  1343. .byte GREY+8 ; 7
  1344. .byte GREY+4 ; 8
  1345. .byte BLUE+4 ; 9
  1346. .byte WHITE-2-2 ; 10
  1347. .byte WHITE-2-2 ; 11
  1348. .byte WHITE-2-2 ; 12
  1349. .byte BLUE ; 13
  1350. .byte BLUE+2 ; 14
  1351. .byte BLUE+4 ; 15
  1352. .byte BLUE+6 ; 16
  1353. ds 29, WHITE
  1354. ds 14, RED+4 ; tank
  1355. ds 28, WHITE
  1356. .byte WHITE ; alignment test
  1357. ds 8, WHITE ; bottom Arena border
  1358. echo "Color0DataStream Size = ", [* - Color0DataStream]d
  1359.  
  1360. Color1DataStream:
  1361. ds 8, WHITE ; top Arena border
  1362. .byte WHITE ; alignment test
  1363. ds 30, WHITE
  1364. ds 10, YELLOW+4 ; invader
  1365. ds 31, WHITE
  1366. .byte HAIR ; 1 right player
  1367. .byte FACE ; 2
  1368. .byte FACE ; 3
  1369. .byte GREEN+2 ; 4
  1370. .byte WHITE -2 ; 5
  1371. .byte WHITE -2 ; 6
  1372. .byte GREY+8 ; 7
  1373. .byte GREY+4 ; 8
  1374. .byte GREEN+4 ; 9
  1375. .byte WHITE-2-2 ; 10
  1376. .byte WHITE-2-2 ; 11
  1377. .byte WHITE-2-2 ; 12
  1378. .byte GREEN ; 13
  1379. .byte GREEN+2 ; 14
  1380. .byte GREEN+4 ; 15
  1381. .byte GREEN+6 ; 16
  1382. ds 29, WHITE
  1383. ds 14, BLUE+2 ; tank
  1384. ds 28, WHITE
  1385. .byte WHITE ; alignment test
  1386. ds 8, WHITE ; bottom Arena border
  1387. echo "Color1DataStream Size = ", [* - Color1DataStream]d
  1388. ColorDataStreamSize = * - Color0DataStream
  1389.  
  1390.  
  1391. DS_ToARM:
  1392. ARMfunction: ds 1 ; which function to run
  1393. ARMswcha: ds 1 ; controller state
  1394. ARMswchb: ds 1 ; state of console switches
  1395. ARMinpt4: ds 1 ; state of left joystick's fire button
  1396. ARMinpt5: ds 1 ; state of right joystick's fire button
  1397. ARMvbtime: ds 1 ; vertical blank time remaining
  1398. ARMostime: ds 1 ; over scan time remaining
  1399. ; this is part of DS_ToARM, but is actually used as "from the ARM to the 6507"
  1400. ARMmode: ds 1 ; tells 6507 to show menu or game screen
  1401.  
  1402. DS_FromARM:
  1403. ARMcolupf: ds 1 ; playfield color from ARM code
  1404.  
  1405. ;----------------------------------------
  1406. ; menu variables
  1407. ;----------------------------------------
  1408. ; Instead of using global C variables, we'll allocate space in Display Data
  1409. ; to hold the state of the main menu.
  1410. ;----------------------------------------
  1411. MM_JoystickTimer: .byte 0
  1412. MM_FireDown: .byte 0
  1413. MM_SelectedOption: .byte MENU_START_ID
  1414. MM_Players: .byte 0 ; 0=1 player, 1=2 players
  1415. MM_TVtype: .byte 0 ; 0=NTSC, 1=PAL, 2=SECAM
  1416.  
  1417. ;----------------------------------------
  1418. ; menu datastream
  1419. ;----------------------------------------
  1420. ; For the menu datastream, the .word values will be accessed by the ARM code as
  1421. ; unsigned short int values. The ARM requires short int (signed and unsigned)
  1422. ; to be aligned in memory on a 2 byte boundary. The align 2 instruction does
  1423. ; this for us.
  1424. ;
  1425. ; Each menu entry is 20 bytes, so align is only needed for the first one.
  1426. ;
  1427. ; The _ID values for each menu entry will be used in the ARM code.
  1428. ;
  1429. ; To create the 2-color 48 pixel image, the players are drawn in black and act
  1430. ; like a stencil - any pixel turned on is black, any pixel turned off will show
  1431. ; either the background or playfield/ball color.
  1432. ;----------------------------------------
  1433. align 2
  1434. MenuData:
  1435. MenuOptionsDatastream:
  1436. .word Collect2LogoF ; 0 0 first value is unsigned char[] index
  1437. .word Collect2LogoE ; 2 1 not actually used in the ARM code, but
  1438. .word Collect2LogoD ; 4 2 keeping track of it helps us to make
  1439. .word Collect2LogoC ; 6 3 sure each menu entry is exactly 20 bytes
  1440. .word Collect2LogoB ; 8 4 second value is unsigned short int[] index
  1441. .word Collect2LogoA ; 10 5 this is used in the ARM code to update
  1442. .word Collect2LogoColor ; 12 6 the datastream to show selected values
  1443. .byte %00000000 ; 14 PF0 - reversed
  1444. .byte %01000000 ; 15 PF1
  1445. .byte %00000000 ; 16 PF2 - reversed
  1446. .byte 100 ; 17 ball x location
  1447. .byte 25 ; 18 rows to show
  1448. .byte MM_TITLE_GAP ; 19 scanline padding before next entry
  1449.  
  1450. MENU_FIRST_OPTION_ID = (* - MenuOptionsDatastream) / 20
  1451.  
  1452. MENU_PLAYERS_ID = (* - MenuOptionsDatastream) / 20
  1453. .word OptionDigit1 ; 0 0 first value is unsigned char[] index
  1454. .word OptionSpace ; 2 1 not actually used in the ARM code, but
  1455. .word PlayersD ; 4 2 keeping track of it helps us to make
  1456. .word PlayersC ; 6 3 sure each menu entry is exactly 20 bytes
  1457. .word PlayersB ; 8 4 second value is unsigned short int[] index
  1458. .word PlayersA ; 10 5 this is used in the ARM code to update
  1459. .word MenuOptionGreen ; 12 6 the datastream to show selected values
  1460. .byte %11100000 ; 14 PF0 - reversed
  1461. .byte %11000000 ; 15 PF1
  1462. .byte %00000000 ; 16 PF2 - reversed
  1463. .byte 0 ; 17 ball x location
  1464. .byte 7 ; 18 rows to show
  1465. .byte MM_OPTION_GAP ; 19 scanline padding before next entry
  1466.  
  1467. MENU_TV_TYPE_ID = (* - MenuOptionsDatastream) / 20
  1468. .word OptionNTSCB ; 0 0 first value is unsigned char[] index
  1469. .word OptionNTSCA ; 2 1 not actually used in the ARM code, but
  1470. .word TVtypeD ; 4 2 keeping track of it helps us to make
  1471. .word TVtypeC ; 6 3 sure each menu entry is exactly 20 bytes
  1472. .word TVtypeB ; 8 4 second value is unsigned short int[] index
  1473. .word TVtypeA ; 10 5 this is used in the ARM code to update
  1474. .word MenuOptionGreen ; 12 6 the datastream to show selected values
  1475. .byte %11100000 ; 14 PF0 - reversed
  1476. .byte %11000000 ; 15 PF1
  1477. .byte %00000000 ; 16 PF2 - reversed
  1478. .byte 0 ; 17 ball x location
  1479. .byte 7 ; 18 rows to show
  1480. .byte 0 ; 19 scanline padding before next entry
  1481.  
  1482. MENU_RGB_ID = (* - MenuOptionsDatastream) / 20
  1483. .word RGBC ; 0 0 first value is unsigned char[] index
  1484. .word RGBB ; 2 1 not actually used in the ARM code, but
  1485. .word RGBA ; 4 2 keeping track of it helps us to make
  1486. .word RGBspace ; 6 3 sure each menu entry is exactly 20 bytes
  1487. .word RGBspace ; 8 4 second value is unsigned short int[] index
  1488. .word RGBspace ; 10 5 this is used in the ARM code to update
  1489. .word MenuOptionRGB ; 12 6 the datastream to show selected values
  1490. .byte %00000000 ; 14 PF0 - reversed
  1491. .byte %00000000 ; 15 PF1
  1492. .byte %00000000 ; 16 PF2 - reversed
  1493. .byte 0 ; 17 ball x location
  1494. .byte 17 ; 18 rows to show
  1495. .byte MM_START_GAP ; 19 scanline padding before next entry
  1496.  
  1497. MENU_START_ID = (* - MenuOptionsDatastream) / 20
  1498. .word StartA ; 0 0 first value is unsigned char[] index
  1499. .word StartE ; 2 1 not actually used in the ARM code, but
  1500. .word StartD ; 4 2 keeping track of it helps us to make
  1501. .word StartC ; 6 3 sure each menu entry is exactly 20 bytes
  1502. .word StartB ; 8 4 second value is unsigned short int[] index
  1503. .word StartA ; 10 5 this is used in the ARM code to update
  1504. .word StartColor ; 12 6 the datastream to show selected values
  1505. .byte %00000000 ; 14 PF0 - reversed
  1506. .byte %11000000 ; 15 PF1
  1507. .byte %00001100 ; 16 PF2 - reversed
  1508. .byte 0 ; 17 ball x location
  1509. .byte 8 ; 18 rows to show
  1510. .byte $80 ; 19 flags end of menu
  1511.  
  1512. Collect2LogoA:
  1513. .byte %00000000 ; 0
  1514. .byte %11111111 ; 1
  1515. .byte %00000000 ; 2
  1516. .byte %11111111 ; 3
  1517. .byte %00000000 ; 4
  1518. .byte %11111111 ; 5
  1519. .byte %00000000 ; 6
  1520. .byte %11111111 ; 7
  1521. .byte %10000110 ; 8
  1522. .byte %01111101 ; 9
  1523. .byte %01111101 ; 10
  1524. .byte %01111101 ; 11
  1525. .byte %01111101 ; 12
  1526. .byte %01111101 ; 13
  1527. .byte %01111101 ; 14
  1528. .byte %01111101 ; 15
  1529. .byte %10000110 ; 16
  1530. .byte %11111111 ; 17
  1531. .byte %00000000 ; 18
  1532. .byte %11111111 ; 19
  1533. .byte %00000000 ; 20
  1534. .byte %11111111 ; 21
  1535. .byte %00000000 ; 22
  1536. .byte %11111111 ; 23
  1537. .byte %00000000 ; 24
  1538.  
  1539. Collect2LogoB:
  1540. .byte %00000000
  1541. .byte %11111111
  1542. .byte %00000000
  1543. .byte %11111111
  1544. .byte %00000000
  1545. .byte %11111111
  1546. .byte %00000000
  1547. .byte %11111111
  1548. .byte %00011011
  1549. .byte %11101011
  1550. .byte %11101011
  1551. .byte %11101011
  1552. .byte %11101011
  1553. .byte %11101011
  1554. .byte %11101011
  1555. .byte %11101011
  1556. .byte %00011000
  1557. .byte %11111111
  1558. .byte %00000000
  1559. .byte %11111111
  1560. .byte %00000000
  1561. .byte %11111111
  1562. .byte %00000000
  1563. .byte %11111111
  1564. .byte %00000000
  1565.  
  1566. Collect2LogoC:
  1567. .byte %00000000
  1568. .byte %11111111
  1569. .byte %00000000
  1570. .byte %11111111
  1571. .byte %00000000
  1572. .byte %11111111
  1573. .byte %00000000
  1574. .byte %11111111
  1575. .byte %11101111
  1576. .byte %11101111
  1577. .byte %11101111
  1578. .byte %11101111
  1579. .byte %11101111
  1580. .byte %11101111
  1581. .byte %11101111
  1582. .byte %11101111
  1583. .byte %00100000
  1584. .byte %11111111
  1585. .byte %00000000
  1586. .byte %11111111
  1587. .byte %00000000
  1588. .byte %11111111
  1589. .byte %00000000
  1590. .byte %11111111
  1591. .byte %00000000
  1592.  
  1593. Collect2LogoD:
  1594. .byte %00000000
  1595. .byte %11111111
  1596. .byte %00000000
  1597. .byte %11111111
  1598. .byte %00000000
  1599. .byte %11111111
  1600. .byte %00000000
  1601. .byte %11111111
  1602. .byte %10000011
  1603. .byte %10111110
  1604. .byte %10111110
  1605. .byte %10111110
  1606. .byte %10001110
  1607. .byte %10111110
  1608. .byte %10111110
  1609. .byte %10111110
  1610. .byte %10000011
  1611. .byte %11111111
  1612. .byte %00000000
  1613. .byte %11111111
  1614. .byte %00000000
  1615. .byte %11111111
  1616. .byte %00000000
  1617. .byte %11111111
  1618. .byte %00000000
  1619.  
  1620. Collect2LogoE:
  1621. .byte %00000000
  1622. .byte %11111111
  1623. .byte %00000000
  1624. .byte %11111111
  1625. .byte %00000000
  1626. .byte %11111111
  1627. .byte %00000000
  1628. .byte %11111111
  1629. .byte %00001000
  1630. .byte %11111110
  1631. .byte %11111110
  1632. .byte %11111110
  1633. .byte %11111110
  1634. .byte %11111110
  1635. .byte %11111110
  1636. .byte %11111110
  1637. .byte %00001110
  1638. .byte %11111111
  1639. .byte %00000000
  1640. .byte %11111111
  1641. .byte %00000000
  1642. .byte %11111111
  1643. .byte %00000000
  1644. .byte %11111111
  1645. .byte %00000000
  1646.  
  1647.  
  1648. Collect2LogoF:
  1649. .byte %00000000
  1650. .byte %11111111
  1651. .byte %00000000
  1652. .byte %11111111
  1653. .byte %00000000
  1654. .byte %11111111
  1655. .byte %00000000
  1656. .byte %11111111
  1657. .byte %00110001
  1658. .byte %11101110
  1659. .byte %11111110
  1660. .byte %11111110
  1661. .byte %11111101
  1662. .byte %11111011
  1663. .byte %11110111
  1664. .byte %11101111
  1665. .byte %11100000
  1666. .byte %11111111
  1667. .byte %00000000
  1668. .byte %11111111
  1669. .byte %00000000
  1670. .byte %11111111
  1671. .byte %00000000
  1672. .byte %11111111
  1673. .byte %00000000
  1674.  
  1675. PlayersA:
  1676. .byte %00110111
  1677. .byte %01010111
  1678. .byte %01010111
  1679. .byte %00110111
  1680. .byte %01110111
  1681. .byte %01110111
  1682. .byte %01110001
  1683.  
  1684. PlayersB:
  1685. .byte %10110101
  1686. .byte %01010101
  1687. .byte %01010101
  1688. .byte %00011011
  1689. .byte %01011011
  1690. .byte %01011011
  1691. .byte %01011011
  1692.  
  1693. PlayersC:
  1694. .byte %00010011
  1695. .byte %01110101
  1696. .byte %01110101
  1697. .byte %00110011
  1698. .byte %01110101
  1699. .byte %01110101
  1700. .byte %00010101
  1701.  
  1702. PlayersD:
  1703. .byte %10011111
  1704. .byte %01111111
  1705. .byte %01111111
  1706. .byte %10111111
  1707. .byte %11011111
  1708. .byte %11011111
  1709. .byte %00111111
  1710.  
  1711. OptionDigit1:
  1712. .byte %11111101
  1713. .byte %11111001
  1714. .byte %11111101
  1715. .byte %11111101
  1716. .byte %11111101
  1717. .byte %11111101
  1718. .byte %11111000
  1719.  
  1720. OptionDigit2:
  1721. .byte %11111001
  1722. .byte %11111110
  1723. .byte %11111110
  1724. .byte %11111101
  1725. .byte %11111011
  1726. .byte %11111011
  1727. .byte %11111000
  1728.  
  1729. TVtypeA:
  1730. .byte %00010101
  1731. .byte %10110101
  1732. .byte %10110101
  1733. .byte %10110101
  1734. .byte %10110101
  1735. .byte %10110101
  1736. .byte %10111011
  1737. TVtypeB:
  1738. .byte %11000101
  1739. .byte %11101101
  1740. .byte %11101101
  1741. .byte %01101110
  1742. .byte %11101110
  1743. .byte %11101110
  1744. .byte %11101110
  1745. TVtypeC:
  1746. .byte %01001100
  1747. .byte %01010101
  1748. .byte %01010101
  1749. .byte %11001100
  1750. .byte %11011101
  1751. .byte %11011101
  1752. .byte %11011100
  1753. TVtypeD:
  1754. .byte %01111111
  1755. .byte %11111111
  1756. .byte %11111111
  1757. .byte %11111111
  1758. .byte %11111111
  1759. .byte %11111111
  1760. .byte %01111111
  1761.  
  1762. OptionNTSCA:
  1763. .byte %10011000
  1764. .byte %10101101
  1765. .byte %10101101
  1766. .byte %10101101
  1767. .byte %10101101
  1768. .byte %10101101
  1769. .byte %10101101
  1770. OptionNTSCB:
  1771. .byte %11001101
  1772. .byte %10111010
  1773. .byte %10111011
  1774. .byte %11011011
  1775. .byte %11101011
  1776. .byte %11101010
  1777. .byte %10011101
  1778.  
  1779. OptionPALA:
  1780. .byte %11111001
  1781. .byte %11111010
  1782. .byte %11111010
  1783. .byte %11111001
  1784. .byte %11111011
  1785. .byte %11111011
  1786. .byte %11111011
  1787. OptionPALB:
  1788. .byte %11011011
  1789. .byte %10101011
  1790. .byte %10101011
  1791. .byte %10001011
  1792. .byte %10101011
  1793. .byte %10101011
  1794. .byte %10101000
  1795.  
  1796. OptionSECAMA:
  1797. .byte %01111100
  1798. .byte %11111011
  1799. .byte %11111011
  1800. .byte %11111101
  1801. .byte %11111110
  1802. .byte %11111110
  1803. .byte %01111001
  1804. OptionSECAMB:
  1805. .byte %10001101
  1806. .byte %10111010
  1807. .byte %10111011
  1808. .byte %10011011
  1809. .byte %10111011
  1810. .byte %10111010
  1811. .byte %10001101
  1812. OptionSECAMC:
  1813. .byte %11011010
  1814. .byte %10101000
  1815. .byte %10101010
  1816. .byte %10001010
  1817. .byte %10101010
  1818. .byte %10101010
  1819. .byte %10101010
  1820.  
  1821. RGBspace:
  1822. .byte %11111111
  1823. .byte %11111111
  1824. .byte %11111111
  1825. .byte %11111111
  1826. .byte %11111111
  1827. .byte %11111111
  1828. .byte %11111111
  1829. .byte %11111111
  1830. .byte %11111111
  1831. .byte %11111111
  1832. .byte %11111111
  1833. .byte %11111111
  1834. .byte %11111111
  1835. .byte %11111111
  1836. .byte %11111111
  1837. .byte %11111111
  1838. .byte %11111111
  1839. RGBA:
  1840. .byte %11111111
  1841. .byte %11111111
  1842. .byte %11111111
  1843. .byte %11111111
  1844. .byte %11111111
  1845. .byte %11111111
  1846. .byte %11111100
  1847. .byte %11111011
  1848. .byte %11111010
  1849. .byte %11111010
  1850. .byte %11111101
  1851. .byte %11111111
  1852. .byte %11111111
  1853. .byte %11111111
  1854. .byte %11111111
  1855. .byte %11111111
  1856. .byte %11111111
  1857. RGBB:
  1858. .byte %11111001
  1859. .byte %11111010
  1860. .byte %11111001
  1861. .byte %11111010
  1862. .byte %11111010
  1863. .byte %11111111
  1864. .byte %10011000
  1865. .byte %10101011
  1866. .byte %10011001
  1867. .byte %10101011
  1868. .byte %10101000
  1869. .byte %11111111
  1870. .byte %10011011
  1871. .byte %10101011
  1872. .byte %10011011
  1873. .byte %10101011
  1874. .byte %10011000
  1875. RGBC:
  1876. .byte %10001001
  1877. .byte %10111010
  1878. .byte %10011010
  1879. .byte %10111010
  1880. .byte %10001001
  1881. .byte %11111111
  1882. .byte %10001001
  1883. .byte %10111010
  1884. .byte %10011010
  1885. .byte %10111010
  1886. .byte %10001010
  1887. .byte %11111111
  1888. .byte %10101000
  1889. .byte %10101011
  1890. .byte %10101001
  1891. .byte %10101011
  1892. .byte %10001000
  1893.  
  1894. OptionSpace:
  1895. StartA:
  1896. .byte %11111111
  1897. .byte %11111111
  1898. .byte %11111111
  1899. .byte %11111111
  1900. .byte %11111111
  1901. .byte %11111111
  1902. .byte %11111111
  1903. .byte %11111111
  1904. StartB:
  1905. .byte %11100001
  1906. .byte %11011111
  1907. .byte %11011111
  1908. .byte %11100011
  1909. .byte %11111101
  1910. .byte %11111101
  1911. .byte %11111101
  1912. .byte %11000011
  1913. StartC:
  1914. .byte %00000110
  1915. .byte %11011101
  1916. .byte %11011101
  1917. .byte %11011100
  1918. .byte %11011101
  1919. .byte %11011101
  1920. .byte %11011101
  1921. .byte %11011101
  1922. StartD:
  1923. .byte %00110000
  1924. .byte %11010111
  1925. .byte %11010111
  1926. .byte %00010000
  1927. .byte %11010111
  1928. .byte %11010111
  1929. .byte %11010111
  1930. .byte %11010111
  1931. StartE:
  1932. .byte %11000001
  1933. .byte %01110111
  1934. .byte %01110111
  1935. .byte %11110111
  1936. .byte %01110111
  1937. .byte %01110111
  1938. .byte %01110111
  1939. .byte %01110111
  1940.  
  1941. SpiceWareLogoA:
  1942. .byte %00001111
  1943. .byte %00010000
  1944. .byte %00010000
  1945. .byte %00010000
  1946. .byte %00001111
  1947. .byte %00000000
  1948. .byte %00000000
  1949. .byte %00000000
  1950. .byte %11111111
  1951.  
  1952. SpiceWareLogoB:
  1953. .byte %11111111
  1954. .byte %00000000
  1955. .byte %00011001
  1956. .byte %00010101
  1957. .byte %10010101
  1958. .byte %01011001
  1959. .byte %01010001
  1960. .byte %01010001
  1961. .byte %10010001
  1962.  
  1963. SpiceWareLogoC:
  1964. .byte %11111111
  1965. .byte %00000000
  1966. .byte %00100111
  1967. .byte %01010100
  1968. .byte %01000100
  1969. .byte %01000110
  1970. .byte %01000100
  1971. .byte %01010100
  1972. .byte %00100111
  1973.  
  1974. SpiceWareLogoD:
  1975. .byte %11000001
  1976. .byte %01000001
  1977. .byte %01100011
  1978. .byte %00101010
  1979. .byte %00101010
  1980. .byte %00111110
  1981. .byte %00010100
  1982. .byte %00010100
  1983. .byte %00010100
  1984.  
  1985. SpiceWareLogoE:
  1986. .byte %11111111
  1987. .byte %00000000
  1988. .byte %00100110
  1989. .byte %01010101
  1990. .byte %01010101
  1991. .byte %01110110
  1992. .byte %01010101
  1993. .byte %01010101
  1994. .byte %01010101
  1995.  
  1996. SpiceWareLogoF:
  1997. .byte %11111111
  1998. .byte %00000000
  1999. .byte %01110000
  2000. .byte %01000000
  2001. .byte %01000000
  2002. .byte %01100000
  2003. .byte %01000000
  2004. .byte %01000000
  2005. .byte %01110000
  2006.  
  2007. MenuColors:
  2008. Collect2LogoColor:
  2009. .byte BLUE + 2, BLUE + 2 ; 0
  2010. .byte 0, 0 ; 1
  2011. .byte BLUE + 4, BLUE + 4 ; 2
  2012. .byte 0, 0 ; 3
  2013. .byte BLUE + 8, BLUE + 8 ; 4
  2014. .byte 0, 0 ; 5
  2015. .byte BLUE + 10, BLUE + 10 ; 6
  2016. .byte 0, 0 ; 7
  2017. .byte RED + 12, GREEN + 12 ; 8
  2018. .byte RED + 12, GREEN + 12 ; 9
  2019. .byte RED + 12, GREEN + 12 ; 10
  2020. .byte RED + 12, GREEN + 12 ; 11
  2021. .byte RED + 12, GREEN + 12 ; 12
  2022. .byte RED + 12, GREEN + 12 ; 13
  2023. .byte RED + 12, GREEN + 12 ; 14
  2024. .byte RED + 12, GREEN + 12 ; 15
  2025. .byte RED + 12, GREEN + 12 ; 16
  2026. .byte 0, 0 ; 17
  2027. .byte BLUE + 10, BLUE + 10 ; 18
  2028. .byte 0, 0 ; 19
  2029. .byte BLUE + 8, BLUE + 8 ; 20
  2030. .byte 0, 0 ; 21
  2031. .byte BLUE + 4, BLUE + 4 ; 22
  2032. .byte 0, 0 ; 23
  2033. .byte BLUE + 2, BLUE + 2 ; 24
  2034.  
  2035. MenuOptionGreen:
  2036. .byte GREEN + 8, BLUE + 8
  2037. .byte GREEN +10, BLUE +10
  2038. .byte GREEN +12, BLUE +12
  2039. .byte GREEN +14, BLUE +14
  2040. .byte GREEN +12, BLUE +12
  2041. .byte GREEN +10, BLUE +10
  2042. .byte GREEN + 8, BLUE + 8
  2043.  
  2044. MenuOptionRGB:
  2045. .byte RED+10, RED+10
  2046. .byte RED+12, RED+12
  2047. .byte RED+14, RED+14
  2048. .byte RED+12, RED+12
  2049. .byte RED+10, RED+10
  2050. .byte WHITE, WHITE
  2051. .byte GREEN+10, GREEN+10
  2052. .byte GREEN+12, GREEN+12
  2053. .byte GREEN+14, GREEN+14
  2054. .byte GREEN+12, GREEN+12
  2055. .byte GREEN+10, GREEN+10
  2056. .byte WHITE, WHITE
  2057. .byte BLUE+10, BLUE+10
  2058. .byte BLUE+12, BLUE+12
  2059. .byte BLUE+14, BLUE+14
  2060. .byte BLUE+12, BLUE+12
  2061. .byte BLUE+10, BLUE+10
  2062.  
  2063. MenuSelectedColor:
  2064. .byte GREY+6, GREY+ 8; 0
  2065. .byte GREY+6, GREY+10; 1
  2066. .byte GREY+6, GREY+12; 2
  2067. .byte GREY+6, GREY+14; 3
  2068. .byte GREY+6, GREY+14; 4
  2069. .byte GREY+6, GREY+12; 5
  2070. .byte GREY+6, GREY+10; 6
  2071. .byte GREY+6, GREY+ 8; 7
  2072.  
  2073. StartColor:
  2074. .byte WHITE, WHITE
  2075. .byte WHITE, WHITE
  2076. .byte WHITE, WHITE
  2077. .byte WHITE, WHITE
  2078. .byte WHITE, WHITE
  2079. .byte WHITE, WHITE
  2080. .byte WHITE, WHITE
  2081. .byte WHITE, WHITE
  2082.  
  2083. MenuColorsSize = * - MenuColors
  2084. MenuDataSize = * - MenuData
  2085.  
  2086. Delay:
  2087. .byte 0
  2088.  
  2089. if (* <= $1000)
  2090. echo "------",($1000 - *) , "bytes of Display Data ROM left"
  2091. ds ($1000 - *) ; pad out remaining space in Display Data ROM
  2092.  
  2093. else
  2094. echo "FATAL ERROR - Display Data exceeds 4K", *
  2095. err
  2096. endif
  2097.  
  2098. include DPC_frequencies.h
  2099.  
  2100.  
  2101. ;===============================================================================
  2102. ; custom/defines.h
  2103. ;----------------------------------------
  2104. ; Instead of manually keeping custom/defines_dasm.h in sync with what's in the
  2105. ; 6507 code, we'll have DASM echo out defines that can be copied/pasted into
  2106. ; the defines.h file.
  2107. ;
  2108. ; Wrapping the 6507 variables in []d will cause their values to be output in
  2109. ; decimal instead of hexadecimal. This is required because C requires a prefix
  2110. ; of 0x for hex values, but echo outputs them using $ for the prefix.
  2111. ;===============================================================================
  2112.  
  2113. echo ""
  2114. echo ""
  2115. echo ""
  2116. echo ""
  2117. echo ""
  2118. echo ""
  2119. echo "// Copy/paste the following to custom/defines_dasm.h"
  2120. echo ""
  2121. echo "// functions to run"
  2122. echo "#define ARM_INIT ", [ARM_INIT]d
  2123. echo "#define ARM_OS ", [ARM_OS]d
  2124. echo "#define ARM_VB ", [ARM_VB]d
  2125. echo "#define ARM_MENU_OS ", [ARM_MENU_OS]d
  2126. echo "#define ARM_MENU_VB ", [ARM_MENU_VB]d
  2127. echo ""
  2128.  
  2129. echo "// datastream DS_ToARM"
  2130. echo "#define FUNCTION queue[", [ARMfunction]d, "]"
  2131. echo "#define SWCHA queue[", [ARMswcha]d, "]"
  2132. echo "#define SWCHB queue[", [ARMswchb]d, "]"
  2133. echo "#define INPT4 queue[", [ARMinpt4]d, "]"
  2134. echo "#define INPT5 queue[", [ARMinpt5]d, "]"
  2135. echo "#define VB_TIME queue[", [ARMvbtime]d, "]"
  2136. echo "#define OS_TIME queue[", [ARMostime]d, "]"
  2137. echo "#define MODE queue[", [ARMmode]d, "]"
  2138. echo ""
  2139.  
  2140. echo "// datastream DS_FromARM"
  2141. echo "#define COLUPF queue[", [ARMcolupf]d, "]"
  2142. echo ""
  2143.  
  2144. echo "// Main Menu"
  2145. echo "#define MENU_FIRST_OPTION_ID ", [MENU_FIRST_OPTION_ID]d
  2146. echo "#define MENU_PLAYERS_ID ", [MENU_PLAYERS_ID]d
  2147. echo "#define MENU_TV_TYPE_ID ", [MENU_TV_TYPE_ID]d
  2148. echo "#define MENU_RGB_ID ", [MENU_RGB_ID]d
  2149. echo "#define MENU_START_ID ", [MENU_START_ID]d
  2150. echo "#define MENU_DATA ", [MenuData]d
  2151. echo "#define MENU_DATA_SIZE ", [MenuDataSize]d
  2152. echo "#define MENU_COLORS ", [MenuColors]d
  2153. echo "#define MENU_COLORS_SIZE ", [MenuColorsSize]d
  2154. echo "#define MENU_SELECTED_COLOR ", [MenuSelectedColor]d
  2155. echo "#define OPTION_DIGIT_1 ", [OptionDigit1]d
  2156. echo "#define OPTION_DIGIT_2 ", [OptionDigit2]d
  2157. echo "#define OPTION_PAL_A ", [OptionPALA]d
  2158. echo "#define OPTION_PAL_B ", [OptionPALB]d
  2159. echo "#define OPTION_SECAM_A ", [OptionSECAMA]d
  2160. echo "#define OPTION_SECAM_B ", [OptionSECAMB]d
  2161. echo "#define OPTION_SECAM_C ", [OptionSECAMC]d
  2162. echo "#define MM_JOYSTICK_TIMER queue[", [MM_JoystickTimer]d, "]"
  2163. echo "#define MM_FIRE_DOWN queue[", [MM_FireDown]d, "]"
  2164. echo "#define MM_SELECTED_OPTION queue[", [MM_SelectedOption]d, "]"
  2165. echo "#define MM_PLAYERS queue[", [MM_Players]d, "]"
  2166. echo "#define MM_TV_TYPE queue[", [MM_TVtype]d, "]"
  2167. echo ""
  2168.  
  2169. echo "// score and timer"
  2170. echo "#define FONT ", [[Font & $fff] + $4000]d
  2171. echo "#define LEFT_SCORE_A ", [LeftScoreA]d
  2172. echo "#define LEFT_SCORE_B ", [LeftScoreB]d
  2173. echo "#define TIMER_A ", [TimerA]d
  2174. echo "#define TIMER_B ", [TimerB]d
  2175. echo "#define RIGHT_SCORE_A ", [RightScoreA]d
  2176. echo "#define RIGHT_SCORE_B ", [RightScoreB]d
  2177. echo "#define SCORE_TIMER_COLORS ", [ScoreTimerColors]d
  2178. echo "#define CHARACTER_SPACE ", [Space]d
  2179. echo "#define CHARACTER_COLON ", [Colon]d
  2180. echo "#define CHARACTER_VB ", [VB]d
  2181. echo "#define CHARACTER_OS ", [OS]d
  2182. echo "#define DELAY ", [Delay]d
  2183. echo ""
  2184.  
  2185. echo "// Arena Kernel"
  2186. echo "#define ARENA_PF0 ", [ArenaPF0]d
  2187. echo "#define ARENA_PF1 ", [ArenaPF1]d
  2188. echo "#define ARENA_PF2 ", [ArenaPF2]d
  2189. echo "#define PLAYER0_DS ", [Player0DataStream]d
  2190. echo "#define PLAYER1_DS ", [Player1DataStream]d
  2191. echo "#define COLOR0_DS ", [Color0DataStream]d
  2192. echo "#define COLOR1_DS ", [Color1DataStream]d
  2193. echo "#define COLOR_DS_SIZE ", [ColorDataStreamSize]d
  2194. echo ""
  2195.  
  2196. echo "// colors"
  2197. echo "#define GREY ", [GREY]d
  2198. echo "#define YELLOW ", [YELLOW]d
  2199. echo "#define ORANGE ", [ORANGE]d
  2200. echo "#define RED_ORANGE ", [RED_ORANGE]d
  2201. echo "#define RED ", [RED]d
  2202. echo "#define PURPLE ", [PURPLE]d
  2203. echo "#define VIOLET ", [VIOLET]d
  2204. echo "#define BLUE ", [BLUE]d
  2205. echo "#define CYAN ", [CYAN]d
  2206. echo "#define GREEN ", [GREEN]d
  2207. echo "#define WHITE ", [WHITE]d
  2208. echo ""
  2209.  
  2210. echo ""
  2211. echo ""
  2212. echo ""
  2213. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement