libgme / game-music-emu

Blargg's video game music emulation library, which allows audio applications to easily add playback support for the music of many classic video game consoles.
GNU Lesser General Public License v2.1
68 stars 12 forks source link

[GBS] No sound when playing "Top Gear 2 Pocket" #42

Closed Wohlstand closed 3 years ago

Wohlstand commented 4 years ago

Original report by brianpow (Bitbucket: brianpow, GitHub: brianpow).


No sound when playing "Top Gear 2 Pocket" with gme_player

The gme_player window shows as normal but no sound and only a flat wavefront bar shown

Other GBS player such as NEZPlug and MiniGBS work fine

Wohlstand commented 3 years ago

Original comment by Leandro Nini (Bitbucket: [Leandro Nini](https://bitbucket.org/Leandro Nini), ).


Did a debug trace on MiniGBS:

0242: f0 40    | SP:dff7 AF:00a0 BC:0000 DE:0000 HL:0100 | ldh a, [$ff40] | [00]
     * * *     + Audio read : ff40 ->  0                 +                +
0244: cb 7f    | SP:dff7 AF:00a0 BC:0000 DE:0000 HL:0100 | bit 7, a       |
0246: 28 09    | SP:dff7 AF:00a0 BC:0000 DE:0000 HL:0100 | jr z, +9       |

It reads from $ff40 (LCD control) and if bit 7 is set enters an infinite loop. Not sure about the rationale :confused:

Looking at the other emulators the IO area ($FF00 – $FF7F) is zeroed out at startup, which makes the tune play fine, while on gme it is set to $ff.

Will send a fix later.

Wohlstand commented 3 years ago

Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).


Zero out IO area ($FF00 – $FF7F) at startup. Fixes issue #40