smchess/chesstrvi: add svg screen for lcd

This commit is contained in:
hap 2024-01-21 22:10:28 +01:00
parent 87d7f1e205
commit 5aca2139f6
7 changed files with 56 additions and 93 deletions

View File

@ -1,6 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Sandro Ronco, hap
// thanks-to:yoyo_chessboard
/*******************************************************************************
Mephisto Academy

View File

@ -8,7 +8,7 @@ license:CC0-1.0
<element name="black"><rect><color red="0.17" green="0.17" blue="0.17" /></rect></element>
<element name="white"><rect><color red="0.85" green="0.85" blue="0.85" /></rect></element>
<element name="lcdm"><rect><color red="0.7" green="0.71" blue="0.72" /></rect></element>
<element name="lcdm"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
<element name="hlb" defstate="0">
<rect state="0"><color alpha="0" /></rect>

View File

@ -9,9 +9,10 @@ license:CC0-1.0
<!-- define elements -->
<element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
<element name="black2"><rect><color red="0.12" green="0.12" blue="0.12" /></rect></element>
<element name="black2"><rect><color red="0.2" green="0.2" blue="0.2" /></rect></element>
<element name="white"><rect><color red="0.8" green="0.8" blue="0.8" /></rect></element>
<element name="white2"><rect><color red="0.75" green="0.76" blue="0.78" /></rect></element>
<element name="lcdm"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
<element name="button" defstate="0">
<rect state="0"><color red="0.26" green="0.25" blue="0.25" /></rect>
@ -56,29 +57,6 @@ license:CC0-1.0
<element name="text_p6"><image file="chess/wp.svg"><color alpha="0.87" /></image></element>
<!-- digits -->
<element name="lcd_bg"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
<element name="digit" defstate="0">
<led7seg><color red="0.2" green="0.16" blue="0.16" /></led7seg>
</element>
<element name="seg0" defstate="0">
<text state="1" string="COMPUTING"><color red="0.2" green="0.16" blue="0.16" /></text>
<text state="0" string="COMPUTING"><color red="0.49412" green="0.51765" blue="0.51765" /></text>
</element>
<group name="digits">
<bounds x="18" y="23.5" width="74" height="27.5" />
<element ref="lcd_bg"><bounds x="18" y="23.5" width="74" height="27.5" /></element>
<element name="computing" ref="seg0"><bounds x="40" y="25.7" width="30" height="4" /></element>
<element name="digit3" ref="digit"><bounds x="29.5" y="30" width="10" height="14" /></element>
<element name="digit2" ref="digit"><bounds x="40" y="30" width="10" height="14" /></element>
<element name="digit1" ref="digit"><bounds x="60" y="30" width="10" height="14" /></element>
<element name="digit0" ref="digit"><bounds x="70.5" y="30" width="10" height="14" /></element>
</group>
<!-- button panel -->
<group name="buttons">
@ -147,12 +125,14 @@ license:CC0-1.0
<!-- build screen -->
<view name="Internal Layout">
<bounds left="-0.775" right="31.775" top="20" bottom="39.3" />
<bounds left="-0.775" right="31.775" top="20.635" bottom="38.665" />
<element ref="white2"><bounds x="-0.775" y="20" width="32.55" height="7.7" /></element>
<element ref="black2"><bounds xc="15.5" yc="23.85" width="15.15" height="5.85" /></element>
<group ref="digits"><bounds xc="15.5" yc="23.85" width="15" height="5.7" /></group>
<group ref="buttons"><bounds x="-1" y="28.5" width="32" height="10.1" /></group>
<element ref="white2"><bounds x="-0.775" y="20.635" width="32.55" height="6.43" /></element>
<element ref="black2"><bounds xc="15.5" yc="23.85" width="15.15" height="4.58" /></element>
<screen index="0"><bounds xc="15.5" yc="23.85" width="15" height="4.43" /></screen>
<element ref="lcdm" blend="multiply"><bounds xc="15.5" yc="23.85" width="15.15" height="4.58" /></element>
<group ref="buttons"><bounds x="-1" y="27.865" width="32" height="10.1" /></group>
</view>
</mamelayout>

View File

@ -11,6 +11,7 @@ license:CC0-1.0
<element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
<element name="white"><rect><color red="0.8" green="0.8" blue="0.8" /></rect></element>
<element name="gray"><rect><color red="0.25" green="0.25" blue="0.25" /></rect></element>
<element name="lcdm"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
<element name="button" defstate="0">
<rect state="0"><color red="0.8" green="0.8" blue="0.8" /></rect>
@ -64,57 +65,13 @@ license:CC0-1.0
<element name="text_p6"><image file="chess/wp.svg"><color alpha="0.87" /></image></element>
<!-- lcd -->
<element name="lcd_bg"><rect><color red="0.54" green="0.57" blue="0.58" /></rect></element>
<element name="digit" defstate="0">
<led7seg><color red="0.2" green="0.16" blue="0.16" /></led7seg>
</element>
<element name="seg0" defstate="0">
<text state="1" string="COMPUTING"><color red="0.2" green="0.16" blue="0.16" /></text>
<text state="0" string="COMPUTING"><color red="0.49412" green="0.51765" blue="0.51765" /></text>
</element>
<element name="seg1" defstate="0">
<text state="1" string="FIND POSITION" align="2"><color red="0.2" green="0.16" blue="0.16" /></text>
<text state="0" string="FIND POSITION" align="2"><color red="0.49412" green="0.51765" blue="0.51765" /></text>
</element>
<element name="seg2" defstate="0">
<text state="1" string="x"><color red="0.2" green="0.16" blue="0.16" /></text>
<text state="0" string="x"><color red="0.49412" green="0.51765" blue="0.51765" /></text>
</element>
<element name="seg3" defstate="0">
<text state="1" string="+"><color red="0.2" green="0.16" blue="0.16" /></text>
<text state="0" string="+"><color red="0.49412" green="0.51765" blue="0.51765" /></text>
</element>
<element name="seg4" defstate="0">
<text state="1" string="I LOSE" align="1"><color red="0.2" green="0.16" blue="0.16" /></text>
<text state="0" string="I LOSE" align="1"><color red="0.49412" green="0.51765" blue="0.51765" /></text>
</element>
<group name="lcd">
<bounds x="18" y="23.5" width="74" height="27.5" />
<element ref="lcd_bg"><bounds x="18" y="23.5" width="74" height="27.5" /></element>
<!-- note: it also has a lightning symbol for low-battery at the left, but is unused -->
<element name="1.7" ref="seg2"><bounds x="50.1" y="31.4" width="10" height="15" /></element>
<element name="3.7" ref="seg3"><bounds x="81.1" y="28.1" width="10" height="16" /></element>
<element name="0.7" ref="seg1"><bounds x="22" y="44.3" width="28" height="4" /></element>
<element name="2.7" ref="seg4"><bounds x="71" y="44.3" width="13" height="4" /></element>
<element name="computing" ref="seg0"><bounds x="40" y="25.7" width="30" height="4" /></element>
<element name="digit0" ref="digit"><bounds x="29.5" y="30" width="10" height="14" /></element>
<element name="digit1" ref="digit"><bounds x="40" y="30" width="10" height="14" /></element>
<element name="digit2" ref="digit"><bounds x="60" y="30" width="10" height="14" /></element>
<element name="digit3" ref="digit"><bounds x="70.5" y="30" width="10" height="14" /></element>
</group>
<!-- build screen -->
<view name="Internal Layout">
<bounds left="8" right="27.6" top="13.5" bottom="46.9" />
<group ref="lcd"><bounds x="8" y="13.5" width="19.6" height="7.28378" /></group>
<bounds left="8" right="27.6" top="15" bottom="46.9" />
<screen index="0"><bounds x="8" y="15" width="19.6" height="5.788" /></screen>
<element ref="lcdm" blend="multiply"><bounds x="7.5" y="14.5" width="21" height="7" /></element>
<!-- buttons -->
<element ref="gray"><bounds x="10.02" y="24.975" width="3.56" height="0.95" /></element>

View File

@ -41,17 +41,17 @@ closer to 6MHz. This was confirmed by hooking up a 6MHz XTAL, taking around
Both chesscomputers have a cheap RC circuit for the MCU clock, it seems that
electronically measuring them affected the frequency.
TODO:
- add low-battery indicator? useless since it's not software-controlled
*******************************************************************************/
#include "emu.h"
#include "cpu/f8/f8.h"
#include "machine/f3853.h"
#include "machine/timer.h"
#include "video/pwm.h"
#include "screen.h"
// internal artwork
#include "saitek_chesstrv.lh"
#include "saitek_chesstrvi.lh"
@ -74,6 +74,9 @@ public:
void chesstrv(machine_config &config);
void chesstrvi(machine_config &config);
// battery status indicator is not software controlled
DECLARE_INPUT_CHANGED_MEMBER(battery) { update_display(); }
protected:
virtual void machine_start() override;
@ -83,7 +86,7 @@ private:
required_device<pwm_display_device> m_display;
optional_device<timer_device> m_comp_timer;
output_finder<> m_computing;
required_ioport_array<4> m_inputs;
required_ioport_array<5> m_inputs;
std::unique_ptr<u8[]> m_ram;
u8 m_ram_address = 0;
@ -125,11 +128,10 @@ void chesstrv_state::machine_start()
I/O
*******************************************************************************/
// F3870 ports
void chesstrv_state::update_display()
{
m_display->matrix(~m_inp_mux, m_7seg_data);
u8 battery = m_inputs[4]->read() << 7 & 0x80;
m_display->matrix(~m_inp_mux, m_7seg_data | battery);
}
void chesstrv_state::digit_w(u8 data)
@ -219,6 +221,11 @@ static INPUT_PORTS_START( chesstrv )
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MM") // multi move
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("IN.4")
PORT_CONFNAME( 0x01, 0x00, "Battery Status" ) PORT_CHANGED_MEMBER(DEVICE_SELF, chesstrv_state, battery, 0)
PORT_CONFSETTING( 0x01, "Low" )
PORT_CONFSETTING( 0x00, DEF_STR( Normal ) )
INPUT_PORTS_END
static INPUT_PORTS_START( chesstrvi )
@ -254,8 +261,9 @@ void chesstrv_state::chesstrv(machine_config &config)
psu.write_b().set(FUNC(chesstrv_state::matrix_w));
// video hardware
PWM_DISPLAY(config, m_display).set_size(4, 7);
PWM_DISPLAY(config, m_display).set_size(4, 8);
m_display->set_segmask(0xf, 0x7f);
m_display->set_segmask(0x1, 0xff); // DP for low battery
config.set_default_layout(layout_saitek_chesstrv);
}
@ -269,6 +277,12 @@ void chesstrv_state::chesstrvi(machine_config &config)
TIMER(config, m_comp_timer).configure_generic(FUNC(chesstrv_state::computing));
config.set_default_layout(layout_saitek_chesstrvi);
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/2, 567/2);
screen.set_visarea_full();
}
@ -285,6 +299,9 @@ ROM_END
ROM_START( chesstrvi )
ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD("sl90594.u3", 0x0000, 0x0800, CRC(9162e89a) SHA1(c3f71365b73b0112aae09f11722bd78186c78408) )
ROM_REGION( 48655, "screen", 0 )
ROM_LOAD("chesstrvi.svg", 0, 48655, CRC(13aa3a99) SHA1(6ea2c55dc8c617532455c4754da9bcc5cad170e2) )
ROM_END
} // anonymous namespace

