0 ;     MAXTER MIND›20 ;         BY›30 ;      BOB POLIN›40 ;›50 ;    ADAPTED FROM›60 ; SYNASSEMBLER VERSION›70 ;**********************›80 ;*G7810 TO RUN PROGRAM*›90 ;**********************›0100  .OPT NOLIST›0110  *=$7800›0120 SC=$7000          SCREEN›0130 PM=$7000          PLAYER-MISSILE›0140 P0=PM+$400        PLAYER0›0150 P1=PM+$500›0160 P2=PM+$600›0170 P3=PM+$700›0180 MISL=PM+$300      MISSILES›0190 PMBASE=$D407›0200 NMIEN=$D40E›0210 CHBASE=$D409›0220 WSYNC=$D40A›0230 RANDOM=$D20A›0240 HPOP0=$D000›0250 HPOSP1=$D001›0260 HPOSP2=$D002›0270 HPOSP3=$D003›0280 HPOSM0=$D004›0290 SIZEP0=$D008›0300 SIZEP2=$D00A›0310 SIZEM=$D00C›0320 COLPM0=$D012›0330 COLPM2=$D014›0340 COLPM3=$D015›0350 COLPF0=$D016›0360 COLPF1=$D017›0370 COLPF2=$D018›0380 COLPF3=$D019›0390 COLBK=$D01A›0400 GRACTL=$D01D›0410 CONSOL=$D01F›0420 RTCLOCK=$14›0430 VDSLST=$200›0440 SDMCTL=$22F›0450 SDLSTL=$230›0460 STICK0=$278›0470 STRIG0=$284›0480 COLOR0=$2C4›0490 COLOR4=$2C8›0500 PCOLR0=$2C0›0510 PCOLR1=$2C1›0520 PCOLR2=$2C2›0530 PCOLR3=$2C3›0540 CH=$2FC›0550 POS=$B4           SCREEN POSITION›0560 ;                 OF CURRENT ENTRY›0570 CSRPOS=$600       CURSOR POSITION›0580 COUNTER=$601›0590 LINE1=$602›0600 LINE2=$607›0610 LINE3=$60C›0620 LINE4=$611›0630 LINE5=$616›0640 LINE6=$61B›0650 LINE7=$620›0660 LINE8=$625›0670 LINE9=$62A›0680 LINE10=$62F›0690 LINE11=$634›0700 ANSPOS=$639       ANSWER POSITION›0710 ;                 ON THE SCREEN›0720 TRIGV=$63E        TRIGGER VALUE›0730 NUMPCK=$63F       NUMBER OF›0740 ;                 PICK (0-4)›0750 ANSWER=$643›0760 GRNBAR=$648       NO. OF GRN BARS›0770 REDBAR=$649       NO. OF RED BARS›0780 VPOSBAR=$64A      VERTICAL POS OF›0790 ;                 RED OR GRN BAR›0800 STRTPRS=$FE       NON 0=START›0810 ;                 BUTTON PRESSED›0820 TEMP1=$B0         TEMPORARY›0830 TEMP2=$B1         CALCULATION›0840 TEMP3=$B2         REGISTERS›0850 CHSET .BYTE 0,0,0,0,0,0,0,0›0860  .BYTE $7C,$FE,$BA,$EE,$BA,$C6,$7C,0›0870  LDA #0›0880  STA STRTPRS›0890 START LDA #0›0900  STA SDMCTL       TURN OFF DMA›0910  LDX #$7F›0920 E STA $600,X      CLEAR 1/2 OF›0930  STA SC+300,X     PAGE 6 & PART›0940  DEX              OF SCREEN›0950  BPL E›0960  LDX #MISL&255    CLEAR PLAYER-›0970  STX TEMP1        MISSILE MEMORY›0980  LDX #MISL/256›0990  STX TEMP2›1000  LDX #5›1010  LDY #0›1020 C STA (TEMP1),Y›1030  DEY›1040  BNE C›1050  INC TEMP2›1060  DEX›1070  BNE C›1080  STA COLOR4       BLACK BKGD›1090  LDA #$2A         YELLOW›1100  STA PCOLR3›1110  LDA #$46         RED›1120  STA PCOLR0›1130  LDA #$C4         GREEN›1140  STA PCOLR1›1150  LDA #$CA         LIGHT GREEN›1160  STA PCOLR2›1170  LDA #DL&255      STORE ADDRESS›1180  STA SDLSTL       OF DISPLAY LIST›1190  LDA #DL/256›1200  STA SDLSTL+1›1210  LDA #DLIR1&255   STORE ADDRESS›1220  STA VDSLST       OF DISPLAY LIST›1230  LDA #DLIR1/256   INTERRUPT›1240  STA VDSLST+1     ROUTINE #1›1250  LDA #166›1260  STA VPOSBAR›1270  LDA #192         ENABLE DLI›1280  STA NMIEN›1290  LDA #3           ENABLE PM›1300  STA GRACTL       GRAPHICS›1310  STA SIZEM        QUAD SIZED MISL›1320  LDA #62          ENABLE DMA &›1330  STA SDMCTL       PM GRAPHICS›1340  LDA #1           DRAW FACE›1350  STA SC+405       WITH COLOR 0›1360  STA SC+385       CURSOR›1370  STA COUNTER      INITIALIZE CNTR›1380  LDA #$41         COLOR 1›1390  STA SC+406›1400  LDA #$81         COLOR 2›1410  STA SC+407›1420  LDA #$C1         COLOR 3›1430  STA SC+408›1440  LDA #13          DRAW 12 LINES›1450  STA TEMP3        OF FACES›1460  LDA #SC+100&255  BLACK AT THIS›1470  STA TEMP1        POINT›1480  LDA #SC+100/256›1490  STA TEMP2        4 ON EACH LINE›1500 G DEC TEMP3       USING COLORS›1510  BEQ F            0 TO 3›1520  LDY #8›1530  LDX #3›1540 H  LDA IM,X›1550  STA (TEMP1),Y›1560  DEY›1570  DEY›1580  DEX›1590  BPL H›1600  LDA TEMP1›1610  CLC›1620  ADC #20          NEXT LINE›1630  STA TEMP1›1640  BCC G›1650  INC TEMP2›1660  BNE G›1670 F LDX #10         PRINT›1680 I LDA MXMND,X     "MAXTER MIND"›1690  STA SC+44,X      ON TOP OF›1700  DEX              SCREEN›1710  BPL I›1720  LDA #12          DRAW 1 FACE›1730  STA TEMP3        ON EACH OF 12›1740  LDY #171         LINES WITH›1750 K LDX #7          PLAYER 3›1760 J LDA PLIM,X›1770  STA P3,Y›1780  DEY›1790  DEX›1800  BPL J›1810  DEC TEMP3›1820  BNE K›1830  LDY #208›1840  LDX #7           DRAW 4›1850 D LDA PLIM,X      FACES›1860  STA P0,Y         AT BOTTOM›1870  STA P1,Y         OF SCREEN›1880  STA P2,Y›1890  STA P3,Y›1900  DEY›1910  DEX›1920  BPL D›1930  LDA #PM/256›1940  STA PMBASE›1950  LDA #128›1960  STA HPOSP3›1970  LDA #136›1980  STA HPOSP1›1990  LDA #144›2000  STA HPOSP2›2010  STA HPOSM0›2020  LDA #1›2030  STA TRIGV›2040  LDA #$FF›2050  STA POS›2060  LDA #4           PICK ANSWER›2070  STA TEMP1›2080 L LDY #4›2090  LDA RANDOM       PICK COLORS›2100  AND #7›2110  TAX›2120  LDA COLOR,X›2130 M CMP ANSWER,Y›2140  BEQ L            COLOR EXISTS-›2150 ;                 PICK AGAIN›2160  DEY›2170  BPL M›2180  LDX TEMP1        COLOR DOES NOT›2190  STA ANSWER,X     EXIST-STORE IT›2200  DEC TEMP1›2210  BPL L            PICK NEXT COLOR›2220  JSR TIMER        DELAY›2230  LDA STRTPRS      START GAME IF›2240  BNE SRT          <> 0›2250 N JSR CKSTRT›2260  LDA RTCLOCK      FLASH PURPLE›2270  AND #$F          "MAXTER MIND"›2280  ORA #$60›2290  STA COLOR0›2300  BNE N›2310 SRT JSR JOYST     SUBROUTINE LOOP›2320  JSR CKSTRT       THAT PLAYS THE›2330  JSR MOVE         GAME›2340  JSR CLEAR›2350  JSR OPT›2360  JSR TIMER›2370  JMP SRT›2380 CALC LDA #0       CALCULATES THE›2390  STA GRNBAR       NUMBER OF›2400  STA REDBAR       CORRECT CHOICES›2410  LDX #4           ON EACH LINE›2420  LDY POS›2430  STY TEMP1        CHECK HOW MANY›2440 O LDY TEMP1       GRN BARS›2450  LDA LINE1,Y›2460  CMP ANSWER,X›2470  BNE P›2480  INC GRNBAR›2490 P DEC TEMP1›2500  DEX›2510  BPL O›2520  LDA #30          DELAY BEFORE›2530  STA TEMP1        PRINTING RESULT›2540 Q JSR TIMER›2550  DEC TEMP1›2560  BNE Q›2570  LDY VPOSBAR›2580  LDA GRNBAR       PRINT GRN BARS›2590  BEQ R            FOR CORRECT›2600  CMP #1           COLOR & POS›2610  BEQ S›2620  CMP #2›2630  BEQ T›2640  CMP #3›2650  BEQ U›2660  CMP #4›2670  BEQ V›2680  LDX #4           GRNBAR=5›2690 W LDA ANSWER,X    PRINT CORRECT›2700  STA ANSPOS,X     ANSWER›2710  DEX›2720  BPL W›2730  INX              BLACKEN›2740  STX COLOR0       "MAXTER MIND"›2750 X JSR CKSTRT›2760  LDA RTCLOCK      FLASH TOP OF›2770  STA COLOR4       SCREEN›2780  JMP X›2790 S LDA #$40        1 GRN BAR FOR›2800  BNE Y            EACH CHOICE›2810 T LDA #$50        CORRECT IN BOTH›2820  BNE Y            COLOR AND›2830 U LDA #$54        POSITION›2840  BNE Y›2850 V LDA #$55›2860 Y STA P2+1,Y›2870  STA P2+2,Y›2880  STA P2+3,Y›2890 R LDA #4          CHECK HOW MANY›2900  STA TEMP2        RED BARS›2910  LDY POS›2920 Z LDX #4›2930 AA LDA LINE1,Y›2940  CMP ANSWER,X›2950  BNE AB›2960  INC REDBAR›2970 AB DEX›2980  BPL AA›2990  DEY›3000  DEC TEMP2›3010  BPL Z›3020  LDY VPOSBAR›3030  LDA REDBAR›3040  SEC›3050  SBC GRNBAR›3060  BEQ AC›3070  CMP #1           1 RED BAR FOR›3080  BEQ AD           EACH CHOICE›3090  CMP #2           CORRECT IN›3100  BEQ AE           COLOR BUT›3110  CMP #3           INCORRECT IN›3120  BEQ AF           POSITION›3130  CMP #4›3140  BEQ BA›3150  LDA #1           USE MISL0 IF›3160  STA MISL+1,Y     5TH RED BAR›3170  STA MISL+2,Y     NEEDED›3180  STA MISL+3,Y›3190 BA LDA #$55›3200 AG STA P0+1,Y›3210  STA P0+2,Y›3220  STA P0+3,Y›3230 AC RTS›3240 AD LDA #1›3250  BNE AG›3260 AE LDA #5›3270  BNE AG›3280 AF LDA #$15›3290  BNE AG›3300 OPT LDA CONSOL    CHECK IF OPTION›3310  CMP #3           PRESSED=GIVE›3320  BEQ LANE         UP›3330  RTS›3340 LANE LDX #4›3350  STX CONSOL       CLICK SPEAKER &›3360 AH LDA ANSWER,X   PRINT ANSWER›3370  STA ANSPOS,X›3380  DEX›3390  BPL AH›3400 AI JSR CKSTRT›3410  JMP AI›3420 DLIR1 PHA›3430  TXA›3440  PHA›3450  LDA #3           QUAD SIZE›3460  STA SIZEP0›3470  STA SIZEP2›3480  LDA #$62         PURPLE›3490  STA WSYNC        WAIT TILL HORIZ›3500 ;                 BLANK BEFORE›3510 ;                 CHANGING COLOR›3520  STA COLBK›3530  LDA #152›3540  STA HPOP0›3550  LDA #CHSET/256   CHARACTER SET›3560  STA CHBASE›3570  LDA #DLIR2&255›3580  LDX #DLIR2/256›3590 RESTORE STA VDSLST›3600  STX VDSLST+1     STORE ADDRESS›3610  PLA              OF NEXT DLIR &›3620  TAX              RESTORE›3630  PLA              REGISTERS›3640  RTI›3650 DLIR2 PHA›3660  TXA›3670  PHA›3680  LDA #0           BLACK›3690  STA WSYNC›3700  STA COLBK›3710  LDX #4›3720 AJ LDA ANSPOS,X   ANSPOS TO›3730  STA COLPM3,X     ANSPOS+4 IS›3740  DEX              BLACK (0) TILL›3750  BPL AJ           ANSWER PRINTED›3760  LDA #DLIR3&255›3770  LDX #DLIR3/256›3780  BNE RESTORE›3790 DLIR3 PHA›3800  TXA›3810  PHA›3820  LDX #4›3830 AK LDA LINE11,X   LINE11 TO LINE1›3840  STA COLPM3,X     ARE ALL BLACK›3850  DEX              TILL CHOICES›3860  BPL AK           ARE ENTERED›3870  LDA #DLIR4&255   ON THEM›3880  LDX #DLIR4/256›3890  JMP RESTORE›3900 DLIR4 PHA›3910  TXA›3920  PHA›3930  LDX #4›3940 AL LDA LINE10,X›3950  STA COLPM3,X›3960  DEX›3970  BPL AL›3980  LDA #DLIR5&255›3990  LDX #DLIR5/256›4000  JMP RESTORE›4010 DLIR5 PHA›4020  TXA›4030  PHA›4040  LDX #4›4050 AM LDA LINE9,X›4060  STA COLPM3,X›4070  DEX›4080  BPL AM›4090  LDA #DLIR6&255›4100  LDX #DLIR6/256›4110  JMP RESTORE›4120 DLIR6 PHA›4130  TXA›4140  PHA›4150  LDX #4›4160 AN LDA LINE8,X›4170  STA COLPM3,X›4180  DEX›4190  BPL AN›4200  LDA #DLIR7&255›4210  LDX #DLIR7/256›4220  JMP RESTORE›4230 DLIR7 PHA›4240  TXA›4250  PHA›4260  LDX #4›4270 AO LDA LINE7,X›4280  STA COLPM3,X›4290  DEX›4300  BPL AO›4310  LDA #DLIR8&255›4320  LDX #DLIR8/256›4330  JMP RESTORE›4340 DLIR8 PHA›4350  TXA›4360  PHA›4370  LDX #4›4380 AP LDA LINE6,X›4390  STA COLPM3,X›4400  DEX›4410  BPL AP›4420  LDA #DLIR9&255›4430  LDX #DLIR9/256›4440  JMP RESTORE›4450 DLIR9 PHA›4460  TXA›4470  PHA›4480  LDX #4›4490 AQ LDA LINE5,X›4500  STA COLPM3,X›4510  DEX›4520  BPL AQ›4530  LDA #DLIR10&255›4540  LDX #DLIR10/256›4550  JMP RESTORE›4560 DLIR10 PHA›4570  TXA›4580  PHA›4590  LDX #4›4600 AR LDA LINE4,X›4610  STA COLPM3,X›4620  DEX›4630  BPL AR›4640  LDA #DLIR11&255›4650  LDX #DLIR11/256›4660  JMP RESTORE›4670 DLIR11 PHA›4680  TXA›4690  PHA›4700  LDX #4›4710 AS LDA LINE3,X›4720  STA COLPM3,X›4730  DEX›4740  BPL AS›4750  LDA #DLIR12&255›4760  LDX #DLIR12/256›4770  JMP RESTORE›4780 DLIR12 PHA›4790  TXA›4800  PHA›4810  LDX #4›4820 AT LDA LINE2,X›4830  STA COLPM3,X›4840  DEX›4850  BPL AT›4860  LDA #DLIR13&255›4870  LDX #DLIR13/256›4880  JMP RESTORE›4890 DLIR13 PHA›4900  TXA›4910  PHA›4920  LDX #4›4930 AU LDA LINE1,X›4940  STA COLPM3,X›4950  DEX›4960  BPL AU›4970  LDA #DLIR14&255›4980  LDX #DLIR14/256›4990  JMP RESTORE›5000 DLIR14 PHA›5010  TXA›5020  PHA›5030  LDA #$62         PURPLE›5040  STA WSYNC›5050  STA COLBK›5060  LDA #$32         RED›5070  STA COLPM0›5080  LDA #$94         BLUE›5090  STA COLPM2›5100  LDA #DLIR15&255›5110  LDX #DLIR15/256›5120  JMP RESTORE›5130 DLIR15 PHA›5140  TXA›5150  PHA›5160  LDA #0›5170  LDX #120›5180  STX HPOP0›5190  STA SIZEP0       NORMAL SIZE›5200  STA SIZEP2›5210  STA WSYNC›5220  STA COLBK›5230  LDA #$66         PURPLE (CURSOR)›5240  STA COLPF0›5250  LDA #$2A         YELLOW›5260  STA COLPM3›5270  LDA #DLIR16&255›5280  LDX #DLIR16/256›5290  JMP RESTORE›5300 DLIR16 PHA›5310  TXA›5320  PHA›5330  LDA #$E          WHITE›5340  LDX #4           GRAY›5350  STA WSYNC›5360  STA COLPF0›5370  STX COLPF1›5380  LDA #$12         BROWN›5390  STA COLPF2›5400  LDA #$36         RED›5410  STA COLPF3›5420  LDA #DLIR1&255›5430  LDX #DLIR1/256›5440  JMP RESTORE›5450 CKERR LDA #5      CHECK IF 1›5460  STA TEMP3        COLOR USED›5470  LDY POS          TWICE ON THE›5480 AV LDA #0         SAME LINE BY›5490  STA TEMP1        COMPARING EACH›5500  LDA #5           COLOR WITH ALL›5510  STA TEMP2        COLORS ON ITS›5520  LDX POS          LINE›5530 AW LDA LINE1,Y›5540  CMP LINE1,X›5550  BNE AX›5560  INC TEMP1›5570 AX DEX›5580  DEC TEMP2›5590  BNE AW›5600  LDA TEMP1        SHOULD=1›5610  CMP #2           BECAUSE SAME›5620  BCS ERR          COLOR AS ITSELF›5630  DEY›5640  DEC TEMP3›5650  BNE AV›5660  RTS›5670 ERR LDA #4        DISALLOW ENTRY›5680  STA NUMPCK       BY BACKSPACING›5690  STA CONSOL       AND CLICKING›5700  LDX POS          SPEAKER›5710  LDA #0›5720  STA LINE1,X›5730  DEC POS›5740  PLA›5750  PLA›5760  RTS›5770 CKSTRT LDA CONSOL CHECK START›5780  CMP #6           BUTTON›5790  BEQ AY›5800  RTS›5810 AY INC STRTPRS    START PRESSED›5820  LDA #$6A         PURPLE›5830  STA COLOR0       "MAX MIND"›5840  PLA›5850  PLA›5860  JMP START›5870 MOVE LDA STRIG0›5880  CMP TRIGV        BRANCH IF›5890  BNE AZ           STATUS CHANGE›5900 BB RTS            IN FIRE BUTTON›5910 AZ STA TRIGV›5920  CMP #1           NOT PRESSED›5930  BEQ BB›5940  INC NUMPCK›5950  LDA NUMPCK›5960  CMP #5›5970  BNE BC›5980  LDA #0           COMPLETE LINE›5990  STA NUMPCK       ENTERED›6000 BC INC POS›6010  LDX POS›6020  LDY CSRPOS›6030  LDA COLOR,Y›6040  STA LINE1,X›6050  LDA NUMPCK›6060  BNE BB›6070  JSR CKERR›6080  JSR CALC›6090  LDA VPOSBAR      UPDATE VERTICAL›6100  SEC              POS FOR NEW›6110  SBC #8           LINE›6120  STA VPOSBAR›6130  LDA POS›6140  CMP #$36         TOTAL NUMBER OF›6150  BCS BD           PICKS ALLOWED›6160  RTS›6170 BD PLA            LOSE-ALL PICKS›6180  PLA              USED UP›6190  JMP LANE›6200 CLEAR LDA CH      CHECK IF SPACE›6210  CMP #33          BAR PRESSED›6220  BEQ BE›6230 BF RTS›6240 BE LDA #255›6250  STA CH›6260  LDX POS›6270  LDA NUMPCK       CANNOT DELETE›6280  BEQ BF           IF NEW LINE›6290  DEC NUMPCK›6300  DEC POS›6310  LDA #0›6320  STA LINE1,X›6330  RTS›6340 JOYST DEC COUNTER CAN MOVE CURSOR›6350  BEQ BG           ONCE EVERY›6360 BH RTS            12/60 SECOND›6370 BG LDA #12›6380  STA COUNTER›6390  STA $4D          NO ATTRACT MODE›6400  LDA STICK0›6410  CMP #11          LEFT›6420  BEQ BI›6430  CMP #7           RIGHT›6440  BNE BH›6450  INC CSRPOS       0-7 ALLOWED›6460  LDX CSRPOS›6470  CPX #8›6480  BNE BJ›6490  DEX›6500  LDA #0›6510  STA SC+385,X›6520  LDX #0           MOVE CORSOR TO›6530  STX CSRPOS       LEFTMOST POS›6540 BK LDA #1›6550  STA SC+385,X›6560  RTS›6570 BJ DEX            CLEAR PREVIOUS›6580  LDA #0           CURSOR POSITION›6590  STA SC+385,X›6600  INX              MOVE CSR RIGHT›6610  BNE BK           1 POSITION›6620 BI DEC CSRPOS›6630  BPL BL›6640  LDX #0           MOVE CURSOR TO›6650  LDA #0           RIGHTMOST POS›6660  STA SC+385,X›6670  LDX #7›6680  STX CSRPOS›6690  BNE BK›6700 BL LDX CSRPOS›6710  INX              CLEAR PREVIOUS›6720  LDA #0           CURSOR POSITION›6730  STA SC+385,X›6740  DEX›6750  BPL BK›6760 TIMER LDA RTCLOCK DO NOTHING›6770 BM CMP RTCLOCK    FOR 1/60›6780  BEQ BM           SECOND›6790  RTS›6800 IM .BYTE $C1,$81,$41,1›6810 ;CHARACTER CODES FOR FACE›6820 MXMND .BYTE $2D,$21,$38,$34,$25,$32,0,$2D,$29,$2E,$24›6830 ;CHAR CODES FOR "MXTR MND"›6840 PLIM .BYTE $7C,$FE,$BA,$EE,$BA,$C6,$7C,0›6850 ;BIT MAP OF FACE›6860 COLOR .BYTE $F,4,$12,$36,$32,$2A,$C4,$94›6870 ;COLORS AVAIBLE›6880 DL .BYTE $70,$70,$70,$46›6890 ;DISPLAY LIST›6900  .WORD SC›6910  .BYTE 6,6,6,$90,$90,6,$86,$86›6920  .BYTE $86,$86,$86,$86,$86,$86,$86,$86›6930  .BYTE $86,6,6,$90,$90,6,6,$80›6940  .BYTE 6,$41›6950  .WORD DL›