diff options
Diffstat (limited to 'src/mame/drivers/majorpkr.cpp')
-rw-r--r-- | src/mame/drivers/majorpkr.cpp | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/src/mame/drivers/majorpkr.cpp b/src/mame/drivers/majorpkr.cpp index dc3f819b01a..8f5af0ea6c4 100644 --- a/src/mame/drivers/majorpkr.cpp +++ b/src/mame/drivers/majorpkr.cpp @@ -472,27 +472,16 @@ class majorpkr_state : public driver_device { public: - majorpkr_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + majorpkr_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_gfxdecode(*this, "gfxdecode"), m_palette_bank(*this, "palette_bank"), m_vram_bank(*this, "vram_bank"), m_rom_bank(*this, "rom_bank"), m_fg_vram(*this, "fg_vram"), - m_bg_vram(*this, "bg_vram") { } - - required_device<gfxdecode_device> m_gfxdecode; - required_device<address_map_bank_device> m_palette_bank; - required_device<address_map_bank_device> m_vram_bank; - - required_memory_bank m_rom_bank; - required_shared_ptr<uint8_t> m_fg_vram; - required_shared_ptr<uint8_t> m_bg_vram; - - tilemap_t *m_bg_tilemap, *m_fg_tilemap; - - int m_mux_data; - int m_flip_state; + m_bg_vram(*this, "bg_vram"), + m_lamp(*this, "lamp%u", 0U) + { } DECLARE_WRITE8_MEMBER(rom_bank_w); DECLARE_WRITE8_MEMBER(palette_bank_w); @@ -509,13 +498,30 @@ public: void init_majorpkr(); TILE_GET_INFO_MEMBER(bg_get_tile_info); TILE_GET_INFO_MEMBER(fg_get_tile_info); - virtual void video_start() override; uint32_t screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void majorpkr(machine_config &config); void map(address_map &map); void palettebanks(address_map &map); void portmap(address_map &map); void vrambanks(address_map &map); + +protected: + virtual void machine_start() override { m_lamp.resolve(); } + virtual void video_start() override; + + required_device<gfxdecode_device> m_gfxdecode; + required_device<address_map_bank_device> m_palette_bank; + required_device<address_map_bank_device> m_vram_bank; + + required_memory_bank m_rom_bank; + required_shared_ptr<uint8_t> m_fg_vram; + required_shared_ptr<uint8_t> m_bg_vram; + + tilemap_t *m_bg_tilemap, *m_fg_tilemap; + + int m_mux_data; + int m_flip_state; + output_finder<13> m_lamp; }; @@ -678,13 +684,13 @@ WRITE8_MEMBER(majorpkr_state::lamps_a_w) -x-- ---- Small lamp. x--- ---- Unknown. */ - output().set_lamp_value(0, (data) & 1); // Lamp 0: Hold 1. - output().set_lamp_value(1, (data >> 1) & 1); // Lamp 1: Hold 2. - output().set_lamp_value(2, (data >> 2) & 1); // Lamp 2: Hold 3. - output().set_lamp_value(3, (data >> 3) & 1); // Lamp 3: Hold 4. - output().set_lamp_value(4, (data >> 4) & 1); // Lamp 4: Hold 5. - output().set_lamp_value(5, (data >> 5) & 1); // Lamp 5: Big or Small (need identification). - output().set_lamp_value(6, (data >> 6) & 1); // Lamp 6: Big or Small (need identification). + m_lamp[0] = BIT(data, 0); // Lamp 0: Hold 1. + m_lamp[1] = BIT(data, 1); // Lamp 1: Hold 2. + m_lamp[2] = BIT(data, 2); // Lamp 2: Hold 3. + m_lamp[3] = BIT(data, 3); // Lamp 3: Hold 4. + m_lamp[4] = BIT(data, 4); // Lamp 4: Hold 5. + m_lamp[5] = BIT(data, 5); // Lamp 5: Big or Small (need identification). + m_lamp[6] = BIT(data, 6); // Lamp 6: Big or Small (need identification). if (data & 0x80) logerror("Lamps A: Write to 13h: %02x\n", data); @@ -704,12 +710,12 @@ WRITE8_MEMBER(majorpkr_state::lamps_b_w) --x- ---- Fever lamp. xx-- ---- Unknown. */ - output().set_lamp_value(7, (data) & 1); // Lamp 7: Bet. - output().set_lamp_value(8, (data >> 1) & 1); // Lamp 8: Draw. - output().set_lamp_value(9, (data >> 2) & 1); // Lamp 9: Cancel. - output().set_lamp_value(10, (data >> 3) & 1); // Lamp 10: Take. - output().set_lamp_value(11, (data >> 4) & 1); // Lamp 11: D-UP. - output().set_lamp_value(12, (data >> 5) & 1); // Lamp 12: Fever. + m_lamp[7] = BIT(data, 0); // Lamp 7: Bet. + m_lamp[8] = BIT(data, 1); // Lamp 8: Draw. + m_lamp[9] = BIT(data, 2); // Lamp 9: Cancel. + m_lamp[10] = BIT(data, 3); // Lamp 10: Take. + m_lamp[11] = BIT(data, 4); // Lamp 11: D-UP. + m_lamp[12] = BIT(data, 5); // Lamp 12: Fever. if (data & 0xc0) logerror("Lamps B: Write to 14h: %02x\n", data); |