From 94eda9b21244d156a608c4f176852e8296323732 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 4 Oct 2020 01:09:14 +0200 Subject: [PATCH] Cleanups --- state.c | 88 --------------------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/state.c b/state.c index 0a83312..3d418d8 100644 --- a/state.c +++ b/state.c @@ -259,94 +259,6 @@ static int state_restore(race_state_t *rs) return 1; } -static int state_restore_0x10(FILE *stream) -{ - struct race_state_0x10 rs; - if (fread(&rs, sizeof(rs), 1, stream) < 1) - return 0; - - /* Verify state version */ - if (rs.state_version != 0x10) - return 0; - - /* Verify ROM signature */ - if (memcmp(mainrom, rs.rom_signature, sizeof(rs.rom_signature)) != 0) - return 0; - - /* TLCS-900h Registers */ - gen_regsPC = rs.pc; - gen_regsSR = rs.sr; - F2 = rs.f_dash; - - int i = 0; - gen_regsXWA0 = rs.gpr[i++]; - gen_regsXBC0 = rs.gpr[i++]; - gen_regsXDE0 = rs.gpr[i++]; - gen_regsXHL0 = rs.gpr[i++]; - - gen_regsXWA1 = rs.gpr[i++]; - gen_regsXBC1 = rs.gpr[i++]; - gen_regsXDE1 = rs.gpr[i++]; - gen_regsXHL1 = rs.gpr[i++]; - - gen_regsXWA2 = rs.gpr[i++]; - gen_regsXBC2 = rs.gpr[i++]; - gen_regsXDE2 = rs.gpr[i++]; - gen_regsXHL2 = rs.gpr[i++]; - - gen_regsXWA3 = rs.gpr[i++]; - gen_regsXBC3 = rs.gpr[i++]; - gen_regsXDE3 = rs.gpr[i++]; - gen_regsXHL3 = rs.gpr[i++]; - - gen_regsXIX = rs.gpr[i++]; - gen_regsXIY = rs.gpr[i++]; - gen_regsXIZ = rs.gpr[i++]; - gen_regsXSP = rs.gpr[i++]; - - gen_regsSP = rs.gpr[i++]; - gen_regsXSSP = rs.gpr[i++]; - gen_regsXNSP = rs.gpr[i++]; - - /* Z80 Registers */ -#ifdef CZ80 - extern cz80_struc *RACE_cz80_struc; - extern s32 Z80_ICount; - int size_of_z80 = - (u32*)(&(RACE_cz80_struc->CycleSup)) - (u32*)(&(RACE_cz80_struc->BC)); - - memcpy(RACE_cz80_struc, &rs.RACE_cz80_struc, size_of_z80); - Z80_ICount = rs.Z80_ICount; - Cz80_Set_PC(RACE_cz80_struc, rs.PC_offset); -#elif DRZ80 - extern Z80_Regs Z80; - memcpy(&Z80, &rs.Z80, sizeof(Z80)); -#endif - - /* Sound Chips */ - extern int sndCycles; - sndCycles = rs.sndCycles; - memcpy(&toneChip, &rs.toneChip, sizeof(SoundChip)); - memcpy(&noiseChip, &rs.noiseChip, sizeof(SoundChip)); - - /* Timers */ - timer0 = rs.timer0; - timer1 = rs.timer1; - timer2 = rs.timer2; - timer3 = rs.timer3; - - /* DMA */ - memcpy(&ldcRegs, &rs.ldcRegs, sizeof(ldcRegs)); - - /* Memory */ - memcpy(mainram, rs.ram, sizeof(rs.ram)); - memcpy(&mainram[0x20000], rs.cpuram, sizeof(rs.cpuram)); - - tlcs_reinit(); - - return 1; -} - int state_store_mem(void *state) { return state_store((race_state_t*)state);