mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
re900.c, ssrj.c, sstrangr.c: added save state support (nw)
This commit is contained in:
parent
8533f2617b
commit
f517793c42
@ -87,26 +87,33 @@ class re900_state : public driver_device
|
||||
public:
|
||||
re900_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_rom(*this, "rom"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_rom(*this, "rom") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
||||
required_shared_ptr<UINT8> m_rom;
|
||||
|
||||
// re900 specific
|
||||
UINT8 m_psg_pa;
|
||||
UINT8 m_psg_pb;
|
||||
UINT8 m_mux_data;
|
||||
UINT8 m_ledant;
|
||||
UINT8 m_player;
|
||||
UINT8 m_stat_a;
|
||||
|
||||
// common
|
||||
DECLARE_READ8_MEMBER(rom_r);
|
||||
DECLARE_WRITE8_MEMBER(cpu_port_0_w);
|
||||
DECLARE_WRITE8_MEMBER(re900_watchdog_reset_w);
|
||||
DECLARE_WRITE8_MEMBER(watchdog_reset_w);
|
||||
|
||||
// re900 specific
|
||||
DECLARE_READ8_MEMBER(re_psg_portA_r);
|
||||
DECLARE_READ8_MEMBER(re_psg_portB_r);
|
||||
DECLARE_WRITE8_MEMBER(re_mux_port_A_w);
|
||||
DECLARE_WRITE8_MEMBER(re_mux_port_B_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(vdp_interrupt);
|
||||
|
||||
DECLARE_DRIVER_INIT(re900);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
};
|
||||
|
||||
|
||||
@ -219,7 +226,7 @@ WRITE8_MEMBER(re900_state::cpu_port_0_w)
|
||||
// output_set_lamp_value(8,1 ^ ( (data >> 5) & 1)); /* Cont. Ent */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(re900_state::re900_watchdog_reset_w)
|
||||
WRITE8_MEMBER(re900_state::watchdog_reset_w)
|
||||
{
|
||||
//watchdog_reset_w(space,0,0); /* To do! */
|
||||
}
|
||||
@ -240,19 +247,13 @@ static ADDRESS_MAP_START( mem_io, AS_IO, 8, re900_state )
|
||||
AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("tms9128", tms9928a_device, register_write)
|
||||
AM_RANGE(0xe800, 0xe801) AM_DEVWRITE("ay_re900", ay8910_device, address_data_w)
|
||||
AM_RANGE(0xe802, 0xe802) AM_DEVREAD("ay_re900", ay8910_device, data_r)
|
||||
AM_RANGE(0xe000, 0xefff) AM_WRITE(re900_watchdog_reset_w)
|
||||
AM_RANGE(0xe000, 0xefff) AM_WRITE(watchdog_reset_w)
|
||||
AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P0) AM_WRITE(cpu_port_0_w)
|
||||
AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_NOP
|
||||
AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_NOP
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
WRITE_LINE_MEMBER(re900_state::vdp_interrupt)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE );
|
||||
}
|
||||
|
||||
|
||||
/************************
|
||||
* Input ports *
|
||||
************************/
|
||||
@ -380,7 +381,7 @@ static MACHINE_CONFIG_START( re900, re900_state )
|
||||
/* video hardware */
|
||||
MCFG_DEVICE_ADD( "tms9128", TMS9128, XTAL_10_738635MHz / 2 ) /* TMS9128NL on the board */
|
||||
MCFG_TMS9928A_VRAM_SIZE(0x4000)
|
||||
MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(re900_state, vdp_interrupt))
|
||||
MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||
MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
|
||||
MCFG_SCREEN_UPDATE_DEVICE( "tms9128", tms9128_device, screen_update )
|
||||
|
||||
@ -431,6 +432,13 @@ DRIVER_INIT_MEMBER(re900_state,re900)
|
||||
m_player = 1;
|
||||
m_stat_a = 1;
|
||||
m_psg_pa = m_psg_pb = m_mux_data = m_ledant = 0;
|
||||
|
||||
save_item(NAME(m_psg_pa));
|
||||
save_item(NAME(m_psg_pb));
|
||||
save_item(NAME(m_mux_data));
|
||||
save_item(NAME(m_ledant));
|
||||
save_item(NAME(m_player));
|
||||
save_item(NAME(m_stat_a));
|
||||
}
|
||||
|
||||
|
||||
@ -439,5 +447,5 @@ DRIVER_INIT_MEMBER(re900_state,re900)
|
||||
*************************/
|
||||
|
||||
/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
|
||||
GAMEL( 1993, re900, 0, re900, re900, re900_state, re900, ROT90, "Entretenimientos GEMINIS", "Ruleta RE-900", 0, layout_re900)
|
||||
GAME ( 1994, bs94 , 0, bs94, bs94 , re900_state, re900, ROT0, "Entretenimientos GEMINIS", "Buena Suerte '94", 0)
|
||||
GAMEL( 1993, re900, 0, re900, re900, re900_state, re900, ROT90, "Entretenimientos GEMINIS", "Ruleta RE-900", GAME_SUPPORTS_SAVE, layout_re900)
|
||||
GAME ( 1994, bs94 , 0, bs94, bs94 , driver_device, 0, ROT0, "Entretenimientos GEMINIS", "Buena Suerte '94", GAME_SUPPORTS_SAVE )
|
||||
|
@ -21,8 +21,8 @@ HW info :
|
||||
f800 ??
|
||||
|
||||
Scroll RAM contains x and y offsets for each tileline,
|
||||
as well as other data (priroities ? additional flags ?)
|
||||
All moving obejcts (cars, etc) are displayed on tilemap 3.
|
||||
as well as other data (priorities ? additional flags ?)
|
||||
All moving objects (cars, etc) are displayed on tilemap 3.
|
||||
|
||||
------------------------------------
|
||||
Cheat : $e210 - timer
|
||||
@ -34,6 +34,11 @@ HW info :
|
||||
#include "sound/ay8910.h"
|
||||
#include "includes/ssrj.h"
|
||||
|
||||
void ssrj_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_oldport));
|
||||
}
|
||||
|
||||
void ssrj_state::machine_reset()
|
||||
{
|
||||
UINT8 *rom = memregion("maincpu")->base();
|
||||
@ -42,7 +47,7 @@ void ssrj_state::machine_reset()
|
||||
m_oldport = 0x80;
|
||||
}
|
||||
|
||||
READ8_MEMBER(ssrj_state::ssrj_wheel_r)
|
||||
READ8_MEMBER(ssrj_state::wheel_r)
|
||||
{
|
||||
int port = ioport("IN1")->read() - 0x80;
|
||||
int retval = port - m_oldport;
|
||||
@ -53,14 +58,14 @@ READ8_MEMBER(ssrj_state::ssrj_wheel_r)
|
||||
|
||||
static ADDRESS_MAP_START( ssrj_map, AS_PROGRAM, 8, ssrj_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ssrj_vram1_w) AM_SHARE("vram1")
|
||||
AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(ssrj_vram2_w) AM_SHARE("vram2")
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(vram1_w) AM_SHARE("vram1")
|
||||
AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(vram2_w) AM_SHARE("vram2")
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("vram3")
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(ssrj_vram4_w) AM_SHARE("vram4")
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(vram4_w) AM_SHARE("vram4")
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM
|
||||
AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("scrollram")
|
||||
AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN0")
|
||||
AM_RANGE(0xf001, 0xf001) AM_READ(ssrj_wheel_r)
|
||||
AM_RANGE(0xf001, 0xf001) AM_READ(wheel_r)
|
||||
AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN2")
|
||||
AM_RANGE(0xf003, 0xf003) AM_WRITENOP /* unknown */
|
||||
AM_RANGE(0xf401, 0xf401) AM_DEVREAD("aysnd", ay8910_device, data_r)
|
||||
@ -141,8 +146,8 @@ static MACHINE_CONFIG_START( ssrj, ssrj_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(40*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 1*8, 31*8-1) // unknown res
|
||||
MCFG_SCREEN_UPDATE_DRIVER(ssrj_state, screen_update_ssrj)
|
||||
MCFG_SCREEN_VBLANK_DRIVER(ssrj_state, screen_eof_ssrj)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(ssrj_state, screen_update)
|
||||
MCFG_SCREEN_VBLANK_DRIVER(ssrj_state, screen_eof)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ssrj)
|
||||
@ -179,4 +184,4 @@ ROM_START( ssrj )
|
||||
|
||||
ROM_END
|
||||
|
||||
GAME( 1985, ssrj, 0, ssrj, ssrj, driver_device, 0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)",GAME_WRONG_COLORS|GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1985, ssrj, 0, ssrj, ssrj, driver_device, 0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
|
||||
|
@ -18,16 +18,21 @@ class sstrangr_state : public driver_device
|
||||
public:
|
||||
sstrangr_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_ram(*this, "ram"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_ram(*this, "ram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
||||
required_shared_ptr<UINT8> m_ram;
|
||||
|
||||
UINT8 m_flip_screen;
|
||||
UINT8 *m_proms;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(port_w);
|
||||
|
||||
virtual void video_start();
|
||||
|
||||
UINT32 screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
};
|
||||
|
||||
|
||||
@ -38,6 +43,11 @@ public:
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void sstrangr_state::video_start()
|
||||
{
|
||||
save_item(NAME(m_flip_screen));
|
||||
}
|
||||
|
||||
UINT32 sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
offs_t offs;
|
||||
@ -296,5 +306,5 @@ ROM_START( sstrangr2 )
|
||||
ROM_END
|
||||
|
||||
|
||||
GAMEL( 1978, sstrangr, 0, sstrangr, sstrangr, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger", GAME_NO_SOUND, layout_sstrangr )
|
||||
GAME( 1979, sstrangr2,sstrangr, sstrngr2, sstrngr2, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger 2", GAME_NO_SOUND )
|
||||
GAMEL( 1978, sstrangr, 0, sstrangr, sstrangr, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_sstrangr )
|
||||
GAME( 1979, sstrangr2,sstrangr, sstrngr2, sstrngr2, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger 2", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
|
||||
|
@ -3,39 +3,46 @@ class ssrj_state : public driver_device
|
||||
public:
|
||||
ssrj_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_vram1(*this, "vram1"),
|
||||
m_vram2(*this, "vram2"),
|
||||
m_vram3(*this, "vram3"),
|
||||
m_vram4(*this, "vram4"),
|
||||
m_scrollram(*this, "scrollram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
m_scrollram(*this, "scrollram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
int m_oldport;
|
||||
tilemap_t *m_tilemap1;
|
||||
tilemap_t *m_tilemap2;
|
||||
tilemap_t *m_tilemap4;
|
||||
required_shared_ptr<UINT8> m_vram1;
|
||||
required_shared_ptr<UINT8> m_vram2;
|
||||
required_shared_ptr<UINT8> m_vram3;
|
||||
required_shared_ptr<UINT8> m_vram4;
|
||||
required_shared_ptr<UINT8> m_scrollram;
|
||||
|
||||
int m_oldport;
|
||||
tilemap_t *m_tilemap1;
|
||||
tilemap_t *m_tilemap2;
|
||||
tilemap_t *m_tilemap4;
|
||||
UINT8 *m_buffer_spriteram;
|
||||
DECLARE_READ8_MEMBER(ssrj_wheel_r);
|
||||
DECLARE_WRITE8_MEMBER(ssrj_vram1_w);
|
||||
DECLARE_WRITE8_MEMBER(ssrj_vram2_w);
|
||||
DECLARE_WRITE8_MEMBER(ssrj_vram4_w);
|
||||
|
||||
DECLARE_READ8_MEMBER(wheel_r);
|
||||
DECLARE_WRITE8_MEMBER(vram1_w);
|
||||
DECLARE_WRITE8_MEMBER(vram2_w);
|
||||
DECLARE_WRITE8_MEMBER(vram4_w);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info1);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info2);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info4);
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
DECLARE_PALETTE_INIT(ssrj);
|
||||
UINT32 screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void screen_eof_ssrj(screen_device &screen, bool state);
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void screen_eof(screen_device &screen, bool state);
|
||||
void draw_objects(bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
/* tilemap 1 */
|
||||
|
||||
WRITE8_MEMBER(ssrj_state::ssrj_vram1_w)
|
||||
WRITE8_MEMBER(ssrj_state::vram1_w)
|
||||
{
|
||||
m_vram1[offset] = data;
|
||||
m_tilemap1->mark_tile_dirty(offset>>1);
|
||||
@ -21,7 +21,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info1)
|
||||
|
||||
/* tilemap 2 */
|
||||
|
||||
WRITE8_MEMBER(ssrj_state::ssrj_vram2_w)
|
||||
WRITE8_MEMBER(ssrj_state::vram2_w)
|
||||
{
|
||||
m_vram2[offset] = data;
|
||||
m_tilemap2->mark_tile_dirty(offset>>1);
|
||||
@ -39,7 +39,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info2)
|
||||
|
||||
/* tilemap 4 */
|
||||
|
||||
WRITE8_MEMBER(ssrj_state::ssrj_vram4_w)
|
||||
WRITE8_MEMBER(ssrj_state::vram4_w)
|
||||
{
|
||||
m_vram4[offset] = data;
|
||||
m_tilemap4->mark_tile_dirty(offset>>1);
|
||||
@ -60,7 +60,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info4)
|
||||
TODO: This table is nowhere near as accurate. If you bother, here's how colors should be:
|
||||
-"START" sign is red with dark blue background.
|
||||
-Sidewalk is yellow-ish.
|
||||
-first opponents have swapped colors (blue/yellow ?nstead of yellow/blue)
|
||||
-first opponents have swapped colors (blue/yellow instead of yellow/blue)
|
||||
-after the first stage, houses have red/white colors.
|
||||
*/
|
||||
|
||||
@ -270,7 +270,7 @@ PALETTE_INIT_MEMBER(ssrj_state, ssrj)
|
||||
palette.set_pen_color(i*8+j, fakecols[i][j][0], fakecols[i][j][1], fakecols[i][j][2]);
|
||||
}
|
||||
|
||||
UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 ssrj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_tilemap1->set_scrollx(0, 0xff-m_scrollram[2] );
|
||||
m_tilemap1->set_scrolly(0, m_scrollram[0] );
|
||||
@ -282,7 +282,7 @@ UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitma
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ssrj_state::screen_eof_ssrj(screen_device &screen, bool state)
|
||||
void ssrj_state::screen_eof(screen_device &screen, bool state)
|
||||
{
|
||||
// rising edge
|
||||
if (state)
|
||||
|
Loading…
Reference in New Issue
Block a user