mirror of
https://github.com/holub/mame
synced 2025-05-29 09:03:08 +03:00
spirit76: Added a layout.
This commit is contained in:
parent
513f368bec
commit
4f2dac91e0
@ -25,13 +25,17 @@ Switch at G6 (sw1-4 = free game scores, sw5-8 = config), at G8 (coin chute setti
|
||||
#include "cpu/m6800/m6800.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "machine/timer.h"
|
||||
#include "spirit76.lh"
|
||||
|
||||
class spirit76_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
spirit76_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: genpin_class(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu") { }
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_digit(*this, "digit%u", 0U)
|
||||
, m_led(*this, "led%u", 0U)
|
||||
{ }
|
||||
|
||||
void spirit76(machine_config &config);
|
||||
|
||||
@ -45,9 +49,14 @@ private:
|
||||
u8 unk_r();
|
||||
void maincpu_map(address_map &map);
|
||||
|
||||
u8 m_t_c;
|
||||
u8 m_t_c = 0;
|
||||
bool m_op_sw = 0;
|
||||
u8 m_segments = 0;
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
output_finder<16> m_digit;
|
||||
output_finder<7> m_led;
|
||||
};
|
||||
|
||||
void spirit76_state::maincpu_map(address_map &map)
|
||||
@ -64,10 +73,56 @@ void spirit76_state::maincpu_map(address_map &map)
|
||||
|
||||
|
||||
static INPUT_PORTS_START( spirit76 )
|
||||
PORT_START("DSW0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_START("DSW1")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_START("G6")
|
||||
PORT_DIPNAME( 0x80, 0x00, "SW 1")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x80, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x40, 0x00, "SW 2")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x40, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x20, 0x00, "SW 3")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x20, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x10, 0x00, "SW 4")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x10, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x08, 0x00, "SW 5")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x08, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x04, 0x00, "SW 6")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x04, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x02, 0x00, "SW 7")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x02, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x01, 0x00, "SW 8")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x01, DEF_STR(On))
|
||||
PORT_START("G8")
|
||||
PORT_DIPNAME( 0x80, 0x00, "SW 9")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x80, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x40, 0x00, "SW 10")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x40, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x20, 0x00, "SW 11")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x20, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x10, 0x00, "SW 12")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x10, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x08, 0x00, "SW 13")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x08, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x04, 0x00, "SW 14")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x04, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x02, 0x00, "SW 15")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x02, DEF_STR(On))
|
||||
PORT_DIPNAME( 0x01, 0x00, "SW 16")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off))
|
||||
PORT_DIPSETTING( 0x01, DEF_STR(On))
|
||||
INPUT_PORTS_END
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( spirit76_state::irq )
|
||||
@ -78,16 +133,25 @@ TIMER_DEVICE_CALLBACK_MEMBER( spirit76_state::irq )
|
||||
m_t_c++;
|
||||
}
|
||||
|
||||
|
||||
// continual write in irq routine
|
||||
void spirit76_state::porta_w(u8 data)
|
||||
{
|
||||
printf("PORT A=%X\n",data);
|
||||
static constexpr uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // unknown decoder that blanks out 10-15
|
||||
printf("PORT A=%02X ",data);
|
||||
m_op_sw = true;
|
||||
m_segments = patterns[~data & 15];
|
||||
}
|
||||
|
||||
// continual write in irq routine
|
||||
void spirit76_state::portb_w(u8 data)
|
||||
{
|
||||
printf("PORT B=%X\n",data);
|
||||
printf("PORT B=%02X ",data);
|
||||
if (m_op_sw)
|
||||
{
|
||||
m_digit[data & 15] = m_segments;
|
||||
m_op_sw = false;
|
||||
}
|
||||
}
|
||||
|
||||
// continual read in irq routine
|
||||
@ -107,7 +171,7 @@ u8 spirit76_state::portb_r()
|
||||
// writes here once at start
|
||||
void spirit76_state::unk_w(u8 data)
|
||||
{
|
||||
printf("UNK PORT=%X\n",data);
|
||||
printf("UNK PORT=%02X\n",data);
|
||||
}
|
||||
|
||||
// continual read in irq routine
|
||||
@ -116,6 +180,12 @@ u8 spirit76_state::unk_r()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void spirit76_state::machine_start()
|
||||
{
|
||||
m_digit.resolve();
|
||||
m_led.resolve();
|
||||
}
|
||||
|
||||
void spirit76_state::machine_reset()
|
||||
{
|
||||
m_t_c = 0;
|
||||
@ -130,7 +200,7 @@ void spirit76_state::spirit76(machine_config &config)
|
||||
TIMER(config, "irq").configure_periodic(FUNC(spirit76_state::irq), attotime::from_hz(120));
|
||||
|
||||
/* video hardware */
|
||||
//config.set_default_layout();
|
||||
config.set_default_layout(layout_spirit76);
|
||||
|
||||
//6821pia
|
||||
pia6821_device &pia(PIA6821(config, "pia", 0));
|
||||
|
99
src/mame/layout/spirit76.lay
Normal file
99
src/mame/layout/spirit76.lay
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
license:CC0
|
||||
copyright-holders:Robbbert
|
||||
-->
|
||||
<mamelayout version="2">
|
||||
<element name="digit" defstate="0">
|
||||
<led7seg>
|
||||
<color red="0.75" green="0" blue="0.0" />
|
||||
</led7seg>
|
||||
</element>
|
||||
<element name="red_led" defstate="0">
|
||||
<disk state="1">
|
||||
<color red="0.75" green="0.0" blue="0.0" />
|
||||
</disk>
|
||||
<disk state="0">
|
||||
<color red="0.09375" green="0.0" blue="0.0" />
|
||||
</disk>
|
||||
</element>
|
||||
|
||||
<element name="T1"><text string="FIRST PLAYER"><color red="1.0" green="1.0" blue="1.0" /></text></element>
|
||||
<element name="T2"><text string="SECOND PLAYER"><color red="1.0" green="1.0" blue="1.0" /></text></element>
|
||||
<element name="T3"><text string="BALL"><color red="1.0" green="1.0" blue="1.0" /></text></element>
|
||||
<element name="T4"><text string="CREDIT"><color red="1.0" green="1.0" blue="1.0" /></text></element>
|
||||
|
||||
<group name="6x7">
|
||||
<repeat count="6">
|
||||
<param name="n" start="~s~" increment="1" />
|
||||
<param name="x" start="~t~" increment="20" />
|
||||
<element name="digit~n~" ref="digit">
|
||||
<bounds x="~x~" y="30" width="18" height="24" />
|
||||
</element>
|
||||
</repeat>
|
||||
</group>
|
||||
|
||||
<group name="2x7">
|
||||
<repeat count="2">
|
||||
<param name="n" start="~s~" increment="1" />
|
||||
<param name="x" start="200" increment="20" />
|
||||
<param name="y" start="~t~" increment="0" />
|
||||
<element name="digit~n~" ref="digit">
|
||||
<bounds x="~x~" y="~y~" width="18" height="24" />
|
||||
</element>
|
||||
</repeat>
|
||||
</group>
|
||||
|
||||
<group name="balls">
|
||||
<repeat count="5">
|
||||
<param name="n" start="0" increment="1" />
|
||||
<param name="y" start="26" increment="10" />
|
||||
<element name="led~n~" ref="red_led">
|
||||
<bounds x="183" y="~y~" width="6" height="6" />
|
||||
</element>
|
||||
</repeat>
|
||||
</group>
|
||||
|
||||
<view name="Standard">
|
||||
<bounds left="5" top="5" right="445" bottom="87" />
|
||||
|
||||
<!-- Player 1 -->
|
||||
<param name="s" value="0" /><!-- first digit number -->
|
||||
<param name="t" value="30" /><!-- first x-coordinate -->
|
||||
<group ref="6x7"></group>
|
||||
|
||||
<!-- Player 2 -->
|
||||
<param name="s" value="10" />
|
||||
<param name="t" value="300" />
|
||||
<group ref="6x7"></group>
|
||||
|
||||
<!-- Ball in play -->
|
||||
<group ref="balls"></group>
|
||||
|
||||
<!-- Credits -->
|
||||
<param name="s" value="8" />
|
||||
<param name="t" value="20" />
|
||||
<group ref="2x7">
|
||||
</group>
|
||||
|
||||
<!-- Match -->
|
||||
<param name="s" value="6" />
|
||||
<param name="t" value="55" />
|
||||
<group ref="2x7">
|
||||
</group>
|
||||
|
||||
<!-- Text Labels -->
|
||||
<element ref="T1"><bounds left="30" right="150" top="10" bottom="20" /></element>
|
||||
<element ref="T2"><bounds left="290" right="420" top="10" bottom="20" /></element>
|
||||
<element ref="T3"><bounds left="174" right="190" top="8" bottom="16" /></element>
|
||||
<element ref="T4"><bounds left="200" right="240" top="8" bottom="16" /></element>
|
||||
|
||||
<!-- Player-up LED -->
|
||||
<element name="led5" ref="red_led"><!-- Player 1's turn -->
|
||||
<bounds x="40" y="12" width="7" height="7" />
|
||||
</element>
|
||||
<element name="led6" ref="red_led">
|
||||
<bounds x="310" y="12" width="7" height="7" />
|
||||
</element>
|
||||
</view>
|
||||
</mamelayout>
|
Loading…
Reference in New Issue
Block a user