From b96a2bd807e54287dd0cb99c13532853cebc1cb8 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 20 Sep 2022 19:11:20 +0200 Subject: gamepock, gmaster: do the lcd colors with internal artwork --- src/mame/epoch/gamepock.cpp | 28 ++++++++++++++++------------ src/mame/handheld/gmaster.cpp | 19 ++++++++----------- src/mame/layout/gamepock.lay | 21 +++++++++++++++++++++ src/mame/layout/gmaster.lay | 21 +++++++++++++++++++++ src/mame/layout/monty.lay | 6 +++--- 5 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 src/mame/layout/gamepock.lay create mode 100644 src/mame/layout/gmaster.lay diff --git a/src/mame/epoch/gamepock.cpp b/src/mame/epoch/gamepock.cpp index d07c2bf38bf..84ced7cc8a5 100644 --- a/src/mame/epoch/gamepock.cpp +++ b/src/mame/epoch/gamepock.cpp @@ -32,6 +32,8 @@ TODO: #include "softlist_dev.h" #include "speaker.h" +#include "gamepock.lh" + namespace { class gamepock_state : public driver_device @@ -67,11 +69,11 @@ private: void hd44102ch_init(int which); void lcd_update(); - void port_a_w(uint8_t data); - void port_b_w(uint8_t data); - uint8_t port_c_r(); + void control_w(uint8_t data); + void lcd_data_w(uint8_t data); + uint8_t input_r(); uint32_t screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void gamepock_mem(address_map &map); + void main_map(address_map &map); uint8_t m_port_a = 0U; uint8_t m_port_b = 0U; @@ -174,7 +176,7 @@ void gamepock_state::lcd_update() } -void gamepock_state::port_a_w(uint8_t data) +void gamepock_state::control_w(uint8_t data) { // 76------ input select // --543--- LCD CS @@ -193,14 +195,14 @@ void gamepock_state::port_a_w(uint8_t data) } -void gamepock_state::port_b_w(uint8_t data) +void gamepock_state::lcd_data_w(uint8_t data) { // LCD data m_port_b = data; } -uint8_t gamepock_state::port_c_r() +uint8_t gamepock_state::input_r() { uint8_t data = 0xff; @@ -287,7 +289,7 @@ uint32_t gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_in } -void gamepock_state::gamepock_mem(address_map &map) +void gamepock_state::main_map(address_map &map) { // 0x0000-0x0fff is internal ROM map(0x0000, 0x7fff).r("cartslot", FUNC(generic_slot_device::read_rom)); @@ -319,10 +321,10 @@ void gamepock_state::gamepock(machine_config &config) { // basic machine hardware UPD78C06(config, m_maincpu, 6_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &gamepock_state::gamepock_mem); - m_maincpu->pa_out_cb().set(FUNC(gamepock_state::port_a_w)); - m_maincpu->pb_out_cb().set(FUNC(gamepock_state::port_b_w)); - m_maincpu->pc_in_cb().set(FUNC(gamepock_state::port_c_r)); + m_maincpu->set_addrmap(AS_PROGRAM, &gamepock_state::main_map); + m_maincpu->pa_out_cb().set(FUNC(gamepock_state::control_w)); + m_maincpu->pb_out_cb().set(FUNC(gamepock_state::lcd_data_w)); + m_maincpu->pc_in_cb().set(FUNC(gamepock_state::input_r)); m_maincpu->to_func().set(m_speaker, FUNC(speaker_sound_device::level_w)); // video hardware @@ -335,6 +337,8 @@ void gamepock_state::gamepock(machine_config &config) PALETTE(config, "palette", palette_device::MONOCHROME); + config.set_default_layout(layout_gamepock); + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); diff --git a/src/mame/handheld/gmaster.cpp b/src/mame/handheld/gmaster.cpp index 385f5f0c1ff..2ed307540d3 100644 --- a/src/mame/handheld/gmaster.cpp +++ b/src/mame/handheld/gmaster.cpp @@ -51,6 +51,8 @@ BTANB: #include "softlist_dev.h" #include "speaker.h" +#include "gmaster.lh" + namespace { class gmaster_state : public driver_device @@ -81,9 +83,8 @@ private: void portc_w(u8 data); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); template SED1520_UPDATE_CB(screen_update_cb); - void palette(palette_device &palette) const; - void gmaster_mem(address_map &map); + void main_map(address_map &map); u8 m_ram[0x800] = { }; u8 m_chipsel = 0; @@ -95,12 +96,6 @@ void gmaster_state::machine_start() save_item(NAME(m_chipsel)); } -void gmaster_state::palette(palette_device &palette) const -{ - palette.set_pen_color(0, rgb_t(0x88, 0x98, 0x90)); // LCD background - palette.set_pen_color(1, rgb_t(0x1c, 0x20, 0x24)); // pixel -}; - /****************************************************************************** @@ -172,7 +167,7 @@ void gmaster_state::io_w(offs_t offset, u8 data) m_lcd[i]->write(offset & 1, data); } -void gmaster_state::gmaster_mem(address_map &map) +void gmaster_state::main_map(address_map &map) { // 0x0000-0x0fff is internal ROM map(0x4000, 0x47ff).mirror(0x3800).rw(FUNC(gmaster_state::io_r), FUNC(gmaster_state::io_w)); @@ -226,7 +221,7 @@ void gmaster_state::gmaster(machine_config &config) { // basic machine hardware UPD78C11(config, m_maincpu, 12_MHz_XTAL); - m_maincpu->set_addrmap(AS_PROGRAM, &gmaster_state::gmaster_mem); + m_maincpu->set_addrmap(AS_PROGRAM, &gmaster_state::main_map); m_maincpu->pa_in_cb().set_ioport("JOY"); m_maincpu->pb_out_cb().set(FUNC(gmaster_state::portb_w)); m_maincpu->pc_out_cb().set(FUNC(gmaster_state::portc_w)); @@ -239,11 +234,13 @@ void gmaster_state::gmaster(machine_config &config) m_screen->set_screen_update(FUNC(gmaster_state::screen_update)); m_screen->set_palette("palette"); - PALETTE(config, "palette", FUNC(gmaster_state::palette), 2); + PALETTE(config, "palette", palette_device::MONOCHROME_INVERTED); SED1520(config, m_lcd[0]).set_screen_update_cb(FUNC(gmaster_state::screen_update_cb<0>)); SED1520(config, m_lcd[1]).set_screen_update_cb(FUNC(gmaster_state::screen_update_cb<1>)); + config.set_default_layout(layout_gmaster); + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(0, "mono", 0.50); diff --git a/src/mame/layout/gamepock.lay b/src/mame/layout/gamepock.lay new file mode 100644 index 00000000000..0a7d978dfd8 --- /dev/null +++ b/src/mame/layout/gamepock.lay @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/gmaster.lay b/src/mame/layout/gmaster.lay new file mode 100644 index 00000000000..ad2d55384d9 --- /dev/null +++ b/src/mame/layout/gmaster.lay @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/monty.lay b/src/mame/layout/monty.lay index bae3d1c3264..0e4aa1a26e7 100644 --- a/src/mame/layout/monty.lay +++ b/src/mame/layout/monty.lay @@ -7,13 +7,13 @@ license:CC0 - - + + - + -- cgit v1.2.3