LIJI32 / SameBoy

Game Boy and Game Boy Color emulator written in C
https://sameboy.github.io/
Other
1.64k stars 207 forks source link

Enhanced SGB games have missing audio effects #451

Open Adamillo opened 2 years ago

Adamillo commented 2 years ago

Super Game Boy games have audio enhancements that don't render at all in Same Boy. Here's how the audio should sound on a real SGB shown in this YouTube video at 8:34 https://youtu.be/JU5OBrDlOR8?t=514 On SameBoy the audio is completely silent

CasualPokePlayer commented 2 years ago

These sound effects come from the SNES SPC, not the Game Boy. SameBoy itself only offers HLE emulation so the full SNES isn't available for use.

As a note Gambatte does offer emulation of these sound effects, by simply dropping in blargg's snes_spc and HLE'ing those interactions (updating ports every frame and transfers are just memcpy's into SPC RAM).

There is a PR for implementing this here https://github.com/LIJI32/SameBoy/pull/264 but it's relatively abandoned and has the question of SPC state legality (since its RAM would be shoved with a standard SNES music program and various samples). Gambatte doesn't particularly care, as it presumes savestates aren't just copyrightable (it just loads up a savestate in snes_spc's format that has the SGB2 ROM initial state on boot/reset).

Also there's the issue of sound being broken even with the (HLE) boot jingle, as there are suddenly two sources of audio outputting at the frontend's requested sample rate within the same sample callback, so essentially double the frontend sample rate is being shoved through and causes samples to be dropped.

If you want pure SGB emulation you can also just look at BSNES which uses SameBoy for the GB part of its LLE SGB emulation.