leonardo/renaissa: add nvram

This commit is contained in:
hap 2023-11-11 14:01:16 +01:00
parent 9b695f8b09
commit 4f9c947633
6 changed files with 101 additions and 64 deletions

View File

@ -478,13 +478,8 @@ license:CC0-1.0
<rect state="0"><color red="0.21" green="0.2" blue="0.2" /></rect>
<rect state="1"><color red="0.34" green="0.33" blue="0.33" /></rect>
</element>
<element name="butd" defstate="0">
<disk state="0"><color red="0.21" green="0.2" blue="0.2" /></disk>
<disk state="1"><color red="0.34" green="0.33" blue="0.33" /></disk>
</element>
<element name="text_l01"><text string="ACL" align="1"/></element>
<element name="text_l02"><text string="MODE" align="1"/></element>
<element name="text_l01"><text string="MODE" align="1"/></element>
<element name="text_l11"><text string="CHECK"/></element>
<element name="text_l12"><text string="END"/></element>
@ -522,8 +517,7 @@ license:CC0-1.0
<group name="panel">
<bounds x="0" y="0" width="55" height="13" />
<element ref="text_l01"><bounds x="41" y="0.4" width="5" height="1.3" /></element>
<element ref="text_l02"><bounds x="48" y="0.4" width="5" height="1.3" /></element>
<element ref="text_l01"><bounds x="48" y="0.4" width="5" height="1.3" /></element>
<element ref="text_l11"><bounds x="18.25" y="2.6" width="5.5" height="1.3" /></element>
<element ref="text_l12"><bounds x="22.25" y="2.6" width="5.5" height="1.3" /></element>
@ -591,8 +585,6 @@ license:CC0-1.0
<element name="8.7" ref="ledrr" blend="add"><bounds x="45" y="0.5" width="2" height="1" /></element>
<element name="9.7" ref="ledrg" blend="add"><bounds x="45" y="0.5" width="2" height="1" /></element>
<element ref="butd" inputtag="RESET" inputmask="0x02"><bounds x="39" y="0.5" width="1" height="1" /></element>
<element ref="but" inputtag="IN.0" inputmask="0x01"><bounds x="3" y="4" width="4" height="1" /></element>
<element ref="but" inputtag="IN.1" inputmask="0x02"><bounds x="12" y="4" width="4" height="1" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x02"><bounds x="30" y="4" width="4" height="1" /></element>
@ -659,7 +651,7 @@ license:CC0-1.0
<group ref="sb_ui"><bounds x="-12" y="3" width="10" height="80" /></group>
</view>
<view name="Internal Layout (Board)"><!-- chesscomputer has a wooden lid for covering bottom side -->
<view name="Internal Layout (Board)"> <!-- chesscomputer has a wooden lid for covering bottom side -->
<bounds left="-13" right="88" top="-1.5" bottom="87.5" />
<group ref="board"><bounds x="-1" y="-1.5" width="89" height="89" /></group>

View File

