From a0c5f7f97c52cd4ca9d1a04be6df026090737501 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 21 Jan 2017 17:50:57 +0100 Subject: [PATCH] hh_tms1k: horseran works now, will correct whatsnew manually (nw) --- src/devices/video/hlcd0515.h | 20 ++--- src/mame/drivers/hh_tms1k.cpp | 17 +++- src/mame/layout/horseran.lay | 154 ++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 13 deletions(-) create mode 100644 src/mame/layout/horseran.lay diff --git a/src/devices/video/hlcd0515.h b/src/devices/video/hlcd0515.h index 918ad0badd4..815e49e0c08 100644 --- a/src/devices/video/hlcd0515.h +++ b/src/devices/video/hlcd0515.h @@ -46,8 +46,8 @@ COL11 19 | | 22 COL13 GND 20 |___________| 21 COL12 - OSC is tied to a capacitor, the result frequency is 50000 * cap(in uF), - eg. 0.01uF cap = 500Hz. + OSC is tied to a capacitor, the result frequency is 50000 * cap(in uF), eg. 0.01uF cap = 500Hz. + Internally, this is divided by 2, and by number of rows to get display refresh frequency. */ class hlcd0515_device : public device_t @@ -70,16 +70,16 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - int m_cs; - int m_clock; - int m_data; + int m_cs; // input pin state + int m_clock; // " + int m_data; // " int m_count; u8 m_control; - bool m_blank; - u8 m_rowmax; - u8 m_rowout; - u8 m_rowsel; - u32 m_ram[8]; + bool m_blank; // display blank/visible + u8 m_rowmax; // number of rows output by lcd (max 8) + u8 m_rowout; // current row for lcd output + u8 m_rowsel; // current row for data in/out + u32 m_ram[8]; // 8x25bit ram emu_timer *m_lcd_timer; diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index ada3e2624ba..45cd9033cd1 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -172,6 +172,7 @@ #include "h2hbaseb.lh" #include "h2hboxing.lh" #include "h2hfootb.lh" +#include "horseran.lh" #include "lostreas.lh" // clickable #include "matchnum.lh" // clickable #include "mathmagi.lh" @@ -4475,6 +4476,17 @@ public: WRITE32_MEMBER(horseran_state::lcd_output_w) { + // only 3 rows used + if (offset > 2) + return; + + // output segments (lamp row*100 + col) + for (int i = 0; i < 24; i++) + output().set_lamp_value(offset*100 + i+1, data >> i & 1); + + // col5-11 and col13-19 are 7segs + for (int i = 0; i < 2; i++) + output().set_digit_value(offset << 1 | i, BITSWAP8(data >> (4+8*i),7,3,5,2,0,1,4,6) & 0x7f); } WRITE16_MEMBER(horseran_state::write_r) @@ -4570,8 +4582,7 @@ static MACHINE_CONFIG_START( horseran, horseran_state ) /* video hardware */ MCFG_DEVICE_ADD("lcd", HLCD0569, 1100) // C=0.022uF MCFG_HLCD0515_WRITE_COLS_CB(WRITE32(horseran_state, lcd_output_w)) - MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test) - //MCFG_DEFAULT_LAYOUT(layout_horseran) + MCFG_DEFAULT_LAYOUT(layout_horseran) /* no sound! */ MACHINE_CONFIG_END @@ -8710,7 +8721,7 @@ COMP( 1979, astro, 0, 0, astro, astro, driver_device, 0, "Kos CONS( 1978, elecbowl, 0, 0, elecbowl, elecbowl, driver_device, 0, "Marx", "Electronic Bowling (Marx)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_NOT_WORKING ) // *** -COMP( 1979, horseran, 0, 0, horseran, horseran, driver_device, 0, "Mattel", "Thoroughbred Horse Race Analyzer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) +COMP( 1979, horseran, 0, 0, horseran, horseran, driver_device, 0, "Mattel", "Thoroughbred Horse Race Analyzer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) CONS( 1980, mdndclab, 0, 0, mdndclab, mdndclab, driver_device, 0, "Mattel", "Dungeons & Dragons - Computer Labyrinth Game", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // *** CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NO_SOUND_HW ) diff --git a/src/mame/layout/horseran.lay b/src/mame/layout/horseran.lay new file mode 100644 index 00000000000..5f8e136a5fd --- /dev/null +++ b/src/mame/layout/horseran.lay @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +