#include "soundux.h"
#include "cpuexec.h"
-/* For note-triggered SPC dump support */
-//#include "snapshot.h"
-
//extern int NoiseFreq [32];
#ifdef DEBUGGER
void S9xTraceSoundDSP (const char *s, int i1 = 0, int i2 = 0, int i3 = 0,
void S9xResetAPU ()
{
-// Settings.APUEnabled = Settings.NextAPUEnabled;
-
memset (IAPU.RAM, Settings.APURAMInitialValue, 0x10000);
//memset (IAPU.ShadowRAM, Settings.APURAMInitialValue, 0x10000);
static uint8 KeyOn;
static uint8 KeyOnPrev;
int i;
-
-/* char str[64];
- if (byte!=0)
- {
- sprintf(str,"fr : %d\nwrite dsp %d\ncpu cycle=%d pc=%04X",framecpto,byte,CPU.Cycles,CPU.PC-CPU.PCBase);
- S9xMessage(0,0,str);
- gp32_pause();
- }*/
-
- //extern uint8 spc_dump_dsp[0x100];
-
- //spc_dump_dsp[reg] = byte;
switch (reg)
{
uint8 mask = 1;
for (int c = 0; c < 8; c++, mask <<= 1)
{
- int type;
- if (byte & mask)
+ uint8 bit = byte & mask;
+ if (bit)
{
- type = SOUND_NOISE;
#ifdef DEBUGGER
if (Settings.TraceSoundDSP)
{
S9xTraceSoundDSP ("%d(on),", c);
}
#endif
+ S9xSetSoundType(c, SOUND_NOISE);
}
else
{
- type = SOUND_SAMPLE;
#ifdef DEBUGGER
if (Settings.TraceSoundDSP)
{
S9xTraceSoundDSP ("%d(off),", c);
}
#endif
+ S9xSetSoundType(c, SOUND_SAMPLE);
}
- S9xSetSoundType (c, type);
}
#ifdef DEBUGGER
if (Settings.TraceSoundDSP)
S9xTraceSoundDSP ("\n");
#endif
}
- //spc_is_dumping_temp = byte;
+
return;
case APU_VOL_LEFT + 0x00: