diff --git a/browser-payloads.json b/browser-payloads.json index 367417db..533196a6 100644 --- a/browser-payloads.json +++ b/browser-payloads.json @@ -1,4 +1,4 @@ { - "release": "browser-payloads-8b903d25f672", - "sha256": "fb4be47c168e12f7007eac443884d7b58077fbccb7b815ed0b68a151cc3ee344" + "release": "browser-payloads-794c86516e68", + "sha256": "4e984c92353f45f0076401dfd63d4c874c4854141a936873f5ce91c5e26846cb" } diff --git a/package-lock.json b/package-lock.json index da9d5736..7bcc77b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3800,7 +3800,7 @@ } }, "packages/romdev-core-gambatte": { - "version": "0.13.0", + "version": "0.13.1", "license": "GPL-2.0-only", "engines": { "node": ">=24" @@ -4011,7 +4011,7 @@ "romdev-core-fake08": "0.1.1", "romdev-core-fceumm": "0.14.0", "romdev-core-flycast": "0.4.1", - "romdev-core-gambatte": "0.13.0", + "romdev-core-gambatte": "0.13.1", "romdev-core-gametank": "0.5.1", "romdev-core-geargrafx": "0.10.1", "romdev-core-gpgx": "0.15.1", diff --git a/packages/romdev-core-gambatte/package.json b/packages/romdev-core-gambatte/package.json index 094bcf45..f530e8df 100644 --- a/packages/romdev-core-gambatte/package.json +++ b/packages/romdev-core-gambatte/package.json @@ -1,6 +1,6 @@ { "name": "romdev-core-gambatte", - "version": "0.13.0", + "version": "0.13.1", "description": "gambatte libretro core (Game Boy / Game Boy Color) for romdev, bundled as WASM.", "type": "module", "main": "index.js", diff --git a/packages/romdevtools/package.json b/packages/romdevtools/package.json index a553fe35..53258cee 100644 --- a/packages/romdevtools/package.json +++ b/packages/romdevtools/package.json @@ -63,7 +63,7 @@ "romdev-core-fake08": "0.1.1", "romdev-core-fceumm": "0.14.0", "romdev-core-flycast": "0.4.1", - "romdev-core-gambatte": "0.13.0", + "romdev-core-gambatte": "0.13.1", "romdev-core-gametank": "0.5.1", "romdev-core-geargrafx": "0.10.1", "romdev-core-gpgx": "0.15.1", diff --git a/packages/romdevtools/scripts/multiplayer/README.md b/packages/romdevtools/scripts/multiplayer/README.md index ce4386bb..4d5d22be 100644 --- a/packages/romdevtools/scripts/multiplayer/README.md +++ b/packages/romdevtools/scripts/multiplayer/README.md @@ -42,7 +42,7 @@ from ROM identity and emulates its timers from CPU cycles. | Core | Schema | Snapshot additions and normalization | | --- | --- | --- | -| gambatte | `0x47420101` | Full CPU/mapper/RTC/HuC3/timer/serial/APU/PPU/WRAM/VRAM/OAM/HRAM/cart-RAM serializer; epoch and emulated clock; frontend frame/sample counters, turbo phase/config, both blipper buffers, phase, integrator and last sample. CC resampler and interframe blending are disabled in this mode. | +| gambatte | `0x47420102` | Full CPU/mapper/RTC/HuC3/timer/serial/APU/PPU/WRAM/VRAM/OAM/HRAM/cart-RAM serializer; epoch and emulated clock; frontend frame/sample counters, turbo phase/config, both blipper buffers, phase, integrator and last sample; native blit deadline and blank-LCD phase. CC resampler and interframe blending are disabled in this mode. | | fceumm | `0x4e450101` | Full CPU/mapper/PPU/APU/DMA/RAM/cart-RAM/controller serializer, Four Score enable flag and exact native device configuration, FIR interpolation index and full low/high quality wave histories. Existing DC filter accumulators remain included. Stereo widening is unsupported (digest refuses it). | Gambatte's `endx` was a cached next-tile boundary reconstructed on load from `xpos` @@ -51,6 +51,21 @@ PPU causal fields. The unused DMG-only `dmgPalette` payload previously contained uninitialized stack bytes; deterministic save writes explicit zeros when `isCgb()` is false. CGB palette data remains intact. No known byte is hidden from the digest. +The MP bootstrap can spend many native frames with the LCD off before world +initialization. Gambatte's ordinary loader recomputes the blit deadline and resets +the blank-LCD phase, changing the first restored native frame. Deterministic +schema `0x47420102` retains both in its 80-byte envelope (64-byte v1 envelopes +are rejected). Its loader also restores all captured sprite attributes/words, +including the dormant suffix that the ordinary loader leaves from a later frame, +and preserves the LCD-off initial current-sprite sentinel. A disabled mode-0 STAT +IRQ deadline is normalized only when the loader ignores it; active deadlines +remain part of the snapshot and digest. These changes are deterministic-only. + +The LCD-off regression restores four differently aged boot checkpoints after +LCD enable, visible sprite processing and active STAT timing. Each restore compares +40 subsequent native frames' CPU/RAM/pixels/audio/digest, including the transition +out of the wait. The browser harness performs the same checks. + Blipper serialization uses fixed-width little-endian integers and excludes its immutable coefficient table and pointers. Its signed residual phase can be negative after rounding to the next output sample; restore validates that range. @@ -109,7 +124,7 @@ ROMDEV_BUILD_CWD=packages/romdevtools build-image/build-wasm.sh build-fceumm.sh node --test packages/romdevtools/test/multiplayer-core.test.js packages/romdevtools/test/browser-surface-imports.test.js ``` -The thirteen core/compiler tests independently boot GB/GBC/NES across a wall-clock +The core/compiler tests independently boot GB/GBC/NES across a wall-clock second without sharing state. They compare 32 replay frames' RAM, CPU registers, pixels, audio and digest, check against Node SHA-256, require visible fixture pixels, and cover 1/2/3/4 pads, gapped slots, release and reload, plus all three NES filter qualities and invalid bootstrap rejection. The GBC fixture diff --git a/packages/romdevtools/scripts/multiplayer/build-harness.mjs b/packages/romdevtools/scripts/multiplayer/build-harness.mjs index 1cadf359..98c6da16 100644 --- a/packages/romdevtools/scripts/multiplayer/build-harness.mjs +++ b/packages/romdevtools/scripts/multiplayer/build-harness.mjs @@ -13,7 +13,7 @@ const out=path.join(dist,'m1');mkdirSync(out,{recursive:true}); for(const name of ['index.html','main.js','worker.js'])cpSync(path.join(import.meta.dirname,'harness',name),path.join(out,name)); const hostDir=path.join(repo,'packages/romdev-core-host');mkdirSync(path.join(out,'host'),{recursive:true}); for(const name of (await import('node:fs')).readdirSync(hostDir).filter(n=>n.endsWith('.js')&&!n.endsWith('.test.js')))cpSync(path.join(hostDir,name),path.join(out,'host',name)); -const roms={nes:(await fourScoreRom()).outputs['pads.nes'],gb:gbFixture(false),gbc:gbFixture(true)}; +const roms={nes:(await fourScoreRom()).outputs['pads.nes'],gb:gbFixture(false),gbc:gbFixture(true),'gb-offlcd':gbFixture(false,false,true),'gbc-offlcd':gbFixture(true,false,true)}; const hash=bytes=>createHash('sha256').update(bytes).digest('hex'); const artifacts={};for(const [name,bytes]of Object.entries(roms)){writeFileSync(path.join(out,name+'.rom'),bytes);artifacts[name+'.rom']=hash(bytes);} for(const core of ['gambatte','fceumm'])for(const ext of ['js','wasm']){ @@ -22,6 +22,17 @@ for(const core of ['gambatte','fceumm'])for(const ext of ['js','wasm']){ const sourceCommit=execFileSync('git',['rev-parse','HEAD'],{cwd:repo,encoding:'utf8'}).trim(); writeFileSync(path.join(out,'manifest.json'),JSON.stringify({milestone:'M1',sourceCommit,artifacts},null,2)+'\n'); cpSync(path.join(dist,'LICENSE'),path.join(out,'LICENSE')); -cpSync(path.join(dist,'NOTICE.md'),path.join(out,'NOTICE.md')); +const versions=JSON.parse(readFileSync(path.join(repo,'packages/romdevtools/scripts/versions.json'),'utf8')); +const source='https://github.com/ssk-play/romdev/tree/'+sourceCommit; +const notices=['# Core verification program notices','', + 'This program redistributes the GPL emulator cores as separate WASM modules. LICENSE contains GPL version 2; LICENSE-host contains the MIT license for the host and test fixtures.', '', + 'Corresponding source and rebuild recipes for this exact harness: '+source+'.', '', + 'The host and fixtures come from packages/romdev-core-host and packages/romdevtools/scripts/multiplayer plus test/fixtures/multiplayer in that source tree.', '']; +for(const core of ['gambatte','fceumm']){ + const pkg=JSON.parse(readFileSync(path.join(repo,'packages',`romdev-core-${core}`,'package.json'),'utf8')),pin=versions.cores[core]; + notices.push(`- ${core} (${pkg.name} ${pkg.version}, ${pkg.license}): ${pin.url.replace(/\.git$/,'')}/tree/${pin.commit}, with the patches and pinned build recipe at ${source}/packages/romdevtools/scripts/build-${core}.sh.`); +} +notices.push('', 'Rebuild from the source checkout with ROMDEV_BUILD_CWD=packages/romdevtools build-image/build-wasm.sh build-gambatte.sh (and build-fceumm.sh), then run build-harness.mjs. The published payload manifest pins the same core binaries. Manifest.json records SHA-256 for every ROM/core artifact.'); +writeFileSync(path.join(out,'NOTICE.md'),notices.join('\n')+'\n'); cpSync(path.join(repo,'packages/romdevtools/LICENSE'),path.join(out,'LICENSE-host')); console.log('M1 harness staged:',out,sourceCommit); diff --git a/packages/romdevtools/scripts/multiplayer/harness/index.html b/packages/romdevtools/scripts/multiplayer/harness/index.html index f93b7aac..c3d372d1 100644 --- a/packages/romdevtools/scripts/multiplayer/harness/index.html +++ b/packages/romdevtools/scripts/multiplayer/harness/index.html @@ -2,7 +2,7 @@
-Independent boot and rollback checks for GB, GBC and native NES Four Score.
Starting automatic checks…
+Independent boot, LCD-off bootstrap restoration, sprites, STAT timing and rollback checks for GB, GBC and native NES Four Score.
Starting automatic checks…
Player positionsAfter the checks, move each NES player's colored square. Hold a button for at least 50 ms. This is a core fixture, not the multiplayer game UI.
Test reports stay in this browser. No login or upload is needed: the fixtures contain no account or game data. License · Source