diff options
Diffstat (limited to 'src/mame/drivers/laser3k.cpp')
-rw-r--r-- | src/mame/drivers/laser3k.cpp | 79 |
1 files changed, 40 insertions, 39 deletions
diff --git a/src/mame/drivers/laser3k.cpp b/src/mame/drivers/laser3k.cpp index fdc27124c5f..e2d3d28bd7c 100644 --- a/src/mame/drivers/laser3k.cpp +++ b/src/mame/drivers/laser3k.cpp @@ -86,28 +86,18 @@ public: void laser3k(machine_config &config); -private: - required_device<m6502_device> m_maincpu; - required_device<screen_device> m_screen; - required_device<ram_device> m_ram; - required_device<address_map_bank_device> m_bank0; - required_device<address_map_bank_device> m_bank1; - required_device<address_map_bank_device> m_bank2; - required_device<address_map_bank_device> m_bank3; - required_device<ay3600_device> m_ay3600; - required_device<speaker_sound_device> m_speaker; - required_device<sn76489_device> m_sn; - required_ioport m_kbspecial; +protected: + virtual void machine_start() override; + virtual void machine_reset() override; +private: READ8_MEMBER( ram_r ); WRITE8_MEMBER( ram_w ); READ8_MEMBER( io_r ); WRITE8_MEMBER( io_w ); READ8_MEMBER( io2_r ); - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_PALETTE_INIT(laser3k); + void laser3k_palette(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); @@ -120,6 +110,21 @@ private: void banks_map(address_map &map); void laser3k_map(address_map &map); + void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen); + void do_io(int offset); + + required_device<m6502_device> m_maincpu; + required_device<screen_device> m_screen; + required_device<ram_device> m_ram; + required_device<address_map_bank_device> m_bank0; + required_device<address_map_bank_device> m_bank1; + required_device<address_map_bank_device> m_bank2; + required_device<address_map_bank_device> m_bank3; + required_device<ay3600_device> m_ay3600; + required_device<speaker_sound_device> m_speaker; + required_device<sn76489_device> m_sn; + required_ioport m_kbspecial; + uint8_t m_bank0val, m_bank1val, m_bank2val, m_bank3val; int m_flash; int m_speaker_state; @@ -132,9 +137,6 @@ private: int m_gfxmode; std::unique_ptr<uint16_t[]> m_hires_artifact_map; std::unique_ptr<uint16_t[]> m_dhires_artifact_map; - - void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen); - void do_io(int offset); }; /*************************************************************************** @@ -944,30 +946,30 @@ INPUT_PORTS_END // this is an apple II palette; it seems more likely the // actual laser3000 has a digital RGB palette... -static const rgb_t laser3k_palette[] = +static constexpr rgb_t laser3k_pens[] = { - rgb_t::black(), - rgb_t(0xE3, 0x1E, 0x60), /* Dark Red */ - rgb_t(0x60, 0x4E, 0xBD), /* Dark Blue */ - rgb_t(0xFF, 0x44, 0xFD), /* Purple */ - rgb_t(0x00, 0xA3, 0x60), /* Dark Green */ - rgb_t(0x9C, 0x9C, 0x9C), /* Dark Gray */ - rgb_t(0x14, 0xCF, 0xFD), /* Medium Blue */ - rgb_t(0xD0, 0xC3, 0xFF), /* Light Blue */ - rgb_t(0x60, 0x72, 0x03), /* Brown */ - rgb_t(0xFF, 0x6A, 0x3C), /* Orange */ - rgb_t(0x9C, 0x9C, 0x9C), /* Light Grey */ - rgb_t(0xFF, 0xA0, 0xD0), /* Pink */ - rgb_t(0x14, 0xF5, 0x3C), /* Light Green */ - rgb_t(0xD0, 0xDD, 0x8D), /* Yellow */ - rgb_t(0x72, 0xFF, 0xD0), /* Aquamarine */ - rgb_t(0xFF, 0xFF, 0xFF) /* White */ + { 0x00, 0x00, 0x00 }, // Black + { 0xe3, 0x1e, 0x60 }, // Dark Red + { 0x60, 0x4e, 0xbd }, // Dark Blue + { 0xff, 0x44, 0xfd }, // Purple + { 0x00, 0xa3, 0x60 }, // Dark Green + { 0x9c, 0x9c, 0x9c }, // Dark Gray + { 0x14, 0xcf, 0xfd }, // Medium Blue + { 0xd0, 0xc3, 0xff }, // Light Blue + { 0x60, 0x72, 0x03 }, // Brown + { 0xff, 0x6a, 0x3c }, // Orange + { 0x9c, 0x9c, 0x9c }, // Light Grey + { 0xff, 0xa0, 0xd0 }, // Pink + { 0x14, 0xf5, 0x3c }, // Light Green + { 0xd0, 0xdd, 0x8d }, // Yellow + { 0x72, 0xff, 0xd0 }, // Aquamarine + { 0xff, 0xff, 0xff } // White }; /* Initialize the palette */ -PALETTE_INIT_MEMBER(laser3k_state, laser3k) +void laser3k_state::laser3k_palette(palette_device &palette) const { - palette.set_pen_colors(0, laser3k_palette, ARRAY_LENGTH(laser3k_palette)); + palette.set_pen_colors(0, laser3k_pens); } MACHINE_CONFIG_START(laser3k_state::laser3k) @@ -983,8 +985,7 @@ MACHINE_CONFIG_START(laser3k_state::laser3k) MCFG_SCREEN_UPDATE_DRIVER(laser3k_state, screen_update) MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(laser3k_palette)) - MCFG_PALETTE_INIT_OWNER(laser3k_state, laser3k) + PALETTE(config, "palette", FUNC(laser3k_state::laser3k_palette), ARRAY_LENGTH(laser3k_pens)); /* memory banking */ ADDRESS_MAP_BANK(config, "bank0").set_map(&laser3k_state::banks_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000); |