class

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

Instance methods

capture_next_frame_sprites(wram : Bytes, ports : Bytes) : Nil
Source
current_line
Source
framebuffer_rgba

Stable frontend API: 224x144 pixels in RGBA8888, row-major, opaque. The same byte buffer is reused on every call.

Source
latch_sprites_if_needed(wram : Bytes, ports : Bytes) : Nil
Source
load_state(io : IO) : Nil
Source
pixel_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.

Source
promote_next_frame_sprites
Source
render_scanline(line : UInt8, wram : Bytes, ports : Bytes, color_hardware : Bool) : Nil
Source
reset
Source
save_state(io : IO) : Nil
Source