; Verifies that reset doesn't alter any RAM.

.include "testing.s"

zp_res FLAG

reset:
	sei
	cld
	ldx #$FF
	txs

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

	lda #$00
	sta FLAG

	lda #$80
	sta PPUCTRL ; NMI on, PPU slave, Small sprites, 0 addresses
loop:
	lda FLAG
	beq loop
	stp

nmi:
	lda #$01
	sta FLAG
	rti

irq:
	stp
