; Verifies that reset doesn't alter any RAM.

.include "testing.s"

zp_res COUNT

reset:
	sei
	cld
	ldx #$FF
	txs

	; Init PPU
	bit PPUSTATUS
vwait1:
	bit PPUSTATUS
	bpl vwait1
vwait2:
	bit PPUSTATUS
	bpl vwait2

	lda #$04
	sta PPUCTRL ; NMI off, PPU slave, Small sprites, 0 addresses, vertical write
	lda #$20
	sta PPUADDR
	lda #$00
	sta PPUADDR ; Load $2000
	ldx #$01
	stx PPUDATA ; Load values into name table
	stx PPUDATA ; Load values into name table

	lda #$00
	sta PPUCTRL ; NMI off, PPU slave, Small sprites, 0 addresses, normal write
	lda #$24
	sta PPUADDR
	lda #$00
	sta PPUADDR ; Load $2000
	ldx #$02
	stx PPUDATA ; Load values into name table
	stx PPUDATA ; Load values into name table
	
	stp

nmi:
	stp

irq:
	stp
