Forgot to properly initalize sound, also switched from YM2612 to YM2608,

due to the sound ceiling not properly rendering sounds as they should be
This commit is contained in:
techmetx11 2024-04-10 19:22:57 +00:00
parent 9bbd673bfa
commit 833ed614b6
No known key found for this signature in database
GPG key ID: 20E0C88A0E7E5AF2

View file

@ -152,8 +152,8 @@ bool DivEngine::loadTFM(unsigned char* file, size_t len) {
ds.systemName="Sega Genesis/Mega Drive or TurboSound FM"; ds.systemName="Sega Genesis/Mega Drive or TurboSound FM";
ds.subsong[0]->hz=50; ds.subsong[0]->hz=50;
ds.systemLen = 1; ds.systemLen = 1;
ds.system[0]=DIV_SYSTEM_YM2612;
ds.system[0]=DIV_SYSTEM_YM2608;
unsigned char magic[8]={0}; unsigned char magic[8]={0};
reader.readNoRLE(magic, 8); reader.readNoRLE(magic, 8);
@ -278,6 +278,8 @@ bool DivEngine::loadTFM(unsigned char* file, size_t len) {
} }
ds.notes=notes; ds.notes=notes;
if (active) quitDispatch();
BUSY_BEGIN_SOFT; BUSY_BEGIN_SOFT;
saveLock.lock(); saveLock.lock();
song.unload(); song.unload();
@ -286,6 +288,13 @@ bool DivEngine::loadTFM(unsigned char* file, size_t len) {
recalcChans(); recalcChans();
saveLock.unlock(); saveLock.unlock();
BUSY_END; BUSY_END;
if (active) {
initDispatch();
BUSY_BEGIN;
renderSamples();
reset();
BUSY_END;
}
success=true; success=true;
} catch(TFMEndOfFileException& e) { } catch(TFMEndOfFileException& e) {
lastError="incomplete file!"; lastError="incomplete file!";