summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2022-09-20 19:11:20 +0200
committer hap <happppp@users.noreply.github.com>2022-09-20 19:11:20 +0200
commitb96a2bd807e54287dd0cb99c13532853cebc1cb8 (patch)
tree196344de2dc090164c2094da754f50b4174027df
parent7d79f0c5082c3e7d5c7ae3aabeea87dd6d89b1f9 (diff)
gamepock, gmaster: do the lcd colors with internal artwork
-rw-r--r--src/mame/epoch/gamepock.cpp28
-rw-r--r--src/mame/handheld/gmaster.cpp19
-rw-r--r--src/mame/layout/gamepock.lay21
-rw-r--r--src/mame/layout/gmaster.lay21
-rw-r--r--src/mame/layout/monty.lay6
5 files changed, 69 insertions, 26 deletions
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<int N> 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 @@
+<?xml version="1.0"?>
+<!--
+license:CC0
+-->
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="lcdm"><rect><color red="0.50" green="0.53" blue="0.48" /></rect></element>
+ <element name="lcda"><rect><color red="0.10" green="0.13" blue="0.16" /></rect></element>
+
+
+<!-- build screen -->
+
+ <view name="Monochrome LCD Preset">
+ <screen index="0"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~" /></screen>
+ <element ref="lcdm" blend="multiply"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~" /></element>
+ <element ref="lcda" blend="add"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~" /></element>
+ </view>
+
+</mamelayout>
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 @@
+<?xml version="1.0"?>
+<!--
+license:CC0
+-->
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="lcdm"><rect><color red="0.42" green="0.47" blue="0.43" /></rect></element>
+ <element name="lcda"><rect><color red="0.11" green="0.13" blue="0.14" /></rect></element>
+
+
+<!-- build screen -->
+
+ <view name="Monochrome LCD Preset">
+ <screen index="0"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~" /></screen>
+ <element ref="lcdm" blend="multiply"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~" /></element>
+ <element ref="lcda" blend="add"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~" /></element>
+ </view>
+
+</mamelayout>
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
<!-- define elements -->
<element name="lcdw"><rect><color red="1" green="1" blue="1" /></rect></element>
- <element name="lcdm"><rect><color red="0.36" green="0.42" blue="0.42" /></rect></element>
- <element name="lcda"><rect><color red="0.20" green="0.16" blue="0.17" /></rect></element>
+ <element name="lcdm"><rect><color red="0.50" green="0.53" blue="0.48" /></rect></element>
+ <element name="lcda"><rect><color red="0.10" green="0.13" blue="0.16" /></rect></element>
<!-- build screen -->
- <view name="Internal Layout">
+ <view name="Monochrome LCD Preset">
<bounds left="0" right="59" top="0" bottom="35" />
<element ref="lcdw"><bounds x="0" y="0" width="59" height="35" /></element>