diff options
| author | 2026-01-24 14:36:04 +0100 | |
|---|---|---|
| committer | 2026-01-24 14:36:41 +0100 | |
| commit | 07e67e2762376036dffc0a2d35c1252f0f70d7e4 (patch) | |
| tree | 1090a6fd6e57b1f352c1e3cf072014a4090cf804 | |
| parent | 3093334027159ddbcbf655d4a7c5bb6c2448b72d (diff) | |
lethalj: add support for savestates [TheLostNinja]
| -rw-r--r-- | src/mame/ice/lethalj.cpp | 50 | ||||
| -rw-r--r-- | src/mame/ice/lethalj.h | 7 | ||||
| -rw-r--r-- | src/mame/ice/lethalj_v.cpp | 13 |
3 files changed, 43 insertions, 27 deletions
diff --git a/src/mame/ice/lethalj.cpp b/src/mame/ice/lethalj.cpp index 9d367fa442b..45a52a6364e 100644 --- a/src/mame/ice/lethalj.cpp +++ b/src/mame/ice/lethalj.cpp @@ -192,6 +192,24 @@ Pin #11(+) | | R | #define VIDEO_CLOCK_LETHALJ XTAL(11'059'200) +/************************************* + * + * Initialisation + * + *************************************/ + +void lethalj_state::machine_start() +{ + m_lamps.resolve(); + + save_item(NAME(m_blitter_data)); + save_item(NAME(m_vispage)); + save_item(NAME(m_gunx)); + save_item(NAME(m_guny)); + save_item(NAME(m_blank_palette)); +} + + /************************************* * @@ -741,7 +759,7 @@ INPUT_PORTS_END /************************************* * - * Machine drivers + * Machine configs * *************************************/ @@ -1234,19 +1252,19 @@ void lethalj_state::init_cclownz() * *************************************/ -GAME( 1996, lethalj, 0, lethalj, lethalj, lethalj_state, empty_init, ROT0, "The Game Room", "Lethal Justice (Version 2.3)", 0 ) +GAME( 1996, lethalj, 0, lethalj, lethalj, lethalj_state, empty_init, ROT0, "The Game Room", "Lethal Justice (Version 2.3)", MACHINE_SUPPORTS_SAVE ) /* manual states (C) 1998 Innovative Concepts in Entertainment, Inc. */ -GAME( 1998, franticf, 0, franticf, franticf, lethalj_state, empty_init, ROT0, "ICE", "Frantic Fred (Release 2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // unemulated I/Os, flickers when inserting a coin (should disable blitter?) -GAME( 1996, franticfa, franticf, franticf, franticfa, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Frantic Fred", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // as above -GAME( 1997, eggventr, 0, gameroom, eggventr, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 10)", 0 ) -GAME( 1997, eggventr8, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 8)", 0 ) -GAME( 1997, eggventr7, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 7)", 0 ) -GAME( 1997, eggventr4, eggventr, gameroom, eggventr2, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 4)", 0 ) -GAME( 1997, eggventr2, eggventr, gameroom, eggventr2, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 2)", 0 ) -GAME( 1997, eggventr1, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "Kyle Hodgetts / The Game Room", "Egg Venture (Release 1)", 0 ) -GAME( 1997, eggventra, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "The Game Room (A.L. Australia license)", "Egg Venture (A.L. Release)", 0 ) -GAME( 1997, eggventrd, eggventr, gameroom, eggvntdx, lethalj_state, empty_init, ROT0, "The Game Room", "Egg Venture Deluxe", 0 ) -GAME( 1997, ripribit, 0, gameroom, ripribit, lethalj_state, init_ripribit, ROT0, "LAI Games", "Ripper Ribbit (Version 3.5)", 0 ) -GAME( 1997, ripribita, ripribit, gameroom, ripribit, lethalj_state, init_ripribit, ROT0, "LAI Games", "Ripper Ribbit (Version 2.8.4)", 0 ) -GAME( 1999, cfarm, 0, gameroom, cfarm, lethalj_state, init_cfarm, ROT90, "LAI Games", "Chicken Farm (Version 2.0)", 0 ) -GAME( 1999, cclownz, 0, gameroom, cclownz, lethalj_state, init_cclownz, ROT0, "LAI Games", "Crazzy Clownz (Version 1.0)", 0 ) +GAME( 1998, franticf, 0, franticf, franticf, lethalj_state, empty_init, ROT0, "ICE", "Frantic Fred (Release 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // unemulated I/Os, flickers when inserting a coin (should disable blitter?) +GAME( 1996, franticfa, franticf, franticf, franticfa, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Frantic Fred", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // as above +GAME( 1997, eggventr, 0, gameroom, eggventr, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 10)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventr8, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 8)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventr7, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 7)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventr4, eggventr, gameroom, eggventr2, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 4)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventr2, eggventr, gameroom, eggventr2, lethalj_state, empty_init, ROT0, "ICE / The Game Room", "Egg Venture (Release 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventr1, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "Kyle Hodgetts / The Game Room", "Egg Venture (Release 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventra, eggventr, gameroom, eggventr, lethalj_state, empty_init, ROT0, "The Game Room (A.L. Australia license)", "Egg Venture (A.L. Release)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, eggventrd, eggventr, gameroom, eggvntdx, lethalj_state, empty_init, ROT0, "The Game Room", "Egg Venture Deluxe", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, ripribit, 0, gameroom, ripribit, lethalj_state, init_ripribit, ROT0, "LAI Games", "Ripper Ribbit (Version 3.5)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, ripribita, ripribit, gameroom, ripribit, lethalj_state, init_ripribit, ROT0, "LAI Games", "Ripper Ribbit (Version 2.8.4)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, cfarm, 0, gameroom, cfarm, lethalj_state, init_cfarm, ROT90, "LAI Games", "Chicken Farm (Version 2.0)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, cclownz, 0, gameroom, cclownz, lethalj_state, init_cclownz, ROT0, "LAI Games", "Crazzy Clownz (Version 1.0)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/ice/lethalj.h b/src/mame/ice/lethalj.h index 784958ad5ef..9f7a0f000a5 100644 --- a/src/mame/ice/lethalj.h +++ b/src/mame/ice/lethalj.h @@ -42,6 +42,10 @@ public: ioport_value cclownz_paddle(); +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + private: void ripribit_control_w(uint16_t data); void cfarm_control_w(uint16_t data); @@ -54,9 +58,6 @@ private: void lethalj_map(address_map &map) ATTR_COLD; - virtual void machine_start() override { m_lamps.resolve(); } - virtual void video_start() override ATTR_COLD; - TIMER_CALLBACK_MEMBER(gen_ext1_int); required_device<tms34010_device> m_maincpu; diff --git a/src/mame/ice/lethalj_v.cpp b/src/mame/ice/lethalj_v.cpp index d3363b2456c..1f3be3695b1 100644 --- a/src/mame/ice/lethalj_v.cpp +++ b/src/mame/ice/lethalj_v.cpp @@ -79,7 +79,7 @@ uint16_t lethalj_state::lethalj_gun_r(offs_t offset) /************************************* * - * video startup + * Video startup * *************************************/ @@ -87,13 +87,12 @@ void lethalj_state::video_start() { /* allocate video RAM for screen */ m_screenram = std::make_unique<uint16_t[]>(BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT); + save_pointer(NAME(m_screenram), BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT); /* predetermine blitter info */ m_blitter_rows = m_blitter_base.length() / BLITTER_SOURCE_WIDTH; m_gen_ext1_int_timer = timer_alloc(FUNC(lethalj_state::gen_ext1_int), this); - - m_vispage = 0; } @@ -118,14 +117,13 @@ void lethalj_state::do_blit() int width = (uint16_t)m_blitter_data[5]; int dstx = (int16_t)m_blitter_data[6]; int height = (uint16_t)m_blitter_data[7]; - int y; /* logerror("blitter data = %04X %04X %04X %04X %04X %04X %04X %04X\n", m_blitter_data[0], m_blitter_data[1], m_blitter_data[2], m_blitter_data[3], m_blitter_data[4], m_blitter_data[5], m_blitter_data[6], m_blitter_data[7]); */ /* loop over Y coordinates */ - for (y = 0; y <= height; y++, srcy++, dsty++) + for (int y = 0; y <= height; y++, srcy++, dsty++) { /* clip in Y */ if (dsty >= 0 && dsty < BLITTER_DEST_HEIGHT/2) @@ -134,10 +132,9 @@ void lethalj_state::do_blit() uint16_t *dest = m_screenram.get() + ((dsty + ((m_vispage ^ 1) << 8)) << 9); int sx = srcx; int dx = dstx; - int x; /* loop over X coordinates */ - for (x = 0; x <= width; x++, sx++, dx++) + for (int x = 0; x <= width; x++, sx++, dx++) { dx &= 0x1ff; @@ -176,7 +173,7 @@ void lethalj_state::blitter_w(offs_t offset, uint16_t data, uint16_t mem_mask) /************************************* * - * video update + * Video update * *************************************/ |
