Shuffled around init/deinit of vio2sf state a bit
parent
11fb240606
commit
7e34ccd15a
|
@ -259,8 +259,10 @@ int state_init(struct NDS_state *state)
|
|||
|
||||
void state_deinit(struct NDS_state *state)
|
||||
{
|
||||
MMU_unsetRom(state);
|
||||
NDS_DeInit(state);
|
||||
if (state->MMU)
|
||||
MMU_unsetRom(state);
|
||||
if (state->nds && state->MMU && state->NDS_ARM7 && state->NDS_ARM9 && state->MainScreen && state->SubScreen)
|
||||
NDS_DeInit(state);
|
||||
if (state->nds) free(state->nds);
|
||||
state->nds = NULL;
|
||||
if (state->NDS_ARM7) free(state->NDS_ARM7);
|
||||
|
|
|
@ -1003,12 +1003,17 @@ static int twosf_info(void * context, const char * name, const char * value)
|
|||
return NO;
|
||||
}
|
||||
|
||||
if ( state_init(core) )
|
||||
{
|
||||
state_deinit(core);
|
||||
if (state.rom) free(state.rom);
|
||||
if (state.state) free(state.state);
|
||||
return NO;
|
||||
}
|
||||
|
||||
emulatorCore = ( uint8_t * ) core;
|
||||
emulatorExtra = state.rom;
|
||||
|
||||
if ( state_init(core) )
|
||||
return NO;
|
||||
|
||||
if ( state.rom )
|
||||
state_setrom(core, state.rom, (u32) state.rom_size );
|
||||
|
||||
|
|
Loading…
Reference in New Issue