summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/maygayv1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/maygayv1.cpp')
-rw-r--r--src/mame/drivers/maygayv1.cpp48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/mame/drivers/maygayv1.cpp b/src/mame/drivers/maygayv1.cpp
index 65366bca4f0..cbe8b4a55ed 100644
--- a/src/mame/drivers/maygayv1.cpp
+++ b/src/mame/drivers/maygayv1.cpp
@@ -212,27 +212,16 @@ struct i82716_t
class maygayv1_state : public driver_device
{
public:
- maygayv1_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ maygayv1_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_upd7759(*this, "upd"),
m_duart68681(*this, "duart68681"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_lamp(*this, "lamp%u", 0U)
+ { }
- required_device<cpu_device> m_maincpu;
- required_device<i8052_device> m_soundcpu;
- required_device<upd7759_device> m_upd7759;
- required_device<mc68681_device> m_duart68681;
- required_device<palette_device> m_palette;
-
- int m_lamp_strobe;
- int m_old_lamp_strobe;
- int m_vsync_latch_preset;
- uint8_t m_p1;
- uint8_t m_p3;
- int m_d68681_val;
- i82716_t m_i82716;
DECLARE_WRITE16_MEMBER(i82716_w);
DECLARE_READ16_MEMBER(i82716_r);
DECLARE_WRITE16_MEMBER(write_odd);
@@ -246,9 +235,6 @@ public:
DECLARE_WRITE8_MEMBER(lamp_data_w);
DECLARE_READ8_MEMBER(kbd_r);
void init_screenpl();
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
uint32_t screen_update_maygayv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank_maygayv1);
DECLARE_WRITE8_MEMBER(data_from_i8031);
@@ -260,6 +246,27 @@ public:
void sound_data(address_map &map);
void sound_io(address_map &map);
void sound_prg(address_map &map);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<i8052_device> m_soundcpu;
+ required_device<upd7759_device> m_upd7759;
+ required_device<mc68681_device> m_duart68681;
+ required_device<palette_device> m_palette;
+
+ int m_lamp_strobe;
+ int m_old_lamp_strobe;
+ int m_vsync_latch_preset;
+ uint8_t m_p1;
+ uint8_t m_p3;
+ int m_d68681_val;
+ i82716_t m_i82716;
+ output_finder<8 * 256> m_lamp;
};
@@ -534,7 +541,7 @@ WRITE8_MEMBER( maygayv1_state::lamp_data_w )
for (int i = 0; i < 8; i++)
{
- output().set_lamp_value((8*m_lamp_strobe)+i, ((data & (1 << i)) !=0));
+ m_lamp[(8*m_lamp_strobe)+i] = BIT(data, i);
}
m_old_lamp_strobe = m_lamp_strobe;
}
@@ -852,6 +859,7 @@ WRITE8_MEMBER(maygayv1_state::b_writ)
void maygayv1_state::machine_start()
{
+ m_lamp.resolve();
i82716_t &i82716 = m_i82716;
i82716.dram = std::make_unique<uint16_t[]>(0x80000/2); // ???
i82716.line_buf = std::make_unique<uint8_t[]>(512);