230. Validation tiny rom writes ppu registers
VALIDATION TEST: tiny iNES ROM writes to PPU registers.
Lesson 230 of 356 · tests/chapter_03_ppu_memory_and_graphics_data/test_230_VALIDATION_tiny_rom_writes_ppu_registers.py
This file is not a student implementation step.
There is nothing new to implement for this test. It exists only to validate that the pieces built so far work together through their real boundaries:
iNES bytes
-> Cartridge.from_ines_bytes(data)
-> CpuBus(cartridge=cartridge, ppu=ppu)
-> CPU.reset()
-> CPU.step()
-> STA $2000 / STA $2001
-> CpuBus.write(...)
-> PPU.write_register(...)Why this validation exists
The previous tests verified PPU registers and CpuBus routing in isolation. This test proves that actual CPU instructions fetched from cartridge PRG ROM can write to PPU registers through the bus.
Tiny program placed at CPU address $8000:
A9 80 LDA #$80
8D 00 20 STA $2000
A9 1E LDA #$1E
8D 01 20 STA $2001
EA NOPExpected result
ppu.ctrl == $80
ppu.mask == $1EOut of scope
- rendering
- VBlank timing
- NMI behavior
- OAMDMA
- real PPUSCROLL/PPUADDR latch behavior
Run this lesson
uv run pytest tests/chapter_03_ppu_memory_and_graphics_data/test_230_VALIDATION_tiny_rom_writes_ppu_registers.py -v