Skip to content

Commit

Permalink
SPU: Logic re-write
Browse files Browse the repository at this point in the history
  • Loading branch information
Aikku93 committed Oct 5, 2022
1 parent b6da15a commit 2bb2802
Show file tree
Hide file tree
Showing 5 changed files with 764 additions and 553 deletions.
9 changes: 6 additions & 3 deletions desmume/src/NDSSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1422,9 +1422,12 @@ static void execHardware_hblank()

//emulation housekeeping. for some reason we always do this at hblank,
//even though it sounds more reasonable to do it at hstart
SPU_Emulate_core();
driver->AVI_SoundUpdate(SPU_core->outbuf,spu_core_samples);
WAV_WavSoundUpdate(SPU_core->outbuf,spu_core_samples);
int coreSamples = SPU_Emulate_core(355*6); // HLine = 355 dots @ 6c/dot
if(coreSamples)
{
driver->AVI_SoundUpdate(SPU_core->outbuf,coreSamples);
WAV_WavSoundUpdate(SPU_core->outbuf,coreSamples);
}
}

static void execHardware_hstart_vblankEnd()
Expand Down
6 changes: 2 additions & 4 deletions desmume/src/NDSSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ extern struct TCommonSettings
, spuInterpolationMode(2)
, manualBackupType(0)
, autodetectBackupMethod(0)
, spu_muteChannels(0)
, spu_captureMuted(false)
, spu_advanced(true)
, StylusPressure(50)
Expand All @@ -543,9 +544,6 @@ extern struct TCommonSettings
strcpy(ARM7BIOS, "biosnds7.bin");
strcpy(ExtFirmwarePath, "firmware.bin");

for(int i=0;i<16;i++)
spu_muteChannels[i] = false;

for(int g=0;g<2;g++)
for(int x=0;x<5;x++)
dispLayers[g][x]=true;
Expand Down Expand Up @@ -652,7 +650,7 @@ extern struct TCommonSettings
int SPU_sync_mode;
int SPU_sync_method;

bool spu_muteChannels[16];
u16 spu_muteChannels;
bool spu_captureMuted;
bool spu_advanced;

Expand Down
Loading

0 comments on commit 2bb2802

Please sign in to comment.