#600·jsnes

Most mappers missing toJSON/fromJSON — save states lose bank state

Author: bfirshCreated Feb 28, 2026Updated Feb 28, 2026
Labelsbugpriority: mediumdifficulty: mediumcomponent: mapper

Summary

Only 6 of 21 mapper implementations have custom toJSON()/fromJSON() methods. The rest inherit from Mapper0, which only serializes base class state. Mapper-specific bank registers, IRQ state, and other fields are lost on save/restore.

Affected mappers

Missing serialization: Mapper 2 (UxROM), 3 (CNROM), 5 (MMC5), 7 (AxROM), 11 (Color Dreams), 34 (BNROM), 66 (GxROM), 71 (Camerica), 79 (NINA), 94 (UN1ROM), 180 (UNROM variant), 240, 241

Impact

Save states with these mappers will restore to the wrong bank configuration, causing games to crash or show garbled graphics after loading a save state.

Fix

Each mapper needs to serialize its bank registers and any other mutable state. For simple mappers like UxROM (just a bank number), this is a one-line addition.