From 3da59f002ffb3c7caee261d74f394359b6bab59b Mon Sep 17 00:00:00 2001 From: João Silva Date: Sat, 14 Jan 2017 23:57:48 +0000 Subject: Merged common S9xReset and S9xSoftReset code into CommonS9xReset. --- source/cpu.c | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) (limited to 'source') 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(); } -- cgit v1.2.3