summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/hh_ucom4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/hh_ucom4.cpp')
-rw-r--r--src/mame/drivers/hh_ucom4.cpp166
1 files changed, 18 insertions, 148 deletions
diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp
index c5242e40808..703453a2b63 100644
--- a/src/mame/drivers/hh_ucom4.cpp
+++ b/src/mame/drivers/hh_ucom4.cpp
@@ -65,11 +65,6 @@
(* means undumped unless noted, @ denotes it's in this driver)
-
-TODO:
- - games that rely on the fact that faster/longer strobed elements appear brighter:
- tactix(player 2)
-
***************************************************************************/
#include "emu.h"
@@ -97,16 +92,9 @@ TODO:
void hh_ucom4_state::machine_start()
{
- // resolve handlers
- m_out_x.resolve();
- m_out_a.resolve();
- m_out_digit.resolve();
+ screenless_state::machine_start();
// zerofill
- memset(m_display_state, 0, sizeof(m_display_state));
- memset(m_display_decay, 0, sizeof(m_display_decay));
- memset(m_display_segmask, 0, sizeof(m_display_segmask));
-
memset(m_port, 0, sizeof(m_port));
m_int = 0;
m_inp_mux = 0;
@@ -114,14 +102,6 @@ void hh_ucom4_state::machine_start()
m_plate = 0;
// register for savestates
- save_item(NAME(m_display_maxy));
- save_item(NAME(m_display_maxx));
- save_item(NAME(m_display_wait));
-
- save_item(NAME(m_display_state));
- save_item(NAME(m_display_decay));
- save_item(NAME(m_display_segmask));
-
save_item(NAME(m_port));
save_item(NAME(m_int));
save_item(NAME(m_inp_mux));
@@ -142,80 +122,6 @@ void hh_ucom4_state::machine_reset()
***************************************************************************/
-// The device may strobe the outputs very fast, it is unnoticeable to the user.
-// To prevent flickering here, we need to simulate a decay.
-
-void hh_ucom4_state::display_update()
-{
- for (int y = 0; y < m_display_maxy; y++)
- {
- u32 active_state = 0;
-
- for (int x = 0; x <= m_display_maxx; x++)
- {
- // turn on powered segments
- if (m_display_state[y] >> x & 1)
- m_display_decay[y][x] = m_display_wait;
-
- // determine active state
- u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
- active_state |= (ds << x);
-
- // output to y.x, or y.a when always-on
- if (x != m_display_maxx)
- m_out_x[y][x] = ds;
- else
- m_out_a[y] = ds;
- }
-
- // output to digity
- if (m_display_segmask[y] != 0)
- m_out_digit[y] = active_state & m_display_segmask[y];
- }
-}
-
-TIMER_DEVICE_CALLBACK_MEMBER(hh_ucom4_state::display_decay_tick)
-{
- // slowly turn off unpowered segments
- for (int y = 0; y < m_display_maxy; y++)
- for (int x = 0; x <= m_display_maxx; x++)
- if (m_display_decay[y][x] != 0)
- m_display_decay[y][x]--;
-
- display_update();
-}
-
-void hh_ucom4_state::set_display_size(int maxx, int maxy)
-{
- m_display_maxx = maxx;
- m_display_maxy = maxy;
-}
-
-void hh_ucom4_state::set_display_segmask(u32 digits, u32 mask)
-{
- // set a segment mask per selected digit, but leave unselected ones alone
- for (int i = 0; i < 0x20; i++)
- {
- if (digits & 1)
- m_display_segmask[i] = mask;
- digits >>= 1;
- }
-}
-
-void hh_ucom4_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
-{
- set_display_size(maxx, maxy);
-
- // update current state
- u32 mask = (1 << maxx) - 1;
- for (int y = 0; y < maxy; y++)
- m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
-
- if (update)
- display_update();
-}
-
-
// generic input handlers
u8 hh_ucom4_state::read_inputs(int columns)
@@ -365,12 +271,10 @@ void ufombs_state::ufombs(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(243, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -523,12 +427,10 @@ void ssfball_state::ssfball(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 482);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -670,12 +572,10 @@ void bmsoccer_state::bmsoccer(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(271, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -788,12 +688,10 @@ void bmsafari_state::bmsafari(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(248, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -950,12 +848,10 @@ void splasfgt_state::splasfgt(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 476);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -1065,12 +961,10 @@ void bcclimbr_state::bcclimbr(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(310, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -1193,7 +1087,6 @@ void tactix_state::tactix(machine_config &config)
m_maincpu->write_f().set(FUNC(tactix_state::leds_w));
m_maincpu->write_g().set(FUNC(tactix_state::speaker_w));
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_tactix);
/* sound hardware */
@@ -1333,7 +1226,6 @@ void ctntune_state::ctntune(machine_config &config)
m_maincpu->write_f().set(FUNC(ctntune_state::_7seg_w));
m_maincpu->write_g().set(FUNC(ctntune_state::speaker_w));
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_ctntune);
/* sound hardware */
@@ -1440,12 +1332,10 @@ void invspace_state::invspace(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(289, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -1564,7 +1454,6 @@ void efball_state::efball(machine_config &config)
m_maincpu->write_h().set(FUNC(efball_state::grid_w));
m_maincpu->write_i().set(FUNC(efball_state::plate_w));
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_efball);
/* sound hardware */
@@ -1674,12 +1563,10 @@ void galaxy2_state::galaxy2(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(304, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -1813,12 +1700,10 @@ void astrocmd_state::astrocmd(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 525);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -1920,12 +1805,10 @@ void edracula_state::edracula(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 526);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -2013,7 +1896,7 @@ void mcompgin_state::mcompgin(machine_config &config)
/* video hardware */
HLCD0530(config, m_lcd, 500); // C=0.01uF
m_lcd->write_cols().set(FUNC(mcompgin_state::lcd_output_w));
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
+
config.set_default_layout(layout_mcompgin);
/* no sound! */
@@ -2120,7 +2003,6 @@ void mvbfree_state::mvbfree(machine_config &config)
m_maincpu->write_h().set(FUNC(mvbfree_state::grid_w));
m_maincpu->write_i().set(FUNC(mvbfree_state::speaker_w));
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_mvbfree);
/* sound hardware */
@@ -2242,7 +2124,6 @@ void grobot9_state::grobot9(machine_config &config)
m_maincpu->write_e().set(FUNC(grobot9_state::lamps_w));
m_maincpu->write_f().set(FUNC(grobot9_state::lamps_w));
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_grobot9);
/* sound hardware */
@@ -2345,12 +2226,10 @@ void tccombat_state::tccombat(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(300, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -2509,11 +2388,10 @@ void tmtennis_state::tmtennis(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 417);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_tmtennis);
/* sound hardware */
@@ -2630,12 +2508,10 @@ void tmpacman_state::tmpacman(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 508);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -2744,12 +2620,10 @@ void tmscramb_state::tmscramb(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 556);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -2854,12 +2728,10 @@ void tcaveman_state::tcaveman(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(1920, 559);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);
@@ -2998,12 +2870,10 @@ void alnchase_state::alnchase(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_svg_region("svg");
- screen.set_refresh_hz(50);
+ screen.set_refresh_hz(60);
screen.set_size(365, 1080);
screen.set_visarea_full();
- TIMER(config, "display_decay").configure_periodic(FUNC(hh_ucom4_state::display_decay_tick), attotime::from_msec(1));
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker);