Previous 15994 Revisions Next

r8057 Monday 17th May, 2010 at 06:28:32 UTC by Fabio Priuli
Added supergb cart SRAM saving (bug #1949)
[src/mess/machine]gb.c

src/mess/machine/gb.c
r8056r8057
338338{
339339   sgb_tile_data = auto_alloc_array_clear(machine, UINT8, 0x2000 );
340340
341   add_exit_callback(machine, gb_machine_stop);
342   
341343   /* Allocate the serial timer, and disable it */
342344   gb_driver_data.gb_serial_timer = timer_alloc(machine,  gb_serial_timer_proc , NULL);
343345   timer_enable( gb_driver_data.gb_serial_timer, 0 );
r8056r8057
425427static void gb_machine_stop(running_machine *machine)
426428{
427429   /* Don't save if there was no battery */
428   if( !(gb_driver_data.CartType & BATTERY) || ! gb_driver_data.RAMBanks )
430   if(!(gb_driver_data.CartType & BATTERY) || !gb_driver_data.RAMBanks)
429431      return;
430432
431433   /* NOTE: The reason we save the carts RAM this way instead of using MAME's
432434       built in macros is because they force the filename to be the name of
433435       the machine.  We need to have a separate name for each game. */
434   image_battery_save(devtag_get_device(machine, "cart"), gb_driver_data.gb_cart_ram, gb_driver_data.RAMBanks * 0x2000 );
436   image_battery_save(devtag_get_device(machine, "cart"), gb_driver_data.gb_cart_ram, gb_driver_data.RAMBanks * 0x2000);
435437}
436438
437439static void gb_set_mbc1_banks( running_machine *machine )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team