fix overclock audio issues
This commit is contained in:
@@ -55,6 +55,7 @@ unsigned overclocked = 0;
|
|||||||
unsigned skip_7bit_overclocking = 1;
|
unsigned skip_7bit_overclocking = 1;
|
||||||
unsigned normal_scanlines = 240;
|
unsigned normal_scanlines = 240;
|
||||||
unsigned extrascanlines = 0;
|
unsigned extrascanlines = 0;
|
||||||
|
unsigned overclock_state = -1;
|
||||||
|
|
||||||
int FCEUnetplay;
|
int FCEUnetplay;
|
||||||
#ifdef PSP
|
#ifdef PSP
|
||||||
@@ -823,7 +824,6 @@ static const keymap bindmap[] = {
|
|||||||
|
|
||||||
static void check_variables(bool startup)
|
static void check_variables(bool startup)
|
||||||
{
|
{
|
||||||
static int overclock_state = -1;
|
|
||||||
struct retro_variable var = {0};
|
struct retro_variable var = {0};
|
||||||
struct retro_system_av_info av_info;
|
struct retro_system_av_info av_info;
|
||||||
bool geometry_update = false;
|
bool geometry_update = false;
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ void FCEU_ResetVidSys(void)
|
|||||||
|
|
||||||
PAL = w ? 1 : 0;
|
PAL = w ? 1 : 0;
|
||||||
|
|
||||||
totalscanlines = normal_scanlines + (overclocked ? extrascanlines : 0);
|
totalscanlines = normal_scanlines + (overclock_state ? extrascanlines : 0);
|
||||||
|
|
||||||
FCEUPPU_SetVideoSystem(w);
|
FCEUPPU_SetVideoSystem(w);
|
||||||
SetSoundVariables();
|
SetSoundVariables();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
extern int fceuindbg;
|
extern int fceuindbg;
|
||||||
|
|
||||||
|
extern unsigned overclock_state;
|
||||||
extern unsigned overclocked;
|
extern unsigned overclocked;
|
||||||
extern unsigned skip_7bit_overclocking;
|
extern unsigned skip_7bit_overclocking;
|
||||||
extern unsigned DMC_7bit;
|
extern unsigned DMC_7bit;
|
||||||
|
|||||||
18
src/ppu.c
18
src/ppu.c
@@ -1216,14 +1216,28 @@ int FCEUPPU_Loop(int skip) {
|
|||||||
if (DMC_7bit && skip_7bit_overclocking)
|
if (DMC_7bit && skip_7bit_overclocking)
|
||||||
totalscanlines = normal_scanlines;
|
totalscanlines = normal_scanlines;
|
||||||
else
|
else
|
||||||
totalscanlines = normal_scanlines + (overclocked ? extrascanlines : 0);
|
totalscanlines = normal_scanlines + (overclock_state ? extrascanlines : 0);
|
||||||
|
|
||||||
for (scanline = 0; scanline < totalscanlines; ) { //scanline is incremented in DoLine. Evil. :/
|
for (scanline = 0; scanline < totalscanlines; ) { //scanline is incremented in DoLine. Evil. :/
|
||||||
deempcnt[deemp]++;
|
deempcnt[deemp]++;
|
||||||
if ((PPUViewer) && (scanline == PPUViewScanline)) UpdatePPUView(1);
|
if ((PPUViewer) && (scanline == PPUViewScanline)) UpdatePPUView(1);
|
||||||
DoLine();
|
DoLine();
|
||||||
|
if (scanline < normal_scanlines || scanline == totalscanlines)
|
||||||
|
overclocked = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (DMC_7bit && skip_7bit_overclocking) /* 7bit sample started after 240th line */
|
||||||
|
break;
|
||||||
|
overclocked = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
/* For Debugging
|
||||||
|
* FCEU_printf("Overclock State:%d DMC+7bit:%d Skip_7bit_OC:%d\n",
|
||||||
|
* overclock_state,DMC_7bit,skip_7bit_overclocking);
|
||||||
|
* FCEU_printf("SL:%d N_SL:%d, T_SL:%d Overclocked(for FCEU_SoundCPUHook):%d\n\n",
|
||||||
|
* scanline,normal_scanlines,totalscanlines,overclocked);
|
||||||
|
*/
|
||||||
|
DMC_7bit = 0;
|
||||||
if (MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline);
|
if (MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline);
|
||||||
for (x = 1, max = 0, maxref = 0; x < 7; x++) {
|
for (x = 1, max = 0, maxref = 0; x < 7; x++) {
|
||||||
if (deempcnt[x] > max) {
|
if (deempcnt[x] > max) {
|
||||||
|
|||||||
@@ -606,7 +606,8 @@ void X6502_Run(int32 cycles)
|
|||||||
temp = _tcount;
|
temp = _tcount;
|
||||||
_tcount = 0;
|
_tcount = 0;
|
||||||
if (MapIRQHook) MapIRQHook(temp);
|
if (MapIRQHook) MapIRQHook(temp);
|
||||||
FCEU_SoundCPUHook(temp);
|
if (!overclocked)
|
||||||
|
FCEU_SoundCPUHook(temp);
|
||||||
X.PC = pbackus;
|
X.PC = pbackus;
|
||||||
_PC++;
|
_PC++;
|
||||||
switch (b1) {
|
switch (b1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user