@ -467,10 +467,6 @@ license:CC0-1.0
<rect state="0"><color red="0.21" green="0.2" blue="0.2" /></rect>
<rect state="1"><color red="0.34" green="0.33" blue="0.33" /></rect>
</element>
<element name="butd" defstate="0">
<disk state="0"><color red="0.21" green="0.2" blue="0.2" /></disk>
<disk state="1"><color red="0.34" green="0.33" blue="0.33" /></disk>
</element>
<element name="text_ln1"><text string="1" align="2"/></element>
<element name="text_ln2"><text string="2" align="2"/></element>
@ -507,7 +503,6 @@ license:CC0-1.0
<element name="text_l011"><text string="Mode"/></element>
<element name="text_l012"><text string="Comm."/></element>
<element name="text_l013"><text string="Module"/></element>
<element name="text_l014"><text string="ACL"/></element>
<element name="text_l11"><text string="Color"/></element>
<element name="text_l11a"><text string="Tab/"/></element>
@ -609,7 +604,6 @@ license:CC0-1.0
<element ref="text_l011"><bounds x="50.25" y="4.1" width="5.5" height="1.3" /></element>
<element ref="text_l012"><bounds x="55.75" y="4.1" width="5.5" height="1.3" /></element>
<element ref="text_l013"><bounds x="61.25" y="4.1" width="5.5" height="1.3" /></element>
<element ref="text_l014"><bounds x="66.75" y="4.1" width="5.5" height="1.3" /></element>
<element ref="text_l11"><bounds x="22.5" y="8.6" width="6" height="1.3" /></element>
<element ref="text_l11a"><bounds x="22.5" y="7.4" width="6" height="1.3" /></element>
@ -680,8 +674,6 @@ license:CC0-1.0
<element name="8.7" ref="ledr" blend="add"><bounds x="52.25" y="5.5" width="1.5" height="1.5" /></element>
<element name="9.7" ref="ledg" blend="add"><bounds x="52.25" y="5.5" width="1.5" height="1.5" /></element>
<element ref="butd" inputtag="RESET" inputmask="0x02"><bounds x="69" y="5.75" width="1" height="1" /></element>
<element ref="but" inputtag="IN.0" inputmask="0x01"><bounds x="1.5" y="10" width="4" height="1" /></element>
<element ref="but" inputtag="IN.0" inputmask="0x02"><bounds x="7.0" y="10" width="4" height="1" /></element>
<element ref="but" inputtag="IN.0" inputmask="0x04"><bounds x="12.5" y="10" width="4" height="1" /></element>
@ -746,7 +738,7 @@ license:CC0-1.0
<group ref="sb_ui"><bounds x="-12" y="3" width="10" height="80" /></group>
</view>
<view name="Internal Layout (Board)"><!-- chesscomputer has a wooden lid for covering bottom side -->
<view name="Internal Layout (Board)"> <!-- chesscomputer has a wooden lid for covering bottom side -->
<bounds left="-13" right="88" top="-1.5" bottom="87.5" />
<group ref="board"><bounds x="-1" y="-1.5" width="89" height="89" /></group>

View File

@ -487,17 +487,12 @@ license:CC0-1.0
<rect state="0"><color red="0.21" green="0.2" blue="0.2" /></rect>
<rect state="1"><color red="0.34" green="0.33" blue="0.33" /></rect>
</element>
<element name="butd" defstate="0">
<disk state="0"><color red="0.21" green="0.2" blue="0.2" /></disk>
<disk state="1"><color red="0.34" green="0.33" blue="0.33" /></disk>
</element>
<element name="text_l01"><text string="ACL"/></element>
<element name="text_l02"><text string="WHITE"/></element>
<element name="text_l03"><text string="BLACK"/></element>
<element name="text_l04"><text string="MODE"/></element>
<element name="text_l05"><text string="COMM"/></element>
<element name="text_l06"><text string="MODULE"/></element>
<element name="text_l01"><text string="WHITE"/></element>
<element name="text_l02"><text string="BLACK"/></element>
<element name="text_l03"><text string="MODE"/></element>
<element name="text_l04"><text string="COMM"/></element>
<element name="text_l05"><text string="MODULE"/></element>
<element name="text_l11"><text string="TAB/COLOR"/></element>
<element name="text_l12"><text string="FUNCTION"/></element>
@ -530,12 +525,11 @@ license:CC0-1.0
<group name="panel">
<bounds x="0" y="0" width="38" height="14" />
<element ref="text_l01"><bounds x="9.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l02"><bounds x="13.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l03"><bounds x="18" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l04"><bounds x="22.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l05"><bounds x="27" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l06"><bounds x="31.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l01"><bounds x="13.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l02"><bounds x="18" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l03"><bounds x="22.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l04"><bounds x="27" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l05"><bounds x="31.5" y="0.1" width="5" height="1.3" /></element>
<element ref="text_l11"><bounds x="12.25" y="3.6" width="5.5" height="1.3" /></element>
<element ref="text_l12"><bounds x="17.5" y="3.6" width="5.5" height="1.3" /></element>
@ -574,8 +568,6 @@ license:CC0-1.0
<element name="9.2" ref="ledr"><bounds x="28.5" y="1.5" width="2" height="1" /></element>
<element name="9.3" ref="ledr"><bounds x="33" y="1.5" width="2" height="1" /></element>
<element ref="butd" inputtag="RESET" inputmask="0x02"><bounds x="11.5" y="1.5" width="1" height="1" /></element>
<element ref="but" inputtag="IN.0" inputmask="0x01"><bounds x="0" y="5" width="4" height="1" /></element>
<element ref="but" inputtag="IN.1" inputmask="0x02"><bounds x="5" y="5" width="4" height="1" /></element>
<element ref="but" inputtag="IN.2" inputmask="0x02"><bounds x="13" y="5" width="4" height="1" /></element>
@ -678,7 +670,7 @@ license:CC0-1.0
<group ref="sb_ui"><bounds x="-12" y="3" width="10" height="80" /></group>
</view>
<view name="Internal Layout (Board)"><!-- chesscomputer has a wooden lid for covering bottom side -->
<view name="Internal Layout (Board)"> <!-- chesscomputer has a wooden lid for covering bottom side -->
<bounds left="-13" right="88" top="-1.5" bottom="87.5" />
<group ref="board"><bounds x="-1" y="-1.5" width="89" height="89" /></group>

