mirror of
https://github.com/holub/mame
synced 2025-05-28 08:33:05 +03:00
xyonix,c: added save state support (nw)
This commit is contained in:
parent
67d993bf43
commit
b0264399ef
@ -25,7 +25,15 @@ TODO:
|
||||
#include "includes/xyonix.h"
|
||||
|
||||
|
||||
WRITE8_MEMBER(xyonix_state::xyonix_irqack_w)
|
||||
void xyonix_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_e0_data));
|
||||
save_item(NAME(m_credits));
|
||||
save_item(NAME(m_coins));
|
||||
save_item(NAME(m_prev_coin));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xyonix_state::irqack_w)
|
||||
{
|
||||
m_maincpu->set_input_line(0, CLEAR_LINE);
|
||||
}
|
||||
@ -71,7 +79,7 @@ void xyonix_state::handle_coins(int coin)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(xyonix_state::xyonix_io_r)
|
||||
READ8_MEMBER(xyonix_state::io_r)
|
||||
{
|
||||
int regPC = space.device().safe_pc();
|
||||
|
||||
@ -122,7 +130,7 @@ READ8_MEMBER(xyonix_state::xyonix_io_r)
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xyonix_state::xyonix_io_w)
|
||||
WRITE8_MEMBER(xyonix_state::io_w)
|
||||
{
|
||||
//logerror ("xyonix_port_e0_w %02x - PC = %04x\n", data, space.device().safe_pc());
|
||||
m_e0_data = data;
|
||||
@ -133,7 +141,7 @@ WRITE8_MEMBER(xyonix_state::xyonix_io_w)
|
||||
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, xyonix_state )
|
||||
AM_RANGE(0x0000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xdfff) AM_RAM
|
||||
AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(xyonix_vidram_w) AM_SHARE("vidram")
|
||||
AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(vidram_w) AM_SHARE("vidram")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( port_map, AS_IO, 8, xyonix_state )
|
||||
@ -141,9 +149,9 @@ static ADDRESS_MAP_START( port_map, AS_IO, 8, xyonix_state )
|
||||
AM_RANGE(0x20, 0x20) AM_READNOP AM_DEVWRITE("sn1", sn76496_device, write) /* SN76496 ready signal */
|
||||
AM_RANGE(0x21, 0x21) AM_READNOP AM_DEVWRITE("sn2", sn76496_device, write)
|
||||
AM_RANGE(0x40, 0x40) AM_WRITENOP /* NMI ack? */
|
||||
AM_RANGE(0x50, 0x50) AM_WRITE(xyonix_irqack_w)
|
||||
AM_RANGE(0x50, 0x50) AM_WRITE(irqack_w)
|
||||
AM_RANGE(0x60, 0x61) AM_WRITENOP /* mc6845 */
|
||||
AM_RANGE(0xe0, 0xe0) AM_READWRITE(xyonix_io_r, xyonix_io_w)
|
||||
AM_RANGE(0xe0, 0xe0) AM_READWRITE(io_r, io_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* Inputs Ports **************************************************************/
|
||||
@ -226,7 +234,7 @@ static MACHINE_CONFIG_START( xyonix, xyonix_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(80*4, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 80*4-1, 0, 28*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(xyonix_state, screen_update_xyonix)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(xyonix_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", xyonix)
|
||||
@ -259,4 +267,4 @@ ROM_END
|
||||
|
||||
/* GAME drivers **************************************************************/
|
||||
|
||||
GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", 0 )
|
||||
GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", GAME_SUPPORTS_SAVE )
|
||||
|
@ -3,26 +3,32 @@ class xyonix_state : public driver_device
|
||||
public:
|
||||
xyonix_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_vidram(*this, "vidram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode") { }
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_vidram(*this, "vidram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
required_shared_ptr<UINT8> m_vidram;
|
||||
|
||||
tilemap_t *m_tilemap;
|
||||
|
||||
int m_e0_data;
|
||||
int m_credits;
|
||||
int m_coins;
|
||||
int m_prev_coin;
|
||||
DECLARE_WRITE8_MEMBER(xyonix_irqack_w);
|
||||
DECLARE_READ8_MEMBER(xyonix_io_r);
|
||||
DECLARE_WRITE8_MEMBER(xyonix_io_w);
|
||||
DECLARE_WRITE8_MEMBER(xyonix_vidram_w);
|
||||
TILE_GET_INFO_MEMBER(get_xyonix_tile_info);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(irqack_w);
|
||||
DECLARE_READ8_MEMBER(io_r);
|
||||
DECLARE_WRITE8_MEMBER(io_w);
|
||||
DECLARE_WRITE8_MEMBER(vidram_w);
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void video_start();
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
DECLARE_PALETTE_INIT(xyonix);
|
||||
UINT32 screen_update_xyonix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void handle_coins(int coin);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ PALETTE_INIT_MEMBER(xyonix_state, xyonix)
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(xyonix_state::get_xyonix_tile_info)
|
||||
TILE_GET_INFO_MEMBER(xyonix_state::get_tile_info)
|
||||
{
|
||||
int tileno;
|
||||
int attr = m_vidram[tile_index+0x1000+1];
|
||||
@ -41,7 +41,7 @@ TILE_GET_INFO_MEMBER(xyonix_state::get_xyonix_tile_info)
|
||||
SET_TILE_INFO_MEMBER(0,tileno,attr >> 4,0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(xyonix_state::xyonix_vidram_w)
|
||||
WRITE8_MEMBER(xyonix_state::vidram_w)
|
||||
{
|
||||
m_vidram[offset] = data;
|
||||
m_tilemap->mark_tile_dirty((offset-1)&0x0fff);
|
||||
@ -49,10 +49,10 @@ WRITE8_MEMBER(xyonix_state::xyonix_vidram_w)
|
||||
|
||||
void xyonix_state::video_start()
|
||||
{
|
||||
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(xyonix_state::get_xyonix_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 80, 32);
|
||||
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(xyonix_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 80, 32);
|
||||
}
|
||||
|
||||
UINT32 xyonix_state::screen_update_xyonix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 xyonix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user