From dc1214c9eeffe928fe3eb57f59506516b86dbbc0 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 25 Feb 2015 01:34:25 +0100 Subject: [PATCH] added wildfire 7seg decoder --- src/emu/cpu/amis2000/amis2000.h | 2 +- src/mess/drivers/wildfire.c | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/emu/cpu/amis2000/amis2000.h b/src/emu/cpu/amis2000/amis2000.h index 250ee6dcb8b..8adcb4e2f7c 100644 --- a/src/emu/cpu/amis2000/amis2000.h +++ b/src/emu/cpu/amis2000/amis2000.h @@ -36,7 +36,7 @@ // S2000 has a hardcoded 7seg table, that (unlike S2200) is officially // uncustomizable, but wildfire proves to be an exception to that rule. -#define MCFG_AMI_S2000_7SEG_DECODER(_pla) \ +#define MCFG_AMI_S2000_7SEG_DECODER(_ptr) \ amis2000_base_device::set_7seg_table(*device, _ptr); diff --git a/src/mess/drivers/wildfire.c b/src/mess/drivers/wildfire.c index 84d2e80be93..28acfdb6c59 100644 --- a/src/mess/drivers/wildfire.c +++ b/src/mess/drivers/wildfire.c @@ -16,7 +16,7 @@ - sound emulation could still be improved - when the game strobes a led faster, it should appear brighter, for example when the ball hits one of the bumpers - - some 7segs digits are wrong (mcu on-die decoder is customizable?) + - 7seg decoder is guessed - MCU clock is unknown ***************************************************************************/ @@ -278,11 +278,35 @@ void wildfire_state::machine_start() save_item(NAME(m_q3)); } +// LED segments A-G +enum +{ + lA = 0x40, + lB = 0x20, + lC = 0x10, + lD = 0x08, + lE = 0x04, + lF = 0x02, + lG = 0x01 +}; + +static const UINT8 wildfire_7seg_table[0x10] = +{ + 0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, // 0-9 unaltered + 0x77, // A -> unused? + lA+lB+lE+lF+lG, // b -> P + 0x4e, // C -> unused? + lD+lE+lF, // d -> L + 0x4f, // E -> unused? + lG // F -> - +}; + static MACHINE_CONFIG_START( wildfire, wildfire_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", AMI_S2152, MASTER_CLOCK) + MCFG_AMI_S2000_7SEG_DECODER(wildfire_7seg_table) MCFG_AMI_S2000_READ_I_CB(IOPORT("IN1")) MCFG_AMI_S2000_WRITE_D_CB(WRITE8(wildfire_state, write_d)) MCFG_AMI_S2000_WRITE_A_CB(WRITE16(wildfire_state, write_a))