View File

@ -13,6 +13,7 @@
Note:
- 4 lines display has an custom LCD controller derived from an HD66780
- NVRAM works only if the machine is turned off (with OFF menu) before closing MAME
- psion1 goes into standby right after a cold boot, so press the ON button
More info:
http://archive.psion2.org/org2/techref/index.htm
@ -46,7 +47,7 @@ uint8_t psion_state::kb_read()
}
else
{
//Read all the input lines
// Read all the input lines
for (int line = 0; line < 7; line++)
data &= m_kb_lines[line]->read();
}
@ -605,8 +606,8 @@ void psion1_state::psion1(machine_config &config)
psion_2lines(config);
HD6301X0(config.replace(), m_maincpu, 3.6864_MHz_XTAL);
m_maincpu->nvram_enable_backup(true);
m_maincpu->set_addrmap(AS_PROGRAM, &psion1_state::psion1_mem);
m_maincpu->nvram_enable_backup(true);
m_maincpu->in_p2_cb().set(FUNC(psion1_state::port2_r));
m_maincpu->out_p2_cb().set(FUNC(psion1_state::port2_w));
m_maincpu->in_p5_cb().set(FUNC(psion1_state::port5_r));

View File

@ -14,6 +14,11 @@ The expansion modules are basically entire chesscomputers, making the whole
thing combined a 'dual brain' chesscomputer. The embedded chess engine is by
Julio Kaplan and Craig Barnes, same as the one in SciSys Turbo S-24K.
NOTE: In order for nvram to work properly, press the STOP button to turn off
the chesscomputer before exiting MAME. Other than ACL (which is an unemulated
hardware button that disconnects the battery), there is no known method to
force a cold boot. So if nvram somehow becomes broken, remove the nvram files.
Hardware notes:
Leonardo (1986):
@ -50,8 +55,7 @@ to be upgraded with an EMI PCB (power supply related, meaningless for emulation)
TODO:
- OSA PC link, uses MCU serial interface
- add nvram (MCU port $14?)
- add power-off, not useful with missing nvram support
- MCU internal nvram belongs in m6801.cpp
*******************************************************************************/
@ -60,6 +64,7 @@ TODO:
#include "bus/saitek_osa/expansion.h"
#include "cpu/m6800/m6801.h"
#include "machine/input_merger.h"
#include "machine/nvram.h"
#include "machine/sensorboard.h"
#include "sound/spkrdev.h"
#include "video/pwm.h"
@ -87,6 +92,8 @@ public:
m_inputs(*this, "IN.%u", 0)
{ }
DECLARE_INPUT_CHANGED_MEMBER(go_button);
void leonardo(machine_config &config);
void leonardoa(machine_config &config);
void galileo(machine_config &config);
@ -107,6 +114,7 @@ private:
void main_map(address_map &map);
void standby(int state);
void update_display();
void mux_w(u8 data);
void leds_w(u8 data);
@ -135,17 +143,35 @@ void leo_state::machine_start()
save_item(NAME(m_led_data));
}
void leo_state::machine_reset()
{
m_stb->in_clear<0>();
}
/*******************************************************************************
I/O
*******************************************************************************/
// power
void leo_state::machine_reset()
{
m_stb->in_clear<0>();
}
void leo_state::standby(int state)
{
if (state)
m_display->clear();
}
INPUT_CHANGED_MEMBER(leo_state::go_button)
{
if (newval && m_maincpu->standby())
{
machine_reset();
m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
}
}
// misc
void leo_state::update_display()
@ -267,8 +293,8 @@ void leo_state::main_map(address_map &map)
{
map(0x0000, 0x0027).m(m_maincpu, FUNC(hd6303y_cpu_device::hd6301y_io));
map(0x0002, 0x0002).rw(FUNC(leo_state::unk_r), FUNC(leo_state::unk_w)); // external
map(0x0040, 0x013f).ram(); // internal
map(0x4000, 0x5fff).ram();
map(0x0040, 0x013f).ram().share("internal"); // internal
map(0x4000, 0x5fff).ram().share("nvram");
map(0x6000, 0x6000).w(FUNC(leo_state::mux_w));
map(0x7000, 0x7000).w(FUNC(leo_state::leds_w));
map(0x8000, 0xffff).rom();
@ -329,8 +355,7 @@ static INPUT_PORTS_START( leonardo )
PORT_CONFSETTING( 0x04, DEF_STR( Normal ) )
PORT_START("RESET")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Go")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F1) PORT_NAME("ACL")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CHANGED_MEMBER(DEVICE_SELF, leo_state, go_button, 0) PORT_NAME("Go")
INPUT_PORTS_END
static INPUT_PORTS_START( galileo ) // same buttons, but different locations
@ -363,7 +388,7 @@ static INPUT_PORTS_START( galileo ) // same buttons, but different locations
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Set Up")
PORT_MODIFY("RESET")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Go")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, leo_state, go_button, 0) PORT_NAME("Go")
INPUT_PORTS_END
@ -377,6 +402,8 @@ void leo_state::leonardo(machine_config &config)
// basic machine hardware
HD6303Y(config, m_maincpu, 12_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &leo_state::main_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(FUNC(leo_state::standby));
m_maincpu->in_p2_cb().set(FUNC(leo_state::p2_r));
m_maincpu->out_p2_cb().set(FUNC(leo_state::p2_w));
m_maincpu->in_p5_cb().set(FUNC(leo_state::p5_r));
@ -389,9 +416,13 @@ void leo_state::leonardo(machine_config &config)
config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "internal", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
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_display).set_size(8+2, 8+2);

View File

@ -8,6 +8,10 @@ Saitek Kasparov Renaissance
Saitek's 2nd version modular chesscomputer. It accepts the same modules as
Leonardo/Galileo. "OSA" version for Renaissance is 1.5.
NOTE: In order for nvram to work properly, press the STOP button to turn off
the chesscomputer before exiting MAME. Unlike Leonardo/Galileo, it looks like
it will always do a cold boot if you reset without having pressed STOP.
Hardware notes:
- 6301Y0(mode 1) or HD6303YP MCU @ 10MHz
- 8KB RAM, 32KB ROM
@ -35,6 +39,7 @@ TODO:
#include "bus/saitek_osa/expansion.h"
#include "cpu/m6800/m6801.h"
#include "machine/input_merger.h"
#include "machine/nvram.h"
#include "machine/sensorboard.h"
#include "sound/spkrdev.h"
#include "video/pwm.h"
@ -68,8 +73,8 @@ public:
{ }
template <int N> DECLARE_INPUT_CHANGED_MEMBER(change_view);
DECLARE_INPUT_CHANGED_MEMBER(go_button);
// machine configs
void ren(machine_config &config);
protected:
@ -94,6 +99,7 @@ private:
void lcd_pwm_w(offs_t offset, u8 data);
void lcd_output_w(offs_t offset, u64 data);
void standby(int state);
void update_display();
void mux_w(u8 data);
void leds_w(u8 data);
@ -124,11 +130,6 @@ void ren_state::machine_start()
save_item(NAME(m_led_data));
}
void ren_state::machine_reset()
{
m_stb->in_clear<0>();
}
template <int N> INPUT_CHANGED_MEMBER(ren_state::change_view)
{
if (oldval && !newval)
@ -145,6 +146,29 @@ template <int N> INPUT_CHANGED_MEMBER(ren_state::change_view)
I/O
*******************************************************************************/
// power
void ren_state::machine_reset()
{
m_stb->in_clear<0>();
}
void ren_state::standby(int state)
{
if (state)
m_display->clear();
}
INPUT_CHANGED_MEMBER(ren_state::go_button)
{
if (newval && m_maincpu->standby())
{
machine_reset();
m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
}
}
// LCD
void ren_state::lcd_pwm_w(offs_t offset, u8 data)
@ -154,7 +178,7 @@ void ren_state::lcd_pwm_w(offs_t offset, u8 data)
void ren_state::lcd_output_w(offs_t offset, u64 data)
{
m_lcd_pwm->write_row(offset, data);
m_lcd_pwm->write_row(offset, m_maincpu->standby() ? 0 : data);
}
@ -283,11 +307,11 @@ void ren_state::p6_w(u8 data)
void ren_state::main_map(address_map &map)
{
map(0x0000, 0x0027).m(m_maincpu, FUNC(hd6303y_cpu_device::hd6301y_io));
map(0x0040, 0x013f).ram(); // internal
map(0x0040, 0x013f).ram().share("internal"); // internal
map(0x2000, 0x2000).w(FUNC(ren_state::mux_w));
map(0x2400, 0x2400).w(FUNC(ren_state::leds_w));
map(0x2600, 0x2600).rw(FUNC(ren_state::control_r), FUNC(ren_state::control_w));
map(0x4000, 0x5fff).ram();
map(0x4000, 0x5fff).ram().share("nvram");
map(0x6000, 0x607f).w("lcd", FUNC(sed1502_device::write));
map(0x8000, 0xffff).rom();
}
@ -345,8 +369,7 @@ static INPUT_PORTS_START( ren )
PORT_CONFSETTING( 0x00, DEF_STR( Normal ) )
PORT_START("RESET")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Go")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F1) PORT_NAME("ACL")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, ren_state, go_button, 0) PORT_NAME("Go")
PORT_START("VIEW")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CHANGED_MEMBER(DEVICE_SELF, ren_state, change_view<+1>, 0)
@ -364,6 +387,8 @@ void ren_state::ren(machine_config &config)
// basic machine hardware
HD6303Y(config, m_maincpu, 10_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &ren_state::main_map);
m_maincpu->nvram_enable_backup(true);
m_maincpu->standby_cb().set(FUNC(ren_state::standby));
m_maincpu->in_p2_cb().set(FUNC(ren_state::p2_r));
m_maincpu->out_p2_cb().set(FUNC(ren_state::p2_w));
m_maincpu->in_p5_cb().set(FUNC(ren_state::p5_r));
@ -376,9 +401,13 @@ void ren_state::ren(machine_config &config)
config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "internal", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
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
SED1502(config, m_lcd, 32768).write_segs().set(FUNC(ren_state::lcd_output_w));