st_mp200: fixed display

This commit is contained in:
Robbbert 2014-08-17 10:34:08 +00:00
parent 8706a0220c
commit 6a3614cdbb
2 changed files with 200 additions and 163 deletions

View File

@ -6,7 +6,6 @@
ToDo:
- Display to fix
- Sound - All machines have a B605/C605 sound card containing a 6840 and many other chips
- Sound - Games 126,128-151,165 have a A720 voice synthesizer with a 'CRC' CPU and many other chips
- Dips, Inputs, Solenoids vary per game
@ -46,6 +45,7 @@ public:
DECLARE_DRIVER_INIT(st_mp200);
DECLARE_DRIVER_INIT(st_mp201);
DECLARE_DRIVER_INIT(st_mp202);
DECLARE_READ8_MEMBER(u10_a_r);
DECLARE_WRITE8_MEMBER(u10_a_w);
DECLARE_READ8_MEMBER(u10_b_r);
@ -59,21 +59,22 @@ public:
DECLARE_WRITE_LINE_MEMBER(u11_cb2_w);
DECLARE_INPUT_CHANGED_MEMBER(activity_test);
DECLARE_INPUT_CHANGED_MEMBER(self_test);
TIMER_DEVICE_CALLBACK_MEMBER(u10_timer);
TIMER_DEVICE_CALLBACK_MEMBER(timer_x);
TIMER_DEVICE_CALLBACK_MEMBER(u11_timer);
private:
UINT8 m_u10;
UINT8 m_u10_a;
UINT8 m_u10_b;
UINT8 m_u11_a;
UINT8 m_u11_b;
UINT8 m_u10a;
UINT8 m_u10b;
UINT8 m_u11a;
UINT8 m_u11b;
bool m_u10_ca2;
bool m_u10_cb2;
bool m_u10_timer;
bool m_u11_cb2;
bool m_timer_x;
bool m_u11_timer;
bool m_su; // speech unit fitted yes/no
bool m_6d; // 6-digit display yes/no
UINT8 m_digit;
UINT8 m_segment;
UINT8 m_counter;
virtual void machine_reset();
required_device<m6800_cpu_device> m_maincpu;
optional_device<s14001a_device> m_s14001a;
@ -97,8 +98,8 @@ static ADDRESS_MAP_START( st_mp200_map, AS_PROGRAM, 8, st_mp200_state )
AM_RANGE(0x0000, 0x007f) AM_RAM // internal to the cpu
AM_RANGE(0x0088, 0x008b) AM_DEVREADWRITE("pia_u10", pia6821_device, read, write)
AM_RANGE(0x0090, 0x0093) AM_DEVREADWRITE("pia_u11", pia6821_device, read, write)
AM_RANGE(0x00a0, 0x00bf) AM_WRITENOP // to sound board
AM_RANGE(0x00c0, 0x00df) // to sound board
AM_RANGE(0x00a0, 0x00a7) AM_WRITENOP // to sound board
AM_RANGE(0x00c0, 0x00c7) // to sound board
AM_RANGE(0x0200, 0x02ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x1000, 0xffff) AM_ROM //AM_REGION("roms", 0 )
ADDRESS_MAP_END
@ -310,8 +311,10 @@ INPUT_CHANGED_MEMBER( st_mp200_state::self_test )
WRITE_LINE_MEMBER( st_mp200_state::u10_ca2_w )
{
m_u10_ca2 = state;
if (!state)
m_counter = 0;
}
WRITE_LINE_MEMBER( st_mp200_state::u10_cb2_w )
{
if (m_su)
@ -329,18 +332,18 @@ WRITE_LINE_MEMBER( st_mp200_state::u11_ca2_w )
if ((m_su) & (state))
{
if BIT(m_u10_a, 7)
if BIT(m_u10a, 7)
{
m_s14001a->reg_w(m_u10_a & 0x3f);
m_s14001a->reg_w(m_u10a & 0x3f);
m_s14001a->rst_w(1);
m_s14001a->rst_w(0);
}
else
if BIT(m_u10_a, 6)
if BIT(m_u10a, 6)
{
m_s14001a->set_volume(((m_u10_a & 0x38) >> 3) + 1);
m_s14001a->set_volume(((m_u10a & 0x38) >> 3) + 1);
UINT8 clock_divisor = 16 - (m_u10_a & 0x07);
UINT8 clock_divisor = 16 - (m_u10a & 0x07);
m_s14001a->set_clock(S14001_CLOCK / clock_divisor / 8);
}
@ -349,41 +352,41 @@ WRITE_LINE_MEMBER( st_mp200_state::u11_ca2_w )
WRITE_LINE_MEMBER( st_mp200_state::u11_cb2_w )
{
m_u11_cb2 = state;
}
READ8_MEMBER( st_mp200_state::u10_a_r )
{
return m_u10_a;
return m_u10a;
}
WRITE8_MEMBER( st_mp200_state::u10_a_w )
{
static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543
m_segment = data >> 4;
m_u10_a = data;
m_u10 = (data & 15) | (BIT(m_u11_a, 0) << 4);
m_u10a = data;
if (!m_u10_ca2)
{
switch (m_u10)
{
case 0x1e:
output_set_digit_value(m_digit, patterns[m_segment]);
break;
case 0x1d:
output_set_digit_value(8+m_digit, patterns[m_segment]);
break;
case 0x1b:
output_set_digit_value(16+m_digit, patterns[m_segment]);
break;
case 0x07:
output_set_digit_value(24+m_digit, patterns[m_segment]);
break;
case 0x0f:
output_set_digit_value(32+m_digit, patterns[m_segment]);
break;
default://printf("%X ",m_u10);
break;
}
m_counter++;
UINT8 segment = data >> 4;
if (m_6d && !m_digit && (m_counter < 6))
m_digit = 6; // handle 6-digit display
if (m_counter==1)
output_set_digit_value(m_digit, patterns[segment]);
else
if (m_counter==3)
output_set_digit_value(10+m_digit, patterns[segment]);
else
if (m_counter==5)
output_set_digit_value(20+m_digit, patterns[segment]);
else
if (m_counter==8)
output_set_digit_value(30+m_digit, patterns[segment]);
else
if (m_counter==10)
output_set_digit_value(40+m_digit, patterns[segment]);
}
}
@ -391,28 +394,28 @@ READ8_MEMBER( st_mp200_state::u10_b_r )
{
UINT8 data = 0;
if (BIT(m_u10_a, 0))
if (BIT(m_u10a, 0))
data |= m_io_x0->read();
if (BIT(m_u10_a, 1))
if (BIT(m_u10a, 1))
data |= m_io_x1->read();
if (BIT(m_u10_a, 2))
if (BIT(m_u10a, 2))
data |= m_io_x2->read();
if (BIT(m_u10_a, 3))
if (BIT(m_u10a, 3))
data |= m_io_x3->read();
if (BIT(m_u10_a, 4))
if (BIT(m_u10a, 4))
data |= m_io_x4->read();
if (BIT(m_u10_a, 5))
if (BIT(m_u10a, 5))
data |= m_io_dsw0->read();
if (BIT(m_u10_a, 6))
if (BIT(m_u10a, 6))
data |= m_io_dsw1->read();
if (BIT(m_u10_a, 7))
if (BIT(m_u10a, 7))
data |= m_io_dsw2->read();
if (m_u10_cb2)
@ -423,114 +426,132 @@ READ8_MEMBER( st_mp200_state::u10_b_r )
WRITE8_MEMBER( st_mp200_state::u10_b_w )
{
m_u10_b = data;
m_u10b = data;
}
READ8_MEMBER( st_mp200_state::u11_a_r )
{
return m_u11_a;
return m_u11a;
}
WRITE8_MEMBER( st_mp200_state::u11_a_w )
{
m_u11_a = data;
m_u11a = data;
m_digit = 0xff;
if BIT(data, 2)
m_digit = 4;
else
if BIT(data, 3)
m_digit = 3;
else
if BIT(data, 4)
m_digit = 2;
else
if BIT(data, 5)
m_digit = 1;
else
if BIT(data, 6)
m_digit = 0;
else
if BIT(data, 7)
m_digit = 5;
if (!m_u10_ca2)
{
if BIT(data, 1)
m_digit = 6;
else
if BIT(data, 2)
m_digit = 5;
else
if BIT(data, 3)
m_digit = 4;
else
if BIT(data, 4)
m_digit = 3;
else
if BIT(data, 5)
m_digit = 2;
else
if BIT(data, 6)
m_digit = 1;
else
if BIT(data, 7)
m_digit = 0;
m_counter++;
}
}
WRITE8_MEMBER( st_mp200_state::u11_b_w )
{
m_u11_b = data;
switch (data & 15)
m_u11b = data;
if (!m_u11_cb2)
{
case 0x0: //
//m_samples->start(0, 3);
break;
case 0x1: // chime 10
m_samples->start(1, 1);
break;
case 0x2: // chime 100
m_samples->start(2, 2);
break;
case 0x3: // chime 1000
m_samples->start(3, 3);
break;
case 0x4: // chime 10000
m_samples->start(0, 4);
break;
case 0x5: // knocker
m_samples->start(0, 6);
break;
case 0x6: // outhole
m_samples->start(0, 5);
break;
// from here, vary per game
case 0x7:
case 0x8:
case 0x9:
//m_samples->start(0, 5);
break;
case 0xa:
//m_samples->start(0, 5);
break;
case 0xb:
//m_samples->start(0, 0);
break;
case 0xc:
//m_samples->start(0, 5);
break;
case 0xd:
//m_samples->start(0, 0);
break;
case 0xe:
//m_samples->start(0, 5);
break;
case 0xf: // not used
break;
switch (data & 15)
{
case 0x0: //
//m_samples->start(0, 3);
break;
case 0x1: // chime 10
//m_samples->start(1, 1);
break;
case 0x2: // chime 100
//m_samples->start(2, 2);
break;
case 0x3: // chime 1000
//m_samples->start(3, 3);
break;
case 0x4: // chime 10000
//m_samples->start(0, 4);
break;
case 0x5: // knocker
m_samples->start(0, 6);
break;
case 0x6: // outhole
m_samples->start(0, 5);
break;
// from here, vary per game
case 0x7:
case 0x8:
case 0x9:
//m_samples->start(0, 5);
break;
case 0xa:
//m_samples->start(0, 5);
break;
case 0xb:
//m_samples->start(0, 0);
break;
case 0xc:
//m_samples->start(0, 5);
break;
case 0xd:
//m_samples->start(0, 0);
break;
case 0xe:
//m_samples->start(0, 5);
break;
case 0xf: // not used
break;
}
}
}
void st_mp200_state::machine_reset()
{
m_u10_a = 0;
m_u10_b = 0;
m_u10a = 0;
m_u10b = 0;
m_u10_cb2 = 0;
m_u11_a = 0;
m_u11_b = 0;
m_u11a = 0;
m_u11b = 0;
}
DRIVER_INIT_MEMBER( st_mp200_state, st_mp200 )
{
m_6d = 0;
m_su = 0;
}
DRIVER_INIT_MEMBER( st_mp200_state, st_mp201 )
{
m_6d = 0;
m_su = 1;
}
// zero-cross detection
TIMER_DEVICE_CALLBACK_MEMBER( st_mp200_state::u10_timer )
DRIVER_INIT_MEMBER( st_mp200_state, st_mp202 )
{
m_u10_timer ^= 1;
m_pia_u10->cb1_w(m_u10_timer);
m_6d = 1;
m_su = 0;
}
// zero-cross detection
TIMER_DEVICE_CALLBACK_MEMBER( st_mp200_state::timer_x )
{
m_timer_x ^= 1;
m_pia_u10->cb1_w(m_timer_x);
}
// 555 timer for display refresh
@ -563,7 +584,7 @@ static MACHINE_CONFIG_START( st_mp200, st_mp200_state )
MCFG_PIA_CB2_HANDLER(WRITELINE(st_mp200_state, u10_cb2_w))
MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_z", st_mp200_state, u10_timer, attotime::from_hz(120)) // mains freq*2
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_x", st_mp200_state, timer_x, attotime::from_hz(120)) // mains freq*2
MCFG_DEVICE_ADD("pia_u11", PIA6821, 0)
MCFG_PIA_READPA_HANDLER(READ8(st_mp200_state, u11_a_r))
@ -889,28 +910,32 @@ ROM_START(st_game)
ROM_RELOAD( 0xf800, 0x0800)
ROM_END
// 6-digit
GAME(1979, meteorp, 0, st_mp200, mp200, st_mp200_state, st_mp202, ROT0, "Stern", "Meteor (Stern)", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, galaxypi, 0, st_mp200, mp200, st_mp200_state, st_mp202, ROT0, "Stern", "Galaxy", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, ali, 0, st_mp200, mp200, st_mp200_state, st_mp202, ROT0, "Stern", "Ali", GAME_IS_SKELETON_MECHANICAL)
GAME(1979, meteorp, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Meteor (Stern)", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, galaxypi, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Galaxy", GAME_IS_SKELETON_MECHANICAL)
// 7-digit
GAME(1980, biggame, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Big Game", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, cheetah, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Cheetah", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, quicksil, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Quicksilver", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, ali, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Ali", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, biggame, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Big Game", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, seawitch, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Seawitch", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, nineball, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Nine Ball", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, lightnin, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Lightning", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, stargzr, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Stargazer", GAME_IS_SKELETON_MECHANICAL)
GAME(1980, flight2k, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Flight 2000", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, freefall, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Freefall", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, splitsec, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Split Second", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, catacomp, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Catacomb (Pinball)", GAME_IS_SKELETON_MECHANICAL)
GAME(1982, dragfist, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Dragonfist", GAME_IS_SKELETON_MECHANICAL)
GAME(1984, lazrlord, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Lazer Lord", GAME_IS_SKELETON_MECHANICAL)
// hang after boot
GAME(1980, flight2k, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Flight 2000", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, freefall, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Freefall", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, viperp, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Viper (Pinball)", GAME_IS_SKELETON_MECHANICAL)
GAME(1981, ironmaid, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Iron Maiden", GAME_IS_SKELETON_MECHANICAL)
GAME(1982, dragfist, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Dragonfist", GAME_IS_SKELETON_MECHANICAL)
GAME(1982, orbitor1, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Orbitor 1", GAME_IS_SKELETON_MECHANICAL)
GAME(1984, lazrlord, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Lazer Lord", GAME_IS_SKELETON_MECHANICAL)
// other manufacturer
GAME(1985, gamatron, flight2k, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Pinstar", "Gamatron", GAME_IS_SKELETON_MECHANICAL)
GAME(1978, blkshpsq, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Astro", "Black Sheep Squadron", GAME_IS_SKELETON_MECHANICAL)
GAME(1978, blkshpsq, 0, st_mp200, mp200, st_mp200_state, st_mp202, ROT0, "Astro", "Black Sheep Squadron", GAME_IS_SKELETON_MECHANICAL)
GAME(198?, st_game, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "<unknown>", "unknown pinball game", GAME_IS_SKELETON_MECHANICAL)

View File

@ -30,103 +30,115 @@
<!-- Background -->
<backdrop element="background">
<bounds left="0" top="20" right="274" bottom="394" />
<bounds left="0" top="20" right="318" bottom="394" />
</backdrop>
<!-- LEDs -->
<!-- Player 1 Score -->
<bezel name="digit5" element="digit">
<bezel name="digit0" element="digit">
<bounds left="10" top="45" right="44" bottom="84" />
</bezel>
<bezel name="digit4" element="digit">
<bezel name="digit6" element="digit">
<bounds left="54" top="45" right="88" bottom="84" />
</bezel>
<bezel name="digit3" element="digit">
<bezel name="digit5" element="digit">
<bounds left="98" top="45" right="132" bottom="84" />
</bezel>
<bezel name="digit2" element="digit">
<bezel name="digit4" element="digit">
<bounds left="142" top="45" right="176" bottom="84" />
</bezel>
<bezel name="digit1" element="digit">
<bezel name="digit3" element="digit">
<bounds left="186" top="45" right="220" bottom="84" />
</bezel>
<bezel name="digit0" element="digit">
<bezel name="digit2" element="digit">
<bounds left="230" top="45" right="264" bottom="84" />
</bezel>
<bezel name="digit1" element="digit">
<bounds left="274" top="45" right="308" bottom="84" />
</bezel>
<!-- Player 2 Score -->
<bezel name="digit13" element="digit">
<bezel name="digit10" element="digit">
<bounds left="10" top="105" right="44" bottom="144" />
</bezel>
<bezel name="digit12" element="digit">
<bezel name="digit16" element="digit">
<bounds left="54" top="105" right="88" bottom="144" />
</bezel>
<bezel name="digit11" element="digit">
<bezel name="digit15" element="digit">
<bounds left="98" top="105" right="132" bottom="144" />
</bezel>
<bezel name="digit10" element="digit">
<bezel name="digit14" element="digit">
<bounds left="142" top="105" right="176" bottom="144" />
</bezel>
<bezel name="digit9" element="digit">
<bezel name="digit13" element="digit">
<bounds left="186" top="105" right="220" bottom="144" />
</bezel>
<bezel name="digit8" element="digit">
<bezel name="digit12" element="digit">
<bounds left="230" top="105" right="264" bottom="144" />
</bezel>
<bezel name="digit11" element="digit">
<bounds left="274" top="105" right="308" bottom="144" />
</bezel>
<!-- Player 3 Score -->
<bezel name="digit21" element="digit">
<bezel name="digit20" element="digit">
<bounds left="10" top="165" right="44" bottom="204" />
</bezel>
<bezel name="digit20" element="digit">
<bezel name="digit26" element="digit">
<bounds left="54" top="165" right="88" bottom="204" />
</bezel>
<bezel name="digit19" element="digit">
<bezel name="digit25" element="digit">
<bounds left="98" top="165" right="132" bottom="204" />
</bezel>
<bezel name="digit18" element="digit">
<bezel name="digit24" element="digit">
<bounds left="142" top="165" right="176" bottom="204" />
</bezel>
<bezel name="digit17" element="digit">
<bezel name="digit23" element="digit">
<bounds left="186" top="165" right="220" bottom="204" />
</bezel>
<bezel name="digit16" element="digit">
<bezel name="digit22" element="digit">
<bounds left="230" top="165" right="264" bottom="204" />
</bezel>
<bezel name="digit21" element="digit">
<bounds left="274" top="165" right="308" bottom="204" />
</bezel>
<!-- Player 4 Score -->
<bezel name="digit28" element="digit">
<bezel name="digit36" element="digit">
<bounds left="10" top="225" right="44" bottom="264" />
</bezel>
<bezel name="digit27" element="digit">
<bezel name="digit35" element="digit">
<bounds left="54" top="225" right="88" bottom="264" />
</bezel>
<bezel name="digit26" element="digit">
<bezel name="digit34" element="digit">
<bounds left="98" top="225" right="132" bottom="264" />
</bezel>
<bezel name="digit25" element="digit">
<bezel name="digit33" element="digit">
<bounds left="142" top="225" right="176" bottom="264" />
</bezel>
<bezel name="digit24" element="digit">
<bezel name="digit32" element="digit">
<bounds left="186" top="225" right="220" bottom="264" />
</bezel>
<bezel name="digit29" element="digit">
<bezel name="digit31" element="digit">
<bounds left="230" top="225" right="264" bottom="264" />
</bezel>
<bezel name="digit30" element="digit">
<bounds left="274" top="225" right="308" bottom="264" />
</bezel>
<!-- Credits and Balls -->
<bezel name="digit35" element="digit">
<bezel name="digit44" element="digit">
<bounds left="10" top="345" right="44" bottom="384" />
</bezel>
<bezel name="digit34" element="digit">
<bezel name="digit43" element="digit">
<bounds left="54" top="345" right="88" bottom="384" />
</bezel>
<bezel name="digit32" element="digit">
<bezel name="digit41" element="digit">
<bounds left="186" top="345" right="220" bottom="384" />
</bezel>
<bezel name="digit37" element="digit">
<bezel name="digit40" element="digit">
<bounds left="230" top="345" right="264" bottom="384" />
</bezel>