Swanium::Core::Ppu
Inherits Reference < Object
WonderSwan LCD renderer. The internal framebuffer uses the machine's native RGB444 format; frontends consume the stable RGBA8888 view.
Constants
PIXEL_COUNT = SCREEN_WIDTH * SCREEN_HEIGHT
SCREEN_HEIGHT = 144
SCREEN_WIDTH = 224
TILE_DATA_2BPP = 8192
TILE_DATA_4BPP = 16384
Constructors
new
SourceInstance methods
capture_next_frame_sprites(wram : Bytes, ports : Bytes) : Nil
Sourcecurrent_line
Sourceframebuffer_rgba
Stable frontend API: 224x144 pixels in RGBA8888, row-major, opaque. The same byte buffer is reused on every call.
latch_sprites_if_needed(wram : Bytes, ports : Bytes) : Nil
Sourceload_state(io : IO) : Nil
Sourcepixel_rgb444(x : Int32, y : Int32) : UInt16
Returns one native RGB444 pixel. The framebuffer remains owned by the PPU so inspection code cannot mutate a rendered frame behind it.
promote_next_frame_sprites
Sourcerender_scanline(line : UInt8, wram : Bytes, ports : Bytes, color_hardware : Bool) : Nil
Sourcereset
Sourcesave_state(io : IO) : Nil
Source