Relevant part of code:
Code: Select all
Text:
LDA $2002 ;Read PPU status to reset it (It is reset by reading from it)
LDA #$32 ;\ High byte
STA $2006 ;/
LDA #$00 ;\ Low byte
STA $2006 ;/
LDX #$00 ;We start at 00
Text2:
LDA backg,x ;Load from text table from data section below
STA $2007 ;And we write it to the PPU I/O
INX ;We set the start of a loop
CPX #$07
BNE Text2 ;Loop if not zero
Text3:
LDA $2002 ;Read PPU status to reset it (It is reset by reading from it)
LDA #$31 ;\ High byte
STA $2006 ;/
LDA #$00 ;\ Low byte
STA $2006 ;/
LDX #$00 ;We start at 00
Text4:
LDA backg1,x ;Load from text table from data section below
STA $2007 ;And we write it to the PPU I/O
INX ;We set the start of a loop
CPX #$0C
BNE Text4 ;Loop if not zeroCode: Select all
DisplayGraphics:
LDA gamestate
CMP #$01
BNE Return1
set:
LDA $2002 ;Rest during game play
LDA #$32 ;\ High byte
STA $2006 ;/
LDA #$00 ;\ Low byte
STA $2006 ;/Code: Select all
backg1:
.db $1D,$1E,$26,$28,$02,$1B,$32,$02,$39,$24,$3A,$29
backg:
.db $29,$2B,$1E,$2C,$2C,$03,$1A,$FF