machine.module
README.md
pcengine.machine
The PC Engine / TurboGrafx-16 machine: the HuC6280 (pcengine.huc6280), the
HuC6270 VDC line renderer (vdc.luau: BAT background with virtual sizes,
64 sprites with the 16-per-line limit, overflow/collision, per-line scroll,
raster-compare and vblank interrupts, VRAM and SATB DMA, burst mode), the
HuC6260 VCE (vce.luau: 512 colours, 256/341/512-pixel dot clocks drawn
into one 512×240 picture), the wavetable PSG (psg.luau: 6 channels, DDA,
noise, LFO, stereo balance → 44.1 kHz), HuCard loading (cart.luau: .pce,
copier header, zip, 384 KB layout), the joypad with a multitap, a
Tennokoe-style backup RAM, a 263-line scheduler and save states. Called by
the pcengine emulatorCore and the package tests.
local Pce = require("pcengine.machine")
local m = Pce.new(hucardBytes)
m:runFrame(true) ; m.fb (512x240 RGBA) ; m:setPad(p1, p2) ; m:drainAudio()
m:snapshot() / m:restore(s) ; m:saveBram() / m:loadBram(s) ; m:watchRam(0)