MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

ShimaPong
MAME Fan
Reged: 03/12/05
Posts: 783
Send PM


Testers ID: 0413 (pesadelo has wrong load via autosave/state)
#240613 - 12/07/10 05:18 PM


Sounds like the reason of un-registed post_load function in tms9928a.c.
Current postload in this driver is the follwoing.

Code:


void TMS9928A_post_load (running_machine *machine) {
int i;

/* all registers need to be re-written, so tables are recalculated */
for (i=0;i<8;i++)
change_register (machine, i, tms.Regs[i]);

/* make sure the interrupt request is set properly */
if (tms.INTCallback) tms.INTCallback (machine, tms.INT);
}


But I doubt it is called from others. So...

Code:


static STATE_POSTLOAD ( tms9928a_postload )
{
// all registers need to be re-written, so tables are recalculated
for (int i = 0; i < 8 ; i++)
change_register (machine, i, tms.Regs[i]);

// make sure the interrupt request is set properly
if (tms.INTCallback != NULL)
tms.INTCallback (machine, tms.INT);
}


Of course, the above postload() is required to regist in TMS9928A_start()

Code:


static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *intf)
{
...
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[0]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[1]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[2]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[3]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[4]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[5]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[6]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Regs[7]);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.StatusReg);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.ReadAhead);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.FirstByte);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.latch);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.Addr);
state_save_register_item(machine, "tms9928a", NULL, 0, tms.INT);
state_save_register_item_pointer(machine, "tms9928a", NULL, 0, tms.vMem, intf->vram);
state_save_register_postload(machine, tms9928a_postload, NULL);



..."-autosave" and "-state" for pesadelo seem to re-load fine.
But pengadvb which marks support_save flag and has the same problem causes freeze via autosave/state though gfx will be restored correctly.

Also state_postload may be required to add into pengadvb.c

Code:


static STATE_POSTLOAD( pengadvb_postload )
{
mem_map_banks(machine);
}




"Any company has no power to stop people emulating"
MAME is the emulator of no giving in the pressure from any company even if they don't allow


Pages: 1

MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 266 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1143