static int StateAction(StateMem *sm, int load, int data_only) { SFORMAT StateRegs[] = { SFVAR(z80_runtime), SFARRAY(CPUExRAM, 16384), SFVAR(FlashStatusEnable), SFEND }; SFORMAT TLCS_StateRegs[] = { SFVARN(pc, "PC"), SFVARN(sr, "SR"), SFVARN(f_dash, "F_DASH"), SFARRAY32N(gpr, 4, "GPR"), SFARRAY32N(gprBank[0], 4, "GPRB0"), SFARRAY32N(gprBank[1], 4, "GPRB1"), SFARRAY32N(gprBank[2], 4, "GPRB2"), SFARRAY32N(gprBank[3], 4, "GPRB3"), SFEND }; if(!MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAIN")) return(0); if(!MDFNSS_StateAction(sm, load, data_only, TLCS_StateRegs, "TLCS")) return(0); if(!MDFNNGPCDMA_StateAction(sm, load, data_only)) return(0); if(!MDFNNGPCSOUND_StateAction(sm, load, data_only)) return(0); if(!NGPGfx->StateAction(sm, load, data_only)) return(0); if(!MDFNNGPCZ80_StateAction(sm, load, data_only)) return(0); if(!int_timer_StateAction(sm, load, data_only)) return(0); if(!BIOSHLE_StateAction(sm, load, data_only)) return(0); if(!FLASH_StateAction(sm, load, data_only)) return(0); if(load) { RecacheFRM(); changedSP(); } return(1); }
static void StateAction(StateMem *sm, const unsigned load, const bool data_only) { SFORMAT StateRegs[] = { SFVAR(z80_runtime), SFARRAY(CPUExRAM, 16384), SFVAR(FlashStatusEnable), SFEND }; SFORMAT TLCS_StateRegs[] = { SFVARN(pc, "PC"), SFVARN(sr, "SR"), SFVARN(f_dash, "F_DASH"), SFARRAY32N(gpr, 4, "GPR"), SFARRAY32N(gprBank[0], 4, "GPRB0"), SFARRAY32N(gprBank[1], 4, "GPRB1"), SFARRAY32N(gprBank[2], 4, "GPRB2"), SFARRAY32N(gprBank[3], 4, "GPRB3"), SFEND }; MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAIN"); MDFNSS_StateAction(sm, load, data_only, TLCS_StateRegs, "TLCS"); MDFNNGPCDMA_StateAction(sm, load, data_only); MDFNNGPCSOUND_StateAction(sm, load, data_only); NGPGfx->StateAction(sm, load, data_only); MDFNNGPCZ80_StateAction(sm, load, data_only); int_timer_StateAction(sm, load, data_only); BIOSHLE_StateAction(sm, load, data_only); FLASH_StateAction(sm, load, data_only); if(load) { RecacheFRM(); changedSP(); } }