; Verifies that reset doesn't alter any RAM.

CUSTOM_RESET=1
.include "testing.s"

; nv_res bad_addr,2

; PPUSTATUS = $2002
zp_res COUNT

reset:
	sei
	cld
	ldx #$FF
	txs

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

	lda #$00
	sta PPUCTRL ; NMI off, PPU slave, Small sprites, 0 addresses
	lda #$0A
	sta PPUMASK; No EM, only background rendering, normal color
	lda #$80
	sta PPUCTRL ; NMI on, PPU slave, Small sprites, 0 addresses
loop:
	jmp loop

nmi:
	lda COUNT
	bne exit
	inc COUNT
	rti
exit:
	stp

irq:
	stp
