aboutsummaryrefslogtreecommitdiff
path: root/source/cpuexec.c
diff options
context:
space:
mode:
authorJoão Silva2017-08-14 06:03:05 +0100
committerJoão Silva2017-08-14 06:03:05 +0100
commit5e450063fbe25926ae50d569c285db428055318a (patch)
treed0dd772a589dbfa07bacd70207fc4db0f37d4109 /source/cpuexec.c
parentfdaf2925f1353b07cd957ae47b0e6793648559be (diff)
downloadsnes9x2005-5e450063fbe25926ae50d569c285db428055318a.tar.gz
snes9x2005-5e450063fbe25926ae50d569c285db428055318a.tar.bz2
snes9x2005-5e450063fbe25926ae50d569c285db428055318a.zip
Deleted several unused variables, code and files.
Diffstat (limited to 'source/cpuexec.c')
-rw-r--r--source/cpuexec.c108
1 files changed, 50 insertions, 58 deletions
diff --git a/source/cpuexec.c b/source/cpuexec.c
index ef96339..fedb318 100644
--- a/source/cpuexec.c
+++ b/source/cpuexec.c
@@ -367,7 +367,6 @@ void S9xDoHBlankProcessing_SFX()
if (!PPU.ForcedBlanking)
{
uint8_t tmp = 0;
-
PPU.OAMAddr = PPU.SavedOAMAddr;
if (PPU.OAMPriorityRotation)
@@ -399,45 +398,42 @@ void S9xDoHBlankProcessing_SFX()
CPU.Flags &= ~NMI_FLAG;
S9xStartScreenRefresh();
}
- if (CPU.V_Counter >= FIRST_VISIBLE_LINE &&
- CPU.V_Counter < PPU.ScreenHeight + FIRST_VISIBLE_LINE)
+ if (CPU.V_Counter >= FIRST_VISIBLE_LINE && CPU.V_Counter < PPU.ScreenHeight + FIRST_VISIBLE_LINE)
RenderLine(CPU.V_Counter - FIRST_VISIBLE_LINE);
#ifndef USE_BLARGG_APU
+ if (APU.TimerEnabled [2])
{
- if (APU.TimerEnabled [2])
+ APU.Timer [2] += 4;
+ while (APU.Timer [2] >= APU.TimerTarget [2])
{
- APU.Timer [2] += 4;
- while (APU.Timer [2] >= APU.TimerTarget [2])
+ IAPU.RAM [0xff] = (IAPU.RAM [0xff] + 1) & 0xf;
+ APU.Timer [2] -= APU.TimerTarget [2];
+ IAPU.WaitCounter++;
+ IAPU.APUExecuting = true;
+ }
+ }
+ if (CPU.V_Counter & 1)
+ {
+ if (APU.TimerEnabled [0])
+ {
+ APU.Timer [0]++;
+ if (APU.Timer [0] >= APU.TimerTarget [0])
{
- IAPU.RAM [0xff] = (IAPU.RAM [0xff] + 1) & 0xf;
- APU.Timer [2] -= APU.TimerTarget [2];
+ IAPU.RAM [0xfd] = (IAPU.RAM [0xfd] + 1) & 0xf;
+ APU.Timer [0] = 0;
IAPU.WaitCounter++;
IAPU.APUExecuting = true;
}
}
- if (CPU.V_Counter & 1)
+ if (APU.TimerEnabled [1])
{
- if (APU.TimerEnabled [0])
+ APU.Timer [1]++;
+ if (APU.Timer [1] >= APU.TimerTarget [1])
{
- APU.Timer [0]++;
- if (APU.Timer [0] >= APU.TimerTarget [0])
- {
- IAPU.RAM [0xfd] = (IAPU.RAM [0xfd] + 1) & 0xf;
- APU.Timer [0] = 0;
- IAPU.WaitCounter++;
- IAPU.APUExecuting = true;
- }
- }
- if (APU.TimerEnabled [1])
- {
- APU.Timer [1]++;
- if (APU.Timer [1] >= APU.TimerTarget [1])
- {
- IAPU.RAM [0xfe] = (IAPU.RAM [0xfe] + 1) & 0xf;
- APU.Timer [1] = 0;
- IAPU.WaitCounter++;
- IAPU.APUExecuting = true;
- }
+ IAPU.RAM [0xfe] = (IAPU.RAM [0xfe] + 1) & 0xf;
+ APU.Timer [1] = 0;
+ IAPU.WaitCounter++;
+ IAPU.APUExecuting = true;
}
}
}
@@ -501,7 +497,6 @@ void S9xDoHBlankProcessing_NoSFX()
if (!PPU.ForcedBlanking)
{
uint8_t tmp = 0;
-
PPU.OAMAddr = PPU.SavedOAMAddr;
if (PPU.OAMPriorityRotation)
@@ -533,45 +528,42 @@ void S9xDoHBlankProcessing_NoSFX()
CPU.Flags &= ~NMI_FLAG;
S9xStartScreenRefresh();
}
- if (CPU.V_Counter >= FIRST_VISIBLE_LINE &&
- CPU.V_Counter < PPU.ScreenHeight + FIRST_VISIBLE_LINE)
+ if (CPU.V_Counter >= FIRST_VISIBLE_LINE && CPU.V_Counter < PPU.ScreenHeight + FIRST_VISIBLE_LINE)
RenderLine(CPU.V_Counter - FIRST_VISIBLE_LINE);
#ifndef USE_BLARGG_APU
+ if (APU.TimerEnabled [2])
{
- if (APU.TimerEnabled [2])
+ APU.Timer [2] += 4;
+ while (APU.Timer [2] >= APU.TimerTarget [2])
{
- APU.Timer [2] += 4;
- while (APU.Timer [2] >= APU.TimerTarget [2])
+ IAPU.RAM [0xff] = (IAPU.RAM [0xff] + 1) & 0xf;
+ APU.Timer [2] -= APU.TimerTarget [2];
+ IAPU.WaitCounter++;
+ IAPU.APUExecuting = true;
+ }
+ }
+ if (CPU.V_Counter & 1)
+ {
+ if (APU.TimerEnabled [0])
+ {
+ APU.Timer [0]++;
+ if (APU.Timer [0] >= APU.TimerTarget [0])
{
- IAPU.RAM [0xff] = (IAPU.RAM [0xff] + 1) & 0xf;
- APU.Timer [2] -= APU.TimerTarget [2];
+ IAPU.RAM [0xfd] = (IAPU.RAM [0xfd] + 1) & 0xf;
+ APU.Timer [0] = 0;
IAPU.WaitCounter++;
IAPU.APUExecuting = true;
}
}
- if (CPU.V_Counter & 1)
+ if (APU.TimerEnabled [1])
{
- if (APU.TimerEnabled [0])
+ APU.Timer [1]++;
+ if (APU.Timer [1] >= APU.TimerTarget [1])
{
- APU.Timer [0]++;
- if (APU.Timer [0] >= APU.TimerTarget [0])
- {
- IAPU.RAM [0xfd] = (IAPU.RAM [0xfd] + 1) & 0xf;
- APU.Timer [0] = 0;
- IAPU.WaitCounter++;
- IAPU.APUExecuting = true;
- }
- }
- if (APU.TimerEnabled [1])
- {
- APU.Timer [1]++;
- if (APU.Timer [1] >= APU.TimerTarget [1])
- {
- IAPU.RAM [0xfe] = (IAPU.RAM [0xfe] + 1) & 0xf;
- APU.Timer [1] = 0;
- IAPU.WaitCounter++;
- IAPU.APUExecuting = true;
- }
+ IAPU.RAM [0xfe] = (IAPU.RAM [0xfe] + 1) & 0xf;
+ APU.Timer [1] = 0;
+ IAPU.WaitCounter++;
+ IAPU.APUExecuting = true;
}
}
}