summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar hap <happppp@users.noreply.github.com>2020-02-26 14:47:05 +0100
committerGravatarGravatar hap <happppp@users.noreply.github.com>2020-02-26 14:47:05 +0100
commit5ed9f4c1aa56757f611e74b41c057969806b1c64 (patch) (github)
tree485f701b9705d9462fb32f6c53a36db13752b1c8
parentc2332dbf6a9000891c3f2c43853858e3e99434f9 (diff)
downloadmame-5ed9f4c1aa56757f611e74b41c057969806b1c64.tar.bz2
mame-5ed9f4c1aa56757f611e74b41c057969806b1c64.zip
trivia madness: less lamp flicker (nw)
-rw-r--r--src/mame/drivers/trvmadns.cpp44
-rw-r--r--src/mame/layout/trvmadns.lay12
2 files changed, 30 insertions, 26 deletions
diff --git a/src/mame/drivers/trvmadns.cpp b/src/mame/drivers/trvmadns.cpp
index 8c458f4df1a..01784c2da48 100644
--- a/src/mame/drivers/trvmadns.cpp
+++ b/src/mame/drivers/trvmadns.cpp
@@ -30,7 +30,7 @@ N U12 U16 U20 U28 U34 |
+---------------------------------------------+
CPU board:
- CPU: Z84000ABI Z80 cpu
+ CPU: Z84000AB1 Z80 cpu
Sound: AY-3-8910
RAM: AMD AM9128-15PC (2048x8 Static RAM)
OSC: 10.000MHz
@@ -83,13 +83,16 @@ Technology = NMOS
- fix palette
- fix tilemap colors
- remove hack for irq0 firing
- - add nvram
+ - nvram does not work
*/
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/nvram.h"
#include "sound/ay8910.h"
+#include "video/pwm.h"
+
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@@ -103,12 +106,12 @@ public:
trvmadns_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_lamps(*this, "lamps"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_generic_paletteram_8(*this, "paletteram"),
m_gfxram(*this, "gfxram"),
- m_tileram(*this, "tileram"),
- m_lamps(*this, "button_%u", 1U)
+ m_tileram(*this, "tileram")
{ }
void trvmadns(machine_config &config);
@@ -120,25 +123,28 @@ protected:
private:
required_device<cpu_device> m_maincpu;
+ required_device<pwm_display_device> m_lamps;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_generic_paletteram_8;
required_shared_ptr<uint8_t> m_gfxram;
required_shared_ptr<uint8_t> m_tileram;
- output_finder<6> m_lamps;
+
+ void cpu_map(address_map &map);
+ void io_map(address_map &map);
tilemap_t *m_bg_tilemap;
int m_old_data;
+
DECLARE_WRITE8_MEMBER(trvmadns_banking_w);
DECLARE_WRITE8_MEMBER(trvmadns_gfxram_w);
DECLARE_WRITE8_MEMBER(trvmadns_palette_w);
- DECLARE_WRITE8_MEMBER(w2);
+ DECLARE_WRITE8_MEMBER(unknown_w);
DECLARE_WRITE8_MEMBER(lamps_w);
DECLARE_WRITE8_MEMBER(trvmadns_tileram_w);
+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
uint32_t screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void cpu_map(address_map &map);
- void io_map(address_map &map);
};
@@ -234,11 +240,11 @@ WRITE8_MEMBER(trvmadns_state::trvmadns_palette_w)
}
-WRITE8_MEMBER(trvmadns_state::w2)
+WRITE8_MEMBER(trvmadns_state::unknown_w)
{
/* static int old = -1;
if(data!=old)
- logerror("w2 = %02X\n",old=data);
+ logerror("unknown_w = %02X\n",old=data);
*/
}
@@ -248,13 +254,7 @@ WRITE8_MEMBER(trvmadns_state::lamps_w)
// -6------ start button led
// --5----- not used
// ---43210 button lamps 5 to 1
-
- m_lamps[0] = BIT(data, 0); // button 1
- m_lamps[1] = BIT(data, 1); // button 2
- m_lamps[2] = BIT(data, 2); // button 3
- m_lamps[3] = BIT(data, 3); // button 4
- m_lamps[4] = BIT(data, 4); // button 5
- m_lamps[5] = BIT(data, 6); // button start
+ m_lamps->matrix(1, data);
}
WRITE8_MEMBER(trvmadns_state::trvmadns_tileram_w)
@@ -281,10 +281,10 @@ void trvmadns_state::cpu_map(address_map &map)
map(0x6000, 0x6fff).bankr("bank1");
map(0x7000, 0x7fff).bankr("bank2");
map(0x6000, 0x7fff).w(FUNC(trvmadns_state::trvmadns_gfxram_w)).share("gfxram");
- map(0x8000, 0x87ff).ram(); // u3
+ map(0x8000, 0x87ff).ram().share("nvram"); // u3
map(0xa000, 0xa7ff).ram().w(FUNC(trvmadns_state::trvmadns_tileram_w)).share("tileram"); // u17
map(0xc000, 0xc01f).ram().w(FUNC(trvmadns_state::trvmadns_palette_w)).share("paletteram");
- map(0xe000, 0xe000).w(FUNC(trvmadns_state::w2));//NOP
+ map(0xe000, 0xe000).w(FUNC(trvmadns_state::unknown_w));//NOP
map(0xe004, 0xe004).w(FUNC(trvmadns_state::lamps_w));
}
@@ -401,7 +401,6 @@ uint32_t trvmadns_state::screen_update_trvmadns(screen_device &screen, bitmap_in
void trvmadns_state::machine_start()
{
- m_lamps.resolve();
}
void trvmadns_state::machine_reset()
@@ -415,6 +414,8 @@ void trvmadns_state::trvmadns(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &trvmadns_state::cpu_map);
m_maincpu->set_addrmap(AS_IO, &trvmadns_state::io_map);
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
@@ -428,6 +429,9 @@ void trvmadns_state::trvmadns(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_trvmadns);
PALETTE(config, m_palette).set_entries(16);
+ PWM_DISPLAY(config, m_lamps).set_size(1, 8);
+ m_lamps->set_bri_levels(0.9);
+
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/layout/trvmadns.lay b/src/mame/layout/trvmadns.lay
index 9a358c81465..512405e3096 100644
--- a/src/mame/layout/trvmadns.lay
+++ b/src/mame/layout/trvmadns.lay
@@ -33,22 +33,22 @@ Simple layout for Trivia Madness
<screen index="0">
<bounds left="0" top="0" right="640" bottom="480" />
</screen>
- <cpanel name="button_1" element="button" inputtag="IN0" inputmask="0x01">
+ <cpanel name="0.0" element="button" inputtag="IN0" inputmask="0x01">
<bounds x="80" y="505" width="70" height="35" />
</cpanel>
- <cpanel name="button_2" element="button" inputtag="IN0" inputmask="0x02">
+ <cpanel name="0.1" element="button" inputtag="IN0" inputmask="0x02">
<bounds x="180" y="505" width="70" height="35" />
</cpanel>
- <cpanel name="button_3" element="button" inputtag="IN0" inputmask="0x04">
+ <cpanel name="0.2" element="button" inputtag="IN0" inputmask="0x04">
<bounds x="280" y="505" width="70" height="35" />
</cpanel>
- <cpanel name="button_4" element="button" inputtag="IN0" inputmask="0x08">
+ <cpanel name="0.3" element="button" inputtag="IN0" inputmask="0x08">
<bounds x="380" y="505" width="70" height="35" />
</cpanel>
- <cpanel name="button_5" element="button" inputtag="IN0" inputmask="0x10">
+ <cpanel name="0.4" element="button" inputtag="IN0" inputmask="0x10">
<bounds x="480" y="505" width="70" height="35" />
</cpanel>
- <cpanel name="button_6" element="start" inputtag="IN0" inputmask="0x40">
+ <cpanel name="0.6" element="start" inputtag="IN0" inputmask="0x40">
<bounds x="250" y="565" width="130" height="35" />
</cpanel>
</view>