summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/cpu/ht1130/ht1130.cpp42
-rw-r--r--src/devices/cpu/ht1130/ht1130.h16
-rw-r--r--src/mame/handheld/hh_ht11xx.cpp19
-rw-r--r--src/mame/saitek/edames.cpp1
4 files changed, 61 insertions, 17 deletions
diff --git a/src/devices/cpu/ht1130/ht1130.cpp b/src/devices/cpu/ht1130/ht1130.cpp
index 21cf784a251..34102819e84 100644
--- a/src/devices/cpu/ht1130/ht1130.cpp
+++ b/src/devices/cpu/ht1130/ht1130.cpp
@@ -39,18 +39,20 @@ ht1130_device::ht1130_device(const machine_config &mconfig, device_type type, co
, m_port_in_ps(*this, 0xff)
, m_port_in_pp(*this, 0xff)
, m_port_out_pa(*this)
- , m_display_data_out(*this)
+ , m_segment_out(*this)
{
}
ht1130_device::ht1130_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: ht1130_device(mconfig, HT1130, tag, owner, clock, address_map_constructor(FUNC(ht1130_device::internal_data_map), this))
{
+ m_compins = 4;
}
ht1190_device::ht1190_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: ht1130_device(mconfig, HT1190, tag, owner, clock, address_map_constructor(FUNC(ht1190_device::internal_data_map_ht1190), this))
{
+ m_compins = 8;
}
std::unique_ptr<util::disasm_interface> ht1130_device::create_disassembler()
@@ -79,9 +81,6 @@ inline void ht1130_device::tempram_w(offs_t offset, u8 data)
inline void ht1130_device::displayram_w(offs_t offset, u8 data)
{
m_displayram[offset] = data & 0xf;
-
- // there might be a better way to do this
- m_display_data_out(offset, m_displayram[offset]);
}
inline void ht1130_device::setreg(u8 which, u8 data)
@@ -191,11 +190,44 @@ void ht1190_device::internal_data_map_ht1190(address_map &map)
map(0xb0, 0xff).ram().w(FUNC(ht1190_device::displayram_w)).share(m_displayram);
}
+void ht1130_device::init_lcd()
+{
+ m_lcd_timer = timer_alloc(FUNC(ht1130_device::update_lcd), this);
+
+ // LCD refresh rate is ~64Hz (not affected by system OSC)
+ attotime period = attotime::from_hz(64 * m_compins);
+ m_lcd_timer->adjust(period, 0, period);
+}
+
+TIMER_CALLBACK_MEMBER(ht1130_device::update_lcd)
+{
+ // prepare SEG data
+ u64 segs = 0;
+ for (int i = 0; i < 0x20; i++)
+ segs = segs << 1 | BIT(m_displayram[i ^ 0x1f], m_comcount & 3);
+
+ m_segment_out(m_comcount, m_inhalt ? 0 : segs);
+ m_comcount = (m_comcount + 1) % m_compins;
+}
+
+TIMER_CALLBACK_MEMBER(ht1190_device::update_lcd)
+{
+ // prepare SEG data
+ u64 segs = 0;
+ for (int i = 0; i < 40; i++)
+ segs = segs << 1 | BIT(m_displayram[(i << 1) | (m_comcount >> 2)], m_comcount & 3);
+
+ m_segment_out(m_comcount, m_inhalt ? 0 : segs);
+ m_comcount = (m_comcount + 1) % m_compins;
+}
+
void ht1130_device::device_start()
{
space(AS_PROGRAM).specific(m_space);
space(AS_DATA).specific(m_data);
+ init_lcd();
+
set_icountptr(m_icount);
state_add(HT1130_PC, "PC", m_pc);
@@ -222,6 +254,7 @@ void ht1130_device::device_start()
m_inhalt = 0;
m_timerover = 0;
m_timer = 0;
+ m_comcount = 0;
save_item(NAME(m_pc));
save_item(NAME(m_regs));
@@ -232,6 +265,7 @@ void ht1130_device::device_start()
save_item(NAME(m_inhalt));
save_item(NAME(m_timerover));
save_item(NAME(m_timer));
+ save_item(NAME(m_comcount));
save_item(NAME(m_stackaddr));
save_item(NAME(m_stackcarry));
}
diff --git a/src/devices/cpu/ht1130/ht1130.h b/src/devices/cpu/ht1130/ht1130.h
index a0b90ef39dc..c0c8562529e 100644
--- a/src/devices/cpu/ht1130/ht1130.h
+++ b/src/devices/cpu/ht1130/ht1130.h
@@ -30,12 +30,11 @@ public:
auto pa_out_cb() { return m_port_out_pa.bind(); }
- auto display_data_out_cb() { return m_display_data_out.bind(); }
+ auto segment_out_cb() { return m_segment_out.bind(); } // COM in offset, SEG in data
protected:
ht1130_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor data);
-
virtual void device_start() override;
virtual void device_reset() override;
@@ -56,7 +55,6 @@ protected:
required_shared_ptr<u8> m_tempram;
required_shared_ptr<u8> m_displayram;
-private:
address_space_config m_space_config;
address_space_config m_data_config;
@@ -82,6 +80,9 @@ private:
u8 gettimer_upper();
u8 gettimer_lower();
+ void init_lcd();
+ virtual TIMER_CALLBACK_MEMBER(update_lcd);
+
void cycle();
u8 fetch();
void do_op();
@@ -98,6 +99,10 @@ private:
u8 m_timerover;
u16 m_timer;
+ u8 m_compins;
+ u8 m_comcount;
+ emu_timer *m_lcd_timer;
+
u16 m_stackaddr;
u8 m_stackcarry;
@@ -107,7 +112,7 @@ private:
devcb_write8 m_port_out_pa;
- devcb_write8 m_display_data_out;
+ devcb_write64 m_segment_out;
};
class ht1190_device : public ht1130_device
@@ -115,6 +120,9 @@ class ht1190_device : public ht1130_device
public:
ht1190_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+protected:
+ virtual TIMER_CALLBACK_MEMBER(update_lcd) override;
+
private:
void internal_data_map_ht1190(address_map &map);
};
diff --git a/src/mame/handheld/hh_ht11xx.cpp b/src/mame/handheld/hh_ht11xx.cpp
index 2bf11066efd..301e24cc2bb 100644
--- a/src/mame/handheld/hh_ht11xx.cpp
+++ b/src/mame/handheld/hh_ht11xx.cpp
@@ -42,7 +42,7 @@ public:
hh_ht11xx_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_out_x(*this, "seg%u_%u", 0xb0U, 0U),
+ m_out_x(*this, "%u.%u", 0U, 0U),
m_in(*this, "IN%u", 1)
{ }
@@ -54,10 +54,10 @@ protected:
private:
void mcfg_svg_screen(machine_config &config, u16 width, u16 height, const char *tag = "screen");
- void display_data_w(offs_t offset, u8 data);
+ void segment_w(offs_t offset, u64 data);
required_device<ht1130_device> m_maincpu;
- output_finder<80, 4> m_out_x;
+ output_finder<8, 40> m_out_x;
required_ioport_array<2> m_in;
};
@@ -81,11 +81,12 @@ static INPUT_PORTS_START( ht11xx_brickgame )
INPUT_PORTS_END
-void hh_ht11xx_state::display_data_w(offs_t offset, u8 data)
+void hh_ht11xx_state::segment_w(offs_t offset, u64 data)
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 40; i++)
{
- m_out_x[offset][i] = (data >> i) & 1;
+ // output to x.y where x = COM# and y = SEG#
+ m_out_x[offset][i] = BIT(data, i);
}
}
@@ -100,7 +101,7 @@ void hh_ht11xx_state::mcfg_svg_screen(machine_config &config, u16 width, u16 hei
void hh_ht11xx_state::ht11xx_brickgame(machine_config &config)
{
HT1190(config, m_maincpu, 1000000/8); // frequency?
- m_maincpu->display_data_out_cb().set(FUNC(hh_ht11xx_state::display_data_w));
+ m_maincpu->segment_out_cb().set(FUNC(hh_ht11xx_state::segment_w));
m_maincpu->ps_in_cb().set_ioport(m_in[0]);
m_maincpu->pp_in_cb().set_ioport(m_in[1]);
@@ -114,8 +115,8 @@ ROM_START( brke23p2 )
ROM_REGION( 0x1000, "maincpu", 0 )
ROM_LOAD( "e23plusmarkii96in1.bin", 0x0000, 0x1000, CRC(8045fac4) SHA1(a36213309e6add31f31e4248f02f17de9914a5c1) ) // visual decap
- ROM_REGION( 139648, "screen", 0)
- ROM_LOAD( "brke23p2.svg", 0, 139648, CRC(f29ea936) SHA1(d80a37aa4e5647b31454a6d6de5a59c770ef0322) )
+ ROM_REGION( 138917, "screen", 0)
+ ROM_LOAD( "brke23p2.svg", 0, 138917, CRC(4e763114) SHA1(8cb006e515f7f90c4959743e3dbe1aa8a0c42cbc) )
ROM_END
} // anonymous namespace
diff --git a/src/mame/saitek/edames.cpp b/src/mame/saitek/edames.cpp
index aca390a52a2..acf41ec2c8c 100644
--- a/src/mame/saitek/edames.cpp
+++ b/src/mame/saitek/edames.cpp
@@ -18,6 +18,7 @@ piece from the board, but it doesn't matter.
Two versions were sold, each should have the same MCU and ROM: a tabletop model
(Electronic Dames, 8MHz or 12MHz), and a portable model (Compact Dames Computer,
8MHz). As with SciSys/Saitek chess computers, they were also licensed to Tandy.
+The program engine is DIOS by Eric van Riet Paap.
According to the second hand market, the tabletop French version is much more
common than the English one. The manual and a LED label incorrectly call crowned