Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Disassembly of VidLife.bin
- ; Disassembled Thu Apr 14 19:12:06 2011
- ; Using DiStella v3.0
- VSYNC = $00
- VBLANK = $01
- WSYNC = $02
- RSYNC = $03
- NUSIZ0 = $04
- NUSIZ1 = $05
- COLUP0 = $06
- COLUP1 = $07
- COLUPF = $08
- COLUBK = $09
- CTRLPF = $0A
- REFP0 = $0B
- REFP1 = $0C
- PF2 = $0F
- RESP0 = $10
- RESP1 = $11
- RESM0 = $12
- RESM1 = $13
- RESBL = $14
- AUDC0 = $15
- AUDC1 = $16
- AUDF0 = $17
- AUDF1 = $18
- AUDV0 = $19
- AUDV1 = $1A
- GRP0 = $1B
- GRP1 = $1C
- ENAM0 = $1D
- ENAM1 = $1E
- ENABL = $1F
- HMP0 = $20
- HMP1 = $21
- HMBL = $24
- HMOVE = $2A
- HMCLR = $2B
- INPT4 = $3C
- INPT5 = $3D
- SWCHA = $0280
- SWCHB = $0282
- INTIM = $0284
- TIM8T = $0295
- TIM64T = $0296
- LF851 = $F851
- LF9A2 = $F9A2
- LFA51 = $FA51
- LFAA2 = $FAA2
- LFB51 = $FB51
- LFC51 = $FC51
- LFCA2 = $FCA2
- LFDA2 = $FDA2
- LFE00 = $FE00
- LFEA2 = $FEA2
- LFF00 = $FF00
- LFFA2 = $FFA2
- CursorX_Hex = $80
- CursorY_Hex = $81
- CursorX_BCD = $82
- CursorY_BCD = $83
- Retraces = $90 ; (Shorter version)
- CellLineBuffer = $bc
- ZoomBuffer = $e8
- GRID_WIDTH = 96
- GRID_HEIGHT = 80
- FontBuffer = $01CA
- CellRead1 = $f000
- CellRead2 = $f051
- CellRead3 = $f0a2
- CellRead4 = $f100
- CellRead5 = $f151
- CellRead6 = $f1a2
- CellRead7 = $f200
- CellRead8 = $f251
- CellRead9 = $f2a2
- CellRead10 = $f300
- CellRead11 = $f351
- CellRead12 = $f3a2
- CellWrite1 = $f400
- CellWrite2 = $f451
- CellWrite3 = $f4a2
- CellWrite4 = $f500
- CellWrite5 = $f551
- CellWrite6 = $f5a2
- CellWrite7 = $f600
- CellWrite8 = $f651
- CellWrite9 = $f6a2
- CellWrite10 = $f700
- CellWrite11 = $f751
- CellWrite12 = $f7a2
- ; ORG $F800
- RenderTheScreen:
- INC Retraces
- BNE LF80A
- LDA $86
- BMI LF80A
- INC $86
- LF80A: LDA Retraces
- AND #$01
- BEQ LF887
- LDA #$80
- STA HMP0
- STA HMP1
- STA WSYNC
- STA HMOVE
- LF81A: STA WSYNC
- LDA #$00
- STA PF2
- TXA
- LSR A
- TAY
- LDA CellRead2,X
- STA GRP0
- LDA CellRead4,X
- STA GRP1
- LDA CellRead6,X
- STA GRP0
- LDA CellRead8,X
- STA GRP1
- LDA CellRead10,X
- STA GRP0
- LDA CellRead12,X
- STA GRP1
- LDA FontBuffer,Y
- STA PF2
- CPX CursorY_Hex
- BNE LF84E
- LDA #$FF
- STA ENABL
- LF84E: STA WSYNC
- LDA #$00
- STA PF2
- TXA
- LSR A
- TAY
- LDA CellRead2,X
- STA GRP0
- LDA CellRead4,X
- STA GRP1
- LDA CellRead6,X
- STA GRP0
- LDA CellRead8,X
- STA GRP1
- LDA CellRead10,X
- STA GRP0
- LDA CellRead12,X
- STA GRP1
- LDA FontBuffer,Y
- STA PF2
- LDA #$00
- INX
- CPX #$50
- STA ENABL
- BNE LF81A
- STA WSYNC
- BEQ LF8F2
- LF887: STA WSYNC
- LF889: STA WSYNC
- STA PF2
- TXA
- LSR A
- TAY
- LDA CellRead1,X
- STA GRP0
- LDA CellRead3,X
- STA GRP1
- LDA CellRead5,X
- STA GRP0
- LDA CellRead7,X
- LF8A2: STA GRP1
- LDA CellRead9,X
- STA GRP0
- LDA CellRead11,X
- STA GRP1
- LDA FontBuffer,Y
- STA PF2
- CPX CursorY_Hex
- BNE LF8BB
- LDA #$FF
- STA ENABL
- LF8BB: LDA #$00
- STA WSYNC
- STA PF2
- TXA
- LSR A
- TAY
- LDA CellRead1,X
- STA GRP0
- LDA CellRead3,X
- STA GRP1
- LDA CellRead5,X
- STA GRP0
- LDA CellRead7,X
- STA GRP1
- LDA CellRead9,X
- STA GRP0
- LDA CellRead11,X
- STA GRP1
- LDA FontBuffer,Y
- STA PF2
- LDA #$00
- INX
- CPX #$50
- STA ENABL
- BNE LF889
- STA WSYNC
- LF8F2: STA GRP0
- STA PF2
- STA GRP1
- STA WSYNC
- LDX #$C5
- BIT $86
- BPL :+
- LF900: LDX Retraces
- : LDY #$02
- STA WSYNC
- STX COLUBK
- STA NUSIZ0
- STA COLUP0
- STY ENAM0
- STA NUSIZ1
- STA COLUP1
- STY ENAM1
- LDA #$3C
- STA TIM64T
- RTS
- WaitTimer1:
- LDA INTIM ;F91A
- BNE WaitTimer1
- LDA #$2A
- STA WSYNC
- STA VBLANK
- STA VSYNC
- STA TIM8T
- RTS
- WaitTimer2:
- LDA INTIM ;F92B
- BNE WaitTimer2
- STA WSYNC
- STA VSYNC
- LDA #$30
- STA TIM64T
- RTS
- CopyCellLineToBuffer: ; see also: CopyBufferToCellLine
- ; Inputs:
- ; X - Location of buffer in zeropage
- ; Y - Row you want
- LDA CellRead1,Y
- STA $0,X
- LDA CellRead2,Y
- STA $1,X
- LDA CellRead3,Y
- STA $2,X
- LDA CellRead4,Y
- STA $3,X
- LDA CellRead5,Y
- LF951: STA $4,X
- LDA CellRead6,Y
- STA $5,X
- LDA CellRead7,Y
- STA $6,X
- LDA CellRead8,Y
- STA $7,X
- LDA CellRead9,Y
- STA $8,X
- LDA CellRead10,Y
- STA $9,X
- LDA CellRead11,Y
- STA $a,X
- LDA CellRead12,Y
- STA $b,X
- RTS
- ToggleCellUnderCursor: ; plays a sound too!
- LDY CursorY_Hex
- LDX #CellLineBuffer
- JSR CopyCellLineToBuffer
- LDA CursorX_Hex ; get index into CellLineBuffer (X/8)
- LSR A
- LSR A
- LSR A
- TAX
- LDA CursorX_Hex ; get bit number of the byte (X&7)
- AND #$07
- TAY
- LDA BitSelectTable,Y
- EOR CellLineBuffer,X
- STA CellLineBuffer,X
- LDX #$08 ; make a different sound depending on if we're turning a bit on or off
- AND BitSelectTable,Y
- BNE :+
- LDX #$10
- : STX AUDF0
- LDY CursorY_Hex
- LDX #CellLineBuffer
- STX AUDV0
- CopyBufferToCellLine: ; see also: CopyCellLineToBuffer
- ; Inputs:
- ; X - Location of buffer in zeropage
- ; Y - Row you want
- LDA 0,X
- STA CellWrite1,Y
- LDA 1,X
- STA CellWrite2,Y
- LDA 2,X
- STA CellWrite3,Y
- LDA 3,X
- STA CellWrite4,Y
- LDA 4,X
- STA CellWrite5,Y
- LDA 5,X
- STA CellWrite6,Y
- LDA 6,X
- STA CellWrite7,Y
- LDA 7,X
- STA CellWrite8,Y
- LDA 8,X
- STA CellWrite9,Y
- LDA 9,X
- STA CellWrite10,Y
- LDA 10,X
- STA CellWrite11,Y
- LDA 11,X
- STA CellWrite12,Y
- RTS
- BitSelectTable:
- .byt $01,$02,$04,$08,$10,$20,$40,$80
- START: SEI
- CLD
- LDA #$00
- TAX
- : STA 0,X ; seems to clear memory but is kind of wacky
- TXS
- STX CursorY_Hex
- INX
- BNE :-
- STA WSYNC
- LDX #$04
- : DEX
- BNE :-
- STA RESM0
- LDX #$0B
- STA WSYNC
- : DEX
- BNE :-
- STA RESM1
- LDX #$07
- STA WSYNC
- : DEX
- BNE :-
- STA RESBL
- STA $84
- STA $87
- STA $88
- LDA #$C5
- STA $F2
- LDA #$08
- STA AUDC1
- STA REFP0
- STA REFP1
- JSR LFE96
- LDA #$43
- JSR LFEC4
- LDA #$0F
- STA AUDV1
- LFA2C: INC CursorY_Hex
- JSR PrepareAndRenderThenWait
- JSR PrepareAndRenderThenWait
- LDA CursorY_Hex
- CMP #$20
- BPL LFA3C
- STA AUDF1
- LFA3C: CMP #$25
- BMI LFA2C
- LDA #$37
- STA CursorX_BCD
- STA CursorY_BCD
- LDA #$55
- STA $F2
- LDA #$00
- STA AUDC1
- STA $AE
- : JSR PrepareAndRenderThenWait
- INC $AE
- BPL :-
- LDA #$49
- JSR LFEC4
- LDA #$FE
- STA $85
- BNE LFA8F
- LFA62: JSR LFE96
- LDA #$00
- STA $87
- STA $88
- STA $86
- ; could be the main loop
- LFA6D: STA $85
- LFA6F: JSR PrepareAndRender
- JSR RenderThreeNumbers
- JSR WaitTimer1
- JSR WaitTimer2
- JSR LFB92
- JSR PrepareAndRenderThenWait
- LDX #$00
- STX AUDV0
- LDA SWCHB
- LSR A
- BCC LFA62
- LDA INPT5
- BMI LFA92
- LFA8F: JMP LFD03
- LFA92: LDA SWCHA ; get keys?
- ORA #$0F
- LDY INPT4 ; button on the controller
- BPL :+
- STX $84
- AND #$FE
- CMP #$FE
- : BEQ LFA6D ; no keys pressed, TRY AGAIN
- ; keys pressed, so process them
- STX $86
- CMP $85
- STA $85
- BNE LFAB1
- LSR $8F ; if
- BNE LFA6F
- BEQ LFAB5
- LFAB1: LDA #$40 ; else
- STA $8F
- LFAB5: LDA $85 ; end
- AND #$01
- BEQ :+
- LDA $84
- BNE :+
- INC $84
- JSR ToggleCellUnderCursor
- : LDA $85
- AND #$F0
- CMP #$F0
- BEQ LFA6F
- LDX #$00
- STX $84
- AND #$40
- BNE CheckPressingUp
- LDA CursorX_Hex
- BNE DontNeedWrapLeft
- LDX #$0B
- STA WSYNC
- LFADC: DEX
- BNE LFADC
- STA RESBL
- LDA #$5F
- STA CursorX_Hex
- LDA #$95
- STA CursorX_BCD
- LDA #$20
- BNE WrappedAroundLeft
- DontNeedWrapLeft:
- DEC CursorX_Hex
- SED
- SEC
- LDA CursorX_BCD
- SBC #$01
- STA CursorX_BCD
- CLD
- LDA #$10
- WrappedAroundLeft:
- STA HMBL
- STA WSYNC
- STA HMOVE
- LFB00: STA WSYNC ; label not referenced anywhere?
- STA HMCLR
- CheckPressingUp:
- LDA $85 ; Pressing up?
- AND #$10
- BNE CheckPressingRight
- LDA CursorY_Hex
- BNE :+
- LDA #$4F
- STA CursorY_Hex
- LDA #$79
- STA CursorY_BCD
- BNE CheckPressingRight
- : DEC CursorY_Hex
- SED
- SEC
- LDA CursorY_BCD
- SBC #$01
- STA CursorY_BCD
- CLD
- CheckPressingRight:
- LDA $85 ; Pressing right?
- AND #$80
- BNE CheckPressDown
- LDA CursorX_Hex ; Do we need to wrap the cursor around?
- CMP #GRID_WIDTH-1
- BNE :+
- STA WSYNC
- STA RESBL
- LDA #$00
- STA CursorX_Hex
- STA CursorX_BCD
- LDA #$80
- BNE WrappedAroundRight
- : INC CursorX_Hex
- SED
- CLC
- LDA CursorX_BCD
- ADC #$01
- STA CursorX_BCD
- CLD
- LDA #$F0 ; move the ball cursor
- WrappedAroundRight:
- STA HMBL ;
- STA WSYNC ;
- STA HMOVE ; update ball X position
- STA WSYNC
- STA HMCLR
- CheckPressDown:
- LDA $85 ; Pressing down?
- AND #$20
- BNE DownNotPressed
- LDA CursorY_Hex ; Do we need to wrap the cursor around?
- CMP #GRID_HEIGHT-1
- BNE :+
- LDA #$00
- STA CursorY_Hex
- STA CursorY_BCD
- BEQ WrappedAroundDown
- : INC CursorY_Hex
- SED
- CLC
- LDA CursorY_BCD
- ADC #$01
- STA CursorY_BCD
- CLD
- DownNotPressed:
- WrappedAroundDown:
- JMP LFA6F
- LFB76: .byte $F3
- LFB77: .byte $F0,$F0,$F0,$F1,$F1,$F1,$F2,$F2,$F2,$F3,$F3,$F3,$F0
- LFB84: .byte $A2
- LFB85: .byte $00,$51,$A2,$00,$51,$A2,$00,$51,$A2,$00,$51,$A2,$00
- LFB92: LDA CursorY_Hex
- CMP #$4B
- BMI :+
- SEC
- SBC #$50
- : CLC
- ADC #$05
- STA $92
- LDA CursorX_Hex
- LFBA2: CLC
- ADC #$05
- TAY
- AND #$07
- STA $99
- TYA
- LSR A
- LSR A
- LSR A
- TAY
- LDA LFB76,Y
- STA $95
- ORA #$04
- STA $A3
- LDA LFB84,Y
- STA $94
- STA $A2
- LDA LFB77,Y
- STA $97
- ORA #$04
- STA $A5
- LDA LFB85,Y
- STA $96
- STA $A4
- LDA #$09
- STA $93
- LDA SWCHB
- BPL MakeZoomBuffer
- LDA SWCHA ; pressing anything?
- AND #$0F
- CMP #$0F
- BEQ LFC2A ; exit mystery routine
- LDA INPT4
- BMI LFC2A ; exit mystery routine
- LDA #$FF
- STA $B1
- LDA #$00
- LDX $99
- SEC
- BEQ LFBF6
- : ROL A
- ROL $B1
- DEX
- BNE :-
- LFBF6: STA $B0
- LFBF8: LDA $92
- BPL :+
- CLC
- ADC #$50
- : TAY
- LFC00: LDA #$00
- STA $AF
- LDX $93
- LDA ZoomBuffer,X
- LDX $99
- BEQ LFC12
- LFC0C: ASL A
- ROL $AF
- DEX
- BNE LFC0C
- LFC12: STA $AE
- LDA ($94),Y
- AND $B0
- ORA $AE
- STA ($A2),Y
- LDA ($96),Y
- AND $B1
- ORA $AF
- STA ($A4),Y
- DEC $92
- DEC $93
- BPL LFBF8
- LFC2A: RTS
- MakeZoomBuffer:
- LDA $92
- BPL :+
- CLC
- ADC #$50
- : TAY
- LDA ($96),Y
- STA $AE
- LDA ($94),Y
- LDX $99
- BEQ LFC43
- : LSR $AE
- ROR A
- DEX
- BNE :-
- LFC43: LDX $93
- STA ZoomBuffer,X
- DEC $92
- DEC $93
- BPL MakeZoomBuffer
- RTS
- RenderThreeNumbers:
- LDA #$00
- STA $A1
- LDX #$04
- : STA $CA,X ; seems to clear out the generations count
- DEX
- BPL :-
- ; Render three numbers
- LDX #$DA
- LDA CursorX_BCD
- JSR RenderNumber
- LDX #$E1
- LDA CursorY_BCD
- JSR RenderNumber
- LDX #$CA
- LDA $88
- BEQ :+
- JSR RenderNumber
- : LDA $88
- STA $A1
- LDX #$D0
- LDA $87
- RenderNumber: ;Renders BCD-coded number A to zeropage at address X
- STA $92 ; store number to render for later
- AND #$0F
- TAY ; render the low nybble
- LDA #$F0
- STA $A0
- LDA #$00 ; clear out the render area
- STA 0,X
- STA 1,X
- STA 2,X
- STA 3,X
- STA 4,X
- JSR RenderNybble
- LDA $92 ; get stored number from last time
- AND #$F0 ; check if top nybble is zero,
- BNE :+ ; if it isn't, go on with drawing it!
- LDY $A1
- BEQ ExitNumberRenderer ; otherwise don't draw it
- : LSR A
- LSR A
- LSR A
- LSR A
- TAY ; render high nybble
- LDA #$0F ; store to top
- STA $A0
- RenderNybble: ; $A0=Digit mask ($F0 or $0F), X=A to render to, Y=Digit to render
- LDA Font1,Y
- AND $A0
- ORA 0,X
- STA 0,X
- LDA Font2,Y
- AND $A0
- ORA 1,X
- STA 1,X
- LDA Font3,Y
- AND $A0
- ORA 2,X
- STA 2,X
- LDA Font4,Y
- AND $A0
- ORA 3,X
- STA 3,X
- LDA Font5,Y
- AND $A0
- ORA 4,X
- STA 4,X
- ExitNumberRenderer:
- RTS
- ; Font! High and low nybbles are the same
- ; so it can mask off one of them and OR with
- ; the font buffer for the top and low nybbles
- Font1: .byte $22,$22,$77,$77,$55,$77,$77,$77,$77,$77
- Font2: .byte $55,$22,$44,$44,$55,$11,$11,$44,$55,$55
- Font3: .byte $55,$22,$77,$77,$77,$77,$77,$44,$77,$77
- Font4: .byte $55,$22,$11,$44,$44,$44,$55,$44,$55,$44
- Font5: .byte $22,$22,$77,$77,$44,$77,$77,$44,$77,$77
- LFD03: LDX #$AF
- LDY #$00
- STY $86
- STY $91
- JSR CopyCellLineToBuffer
- LDA #$0C
- STA AUDC0
- LDA $AF
- STA $BB
- LDA $BA
- STA $AE
- LDY #$50
- JSR CopyBufferToCellLine
- LDX #$A1
- LDY #$4F
- STY AUDV0
- JSR CopyCellLineToBuffer
- LDA $A1
- STA $AD
- LDA $AC
- STA $A0
- LDA #$01
- STA $8F
- LFD34: LDA #$0A
- JSR LFF67
- LDX #$0D
- LDY #$00
- : LDA $A0,X
- STA $92,X
- LDA $AE,X
- STA $A0,X
- STY CellLineBuffer,X
- DEX
- BPL :-
- LDY $8F
- LDX #$AF
- JSR CopyCellLineToBuffer
- LFD51: LDA $AF
- STA $BB
- LDA $BA
- STA $AE
- LDA #$00
- STA $8A
- LDA $9F
- LSR A
- ROL $8A
- LDA $BB
- LSR A
- ROL $8A
- LDA $AD
- LSR A
- ROL $8A
- LDX #$0C
- STX $8E
- LDY #$00
- BEQ LFDA9
- LFD74: TYA
- ASL A
- ASL A
- ASL A
- AND #$38
- ORA $8A
- TAY
- LDA #$00
- ASL $8B
- ROL A
- ASL $8C
- ROL A
- ASL $8D
- ROL A
- TAX
- STX $8A
- LDA LFE56,Y
- AND BitSelectTable,X
- BEQ LFD9B
- ASL $89
- INC $89
- BCC LFD74
- BCS LFD9F
- LFD9B: ASL $89
- BCC LFD74
- LFD9F: LDX $8E
- LDA $89
- ASL A
- ROL $BE,X
- LSR A
- STA $BD,X
- LFDA9: LDA #$0A
- JSR LFF67
- LDX $8E
- BEQ LFDC5
- TYA
- AND #$07
- ORA $8A
- ORA $92,X
- ORA $AE,X
- ORA $A0,X
- BNE LFDC5
- STA $89
- DEC $8E
- BPL LFD9F
- LFDC5: LDA $92,X
- STA $8B
- LDA $AE,X
- STA $8C
- LDA $A0,X
- STA $8D
- LDA #$01
- STA $89
- DEC $8E
- BPL LFD74
- TYA
- ASL A
- ASL A
- ASL A
- AND #$38
- ORA $8A
- TAY
- LDA #$00
- ASL $8B
- ROL A
- ASL $8C
- ROL A
- ASL $8D
- ROL A
- TAX
- LDA LFE56,Y
- AND BitSelectTable,X
- CLC
- BEQ :+
- SEC
- : ROL $BD
- LDY $8F
- DEY
- LDX #$BD
- JSR CopyBufferToCellLine
- INC $8F
- CPY #$4F
- BEQ LFE0B
- JMP LFD34
- LFE0B: LDA INTIM
- ORA #$08
- STA AUDF0
- LFE12: LDA #$FF
- JSR LFF67
- LDA $91
- BEQ LFE12
- SED
- CLC
- ADC $87
- STA $87
- LDA #$00
- ADC $88
- STA $88
- CLD
- BCS LFE4F
- JSR RenderThreeNumbers
- JSR WaitTimer1
- JSR WaitTimer2
- JSR LFB92
- JSR PrepareAndRenderThenWait
- JSR PrepareAndRenderThenWait
- JSR PrepareAndRenderThenWait
- LDA SWCHA
- CMP #$FF
- BNE LFE4F
- LDA SWCHB
- LSR A
- BCC LFE4F
- JMP LFD03
- LFE4F: LDA #$05
- LFE51: STA AUDC0
- JMP LFA6F
- ; could possibly have something to do with grid calculation
- LFE56: .byt $80,$E8,$68,$7E,$68,$7E,$16,$17,$68,$7E,$16,$17,$16,$17,$01,$01
- .byt $68,$7E,$16,$17,$16,$17,$01,$01,$16,$17,$01,$01,$01,$01,$00,$00
- .byt $68,$7E,$16,$17,$16,$17,$01,$01,$16,$17,$01,$01,$01,$01,$00,$00
- .byt $16,$17,$01,$01,$01,$01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00
- LFE96: JSR PrepareAndRenderThenWait
- LDX #$0D
- LFE9B: LDA #$00
- STA $92,X
- LDA #$FF
- STA $A0,X
- DEX
- BPL LFE9B
- : LDY $92
- LDX #$A1
- JSR CopyBufferToCellLine
- JSR PrepareAndRenderThenWait
- JSR PrepareAndRenderThenWait
- LDY $92
- LDX #$93
- JSR CopyBufferToCellLine
- INY
- STY $92
- CPY #$50
- BMI :-
- JMP PrepareAndRenderThenWait
- LFEC4: STA $B4
- LDA #$00
- STA $B3
- LDA LFF1C
- STA $AE
- LDA LFF1D
- STA $AF
- LDA #$19
- STA $B0
- LDA #$1C
- STA $B1
- LFEDC: JSR PrepareAndRenderThenWait
- LDA CursorY_Hex
- PHA
- LDY $B3
- LDA ($AE),Y
- LSR A
- LSR A
- LSR A
- LSR A
- CMP #$08
- BMI LFEF0
- ORA #$F0
- LFEF0: CLC
- ADC $B0
- STA $B0
- STA CursorX_Hex
- LDA ($AE),Y
- AND #$0F
- CMP #$08
- BMI LFF01
- ORA #$F0
- LFF01: CLC
- ADC $B1
- STA $B1
- STA CursorY_Hex
- JSR ToggleCellUnderCursor
- PLA
- STA CursorX_Hex
- STA CursorY_Hex
- JSR PrepareAndRenderThenWait
- INC $B3
- LDA $B3
- CMP $B4
- BNE LFEDC
- RTS
- LFF1C: .byt $1E
- LFF1D: .byt $FF,$00,$20,$21,$12,$20,$10,$1F,$0F,$FF,$E1,$01,$03,$02,$02,$02
- .byt $02,$02,$01,$F1,$EF,$FF,$1F,$20,$21,$21,$20,$1F,$0D,$01,$13,$2F
- .byt $2F,$1F,$1F,$1E,$0E,$0E,$FE,$F0,$01,$02,$02,$02,$04,$02,$02,$12
- .byt $2F,$0E,$FE,$FE
- LFF51: .byt $30,$20,$20,$1F,$1F,$0E,$EF,$F1,$01,$02,$02,$01,$11,$20,$2F,$2F
- .byt $08,$0F,$1F,$01,$10,$01
- LFF67: CMP INTIM
- BCC LFF9F
- STY $8B
- LDA $91
- BNE LFF95
- LDA SWCHB
- AND #$40
- BNE :+
- JSR PrepareAndRender
- INC $91
- BNE LFF9D
- : LDA INTIM
- BNE :-
- LDX #$02
- LFF87: STA WSYNC
- DEX
- BPL LFF87
- INC $91
- LDA #$FF
- STA TIM64T
- BNE LFF9D
- LFF95: JSR WaitTimer1
- JSR WaitTimer2
- DEC $91
- LFF9D: LDY $8B
- LFF9F: RTS
- PrepareAndRender:
- LDA INTIM ; wait until the timer is empty
- BNE PrepareAndRender
- ; A is now zero
- STA WSYNC
- STA VBLANK
- LDY #$17
- BIT $86
- BPL :+
- LDY Retraces
- : STY COLUPF
- LDY #$06
- STA WSYNC
- STA RESP0
- LDX #$04 ; delay
- : DEX
- BNE :-
- STA RESP1
- LDA #$90
- STA HMP0
- LDA #$80
- STA HMP1
- LDX #$00
- LDA $F2
- BIT $86
- BPL :+
- LDA Retraces
- EOR #$FF
- AND #$FD
- TAX
- LDA Retraces
- : STA WSYNC
- STA HMOVE
- STX COLUBK
- STX ENAM0
- STX ENAM1
- STY NUSIZ0
- STY NUSIZ1
- STA COLUP0
- STA COLUP1
- LDX #$00
- JMP RenderTheScreen
- PrepareAndRenderThenWait:
- JSR PrepareAndRender
- JSR WaitTimer1
- JSR WaitTimer2
- RTS
- LFFFA: ;.byte $E6,$F9,$E6,$F9,$E6,$F9
- .addr START, START, START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement