ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 ; Copyright 1980 Atari, Inc. and Carol Shaw#
ATR image#
- Checkers_Source_Code_Atari_Assembler-Editor_with_DOS_2.0S_SD.atr ; to be used with the Atari Assembler Editor cartridge by Kathleen Ann O'Brien
- Checkers_Source_Code_Atari_Assembler-Editor_with_DOS_2.75_SD.atr ; to be used with the Atari Assembler Editor cartridge by Kathleen Ann O'Brien
TXT Files#
- Checkers Source Code.txt ; Checkers Display source code in a text file
- Checkers assembliert-0 Fehler.txt ; Checkers Display assembled with 0 errors in a text file
Source Code#
10 .TITLE "ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80" 20 ; 30 ;COPYRIGHT ATARI 1980 40 ; 50 ;THIS IS AN EXAMPLE OF A DISPLAY LIST WHICH USES CHARACTER MAPPING TO 60 ;PRODUCE THE CHECKERS AND THE TOP AND BOTTOM BORDERS OF THE BOARD. 70 ;PLAYERS ARE USED FOR THE RED SQUARES. THIS GIVES 6 COLORS WITHOUT 80 ;CHANGING THE COLOR REGISTERS. 90 ;MISSILES ARE USED FOR THE LEFT AND RIGHT BORDERS. 0100 ;THE PROGRAM STARTS AT THE LOCATION SPECIFIED BY PMB. 0110 ;A FEW TRICKS ARE USED TO SAVE RAM, BUT FURTHER OPTIMIZATION IS POSSIBLE 0120 ;ROM CARTRIDGE. 0140 ; 0150 ;COLLEEN (ATARI 800) EQUATES 0160 ; 0170 CHBASE = $D409 0180 DMACTL = $D400 0190 SDMCTL = $022F 0200 HPOSP0 = $D000 0210 SIZEP0 = $D008 0220 PCOLR0 = $02C0 0230 SDLSTL = $0230 0240 SDLSTH = $0231 0250 GRACTL = $D01D 0260 PMBASE = $D407 0270 GPRIOR = $026F 0280 VDSLST = $0200 0290 NMIEN = $D40E 0300 ; 0310 ;DISPLAY LIST EQUATES 0320 ; 0330 INT = $80 ;DISPLAY LIST INTERRUPT (BIT 7 OF NMI STATUS) 0340 JMPWT = $41 ;JUMP AND WAIT UNTIL END OF NEXT VERTICAL BLANK (2 BYTES) 0350 RELOAD = $40 ;RELOAD MEM SCAN COUNTER (2 BYTES) 0360 VSC = $20 ;VERTICAL SCROLL ENABLE 0370 HSC = $10 ;HORIZONTAL SCROLL ENABLE 0380 JUMP = 1 ;JUMP INSTRUCTION (2 BYTES) 0390 BLANK1 = 0 ;1 BLANK TV LINE 0400 BLANK2 = $10 ;2 BLANK LINES 0410 BLANK3 = $20 ;3 0420 BLANK4 = $30 ;4 0430 BLANK5 = $40 ;5 0440 BLANK6 = $50 ;6 0450 BLANK7 = $60 ;7 0460 BLANK8 = $70 ;8 BLANK TV LINES 0470 .PAGE 0480 ; 0490 INTOFF = $20 ;USED TO GET INTERNAL CODE FOR UPPER CASE ALPHANUMERICS 0500 ; 0510 ;INTERNAL CHARACTER CODES 0520 ; 0530 SPI = ' -INTOFF 0540 AI = 'A-INTOFF 0550 CI = 'C-INTOFF 0560 DI = 'D-INTOFF 0570 EI = 'E-INTOFF 0580 GI = 'G-INTOFF 0590 HI = 'H-INTOFF 0600 II = 'I-INTOFF 0610 OI = 'O-INTOFF 0620 PI = 'P-INTOFF 0630 RI = 'R-INTOFF 0640 TI = 'T-INTOFF 0650 YI = 'Y-INTOFF 0660 N1I = '1-INTOFF 0670 N8I = '8-INTOFF 0680 N9I = '9-INTOFF 0690 N0I = '0-INTOFF 0700 ; 0710 ;CHECKERS EQUATES 0720 ; 0730 ;CODES FOR SPECIAL CHECKERS CHARACTER SET 0740 ; 0750 EMPTY = 0 ;EMPTY SQUARE 0760 CHECKER= 1 ;ORDINARY CHECKER 0770 KING = 2 0780 CURS = 3 ;CURSOR (X) 0790 BORDER = 4 ;USED FOR TOP AND BOTTOM BORDERS OF BOARD 0800 ; 0810 CLP0 = 0 ;PLAYER 0 (HUMAN) 0820 CLP1 = $80 ;PLAYER 1 (COMPUTER) 0830 CLBOR = $C0 ;BORDER COLOR (USED TO SET UP 2 MSB'S OF CHAR) 0840 PMB = $5000 ;PLAYER MISSILE BASE ADDRESS & PROGRAM LOCATION 0850 .PAGE 0860 ; 0870 ; RAM VARIABLES 0880 ; 0890 *= PMB 0900 BOARD *= *+32 ;CHECKER BOARD (ONLY 32 BLOCK SQUARES ARE USED) 0910 T0 *= *+1 ;TEMP FOR MOVING BOARD TO MEM MAP 0920 ; 0930 ;PLAYER AND MISSILE GRAPHICS. 0940 ;PLAYERS ARE USED FOR SQUARES, MISSILES FOR LEFT AND RIGHT BORDERS. 0950 ; 0960 *= PMB+$180 0970 GRM03 *= *+$80 ;MISSILE GRAPHICS 0980 GRP0 *= *+$80 ;PLAYER 0 GRAPHICS 0990 GRP1 *= *+$80 ;PLAYER 1 1000 GRP2 *= *+$80 ; 2 1010 GRP3 *= *+$80 ; 3 1020 ; 1030 TITL *= *+20 ;TOP LINE OF CHARS -- ATASCII MESSAGE 1040 TOPBRD *= *+16 ;TOP BORDER OF BOARD 1050 BRDSP *= 8*16+* ;BOARD DISPLAY 1060 BOTBRD *= *+16 ;BOTTOM BORDER 1070 .PAGE 1080 ; 1090 ;GP -- SPECIAL CHECKERS CHARACTER SET (ONLY CODES 0-4 ARE USED). 1100 ; 1110 *= PMB+$600 1120 GR 1130 .BYTE 0,0,0,0,0,0,0,0 ; BLANK (0) 1140 .BYTE $3C,$7E,$FF,$FF,$FF,$FF,$7E,$3C ;CHECKER (1) 1150 .BYTE $3C,$7E,$A5,$A5,$C3,$C3,$7E,$3C ;KING (2) 1160 .BYTE $C3,$66,$3C,$18,$18,$3C,$66,$C3 ;CURSOR (3) 1170 .BYTE 0,$FF,$FF,$FF,$FF,$FF,$FF,0 ;BORDER (4) 1180 .PAGE 1190 ; 1200 ; 1210 ;DISPLAY LIST 1220 ; 1230 DSP 1240 .BYTE BLANK8 ;24 BLANK LINES 1250 .BYTE BLANK8 1260 .BYTE BLANK8 1270 .BYTE RELOAD+6 ;LINES 0-7 MESSAGE LINE: 20 ACROSS X 5 COLOR X 1 LINE RESOLUTION CHARACTERS 1280 .WORD TITL 1290 .BYTE INT+BLANK1 ;8. INTERRUPT TO CHANGE CHARACTER BASE ADDRESS AND CHANGE TO NARROW SCREEN. 1300 .BYTE 6 ;9-16. TOP BORDER: 16 X 5 X 1 CHARS (LAST LINE IS TOP OF 1ST ROW OF SQUARES) 1310 .BYTE BLANK2 ;17-18. TOP OF FIRST ROW OF SQUARES 1320 ; CHECKERBOARD (8 LINES OF CHARS WITH SPACES INBETWEEN - 22 LINES/SQUARE) 1330 .BYTE 7 ;19-34. 16X5X2 LINE RESOLUTION CHARS 1340 .BYTE BLANK6 ;35-40. FIRST 3 LINES=BOTTOM OF PREVIOUS SQUARE. 1350 .BYTE 7 ;41-56 1360 .BYTE BLANK6 ;57-62. LAST 3 LINES=TOP OF NEXT SQUARE. 1370 .BYTE 7 ;63-78 1380 .BYTE BLANK6 ;79-84 1390 .BYTE 7 ;85-100 1400 .BYTE BLANK6 ;101-106 1410 .BYTE 7 ;107-122 1420 .BYTE BLANK6 ;123-128 1430 .BYTE 7 ;129-144 1440 .BYTE BLANK6 ;145-150 1450 .BYTE 7 ;151-166 1460 .BYTE BLANK6 ;167-172 1470 .BYTE 7 ;173-188 1480 ; NEXT THREE LINES ARE BOTTOM OF PREVIOUS SQUARE 1490 .BYTE BLANK2 ;189-190. END OF NORMAL DISPLAY (SHOULD BE ON SCREEN ON ALL TV'S). 1500 .BYTE 6 ;191-198. BOTTOM BORDER (MAY OVERSCAN, BUT NOT ESSENTIAL TO GAME PLAY) 1510 .BYTE JMPWT ;WAIT FOR NEXT VBLANK, THEN START OVER 1520 .WORD DSP 1530 ; 1540 ; 1550 ;DSP -- DISPLAY LIST INTERRUPT HANDLER. 1560 ;CHANGES CHARACTER BASE AND WIDTH OF DISPLAY FOR SPECIAL CHECKERS GRAPHICS 1570 ;THE OS WILL CHANGE CHBASE BACK TO NORMAL DURING VERTICAL BLANK. 1580 ; 1590 NCHR 1600 PHA 1610 LDA #GR/256 1620 STA CHBASE 1630 ; 1640 ;INSTRUCTION FETCH DMA ENABLE, P/M 2 LINE RES, P/M DMA ENABLE, NARROW SCREEN (128 CLOCKS) 1650 LDA #$2D 1660 STA DMACTL 1670 PLA 1680 RTI 1690 .PAGE 1700 ; 1710 ;INITIALIZATION CODE -- START EXECUTION HERE 1720 ; 1730 *= PMB+$700 1740 ; 1750 ;INIT OS'S DMACTL VRRIRBLE 1760 ;INSTRUCTION FETCH DMA ENABLE, P/M 2 LINE RES, P/M DMA ENABLE, STANDARD SCREEN (160 CLOCKS) 1770 ; 1780 LDA #$2E 1790 STA SDMCTL 1800 ; 1810 ;CLEAR RAM 1820 ; 1830 LDA #0 1840 TAX 1850 INITLP 1860 STA PMB,X 1870 STA PMB+$100,X 1880 STA PMB+$200,X 1890 STA PMB+$300,X 1900 STA PMB+$400,X 1910 INX 1920 BNE INITLP 1930 ; 1940 ;INITIALIZE MISSILE GRAPHICS FOR BORDERS 1950 ; 1960 LDA #$0E 1970 LDY #$5E 1980 LQPZ STA GRM03+$14,Y 1990 DEY 2000 BNE LQPZ 2010 ; 2020 ;INITIALIZE TOP AND BOTTOM BORDERS. 2030 ; 2040 LDY #16 2050 LDA #CLBOR+BORDER 2060 TBLP STA TOPBRD-1,Y 2070 STA BOTBRD-1,Y 2080 DEY 2090 BNE TBLP ; CONTINUE UNTIL Y=0 2100 ; 2110 ;INITIALIZE PLAYER GRAPHICS FOR SQUARES (CHECKER BOARD) Y=0 2120 ; 2130 LDA #$F0 2140 IN2 LDX #10 2150 IN3 STA GRP0+$18,Y 2160 STA GRP1+$18,Y 2170 STA GRP2+$18,Y 2180 STA GRP3+$18,Y 2190 ; 2200 PHA 2210 LDA #$0A 2220 STA GRM03+$18,Y ;REST OF MISSILE GRAPHICS 2230 PLA 2240 INY 2250 DEX 2260 BPL IN3 2270 EOR #$FF ;FILL IN OPPOSITE SQUARES 2280 CPY #88 2290 BCC IN2 2300 LDY #8 2310 ; 2320 ; INITIALIZE PLAYER AND MISSILE POSITIONS AND COLORS 2330 ; 2340 IN4 LDA ITBL,Y 2350 STA HPOSP0,Y 2360 TXA ;$FF 2370 STA SIZEP0,Y ;$03 INDICATES 4 TIMES NORMAL SIZE (REST IS DON'T CARE) 2380 LDA ITBL1,Y 2390 STA PCOLR0,Y 2400 DEY 2410 BPL IN4 2420 ; 2430 ;OS, ANTIC, POKEY INITIALIZATION 2440 ; 2450 LDA #DSP&$FF ; DISPLAY LIST START ADDRESS (LSB) 2460 STA SDLSTL 2470 LDA #DSP/256 ; MSB OF ADDRESS 2480 STA SDLSTH 2490 LDA #3 ;ENABLE PLAYER/MISSILE DMA TO GRAPHICS REGS. 2500 STA GRACTL 2510 LDA #PMB/256 ;MSB OF ADDRESS OF PLAYER/MISSILE GRAPHICS 2520 STA PMBASE 2530 LDA #$14 ;5TH PLAYER ENABLE (USE PF3 FOR MISSILE COLOR), PF TAKES PRIO OVER PLAYERS 2540 STA GPRIOR ;OS PRIORITY REG 2550 LDA #NCHR&$FF ;DISPLAY LIST INTERRUPT VECTOR (LSB) 2560 STA VDSLST 2570 LDA #NCHR/256 2580 STA VDSLST+1 2590 STX NMIEN ;X=$FF $C0 ENABLES DISPLAY LIST & VBLANK INTERRUPTS. 2600 ; 2610 ;INITIALIZE BOARD DISPLAY 2620 ; 2630 LDX #11 2640 BRDLP 2650 LDA #CHECKER+CLP0 ;HUMAN PIECES ON SQUARES 0-11 2660 STA BOARD,X 2670 LDA #CHECKER+CLP1 ;COMPUTER PIECES ON SQUARES 20-31 2680 STA BOARD+20,X 2690 DEX 2700 BPL BRDLP 2710 ; 2720 ;MOVE COPYRIGHT MESSAGE TO MESSAGE DISPLAY LINE 2730 ; 2740 LDX #19 2750 IN6 LDA COPY,X 2760 STA TITL,X 2770 DEX 2780 BPL IN6 2790 ; 2800 ;LOOP TO MOVE BOARD TO GRAPHICS AREA. 2810 ;THE CHECKERS PROGRAM LOGIC COULD BE ADDED HERE OR A VBLANK INTERRUPT COULD BE USED. 2820 ; 2830 LOOP 2840 JSR UPCHR 2850 JMP LOOP 2860 ; 2870 ; 2880 ; 2890 ; 2900 ;UPCHR -- SUBROUTINE TO MOVE 32 BYTES OF CHECKER BOARD TO DISPLAY RAM. 2910 ; 2920 UPCHR 2930 LDX #31 ;SQUARE 31 = UPPER LEFT 2940 LDY #0 2950 UPLP1 2960 LDA #4-1 ;4 SQUARES/LINE 2970 STA T0 2980 UPLP2 2990 LDA BOARD,X 3000 STA BRDSP+2,Y ; FOR ROWS SHIFTED TO RIGHT 3010 LDA BOARD-4,X 3020 STA BRDSP+$10,Y ; FOR ROWS SHIFTED TO LEFT 3030 INY 3040 INY 3050 INY 3060 INY 3070 DEX 3080 DEC T0 3090 BPL UPLP2 3100 ; 3110 TYA 3120 CLC 3130 ADC #$10 3140 TAY 3150 TXA 3160 SBC #4-1 ;CARRY IS CLEAR (SUBTRACT 4) 3170 TAX 3180 BCS UPLP1 3190 RTS 3200 ; 3210 ; 3220 ; 3230 ; 3240 ;DATA 3250 ;HORIZONTAL POSITION OF PLAYERS (SQUARES) AND MISSILES (SIDE BORDERS). 3260 ;M0=RIGHT BORDER, M1=LEFT BORDER 3270 ;M2 & M3 ARE PLACED WITH M1. 3280 ; P0, P1, P2, P3, M0, M1, M2, M2 3290 ITBL 3300 .BYTE $3C,$5C,$7C,$9C,$BC,$38,$38,$38 3310 ; 3320 ;COLOR TABLE 3330 ITBL1 3340 .BYTE $34,$34,$34,$34 ;4 PLAYERS (RED SQUARES) 3350 .BYTE $36 ;PF0 RED CHECKERS AND MESSAGES 3360 .BYTE $88 ;PF1 BLUE CHARACTERS 3370 .BYTE $0E ;PF2 WHITE CHECKERS AND MESSAGES 3380 .BYTE $26 ;PF3 YELLOW BORDER (CHARS & MISSILES) 3390 .BYTE 0 ;BK: BLACK BACKGROUND 3400 ; 3410 ;"COPYRIGHT ATARI 1980" MESSAGE 3420 ; 3430 OF = $00 ;FOR PF0 COLOR (RED) 3440 OF2 = $80 ;FOR PF2 COLOR (WHITE) 3450 OF3 = $40 ;FOR PF1 COLOR (BLUE) 3460 TGTBL 3470 COPY .BYTE SPI,CI+OF,OI+OF,PI+OF,YI+OF,RI+OF,II+OF,GI+OF,HI+OF,TI+OF 3480 .BYTE AI+OF2,TI+OF2,AI+OF2,RI+OF2,II+OF2,N1I+OF3,N9I+OF3,N8I+OF3,N0I+OF3
Assembled Source Code with 0 errors#
0000 10 .TITLE "ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80" 20 ; 30 ;COPYRIGHT ATARI 1980 40 ; 50 ;THIS IS AN EXAMPLE OF A DISPLAY LIST WHICH USES CHARACTER MAPPING TO 60 ;PRODUCE THE CHECKERS AND THE TOP AND BOTTOM BORDERS OF THE BOARD. 70 ;PLAYERS ARE USED FOR THE RED SQUARES. THIS GIVES 6 COLORS WITHOUT 80 ;CHANGING THE COLOR REGISTERS. 90 ;MISSILES ARE USED FOR THE LEFT AND RIGHT BORDERS. 0100 ;THE PROGRAM STARTS AT THE LOCATION SPECIFIED BY PMB. 0110 ;A FEW TRICKS ARE USED TO SAVE RAM, BUT FURTHER OPTIMIZATION IS POSSIBLE 0120 ;ROM CARTRIDGE. 0140 ; 0150 ;COLLEEN (ATARI 800) EQUATES 0160 ; D409 0170 CHBASE = $D409 D400 0180 DMACTL = $D400 022F 0190 SDMCTL = $022F D000 0200 HPOSP0 = $D000 D008 0210 SIZEP0 = $D008 02C0 0220 PCOLR0 = $02C0 0230 0230 SDLSTL = $0230 0231 0240 SDLSTH = $0231 D01D 0250 GRACTL = $D01D D407 0260 PMBASE = $D407 026F 0270 GPRIOR = $026F 0200 0280 VDSLST = $0200 D40E 0290 NMIEN = $D40E 0300 ; 0310 ;DISPLAY LIST EQUATES 0320 ; 0080 0330 INT = $80 ;DISPLAY LIST INTERRUPT (BIT 7 OF NMI STATUS) 0041 0340 JMPWT = $41 ;JUMP AND WAIT UNTIL END OF NEXT VERTICAL BLANK (2 BYTES) 0040 0350 RELOAD = $40 ;RELOAD MEM SCAN COUNTER (2 BYTES) 0020 0360 VSC = $20 ;VERTICAL SCROLL ENABLE 0010 0370 HSC = $10 ;HORIZONTAL SCROLL ENABLE 0001 0380 JUMP = 1 ;JUMP INSTRUCTION (2 BYTES) 0000 0390 BLANK1 = 0 ;1 BLANK TV LINE 0010 0400 BLANK2 = $10 ;2 BLANK LINES 0020 0410 BLANK3 = $20 ;3 0030 0420 BLANK4 = $30 ;4 0040 0430 BLANK5 = $40 ;5 0050 0440 BLANK6 = $50 ;6 0060 0450 BLANK7 = $60 ;7 0070 0460 BLANK8 = $70 ;8 BLANK TV LINES ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 0000 0470 .PAGE 0480 ; 0020 0490 INTOFF = $20 ;USED TO GET INTERNAL CODE FOR UPPER CASE ALPHANUMERICS 0500 ; 0510 ;INTERNAL CHARACTER CODES 0520 ; 0000 0530 SPI = ' -INTOFF 0021 0540 AI = 'A-INTOFF 0023 0550 CI = 'C-INTOFF 0024 0560 DI = 'D-INTOFF 0025 0570 EI = 'E-INTOFF 0027 0580 GI = 'G-INTOFF 0028 0590 HI = 'H-INTOFF 0029 0600 II = 'I-INTOFF 002F 0610 OI = 'O-INTOFF 0030 0620 PI = 'P-INTOFF 0032 0630 RI = 'R-INTOFF 0034 0640 TI = 'T-INTOFF 0039 0650 YI = 'Y-INTOFF 0011 0660 N1I = '1-INTOFF 0018 0670 N8I = '8-INTOFF 0019 0680 N9I = '9-INTOFF 0010 0690 N0I = '0-INTOFF 0700 ; 0710 ;CHECKERS EQUATES 0720 ; 0730 ;CODES FOR SPECIAL CHECKERS CHARACTER SET 0740 ; 0000 0750 EMPTY = 0 ;EMPTY SQUARE 0001 0760 CHECKER= 1 ;ORDINARY CHECKER 0002 0770 KING = 2 0003 0780 CURS = 3 ;CURSOR (X) 0004 0790 BORDER = 4 ;USED FOR TOP AND BOTTOM BORDERS OF BOARD 0800 ; 0000 0810 CLP0 = 0 ;PLAYER 0 (HUMAN) 0080 0820 CLP1 = $80 ;PLAYER 1 (COMPUTER) 00C0 0830 CLBOR = $C0 ;BORDER COLOR (USED TO SET UP 2 MSB'S OF CHAR) 5000 0840 PMB = $5000 ;PLAYER MISSILE BASE ADDRESS & PROGRAM LOCATION ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 0000 0850 .PAGE 0860 ; 0870 ; RAM VARIABLES 0880 ; 0000 0890 *= PMB 5000 0900 BOARD *= *+32 ;CHECKER BOARD (ONLY 32 BLOCK SQUARES ARE USED) 5020 0910 T0 *= *+1 ;TEMP FOR MOVING BOARD TO MEM MAP 0920 ; 0930 ;PLAYER AND MISSILE GRAPHICS. 0940 ;PLAYERS ARE USED FOR SQUARES, MISSILES FOR LEFT AND RIGHT BORDERS. 0950 ; 5021 0960 *= PMB+$180 5180 0970 GRM03 *= *+$80 ;MISSILE GRAPHICS 5200 0980 GRP0 *= *+$80 ;PLAYER 0 GRAPHICS 5280 0990 GRP1 *= *+$80 ;PLAYER 1 5300 1000 GRP2 *= *+$80 ; 2 5380 1010 GRP3 *= *+$80 ; 3 1020 ; 5400 1030 TITL *= *+20 ;TOP LINE OF CHARS -- ATASCII MESSAGE 5414 1040 TOPBRD *= *+16 ;TOP BORDER OF BOARD 5424 1050 BRDSP *= 8*16+* ;BOARD DISPLAY 54A4 1060 BOTBRD *= *+16 ;BOTTOM BORDER ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 54B4 1070 .PAGE 1080 ; 1090 ;GP -- SPECIAL CHECKERS CHARACTER SET (ONLY CODES 0-4 ARE USED). 1100 ; 54B4 1110 *= PMB+$600 1120 GR 5600 00 1130 .BYTE 0,0,0,0,0,0,0,0 ; BLANK (0) 5601 00 5602 00 5603 00 5604 00 5605 00 5606 00 5607 00 5608 3C 1140 .BYTE $3C,$7E,$FF,$FF,$FF,$FF,$7E,$3C ;CHECKER (1) 5609 7E 560A FF 560B FF 560C FF 560D FF 560E 7E 560F 3C 5610 3C 1150 .BYTE $3C,$7E,$A5,$A5,$C3,$C3,$7E,$3C ;KING (2) 5611 7E 5612 A5 5613 A5 5614 C3 5615 C3 5616 7E 5617 3C 5618 C3 1160 .BYTE $C3,$66,$3C,$18,$18,$3C,$66,$C3 ;CURSOR (3) 5619 66 561A 3C 561B 18 561C 18 561D 3C 561E 66 561F C3 5620 00 1170 .BYTE 0,$FF,$FF,$FF,$FF,$FF,$FF,0 ;BORDER (4) 5621 FF 5622 FF 5623 FF 5624 FF 5625 FF 5626 FF 5627 00 ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 5628 1180 .PAGE 1190 ; 1200 ; 1210 ;DISPLAY LIST 1220 ; 1230 DSP 5628 70 1240 .BYTE BLANK8 ;24 BLANK LINES 5629 70 1250 .BYTE BLANK8 562A 70 1260 .BYTE BLANK8 562B 46 1270 .BYTE RELOAD+6 ;LINES 0-7 MESSAGE LINE: 20 ACROSS X 5 COLOR X 1 LINE RESOLUTION CHARACTERS 562C 0054 1280 .WORD TITL 562E 80 1290 .BYTE INT+BLANK1 ;8. INTERRUPT TO CHANGE CHARACTER BASE ADDRESS AND CHANGE TO NARROW SCREEN. 562F 06 1300 .BYTE 6 ;9-16. TOP BORDER: 16 X 5 X 1 CHARS (LAST LINE IS TOP OF 1ST ROW OF SQUARES) 5630 10 1310 .BYTE BLANK2 ;17-18. TOP OF FIRST ROW OF SQUARES 1320 ; CHECKERBOARD (8 LINES OF CHARS WITH SPACES INBETWEEN - 22 LINES/SQUARE) 5631 07 1330 .BYTE 7 ;19-34. 16X5X2 LINE RESOLUTION CHARS 5632 50 1340 .BYTE BLANK6 ;35-40. FIRST 3 LINES=BOTTOM OF PREVIOUS SQUARE. 5633 07 1350 .BYTE 7 ;41-56 5634 50 1360 .BYTE BLANK6 ;57-62. LAST 3 LINES=TOP OF NEXT SQUARE. 5635 07 1370 .BYTE 7 ;63-78 5636 50 1380 .BYTE BLANK6 ;79-84 5637 07 1390 .BYTE 7 ;85-100 5638 50 1400 .BYTE BLANK6 ;101-106 5639 07 1410 .BYTE 7 ;107-122 563A 50 1420 .BYTE BLANK6 ;123-128 563B 07 1430 .BYTE 7 ;129-144 563C 50 1440 .BYTE BLANK6 ;145-150 563D 07 1450 .BYTE 7 ;151-166 563E 50 1460 .BYTE BLANK6 ;167-172 563F 07 1470 .BYTE 7 ;173-188 1480 ; NEXT THREE LINES ARE BOTTOM OF PREVIOUS SQUARE 5640 10 1490 .BYTE BLANK2 ;189-190. END OF NORMAL DISPLAY (SHOULD BE ON SCREEN ON ALL TV'S). 5641 06 1500 .BYTE 6 ;191-198. BOTTOM BORDER (MAY OVERSCAN, BUT NOT ESSENTIAL TO GAME PLAY) 5642 41 1510 .BYTE JMPWT ;WAIT FOR NEXT VBLANK, THEN START OVER 5643 2856 1520 .WORD DSP 1530 ; 1540 ; 1550 ;DSP -- DISPLAY LIST INTERRUPT HANDLER. 1560 ;CHANGES CHARACTER BASE AND WIDTH OF DISPLAY FOR SPECIAL CHECKERS GRAPHICS 1570 ;THE OS WILL CHANGE CHBASE BACK TO NORMAL DURING VERTICAL BLANK. 1580 ; 1590 NCHR 5645 48 1600 PHA 5646 A956 1610 LDA #GR/256 5648 8D09D4 1620 STA CHBASE 1630 ; 1640 ;INSTRUCTION FETCH DMA ENABLE, P/M 2 LINE RES, P/M DMA ENABLE, NARROW SCREEN (128 CLOCKS) 564B A92D 1650 LDA #$2D 564D 8D00D4 1660 STA DMACTL 5650 68 1670 PLA 5651 40 1680 RTI ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 5652 1690 .PAGE 1700 ; 1710 ;INITIALIZATION CODE -- START EXECUTION HERE 1720 ; 5652 1730 *= PMB+$700 1740 ; 1750 ;INIT OS'S DMACTL VRRIRBLE 1760 ;INSTRUCTION FETCH DMA ENABLE, P/M 2 LINE RES, P/M DMA ENABLE, STANDARD SCREEN (160 CLOCKS) 1770 ; 5700 A92E 1780 LDA #$2E 5702 8D2F02 1790 STA SDMCTL 1800 ; 1810 ;CLEAR RAM 1820 ; 5705 A900 1830 LDA #0 5707 AA 1840 TAX 1850 INITLP 5708 9D0050 1860 STA PMB,X 570B 9D0051 1870 STA PMB+$100,X 570E 9D0052 1880 STA PMB+$200,X 5711 9D0053 1890 STA PMB+$300,X 5714 9D0054 1900 STA PMB+$400,X 5717 E8 1910 INX 5718 D0EE 1920 BNE INITLP 1930 ; 1940 ;INITIALIZE MISSILE GRAPHICS FOR BORDERS 1950 ; 571A A90E 1960 LDA #$0E 571C A05E 1970 LDY #$5E 571E 999451 1980 LQPZ STA GRM03+$14,Y 5721 88 1990 DEY 5722 D0FA 2000 BNE LQPZ 2010 ; 2020 ;INITIALIZE TOP AND BOTTOM BORDERS. 2030 ; 5724 A010 2040 LDY #16 5726 A9C4 2050 LDA #CLBOR+BORDER 5728 991354 2060 TBLP STA TOPBRD-1,Y 572B 99A354 2070 STA BOTBRD-1,Y 572E 88 2080 DEY 572F D0F7 2090 BNE TBLP ; CONTINUE UNTIL Y=0 2100 ; 2110 ;INITIALIZE PLAYER GRAPHICS FOR SQUARES (CHECKER BOARD) Y=0 2120 ; 5731 A9F0 2130 LDA #$F0 5733 A20A 2140 IN2 LDX #10 5735 991852 2150 IN3 STA GRP0+$18,Y 5738 999852 2160 STA GRP1+$18,Y 573B 991853 2170 STA GRP2+$18,Y 573E 999853 2180 STA GRP3+$18,Y 2190 ; 5741 48 2200 PHA 5742 A90A 2210 LDA #$0A 5744 999851 2220 STA GRM03+$18,Y ;REST OF MISSILE GRAPHICS 5747 68 2230 PLA 5748 C8 2240 INY 5749 CA 2250 DEX 574A 10E9 2260 BPL IN3 574C 49FF 2270 EOR #$FF ;FILL IN OPPOSITE SQUARES ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 574E C058 2280 CPY #88 5750 90E1 2290 BCC IN2 5752 A008 2300 LDY #8 2310 ; 2320 ; INITIALIZE PLAYER AND MISSILE POSITIONS AND COLORS 2330 ; 5754 B9D857 2340 IN4 LDA ITBL,Y 5757 9900D0 2350 STA HPOSP0,Y 575A 8A 2360 TXA ;$FF 575B 9908D0 2370 STA SIZEP0,Y ;$03 INDICATES 4 TIMES NORMAL SIZE (REST IS DON'T CARE) 575E B9E057 2380 LDA ITBL1,Y 5761 99C002 2390 STA PCOLR0,Y 5764 88 2400 DEY 5765 10ED 2410 BPL IN4 2420 ; 2430 ;OS, ANTIC, POKEY INITIALIZATION 2440 ; 5767 A928 2450 LDA #DSP&$FF ; DISPLAY LIST START ADDRESS (LSB) 5769 8D3002 2460 STA SDLSTL 576C A956 2470 LDA #DSP/256 ; MSB OF ADDRESS 576E 8D3102 2480 STA SDLSTH 5771 A903 2490 LDA #3 ;ENABLE PLAYER/MISSILE DMA TO GRAPHICS REGS. 5773 8D1DD0 2500 STA GRACTL 5776 A950 2510 LDA #PMB/256 ;MSB OF ADDRESS OF PLAYER/MISSILE GRAPHICS 5778 8D07D4 2520 STA PMBASE 577B A914 2530 LDA #$14 ;5TH PLAYER ENABLE (USE PF3 FOR MISSILE COLOR), PF TAKES PRIO OVER PLAYERS 577D 8D6F02 2540 STA GPRIOR ;OS PRIORITY REG 5780 A945 2550 LDA #NCHR&$FF ;DISPLAY LIST INTERRUPT VECTOR (LSB) 5782 8D0002 2560 STA VDSLST 5785 A956 2570 LDA #NCHR/256 5787 8D0102 2580 STA VDSLST+1 578A 8E0ED4 2590 STX NMIEN ;X=$FF $C0 ENABLES DISPLAY LIST & VBLANK INTERRUPTS. 2600 ; 2610 ;INITIALIZE BOARD DISPLAY 2620 ; 578D A20B 2630 LDX #11 2640 BRDLP 578F A901 2650 LDA #CHECKER+CLP0 ;HUMAN PIECES ON SQUARES 0-11 5791 9D0050 2660 STA BOARD,X 5794 A981 2670 LDA #CHECKER+CLP1 ;COMPUTER PIECES ON SQUARES 20-31 5796 9D1450 2680 STA BOARD+20,X 5799 CA 2690 DEX 579A 10F3 2700 BPL BRDLP 2710 ; 2720 ;MOVE COPYRIGHT MESSAGE TO MESSAGE DISPLAY LINE 2730 ; 579C A213 2740 LDX #19 579E BDE957 2750 IN6 LDA COPY,X 57A1 9D0054 2760 STA TITL,X 57A4 CA 2770 DEX 57A5 10F7 2780 BPL IN6 2790 ; 2800 ;LOOP TO MOVE BOARD TO GRAPHICS AREA. 2810 ;THE CHECKERS PROGRAM LOGIC COULD BE ADDED HERE OR A VBLANK INTERRUPT COULD BE USED. 2820 ; 2830 LOOP 57A7 20AD57 2840 JSR UPCHR 57AA 4CA757 2850 JMP LOOP 2860 ; ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 2870 ; 2880 ; 2890 ; 2900 ;UPCHR -- SUBROUTINE TO MOVE 32 BYTES OF CHECKER BOARD TO DISPLAY RAM. 2910 ; 2920 UPCHR 57AD A21F 2930 LDX #31 ;SQUARE 31 = UPPER LEFT 57AF A000 2940 LDY #0 2950 UPLP1 57B1 A903 2960 LDA #4-1 ;4 SQUARES/LINE 57B3 8D2050 2970 STA T0 2980 UPLP2 57B6 BD0050 2990 LDA BOARD,X 57B9 992654 3000 STA BRDSP+2,Y ; FOR ROWS SHIFTED TO RIGHT 57BC BDFC4F 3010 LDA BOARD-4,X 57BF 993454 3020 STA BRDSP+$10,Y ; FOR ROWS SHIFTED TO LEFT 57C2 C8 3030 INY 57C3 C8 3040 INY 57C4 C8 3050 INY 57C5 C8 3060 INY 57C6 CA 3070 DEX 57C7 CE2050 3080 DEC T0 57CA 10EA 3090 BPL UPLP2 3100 ; 57CC 98 3110 TYA 57CD 18 3120 CLC 57CE 6910 3130 ADC #$10 57D0 A8 3140 TAY 57D1 8A 3150 TXA 57D2 E903 3160 SBC #4-1 ;CARRY IS CLEAR (SUBTRACT 4) 57D4 AA 3170 TAX 57D5 B0DA 3180 BCS UPLP1 57D7 60 3190 RTS 3200 ; 3210 ; 3220 ; 3230 ; 3240 ;DATA 3250 ;HORIZONTAL POSITION OF PLAYERS (SQUARES) AND MISSILES (SIDE BORDERS). 3260 ;M0=RIGHT BORDER, M1=LEFT BORDER 3270 ;M2 & M3 ARE PLACED WITH M1. 3280 ; P0, P1, P2, P3, M0, M1, M2, M2 3290 ITBL 57D8 3C 3300 .BYTE $3C,$5C,$7C,$9C,$BC,$38,$38,$38 57D9 5C 57DA 7C 57DB 9C 57DC BC 57DD 38 57DE 38 57DF 38 3310 ; 3320 ;COLOR TABLE 3330 ITBL1 57E0 34 3340 .BYTE $34,$34,$34,$34 ;4 PLAYERS (RED SQUARES) 57E1 34 57E2 34 57E3 34 57E4 36 3350 .BYTE $36 ;PF0 RED CHECKERS AND MESSAGES ATARI 800 CHECKERS DISPLAY BY C. SHAW 3/31/80 57E5 88 3360 .BYTE $88 ;PF1 BLUE CHARACTERS 57E6 0E 3370 .BYTE $0E ;PF2 WHITE CHECKERS AND MESSAGES 57E7 26 3380 .BYTE $26 ;PF3 YELLOW BORDER (CHARS & MISSILES) 57E8 00 3390 .BYTE 0 ;BK: BLACK BACKGROUND 3400 ; 3410 ;"COPYRIGHT ATARI 1980" MESSAGE 3420 ; 0000 3430 OF = $00 ;FOR PF0 COLOR (RED) 0080 3440 OF2 = $80 ;FOR PF2 COLOR (WHITE) 0040 3450 OF3 = $40 ;FOR PF1 COLOR (BLUE) 3460 TGTBL 57E9 00 3470 COPY .BYTE SPI,CI+OF,OI+OF,PI+OF,YI+OF,RI+OF,II+OF,GI+OF,HI+OF,TI+OF 57EA 23 57EB 2F 57EC 30 57ED 39 57EE 32 57EF 29 57F0 27 57F1 28 57F2 34 57F3 A1 3480 .BYTE AI+OF2,TI+OF2,AI+OF2,RI+OF2,II+OF2,N1I+OF3,N9I+OF3,N8I+OF3,N0I+OF3 57F4 B4 57F5 A1 57F6 B2 57F7 A9 57F8 51 57F9 59 57FA 58 57FB 50 0 ERRORS