summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2020-10-10 01:31:28 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2020-10-10 01:31:28 +1100
commit7ae53fff264c9d4c75a06a2edebd5346590e138b (patch)
tree18ab74341abedc5da96e97b48d697e58102aa84a
parent0590cd598a32e15b97eb1a8ad3303652822e79d8 (diff)
ut88mini: removed anonymous timer; fixed keyboard; fixed data display
-rw-r--r--src/mame/drivers/ut88.cpp42
-rw-r--r--src/mame/includes/ut88.h8
-rw-r--r--src/mame/machine/ut88.cpp13
3 files changed, 28 insertions, 35 deletions
diff --git a/src/mame/drivers/ut88.cpp b/src/mame/drivers/ut88.cpp
index a7d19ec4ccd..fd83840838f 100644
--- a/src/mame/drivers/ut88.cpp
+++ b/src/mame/drivers/ut88.cpp
@@ -13,12 +13,12 @@ Need instructions...
When started you enter a one-key command, followed by whatever parameters
are needed.
-Pressing 1 will allow entry of bytes into RAM, however the system doesn't
-allow you to view memory (afaik).
+Pressing 1 will allow entry of bytes into RAM.
Command 3 does a test of the display, however the rest are a mystery.
-Paste facility was tested but doesn't work, so all code remnants removed.
+Paste facility was tested but doesn't work, because keyboard response is
+too slow.
****************************************************************************/
@@ -157,27 +157,27 @@ INPUT_PORTS_END
static INPUT_PORTS_START( ut88mini )
PORT_START("LINE0")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CHAR('2')
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CHAR('5')
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CHAR('6')
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CHAR('7')
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7')
PORT_START("LINE1")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CHAR('8')
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CHAR('9')
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8')
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
PORT_START("LINE2")
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR('V')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR('V')
INPUT_PORTS_END
const gfx_layout charlayout =
@@ -259,6 +259,7 @@ void ut88mini_state::ut88mini(machine_config &config)
/* video hardware */
config.set_default_layout(layout_ut88mini);
+ TIMER(config, "display_timer").configure_periodic(FUNC(ut88mini_state::display_timer), attotime::from_hz(60));
/* Cassette */
SPEAKER(config, "speaker").front_center();
@@ -284,6 +285,7 @@ ROM_END
ROM_START( ut88mini )
ROM_REGION( 0x0400, "maincpu", 0 )
ROM_LOAD( "ut88mini.rom", 0x0000, 0x0400, CRC(ce9213ee) SHA1(16b71b3051a800386d664dbcc5983b783475d0c6) ) // DD10,DD11 (0x200 each)
+ ROM_FILL(0x71,1,0x7e) // show content of ram address
ROM_REGION( 0x0200, "proms", 0 )
ROM_LOAD( "ut88key1.dd15", 0x0000, 0x0100, CRC(ecfe42c7) SHA1(d7f10bbb05934150c1a258db1c8b4eb65771af59) )
diff --git a/src/mame/includes/ut88.h b/src/mame/includes/ut88.h
index 8b7c2a85824..2e3edd16491 100644
--- a/src/mame/includes/ut88.h
+++ b/src/mame/includes/ut88.h
@@ -14,6 +14,7 @@
#include "sound/dac.h"
#include "machine/i8255.h"
#include "imagedev/cassette.h"
+#include "machine/timer.h"
#include "emupal.h"
class ut88_common : public driver_device
@@ -108,16 +109,11 @@ public:
private:
void machine_start() override;
void machine_reset() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ TIMER_DEVICE_CALLBACK_MEMBER(display_timer);
void io_map(address_map &map);
void mem_map(address_map &map);
- enum
- {
- TIMER_UPDATE_DISPLAY
- };
-
uint8_t keyboard_r();
void led_w(offs_t offset, uint8_t data);
diff --git a/src/mame/machine/ut88.cpp b/src/mame/machine/ut88.cpp
index 4c6fa1e2833..45116248dc6 100644
--- a/src/mame/machine/ut88.cpp
+++ b/src/mame/machine/ut88.cpp
@@ -25,14 +25,10 @@ static const uint8_t hex_to_7seg[16] =
/* Driver initialization */
-void ut88mini_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_DEVICE_CALLBACK_MEMBER(ut88mini_state::display_timer)
{
- if (id == TIMER_UPDATE_DISPLAY)
- {
- for (int i = 0; i < 6; i++)
- m_digits[i] = hex_to_7seg[m_lcd_digit[i]];
- timer_set(attotime::from_hz(60), TIMER_UPDATE_DISPLAY);
- }
+ for (u8 i = 0; i < 6; i++)
+ m_digits[i] = hex_to_7seg[m_lcd_digit[i]];
}
uint8_t ut88_state::ppi_portb_r()
@@ -123,7 +119,7 @@ uint8_t ut88mini_state::keyboard_r()
{
// This is real keyboard implementation
uint8_t *keyrom1 = m_proms->base();
- uint8_t *keyrom2 = m_proms->base()+100;
+ uint8_t *keyrom2 = m_proms->base()+0x100;
uint8_t key = keyrom2[m_io_line1->read()];
@@ -164,7 +160,6 @@ void ut88mini_state::led_w(offs_t offset, uint8_t data)
void ut88mini_state::machine_start()
{
m_digits.resolve();
- timer_set(attotime::from_hz(60), TIMER_UPDATE_DISPLAY);
save_item(NAME(m_lcd_digit));
}