Skip to content

Commit

Permalink
-Applied some optimizations to APU, getset and soundux based on snes9…
Browse files Browse the repository at this point in the history
…x 3DS.

-Updated getset to snes9x v1.43.
-Fixed Mega Man X3: Zero Project romhack.
-Added fix for ActRaiser 2.
-Added some optimize compiler options, thanks to @reprep for the help.
-Code clean up.
  • Loading branch information
esmjanus committed Aug 28, 2017
1 parent 4249449 commit f79c148
Show file tree
Hide file tree
Showing 8 changed files with 717 additions and 806 deletions.
14 changes: 9 additions & 5 deletions apu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ void S9xSetAPUDSP (uint8 byte)
{
static uint8 KeyOn;
static uint8 KeyOnPrev;
//WAIT4MIXING()
uint8 reg = (IAPU.RAM) [0xf2];
int pitch;

uint8 reg = (IAPU.RAM) [0xf2];

switch (reg)
{
Expand Down Expand Up @@ -520,7 +521,9 @@ void S9xSetAPUDSP (uint8 byte)
case APU_P_LOW + 0x50:
case APU_P_LOW + 0x60:
case APU_P_LOW + 0x70:
S9xSetSoundHertz (reg >> 4, ((byte + (APUPack.APU.DSP[reg + 1] << 8)) & FREQUENCY_MASK) * 8);
pitch = (((int)byte + ((int)APUPack.APU.DSP [reg + 1] << 8)) & FREQUENCY_MASK);
S9xSetSoundHertz (reg >> 4, pitch * 8);
//S9xSetSoundHertz (reg >> 4, ((byte + (APUPack.APU.DSP [reg + 1] << 8)) & FREQUENCY_MASK) * 8);
break;

case APU_P_HIGH + 0x00:
Expand All @@ -531,8 +534,9 @@ void S9xSetAPUDSP (uint8 byte)
case APU_P_HIGH + 0x50:
case APU_P_HIGH + 0x60:
case APU_P_HIGH + 0x70:
S9xSetSoundHertz (reg >> 4,
(((byte << 8) + APUPack.APU.DSP[reg - 1]) & FREQUENCY_MASK) * 8);
pitch = ((((int)byte << 8) + (int)APUPack.APU.DSP [reg - 1]) & FREQUENCY_MASK);
S9xSetSoundHertz (reg >> 4, pitch * 8);
//S9xSetSoundHertz (reg >> 4, (((byte << 8) + APUPack.APU.DSP [reg - 1]) & FREQUENCY_MASK) * 8);
break;

case APU_SRCN + 0x00:
Expand Down
Loading

0 comments on commit f79c148

Please sign in to comment.