Add overclocking - backported from FCEUX with mods

This commit is contained in:
twinaphex
2016-02-22 18:36:09 +01:00
parent 479d5d8e37
commit 417b8c6022
8 changed files with 114 additions and 33 deletions

View File

@@ -61,6 +61,7 @@ typedef struct {
int reloaddec;
} ENVUNIT;
unsigned DMC_7bit = 0; // used to skip overclocking
static ENVUNIT EnvUnits[3];
static const int RectDuties[4] = { 1, 2, 4, 6 };
@@ -276,9 +277,19 @@ static DECLFW(Write_DMCRegs) {
break;
case 0x01: DoPCM();
RawDALatch = V & 0x7F;
if (RawDALatch)
DMC_7bit = 1;
break;
case 0x02: DMCAddressLatch = V; break;
case 0x03: DMCSizeLatch = V; break;
case 0x02:
DMCAddressLatch = V;
if (V)
DMC_7bit = 0;
break;
case 0x03:
DMCSizeLatch = V;
if (V)
DMC_7bit = 0;
break;
}
}