summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2024-07-20 20:28:22 +0200
committer hap <happppp@users.noreply.github.com>2024-07-20 20:28:34 +0200
commitf8a806b0ba72c5999dc3df603992fe5f92ddb25c (patch)
treef312e5d4f3cc5fa441a522f64276ecc00129b2f6 /src
parent7ab573d5906b470dd8750cad110650933c28f7ee (diff)
New working systems
------------------- Sapphire II [hap, Berger] Diamond II [hap, Berger]
Diffstat (limited to 'src')
-rw-r--r--src/devices/video/pwm.h16
-rw-r--r--src/mame/layout/novag_diamond2.lay508
-rw-r--r--src/mame/layout/novag_sapphire.lay40
-rw-r--r--src/mame/layout/novag_sapphire2.lay230
-rw-r--r--src/mame/mame.lst4
-rw-r--r--src/mame/novag/diamond2.cpp431
-rw-r--r--src/mame/novag/primo.cpp4
-rw-r--r--src/mame/novag/sapphire.cpp155
-rw-r--r--src/mame/novag/sdiamond.cpp12
-rw-r--r--src/mame/novag/vip.cpp2
10 files changed, 1336 insertions, 66 deletions
diff --git a/src/devices/video/pwm.h b/src/devices/video/pwm.h
index ee1bf8239e8..4baec97f9cd 100644
--- a/src/devices/video/pwm.h
+++ b/src/devices/video/pwm.h
@@ -17,12 +17,17 @@ public:
pwm_display_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// configuration helpers
- pwm_display_device &set_size(u8 numrows, u8 rowbits) { m_height = numrows; m_width = rowbits; return *this; } // max 64 * 64
- pwm_display_device &set_refresh(attotime duration) { m_framerate_set = duration; return *this; } // time between each outputs refresh
- pwm_display_device &set_interpolation(double factor) { m_interpolation = factor; return *this; } // frame interpolation (0.0 - 1.0)
+ pwm_display_device &set_size(u8 height, u8 width) { m_height = height; m_width = width; return *this; } // max 64 * 64
+ pwm_display_device &set_height(u8 height) { m_height = height; return *this; }
+ pwm_display_device &set_width(u8 width) { m_width = width; return *this; }
+
pwm_display_device &set_segmask(u64 digits, u64 mask); // mask for multi-state outputs, eg. 7seg led
pwm_display_device &reset_segmask() { std::fill(std::begin(m_segmask), std::end(m_segmask), 0); return *this; }
- pwm_display_device &set_bri_levels(double l0, double l1 = 1.0, double l2 = 1.0, double l3 = 1.0); // brightness threshold per level (0.0 - 1.0)
+
+ pwm_display_device &set_refresh(attotime duration) { m_framerate_set = duration; return *this; } // time between each outputs refresh (default 60hz)
+ pwm_display_device &set_interpolation(double factor) { m_interpolation = factor; return *this; } // frame interpolation (0.0 - 1.0, default 0.5)
+
+ pwm_display_device &set_bri_levels(double l0, double l1 = 1.0, double l2 = 1.0, double l3 = 1.0); // brightness threshold per level (0.0 - 1.0, default 0.01)
pwm_display_device &set_bri_minimum(u8 i) { m_level_min = i; return *this; } // minimum level index for element to be considered "on"
pwm_display_device &set_bri_maximum(double b) { m_level_max = b; return *this; } // maximum brightness level, 0.0 for auto
@@ -46,6 +51,9 @@ public:
u64 read_my() { return m_rowsel; }
u64 read_mx() { return m_rowdata_last; }
+ u8 height() { return m_height; }
+ u8 width() { return m_width; }
+
// directly handle individual element (does not affect m_rowsel), y = row num, x = row bit
int read_element(u8 y, u8 x) { return BIT(m_rowdata[y], x); }
void write_element(u8 y, u8 x, int state) { sync(); m_rowdata[y] = (m_rowdata[y] & ~(u64(1) << x)) | (u64(state ? 1 : 0) << x); }
diff --git a/src/mame/layout/novag_diamond2.lay b/src/mame/layout/novag_diamond2.lay
new file mode 100644
index 00000000000..653aa73a547
--- /dev/null
+++ b/src/mame/layout/novag_diamond2.lay
@@ -0,0 +1,508 @@
+<?xml version="1.0"?>
+<!--
+license:CC0-1.0
+authors:hap
+-->
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
+ <element name="cgray"><rect><color red="0.61" green="0.6" blue="0.59" /></rect></element>
+ <element name="lcdm"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
+
+ <element name="ledr" defstate="0">
+ <rect state="1"><color red="1.0" green="0.1" blue="0.15" /></rect>
+ <rect state="0"><color red="0.1" green="0.01" blue="0.015" /></rect>
+ </element>
+
+ <element name="text_1"><text string="1"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_2"><text string="2"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_3"><text string="3"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_4"><text string="4"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_5"><text string="5"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_6"><text string="6"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_7"><text string="7"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_8"><text string="8"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+
+ <element name="text_a"><text string="A"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_b"><text string="B"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_c"><text string="C"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_d"><text string="D"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_e"><text string="E"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_f"><text string="F"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_g"><text string="G"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_h"><text string="H"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+
+
+<!-- sb board -->
+
+ <element name="cblack"><rect><color red="0.41" green="0.4" blue="0.39" /></rect></element>
+ <element name="cwhite"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element>
+
+ <element name="hlbb" defstate="0">
+ <text string=" "><bounds x="0" y="0" width="1" height="1" /></text>
+ <disk state="1">
+ <bounds x="0.12" y="0.12" width="0.76" height="0.76" />
+ <color red="0" green="0" blue="0" />
+ </disk>
+ </element>
+
+ <element name="piece" defstate="0">
+ <image file="chess/wp.svg" state="1"/>
+ <image file="chess/wn.svg" state="2"/>
+ <image file="chess/wb.svg" state="3"/>
+ <image file="chess/wr.svg" state="4"/>
+ <image file="chess/wq.svg" state="5"/>
+ <image file="chess/wk.svg" state="6"/>
+
+ <image file="chess/bp.svg" state="7"/>
+ <image file="chess/bn.svg" state="8"/>
+ <image file="chess/bb.svg" state="9"/>
+ <image file="chess/br.svg" state="10"/>
+ <image file="chess/bq.svg" state="11"/>
+ <image file="chess/bk.svg" state="12"/>
+
+ <!-- selected pieces -->
+ <image file="chess/wp.svg" state="13"><color alpha="0.5" /></image>
+ <image file="chess/wn.svg" state="14"><color alpha="0.5" /></image>
+ <image file="chess/wb.svg" state="15"><color alpha="0.5" /></image>
+ <image file="chess/wr.svg" state="16"><color alpha="0.5" /></image>
+ <image file="chess/wq.svg" state="17"><color alpha="0.5" /></image>
+ <image file="chess/wk.svg" state="18"><color alpha="0.5" /></image>
+
+ <image file="chess/bp.svg" state="19"><color alpha="0.5" /></image>
+ <image file="chess/bn.svg" state="20"><color alpha="0.5" /></image>
+ <image file="chess/bb.svg" state="21"><color alpha="0.5" /></image>
+ <image file="chess/br.svg" state="22"><color alpha="0.5" /></image>
+ <image file="chess/bq.svg" state="23"><color alpha="0.5" /></image>
+ <image file="chess/bk.svg" state="24"><color alpha="0.5" /></image>
+ </element>
+
+ <group name="sb_board">
+ <bounds x="-0.25" y="-0.25" width="80.5" height="80.5" />
+ <element ref="blackb"><bounds x="-0.25" y="-0.25" width="80.5" height="80.5" /></element>
+
+ <!-- squares (avoid seams) -->
+ <element ref="cwhite"><bounds x="0" y="0" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="10" y="0" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="20" y="0" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="30" y="0" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="40" y="0" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="50" y="0" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="60" y="0" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="70" y="0" width="10" height="11" /></element>
+
+ <element ref="cblack"><bounds x="0" y="10" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="10" y="10" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="20" y="10" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="30" y="10" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="40" y="10" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="50" y="10" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="60" y="10" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="70" y="10" width="10" height="11" /></element>
+
+ <element ref="cwhite"><bounds x="0" y="20" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="10" y="20" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="20" y="20" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="30" y="20" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="40" y="20" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="50" y="20" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="60" y="20" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="70" y="20" width="10" height="11" /></element>
+
+ <element ref="cblack"><bounds x="0" y="30" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="10" y="30" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="20" y="30" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="30" y="30" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="40" y="30" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="50" y="30" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="60" y="30" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="70" y="30" width="10" height="11" /></element>
+
+ <element ref="cwhite"><bounds x="0" y="40" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="10" y="40" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="20" y="40" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="30" y="40" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="40" y="40" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="50" y="40" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="60" y="40" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="70" y="40" width="10" height="11" /></element>
+
+ <element ref="cblack"><bounds x="0" y="50" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="10" y="50" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="20" y="50" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="30" y="50" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="40" y="50" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="50" y="50" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="60" y="50" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="70" y="50" width="10" height="11" /></element>
+
+ <element ref="cwhite"><bounds x="0" y="60" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="10" y="60" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="20" y="60" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="30" y="60" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="40" y="60" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="50" y="60" width="11" height="11" /></element>
+ <element ref="cwhite"><bounds x="60" y="60" width="11" height="11" /></element>
+ <element ref="cblack"><bounds x="70" y="60" width="10" height="11" /></element>
+
+ <element ref="cblack"><bounds x="0" y="70" width="11" height="10" /></element>
+ <element ref="cwhite"><bounds x="10" y="70" width="11" height="10" /></element>
+ <element ref="cblack"><bounds x="20" y="70" width="11" height="10" /></element>
+ <element ref="cwhite"><bounds x="30" y="70" width="11" height="10" /></element>
+ <element ref="cblack"><bounds x="40" y="70" width="11" height="10" /></element>
+ <element ref="cwhite"><bounds x="50" y="70" width="11" height="10" /></element>
+ <element ref="cblack"><bounds x="60" y="70" width="11" height="10" /></element>
+ <element ref="cwhite"><bounds x="70" y="70" width="10" height="10" /></element>
+
+ <!-- sensors, pieces -->
+ <repeat count="8">
+ <param name="y" start="0" increment="10" />
+ <param name="i" start="8" increment="-1" />
+
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x01"><bounds x="0" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x02"><bounds x="10" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x04"><bounds x="20" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x08"><bounds x="30" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x10"><bounds x="40" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x20"><bounds x="50" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x40"><bounds x="60" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+ <element ref="hlbb" inputtag="board:RANK.~i~" inputmask="0x80"><bounds x="70" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
+
+ <element name="piece_a~i~" ref="piece"><bounds x="0" y="~y~" width="10" height="10" /></element>
+ <element name="piece_b~i~" ref="piece"><bounds x="10" y="~y~" width="10" height="10" /></element>
+ <element name="piece_c~i~" ref="piece"><bounds x="20" y="~y~" width="10" height="10" /></element>
+ <element name="piece_d~i~" ref="piece"><bounds x="30" y="~y~" width="10" height="10" /></element>
+ <element name="piece_e~i~" ref="piece"><bounds x="40" y="~y~" width="10" height="10" /></element>
+ <element name="piece_f~i~" ref="piece"><bounds x="50" y="~y~" width="10" height="10" /></element>
+ <element name="piece_g~i~" ref="piece"><bounds x="60" y="~y~" width="10" height="10" /></element>
+ <element name="piece_h~i~" ref="piece"><bounds x="70" y="~y~" width="10" height="10" /></element>
+ </repeat>
+ </group>
+
+
+<!-- sb ui -->
+
+ <element name="hlub" defstate="0">
+ <rect state="1"><color red="0" green="0" blue="0" /></rect>
+ </element>
+
+ <element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_uib2"><text string="RESET"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uib3"><text string="CLEAR"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uis1"><text string="SPAWN:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_uih1"><text string="HAND:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_uih2"><text string="REMOVE"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uiu1"><text string="UNDO:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_uiu2a"><text string=" &lt;&lt;"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uiu2b"><text string=" &lt; "><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uiu2c"><text string=" &gt;"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uiu2d"><text string=" &gt;&gt;"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_uiu3b"><text string="/"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+
+ <element name="text_uiu3a" defstate="0">
+ <simplecounter maxstate="999" digits="1" align="2">
+ <color red="0.81" green="0.8" blue="0.79" />
+ </simplecounter>
+ </element>
+ <element name="text_uiu3c" defstate="0">
+ <simplecounter maxstate="999" digits="1" align="1">
+ <color red="0.81" green="0.8" blue="0.79" />
+ </simplecounter>
+ </element>
+
+ <group name="sb_ui">
+ <bounds x="0" y="0" width="10" height="80" />
+ <element ref="cblack"><bounds x="0" y="0" width="10" height="1" /></element>
+ <element ref="cblack"><bounds x="0" y="7" width="10" height="1" /></element>
+ <element ref="cblack"><bounds x="0" y="79" width="10" height="1" /></element>
+ <element ref="text_uit1"><bounds x="0" y="2" width="10" height="2" /></element>
+ <element ref="text_uit2"><bounds x="0" y="4" width="10" height="2" /></element>
+
+ <!-- board -->
+ <element ref="text_uib1"><bounds x="0" y="9" width="10" height="2" /></element>
+ <element ref="cwhite"><bounds x="1" y="11.5" width="8" height="2.5" /></element>
+ <element ref="cwhite"><bounds x="1" y="15" width="8" height="2.5" /></element>
+
+ <element ref="text_uib2"><bounds x="1.5" y="11.75" width="7" height="2" /></element>
+ <element ref="text_uib3"><bounds x="1.5" y="15.25" width="7" height="2" /></element>
+
+ <element ref="hlub" inputtag="board:UI" inputmask="0x200"><bounds x="1" y="11.5" width="8" height="2.5" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></element>
+
+ <!-- spawn -->
+ <element ref="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></element>
+ <element ref="cwhite"><bounds x="1" y="23" width="8" height="12" /></element>
+ <element ref="cwhite"><bounds x="1" y="36" width="8" height="12" /></element>
+
+ <element name="piece_ui1" ref="piece"><bounds x="1" y="23" width="4" height="4" /></element>
+ <element name="piece_ui2" ref="piece"><bounds x="1" y="27" width="4" height="4" /></element>
+ <element name="piece_ui3" ref="piece"><bounds x="1" y="31" width="4" height="4" /></element>
+ <element name="piece_ui4" ref="piece"><bounds x="5" y="23" width="4" height="4" /></element>
+ <element name="piece_ui5" ref="piece"><bounds x="5" y="27" width="4" height="4" /></element>
+ <element name="piece_ui6" ref="piece"><bounds x="5" y="31" width="4" height="4" /></element>
+ <element name="piece_ui7" ref="piece"><bounds x="1" y="36" width="4" height="4" /></element>
+ <element name="piece_ui8" ref="piece"><bounds x="1" y="40" width="4" height="4" /></element>
+ <element name="piece_ui9" ref="piece"><bounds x="1" y="44" width="4" height="4" /></element>
+ <element name="piece_ui10" ref="piece"><bounds x="5" y="36" width="4" height="4" /></element>
+ <element name="piece_ui11" ref="piece"><bounds x="5" y="40" width="4" height="4" /></element>
+ <element name="piece_ui12" ref="piece"><bounds x="5" y="44" width="4" height="4" /></element>
+
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></element>
+
+ <!-- hand -->
+ <element ref="text_uih1"><bounds x="0" y="51" width="10" height="2" /></element>
+ <element ref="cblack"><bounds x="1" y="53.5" width="8" height="6" /></element>
+ <element name="piece_ui0" ref="piece"><bounds x="2" y="53.5" width="6" height="6" /></element>
+
+ <element ref="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></element>
+ <element ref="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></element>
+ <element ref="hlub" inputtag="board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></element>
+
+ <!-- undo -->
+ <element ref="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></element>
+ <element ref="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></element>
+ <element ref="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></element>
+ <element ref="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></element>
+ <element ref="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></element>
+ <element ref="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></element>
+ <element ref="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></element>
+ <element ref="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></element>
+ <element ref="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></element>
+
+ <element ref="hlub" inputtag="board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
+ <element ref="hlub" inputtag="board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
+
+ <element name="count_ui0" ref="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></element>
+ <element name="count_ui1" ref="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></element>
+ <element ref="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></element>
+ </group>
+
+
+<!-- buttons -->
+
+ <element name="cyanm"><rect><color red="0.0" green="0.3" blue="0.41" /></rect></element>
+
+ <element name="but" defstate="0">
+ <rect state="0"><color red="0.155" green="0.15" blue="0.15" /></rect>
+ <rect state="1"><color red="0.32" green="0.31" blue="0.31" /></rect>
+ </element>
+
+ <element name="butd" defstate="0">
+ <disk state="0">
+ <bounds x="0" y="0" width="2.9" height="3.5" />
+ <color red="0.155" green="0.15" blue="0.15" />
+ </disk>
+ <rect state="0">
+ <bounds x="1.45" y="0" width="4.35" height="3.5" />
+ <color red="0.155" green="0.15" blue="0.15" />
+ </rect>
+ <disk state="1">
+ <bounds x="0" y="0" width="2.9" height="3.5" />
+ <color red="0.24" green="0.23" blue="0.23" />
+ </disk>
+ <rect state="1">
+ <bounds x="1.45" y="0" width="4.35" height="3.5" />
+ <color red="0.24" green="0.23" blue="0.23" />
+ </rect>
+ </element>
+
+ <element name="text_l1a"><text string="Referee"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l1b"><text string="Print Moves"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l2a"><text string="Sound"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l2b"><text string="Auto Clock"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l3a"><text string="Book Select"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l3b"><text string="Auto/Demo"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l4a"><text string="Restore"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l4b"><text string="Human"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l5a"><text string="Random"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l5b"><text string="Video"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l6a"><text string="Easy"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l6b"><text string="Replay"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l7a"><text string="Trace Forward"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l7b"><text string="Print Game"><color red="0.98" green="0.97" blue="0.96" /></text></element>
+ <element name="text_l8a"><text string=" "></text></element>
+ <element name="text_l8b"><text string="Print Board"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+
+ <element name="text_m1a"><text string="Save Game"><color red="0.6" green="0.9" blue="1.0" /></text></element>
+ <element name="text_m1b"><text string=" "></text></element>
+ <element name="text_m2a"><text string="Load Game"><color red="0.6" green="0.9" blue="1.0" /></text></element>
+ <element name="text_m2b"><text string=" "></text></element>
+ <element name="text_m3a"><text string="Pro-op Save"><color red="0.6" green="0.9" blue="1.0" /></text></element>
+ <element name="text_m3b"><text string=" "></text></element>
+ <element name="text_m4a"><text string="Pro-op Delete"><color red="0.6" green="0.9" blue="1.0" /></text></element>
+ <element name="text_m4b"><text string=" "></text></element>
+ <element name="text_m5a"><text string="Pro-op Priority"><color red="0.6" green="0.9" blue="1.0" /></text></element>
+ <element name="text_m5b"><text string=" "></text></element>
+ <element name="text_m6a"><text string="Pro-op Print"><color red="0.6" green="0.9" blue="1.0" /></text></element>
+ <element name="text_m6b"><text string=" "></text></element>
+ <element name="text_m7a"><text string="Verify/Setup"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_m7b"><text string="Rating"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_m8a"><text string="Color"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_m8b"><text string=" "></text></element>
+
+ <element name="text_r1a"><text string="New Game"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r1b"><text string=" "></text></element>
+ <element name="text_r2a"><text string="Clear"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r2b"><text string="Clear Board"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r3a"><text string="Set Level"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r3b"><text string=" "></text></element>
+ <element name="text_r4a"><text string="Option 1/2"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r4b"><text string=" "></text></element>
+ <element name="text_r5a"><text string="Training"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r5b"><text string=""></text></element>
+ <element name="text_r6a"><text string="Hint"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r6b"><text string=" "></text></element>
+ <element name="text_r7a"><text string="Info"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r7b"><text string=" "></text></element>
+ <element name="text_r8a"><text string="Go"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r8b"><text string=" "></text></element>
+
+ <element name="text_l8c"><text string="Next Best/"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_l8d"><text string="Take Back"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+
+ <element name="text_p1"><image file="chess/wp.svg"></image></element>
+ <element name="text_p2"><image file="chess/wn.svg"></image></element>
+ <element name="text_p3"><image file="chess/wb.svg"></image></element>
+ <element name="text_p4"><image file="chess/wr.svg"></image></element>
+ <element name="text_p5"><image file="chess/wq.svg"></image></element>
+ <element name="text_p6"><image file="chess/wk.svg"></image></element>
+
+ <group name="buttons">
+ <bounds x="0" y="0" width="40" height="80" />
+
+ <repeat count="6">
+ <param name="y" start="14.4" increment="8.05714" />
+ <param name="i" start="1" increment="1" />
+
+ <element ref="blackb"><bounds xc="18" yc="~y~" width="3" height="3" /></element>
+ <element ref="text_p~i~"><bounds xc="18" yc="~y~" width="2" height="2" /></element>
+ <element ref="cyanm" blend="multiply"><bounds xc="18" yc="~y~" width="3" height="3" /></element>
+ <element ref="cgray" blend="add"><bounds xc="18" yc="~y~" width="3" height="3" /></element>
+ </repeat>
+
+ <repeat count="8">
+ <param name="y" start="8.3" increment="8.05714" />
+ <param name="i" start="1" increment="1" />
+
+ <element ref="text_l~i~a"><bounds xc="10" y="~y~" width="10" height="1.5" /></element>
+ <element ref="text_m~i~a"><bounds xc="18" y="~y~" width="10" height="1.5" /></element>
+ <element ref="text_r~i~a"><bounds xc="26" y="~y~" width="10" height="1.5" /></element>
+ </repeat>
+
+ <repeat count="8">
+ <param name="y" start="13.7" increment="8.05714" />
+ <param name="i" start="1" increment="1" />
+
+ <element ref="text_l~i~b"><bounds xc="10" y="~y~" width="10" height="1.5" /></element>
+ <element ref="text_m~i~b"><bounds xc="18" y="~y~" width="10" height="1.5" /></element>
+ <element ref="text_r~i~b"><bounds xc="26" y="~y~" width="10" height="1.5" /></element>
+ </repeat>
+
+ <element ref="text_l8c"><bounds xc="10" y="64" width="10" height="1.2" /></element>
+ <element ref="text_l8d"><bounds xc="10" y="65" width="10" height="1.2" /></element>
+
+ <element ref="butd" inputtag="IN.1" inputmask="0x80"><bounds xc="10" y="10.000" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x40"><bounds xc="10" y="18.057" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x20"><bounds xc="10" y="26.114" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x10"><bounds xc="10" y="34.171" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x08"><bounds xc="10" y="42.229" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x04"><bounds xc="10" y="50.286" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x02"><bounds xc="10" y="58.343" width="5.65" height="3.6" /></element>
+ <element ref="butd" inputtag="IN.1" inputmask="0x01"><bounds xc="10" y="66.400" width="5.65" height="3.6" /></element>
+
+ <element ref="but" inputtag="IN.2" inputmask="0x80"><bounds xc="18" y="10.000" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x40"><bounds xc="18" y="18.057" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x20"><bounds xc="18" y="26.114" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x10"><bounds xc="18" y="34.171" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x08"><bounds xc="18" y="42.229" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x04"><bounds xc="18" y="50.286" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x02"><bounds xc="18" y="58.343" width="5.65" height="3.6" /></element>
+ <element ref="but" inputtag="IN.2" inputmask="0x01"><bounds xc="18" y="66.400" width="5.65" height="3.6" /></element>
+
+ <element ref="butd" inputtag="IN.0" inputmask="0x80"><bounds xc="26" y="10.000" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x40"><bounds xc="26" y="18.057" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x20"><bounds xc="26" y="26.114" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x10"><bounds xc="26" y="34.171" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x08"><bounds xc="26" y="42.229" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x04"><bounds xc="26" y="50.286" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x02"><bounds xc="26" y="58.343" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ <element ref="butd" inputtag="IN.0" inputmask="0x01"><bounds xc="26" y="66.400" width="5.65" height="3.6" /><orientation flipx="yes" /></element>
+ </group>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-14.25" right="114" top="-2.25" bottom="100.25" />
+
+ <element ref="cgray"><bounds x="-1.25" y="-2.25" width="120" height="102.5" /></element>
+ <element ref="blackb"><bounds x="2.875" yc="43" width="115" height="82.25" /><color alpha="0.25" /></element>
+ <element ref="cgray"><bounds x="3.125" yc="43" width="115" height="81.75" /></element>
+ <element ref="blackb"><bounds x="114" yc="43" width="20" height="120" /></element>
+
+ <group ref="sb_board"><bounds x="3.75" yc="43" width="80.5" height="80.5" /></group>
+ <group ref="sb_ui"><bounds x="-12.75" y="3" width="10" height="80" /></group>
+
+ <group ref="buttons"><bounds x="81" y="3" width="40" height="80" /></group>
+
+ <!-- chessboard coords -->
+ <element ref="text_8"><bounds x="0.25" y="5.3" width="2" height="2" /></element>
+ <element ref="text_7"><bounds x="0.25" y="15.3" width="2" height="2" /></element>
+ <element ref="text_6"><bounds x="0.25" y="25.3" width="2" height="2" /></element>
+ <element ref="text_5"><bounds x="0.25" y="35.3" width="2" height="2" /></element>
+ <element ref="text_4"><bounds x="0.25" y="45.3" width="2" height="2" /></element>
+ <element ref="text_3"><bounds x="0.25" y="55.3" width="2" height="2" /></element>
+ <element ref="text_2"><bounds x="0.25" y="65.3" width="2" height="2" /></element>
+ <element ref="text_1"><bounds x="0.25" y="75.3" width="2" height="2" /></element>
+
+ <element ref="text_a"><bounds x="5.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_b"><bounds x="15.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_c"><bounds x="25.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_d"><bounds x="35.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_e"><bounds x="45.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_f"><bounds x="55.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_g"><bounds x="65.75" y="84.25" width="2" height="2" /></element>
+ <element ref="text_h"><bounds x="75.75" y="84.25" width="2" height="2" /></element>
+
+ <!-- chessboard leds -->
+ <element name="0.7" ref="ledr"><bounds x="0.25" y="7.5" width="2" height="1" /></element>
+ <element name="0.6" ref="ledr"><bounds x="0.25" y="17.5" width="2" height="1" /></element>
+ <element name="0.5" ref="ledr"><bounds x="0.25" y="27.5" width="2" height="1" /></element>
+ <element name="0.4" ref="ledr"><bounds x="0.25" y="37.5" width="2" height="1" /></element>
+ <element name="0.3" ref="ledr"><bounds x="0.25" y="47.5" width="2" height="1" /></element>
+ <element name="0.2" ref="ledr"><bounds x="0.25" y="57.5" width="2" height="1" /></element>
+ <element name="0.1" ref="ledr"><bounds x="0.25" y="67.5" width="2" height="1" /></element>
+ <element name="0.0" ref="ledr"><bounds x="0.25" y="77.5" width="2" height="1" /></element>
+
+ <element name="1.7" ref="ledr"><bounds x="7.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.6" ref="ledr"><bounds x="17.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.5" ref="ledr"><bounds x="27.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.4" ref="ledr"><bounds x="37.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.3" ref="ledr"><bounds x="47.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.2" ref="ledr"><bounds x="57.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.1" ref="ledr"><bounds x="67.75" y="84.75" width="2" height="1" /></element>
+ <element name="1.0" ref="ledr"><bounds x="77.75" y="84.75" width="2" height="1" /></element>
+
+ <!-- lcd panel -->
+ <element ref="blackb"><bounds xc="58.75" yc="93" width="30" height="10" /></element>
+ <screen index="0"><bounds xc="58.75" yc="93" width="25" height="8.737" /></screen>
+ <element ref="lcdm" blend="multiply"><bounds xc="58.75" yc="93" width="30" height="10" /></element>
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/novag_sapphire.lay b/src/mame/layout/novag_sapphire.lay
index 64bb5e71ba2..6e0daadbabb 100644
--- a/src/mame/layout/novag_sapphire.lay
+++ b/src/mame/layout/novag_sapphire.lay
@@ -16,7 +16,7 @@ authors:hap
<element name="triangle">
<image><data><![CDATA[
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="10" height="10">
- <path d="M 5,0 10,10 0,10 z" fill="#99e6e6" stroke="none" stroke-width="0" />
+ <path d="M 5,0 10,10 0,10 z" fill="#9ee6f4" stroke="none" stroke-width="0" />
</svg>
]]></data></image>
</element>
@@ -29,25 +29,25 @@ authors:hap
<disk state="1"><color red="0.77" green="0.77" blue="0.77" /></disk>
</element>
- <element name="text_b1"><text string="A 1"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b2"><text string="B 2"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b3"><text string="C 3"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b4"><text string="D 4"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b5"><text string="E 5"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b6"><text string="F 6"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b7"><text string="G 7"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_b8"><text string="H 8"><color red="0.6" green="0.9" blue="0.9" /></text></element>
- <element name="text_bng"><text string="NG"><color red="0.93" green="0.92" blue="0.92" /></text></element>
- <element name="text_bc1"><text string="C"><color red="0.86" green="0.85" blue="0.85" /></text></element>
- <element name="text_bc2"><text string="C B"><color red="0.86" green="0.85" blue="0.85" /></text></element>
- <element name="text_bgo"><text string="GO"><color red="0.86" green="0.85" blue="0.85" /></text></element>
-
- <element name="text_p1"><image file="chess/wp.svg"><color alpha="0.67" /></image></element>
- <element name="text_p2"><image file="chess/wn.svg"><color alpha="0.67" /></image></element>
- <element name="text_p3"><image file="chess/wb.svg"><color alpha="0.67" /></image></element>
- <element name="text_p4"><image file="chess/wr.svg"><color alpha="0.67" /></image></element>
- <element name="text_p5"><image file="chess/wq.svg"><color alpha="0.67" /></image></element>
- <element name="text_p6"><image file="chess/wk.svg"><color alpha="0.67" /></image></element>
+ <element name="text_b1"><text string="A 1"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b2"><text string="B 2"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b3"><text string="C 3"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b4"><text string="D 4"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b5"><text string="E 5"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b6"><text string="F 6"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b7"><text string="G 7"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b8"><text string="H 8"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_bng"><text string="NG"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_bc1"><text string="C"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_bc2"><text string="C B"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_bgo"><text string="GO"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+
+ <element name="text_p1"><image file="chess/wp.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p2"><image file="chess/wn.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p3"><image file="chess/wb.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p4"><image file="chess/wr.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p5"><image file="chess/wq.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p6"><image file="chess/wk.svg"><color alpha="0.76" /></image></element>
<element name="text_w1"><text string="Ver/Set"><color red="0.86" green="0.85" blue="0.85" /></text></element>
<element name="text_w2"><text string="Option 1/2"><color red="0.86" green="0.85" blue="0.85" /></text></element>
diff --git a/src/mame/layout/novag_sapphire2.lay b/src/mame/layout/novag_sapphire2.lay
new file mode 100644
index 00000000000..a8e985057f2
--- /dev/null
+++ b/src/mame/layout/novag_sapphire2.lay
@@ -0,0 +1,230 @@
+<?xml version="1.0"?>
+<!--
+license:CC0-1.0
+authors:hap
+-->
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="blackd"><disk><color red="0" green="0" blue="0" /></disk></element>
+ <element name="grayd"><disk><color red="0.21" green="0.2" blue="0.2" /></disk></element>
+ <element name="redd"><disk><color red="0.85" green="0.35" blue="0.2" /></disk></element>
+ <element name="white"><rect><color red="0.86" green="0.85" blue="0.85" /></rect></element>
+ <element name="gray"><rect><color red="0.61" green="0.6" blue="0.59" /></rect></element>
+ <element name="lcdm"><rect><color red="0.7" green="0.71" blue="0.72" /></rect></element>
+
+ <element name="triangle">
+ <image><data><![CDATA[
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="10" height="10">
+ <path d="M 5,0 10,10 0,10 z" fill="#9ee6f4" stroke="none" stroke-width="0" />
+ </svg>
+ ]]></data></image>
+ </element>
+
+ <element name="hlb" defstate="0">
+ <disk state="1"><color red="0.1" green="0.1" blue="0.1" /></disk>
+ </element>
+ <element name="hlb2" defstate="0">
+ <rect><color red="1" green="1" blue="1" /></rect>
+ <disk state="1"><color red="0.77" green="0.77" blue="0.77" /></disk>
+ </element>
+
+ <element name="text_b1"><text string="A 1"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b2"><text string="B 2"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b3"><text string="C 3"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b4"><text string="D 4"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b5"><text string="E 5"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b6"><text string="F 6"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b7"><text string="G 7"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_b8"><text string="H 8"><color red="0.62" green="0.9" blue="0.96" /></text></element>
+ <element name="text_bng"><text string="NG"><color red="0.96" green="0.9" blue="0.96" /></text></element>
+ <element name="text_bc1"><text string="C"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_bc2"><text string="C B"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_bgo"><text string="GO"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+
+ <element name="text_p1"><image file="chess/wp.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p2"><image file="chess/wn.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p3"><image file="chess/wb.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p4"><image file="chess/wr.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p5"><image file="chess/wq.svg"><color alpha="0.76" /></image></element>
+ <element name="text_p6"><image file="chess/wk.svg"><color alpha="0.76" /></image></element>
+
+ <element name="text_w1"><text string="Ver/Set"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w2"><text string="Option 1/2"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w3"><text string="Load Game"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w4"><text string="Save Game"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w5"><text string="Training"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w6"><text string="Color"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w7"><text string="Hint"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w8"><text string="Referee"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w9"><text string="Sound"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w10"><text string="Info"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+ <element name="text_w11"><text string="Level"><color red="0.96" green="0.95" blue="0.95" /></text></element>
+
+ <element name="text_r1"><text string="Random"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r2"><text string="ProDelete"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r3"><text string="ProSave"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r4"><text string="ProPrior"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r5"><text string="Analyze"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r6"><text string="ProPrint"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r7"><text string="BkSelect"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r8"><text string="Restore"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r9"><text string="Next Best"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+ <element name="text_r10"><text string="Easy"><color red="0.01" green="0.01" blue="0.01" /></text></element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="4" right="66" top="-20" bottom="59" />
+
+ <element ref="gray"><bounds xc="35" y="1" width="62" height="58" /></element>
+ <screen index="0"><bounds xc="35" yc="-9.5" width="40" height="13.979" /></screen>
+ <element ref="lcdm" blend="multiply"><bounds xc="35" yc="-9.5" width="40.5" height="15" /></element>
+
+ <!-- buttons base -->
+ <element ref="blackd"><bounds xc="10" yc="10" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="20" yc="10" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="30" yc="10" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="40" yc="10" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="50" yc="10" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="60" yc="10" width="6.1" height="6.1" /></element>
+
+ <element ref="blackd"><bounds xc="10" yc="20" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="20" yc="20" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="30" yc="20" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="40" yc="20" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="50" yc="20" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="60" yc="20" width="6.1" height="6.1" /></element>
+
+ <element ref="blackd"><bounds xc="15" yc="30" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="25" yc="30" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="35" yc="30" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="45" yc="30" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="55" yc="30" width="6.1" height="6.1" /></element>
+
+ <element ref="blackd"><bounds xc="20" yc="40" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="30" yc="40" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="40" yc="40" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="50" yc="40" width="6.1" height="6.1" /></element>
+
+ <element ref="blackd"><bounds xc="25" yc="50" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="35" yc="50" width="6.1" height="6.1" /></element>
+ <element ref="blackd"><bounds xc="45" yc="50" width="6.1" height="6.1" /></element>
+
+ <element ref="grayd"><bounds xc="10" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="20" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="30" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="40" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="50" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="redd"><bounds xc="60" yc="10" width="5.3" height="5.3" /></element>
+
+ <element ref="grayd"><bounds xc="10" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="20" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="30" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="40" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="50" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="60" yc="20" width="5.3" height="5.3" /></element>
+
+ <element ref="grayd"><bounds xc="15" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="25" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="35" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="45" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="55" yc="30" width="5.3" height="5.3" /></element>
+
+ <element ref="grayd"><bounds xc="20" yc="40" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="30" yc="40" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="40" yc="40" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="50" yc="40" width="5.3" height="5.3" /></element>
+
+ <element ref="grayd"><bounds xc="25" yc="50" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="35" yc="50" width="5.3" height="5.3" /></element>
+ <element ref="grayd"><bounds xc="45" yc="50" width="5.3" height="5.3" /></element>
+
+ <element ref="text_b1"><bounds xc="10" yc="9.95" width="6" height="3.1" /></element>
+ <element ref="text_b2"><bounds xc="20" yc="9.95" width="6" height="3.1" /></element>
+ <element ref="text_b3"><bounds xc="30" yc="9.95" width="6" height="3.1" /></element>
+ <element ref="text_b4"><bounds xc="40" yc="9.95" width="6" height="3.1" /></element>
+ <element ref="text_b5"><bounds xc="10" yc="19.95" width="6" height="3.1" /></element>
+ <element ref="text_b6"><bounds xc="20" yc="19.95" width="6" height="3.1" /></element>
+ <element ref="text_b7"><bounds xc="30" yc="19.95" width="6" height="3.1" /></element>
+ <element ref="text_b8"><bounds xc="40" yc="19.95" width="6" height="3.1" /></element>
+ <element ref="text_bng"><bounds xc="60" yc="9.95" width="6" height="3.1" /></element>
+ <element ref="text_bgo"><bounds xc="45" yc="49.95" width="6" height="3.1" /></element>
+
+ <element ref="white"><bounds xc="60" yc="20" width="1.7" height="0.15" /></element>
+ <element ref="text_bc1"><bounds xc="60" yc="18.85" width="6" height="2.1" /></element>
+ <element ref="text_bc2"><bounds xc="60" yc="21.05" width="6" height="2.1" /></element>
+
+ <element ref="text_p1" blend="add"><bounds xc="15" yc="29.9" width="4" height="4" /></element>
+ <element ref="text_p2" blend="add"><bounds xc="25" yc="29.9" width="4" height="4" /></element>
+ <element ref="text_p3" blend="add"><bounds xc="35" yc="29.9" width="4" height="4" /></element>
+ <element ref="text_p4" blend="add"><bounds xc="20" yc="39.9" width="4" height="4" /></element>
+ <element ref="text_p5" blend="add"><bounds xc="30" yc="39.9" width="4" height="4" /></element>
+ <element ref="text_p6" blend="add"><bounds xc="40" yc="39.9" width="4" height="4" /></element>
+
+ <element ref="triangle"><bounds xc="24.6" yc="50" width="2.5" height="2.8" /><orientation rotate="270" /></element>
+ <element ref="triangle"><bounds xc="35.4" yc="50" width="2.5" height="2.8" /><orientation rotate="90" /></element>
+
+ <!-- button masks -->
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x80"><bounds xc="10" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x40"><bounds xc="20" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x20"><bounds xc="30" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x10"><bounds xc="40" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x20"><bounds xc="50" yc="10" width="5.3" height="5.3" /></element>
+ <element ref="hlb2" blend="multiply" inputtag="IN.0" inputmask="0x01"><bounds xc="60" yc="10" width="5.3" height="5.3" /></element>
+
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x08"><bounds xc="10" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x04"><bounds xc="20" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x02"><bounds xc="30" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.2" inputmask="0x01"><bounds xc="40" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x04"><bounds xc="50" yc="20" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x02"><bounds xc="60" yc="20" width="5.3" height="5.3" /></element>
+
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x01"><bounds xc="15" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x02"><bounds xc="25" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x04"><bounds xc="35" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x80"><bounds xc="45" yc="30" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x10"><bounds xc="55" yc="30" width="5.3" height="5.3" /></element>
+
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x08"><bounds xc="20" yc="40" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x10"><bounds xc="30" yc="40" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x20"><bounds xc="40" yc="40" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x08"><bounds xc="50" yc="40" width="5.3" height="5.3" /></element>
+
+ <element ref="hlb" blend="add" inputtag="IN.1" inputmask="0x40"><bounds xc="25" yc="50" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x40"><bounds xc="35" yc="50" width="5.3" height="5.3" /></element>
+ <element ref="hlb" blend="add" inputtag="IN.0" inputmask="0x80"><bounds xc="45" yc="50" width="5.3" height="5.3" /></element>
+
+ <!-- labels under -->
+ <element ref="text_w1"><bounds xc="50" y="13" width="10" height="1.75" /></element>
+ <element ref="text_w2"><bounds xc="50" y="23" width="10" height="1.75" /></element>
+
+ <element ref="text_w3"><bounds xc="15" y="33" width="10" height="1.75" /></element>
+ <element ref="text_w4"><bounds xc="25" y="33" width="10" height="1.75" /></element>
+ <element ref="text_w5"><bounds xc="35" y="33" width="10" height="1.75" /></element>
+ <element ref="text_w6"><bounds xc="45" y="33" width="10" height="1.75" /></element>
+ <element ref="text_w7"><bounds xc="55" y="33" width="10" height="1.75" /></element>
+
+ <element ref="text_w8"><bounds xc="20" y="43" width="10" height="1.75" /></element>
+ <element ref="text_w9"><bounds xc="30" y="43" width="10" height="1.75" /></element>
+ <element ref="text_w10"><bounds xc="40" y="43" width="10" height="1.75" /></element>
+ <element ref="text_w11"><bounds xc="50" y="43" width="10" height="1.75" /></element>
+
+ <element ref="text_r1"><bounds xc="50" y="24.55" width="10" height="1.75" /></element>
+
+ <element ref="text_r2"><bounds xc="15" y="34.55" width="10" height="1.75" /></element>
+ <element ref="text_r3"><bounds xc="25" y="34.55" width="10" height="1.75" /></element>
+ <element ref="text_r4"><bounds xc="35" y="34.55" width="10" height="1.75" /></element>
+ <element ref="text_r5"><bounds xc="55" y="34.55" width="10" height="1.75" /></element>
+
+ <element ref="text_r6"><bounds xc="20" y="44.55" width="10" height="1.75" /></element>
+ <element ref="text_r7"><bounds xc="30" y="44.55" width="10" height="1.75" /></element>
+ <element ref="text_r8"><bounds xc="40" y="44.55" width="10" height="1.75" /></element>
+
+ <element ref="text_r9"><bounds xc="25" y="53" width="10" height="1.75" /></element>
+ <element ref="text_r10"><bounds xc="35" y="53" width="10" height="1.75" /></element>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 59356276708..98cfe619232 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -35034,6 +35034,9 @@ diablo68
diablo68a
scorpio68
+@source:novag/diamond2.cpp
+diamond2
+
@source:novag/mentor16.cpp
mentor16
@@ -35054,6 +35057,7 @@ robotadv
@source:novag/sapphire.cpp
sapphire
+sapphire2
@source:novag/savant.cpp
savant //
diff --git a/src/mame/novag/diamond2.cpp b/src/mame/novag/diamond2.cpp
new file mode 100644
index 00000000000..74ad2646ee6
--- /dev/null
+++ b/src/mame/novag/diamond2.cpp
@@ -0,0 +1,431 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+// thanks-to:Berger
+/*******************************************************************************
+
+Novag Diamond II (model 38602)
+
+Hardware notes:
+- PCB label: 100208 REV B
+- Hitachi H8/325 MCU (mode 2), 32MHz XTAL
+- 128KB EPROM (27C010), 128KB SRAM (KM681000BLG-7)
+- LCD with 6 7segs and custom segments (same as Sapphire II)
+- RJ-12 port for Novag Super System (always 9600 baud)
+- piezo, 16 LEDs, button sensors chessboard
+
+Diamond II MCU and EPROM are the same as Sapphire II. MCU pin P62 determines
+which hardware it runs on, see sapphire.cpp for Sapphire II.
+
+TODO:
+- dump/add Diamond(1), the hardware looks very similar judging from PCB photos
+- Novag Super System peripherals don't work due to serial clock drift, baud rate
+ differs a bit between host and client, m6801 serial emulation issue (to work
+ around it, underclock diamond2 to exactly 31.9488MHz)
+- it does a cold boot at every reset, so nvram won't work properly unless MAME
+ adds some kind of auxillary autosave state feature at power-off
+
+*******************************************************************************/
+
+#include "emu.h"
+
+#include "bus/rs232/rs232.h"
+#include "cpu/h8/h8325.h"
+#include "machine/nvram.h"
+#include "machine/sensorboard.h"
+#include "sound/dac.h"
+#include "video/pwm.h"
+
+#include "screen.h"
+#include "speaker.h"
+
+// internal artwork
+#include "novag_diamond2.lh"
+
+
+namespace {
+
+class diamond2_state : public driver_device
+{
+public:
+ diamond2_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_memory(*this, "memory"),
+ m_nvram(*this, "nvram", 0x20000, ENDIANNESS_BIG),
+ m_rambank(*this, "rambank"),
+ m_rombank(*this, "rombank"),
+ m_board(*this, "board"),
+ m_led_pwm(*this, "led_pwm"),
+ m_lcd_pwm(*this, "lcd_pwm"),
+ m_dac(*this, "dac"),
+ m_rs232(*this, "rs232"),
+ m_inputs(*this, "IN.%u", 0),
+ m_out_lcd(*this, "s%u.%u", 0U, 0U)
+ { }
+
+ void diamond2(machine_config &config);
+
+ DECLARE_INPUT_CHANGED_MEMBER(power_switch);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override { set_power(true); }
+
+private:
+ // devices/pointers
+ required_device<h8325_device> m_maincpu;
+ memory_view m_memory;
+ memory_share_creator<u8> m_nvram;
+ required_memory_bank m_rambank;
+ required_memory_bank m_rombank;
+ required_device<sensorboard_device> m_board;
+ required_device<pwm_display_device> m_led_pwm;
+ required_device<pwm_display_device> m_lcd_pwm;
+ required_device<dac_1bit_device> m_dac;
+ required_device<rs232_port_device> m_rs232;
+ required_ioport_array<3> m_inputs;
+ output_finder<4, 16> m_out_lcd;
+
+ bool m_power = false;
+ u8 m_inp_mux = 0;
+ u8 m_led_select = 0;
+ u8 m_lcd_sclk = 0;
+ u32 m_lcd_data = 0;
+
+ void main_map(address_map &map);
+
+ // I/O handlers
+ void standby(int state);
+ void set_power(bool power);
+ u8 power_r();
+
+ void lcd_pwm_w(offs_t offset, u8 data);
+ void update_lcd();
+ void lcd_data_w(u8 data);
+
+ void update_leds();
+ u8 read_buttons();
+ u8 read_board();
+ u8 p4_r();
+ void p4_w(u8 data);
+ void p5_w(u8 data);
+ void p6_w(u8 data);
+ u8 p7_r();
+ void p7_w(u8 data);
+};
+
+void diamond2_state::machine_start()
+{
+ m_out_lcd.resolve();
+
+ m_rombank->configure_entries(0, 4, memregion("eprom")->base(), 0x8000);
+ m_rambank->configure_entries(0, 4, m_nvram, 0x8000);
+ m_memory.select(0);
+
+ // register for savestates
+ save_item(NAME(m_power));
+ save_item(NAME(m_inp_mux));
+ save_item(NAME(m_led_select));
+ save_item(NAME(m_lcd_sclk));
+ save_item(NAME(m_lcd_data));
+}
+
+
+
+/*******************************************************************************
+ I/O
+*******************************************************************************/
+
+// power
+
+void diamond2_state::standby(int state)
+{
+ // clear display
+ if (state)
+ {
+ m_lcd_pwm->clear();
+ m_led_pwm->clear();
+ }
+}
+
+void diamond2_state::set_power(bool power)
+{
+ // power switch is tied to IRQ2
+ m_maincpu->set_input_line(INPUT_LINE_IRQ2, power ? ASSERT_LINE : CLEAR_LINE);
+ m_power = power;
+}
+
+INPUT_CHANGED_MEMBER(diamond2_state::power_switch)
+{
+ if (newval)
+ set_power(bool(param));
+}
+
+u8 diamond2_state::power_r()
+{
+ // P62: forced low (0 = Diamond II, 1 = Sapphire II)
+ // P66: power switch (IRQ2)
+ return m_power ? 0xbb : 0xfb;
+}
+
+
+// LCD
+
+void diamond2_state::lcd_pwm_w(offs_t offset, u8 data)
+{
+ m_out_lcd[offset & 0x3f][offset >> 6] = data;
+}
+
+void diamond2_state::update_lcd()
+{
+ for (int i = 0; i < 4; i++)
+ {
+ // LCD common is analog (voltage level)
+ const u8 com = population_count_32(m_lcd_data >> (16 + (i * 2)) & 3);
+ u16 segs = (com == 0) ? m_lcd_data : (com == 2) ? ~m_lcd_data : 0;
+
+ m_lcd_pwm->write_row(i, segs);
+ }
+}
+
+void diamond2_state::lcd_data_w(u8 data)
+{
+ // P60: 3*14015B C (chained)
+ if (data & 1 && !m_lcd_sclk)
+ {
+ // P61: 14015B D, outputs to LCD
+ m_lcd_data = m_lcd_data << 1 | BIT(data, 1);
+ update_lcd();
+ }
+ m_lcd_sclk = data & 1;
+}
+
+
+// misc
+
+void diamond2_state::update_leds()
+{
+ m_led_pwm->matrix(m_led_select, m_inp_mux);
+}
+
+u8 diamond2_state::read_buttons()
+{
+ u8 data = 0;
+
+ for (int i = 0; i < 3; i++)
+ if (m_inp_mux & m_inputs[i]->read())
+ data |= 1 << i;
+
+ return ~data;
+}
+
+u8 diamond2_state::read_board()
+{
+ u8 data = 0;
+
+ // priority encoded (either a 74148 on diamond, or 2*7421 on diamond2)
+ for (int i = 0; i < 8; i++)
+ if (BIT(m_inp_mux, i))
+ data |= (count_leading_zeros_32(m_board->read_rank(i)) - 24) ^ 8;
+
+ return ~data;
+}
+
+u8 diamond2_state::p4_r()
+{
+ // P47: chessboard active
+ return read_board() << 4 | 0x7f;
+}
+
+void diamond2_state::p4_w(u8 data)
+{
+ // P40: speaker out
+ m_dac->write(data & 1);
+
+ // P41: select LEDs A-H
+ m_led_select = (m_led_select & 1) | (~data & 2);
+
+ // P42-P45: input mux low
+ m_inp_mux = (m_inp_mux & 0xf0) | (~data >> 2 & 0xf);
+ update_leds();
+}
+
+void diamond2_state::p5_w(u8 data)
+{
+ // P52-P55: input mux high
+ m_inp_mux = (m_inp_mux & 0x0f) | (~data << 2 & 0xf0);
+ update_leds();
+}
+
+void diamond2_state::p6_w(u8 data)
+{
+ // P63: ROM/RAM CS
+ m_memory.select(BIT(data, 3));
+
+ // P64,P65: ROM/RAM bankswitch
+ const u8 bank = data >> 4 & 3;
+ m_rombank->set_entry(bank);
+ m_rambank->set_entry(bank);
+
+ // other: LCD (see above)
+}
+
+u8 diamond2_state::p7_r()
+{
+ // P71-P73: multiplexed inputs
+ return (read_buttons() & read_board()) << 1 | 0xf1;
+}
+
+void diamond2_state::p7_w(u8 data)
+{
+ // P70: select LEDs 1-8
+ m_led_select = (m_led_select & 2) | (~data & 1);
+ update_leds();
+}
+
+
+
+/*******************************************************************************
+ Address Maps
+*******************************************************************************/
+
+void diamond2_state::main_map(address_map &map)
+{
+ map(0x8000, 0xffff).view(m_memory);
+ m_memory[0](0x8000, 0xffff).bankr(m_rombank);
+ m_memory[1](0x8000, 0xffff).bankrw(m_rambank);
+
+ map(0xff90, 0xff9f).unmaprw(); // reserved for H8 registers
+ map(0xffb0, 0xffff).unmaprw(); // "
+}
+
+
+
+/*******************************************************************************
+ Input Ports
+*******************************************************************************/
+
+static INPUT_PORTS_START( diamond2 )
+ PORT_START("IN.0")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Go")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Info")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Hint")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Training")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Option 1/2")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Set Level")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Clear / Clear Board")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("New Game")
+
+ PORT_START("IN.1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Next Best / Take Back / Print Board")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Trace Forward / Print Game")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Easy / Replay")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Random / Video")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Restore / Human")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Book Select / Auto/Demo")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Sound / Auto Clock")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Referee / Print Moves")
+
+ PORT_START("IN.2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Color")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Verify / Setup / Rating")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Pro-op Print / King")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Pro-op Priority / Queen")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Pro-op Delete / Rook")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Pro-op Save / Bishop")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Load Game / Knight")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Save Game / Pawn")
+
+ PORT_START("BATT")
+ PORT_CONFNAME( 0x80, 0x80, "Battery Status" )
+ PORT_CONFSETTING( 0x00, "Low" )
+ PORT_CONFSETTING( 0x80, DEF_STR( Normal ) )
+ PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNUSED)
+
+ PORT_START("POWER")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_ON) PORT_CHANGED_MEMBER(DEVICE_SELF, diamond2_state, power_switch, 1)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, diamond2_state, power_switch, 0)
+INPUT_PORTS_END
+
+
+
+/*******************************************************************************
+ Machine Configs
+*******************************************************************************/
+
+void diamond2_state::diamond2(machine_config &config)
+{
+ // basic machine hardware
+ H8325(config, m_maincpu, 32_MHz_XTAL);
+ m_maincpu->set_mode(2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &diamond2_state::main_map);
+ m_maincpu->nvram_enable_backup(true);
+ m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery));
+ m_maincpu->standby_cb().append(FUNC(diamond2_state::standby));
+ m_maincpu->write_sci_tx<0>().set(m_rs232, FUNC(rs232_port_device::write_txd));
+ m_maincpu->read_port2().set_ioport("BATT").invert();
+ m_maincpu->read_port4().set(FUNC(diamond2_state::p4_r));
+ m_maincpu->write_port4().set(FUNC(diamond2_state::p4_w));
+ m_maincpu->write_port5().set(FUNC(diamond2_state::p5_w));
+ m_maincpu->read_port6().set(FUNC(diamond2_state::power_r));
+ m_maincpu->write_port6().set(FUNC(diamond2_state::p6_w));
+ m_maincpu->write_port6().append(FUNC(diamond2_state::lcd_data_w));
+ m_maincpu->read_port7().set(FUNC(diamond2_state::p7_r));
+ m_maincpu->write_port7().set(FUNC(diamond2_state::p7_w));
+
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+
+ SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
+ m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
+ m_board->set_delay(attotime::from_msec(250));
+ //m_board->set_nvram_enable(true);
+
+ // video hardware
+ PWM_DISPLAY(config, m_lcd_pwm).set_size(4, 16);
+ m_lcd_pwm->output_x().set(FUNC(diamond2_state::lcd_pwm_w));
+ m_lcd_pwm->set_bri_levels(0.05);
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
+ screen.set_refresh_hz(60);
+ screen.set_size(1920/5, 671/5);
+ screen.set_visarea_full();
+
+ PWM_DISPLAY(config, m_led_pwm).set_size(2, 8);
+ config.set_default_layout(layout_novag_diamond2);
+
+ // rs232 (configure after video)
+ RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
+ m_rs232->rxd_handler().set(m_maincpu, FUNC(h8325_device::sci_rx_w<0>));
+
+ // sound hardware
+ SPEAKER(config, "speaker").front_center();
+ DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
+}
+
+
+
+/*******************************************************************************
+ ROM Definitions
+*******************************************************************************/
+
+ROM_START( diamond2 ) // ID = DIAMOND II V1.02
+ ROM_REGION16_BE( 0x8000, "maincpu", 0 )
+ ROM_LOAD("ihp_7600109_hd6433258c67f.u1", 0x0000, 0x8000, CRC(10970123) SHA1(8f72e756915de6569c3936140c775d24730e9065) )
+
+ ROM_REGION16_BE( 0x20000, "eprom", 0 )
+ ROM_LOAD("32dsii_060597.u3", 0x00000, 0x20000, CRC(c1be39c6) SHA1(e33ee655bd342fed736c2b2093a89752e695aff3) )
+
+ ROM_REGION( 72533, "screen", 0 )
+ ROM_LOAD("sapphire2.svg", 0, 72533, CRC(34944b61) SHA1(4a0536ac07790cced9f9bf15522b17ebc375ff8a) )
+ROM_END
+
+} // anonymous namespace
+
+
+
+/*******************************************************************************
+ Drivers
+*******************************************************************************/
+
+// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
+SYST( 1997, diamond2, 0, 0, diamond2, diamond2, diamond2_state, empty_init, "Novag Industries", "Diamond II", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/novag/primo.cpp b/src/mame/novag/primo.cpp
index dbdf45169a6..684ad27a053 100644
--- a/src/mame/novag/primo.cpp
+++ b/src/mame/novag/primo.cpp
@@ -483,5 +483,5 @@ SYST( 1987, nprimo, 0, 0, primo, primo, primo_state, empty_init,
SYST( 1988, supremo, 0, 0, supremo, supremo, primo_state, empty_init, "Novag Industries", "Supremo", MACHINE_SUPPORTS_SAVE )
-SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, v1.05 set 1)", MACHINE_SUPPORTS_SAVE )
-SYST( 1990, nsnovaa, nsnova, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, v1.05 set 2)", MACHINE_SUPPORTS_SAVE )
+SYST( 1990, nsnova, 0, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, set 1)", MACHINE_SUPPORTS_SAVE )
+SYST( 1990, nsnovaa, nsnova, 0, snova, snova, primo_state, empty_init, "Novag Industries", "Super Nova (Novag, set 2)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/novag/sapphire.cpp b/src/mame/novag/sapphire.cpp
index e251a33fc1c..e5490111a4b 100644
--- a/src/mame/novag/sapphire.cpp
+++ b/src/mame/novag/sapphire.cpp
@@ -3,12 +3,14 @@
// thanks-to:Berger
/*******************************************************************************
-Novag Sapphire (model 9304)
+Novag Sapphire (model 9304) / Sapphire II (model 38601)
Handheld chess computer. It's the successor to Novag Super VIP, whereas Ruby is
the successor to Novag VIP. The chess engine is by David Kittinger again.
Hardware notes:
+
+Sapphire:
- PCB label: 100168 REV A
- Hitachi H8/325 MCU (mode 2), 26.601712MHz XTAL
- 32KB EPROM (M27C256B-12F1), 128KB SRAM (KM681000ALG-10)
@@ -16,16 +18,26 @@ Hardware notes:
- RJ-12 port for Novag Super System (always 9600 baud)
- 24 buttons, piezo
+Sapphire II:
+- PCB label: 100209 REV A
+- Hitachi H8/325 MCU (mode 2), 32MHz XTAL
+- 128KB EPROM (27C010), 128KB SRAM (KM681000CLG-7)
+- LCD has more segments, the rest is the same as Sapphire
+
+Sapphire II MCU and EPROM are the same as Diamond II. MCU pin P62 determines
+which hardware it runs on, see diamond2.cpp for Diamond II.
+
TODO:
- Novag Super System peripherals don't work due to serial clock drift, baud rate
differs a bit between host and client, m6801 serial emulation issue (to work
- around it, underclock sapphire to exactly 26.4192MHz)
+ around it, underclock sapphire to exactly 26.4192MHz, sapphire2 to 31.9488MHz)
- it does a cold boot at every reset, so nvram won't work properly unless MAME
adds some kind of auxillary autosave state feature at power-off
BTANB:
-- Average Time level (AT) does not work properly after a few moves, this is
- mentioned in the manual and it suggests to set user programmable time control
+- Average Time level (AT) does not work properly after a few moves on sapphire,
+ this is mentioned in the manual and it suggests to set user programmable time
+ control
*******************************************************************************/
@@ -42,6 +54,7 @@ BTANB:
// internal artwork
#include "novag_sapphire.lh"
+#include "novag_sapphire2.lh"
namespace {
@@ -55,6 +68,7 @@ public:
m_memory(*this, "memory"),
m_nvram(*this, "nvram", 0x20000, ENDIANNESS_BIG),
m_rambank(*this, "rambank"),
+ m_rombank(*this, "rombank"),
m_lcd_pwm(*this, "lcd_pwm"),
m_dac(*this, "dac"),
m_rs232(*this, "rs232"),
@@ -63,6 +77,7 @@ public:
{ }
void sapphire(machine_config &config);
+ void sapphire2(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(power_switch);
@@ -76,19 +91,21 @@ private:
memory_view m_memory;
memory_share_creator<u8> m_nvram;
required_memory_bank m_rambank;
+ optional_memory_bank m_rombank;
required_device<pwm_display_device> m_lcd_pwm;
required_device<dac_1bit_device> m_dac;
required_device<rs232_port_device> m_rs232;
required_ioport_array<3> m_inputs;
- output_finder<4, 10> m_out_lcd;
+ output_finder<4, 10+6> m_out_lcd;
bool m_power = false;
u8 m_inp_mux = 0;
u8 m_lcd_sclk = 0;
- u16 m_lcd_data = 0;
+ u32 m_lcd_data = 0;
u8 m_lcd_segs2 = 0;
- void main_map(address_map &map);
+ void sapphire_map(address_map &map);
+ void sapphire2_map(address_map &map);
// I/O handlers
void set_power(bool power);
@@ -96,9 +113,11 @@ private:
void lcd_pwm_w(offs_t offset, u8 data);
void update_lcd();
- void lcd_data_w(u8 data);
+ void s1_lcd_data_w(u8 data);
+ void s2_lcd_data_w(u8 data);
- u8 read_inputs();
+ u8 read_buttons();
+ void bank_w(u8 data);
void p4_w(u8 data);
u8 p5_r();
void p6_w(u8 data);
@@ -109,6 +128,9 @@ void sapphire_state::machine_start()
{
m_out_lcd.resolve();
+ if (m_rombank)
+ m_rombank->configure_entries(0, 4, memregion("eprom")->base(), 0x8000);
+
m_rambank->configure_entries(0, 4, m_nvram, 0x8000);
m_memory.select(0);
@@ -159,38 +181,48 @@ void sapphire_state::update_lcd()
{
for (int i = 0; i < 4; i++)
{
+ const u8 shift = m_lcd_pwm->width() & 0x18;
+
// LCD common is analog (voltage level)
- const u8 com = population_count_32(m_lcd_data >> (8 + (i * 2)) & 3);
- u16 segs = (m_lcd_data & 0xff) | (m_lcd_segs2 << 8 & 0x300);
+ const u8 com = population_count_32(m_lcd_data >> (shift + (i * 2)) & 3);
+ u16 segs = m_lcd_data & ((1 << shift) - 1);
+ segs |= m_lcd_segs2 << shift; // sapphire
segs = (com == 0) ? segs : (com == 2) ? ~segs : 0;
m_lcd_pwm->write_row(i, segs);
}
}
-void sapphire_state::lcd_data_w(u8 data)
+void sapphire_state::s1_lcd_data_w(u8 data)
{
+ // P60,P61: same as sapphire2
+ s2_lcd_data_w(data);
+
// P62: 2*14015B R
if (data & 4)
m_lcd_data = 0;
- // P60: 2*14015B C (chained)
- else if (data & 1 && !m_lcd_sclk)
+ // P64,P65: 2 more LCD segments
+ m_lcd_segs2 = data >> 4 & 3;
+ update_lcd();
+}
+
+void sapphire_state::s2_lcd_data_w(u8 data)
+{
+ // P60: 2/3*14015B C (chained)
+ if (data & 1 && !m_lcd_sclk)
{
// P61: 14015B D, outputs to LCD
m_lcd_data = m_lcd_data << 1 | BIT(data, 1);
+ update_lcd();
}
m_lcd_sclk = data & 1;
-
- // P64,P65: 2 more LCD segments
- m_lcd_segs2 = data >> 4 & 3;
- update_lcd();
}
// misc
-u8 sapphire_state::read_inputs()
+u8 sapphire_state::read_buttons()
{
u8 data = 0;
@@ -201,14 +233,23 @@ u8 sapphire_state::read_inputs()
return ~data;
}
+void sapphire_state::bank_w(u8 data)
+{
+ // ROM/RAM bankswitch
+ const u8 bank = data & 3;
+
+ // only sapphire2 has ROM banks
+ if (m_rombank)
+ m_rombank->set_entry(bank);
+
+ m_rambank->set_entry(bank);
+}
+
void sapphire_state::p4_w(u8 data)
{
// P40: speaker out
m_dac->write(data & 1);
- // P41,P42: RAM bank
- m_rambank->set_entry(data >> 1 & 3);
-
// P43-P45: input mux
m_inp_mux = ~data >> 3 & 7;
}
@@ -216,19 +257,21 @@ void sapphire_state::p4_w(u8 data)
u8 sapphire_state::p5_r()
{
// P52-P55: read buttons (low)
- return read_inputs() << 2 | 0xc3;
+ return read_buttons() << 2 | 0xc3;
}
void sapphire_state::p6_w(u8 data)
{
- // P63: RAM/ROM CS
+ // P63: ROM/RAM CS
m_memory.select(BIT(data, 3));
+
+ // other: LCD (see above)
}
u8 sapphire_state::p7_r()
{
// P70-P73: read buttons (high)
- return read_inputs() >> 4 | 0xf0;
+ return read_buttons() >> 4 | 0xf0;
}
@@ -237,16 +280,22 @@ u8 sapphire_state::p7_r()
Address Maps
*******************************************************************************/
-void sapphire_state::main_map(address_map &map)
+void sapphire_state::sapphire_map(address_map &map)
{
map(0x8000, 0xffff).view(m_memory);
- m_memory[0](0x8000, 0xffff).rom().region("maincpu", 0x8000);
+ m_memory[0](0x8000, 0xffff).rom().region("eprom", 0);
m_memory[1](0x8000, 0xffff).bankrw(m_rambank);
map(0xff90, 0xff9f).unmaprw(); // reserved for H8 registers
map(0xffb0, 0xffff).unmaprw(); // "
}
+void sapphire_state::sapphire2_map(address_map &map)
+{
+ sapphire_map(map);
+ m_memory[0](0x8000, 0xffff).bankr(m_rombank);
+}
+
/*******************************************************************************
@@ -312,7 +361,7 @@ void sapphire_state::sapphire(machine_config &config)
// basic machine hardware
H8325(config, m_maincpu, 26.601712_MHz_XTAL);
m_maincpu->set_mode(2);
- m_maincpu->set_addrmap(AS_PROGRAM, &sapphire_state::main_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &sapphire_state::sapphire_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery));
m_maincpu->standby_cb().append([this](int state) { if (state) m_lcd_pwm->clear(); });
@@ -320,10 +369,11 @@ void sapphire_state::sapphire(machine_config &config)
m_maincpu->read_port2().set_ioport("BATT").invert();
m_maincpu->read_port4().set_ioport("LOCK").invert();
m_maincpu->write_port4().set(FUNC(sapphire_state::p4_w));
+ m_maincpu->write_port4().append(FUNC(sapphire_state::bank_w)).rshift(1);
m_maincpu->read_port5().set(FUNC(sapphire_state::p5_r));
m_maincpu->read_port6().set(FUNC(sapphire_state::power_r));
m_maincpu->write_port6().set(FUNC(sapphire_state::p6_w));
- m_maincpu->write_port6().append(FUNC(sapphire_state::lcd_data_w));
+ m_maincpu->write_port6().append(FUNC(sapphire_state::s1_lcd_data_w));
m_maincpu->read_port7().set(FUNC(sapphire_state::p7_r));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -335,7 +385,7 @@ void sapphire_state::sapphire(machine_config &config)
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
- screen.set_size(1920/2.5, 606/2.5);
+ screen.set_size(1920/3, 606/3);
screen.set_visarea_full();
config.set_default_layout(layout_novag_sapphire);
@@ -349,6 +399,28 @@ void sapphire_state::sapphire(machine_config &config)
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
}
+void sapphire_state::sapphire2(machine_config &config)
+{
+ sapphire(config);
+
+ // basic machine hardware
+ m_maincpu->set_clock(32_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &sapphire_state::sapphire2_map);
+ m_maincpu->write_port4().set(FUNC(sapphire_state::p4_w)); // bankswitch is on port 6
+ m_maincpu->write_port6().set(FUNC(sapphire_state::p6_w));
+ m_maincpu->write_port6().append(FUNC(sapphire_state::bank_w)).rshift(4);
+ m_maincpu->write_port6().append(FUNC(sapphire_state::s2_lcd_data_w));
+
+ // video hardware
+ m_lcd_pwm->set_width(16);
+
+ screen_device &screen(*subdevice<screen_device>("screen"));
+ screen.set_size(1920/3, 671/3);
+ screen.set_visarea_full();
+
+ config.set_default_layout(layout_novag_sapphire2);
+}
+
/*******************************************************************************
@@ -356,14 +428,27 @@ void sapphire_state::sapphire(machine_config &config)
*******************************************************************************/
ROM_START( sapphire ) // ID = SAPPHIRE V1.01
- ROM_REGION16_BE( 0x10000, "maincpu", 0 )
+ ROM_REGION16_BE( 0x8000, "maincpu", 0 )
ROM_LOAD("novag_9304-010053_6433258b46f.u1", 0x0000, 0x8000, CRC(bfc39f4b) SHA1(dc96440c070e903772f4485757443dd690e92120) )
- ROM_LOAD("bk301_26601.u2", 0x8000, 0x8000, CRC(648ebe8f) SHA1(2883f962a0bf17426fd809b9f2c01ce3dec0df1b) )
+
+ ROM_REGION16_BE( 0x8000, "eprom", 0 )
+ ROM_LOAD("bk301_26601.u2", 0x0000, 0x8000, CRC(648ebe8f) SHA1(2883f962a0bf17426fd809b9f2c01ce3dec0df1b) )
ROM_REGION( 36256, "screen", 0 )
ROM_LOAD("nvip.svg", 0, 36256, CRC(3373e0d5) SHA1(25bfbf0405017388c30f4529106baccb4723bc6b) )
ROM_END
+ROM_START( sapphire2 ) // ID = SAPPHIRE II V1.02
+ ROM_REGION16_BE( 0x8000, "maincpu", 0 )
+ ROM_LOAD("ihp_7600109_hd6433258c67f.u1", 0x0000, 0x8000, CRC(10970123) SHA1(8f72e756915de6569c3936140c775d24730e9065) )
+
+ ROM_REGION16_BE( 0x20000, "eprom", 0 )
+ ROM_LOAD("32dsii_060597.u3", 0x00000, 0x20000, CRC(c1be39c6) SHA1(e33ee655bd342fed736c2b2093a89752e695aff3) )
+
+ ROM_REGION( 72533, "screen", 0 )
+ ROM_LOAD("sapphire2.svg", 0, 72533, CRC(34944b61) SHA1(4a0536ac07790cced9f9bf15522b17ebc375ff8a) )
+ROM_END
+
} // anonymous namespace
@@ -372,5 +457,7 @@ ROM_END
Drivers
*******************************************************************************/
-// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
-SYST( 1994, sapphire, 0, 0, sapphire, sapphire, sapphire_state, empty_init, "Novag Industries", "Sapphire (Novag)", MACHINE_SUPPORTS_SAVE )
+// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
+SYST( 1994, sapphire, 0, 0, sapphire, sapphire, sapphire_state, empty_init, "Novag Industries", "Sapphire", MACHINE_SUPPORTS_SAVE )
+
+SYST( 1997, sapphire2, 0, 0, sapphire2, sapphire, sapphire_state, empty_init, "Novag Industries", "Sapphire II", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/novag/sdiamond.cpp b/src/mame/novag/sdiamond.cpp
index eeac2cb48fe..85c54f1b9b7 100644
--- a/src/mame/novag/sdiamond.cpp
+++ b/src/mame/novag/sdiamond.cpp
@@ -3,7 +3,7 @@
// thanks-to:Berger
/*******************************************************************************
-Novag (Perfect Technology*) Star Diamond
+Novag (Perfect Technology*) Star Diamond (model 1004)
*: Novag Industries dissolved in 2000. The Novag brand continued for a few years
under Perfect Technology, Ltd., established by the daughter of Novag's founder.
@@ -17,10 +17,13 @@ Hardware notes:
- Hitachi H8S/2312 12312VTE25V, 25MHz XTAL
- 512KB Flash ROM (SST 39VF400A), only 192KB used
- 256KB RAM (2*Hynix HY62V8100B)
-- LCD with 6 7segs and custom segments
+- LCD with 6 7segs and custom segments (same as Sapphire II)
- RJ-12 port for Novag Super System (always 57600 baud)
- piezo, 16 LEDs, button sensors chessboard
+Other than 2 checksum bytes, the opening book data (0x10000-0x2ffff) is identical
+to the Diamond II / Sapphire II 060597 EPROM.
+
TODO:
- it does a cold boot at every reset, so nvram won't work properly unless MAME
adds some kind of auxillary autosave state feature at power-off
@@ -180,7 +183,6 @@ void sdiamond_state::lcd_segs_w(u8 data)
m_lcd_segs = m_lcd_segs << 1 | BIT(data, 4);
update_lcd();
}
-
m_lcd_sclk = BIT(data, 5);
}
@@ -359,7 +361,7 @@ ROM_START( sdiamond ) // ID = H8S/SD V1.04
ROM_LOAD16_WORD_SWAP("39vf400a.ic3", 0x00000, 0x80000, CRC(ee9a4fee) SHA1(b86e5efa5b7b9ddbe9fe1dabfe8cbc2bc40809b8) )
ROM_REGION( 72533, "screen", 0 )
- ROM_LOAD("sdiamond.svg", 0, 72533, CRC(34944b61) SHA1(4a0536ac07790cced9f9bf15522b17ebc375ff8a) )
+ ROM_LOAD("sapphire2.svg", 0, 72533, CRC(34944b61) SHA1(4a0536ac07790cced9f9bf15522b17ebc375ff8a) )
ROM_END
} // anonymous namespace
@@ -371,4 +373,4 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
-SYST( 2003, sdiamond, 0, 0, sdiamond, sdiamond, sdiamond_state, empty_init, "Perfect Technology", "Star Diamond (v1.04)", MACHINE_SUPPORTS_SAVE )
+SYST( 2003, sdiamond, 0, 0, sdiamond, sdiamond, sdiamond_state, empty_init, "Perfect Technology", "Star Diamond", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/novag/vip.cpp b/src/mame/novag/vip.cpp
index a88850b13d8..2caa4209620 100644
--- a/src/mame/novag/vip.cpp
+++ b/src/mame/novag/vip.cpp
@@ -325,7 +325,7 @@ void vip_state::vip(machine_config &config)
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
- screen.set_size(1920/2.5, 606/2.5);
+ screen.set_size(1920/3, 606/3);
screen.set_visarea_full();
config.set_default_layout(layout_novag_vip);