From: Xander Xander [mailto:xander85@operamail.com]

Sent: Sunday, May 10, 2009 1:28 AM
To: submit@mamedev.org
Subject: Save state for artmagic.c and runaway.c

I have added the save state to artmagic.c and runaway.c

Xander
This commit is contained in:
Aaron Giles 2009-05-15 05:14:52 +00:00
parent a5699e8513
commit d9f4734cfa
6 changed files with 57 additions and 8 deletions

View File

@ -99,6 +99,24 @@ void tlc34076_reset(int dacwidth)
/*************************************
*
* Save State
*
*************************************/
void tlc34076_state_save(running_machine *machine)
{
state_save_register_global_array(machine, local_paletteram);
state_save_register_global_array(machine, regs);
state_save_register_global_array(machine, pens);
state_save_register_global(machine, writeindex);
state_save_register_global(machine, readindex);
state_save_register_global(machine, dacbits);
}
/*************************************
*
* Read access

View File

@ -8,6 +8,7 @@
***************************************************************************/
void tlc34076_reset(int dacwidth);
void tlc34076_state_save(running_machine *machine);
const pen_t *tlc34076_get_pens(void);

View File

@ -76,11 +76,25 @@ static void m68k_gen_int(const device_config *device, int state)
*
*************************************/
static MACHINE_START( artmagic )
{
state_save_register_global(machine, tms_irq);
state_save_register_global(machine, hack_irq);
state_save_register_global(machine, prot_input_index);
state_save_register_global(machine, prot_output_index);
state_save_register_global(machine, prot_output_bit);
state_save_register_global(machine, prot_bit_index);
state_save_register_global(machine, prot_save);
state_save_register_global_array(machine, prot_input);
state_save_register_global_array(machine, prot_output);
}
static MACHINE_RESET( artmagic )
{
tms_irq = hack_irq = 0;
update_irq_state(machine);
tlc34076_reset(6);
tlc34076_state_save(machine);
}
@ -699,6 +713,7 @@ static MACHINE_DRIVER_START( artmagic )
MDRV_CPU_CONFIG(tms_config)
MDRV_CPU_PROGRAM_MAP(tms_map)
MDRV_MACHINE_START(artmagic)
MDRV_MACHINE_RESET(artmagic)
MDRV_QUANTUM_TIME(HZ(6000))
MDRV_NVRAM_HANDLER(generic_1fill)
@ -917,7 +932,7 @@ static DRIVER_INIT( stonebal )
*
*************************************/
GAME( 1993, ultennis, 0, artmagic, ultennis, ultennis, ROT0, "Art & Magic", "Ultimate Tennis", 0 )
GAME( 1994, cheesech, 0, cheesech, cheesech, cheesech, ROT0, "Art & Magic", "Cheese Chase", 0 )
GAME( 1994, stonebal, 0, stonebal, stonebal, stonebal, ROT0, "Art & Magic", "Stone Ball (4 Players)", 0 )
GAME( 1994, stoneba2, stonebal, stonebal, stoneba2, stonebal, ROT0, "Art & Magic", "Stone Ball (2 Players)", 0 )
GAME( 1993, ultennis, 0, artmagic, ultennis, ultennis, ROT0, "Art & Magic", "Ultimate Tennis", GAME_SUPPORTS_SAVE )
GAME( 1994, cheesech, 0, cheesech, cheesech, cheesech, ROT0, "Art & Magic", "Cheese Chase", GAME_SUPPORTS_SAVE )
GAME( 1994, stonebal, 0, stonebal, stonebal, stonebal, ROT0, "Art & Magic", "Stone Ball (4 Players)", GAME_SUPPORTS_SAVE )
GAME( 1994, stoneba2, stonebal, stonebal, stoneba2, stonebal, ROT0, "Art & Magic", "Stone Ball (2 Players)", GAME_SUPPORTS_SAVE )

View File

@ -27,6 +27,7 @@ extern WRITE8_HANDLER( runaway_paletteram_w );
extern WRITE8_HANDLER( runaway_video_ram_w );
extern WRITE8_HANDLER( runaway_tile_bank_w );
static emu_timer *interrupt_timer;
static TIMER_CALLBACK( interrupt_callback )
{
@ -40,13 +41,17 @@ static TIMER_CALLBACK( interrupt_callback )
if (scanline >= 263)
scanline = 16;
timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), NULL, scanline, interrupt_callback);
timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
}
static MACHINE_START( runaway )
{
interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
}
static MACHINE_RESET( runaway )
{
timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 16, 0), NULL, 16, interrupt_callback);
timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 16, 0), 16);
}
@ -357,6 +362,7 @@ static MACHINE_DRIVER_START( runaway )
MDRV_CPU_ADD("maincpu", M6502, 12096000 / 8) /* ? */
MDRV_CPU_PROGRAM_MAP(runaway_map)
MDRV_MACHINE_START(runaway)
MDRV_MACHINE_RESET(runaway)
MDRV_ATARIVGEAROM_ADD("earom")
@ -433,5 +439,5 @@ ROM_START( qwak )
ROM_END
GAME( 1982, qwak, 0, qwak, qwak, 0, ROT270, "Atari", "Qwak (prototype)", 0 )
GAME( 1982, runaway, 0, runaway, runaway, 0, ROT0, "Atari", "Runaway (prototype)", 0 )
GAME( 1982, qwak, 0, qwak, qwak, 0, ROT270, "Atari", "Qwak (prototype)", GAME_SUPPORTS_SAVE )
GAME( 1982, runaway, 0, runaway, runaway, 0, ROT0, "Atari", "Runaway (prototype)", GAME_SUPPORTS_SAVE )

View File

@ -60,6 +60,11 @@ VIDEO_START( artmagic )
{
blitter_base = (UINT16 *)memory_region(machine, "gfx1");
blitter_mask = memory_region_length(machine, "gfx1")/2 - 1;
state_save_register_global_array(machine, artmagic_xor);
state_save_register_global(machine, artmagic_is_stoneball);
state_save_register_global_array(machine, blitter_data);
state_save_register_global(machine, blitter_page);
}

View File

@ -77,12 +77,16 @@ static TILE_GET_INFO( qwak_get_tile_info )
VIDEO_START( runaway )
{
bg_tilemap = tilemap_create(machine, runaway_get_tile_info, tilemap_scan_rows, 8, 8, 32, 30);
state_save_register_global(machine, tile_bank);
}
VIDEO_START( qwak )
{
bg_tilemap = tilemap_create(machine, qwak_get_tile_info, tilemap_scan_rows, 8, 8, 32, 30);
state_save_register_global(machine, tile_bank);
}