{
  "schema": 1,
  "scope": "Static USA-ROM control flow and installed Common audio PCM identities. The XSharp implementation covers X in campaign sessions.",
  "rules": [
    "Each owned tank has bit 7 set and stores 0 to 14 units. Acquisition writes the first unowned slot. The full-health pickup checks tanks in ascending native slot order and selects the first owned tank below 14.",
    "A small pickup adds one reserve unit, and a large pickup adds up to two to that same tank. The fill cue is queued before the increment. Reaching 14 also queues the full cue immediately; a large pickup that does not fill the tank queues a second fill cue four updates later with no second increment.",
    "Health pickups that start below maximum HP follow the normal heal path. Reaching maximum HP in the middle of that pickup ends the heal and does not store its remainder.",
    "X1 applies one or two HP per four updates. Its activation routine reads $1F83 + byte(HP - 10), so the gain is not solely a selected-reserve fullness test; see docs/parity/pause-menus/x1-reserve-activation.csv. X2 and X3 apply one HP per two updates and decrement a full reserve on alternating updates. Healing clamps HP independently of reserve drain.",
    "X1 compaction shifts the consecutive nonempty owned slots after the drained slot, stopping at the first gap. X2 and X3 total the remaining energy, clear reserve values, and repack from the start in groups of up to 14. Their sum loop stops at the first unowned slot before clearing all four energy bytes; normal pickup acquisition keeps ownership contiguous.",
    "X3 also tests WRAM 7E0A8E before storing or using a reserve. The XSharp path covers normal X gameplay.",
    "The optional native X1 menu preserves empty-byte underflow (80 to 7F through 70), ownership loss, display persistence and stop-at-gap reopening; see docs/parity/pause-menus/x1-empty-reserve.json. Custom menus retain safe rejection."
  ],
  "games": [
    {
      "game": "X1",
      "romSha1": "449A00631208FBCC8D58209E66D0D488674B7FB1",
      "reserveArray": "7E1F83",
      "maxTanks": 4,
      "storageUnitsPerTank": 14,
      "pauseDrainCadenceUpdates": 4,
      "cues": [
        {
          "action": "Sub Tank Fill Tick",
          "command": "0D",
          "callSites": [
            "82E4FA",
            "82E5C3"
          ],
          "pcmSha256": "32882559F13F6D20000D7F27E3577FF712ABDE0F3C2C22B12D7EBD85CBCAA817"
        },
        {
          "action": "Sub Tank Fully Charged",
          "command": "2B",
          "callSites": [
            "82E529"
          ],
          "pcmSha256": "D5B4D88D9BA8F9C38DDD0741450C6BB7142A413442D225F99DF54695F37877C3"
        }
      ],
      "spans": [
        {
          "address": "81E633",
          "length": 36,
          "sha256": "BDB316AE59BAE0BFE8599E3FB9EFD0FC1C87A9FD67D3E8A98B292C4C47519730",
          "purpose": "Sub-Tank acquisition assigns the first free slot"
        },
        {
          "address": "82E4DB",
          "length": 84,
          "sha256": "AAD388D95532C9B12723570673A34F7CDCCE85B1652BA2E2A207ACCA5BF78246",
          "purpose": "full-health pickup and reserve fill"
        },
        {
          "address": "82E5BD",
          "length": 18,
          "sha256": "2325521B6A51D5DA1EF065FBD6A71F9C2D5BCB83A87941624A35AF749B4809F1",
          "purpose": "delayed fill cue for a large drop"
        },
        {
          "address": "80C6DF",
          "length": 48,
          "sha256": "F388D08649C9B1544A093F28342C74B1D6C4999AC71B3983C71601BFAF5ACA5A",
          "purpose": "pause input, full HP gate, and setup for the one- or two-HP step"
        },
        {
          "address": "80C739",
          "length": 77,
          "sha256": "4CF0DCAFD1B9478BA1FE97CD19D44A5245D4890E4072178658F2CB6EDC53F40E",
          "purpose": "pause-menu tank drain and healing"
        },
        {
          "address": "80CDB7",
          "length": 36,
          "sha256": "CD3F0ED136FF36046AA7F7D942725CF4F20C2A45DF5447A78DEB9F15441F19CA",
          "purpose": "compaction of the consecutive nonempty tail after the selected slot"
        }
      ]
    },
    {
      "game": "X2",
      "romSha1": "637079014421563283CDED6AEAA0604597B2E33C",
      "reserveArray": "7E1FB6",
      "maxTanks": 4,
      "storageUnitsPerTank": 14,
      "pauseDrainCadenceUpdates": 2,
      "cues": [
        {
          "action": "Sub Tank Fill Tick",
          "command": "16",
          "callSites": [
            "01D5B9",
            "01D68A"
          ],
          "pcmSha256": "598AA990F8B8FE9BB06BDBE095749F3D7AA4E07EB4D9ED4730EEF5356E8BE4A9"
        },
        {
          "action": "Sub Tank Fully Charged",
          "command": "17",
          "callSites": [
            "01D5E8"
          ],
          "pcmSha256": "AB9E0A90E0808BC12B903147BF96A57368F16CBAFC992CDEF4E5632D2279E2D6"
        }
      ],
      "spans": [
        {
          "address": "01DBF6",
          "length": 36,
          "sha256": "B39BC3FC3BB55C27EABE18E1F0FBD9C95C5828196E7E6A138F1EA893D992C8B1",
          "purpose": "Sub-Tank acquisition assigns the first free slot"
        },
        {
          "address": "01D59A",
          "length": 84,
          "sha256": "C6ACF18492CA045525FFD0A65A64F7AC1BBA8E40B4E3DD692A6D92C75E6E4AA1",
          "purpose": "full-health pickup and reserve fill"
        },
        {
          "address": "01D684",
          "length": 18,
          "sha256": "1FB5A28C8F5ADD06F235CD8A6B0167C9C45C5CDD1A39420C4F727D6E1096006C",
          "purpose": "delayed fill cue for a large drop"
        },
        {
          "address": "00C29E",
          "length": 99,
          "sha256": "9022E8183D3EB9E2D66A196B7CDE10664C01D1BC6BD4265BDC2C82232B190E83",
          "purpose": "pause-menu tank activation, drain and healing"
        },
        {
          "address": "00C5DA",
          "length": 72,
          "sha256": "CC7A0E2F5C067D5B3C113D9B45F3538E7B7BA369E07D11AA216DACA666A114F6",
          "purpose": "total and repack remaining reserve energy"
        }
      ]
    },
    {
      "game": "X3",
      "romSha1": "B226F7EC59283B05C1E276E2F433893F45027CAC",
      "reserveArray": "7E1FB7",
      "maxTanks": 4,
      "storageUnitsPerTank": 14,
      "pauseDrainCadenceUpdates": 2,
      "cues": [
        {
          "action": "Sub Tank Fill Tick",
          "command": "16",
          "callSites": [
            "01D856",
            "01D927"
          ],
          "pcmSha256": "178EC752289E5F96ACD55ACD7935812FA0820AFE4A74A69107F57C99CC82B50A"
        },
        {
          "action": "Sub Tank Fully Charged",
          "command": "17",
          "callSites": [
            "01D885"
          ],
          "pcmSha256": "FAB9AA689278F159DAD8B676B090592A6B810241E73EF9E12C268E71D9094775"
        }
      ],
      "spans": [
        {
          "address": "01DC2A",
          "length": 36,
          "sha256": "ECC105A72B3908301A1F77498A0D553887B20897FC5907228E5D476E11414927",
          "purpose": "Sub-Tank acquisition assigns the first free slot"
        },
        {
          "address": "01D82D",
          "length": 20,
          "sha256": "86C840C27C87C9CAA6675CB9FD1EAB838F12E7B529F9632208F7C9F28F9834A2",
          "purpose": "health and player-mode gates before reserve fill"
        },
        {
          "address": "01D841",
          "length": 74,
          "sha256": "961E5A243C28CB5F48E720904D6729A21D025163D508D75999328E1A9A659FAA",
          "purpose": "reserve fill after the full-health gate"
        },
        {
          "address": "01D921",
          "length": 18,
          "sha256": "5693836F8CBE2A457F6421F44CB8DA6CCF37164587F28A41107D1F78C8E1AFED",
          "purpose": "delayed fill cue for a large drop"
        },
        {
          "address": "00C89F",
          "length": 50,
          "sha256": "52F1EBED1A9A22E4DE58F7B5759BB4FBC5FF5016F0E4927175CCE7053DCD958A",
          "purpose": "pause-menu tank activation"
        },
        {
          "address": "00C901",
          "length": 54,
          "sha256": "F6C89D8C4A280F3BD59BE974F1255BC1D753810411D588661C37E2E0C42C6799",
          "purpose": "pause-menu tank drain and healing"
        },
        {
          "address": "00CEAC",
          "length": 72,
          "sha256": "51E46D25B93D55C014FD224DB97C26DC6987796B4D65EAB7FA1AFCE4BA80AF1C",
          "purpose": "total and repack remaining reserve energy"
        }
      ]
    }
  ],
  "runtimeMenuEvidence": "docs/parity/pause-menus/native-reserve-transfers.json"
}
