mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
basic implementation of SNDExCnt
isn't hooked up to the DSP or microphone though fixes memory abort in TwilightMenu
This commit is contained in:
@ -27,6 +27,9 @@
|
||||
namespace DSi_DSP
|
||||
{
|
||||
|
||||
// not sure whether to not rather put it somewhere else
|
||||
u16 SNDExCnt;
|
||||
|
||||
Teakra::Teakra* TeakraCore;
|
||||
|
||||
bool SCFG_RST;
|
||||
@ -151,6 +154,8 @@ void Reset()
|
||||
TeakraCore->Reset();
|
||||
|
||||
NDS::CancelEvent(NDS::Event_DSi_DSP);
|
||||
|
||||
SNDExCnt = 0;
|
||||
}
|
||||
|
||||
bool IsRstReleased()
|
||||
@ -548,6 +553,21 @@ void Write32(u32 addr, u32 val)
|
||||
Write16(addr, val & 0xFFFF);
|
||||
}
|
||||
|
||||
void WriteSNDExCnt(u16 val)
|
||||
{
|
||||
// it can be written even in NDS mode
|
||||
|
||||
// mic frequency can only be changed if it was disabled
|
||||
// before the write
|
||||
if (SNDExCnt & 0x8000)
|
||||
{
|
||||
val &= ~0x2000;
|
||||
val |= SNDExCnt & 0x2000;
|
||||
}
|
||||
|
||||
SNDExCnt = val & 0xE00F;
|
||||
}
|
||||
|
||||
void Run(u32 cycles)
|
||||
{
|
||||
if (!IsDSPCoreEnabled())
|
||||
|
Reference in New Issue
Block a user