summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-04-27 16:42:47 +0200
committer hap <happppp@users.noreply.github.com>2021-04-27 16:42:59 +0200
commitc351fc1da4dda7d776d51fc0a545f819776dd71a (patch)
tree90f0b3e32dffcb9bf98085b13846593ff076b0a1
parent0d5a46097ab32160b4da7e2c927c7bb36fd6041b (diff)
slc1: get rid of the fake double keyboard
-rw-r--r--src/mame/drivers/slc1.cpp153
-rw-r--r--src/mame/layout/lc80.lay16
-rw-r--r--src/mame/layout/slc1.lay61
-rw-r--r--src/mame/layout/slc1a.lay3
4 files changed, 77 insertions, 156 deletions
diff --git a/src/mame/drivers/slc1.cpp b/src/mame/drivers/slc1.cpp
index 22fdd38a2ac..75798ecdddd 100644
--- a/src/mame/drivers/slc1.cpp
+++ b/src/mame/drivers/slc1.cpp
@@ -5,52 +5,47 @@
2011-JUL-16 SLC1 skeleton driver [Robbbert]
2011-DEC-29 Working [Robbbert]
-http://www.jens-mueller.org/jkcemu/slc1.html
+reference: http://www.jens-mueller.org/jkcemu/slc1.html
-This computer is both a Z80 trainer, and a chess computer.
- The keyboard is different between the two, so
- we redefine it for your convenience.
+This computer is both a Z80 trainer, and a chess computer. The keyboard
+ is different between the two. So by default, the chess number buttons
+ are on the main keyboard, and the one for the trainer are on the numpad.
- There is no chess board attached. You supply your own
- and you sync the pieces and the computer instructions.
- The chess engine was copied from Fidelity's Sensory
- Chess Challenger 8.
+ There is no chess board attached. You supply your own and you sync the
+ pieces and the computer instructions. The chess engine was copied from
+ Fidelity's Sensory Chess Challenger 8.
- When started, it is in Chess mode. Press 11111 to switch to
- Trainer mode.
+ When started, it is in Chess mode. Press 11111 to switch to Trainer mode.
-Hardware
+Hardware:
4 Kbytes ROM in the address range 0000-0FFF
1 Kbyte RAM in the address range 5000-53ff (user area starts at 5100)
6-digit 7-segment display
Busy LED
Keyboard with 12 keys
-Keys:
+Trainer Keys:
0-7 : hexadecimal numbers
Shift then 0-7 : Hexadecimal 8-F (decimal points will appear)
ADR : enter an address to work with. After the 4 digits are entered,
the data at that address shows, and you can modify the data.
+ (inc) : Enter the data into memory, and increment the address by 1.
-Pasting doesn't work, but if it did...
-
Pasting:
0-7 : as is
- 8-F : H, then 0-7
- + : ^
- - : H^
- ADR : -
+ 8-F : X, then 0-7
+ + : O
+ - : XO
+ ADR : Z
Test Paste:
- [[[[[-510011^22^33^44^55^66^77^H8H8^H9H9^-5100
- Now press up-arrow to confirm the data has been entered.
+ 00000Z510011O22O33O44O55O66O77OX8X8OX9X9OZ5100
+ Now press O to confirm the data has been entered.
TODO:
- Make emulation more faithful, io_w doesn't make much sense from
a TTL wiring point of view.
- - Likewise, having 2 auto-switching input mappings is convenient,
- but not at all how the hardware works.
+ - Pasting doesn't work, probably too slow.
***************************************************************************/
@@ -71,8 +66,7 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_speaker(*this, "speaker")
- , m_chess_keyboard(*this, "X%u", 0U)
- , m_trainer_keyboard(*this, "Y%u", 0U)
+ , m_inputs(*this, "IN.%u", 0U)
, m_display(*this, "digit%u", 0U)
, m_busyled(*this, "busyled")
{ }
@@ -91,23 +85,17 @@ private:
void io_map(address_map &map);
u8 m_digit = 0;
- bool m_kbd_type = false;
required_device<cpu_device> m_maincpu;
required_device<speaker_sound_device> m_speaker;
- required_ioport_array<3> m_chess_keyboard;
- required_ioport_array<3> m_trainer_keyboard;
+ required_ioport_array<3> m_inputs;
output_finder<8> m_display;
output_finder<> m_busyled;
};
-
-
/***************************************************************************
-
Display
-
***************************************************************************/
void slc1_state::io_w(offs_t offset, u8 data)
@@ -138,54 +126,35 @@ void slc1_state::io_w(offs_t offset, u8 data)
m_display[m_digit] = segdata;
m_busyled = busyled;
-
- if (m_digit == 3)
- m_kbd_type = segdata;
}
/***************************************************************************
-
Keyboard
-
***************************************************************************/
u8 slc1_state::io_r(offs_t offset)
{
- u8 data = 0xff, upper = (offset >> 8) & 7;
+ u8 data = 0, upper = (offset >> 8) & 7;
- if (m_kbd_type)
- { // Trainer
- if (upper == 3)
- data &= m_trainer_keyboard[0]->read();
- else
- if (upper == 4)
- data &= m_trainer_keyboard[1]->read();
- else
- if (upper == 5)
- data &= m_trainer_keyboard[2]->read();
- }
- else
- { // Chess
+ if (1)
+ {
if (upper == 3)
- data &= m_chess_keyboard[0]->read();
+ data = m_inputs[0]->read();
else
if (upper == 4)
- data &= m_chess_keyboard[1]->read();
+ data = m_inputs[1]->read();
else
if (upper == 5)
- data &= m_chess_keyboard[2]->read();
+ data = m_inputs[2]->read();
}
- return data;
+ return data << 4 ^ 0xff;
}
-
/***************************************************************************
-
Machine
-
***************************************************************************/
void slc1_state::machine_start()
@@ -194,7 +163,6 @@ void slc1_state::machine_start()
m_busyled.resolve();
save_item(NAME(m_digit));
- save_item(NAME(m_kbd_type));
}
void slc1_state::machine_reset()
@@ -202,11 +170,8 @@ void slc1_state::machine_reset()
}
-
/***************************************************************************
-
Address Map
-
***************************************************************************/
void slc1_state::mem_map(address_map &map)
@@ -223,62 +188,32 @@ void slc1_state::io_map(address_map &map)
/**************************************************************************
-
Keyboard Layout
-
***************************************************************************/
static INPUT_PORTS_START( slc1 )
-// Chess Keyboard
- PORT_START("X0")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D4 T") PORT_CODE(KEYCODE_4)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3 L") PORT_CODE(KEYCODE_3)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2 S") PORT_CODE(KEYCODE_2)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A1 B") PORT_CODE(KEYCODE_1) PORT_CHAR('[')
-
- PORT_START("X1")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5 D") PORT_CODE(KEYCODE_5)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F6 K") PORT_CODE(KEYCODE_6)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G7") PORT_CODE(KEYCODE_7)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H8") PORT_CODE(KEYCODE_8)
-
- PORT_START("X2")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("St") PORT_CODE(KEYCODE_S)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
-
-// Trainer Keyboard
- PORT_START("Y0")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 B") PORT_CODE(KEYCODE_3) PORT_CHAR('3')
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 A") PORT_CODE(KEYCODE_2) PORT_CHAR('2')
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 9") PORT_CODE(KEYCODE_1) PORT_CHAR('1')
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 8") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
-
- PORT_START("Y1")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 C INS") PORT_CODE(KEYCODE_4) PORT_CHAR('4')
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 D DEL") PORT_CODE(KEYCODE_5) PORT_CHAR('5')
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 E BL") PORT_CODE(KEYCODE_6) PORT_CHAR('6')
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 F Go") PORT_CODE(KEYCODE_7) PORT_CHAR('7')
-
- PORT_START("Y2")
- PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Fu DP") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR('H')
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+-1 SS") PORT_CODE(KEYCODE_UP) PORT_CHAR('^')
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Seq BG") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ADR BP") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
+ PORT_START("IN.0")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D 4 / T / 3 B") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR('3')
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C 3 / L / 2 A") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2')
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B 2 / S / 1 9") PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A 1 / B / 0 8") PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0')
+
+ PORT_START("IN.1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E 5 / D / 4 C INS") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4')
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F 6 / K / 5 D DEL") PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5')
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G 7 / 6 E BL") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6')
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H 8 / 7 F GO") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
+
+ PORT_START("IN.2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C / Seq / BG") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A / +/- 1 / SS") PORT_CODE(KEYCODE_O) PORT_CHAR('O')
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("St / Fu / DP") PORT_CODE(KEYCODE_S) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CHAR('S')
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z / ADR / BP") PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR('Z')
INPUT_PORTS_END
/***************************************************************************
-
Machine driver
-
***************************************************************************/
void slc1_state::slc1(machine_config &config)
@@ -298,9 +233,7 @@ void slc1_state::slc1(machine_config &config)
/***************************************************************************
-
Game driver
-
***************************************************************************/
ROM_START(slc1)
diff --git a/src/mame/layout/lc80.lay b/src/mame/layout/lc80.lay
index b8bac66918a..abc69b916e3 100644
--- a/src/mame/layout/lc80.lay
+++ b/src/mame/layout/lc80.lay
@@ -30,32 +30,32 @@ license:CC0
<view name="Internal Layout">
<!-- OUT led -->
<element name="0.a" ref="green_led">
- <bounds x="0" y="5" width="5" height="5" />
+ <bounds x="-5" y="0" width="8" height="8" />
</element>
<!-- HALT led -->
<element name="halt" ref="red_led">
- <bounds x="0" y="15" width="5" height="5" />
+ <bounds x="-5" y="10" width="8" height="8" />
</element>
<!-- Led address display -->
<element name="digit6" ref="digit">
- <bounds x="10" y="0" width="18" height="24" />
+ <bounds x="10" y="0" width="18" height="26" />
</element>
<element name="digit5" ref="digit">
- <bounds x="28" y="0" width="18" height="24" />
+ <bounds x="28" y="0" width="18" height="26" />
</element>
<element name="digit4" ref="digit">
- <bounds x="46" y="0" width="18" height="24" />
+ <bounds x="46" y="0" width="18" height="26" />
</element>
<element name="digit3" ref="digit">
- <bounds x="64" y="0" width="18" height="24" />
+ <bounds x="64" y="0" width="18" height="26" />
</element>
<element name="digit2" ref="digit">
- <bounds x="82" y="0" width="18" height="24" />
+ <bounds x="82" y="0" width="18" height="26" />
</element>
<element name="digit1" ref="digit">
- <bounds x="100" y="0" width="18" height="24" />
+ <bounds x="100" y="0" width="18" height="26" />
</element>
</view>
</mamelayout>
diff --git a/src/mame/layout/slc1.lay b/src/mame/layout/slc1.lay
index c3e674a6589..5f5a09e5288 100644
--- a/src/mame/layout/slc1.lay
+++ b/src/mame/layout/slc1.lay
@@ -6,54 +6,43 @@ license:CC0
<!-- NOTE: no chesspieces simulation here -->
- <element name="g_led" defstate="0">
- <disk>
- <color red="0.0" green="0.75" blue="0.0" />
- </disk>
- </element>
- <element name="g_digit" defstate="0">
- <led7seg>
- <color red="0.75" green="0.5" blue="0.0" />
- </led7seg>
- </element>
- <element name="r_digit" defstate="0">
+ <element name="digit" defstate="0">
<led7seg>
- <color red="0.75" green="0.0" blue="0.0" />
+ <color red="0.4" green="1.0" blue="0" />
</led7seg>
</element>
- <element name="background">
- <rect>
- <bounds left="0" top="0" right="1" bottom="1" />
- <color red="0.0" green="0.0" blue="0.0" />
- </rect>
+
+ <element name="led" defstate="0">
+ <disk state="1">
+ <color red="1.0" green="0.0" blue="0.0" />
+ </disk>
+ <disk state="0">
+ <color red="0.15" green="0.0" blue="0.0" />
+ </disk>
</element>
- <view name="Default Layout">
- <!-- Black background -->
- <element ref="background">
- <bounds left="64" top="95" right="453" bottom="195" />
- </element>
- <element name="busy_led" ref="g_led">
- <bounds left="76" right="96" top="130" bottom="150" />
+ <view name="Internal Layout">
+ <element name="busy_led" ref="led">
+ <bounds x="110" y="36" width="8" height="8" />
</element>
- <element name="digit0" ref="r_digit">
- <bounds left="107" top="105" right="155" bottom="185" />
+ <element name="digit0" ref="digit">
+ <bounds x="10" y="0" width="18" height="26" />
</element>
- <element name="digit6" ref="r_digit">
- <bounds left="155" top="105" right="203" bottom="185" />
+ <element name="digit6" ref="digit">
+ <bounds x="28" y="0" width="18" height="26" />
</element>
- <element name="digit5" ref="r_digit">
- <bounds left="203" top="105" right="251" bottom="185" />
+ <element name="digit5" ref="digit">
+ <bounds x="46" y="0" width="18" height="26" />
</element>
- <element name="digit4" ref="r_digit">
- <bounds left="251" top="105" right="299" bottom="185" />
+ <element name="digit4" ref="digit">
+ <bounds x="64" y="0" width="18" height="26" />
</element>
- <element name="digit3" ref="g_digit">
- <bounds left="347" top="105" right="395" bottom="185" />
+ <element name="digit3" ref="digit">
+ <bounds x="82" y="0" width="18" height="26" />
</element>
- <element name="digit1" ref="g_digit">
- <bounds left="395" top="105" right="443" bottom="185" />
+ <element name="digit1" ref="digit">
+ <bounds x="100" y="0" width="18" height="26" />
</element>
</view>
</mamelayout>
diff --git a/src/mame/layout/slc1a.lay b/src/mame/layout/slc1a.lay
index 2fc5a5285f0..599058e7fea 100644
--- a/src/mame/layout/slc1a.lay
+++ b/src/mame/layout/slc1a.lay
@@ -9,7 +9,7 @@ license:CC0
<!-- define elements -->
<element name="digit" defstate="0">
- <led7seg><color red="1.0" green="0.1" blue="0.15" /></led7seg>
+ <led7seg><color red="0.4" green="1.0" blue="0" /></led7seg>
</element>
@@ -20,6 +20,5 @@ license:CC0
<element name="digit1" ref="digit"><bounds x="10" y="0" width="10" height="15" /></element>
<element name="digit2" ref="digit"><bounds x="20" y="0" width="10" height="15" /></element>
<element name="digit3" ref="digit"><bounds x="30" y="0" width="10" height="15" /></element>
-
</view>
</mamelayout>