mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
sidearms.c: ioport_array (nw)
This commit is contained in:
parent
8e1e14dacf
commit
e0b95640cb
@ -52,17 +52,14 @@ WRITE8_MEMBER(sidearms_state::sidearms_bankswitch_w)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Turtle Ship input ports are rotated 90 degrees */
|
||||
IOPORT_ARRAY_MEMBER(sidearms_state::ports) { "SYSTEM", "P1", "P2", "DSW0", "DSW1" };
|
||||
|
||||
READ8_MEMBER(sidearms_state::turtship_ports_r)
|
||||
{
|
||||
int i,res;
|
||||
static const char *const portnames[] = { "SYSTEM", "P1", "P2", "DSW0", "DSW1", "NOT_PRESENT", "NOT_PRESENT", "NOT_PRESENT" }; // only inputs 0-4 are present
|
||||
|
||||
res = 0;
|
||||
for (i = 0;i < 8;i++)
|
||||
res |= ((ioport(portnames[i])->read_safe(0) >> offset) & 1) << i;
|
||||
int res = 0;
|
||||
for (int i = 0; i < 5;i++)
|
||||
res |= ((m_ports[i]->read_safe(0) >> offset) & 1) << i;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -5,23 +5,33 @@ class sidearms_state : public driver_device
|
||||
public:
|
||||
sidearms_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram") ,
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_spriteram(*this, "spriteram") ,
|
||||
m_bg_scrollx(*this, "bg_scrollx"),
|
||||
m_bg_scrolly(*this, "bg_scrolly"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_colorram(*this, "colorram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
m_ports(*this, ports) { }
|
||||
|
||||
int m_gameid;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<buffered_spriteram8_device> m_spriteram;
|
||||
|
||||
required_shared_ptr<UINT8> m_bg_scrollx;
|
||||
required_shared_ptr<UINT8> m_bg_scrolly;
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
required_shared_ptr<UINT8> m_colorram;
|
||||
|
||||
DECLARE_IOPORT_ARRAY(ports);
|
||||
required_ioport_array<5> m_ports;
|
||||
|
||||
UINT8 *m_tilerom;
|
||||
tilemap_t *m_bg_tilemap;
|
||||
tilemap_t *m_fg_tilemap;
|
||||
@ -60,8 +70,4 @@ public:
|
||||
void draw_sprites_region(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset );
|
||||
void sidearms_draw_starfield( bitmap_ind16 &bitmap );
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user