View File

@ -26,10 +26,13 @@ It works on the old A34 MCU because the game keeps reading D0 while computing.
*******************************************************************************/
#include "emu.h"
#include "cpu/hmcs40/hmcs40.h"
#include "machine/timer.h"
#include "sound/dac.h"
#include "video/pwm.h"
#include "screen.h"
#include "speaker.h"
// internal artwork
@ -189,10 +192,14 @@ void mini_state::smchess(machine_config &config)
PWM_DISPLAY(config, m_display).set_size(4, 8);
m_display->set_segmask(0xf, 0x7f);
m_display->set_refresh(attotime::from_hz(30));
config.set_default_layout(layout_saitek_minichess);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/2.5, 567/2.5);
screen.set_visarea_full();
TIMER(config, m_comp_timer).configure_generic(FUNC(mini_state::computing));
config.set_default_layout(layout_saitek_minichess);
}
@ -204,6 +211,9 @@ void mini_state::smchess(machine_config &config)
ROM_START( smchess )
ROM_REGION( 0x2000, "maincpu", 0 )
ROM_LOAD("44801a34_proj_t", 0x0000, 0x2000, CRC(be71f1c0) SHA1(6b4d5c8f8491c82bdec1938bd83c14e826ff3e30) )
ROM_REGION( 48645, "screen", 0 )
ROM_LOAD("smchess.svg", 0, 48645, CRC(19beaa99) SHA1(2d738bd6953dfd7a2c8c37814badd0aac2960c8c) )
ROM_END
} // anonymous namespace

View File

@ -339,14 +339,14 @@ void omar2_state::omar2(machine_config &config)
m_psu->write_b().append(FUNC(omar2_state::display4_w));
// video hardware
PWM_DISPLAY(config.replace(), m_display).set_size(1, 32);
m_display->set_bri_levels(0.25);
config.set_default_layout(layout_omar2);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1920/2.5, 412/2.5);
screen.set_visarea_full();
PWM_DISPLAY(config.replace(), m_display).set_size(1, 32);
m_display->set_bri_levels(0.25);
config.set_default_layout(layout_omar2);
}