summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2020-01-24 18:44:20 +0700
committer Patrick Mackinlay <pmackinlay@hotmail.com>2020-01-24 18:44:20 +0700
commita087ebaadb90212aab36a9059c8f3d021ff71bf7 (patch)
tree58aaac608f570bf61815281a806f79c523012e5c
parente04e69b353d2013fae04006c23248ec2e912e1aa (diff)
jazz: diagnostic led (nw)
-rw-r--r--src/mame/drivers/jazz.cpp40
-rw-r--r--src/mame/includes/jazz.h7
-rw-r--r--src/mame/layout/jazz.lay25
3 files changed, 62 insertions, 10 deletions
diff --git a/src/mame/drivers/jazz.cpp b/src/mame/drivers/jazz.cpp
index b994c22ea0a..e74aaee15f1 100644
--- a/src/mame/drivers/jazz.cpp
+++ b/src/mame/drivers/jazz.cpp
@@ -60,11 +60,14 @@
#include "debugger.h"
+#include "jazz.lh"
+
#define VERBOSE 0
#include "logmacro.h"
void jazz_state::machine_start()
{
+ m_led.resolve();
}
void jazz_state::machine_reset()
@@ -124,13 +127,7 @@ void jazz_state::jazz_common_map(address_map &map)
//map(0x8000d000, 0x8000dfff).noprw(); // dummy dma device?
map(0x8000d600, 0x8000d607).nopw();
- map(0x8000f000, 0x8000f007).lrw8(
- NAME([this] () { return m_led; }),
- NAME([this] (u8 data)
- {
- logerror("led 0x%02x (%s)\n", data, machine().describe_context());
- m_led = data;
- })).umask64(0xff);
+ map(0x8000f000, 0x8000f007).w(FUNC(jazz_state::led_w)).umask64(0xff);
// lots of byte data written to 800
//map(0x800e0000, 0x800fffff).m() // dram config
@@ -312,6 +309,35 @@ void jazz_state::jazz(machine_config &config)
m_isp->out_spkr_cb().set(m_buzzer, FUNC(speaker_sound_device::level_w));
// TODO: 4 EISA slots
+
+ config.set_default_layout(layout_jazz);
+}
+
+void jazz_state::led_w(u8 data)
+{
+ // 7-segment diagnostic led
+ static u8 const patterns[16] =
+ {
+ // test output
+ 0x3f, // mct-adr 0
+ 0x06, // network 1
+ 0x5b, // scsi 2
+ 0x4f, // floppy 3
+ 0x66, // isp/rtc 4
+ 0x6d, // keyboard 5
+ 0x7d, // serial 6
+ 0x07, // nvram 7
+ 0x7f, // 8?
+ 0x6f, // video 9
+ 0x77, // memory A
+ 0x40, // -
+ 0x39, // flash C
+ 0x00, // (blank)
+ 0x79, // cpu E
+ 0x71, // F?
+ };
+
+ m_led = patterns[data & 0xf] | (BIT(data, 4) ? 0x80 : 0);
}
void jazz_state::mmr4000be(machine_config &config)
diff --git a/src/mame/includes/jazz.h b/src/mame/includes/jazz.h
index 793b7410ee1..449035a4293 100644
--- a/src/mame/includes/jazz.h
+++ b/src/mame/includes/jazz.h
@@ -66,6 +66,7 @@ public:
, m_lpt(*this, "lpt")
, m_isp(*this, "isp")
, m_buzzer(*this, "buzzer")
+ , m_led(*this, "led0")
{
}
@@ -80,6 +81,8 @@ protected:
// machine config
void jazz(machine_config &config);
+ void led_w(u8 data);
+
public:
void mmr4000be(machine_config &config);
void mmr4000le(machine_config &config);
@@ -109,9 +112,7 @@ protected:
required_device<i82357_device> m_isp;
required_device<speaker_sound_device> m_buzzer;
-private:
- // machine state
- u8 m_led;
+ output_finder<> m_led;
};
#endif // MAME_INCLUDES_JAZZ_H
diff --git a/src/mame/layout/jazz.lay b/src/mame/layout/jazz.lay
new file mode 100644
index 00000000000..7e6aaf4988e
--- /dev/null
+++ b/src/mame/layout/jazz.lay
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!--
+license:CC0
+copyright-holders:Patrick Mackinlay
+Jazz graphics display with 7-segment diagnostic LED.
+
+TODO
+ - network/disk/floppy activity?
+ - keyboard indicators?
+-->
+<mamelayout version="2">
+ <element name="led" defstate="0">
+ <led7seg>
+ <color red="0.0" green="1.0" blue="0.0" />
+ </led7seg>
+ </element>
+ <view name="Graphics">
+ <screen index="0">
+ <bounds x="0" y="0" width="1280" height="1024" />
+ </screen>
+ <bezel name="led0" element="led">
+ <bounds x="1240" y="1024" width="40" height="50" />
+ </bezel>
+ </view>
+</mamelayout>