summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author ajrhacker <ajrhacker@users.noreply.github.com>2018-09-24 14:48:56 -0400
committer GitHub <noreply@github.com>2018-09-24 14:48:56 -0400
commitb671894849e1468b8c12fb3a38b4eee3488af795 (patch)
tree90d2cf009fd3462d87d658938193d9f684c47ef6
parentdd0b82a670e3d62c1f4ba4a4b69c83fd827e6421 (diff)
parentaaf0bd37325ee36edf0bf4c7607a9e34f9cd43db (diff)
Merge pull request #4023 from DavidHaywood/240918
added crude lamp layout to "Video 21" so that it is actually worthy of the 'Working' tag
-rw-r--r--src/mame/drivers/video21.cpp75
-rw-r--r--src/mame/layout/video21.lay103
2 files changed, 172 insertions, 6 deletions
diff --git a/src/mame/drivers/video21.cpp b/src/mame/drivers/video21.cpp
index 6a0e2d145f1..08384e91095 100644
--- a/src/mame/drivers/video21.cpp
+++ b/src/mame/drivers/video21.cpp
@@ -18,6 +18,7 @@ To Do:
- CPU clock
- unknown status bits? eg. hopper
- color overlay as seen on flyer upright cabinet
+- no lamp for 'Deal' is this correct?
When booted, press Key out (mapped to W by default) to get it going.
@@ -30,6 +31,7 @@ When booted, press Key out (mapped to W by default) to get it going.
#include "screen.h"
#include "emupal.h"
+#include "video21.lh"
class video21_state : public driver_device
{
@@ -39,18 +41,31 @@ public:
, m_maincpu(*this,"maincpu")
, m_p_videoram(*this, "videoram")
, m_p_chargen(*this, "chargen")
+ , m_lamps(*this, "lamp%u", 0U)
{ }
void video21(machine_config &config);
+protected:
+ virtual void machine_start() override;
+
private:
+ DECLARE_WRITE8_MEMBER(unk_w);
+ DECLARE_WRITE8_MEMBER(lamp1_w);
+ DECLARE_WRITE8_MEMBER(lamp2_w);
+
+ void clear_lamps(device_t &device);
+
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void mem_map(address_map &map);
void io_map(address_map &map);
required_device<cpu_device> m_maincpu;
required_shared_ptr<u8> m_p_videoram;
required_region_ptr<u8> m_p_chargen;
+
+ int m_offcounter;
+ output_finder<24> m_lamps;
};
@@ -86,6 +101,48 @@ uint32_t video21_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
return 0;
}
+WRITE8_MEMBER(video21_state::unk_w)
+{
+ // doesn't appear to be lamps
+ logerror("%s: unk_w %02x\n", machine().describe_context(), data);
+}
+
+WRITE8_MEMBER(video21_state::lamp1_w)
+{
+ for (int i = 0; i < 8; i++)
+ {
+ m_lamps[i+0] = BIT(data, 7-i);
+ }
+ m_offcounter = 8;
+}
+
+WRITE8_MEMBER(video21_state::lamp2_w)
+{
+ for (int i = 0; i < 8; i++)
+ {
+ m_lamps[i+8] = BIT(data, 7-i);
+ }
+ m_offcounter = 8;
+}
+
+void video21_state::clear_lamps(device_t &device)
+{
+ // the game stops writing the lamp values in certain situations and expects the lamps to turn off automatically (decay?)
+ // eg. if you select 'take' in the 'take' or 'stand' choice
+
+ if (m_offcounter > 0)
+ m_offcounter--;
+
+ if (m_offcounter == 0)
+ {
+ for (int i = 0; i < 16; i++)
+ {
+ m_lamps[i] = 0;
+ }
+ }
+}
+
+
void video21_state::mem_map(address_map &map) {
map(0x0000,0x0fff).rom().mirror(0x3000);
map(0xe000,0xe3ff).ram().share("videoram");
@@ -93,9 +150,9 @@ void video21_state::mem_map(address_map &map) {
}
void video21_state::io_map(address_map &map) {
- map(0x02,0x02).nopw(); // lots of unknown writes, might be some kind of dac
- map(0x04,0x04); //.w unknown write
- map(0x08,0x08); //.w unknown write
+ map(0x02,0x02).w(FUNC(video21_state::unk_w)); // lots of unknown writes, might be some kind of dac
+ map(0x04,0x04).w(FUNC(video21_state::lamp1_w));
+ map(0x08,0x08).w(FUNC(video21_state::lamp2_w));
map(0x41,0x41).portr("IN41");
map(0x42,0x42).portr("IN42");
map(0x44,0x44).portr("IN44");
@@ -128,8 +185,8 @@ static INPUT_PORTS_START( video21 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )
PORT_START("IN42")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_STAND )
@@ -180,12 +237,18 @@ static GFXDECODE_START( gfx_video21 )
GFXDECODE_ENTRY( "chargen", 0x0000, video21_charlayout, 0, 1 )
GFXDECODE_END
+void video21_state::machine_start()
+{
+ m_lamps.resolve();
+}
+
void video21_state::video21(machine_config &config)
{
/* basic machine hardware */
I8080A(config, m_maincpu, 20.79_MHz_XTAL / 10); // crystal confirmed but divisor unknown (divider appears to be 74LS160)
m_maincpu->set_addrmap(AS_PROGRAM, &video21_state::mem_map);
m_maincpu->set_addrmap(AS_IO, &video21_state::io_map);
+ m_maincpu->set_periodic_int(FUNC(video21_state::clear_lamps), attotime::from_hz(240));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -220,4 +283,4 @@ ROM_START( video21 )
ROM_LOAD_NIB_LOW ( "lich_gfx.43", 0x0000, 0x0400, CRC(0ecb0aab) SHA1(7f3f1b93a5d38828ae3e97e5f8ef1a6a96dc798b) )
ROM_END
-GAME(1980, video21, 0, video21, video21, video21_state, empty_init, ROT0, "Video Games GmbH", "Video 21", MACHINE_NO_SOUND)
+GAMEL(1980, video21, 0, video21, video21, video21_state, empty_init, ROT0, "Video Games GmbH", "Video 21", MACHINE_NO_SOUND, layout_video21)
diff --git a/src/mame/layout/video21.lay b/src/mame/layout/video21.lay
new file mode 100644
index 00000000000..8a6237eeb9e
--- /dev/null
+++ b/src/mame/layout/video21.lay
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+ <element name="Out0_80" defstate="0">
+ <rect state="1">
+ <color red="0.80" green="0.80" blue="0.80" />
+ </rect>
+ <rect state="0">
+ <color red="0.10" green="0.10" blue="0.10" />
+ </rect>
+ <text string="Start">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
+ </text>
+ </element>
+
+ <element name="Out0_40" defstate="0">
+ <rect state="1">
+ <color red="0.80" green="0.80" blue="0.80" />
+ </rect>
+ <rect state="0">
+ <color red="0.10" green="0.10" blue="0.10" />
+ </rect>
+ <text string="Take">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
+ </text>
+ </element>
+
+ <element name="Out0_20" defstate="0">
+ <rect state="1">
+ <color red="0.80" green="0.80" blue="0.80" />
+ </rect>
+ <rect state="0">
+ <color red="0.10" green="0.10" blue="0.10" />
+ </rect>
+ <text string="Stand">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
+ </text>
+ </element>
+
+ <element name="Out0_04" defstate="0">
+ <rect state="1">
+ <color red="0.80" green="0.80" blue="0.80" />
+ </rect>
+ <rect state="0">
+ <color red="0.10" green="0.10" blue="0.10" />
+ </rect>
+ <text string="Cabinet?">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
+ </text>
+ </element>
+
+ <element name="Out1_20" defstate="0">
+ <rect state="1">
+ <color red="0.80" green="0.80" blue="0.80" />
+ </rect>
+ <rect state="0">
+ <color red="0.10" green="0.10" blue="0.10" />
+ </rect>
+ <text string="Bet">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
+ </text>
+ </element>
+
+ <element name="deal" defstate="0">
+ <rect state="0">
+ <color red="0.10" green="1.00" blue="0.10" />
+ </rect>
+ <text string="Deal">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0.1" y="0.25" width="0.8" height="0.5" />
+ </text>
+ </element>
+
+ <view name="Button Lamps">
+ <screen index="0">
+ <bounds left="0" top="0" right="4" bottom="3" />
+ </screen>
+
+ <bezel name="lamp0" element="Out0_80" inputtag="IN42" inputmask="0x04">
+ <bounds x="0.00" y="3.10" width="0.20" height="0.14" />
+ </bezel>
+ <bezel name="lamp1" element="Out0_40" inputtag="IN42" inputmask="0x08">
+ <bounds x="0.25" y="3.10" width="0.20" height="0.14" />
+ </bezel>
+ <bezel name="lamp2" element="Out0_20" inputtag="IN42" inputmask="0x10">
+ <bounds x="0.50" y="3.10" width="0.20" height="0.14" />
+ </bezel>
+ <bezel name="lamp10" element="Out1_20" inputtag="IN44" inputmask="0x10">
+ <bounds x="2.50" y="3.10" width="0.20" height="0.14" />
+ </bezel>
+
+ <!-- no lamp associated with this? -->
+ <bezel name="deal" element="deal" inputtag="IN42" inputmask="0x80">
+ <bounds x="3.75" y="3.10" width="0.20" height="0.14" />
+ </bezel>
+
+ </view>
+</mamelayout>