summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/cardline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/cardline.cpp')
-rw-r--r--src/mame/drivers/cardline.cpp61
1 files changed, 26 insertions, 35 deletions
diff --git a/src/mame/drivers/cardline.cpp b/src/mame/drivers/cardline.cpp
index bad735186f5..0db1f9319dd 100644
--- a/src/mame/drivers/cardline.cpp
+++ b/src/mame/drivers/cardline.cpp
@@ -17,7 +17,6 @@
TODO:
Really understand ASIC chip
- Remove device_post_load once outputs support savestates
***********************************/
@@ -52,18 +51,17 @@ public:
protected:
virtual void machine_start() override;
- virtual void device_post_load() override;
private:
- DECLARE_WRITE8_MEMBER(vram_w);
- DECLARE_WRITE8_MEMBER(attr_w);
- DECLARE_WRITE8_MEMBER(video_w);
- DECLARE_READ8_MEMBER(hsync_r);
- DECLARE_WRITE8_MEMBER(lamps_w);
+ void vram_w(offs_t offset, uint8_t data);
+ void attr_w(offs_t offset, uint8_t data);
+ void video_w(uint8_t data);
+ uint8_t hsync_r();
+ void lamps_w(uint8_t data);
- DECLARE_READ8_MEMBER(asic_r);
- DECLARE_WRITE8_MEMBER(asic_w);
- DECLARE_WRITE8_MEMBER(a3003_w);
+ uint8_t asic_r(offs_t offset);
+ void asic_w(offs_t offset, uint8_t data);
+ void a3003_w(uint8_t data);
void cardline_palette(palette_device &palette) const;
@@ -80,7 +78,6 @@ private:
uint8_t m_video;
uint8_t m_hsync_q;
- uint8_t m_lamps_cache[8];
required_device<i80c32_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
@@ -94,18 +91,12 @@ void cardline_state::machine_start()
m_lamps.resolve();
m_video = 0;
m_hsync_q = 1;
- memset(m_lamps_cache, 0, sizeof(m_lamps_cache));
+
for (int i = 0; i < 0x2000; i++)
m_maincpu.target()->space(AS_IO).write_byte(i, 0x73);
+
save_item(NAME(m_video));
save_item(NAME(m_hsync_q));
- save_item(NAME(m_lamps_cache));
-}
-
-void cardline_state::device_post_load()
-{
- for (int i = 0; i < 8; i++)
- m_lamps[i] = m_lamps_cache[i];
}
MC6845_BEGIN_UPDATE( cardline_state::crtc_begin_update )
@@ -169,18 +160,18 @@ WRITE_LINE_MEMBER(cardline_state::vsync_changed)
//m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
-WRITE8_MEMBER(cardline_state::a3003_w)
+void cardline_state::a3003_w(uint8_t data)
{
/* seems to generate a signal when address is written to */
}
-WRITE8_MEMBER(cardline_state::vram_w)
+void cardline_state::vram_w(offs_t offset, uint8_t data)
{
offset+=0x1000*((m_video&2)>>1);
m_videoram[offset]=data;
}
-READ8_MEMBER(cardline_state::asic_r)
+uint8_t cardline_state::asic_r(offs_t offset)
{
static int t=0;
//printf("asic read %02x\n", offset);
@@ -191,40 +182,40 @@ READ8_MEMBER(cardline_state::asic_r)
return 0xaa;
}
-WRITE8_MEMBER(cardline_state::asic_w)
+void cardline_state::asic_w(offs_t offset, uint8_t data)
{
//printf("asic write %02x %02x\n", offset, data);
}
-WRITE8_MEMBER(cardline_state::attr_w)
+void cardline_state::attr_w(offs_t offset, uint8_t data)
{
offset+=0x1000*((m_video&2)>>1);
m_colorram[offset]=data;
}
-WRITE8_MEMBER(cardline_state::video_w)
+void cardline_state::video_w(uint8_t data)
{
m_video=data;
//printf("m_video %x\n", m_video);
}
-READ8_MEMBER(cardline_state::hsync_r)
+uint8_t cardline_state::hsync_r()
{
return m_hsync_q;
}
-WRITE8_MEMBER(cardline_state::lamps_w)
+void cardline_state::lamps_w(uint8_t data)
{
/* button lamps 1-8 (collect, card 1-5, bet, start) */
- m_lamps_cache[5] = m_lamps[5] = BIT(data, 0);
- m_lamps_cache[0] = m_lamps[0] = BIT(data, 1);
- m_lamps_cache[1] = m_lamps[1] = BIT(data, 2);
- m_lamps_cache[2] = m_lamps[2] = BIT(data, 3);
- m_lamps_cache[3] = m_lamps[3] = BIT(data, 4);
- m_lamps_cache[4] = m_lamps[4] = BIT(data, 5);
- m_lamps_cache[6] = m_lamps[6] = BIT(data, 6);
- m_lamps_cache[7] = m_lamps[7] = BIT(data, 7);
+ m_lamps[5] = BIT(data, 0);
+ m_lamps[0] = BIT(data, 1);
+ m_lamps[1] = BIT(data, 2);
+ m_lamps[2] = BIT(data, 3);
+ m_lamps[3] = BIT(data, 4);
+ m_lamps[4] = BIT(data, 5);
+ m_lamps[6] = BIT(data, 6);
+ m_lamps[7] = BIT(data, 7);
}
void cardline_state::mem_prg(address_map &map)