mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Machine promoted to working
------------ Ideal Maniac [hap, Sean Riddle, Kevin Horton]
This commit is contained in:
parent
2accd141cc
commit
9290ca336e
@ -1,5 +1,5 @@
|
|||||||
// license:BSD-3-Clause
|
// license:BSD-3-Clause
|
||||||
// copyright-holders:hap
|
// copyright-holders:hap, Sean Riddle, Kevin Horton
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
|
||||||
GI PIC16xx-driven dedicated handhelds or other simple devices.
|
GI PIC16xx-driven dedicated handhelds or other simple devices.
|
||||||
@ -19,8 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
- it doesn't work, emu/cpu/pic16c5x needs some love (dev note: hack to make it
|
- x
|
||||||
playable: remove the TRIS masks)
|
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
@ -52,8 +51,7 @@ public:
|
|||||||
optional_device<speaker_sound_device> m_speaker;
|
optional_device<speaker_sound_device> m_speaker;
|
||||||
|
|
||||||
// misc common
|
// misc common
|
||||||
u8 m_b; // MCU port B data
|
u8 m_port[4]; // MCU port A-D write data
|
||||||
u8 m_c; // MCU port C data
|
|
||||||
|
|
||||||
// display common
|
// display common
|
||||||
int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
|
int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
|
||||||
@ -68,6 +66,7 @@ public:
|
|||||||
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
|
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
|
||||||
void display_update();
|
void display_update();
|
||||||
void set_display_size(int maxx, int maxy);
|
void set_display_size(int maxx, int maxy);
|
||||||
|
void set_display_segmask(u32 digits, u32 mask);
|
||||||
void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
|
void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -86,8 +85,7 @@ void hh_pic16_state::machine_start()
|
|||||||
memset(m_display_decay, 0, sizeof(m_display_decay));
|
memset(m_display_decay, 0, sizeof(m_display_decay));
|
||||||
memset(m_display_segmask, 0, sizeof(m_display_segmask));
|
memset(m_display_segmask, 0, sizeof(m_display_segmask));
|
||||||
|
|
||||||
m_b = 0;
|
memset(m_port, 0, sizeof(m_port));
|
||||||
m_c = 0;
|
|
||||||
|
|
||||||
// register for savestates
|
// register for savestates
|
||||||
save_item(NAME(m_display_maxy));
|
save_item(NAME(m_display_maxy));
|
||||||
@ -99,8 +97,7 @@ void hh_pic16_state::machine_start()
|
|||||||
save_item(NAME(m_display_decay));
|
save_item(NAME(m_display_decay));
|
||||||
save_item(NAME(m_display_segmask));
|
save_item(NAME(m_display_segmask));
|
||||||
|
|
||||||
save_item(NAME(m_b));
|
save_item(NAME(m_port));
|
||||||
save_item(NAME(m_c));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void hh_pic16_state::machine_reset()
|
void hh_pic16_state::machine_reset()
|
||||||
@ -188,6 +185,17 @@ void hh_pic16_state::set_display_size(int maxx, int maxy)
|
|||||||
m_display_maxy = maxy;
|
m_display_maxy = maxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hh_pic16_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_pic16_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
|
void hh_pic16_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
|
||||||
{
|
{
|
||||||
set_display_size(maxx, maxy);
|
set_display_size(maxx, maxy);
|
||||||
@ -213,7 +221,9 @@ void hh_pic16_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool
|
|||||||
|
|
||||||
Ideal Maniac, by Ralph Baer
|
Ideal Maniac, by Ralph Baer
|
||||||
* PIC1655A-036
|
* PIC1655A-036
|
||||||
|
* 2 7seg LEDs, 1-bit sound
|
||||||
|
|
||||||
|
This is a reflex game for 2 to 4 players, 1 button per player.
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
@ -231,20 +241,14 @@ public:
|
|||||||
|
|
||||||
WRITE8_MEMBER(maniac_state::output_w)
|
WRITE8_MEMBER(maniac_state::output_w)
|
||||||
{
|
{
|
||||||
// B,C: outputs
|
m_port[offset] = data;
|
||||||
offset -= PIC16C5x_PORTB;
|
|
||||||
if (offset)
|
|
||||||
m_c = data;
|
|
||||||
else
|
|
||||||
m_b = data;
|
|
||||||
|
|
||||||
// d7: speaker out
|
// B7,C7: speaker out
|
||||||
m_speaker->level_w((m_b >> 7 & 1) | (m_c >> 6 & 2));
|
m_speaker->level_w((m_port[PIC16C5x_PORTB] >> 7 & 1) | (m_port[PIC16C5x_PORTC] >> 6 & 2));
|
||||||
|
|
||||||
// d0-d6: 7seg
|
|
||||||
m_display_segmask[offset] = 0x7f;
|
|
||||||
m_display_state[offset] = ~data & 0x7f;
|
|
||||||
|
|
||||||
|
// B0-6,C0-6: 7seg data
|
||||||
|
m_display_state[offset-PIC16C5x_PORTB] = ~data & 0x7f;
|
||||||
|
set_display_segmask(3, 0x7f);
|
||||||
set_display_size(7, 2);
|
set_display_size(7, 2);
|
||||||
display_update();
|
display_update();
|
||||||
}
|
}
|
||||||
@ -254,10 +258,10 @@ WRITE8_MEMBER(maniac_state::output_w)
|
|||||||
|
|
||||||
static INPUT_PORTS_START( maniac )
|
static INPUT_PORTS_START( maniac )
|
||||||
PORT_START("IN.0") // port A
|
PORT_START("IN.0") // port A
|
||||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // bottom-right
|
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // top button, increment clockwise
|
||||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // upper-right
|
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // bottom-left
|
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
|
||||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) // upper-left
|
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
|
||||||
INPUT_PORTS_END
|
INPUT_PORTS_END
|
||||||
|
|
||||||
static const s16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
|
static const s16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
|
||||||
@ -265,7 +269,7 @@ static const s16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
|
|||||||
static MACHINE_CONFIG_START( maniac, maniac_state )
|
static MACHINE_CONFIG_START( maniac, maniac_state )
|
||||||
|
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD("maincpu", PIC1655, 850000) // RC osc. R=13.4K, C=470pf, but unknown RC curve - measured 800-890kHz
|
MCFG_CPU_ADD("maincpu", PIC1655, 1000000) // approximation - RC osc. R=~13.4K, C=47pF
|
||||||
MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
|
MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
|
||||||
MCFG_PIC16C5x_WRITE_B_CB(WRITE8(maniac_state, output_w))
|
MCFG_PIC16C5x_WRITE_B_CB(WRITE8(maniac_state, output_w))
|
||||||
MCFG_PIC16C5x_WRITE_C_CB(WRITE8(maniac_state, output_w))
|
MCFG_PIC16C5x_WRITE_C_CB(WRITE8(maniac_state, output_w))
|
||||||
@ -298,4 +302,4 @@ ROM_END
|
|||||||
|
|
||||||
|
|
||||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
|
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
|
||||||
CONS( 1979, maniac, 0, 0, maniac, maniac, driver_device, 0, "Ideal", "Maniac", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
|
CONS( 1979, maniac, 0, 0, maniac, maniac, driver_device, 0, "Ideal", "Maniac", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
|
||||||
|
@ -3,7 +3,21 @@
|
|||||||
|
|
||||||
<!-- define elements -->
|
<!-- define elements -->
|
||||||
|
|
||||||
<element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
|
<element name="but">
|
||||||
|
<rect><bounds x="0" y="0" width="1" height="1"/><color red="0.85" green="0.85" blue="0.85" /></rect>
|
||||||
|
<text string="M"><bounds x="0.15" y="0.12" width="0.7" height="0.7"/><color red="0.85" green="0.25" blue="0.2" /></text>
|
||||||
|
</element>
|
||||||
|
|
||||||
|
<element name="hl" defstate="0">
|
||||||
|
<text string=" ">
|
||||||
|
<bounds x="0.0" y="0.0" width="1.0" height="1.0" />
|
||||||
|
<color red="0.0" green="0.0" blue="0.0" />
|
||||||
|
</text>
|
||||||
|
<disk state="1">
|
||||||
|
<bounds x="0.07" y="0.07" width="0.86" height="0.86" />
|
||||||
|
<color red="0.0" green="0.0" blue="0.0" />
|
||||||
|
</disk>
|
||||||
|
</element>
|
||||||
|
|
||||||
<element name="digit" defstate="0">
|
<element name="digit" defstate="0">
|
||||||
<led7seg><color red="1.0" green="0.2" blue="0.2" /></led7seg>
|
<led7seg><color red="1.0" green="0.2" blue="0.2" /></led7seg>
|
||||||
@ -14,14 +28,20 @@
|
|||||||
<!-- build screen -->
|
<!-- build screen -->
|
||||||
|
|
||||||
<view name="Internal Layout">
|
<view name="Internal Layout">
|
||||||
<bounds left="0" right="25" top="0" bottom="25" />
|
<bounds left="7" right="53" top="7" bottom="48" />
|
||||||
<bezel element="static_black">
|
|
||||||
<bounds left="0" right="25" top="0" bottom="25" />
|
|
||||||
</bezel>
|
|
||||||
|
|
||||||
<bezel name="digit0" element="digit"><bounds x="2.5" y="5" width="10" height="15" /></bezel>
|
<bezel name="digit0" element="digit"><bounds x="20" y="20" width="10" height="15" /></bezel>
|
||||||
<bezel name="digit1" element="digit"><bounds x="12.5" y="5" width="10" height="15" /></bezel>
|
<bezel name="digit1" element="digit"><bounds x="30" y="20" width="10" height="15" /></bezel>
|
||||||
|
|
||||||
|
<bezel element="but"><bounds x="8" y="8" width="10" height="10" /><orientation rotate="90" /></bezel>
|
||||||
|
<bezel element="but"><bounds x="42" y="8" width="10" height="10" /><orientation rotate="180" /></bezel>
|
||||||
|
<bezel element="but"><bounds x="8" y="37" width="10" height="10" /><orientation rotate="0" /></bezel>
|
||||||
|
<bezel element="but"><bounds x="42" y="37" width="10" height="10" /><orientation rotate="270" /></bezel>
|
||||||
|
|
||||||
|
<bezel element="hl" inputtag="IN.0" inputmask="0x01"><bounds x="42" y="8" width="10" height="10" /><color alpha="0.15" /></bezel>
|
||||||
|
<bezel element="hl" inputtag="IN.0" inputmask="0x02"><bounds x="42" y="37" width="10" height="10" /><color alpha="0.15" /></bezel>
|
||||||
|
<bezel element="hl" inputtag="IN.0" inputmask="0x04"><bounds x="8" y="37" width="10" height="10" /><color alpha="0.15" /></bezel>
|
||||||
|
<bezel element="hl" inputtag="IN.0" inputmask="0x08"><bounds x="8" y="8" width="10" height="10" /><color alpha="0.15" /></bezel>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</mamelayout>
|
</mamelayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user