 .OPT NO LIST›; SAVE #D1:ST1.M65› .PAGE "Self Test ROM"›  LIST  › .LOCAL ›; antic mode 8 = Gr 3›;col1 = reg0 =  12 = white 0101 $55›;col2 = reg1 =  50 = red   1010 $AA›;col3 = reg2 = 214 = grn   1111 $FF›;col0 = reg4 = 160 = bak   0000 $00›;›; This code actually maps in at›; $5000 though it is in ROM at›; $D000 (hardware range)›; Line numbers are peek addresses›; when the rom is enabled›?JKP     .=  *       ; Save current org›; do some local equates›?WHT     =   $55     mode 8 col1›?RED     =   $AA     ; mode 8 col2›?GRN     =   $FF     ; mode 8 col3› *=  $80› *=  *+2     Dli two byte counter› *=  *+1     ;$82›?ZDLJ    *=  *+3     Dlist jvb addr› *=  *+1     ;$86 Dli› *=  *+1     ;$87 Dli› *=  *+1     ;$88 Dli› *=  *+1     unused› *=  *+1     ;$8A becomes› *=  *+2     ;$8B unused› *=  *+1     ;$8D ?? mask›?ZRTIX   *=  *+1     ;$8E ram test index› *=  *+1     ;$8F ??› *=  *+2     ;$90 pointer› *=  *+1     ;$92 counter› *=  *+1     ;$93 ??› *=  *+1     ;$94 counter› *=  *+2     ;$95 pointer› *=  *+1     ;$97 ??› *=  *+1     ;$98 index› *=  *+1     ;$99 counter› *=  *+1     ;$9A ??› *=  *+2     ;$9B pointer› *=  *+1     ;$9D loop counter› *=  *+2     ;$9E pointer› *=  *+2     ;$A0 pointer› *=  *+1     ;$A2 Dli› *=  *+1     ;$A3 loop counter›?ZPBCALC *=  *+1     ;$A4›?ZPBORA  *=  *+1     ;$A5 portb bits›;› *=  ?JKP    ; $D000 restore org›;›?DSP     =   *-$5000 Displacement›;›XSLFTST  =   *-?DSP  From vector› JMP ?BYE-?DSP›XRAMERR  =   *-?DSP› JSR ?INIT1-?DSP Reset entry› JMP ?MEMTST-?DSP on ram error›;›?BYE› JSR ?INIT1-?DSP Bye entry›;›?MAIN› LDA #0› STA $80› STA $80+1› STA $82› STA AUDCTL  Init Pokey› LDA #3      enable debounce› STA SKCTL   and Kbd scan› JSR ?NOSOUND-?DSP› LDA #$40    Disable dlis› STA NMIEN› LDX #0› JSR ?SETCOL-?DSP a=210› LDX # <?MAINDL-?DSP› LDY # >?MAINDL-?DSP› JSR ?SETDL-?DSP› LDA # <?DLI.2-?DSP› STA VDSLST› LDA # >?DLI.2-?DSP› STA VDSLST+1› LDX #12     Range $3000-$3020› LDA #$AA› JSR ?FILRAM-?DSP fill with (a)› LDX #0›;›?WAIT1› STX WSYNC   waste some time› INX › BNE ?WAIT1›;›?WAIT2› LDA VCOUNT  Wait til› CMP #24     Antic in first› BCS ?WAIT2  ;48 scan lines› LDA #16› STA $87› LDA #$C0    Enable Dli and› STA NMIEN   vbi›;›?START1› LDA CONSOL  Wait for› AND #1      Start key› BNE ?START1› LDA #$FF    Clear keypress› STA CH› LDA $86› AND #$0F› CMP #1› BEQ ?GOMEM› CMP #2› BEQ ?GOAV› CMP #4› BEQ ?GOKEY›;›?20597› LDA #$88› STA $86› LDA #$FF› STA $82›;›?GOMEM› JMP ?MEMTST-?DSP›;›;›?GOAV› JMP ?AVTEST-?DSP›;›;›?GOKEY› JMP ?KEYTST-?DSP›;›;›?INIT1› LDA #$11› STA $86     Initial init› LDA #33     Narrow playfield› STA SDMCTL› LDA #$C0    Enable Dli/Vbi› STA NMIEN› LDA #$41    Set JVB into page 0› STA ?ZDLJ› LDA #$FF    Clear keypress› STA CH› RTS ›;›?SETDL› STA $8A› TYA › PHA › TXA › PHA › LDA #0› STA SDMCTL› STA HELPFG› LDA # <?DLI.1-?DSP› STA VDSLST› LDA # >?DLI.1-?DSP› STA VDSLST+1› LDX #0      Range $3000-$3EFF› TXA         a=0› JSR ?FILRAM-?DSP clear ram› PLA › TAX › PLA › TAY › STX SDLSTL  Set dlist› STX ?ZDLJ+1 addr into DLJ› STY SDLSTH› STY ?ZDLJ+2› LDA #33     Narrow playfield› STA SDMCTL  all lines 0.8› RTS         ; ----------------›;›?DLI.2› PHA         Main menu dli› TXA › PHA ›;›?20691› LDX #122    blue› LDA $87› CMP #1› BEQ ?20730› AND #1› BEQ ?20713› INC $A2› LDA $A2› AND #$20› BEQ ?20713› LDX #44     orange›;›?20713› STX WSYNC› STX COLPF0› CLC › ROR $87› LDA #0› STA ATRACT› PLA › TAX › PLA › RTI ›;›?20730› LDA $88› BNE ?20756› LDA CONSOL› AND #2      Select?› BNE ?20767  No› LDA $86› ROL A› ROL $86› LDA #$20› STA $A2› LDA #$FF› STA $88› BNE ?20767  Go always›;›?20756› LDA CONSOL› AND #2      Select?› BEQ ?20767› LDA #0› STA $88›;›?20767› LDA $86› AND #$0F› ORA #$10› STA $87› INC $80› BNE ?20781› INC $80+1›;›?20781› LDA $80+1› CMP #$FA› BNE ?20791› CLI › JMP ?20597-?DSP›;›?20791› JMP ?20691-?DSP›;›;›?MAINDL› .BYTE $70,$70,$70,$70› .BYTE $70   ;40 blank lines› .BYTE $47   lms + mode 7 (Gr2)› .WORD ?MENU1-?DSP› .BYTE $70,$70,$70 ;24 blank› .BYTE $4E   lms + mode 14› .WORD $3000› .BYTE $70   ;8 blank› .BYTE $F0   ;8 blank  +dli› .BYTE $C6   lms+mode 6 +dli› .WORD ?MENU2-?DSP› .BYTE $70   ;8 blank› .BYTE $86   mode 6    +dli› .BYTE $70   ;8 blank› .BYTE $86   mode 6    +dli› .BYTE $70   ;8 blank› .BYTE $06   mode 6› .BYTE $70,$70 ;16 blank› .BYTE $4E   lms+mode 14› .WORD $3000› .BYTE $70,$70,$70 ;24 blank› .BYTE $42   lms + mode 2› .WORD ?MENU3-?DSP› .BYTE $41   jvb maindl› .WORD ?MAINDL-?DSP›;›?MENU1› .SBYTE "    SELF TEST   "›;›?MENU2› .SBYTE "  MEMORY        "› .SBYTE "  AUDIO-VISUAL  "› .SBYTE "  KEYBOARD      "› .SBYTE "  ALL TESTS     "›;›?MENU3› .SBYTE "    ",2› .SBYTE +$80,"SELECT"› .SBYTE 22,44,2› .SBYTE +$80,"START"› .SBYTE 22,"OR",2› .SBYTE +$80,"RESET"› .SBYTE 22,"   "›;›?MEMDL› .BYTE $70,$70,$70 ; 24bl› .BYTE $46   ; lms mode 6› .WORD $3000 (Gr1 16bpl)› .BYTE $70,$70 ; 16 blank› .BYTE $06   mode 6  16 bytes› .BYTE $70   ; 8 blank $3030› .BYTE $08   mode 8 (Gr3 8bpl)› .BYTE $70,$70 ; 16 blank $3038› .BYTE $06   mode 6  16 bytes› .BYTE $70   ; 8 blank $3048› .BYTE $08   ; mode 8  8 bytes› .BYTE $70   ; 8 blank $3050› .BYTE $08   ; mode 8  8 bytes› .BYTE $70   ; 8 blank› .BYTE $08   ; mode 8  8 bytes› .BYTE $70   ; 8 blank› .BYTE $08   ; mode 8  8 bytes› .BYTE $70,$70,$70 ; 24 blank› .BYTE $01   jump› .WORD ?DLEND-?DSP›;›?DLEND› .BYTE $A0   ; 3 blank+dli› .BYTE $40   ; 5 blank› .BYTE $42   ; lms mode 2 32› .WORD ?PRESS-?DSP› .BYTE $01   ; jump $0083› .WORD ?ZDLJ ;›;›?PRESS› .SBYTE "     ",2› .SBYTE +$80,"RESET"› .SBYTE 22,"OR",2› .SBYTE +$80,"HELP"› .SBYTE 22,"TO EXIT     "›;›?KEYDL› .BYTE $70,$70,$70,$70› .BYTE $46   ;lms mode6› .WORD $3000› .BYTE $70,$70,$70,$70 ;32 blank› .BYTE $02   ; mode 2 32 byts› .BYTE $70,$70 ; 16 blank› .BYTE $02   ; mode 2  32 byts› .BYTE $70   ; 8 blank› .BYTE $02   ; mode 2  32 bytes› .BYTE $70   ; 8 blank› .BYTE $02   ; mode 2  32 bytes› .BYTE $70   ; 8 blank› .BYTE $02   ; mode 2  32 bytes› .BYTE $70   ; 8 blank› .BYTE $02   ; mode 2  32 bytes› .BYTE $70,$70 ; 16 blank› .BYTE $01   ; jump› .WORD ?DLEND-?DSP›;›?AVDL› .BYTE $70,$70,$70,$70› .BYTE $46   ; lms mode 6 16› .WORD ?AVMSG-?DSP› .BYTE $70   ; 8 blank› .BYTE $06   ; mode 6  16 bytes› .BYTE $70,$70 ; 16 blank› .BYTE $4B   ; lms mode 11 (Gr6 16)› .WORD $3100› .BYTE $0B,$0B,$0B,$0B ; 42 more› .BYTE $0B,$0B,$0B,$0B ; mode 6› .BYTE $0B,$0B,$0B,$0B ; 16 each› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B,$0B,$0B› .BYTE $0B,$0B› .BYTE $70   ; 8 blank› .BYTE $46   ; lms mode 6 16› .WORD $3000› .BYTE $70   ; 8 blank› .BYTE $01   ; jump› .WORD ?DLEND-?DSP›;›?AVMSG› .SBYTE "  AUDIO-VISUAL "› .SBYTE "       TEST      "›;›; If reset entry $80 holds $10›; otherwise $80 holds 0›;›;›?MEMTST› LDX # <?MEMDL-?DSP› LDY # >?MEMDL-?DSP› LDA #0      will go to $8A› JSR ?SETDL-?DSP Dlist x=< y=>› LDX #1› JSR ?SETCOL-?DSP Set colors›; reg0=12 reg1=50 reg2=214›; reg4=160 (bak)› LDX #0      Point to "Ram Test"› JSR ?SCRMOV-?DSP Move to screen› LDX #1      Point to "Ram"› JSR ?SCRMOV-?DSP Move to screen›;›?TSTROMA› LDA $3020   Get first byte› CMP #?RED   ; already red?› BEQ ?TSTROMB Yes› LDA #?WHT   Make it white› JSR ?DSPROMA-?DSP› JSR ?21425-?DSP delay› JSR VFR     Test rom› BCS ?BADA   Go if error› LDA #$FF    Show green› JMP ?SHOWA-?DSP›;›?BADA› LDA #?RED   Make it red›;›?SHOWA› JSR ?DSPROMA-?DSP›;›?TSTROMB› LDA $3024› CMP #?RED   Red already?› BEQ ?TSTRAM› LDA #?WHT   Make it white› JSR ?DSPROMB-?DSP› JSR ?21425-?DSP delay› JSR VSR     Test rom a=$8C› BCS ?BADB   Exit on error› LDA #$FF    Show green› JMP ?SHOWB-?DSP›?BADB    LDA #?RED   Error=red›;›?SHOWB› JSR ?DSPROMB-?DSP›;›?TSTRAM› LDA #$C0› STA $8D› LDA #4      First pass bit 2 hi› STA ?ZPBCALC› LDA #0› STA ?ZRTIX  Clear screen index› STA $90› STA $90+1› STA $8F›;›?21239› LDX ?ZRTIX› LDA $3038,X› AND $8D› CMP #$80› BEQ ?21342› CMP #$08› BEQ ?21342› LDA #$44› JSR ?21443-?DSP› LDA ?ZPBCALC Force bit 2 hi› JSR ?SETPB-?DSP Go set Portb› LDA ?ZPBCALC› EOR #$0C› STA ?ZPBCALC› LDX #7›;›?21272› LDA ?21578-?DSP,X› CMP $90+1› BEQ ?21334› DEX › BPL ?21272› LDA #4› STA $92›;›?21286› LDX #0›;›?21288› LDY #0›;›?21290› TXA › STA ($90),Y› INX › INY › BNE ?21290› STX $93› LDY #0›;›?21301› LDA ($90),Y› CMP $93› BNE ?21323› INC $93› INY › BNE ?21301› INX › BNE ?21288› INC $90+1› DEC $92› BNE ?21286› BEQ ?21337›;›?21323› JSR ?21425-?DSP delay› LDA #$88› JSR ?21443-?DSP› JMP ?21342-?DSP›;›?21334› JSR ?21429-?DSP delay›;›?21337› LDA #$CC› JSR ?21443-?DSP›;›?21342› LDA $8D› BMI ?21384› LDA #$C0› STA $8D› INC ?ZRTIX  ;$8E›;›?21352› CLC › LDA $8F› ADC #4› STA $90+1› STA $8F› CMP RAMSIZ› BNE ?21239› LDA $82› BNE ?21373› JMP ?TSTROMA-?DSP›;›?21373› LDA #12     Force b4 b1 high› JSR ?SETPB-?DSP Go set Portb› JSR ?21429-?DSP delay› JMP ?AVTEST-?DSP›;›?21384› LDA #12› STA $8D› BNE ?21352  Go always›;›?DSPROMA› LDX #4      Display Rom A› JSR ?FILRAM-?DSP with (a)› AND #$FC    Make last byte not› STA $3023   equal› RTS ›;›?DSPROMB› LDX #8      Display Rom B› JSR ?FILRAM-?DSP with (a)› AND #$FC› STA $3027› RTS ›