Play the music and sound effects from the ROM's sound engine (Closes #34)
The sound engine (audio/engine.asm, home/audio.asm) is ported on a byte copy of its audio WRAM and a sound register model. A reference test runs the cartridge's routines beside it and matches the WRAM and registers after every UpdateSound for all songs, effects and cries, fades, the danger tone and effect priority. apu.ts synthesizes the four channels in an AudioWorklet; its output matches the reference emulator's APU by spectrum. The world runs the engine twice per tick; Play or the first press unlocks sound, pausing suspends it, Settings sets the volume. Wired in: map music by map setup and special map music, script audio commands, text fanfares, WaitSFX and cries that hold the script frozen (the last page stays shown), battle music, cries, fainting, victory, capture and the low HP tone, Pokémon Center healing, evolution, the intro, the Pokédex's cries, PCs, marts, healing items, talk and menu clicks, bumps, ledges, warps, boulders, the Bicycle and Surf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aff8391e55
commit
7f30c3f450
34 files changed
+3961
-74
No files matched your search
@@ -747,8 +747,13 @@ describe.skipIf(!existsSync(romPath))(
|
||||
walkTo(world, 6, 4);
|
||||
expect(world.move("up")).toBe(false);
|
||||
world.interact();
|
||||
// pokepic shows the ROM's front picture and waits for a button.
|
||||
// pokepic shows the ROM's front picture; the cry plays (PlayMonCry
|
||||
// waits for it) and waitbutton then waits for a button.
|
||||
expect(world.picture).toBe(155);
|
||||
expect(world.dialogue).toBeUndefined();
|
||||
expect(world.sound.sfxPlaying).toBe(true);
|
||||
for (let tick = 0; tick < 300 && !world.dialogue; tick++) world.tick();
|
||||
expect(world.sound.sfxPlaying).toBe(false);
|
||||
expect(world.dialogue?.pages).toEqual([""]);
|
||||
world.advanceDialogue();
|
||||
expect(world.picture).toBeUndefined();
|
||||
|
||||
Reference in new issue
Block a user