| English | Português (Brasil) |
The implemented runtime provides a small initialization sequence and a runtime-owned NMI handler for an NTSC NROM program. Its frame and controller APIs are:
nes.set_background_color sets the universal
NES background palette color;nes.load_background uploads one configured raw
nametable and its attribute table during initialization;nes.run completes initialization, enables NMI and rendering at
VBlank, and starts the frame-synchronized runtime phase;nes.set_scroll atomically stages a fixed
horizontal and vertical scroll pair for final NMI restoration;nes.wait_frame waits for the volatile NMI frame counter
to change;nes.on_update statically registers one parameterless
procedure for the main-thread frame loop;nes.on_vblank statically registers one restricted,
parameterless procedure for NMI VBlank work.nes.controller_down, nes.controller_pressed, and
nes.controller_released query stable state from
standard controllers 1 and 2.nes.set_sprite_zero is the fixed, example-only OAM staging helper described
in the controller documentation; it remains as a compatibility helper.nes.load_background() and direct initialization palette commands belong
before nes.run; palette calls in procedures or after nes.run are queued
instead.
nes.wait_frame may appear in main-block loops and conditionals after
nes.run, but not in procedures. The only user code executed by NMI is the
single statically validated VBlank callback, when registered.
See VBlank cycle budget for current worst-case runtime costs, available callback headroom, and scalability limits.
See Target platform for the generated ROM format and hardware initialization behavior. See CPU memory for the physical RAM limit, reserved regions, user capacity, and generated memory-map artifact.