diff options
author | João Silva | 2017-01-14 23:57:48 +0000 |
---|---|---|
committer | João Silva | 2017-01-14 23:57:48 +0000 |
commit | 3da59f002ffb3c7caee261d74f394359b6bab59b (patch) | |
tree | da5d1eab28e16d5b0f71ed3154750fe2f97037c1 /source | |
parent | 9702298962eccc89ded30901f8b219f3e7f948dc (diff) | |
download | snes9x2005-3da59f002ffb3c7caee261d74f394359b6bab59b.tar.gz snes9x2005-3da59f002ffb3c7caee261d74f394359b6bab59b.tar.bz2 snes9x2005-3da59f002ffb3c7caee261d74f394359b6bab59b.zip |
Merged common S9xReset and S9xSoftReset code into CommonS9xReset.
Diffstat (limited to 'source')
-rw-r--r-- | source/cpu.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/source/cpu.c b/source/cpu.c index 14695e6..ba1b45f 100644 --- a/source/cpu.c +++ b/source/cpu.c @@ -73,19 +73,17 @@ void S9xResetCPU() S9xUnpackStatus(); } -void S9xReset(void) +static void CommonS9xReset(void) { if (Settings.SuperFX) S9xResetSuperFX(); memset(Memory.FillRAM, 0, 0x8000); memset(Memory.VRAM, 0x00, 0x10000); - memset(Memory.RAM, 0x55, 0x20000); if (Settings.SPC7110) S9xSpc7110Reset(); S9xResetCPU(); - S9xResetPPU(); S9xResetSRTC(); if (Settings.SDD1) S9xResetSDD1(); @@ -93,6 +91,8 @@ void S9xReset(void) S9xResetDMA(); S9xResetAPU(); S9xResetDSP1(); + if (Settings.OBC1) + ResetOBC1(); S9xSA1Init(); if (Settings.C4) S9xInitC4(); @@ -100,38 +100,18 @@ void S9xReset(void) #ifdef WANT_CHEATS S9xInitCheatData(); #endif +} - if (Settings.OBC1) - ResetOBC1(); +void S9xReset(void) +{ + S9xResetPPU(); + CommonS9xReset(); + memset(Memory.RAM, 0x55, 0x20000); } + void S9xSoftReset(void) { - if (Settings.SuperFX) - S9xResetSuperFX(); - - memset(Memory.FillRAM, 0, 0x8000); - memset(Memory.VRAM, 0x00, 0x10000); - - if (Settings.SPC7110) - S9xSpc7110Reset(); - S9xResetCPU(); S9xSoftResetPPU(); - S9xResetSRTC(); - if (Settings.SDD1) - S9xResetSDD1(); - - S9xResetDMA(); - S9xResetAPU(); - S9xResetDSP1(); - if (Settings.OBC1) - ResetOBC1(); - S9xSA1Init(); - if (Settings.C4) - S9xInitC4(); - -#ifdef WANT_CHEATS - S9xInitCheatData(); -#endif - + CommonS9xReset(); } |