diff options
author | WaluigiWare64 <68647953+WaluigiWare64@users.noreply.github.com> | 2020-08-05 15:06:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 15:06:15 +0100 |
commit | 6d71f9c83293006b02a96ce0f5a5f9f65a47cd18 (patch) | |
tree | 5558a3a2ae148e7e17fdd56ab0296b883da0aa09 /src/SPU.cpp | |
parent | 7e5eafe345017dc93a68572528e896f896a6e175 (diff) | |
parent | e4b1526b477bc66996bce8f0a2f81c2f1cffba63 (diff) |
Merge branch 'master' into feature/zip-support
Diffstat (limited to 'src/SPU.cpp')
-rw-r--r-- | src/SPU.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SPU.cpp b/src/SPU.cpp index 9f6b107..cd5c5b8 100644 --- a/src/SPU.cpp +++ b/src/SPU.cpp @@ -160,6 +160,8 @@ void Channel::Reset() else BusRead32 = NDS::ARM7Read32; + KeyOn = false; + SetCnt(0); SrcAddr = 0; TimerReload = 0; @@ -187,6 +189,7 @@ void Channel::DoSavestate(Savestate* file) file->Var8(&VolumeShift); file->Var8(&Pan); + file->Var8((u8*)&KeyOn); file->Var32(&Timer); file->Var32((u32*)&Pos); file->Var16((u16*)&CurSample); @@ -417,6 +420,12 @@ void Channel::Run(s32* buf, u32 samples) { if (!(Cnt & (1<<31))) return; + if (KeyOn) + { + Start(); + KeyOn = false; + } + for (u32 s = 0; s < samples; s++) { Timer += 512; // 1 sample = 512 cycles at 16MHz |