mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
New working systems
------------------- Kasparov Chess Academy [hap, Sean Riddle] h8_watchdog: improve overflow flag reset
This commit is contained in:
parent
142144af66
commit
72e8b752a2
@ -12,6 +12,9 @@
|
||||
Or if it's edge triggered, will it trigger an IRQ on rising edge of
|
||||
(irq_enable & flag)? Note that mu100 will lock up at boot if it's
|
||||
triggered at rising edge of (flag) or (irq_enable & flag).
|
||||
- When writing 0 to the status register(s), the overflow/compare match
|
||||
flags will only be cleared after a read access was done while they
|
||||
were set? It's how the databook explains it, similar to HD6301.
|
||||
- H8/325 16-bit timer is shoehorned in and may have a bug lurking?
|
||||
It doesn't have TGR registers, but functionally equivalent OCR/ICR.
|
||||
- Make the base class more generic, and derive the devices from that,
|
||||
|
@ -11,6 +11,9 @@
|
||||
while an overflow or compare match flag is 1, will it trigger an IRQ?
|
||||
Or if it's edge triggered, will it trigger an IRQ on rising edge of
|
||||
(irq_enable & flag)?
|
||||
- When writing 0 to the status register(s), the overflow/compare match
|
||||
flags will only be cleared after a read access was done while they
|
||||
were set? It's how the databook explains it, similar to HD6301.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
|
@ -1,5 +1,17 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Olivier Galibert
|
||||
/***************************************************************************
|
||||
|
||||
h8_watchdog.cpp
|
||||
|
||||
H8 watchdog/timer
|
||||
|
||||
TODO:
|
||||
- add RSTCSR for MCUs that have it (reset is only enabled when RSTI is 1)
|
||||
- It will only clear the overflow flag when writing 0 after reading it
|
||||
when it's set? It's how the databook explains it, similar to HD6301.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "h8_watchdog.h"
|
||||
@ -72,7 +84,9 @@ u16 h8_watchdog_device::wd_r()
|
||||
{
|
||||
if(!machine().side_effects_disabled())
|
||||
tcnt_update();
|
||||
return (m_tcsr << 8) | m_tcnt;
|
||||
|
||||
u8 tcsr_mask = m_type == B ? 0x10 : 0x18;
|
||||
return ((m_tcsr | tcsr_mask) << 8) | m_tcnt;
|
||||
}
|
||||
|
||||
void h8_watchdog_device::wd_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
@ -84,8 +98,7 @@ void h8_watchdog_device::wd_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
tcnt_update();
|
||||
if(!(m_tcsr & TCSR_TME) && (data & TCSR_TME))
|
||||
m_tcnt_cycle_base = m_cpu->total_cycles();
|
||||
m_tcsr = data & 0xff;
|
||||
m_tcsr |= m_type == B ? 0x10 : 0x18;
|
||||
m_tcsr = (m_tcsr & data & TCSR_OVF) | (data & 0x7f);
|
||||
m_cpu->internal_update();
|
||||
}
|
||||
|
||||
@ -103,11 +116,16 @@ u16 h8_watchdog_device::rst_r()
|
||||
{
|
||||
if(!machine().side_effects_disabled())
|
||||
logerror("rst_r\n");
|
||||
return 0;
|
||||
|
||||
u8 rst_mask = m_type == S ? 0x1f : 0x3f;
|
||||
return m_rst | rst_mask;
|
||||
}
|
||||
|
||||
void h8_watchdog_device::rst_w(u16 data)
|
||||
void h8_watchdog_device::rst_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
if(mem_mask != 0xffff)
|
||||
return;
|
||||
|
||||
if((data & 0xff00) == 0xa500)
|
||||
logerror("wowf_w %02x\n", data & 0xff);
|
||||
if((data & 0xff00) == 0x5a00)
|
||||
@ -124,8 +142,8 @@ void h8_watchdog_device::device_start()
|
||||
|
||||
void h8_watchdog_device::device_reset()
|
||||
{
|
||||
m_tcnt = 0x00;
|
||||
m_tcnt_cycle_base = m_cpu->total_cycles();
|
||||
m_tcsr = m_type == B ? 0x10 : 0x18;
|
||||
m_rst = m_type == S ? 0x1f : 0x3f;
|
||||
m_tcnt = 0x00;
|
||||
m_tcsr = 0x00;
|
||||
m_rst = 0x00;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
u16 wd_r();
|
||||
void wd_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
u16 rst_r();
|
||||
void rst_w(u16 data);
|
||||
void rst_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
|
525
src/mame/layout/saitek_chessac.lay
Normal file
525
src/mame/layout/saitek_chessac.lay
Normal file
@ -0,0 +1,525 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
license:CC0-1.0
|
||||
authors:hap
|
||||
-->
|
||||
<mamelayout version="2">
|
||||
|
||||
<!-- luascript (-plugin layout), for pressing 2 buttons simultaneously -->
|
||||
|
||||
<script><![CDATA[
|
||||
local layout = {}
|
||||
local prev_state = 0
|
||||
|
||||
function layout.frame()
|
||||
local cur_state = machine.ioport.ports[":CLICKABLE"]:read() & 1
|
||||
if cur_state ~= prev_state then
|
||||
machine.ioport.ports[":IN.0"]:field(0x01):set_value(cur_state)
|
||||
machine.ioport.ports[":IN.0"]:field(0x02):set_value(cur_state)
|
||||
end
|
||||
prev_state = cur_state
|
||||
end
|
||||
|
||||
return layout
|
||||
]]></script>
|
||||
|
||||
|
||||
<!-- define elements -->
|
||||
|
||||
<element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
|
||||
<element name="black2"><rect><color red="0.125" green="0.12" blue="0.12" /></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="led" defstate="0">
|
||||
<disk state="1"><color red="1.0" green="0.1" blue="0.15" /></disk>
|
||||
<disk state="0"><color red="0.1" green="0.01" blue="0.015" /></disk>
|
||||
</element>
|
||||
|
||||
<element name="text_1"><text string="1"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_2"><text string="2"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_3"><text string="3"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_4"><text string="4"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_5"><text string="5"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_6"><text string="6"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_7"><text string="7"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_8"><text string="8"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_a"><text string="A"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_b"><text string="B"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_c"><text string="C"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_d"><text string="D"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_e"><text string="E"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_f"><text string="F"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_g"><text string="G"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
<element name="text_h"><text string="H"><color red="0.1" green="0.1" blue="0.1" /></text></element>
|
||||
|
||||
|
||||
<!-- sb board -->
|
||||
|
||||
<element name="cwhite"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element>
|
||||
<element name="cblack"><rect><color red="0.41" green="0.4" blue="0.39" /></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>
|
||||
|
||||
<!-- leds -->
|
||||
<repeat count="8">
|
||||
<param name="y" start="8.3" increment="10" />
|
||||
<param name="i1" start="0" increment="1" />
|
||||
|
||||
<repeat count="8">
|
||||
<param name="x" start="0.2" increment="10" />
|
||||
<param name="i2" start="0" increment="1" />
|
||||
<element name="~i1~.~i2~" ref="led"><bounds x="~x~" y="~y~" width="1.5" height="1.5" /></element>
|
||||
</repeat>
|
||||
</repeat>
|
||||
|
||||
<!-- 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=" <<"><color red="0.01" green="0.01" blue="0.01" /></text></element>
|
||||
<element name="text_uiu2b"><text string=" < "><color red="0.01" green="0.01" blue="0.01" /></text></element>
|
||||
<element name="text_uiu2c"><text string=" >"><color red="0.01" green="0.01" blue="0.01" /></text></element>
|
||||
<element name="text_uiu2d"><text string=" >>"><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="white2"><rect><color red="0.9" green="0.89" blue="0.88" /></rect></element>
|
||||
<element name="yellow"><rect><color red="0.9" green="0.8" blue="0.35" /></rect></element>
|
||||
<element name="blackd"><disk><color red="0" green="0" blue="0" /></disk></element>
|
||||
|
||||
<element name="box">
|
||||
<rect>
|
||||
<bounds xc="0" yc="0" width="10" height="10" />
|
||||
<color red="1" green="1" blue="1" />
|
||||
</rect>
|
||||
<rect>
|
||||
<bounds xc="0" yc="0" width="8" height="8" />
|
||||
<color red="0" green="0" blue="0" />
|
||||
</rect>
|
||||
</element>
|
||||
|
||||
<element name="box2">
|
||||
<rect>
|
||||
<bounds xc="0" yc="0" width="7" height="1.7" />
|
||||
<color red="1" green="1" blue="1" />
|
||||
</rect>
|
||||
<rect>
|
||||
<bounds xc="0" yc="0" width="6.8" height="1.5" />
|
||||
<color red="0" green="0" blue="0" />
|
||||
</rect>
|
||||
</element>
|
||||
|
||||
<element name="text_x"><text string="x"></text></element>
|
||||
|
||||
<!-- flat checkmark icon, (C) Icons8, MIT license -->
|
||||
<element name="checkmark">
|
||||
<image><data><![CDATA[
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="48" height="48" viewBox="0 0 48 48">
|
||||
<polygon fill="#ffffff" points="40.6,12.1 17,35.7 7.4,26.1 4.6,29 17,41.3 43.4,14.9"/>
|
||||
</svg>
|
||||
]]></data></image>
|
||||
</element>
|
||||
|
||||
<element name="but" defstate="0">
|
||||
<rect><color red="0" green="0" blue="0" /></rect>
|
||||
<rect state="0"><color red="0.71" green="0.7" blue="0.69" /></rect>
|
||||
<rect state="1"><color red="0.71" green="0.7" blue="0.69" alpha="0.78" /></rect>
|
||||
</element>
|
||||
|
||||
<element name="butd" defstate="0">
|
||||
<disk state="0"><color red="0.71" green="0.7" blue="0.69" /></disk>
|
||||
<disk state="1"><color red="0.71" green="0.7" blue="0.69" alpha="0.78" /></disk>
|
||||
</element>
|
||||
|
||||
<element name="nothing" defstate="0">
|
||||
<rect><color alpha="0" /></rect>
|
||||
</element>
|
||||
|
||||
<element name="text_l1"><text string="BACK"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l2"><text string="FWD"> <color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l3"><text string="WHITE"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l4"><text string="BLACK"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
|
||||
<element name="text_l5"><text string="SAY AGAIN"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l6"><text string="HINT / INFO"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l7"><text string="NO /" align="2"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l8"><text string="YES /" align="2"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l9"><text string="NEW GAME"><color red="0.9" green="0.8" blue="0.35" /></text></element>
|
||||
|
||||
<element name="text_l10"><text string="TUTORIAL"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l11"><text string="LEVEL"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l12"><text string="POSITION"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l13"><text string="OPTION"><color red="0.93" green="0.92" blue="0.91" /></text></element>
|
||||
<element name="text_l14"><text string="GO/STOP"><color red="0.9" green="0.8" blue="0.35" /></text></element>
|
||||
|
||||
<element name="text_p1"><image file="chess/wk.svg"/></element>
|
||||
<element name="text_p2"><image file="chess/wq.svg"/></element>
|
||||
<element name="text_p3"><image file="chess/wr.svg"/></element>
|
||||
<element name="text_p4"><image file="chess/wb.svg"/></element>
|
||||
<element name="text_p5"><image file="chess/wn.svg"/></element>
|
||||
<element name="text_p6"><image file="chess/wp.svg"/></element>
|
||||
|
||||
<group name="buttons">
|
||||
<bounds x="1.75" y="2.5" width="50" height="33.3" />
|
||||
|
||||
<element ref="blackb"><bounds x="1.75" y="2.75" width="49" height="27" /></element>
|
||||
<element ref="blackb"><bounds x="1.75" y="24.95" width="49" height="10.6" /></element>
|
||||
|
||||
<element ref="black2"><bounds x="2" y="3" width="12" height="27" /></element>
|
||||
<element ref="black2"><bounds x="2" y="24.7" width="47" height="10.6" /></element>
|
||||
|
||||
<element ref="blackb"><bounds x="2.5" y="3.5" width="11" height="20" /></element>
|
||||
|
||||
<element ref="box"><bounds xc="35.3" yc="22.55" width="0.9" height="0.9" /></element>
|
||||
<element ref="text_x"><bounds xc="35.3" yc="22.45" width="1.2" height="1.2" /></element>
|
||||
|
||||
<element ref="box"><bounds xc="42.3" yc="22.55" width="0.9" height="0.9" /></element>
|
||||
<element ref="checkmark"><bounds xc="42.3" yc="22.50" width="0.7" height="0.8" /></element>
|
||||
|
||||
<element ref="yellow" blend="multiply"><bounds x="34" y="21" width="10" height="2.75" /></element>
|
||||
|
||||
<element ref="white2"><bounds xc="37.5" y="18.6" width="9.5" height="1.0" /></element>
|
||||
<element ref="blackb"><bounds xc="37.5" y="18.8" width="9.1" height="2" /></element>
|
||||
|
||||
<element ref="nothing" inputtag="CLICKABLE" inputmask="0x01"><bounds xc="37.5" yc="18.6" width="6.8" height="1.5" /></element>
|
||||
|
||||
<element ref="blackb"><bounds xc="37.5" yc="18.6" width="7.8" height="3" /></element>
|
||||
<element ref="box2"><bounds xc="37.5" yc="18.6" width="7" height="1.7" /></element>
|
||||
<element ref="yellow" blend="multiply"><bounds xc="37.5" yc="18.6" width="7.8" height="3" /></element>
|
||||
|
||||
<element ref="text_p1"><bounds xc="5" y="4.0" width="2.3" height="2.3" /></element>
|
||||
<element ref="text_p2"><bounds xc="11" y="4.0" width="2.3" height="2.3" /></element>
|
||||
<element ref="text_p3"><bounds xc="5" y="8.5" width="2.3" height="2.3" /></element>
|
||||
<element ref="text_p4"><bounds xc="11" y="8.5" width="2.3" height="2.3" /></element>
|
||||
<element ref="text_p5"><bounds xc="5" y="13.0" width="2.3" height="2.3" /></element>
|
||||
<element ref="text_p6"><bounds xc="11" y="13.0" width="2.3" height="2.3" /></element>
|
||||
|
||||
<element ref="cwhite" blend="multiply"><bounds x="2.5" y="3.5" width="11" height="20" /></element>
|
||||
<element ref="black2" blend="add"><bounds x="2.5" y="3.5" width="11" height="20" /></element>
|
||||
|
||||
<element ref="text_l1"><bounds xc="5" y="18.4" width="6" height="1.2" /></element>
|
||||
<element ref="text_l2"><bounds xc="11" y="18.4" width="6" height="1.2" /></element>
|
||||
|
||||
<element ref="text_l3"><bounds xc="5" y="21.9" width="6" height="1.2" /></element>
|
||||
<element ref="text_l4"><bounds xc="11" y="21.9" width="6" height="1.2" /></element>
|
||||
<element ref="text_l5"><bounds xc="20" y="21.9" width="6" height="1.2" /></element>
|
||||
<element ref="text_l6"><bounds xc="27" y="21.9" width="6" height="1.2" /></element>
|
||||
|
||||
<element ref="text_l7"><bounds x="28.5" y="21.9" width="6" height="1.2" /></element>
|
||||
<element ref="text_l8"><bounds x="35.5" y="21.9" width="6" height="1.2" /></element>
|
||||
<element ref="text_l9"><bounds xc="37.5" yc="18.6" width="6" height="1.2" /></element>
|
||||
|
||||
<repeat count="5">
|
||||
<param name="x" start="20" increment="5.25" />
|
||||
<param name="i" start="0" increment="1" />
|
||||
<element ref="text_l1~i~"><bounds xc="~x~" y="26.3" width="6" height="1.2" /></element>
|
||||
<element ref="blackd"><bounds xc="~x~" yc="30" width="4" height="4" /></element>
|
||||
</repeat>
|
||||
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x80"><bounds xc="5" y="6.5" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x40"><bounds xc="5" y="11.0" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.1" inputmask="0x20"><bounds xc="5" y="15.5" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.1" inputmask="0x10"><bounds xc="5" y="20.0" width="4" height="1.5" /></element>
|
||||
|
||||
<element ref="but" inputtag="IN.1" inputmask="0x80"><bounds xc="11" y="6.5" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.1" inputmask="0x40"><bounds xc="11" y="11.0" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x20"><bounds xc="11" y="15.5" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x10"><bounds xc="11" y="20.0" width="4" height="1.5" /></element>
|
||||
|
||||
<element ref="but" inputtag="IN.1" inputmask="0x08"><bounds xc="20" y="20" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x08"><bounds xc="27" y="20" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x02"><bounds xc="34" y="20" width="4" height="1.5" /></element>
|
||||
<element ref="but" inputtag="IN.0" inputmask="0x01"><bounds xc="41" y="20" width="4" height="1.5" /></element>
|
||||
|
||||
<element ref="butd" inputtag="IN.1" inputmask="0x04"><bounds xc="20.00" yc="30" width="2.5" height="2.5" /></element>
|
||||
<element ref="butd" inputtag="IN.1" inputmask="0x02"><bounds xc="25.25" yc="30" width="2.5" height="2.5" /></element>
|
||||
<element ref="butd" inputtag="IN.0" inputmask="0x04"><bounds xc="30.50" yc="30" width="2.5" height="2.5" /></element>
|
||||
<element ref="butd" inputtag="IN.1" inputmask="0x01"><bounds xc="35.75" yc="30" width="2.5" height="2.5" /></element>
|
||||
<element ref="butd" inputtag="IN.2" inputmask="0x10"><bounds xc="41.00" yc="30" width="2.5" height="2.5" /></element>
|
||||
</group>
|
||||
|
||||
|
||||
<!-- build screen -->
|
||||
|
||||
<view name="Internal Layout">
|
||||
<bounds left="2.75" right="153.75" top="-1.25" bottom="87.25" />
|
||||
|
||||
<element ref="cwhite"><bounds xc="60" yc="43" width="88.5" height="88.5" /></element>
|
||||
<group ref="sb_board"><bounds xc="60" yc="43" width="80.5" height="80.5" /></group>
|
||||
<group ref="sb_ui"><bounds x="4.25" y="3" width="10" height="80" /></group>
|
||||
|
||||
<element ref="cgray"><bounds x="104.5" y="-1.25" width="55" height="88.5" /></element>
|
||||
|
||||
<group ref="buttons"><bounds x="108.5" yc="43" width="50" height="33.3" /></group>
|
||||
|
||||
<screen index="0"><bounds xc="137" yc="35.5" width="19" height="7.955" /></screen>
|
||||
<element ref="lcdm" blend="multiply"><bounds xc="137" yc="35.5" width="19.3" height="8.255" /></element>
|
||||
|
||||
<element ref="blackb"><bounds x="153.75" y="-1.25" width="20" height="95" /></element>
|
||||
|
||||
<!-- chessboard coords -->
|
||||
<element ref="text_8"><bounds x="16.8" y="7" width="2" height="2" /></element>
|
||||
<element ref="text_7"><bounds x="16.8" y="17" width="2" height="2" /></element>
|
||||
<element ref="text_6"><bounds x="16.8" y="27" width="2" height="2" /></element>
|
||||
<element ref="text_5"><bounds x="16.8" y="37" width="2" height="2" /></element>
|
||||
<element ref="text_4"><bounds x="16.8" y="47" width="2" height="2" /></element>
|
||||
<element ref="text_3"><bounds x="16.8" y="57" width="2" height="2" /></element>
|
||||
<element ref="text_2"><bounds x="16.8" y="67" width="2" height="2" /></element>
|
||||
<element ref="text_1"><bounds x="16.8" y="77" width="2" height="2" /></element>
|
||||
|
||||
<element ref="text_a"><bounds x="24" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_b"><bounds x="34" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_c"><bounds x="44" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_d"><bounds x="54" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_e"><bounds x="64" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_f"><bounds x="74" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_g"><bounds x="84" y="84.2" width="2" height="2" /></element>
|
||||
<element ref="text_h"><bounds x="94" y="84.2" width="2" height="2" /></element>
|
||||
|
||||
</view>
|
||||
</mamelayout>
|
@ -38539,6 +38539,13 @@ r9751 // ROLM 9751 phone system
|
||||
@source:sage/sage2.cpp
|
||||
sage2
|
||||
|
||||
@source:saitek/chessac.cpp
|
||||
chessac
|
||||
|
||||
@source:saitek/chesstrv.cpp
|
||||
chesstrv
|
||||
chesstrvi
|
||||
|
||||
@source:saitek/companion.cpp
|
||||
compan
|
||||
|
||||
@ -38547,10 +38554,6 @@ compan2
|
||||
enterp
|
||||
expchess
|
||||
|
||||
@source:saitek/chesstrv.cpp
|
||||
chesstrv
|
||||
chesstrvi
|
||||
|
||||
@source:saitek/corona.cpp
|
||||
corona
|
||||
coronaa
|
||||
|
408
src/mame/saitek/chessac.cpp
Normal file
408
src/mame/saitek/chessac.cpp
Normal file
@ -0,0 +1,408 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
// thanks-to:Sean Riddle
|
||||
/*******************************************************************************
|
||||
|
||||
Saitek Kasparov Chess Academy / Mephisto Schachakademie (both were later rebranded
|
||||
to Mephisto Talking Chess Academy)
|
||||
|
||||
The chess engine is by Frans Morsch, similar to the one in GK 2000. Other features,
|
||||
such as the tutorials, were supposedly added by Craig Barnes.
|
||||
|
||||
Hardware notes:
|
||||
- Hitachi H8/3214 MCU, 16MHz XTAL
|
||||
- same LCD as GK 2000
|
||||
- OKI MSM6588 ADPCM Recorder @ 4MHz, small daughterboard with 4MB ROM under epoxy
|
||||
- 8*8 LEDs, button sensors chessboard
|
||||
|
||||
TODO:
|
||||
- it does a cold boot at every reset, so nvram won't work properly unless MAME
|
||||
has some kind of auxillary autosave state feature at power-off
|
||||
- dump/add German speech ROM (Mephisto Schachakademie, MCU is same)
|
||||
- does a French speech version exist?
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "cpu/h8/h83217.h"
|
||||
#include "machine/sensorboard.h"
|
||||
#include "sound/okim6588.h"
|
||||
#include "video/pwm.h"
|
||||
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
// internal artwork
|
||||
#include "saitek_chessac.lh"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class chessac_state : public driver_device
|
||||
{
|
||||
public:
|
||||
chessac_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_board(*this, "board"),
|
||||
m_adpcm_rom(*this, "adpcm"),
|
||||
m_led_pwm(*this, "led_pwm"),
|
||||
m_lcd_pwm(*this, "lcd_pwm"),
|
||||
m_okim6588(*this, "okim6588"),
|
||||
m_inputs(*this, "IN.%u", 0),
|
||||
m_out_lcd(*this, "s%u.%u", 0U, 0U)
|
||||
{ }
|
||||
|
||||
void chessac(machine_config &config);
|
||||
|
||||
DECLARE_INPUT_CHANGED_MEMBER(go_button);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
|
||||
private:
|
||||
// devices/pointers
|
||||
required_device<h83214_device> m_maincpu;
|
||||
required_device<sensorboard_device> m_board;
|
||||
required_region_ptr<u8> m_adpcm_rom;
|
||||
required_device<pwm_display_device> m_led_pwm;
|
||||
required_device<pwm_display_device> m_lcd_pwm;
|
||||
required_device<okim6588_device> m_okim6588;
|
||||
required_ioport_array<3> m_inputs;
|
||||
output_finder<2, 24> m_out_lcd;
|
||||
|
||||
u16 m_inp_mux = 0;
|
||||
u32 m_lcd_segs = 0;
|
||||
u8 m_lcd_com = 0;
|
||||
u8 m_led_select = 0;
|
||||
u8 m_led_data = 0;
|
||||
u32 m_adpdm_address = 0;
|
||||
|
||||
u8 m_port3 = 0;
|
||||
u8 m_port5 = 0;
|
||||
u8 m_port7 = 0;
|
||||
|
||||
void main_map(address_map &map);
|
||||
|
||||
// I/O handlers
|
||||
void lcd_pwm_w(offs_t offset, u8 data);
|
||||
void update_lcd();
|
||||
template <int N> void lcd_segs_w(u8 data);
|
||||
|
||||
void standby(int state);
|
||||
|
||||
void update_leds();
|
||||
void update_adpcm_address();
|
||||
|
||||
void p3_w(u8 data);
|
||||
u8 p4_r();
|
||||
void p5_w(u8 data);
|
||||
void p6_w(u8 data);
|
||||
u8 p7_r();
|
||||
void p7_w(u8 data);
|
||||
};
|
||||
|
||||
void chessac_state::machine_start()
|
||||
{
|
||||
m_out_lcd.resolve();
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_inp_mux));
|
||||
save_item(NAME(m_lcd_segs));
|
||||
save_item(NAME(m_lcd_com));
|
||||
save_item(NAME(m_led_select));
|
||||
save_item(NAME(m_led_data));
|
||||
save_item(NAME(m_adpdm_address));
|
||||
save_item(NAME(m_port3));
|
||||
save_item(NAME(m_port5));
|
||||
save_item(NAME(m_port7));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
I/O
|
||||
*******************************************************************************/
|
||||
|
||||
// power
|
||||
|
||||
void chessac_state::standby(int state)
|
||||
{
|
||||
// clear display
|
||||
if (state)
|
||||
{
|
||||
m_lcd_pwm->clear();
|
||||
m_led_pwm->clear();
|
||||
}
|
||||
}
|
||||
|
||||
INPUT_CHANGED_MEMBER(chessac_state::go_button)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
// LCD
|
||||
|
||||
void chessac_state::lcd_pwm_w(offs_t offset, u8 data)
|
||||
{
|
||||
m_out_lcd[offset & 0x3f][offset >> 6] = data;
|
||||
}
|
||||
|
||||
void chessac_state::update_lcd()
|
||||
{
|
||||
// LCD latch from P1x
|
||||
if (m_port5 & 1)
|
||||
m_lcd_segs = (m_lcd_segs << 8 & 0xff0000) | (m_lcd_segs & 0xffff);
|
||||
|
||||
u32 lcd_segs = bitswap<24>(m_lcd_segs,11,18,19,20,21,12,13,14,15,22,23,0,1,2,3,4,5,6,7,16,17,8,9,10);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
// LCD common is analog (voltage level)
|
||||
const u8 com = population_count_32(m_lcd_com >> (i * 2) & 3);
|
||||
const u32 data = (com == 0) ? lcd_segs : (com == 2) ? ~lcd_segs : 0;
|
||||
m_lcd_pwm->write_row(i, data);
|
||||
}
|
||||
}
|
||||
|
||||
template <int N>
|
||||
void chessac_state::lcd_segs_w(u8 data)
|
||||
{
|
||||
// P1x, P2x: LCD segments
|
||||
const u8 shift = 8 * N;
|
||||
m_lcd_segs = (m_lcd_segs & ~(0xff << shift)) | (data << shift);
|
||||
update_lcd();
|
||||
}
|
||||
|
||||
|
||||
// misc
|
||||
|
||||
void chessac_state::update_leds()
|
||||
{
|
||||
if (m_port5 & 0x10)
|
||||
m_led_select = ~m_port7;
|
||||
if (m_port5 & 0x20)
|
||||
m_led_data = m_port7;
|
||||
|
||||
m_led_pwm->matrix(m_led_select, m_led_data);
|
||||
}
|
||||
|
||||
void chessac_state::update_adpcm_address()
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (BIT(m_port3, i))
|
||||
{
|
||||
const u8 shift = 8 * i;
|
||||
m_adpdm_address = (m_adpdm_address & ~(0xff << shift)) | (m_port7 << shift);
|
||||
}
|
||||
}
|
||||
|
||||
void chessac_state::p3_w(u8 data)
|
||||
{
|
||||
// P37: MSM6588 RESET
|
||||
if (m_port3 & 0x80 && ~data & 0x80)
|
||||
m_okim6588->reset();
|
||||
|
||||
// P34: MSM6588 RD
|
||||
// P35: MSM6588 WR
|
||||
// P36: MSM6588 CE
|
||||
if ((data & 0xc0) == 0x80 && m_port3 & 0x20 && ~data & 0x20)
|
||||
m_okim6588->data_w(m_port7);
|
||||
|
||||
// P33: ADPCM ROM CE
|
||||
// P30-P33: enable ADPCM ROM address latches
|
||||
m_port3 = data;
|
||||
update_adpcm_address();
|
||||
}
|
||||
|
||||
u8 chessac_state::p4_r()
|
||||
{
|
||||
// P40-P47: multiplexed inputs
|
||||
u8 data = 0;
|
||||
|
||||
// read buttons
|
||||
for (int i = 0; i < 2; i++)
|
||||
if (BIT(m_inp_mux, i + 8))
|
||||
data |= m_inputs[i]->read();
|
||||
|
||||
// read chessboard
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (BIT(m_inp_mux, i))
|
||||
data |= m_board->read_file(i, true);
|
||||
|
||||
return ~data;
|
||||
}
|
||||
|
||||
void chessac_state::p5_w(u8 data)
|
||||
{
|
||||
// P50: enable LCD latch
|
||||
m_port5 = data;
|
||||
update_lcd();
|
||||
|
||||
// P51: ext power (no need to emulate it)
|
||||
// P52,P53: N/C
|
||||
|
||||
// P54,P55: enable LED latches
|
||||
update_leds();
|
||||
}
|
||||
|
||||
void chessac_state::p6_w(u8 data)
|
||||
{
|
||||
// P60-P63: LCD common
|
||||
m_lcd_com = data & 0xf;
|
||||
update_lcd();
|
||||
|
||||
// P65,P66: input mux (buttons)
|
||||
m_inp_mux = (m_inp_mux & 0xff) | (~data << 3 & 0x300);
|
||||
}
|
||||
|
||||
u8 chessac_state::p7_r()
|
||||
{
|
||||
u8 data = 0xff;
|
||||
|
||||
// P70-P77: read ADPCM ROM
|
||||
if (~m_port3 & 8)
|
||||
data &= m_adpcm_rom[m_adpdm_address & (m_adpcm_rom.bytes() - 1)];
|
||||
|
||||
// P70-P73: read MSM6588 status
|
||||
if ((m_port3 & 0xf0) == 0xa0)
|
||||
data &= (m_okim6588->data_r() | 0xf0);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void chessac_state::p7_w(u8 data)
|
||||
{
|
||||
// P70-P77: input mux (chessboard)
|
||||
m_inp_mux = (m_inp_mux & 0x300) | (data ^ 0xff);
|
||||
|
||||
// also data for LED latches, ADPCM address latches, and MSM6588
|
||||
m_port7 = data;
|
||||
update_leds();
|
||||
update_adpcm_address();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
Address Maps
|
||||
*******************************************************************************/
|
||||
|
||||
void chessac_state::main_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x7fff).rom();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
Input Ports
|
||||
*******************************************************************************/
|
||||
|
||||
static INPUT_PORTS_START( chessac )
|
||||
PORT_START("IN.0")
|
||||
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Yes") PORT_CODE(KEYCODE_F1) // combine for NEW GAME
|
||||
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("No") PORT_CODE(KEYCODE_F1) // "
|
||||
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position")
|
||||
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Hint / Info")
|
||||
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_CODE(KEYCODE_B) PORT_NAME("Fwd / Black")
|
||||
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn")
|
||||
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Rook")
|
||||
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("King")
|
||||
|
||||
PORT_START("IN.1")
|
||||
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Option")
|
||||
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level")
|
||||
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Tutorial")
|
||||
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Say Again")
|
||||
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_W) PORT_NAME("Back / White")
|
||||
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Knight")
|
||||
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop")
|
||||
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen")
|
||||
|
||||
PORT_START("IN.2")
|
||||
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, chessac_state, go_button, 0) PORT_NAME("Go / Stop")
|
||||
PORT_BIT(0xef, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("CLICKABLE") // helper for clickable artwork
|
||||
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
Machine Configs
|
||||
*******************************************************************************/
|
||||
|
||||
void chessac_state::chessac(machine_config &config)
|
||||
{
|
||||
// basic machine hardware
|
||||
H83214(config, m_maincpu, 16_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &chessac_state::main_map);
|
||||
m_maincpu->nvram_enable_backup(true);
|
||||
m_maincpu->standby_cb().set(m_maincpu, FUNC(h83214_device::nvram_set_battery));
|
||||
m_maincpu->standby_cb().append(FUNC(chessac_state::standby));
|
||||
m_maincpu->write_port1().set(FUNC(chessac_state::lcd_segs_w<1>));
|
||||
m_maincpu->write_port2().set(FUNC(chessac_state::lcd_segs_w<0>));
|
||||
m_maincpu->write_port3().set(FUNC(chessac_state::p3_w));
|
||||
m_maincpu->read_port4().set(FUNC(chessac_state::p4_r));
|
||||
m_maincpu->write_port5().set(FUNC(chessac_state::p5_w));
|
||||
m_maincpu->read_port6().set_ioport("IN.2").invert();
|
||||
m_maincpu->write_port6().set(FUNC(chessac_state::p6_w));
|
||||
m_maincpu->read_port7().set(FUNC(chessac_state::p7_r));
|
||||
m_maincpu->write_port7().set(FUNC(chessac_state::p7_w));
|
||||
|
||||
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(150));
|
||||
//m_board->set_nvram_enable(true);
|
||||
|
||||
// video hardware
|
||||
PWM_DISPLAY(config, m_lcd_pwm).set_size(2, 24);
|
||||
m_lcd_pwm->output_x().set(FUNC(chessac_state::lcd_pwm_w));
|
||||
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
|
||||
screen.set_refresh_hz(60);
|
||||
screen.set_size(1920/5, 804/5);
|
||||
screen.set_visarea_full();
|
||||
|
||||
PWM_DISPLAY(config, m_led_pwm).set_size(8, 8);
|
||||
config.set_default_layout(layout_saitek_chessac);
|
||||
|
||||
// sound hardware
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
|
||||
OKIM6588(config, m_okim6588, 4_MHz_XTAL).add_route(ALL_OUTPUTS, "speaker", 0.5);
|
||||
m_okim6588->write_mon().set_inputline(m_maincpu, INPUT_LINE_NMI).invert();
|
||||
m_okim6588->set_mcum_pin(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
ROM Definitions
|
||||
*******************************************************************************/
|
||||
|
||||
ROM_START( chessac )
|
||||
ROM_REGION( 0x8000, "maincpu", 0 )
|
||||
ROM_LOAD("97_saitek_86165400831_hd6433214a08f.u1", 0x0000, 0x8000, CRC(29d06d6a) SHA1(08b6f4093b240b0a34d9da67c9acffc576ba1d2d) )
|
||||
|
||||
ROM_REGION( 0x400000, "adpcm", 0 )
|
||||
ROM_LOAD("adpcm.u10", 0x000000, 0x400000, CRC(73d9650c) SHA1(ecf3bd72fc954528fa72f64eac91e225d11150c6) ) // no label
|
||||
|
||||
ROM_REGION( 68501, "screen", 0 )
|
||||
ROM_LOAD("gk2000.svg", 0, 68501, CRC(80554c49) SHA1(88f06ec8f403eaaf7cbce4cc84807b5742ce7108) )
|
||||
ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
Drivers
|
||||
*******************************************************************************/
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
|
||||
SYST( 1997, chessac, 0, 0, chessac, chessac, chessac_state, empty_init, "Saitek", "Kasparov Chess Academy", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
|
@ -11,7 +11,7 @@ same hardware.
|
||||
Hardware notes:
|
||||
- Hitachi H8/323 MCU, 20MHz XTAL
|
||||
- LCD with custom segments
|
||||
- piezo, 16 leds, button sensors chessboard
|
||||
- piezo, 16 LEDs, button sensors chessboard
|
||||
|
||||
A13 MCU is used in:
|
||||
- Saitek GK 2000 (86071220X12)
|
||||
|
@ -16,7 +16,7 @@ Hardware notes:
|
||||
- PCB label: ST9A-PE-001
|
||||
- Hitachi H8/325 MCU, 20MHz XTAL
|
||||
- Epson SED1502F, LCD screen (same as simultano)
|
||||
- piezo, 16+3 leds, button sensors chessboard
|
||||
- piezo, 16+3 LEDs, button sensors chessboard
|
||||
|
||||
In 1992, it was also sold by Tandy as Chess Champion 2150L, still manufactured
|
||||
by Saitek. Overall, the hardware is the same, but with a slower CPU (16MHz XTAL).
|
||||
|
Loading…
Reference in New Issue
Block a user