summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/cpu/cop400/cop400.cpp47
-rw-r--r--src/devices/cpu/cop400/cop400.h9
-rw-r--r--src/devices/cpu/powerpc/ppccom.cpp90
-rw-r--r--src/devices/machine/netlist.cpp2
-rw-r--r--src/devices/machine/z80scc.cpp44
-rw-r--r--src/devices/machine/z80scc.h7
-rw-r--r--src/devices/machine/z80sio.cpp19
-rw-r--r--src/devices/video/vooddefs.h197
-rw-r--r--src/devices/video/voodoo.cpp2
-rw-r--r--src/devices/video/voodoo.h6
-rw-r--r--src/emu/debug/debugcon.cpp8
-rw-r--r--src/emu/debug/debugcon.h2
-rw-r--r--src/emu/debug/debugcpu.cpp8
-rw-r--r--src/emu/distate.cpp146
-rw-r--r--src/emu/distate.h127
-rw-r--r--src/emu/video/rgbgen.h6
-rw-r--r--src/emu/video/rgbsse.h6
-rw-r--r--src/emu/video/rgbvmx.h7
-rw-r--r--src/frontend/mame/ui/selgame.cpp18
-rw-r--r--src/mame/drivers/cyberbal.cpp56
-rw-r--r--src/mame/drivers/namcos1.cpp4
-rw-r--r--src/mame/drivers/notechan.cpp124
-rw-r--r--src/mame/drivers/qix.cpp22
-rw-r--r--src/mame/drivers/segas16b.cpp2
-rw-r--r--src/mame/mame.lst1
25 files changed, 601 insertions, 359 deletions
diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp
index 30b1680150a..696e504835d 100644
--- a/src/devices/cpu/cop400/cop400.cpp
+++ b/src/devices/cpu/cop400/cop400.cpp
@@ -1117,9 +1117,10 @@ void cop400_cpu_device::device_start()
// setup debugger state display
offs_t pc_mask = m_program->addrmask();
+ using namespace std::placeholders;
state_add(STATE_GENPC, "GENPC", m_pc).mask(pc_mask).noshow();
state_add(STATE_GENPCBASE, "CURPC", m_prevpc).mask(pc_mask).noshow();
- state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).mask(0x7).callimport().callexport().noshow().formatstr("%3s");
+ state_add<uint8_t>(STATE_GENFLAGS, "GENFLAGS", std::bind(&cop400_cpu_device::get_flags, this), std::bind(&cop400_cpu_device::set_flags, this, _1)).mask(0x7).noshow().formatstr("%3s");
state_add(COP400_PC, "PC", m_pc).mask(pc_mask);
state_add(COP400_SA, "SA", m_sa).mask(pc_mask);
state_add(COP400_SB, "SB", m_sb).mask(pc_mask);
@@ -1127,7 +1128,7 @@ void cop400_cpu_device::device_start()
state_add(COP400_SC, "SC", m_sc).mask(pc_mask);
state_add(COP400_B, "B", m_b);
state_add(COP400_A, "A", m_a).mask(0xf);
- state_add(COP400_M, "M", m_temp_m).mask(0xf).callimport().callexport();
+ state_add<uint8_t>(COP400_M, "M", std::bind(&cop400_cpu_device::get_m, this), std::bind(&cop400_cpu_device::set_m, this, _1)).mask(0xf);
state_add(COP400_G, "G", m_g).mask(0xf);
state_add(COP400_Q, "Q", m_q);
state_add(COP400_SIO, "SIO", m_sio).mask(0xf).formatstr("%4s");
@@ -1145,8 +1146,6 @@ void cop400_cpu_device::device_start()
m_sb = 0;
m_sc = 0;
m_sio = 0;
- m_flags = 0;
- m_temp_m = 0;
m_il = 0;
m_in[0] = m_in[1] = m_in[2] = m_in[3] = 0;
m_si = 0;
@@ -1309,36 +1308,28 @@ void cop400_cpu_device::execute_run()
GENERAL CONTEXT ACCESS
***************************************************************************/
-void cop400_cpu_device::state_import(const device_state_entry &entry)
+uint8_t cop400_cpu_device::get_flags() const
{
- switch (entry.index())
- {
- case STATE_GENFLAGS:
- m_skt_latch = BIT(m_flags, 2);
- m_c = BIT(m_flags, 1);
- m_skl = BIT(m_flags, 0);
- break;
+ return (m_skt_latch ? 0x04 : 0x00) | (m_c ? 0x02 : 0x00) | (m_skl ? 0x01 : 0x00);
+}
- case COP400_M:
- auto dis = machine().disable_side_effect();
- RAM_W(B, m_temp_m);
- break;
- }
+void cop400_cpu_device::set_flags(uint8_t flags)
+{
+ m_skt_latch = BIT(flags, 2);
+ m_c = BIT(flags, 1);
+ m_skl = BIT(flags, 0);
}
-void cop400_cpu_device::state_export(const device_state_entry &entry)
+uint8_t cop400_cpu_device::get_m() const
{
- switch (entry.index())
- {
- case STATE_GENFLAGS:
- m_flags = (m_skt_latch ? 0x04 : 0x00) | (m_c ? 0x02 : 0x00) | (m_skl ? 0x01 : 0x00);
- break;
+ auto dis = machine().disable_side_effect();
+ return RAM_R(B);
+}
- case COP400_M:
- auto dis = machine().disable_side_effect();
- m_temp_m = RAM_R(B);
- break;
- }
+void cop400_cpu_device::set_m(uint8_t m)
+{
+ auto dis = machine().disable_side_effect();
+ RAM_W(B, m);
}
void cop400_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const
diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h
index 13461ffe583..3a047d10c8a 100644
--- a/src/devices/cpu/cop400/cop400.h
+++ b/src/devices/cpu/cop400/cop400.h
@@ -162,8 +162,6 @@ protected:
virtual space_config_vector memory_space_config() const override;
// device_state_interface overrides
- virtual void state_import(const device_state_entry &entry) override;
- virtual void state_export(const device_state_entry &entry) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
// device_disasm_interface overrides
@@ -226,8 +224,6 @@ protected:
uint16_t m_sa, m_sb, m_sc; /* subroutine save registers */
uint8_t m_sio; /* 4-bit shift register and counter */
int m_skl; /* 1-bit latch for SK output */
- uint8_t m_flags; // used for debugger state only
- uint8_t m_temp_m; // 4-bit RAM at B (for debugger state only)
/* counter */
uint8_t m_t; /* 8-bit timer */
@@ -289,6 +285,11 @@ protected:
void skip();
void sk_update();
+ uint8_t get_flags() const;
+ void set_flags(uint8_t flags);
+ uint8_t get_m() const;
+ void set_m(uint8_t m);
+
void illegal(uint8_t operand);
void asc(uint8_t operand);
void add(uint8_t operand);
diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp
index 56a7325c460..d9b4cf3ba96 100644
--- a/src/devices/cpu/powerpc/ppccom.cpp
+++ b/src/devices/cpu/powerpc/ppccom.cpp
@@ -799,88 +799,14 @@ void ppc_device::device_start()
state_add(PPC_TBL, "TBL", m_debugger_temp).callimport().callexport().formatstr("%08X");
state_add(PPC_DEC, "DEC", m_debugger_temp).callimport().callexport().formatstr("%08X");
- state_add(PPC_SR0, "SR0", m_core->sr[0]).formatstr("%08X");
- state_add(PPC_SR1, "SR1", m_core->sr[1]).formatstr("%08X");
- state_add(PPC_SR2, "SR2", m_core->sr[2]).formatstr("%08X");
- state_add(PPC_SR3, "SR3", m_core->sr[3]).formatstr("%08X");
- state_add(PPC_SR4, "SR4", m_core->sr[4]).formatstr("%08X");
- state_add(PPC_SR5, "SR5", m_core->sr[5]).formatstr("%08X");
- state_add(PPC_SR6, "SR6", m_core->sr[6]).formatstr("%08X");
- state_add(PPC_SR7, "SR7", m_core->sr[7]).formatstr("%08X");
- state_add(PPC_SR8, "SR8", m_core->sr[8]).formatstr("%08X");
- state_add(PPC_SR9, "SR9", m_core->sr[9]).formatstr("%08X");
- state_add(PPC_SR10, "SR10", m_core->sr[10]).formatstr("%08X");
- state_add(PPC_SR11, "SR11", m_core->sr[11]).formatstr("%08X");
- state_add(PPC_SR12, "SR12", m_core->sr[12]).formatstr("%08X");
- state_add(PPC_SR13, "SR13", m_core->sr[13]).formatstr("%08X");
- state_add(PPC_SR14, "SR14", m_core->sr[14]).formatstr("%08X");
- state_add(PPC_SR15, "SR15", m_core->sr[15]).formatstr("%08X");
-
- state_add(PPC_R0, "R0", m_core->r[0]).formatstr("%08X");
- state_add(PPC_R1, "R1", m_core->r[1]).formatstr("%08X");
- state_add(PPC_R2, "R2", m_core->r[2]).formatstr("%08X");
- state_add(PPC_R3, "R3", m_core->r[3]).formatstr("%08X");
- state_add(PPC_R4, "R4", m_core->r[4]).formatstr("%08X");
- state_add(PPC_R5, "R5", m_core->r[5]).formatstr("%08X");
- state_add(PPC_R6, "R6", m_core->r[6]).formatstr("%08X");
- state_add(PPC_R7, "R7", m_core->r[7]).formatstr("%08X");
- state_add(PPC_R8, "R8", m_core->r[8]).formatstr("%08X");
- state_add(PPC_R9, "R9", m_core->r[9]).formatstr("%08X");
- state_add(PPC_R10, "R10", m_core->r[10]).formatstr("%08X");
- state_add(PPC_R11, "R11", m_core->r[11]).formatstr("%08X");
- state_add(PPC_R12, "R12", m_core->r[12]).formatstr("%08X");
- state_add(PPC_R13, "R13", m_core->r[13]).formatstr("%08X");
- state_add(PPC_R14, "R14", m_core->r[14]).formatstr("%08X");
- state_add(PPC_R15, "R15", m_core->r[15]).formatstr("%08X");
- state_add(PPC_R16, "R16", m_core->r[16]).formatstr("%08X");
- state_add(PPC_R17, "R17", m_core->r[17]).formatstr("%08X");
- state_add(PPC_R18, "R18", m_core->r[18]).formatstr("%08X");
- state_add(PPC_R19, "R19", m_core->r[19]).formatstr("%08X");
- state_add(PPC_R20, "R20", m_core->r[20]).formatstr("%08X");
- state_add(PPC_R21, "R21", m_core->r[21]).formatstr("%08X");
- state_add(PPC_R22, "R22", m_core->r[22]).formatstr("%08X");
- state_add(PPC_R23, "R23", m_core->r[23]).formatstr("%08X");
- state_add(PPC_R24, "R24", m_core->r[24]).formatstr("%08X");
- state_add(PPC_R25, "R25", m_core->r[25]).formatstr("%08X");
- state_add(PPC_R26, "R26", m_core->r[26]).formatstr("%08X");
- state_add(PPC_R27, "R27", m_core->r[27]).formatstr("%08X");
- state_add(PPC_R28, "R28", m_core->r[28]).formatstr("%08X");
- state_add(PPC_R29, "R29", m_core->r[29]).formatstr("%08X");
- state_add(PPC_R30, "R30", m_core->r[30]).formatstr("%08X");
- state_add(PPC_R31, "R31", m_core->r[31]).formatstr("%08X");
-
- state_add(PPC_F0, "F0", m_core->f[0]).formatstr("%12s");
- state_add(PPC_F1, "F1", m_core->f[1]).formatstr("%12s");
- state_add(PPC_F2, "F2", m_core->f[2]).formatstr("%12s");
- state_add(PPC_F3, "F3", m_core->f[3]).formatstr("%12s");
- state_add(PPC_F4, "F4", m_core->f[4]).formatstr("%12s");
- state_add(PPC_F5, "F5", m_core->f[5]).formatstr("%12s");
- state_add(PPC_F6, "F6", m_core->f[6]).formatstr("%12s");
- state_add(PPC_F7, "F7", m_core->f[7]).formatstr("%12s");
- state_add(PPC_F8, "F8", m_core->f[8]).formatstr("%12s");
- state_add(PPC_F9, "F9", m_core->f[9]).formatstr("%12s");
- state_add(PPC_F10, "F10", m_core->f[10]).formatstr("%12s");
- state_add(PPC_F11, "F11", m_core->f[11]).formatstr("%12s");
- state_add(PPC_F12, "F12", m_core->f[12]).formatstr("%12s");
- state_add(PPC_F13, "F13", m_core->f[13]).formatstr("%12s");
- state_add(PPC_F14, "F14", m_core->f[14]).formatstr("%12s");
- state_add(PPC_F15, "F15", m_core->f[15]).formatstr("%12s");
- state_add(PPC_F16, "F16", m_core->f[16]).formatstr("%12s");
- state_add(PPC_F17, "F17", m_core->f[17]).formatstr("%12s");
- state_add(PPC_F18, "F18", m_core->f[18]).formatstr("%12s");
- state_add(PPC_F19, "F19", m_core->f[19]).formatstr("%12s");
- state_add(PPC_F20, "F20", m_core->f[20]).formatstr("%12s");
- state_add(PPC_F21, "F21", m_core->f[21]).formatstr("%12s");
- state_add(PPC_F22, "F22", m_core->f[22]).formatstr("%12s");
- state_add(PPC_F23, "F23", m_core->f[23]).formatstr("%12s");
- state_add(PPC_F24, "F24", m_core->f[24]).formatstr("%12s");
- state_add(PPC_F25, "F25", m_core->f[25]).formatstr("%12s");
- state_add(PPC_F26, "F26", m_core->f[26]).formatstr("%12s");
- state_add(PPC_F27, "F27", m_core->f[27]).formatstr("%12s");
- state_add(PPC_F28, "F28", m_core->f[28]).formatstr("%12s");
- state_add(PPC_F29, "F29", m_core->f[29]).formatstr("%12s");
- state_add(PPC_F30, "F30", m_core->f[30]).formatstr("%12s");
- state_add(PPC_F31, "F31", m_core->f[31]).formatstr("%12s");
+ for (int regnum = 0; regnum < 16; regnum++)
+ state_add(PPC_SR0 + regnum, string_format("SR%d", regnum).c_str(), m_core->sr[regnum]).formatstr("%08X");
+
+ for (int regnum = 0; regnum < 32; regnum++)
+ state_add(PPC_R0 + regnum, string_format("R%d", regnum).c_str(), m_core->r[regnum]).formatstr("%08X");
+
+ for (int regnum = 0; regnum < 32; regnum++)
+ state_add(PPC_F0 + regnum, string_format("F%d", regnum).c_str(), m_core->f[regnum]).formatstr("%12s");
state_add(PPC_FPSCR, "FPSCR", m_core->fpscr).formatstr("%08X");
state_add(STATE_GENPC, "GENPC", m_core->pc).noshow();
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index 60c814ee45e..6674efee841 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -1021,7 +1021,7 @@ void netlist_mame_cpu_device::device_start()
}
else
{
- state_add(i*2+1, n->name().c_str(), *downcast<netlist::analog_net_t *>(n)->Q_Analog_state_ptr()).formatstr("%20s");
+ state_add(i*2+1, n->name().c_str(), *downcast<netlist::analog_net_t *>(n)->Q_Analog_state_ptr());
}
}
diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp
index 805018d00f2..64a424f993d 100644
--- a/src/devices/machine/z80scc.cpp
+++ b/src/devices/machine/z80scc.cpp
@@ -81,17 +81,16 @@ DONE (x) (p=partly) NMOS CMOS ESCC EMSCC
#define LOG_GENERAL (1U << 0)
#define LOG_SETUP (1U << 1)
-#define LOG_PRINTF (1U << 2)
-#define LOG_READ (1U << 3)
-#define LOG_INT (1U << 4)
-#define LOG_CMD (1U << 5)
-#define LOG_TX (1U << 6)
-#define LOG_RCV (1U << 7)
-#define LOG_CTS (1U << 8)
-#define LOG_DCD (1U << 9)
-#define LOG_SYNC (1U << 10)
-
-//#define VERBOSE (LOG_CMD|LOG_INT|LOG_SETUP|LOG_TX|LOG_RCV|LOG_READ|LOG_CTS|LOG_DCD)
+#define LOG_READ (1U << 2)
+#define LOG_INT (1U << 3)
+#define LOG_CMD (1U << 4)
+#define LOG_TX (1U << 5)
+#define LOG_RCV (1U << 6)
+#define LOG_CTS (1U << 7)
+#define LOG_DCD (1U << 8)
+#define LOG_SYNC (1U << 9)
+
+//#define VERBOSE (LOG_INT|LOG_READ|LOG_SETUP|LOG_TX|LOG_CMD)
//#define LOG_OUTPUT_FUNC printf
#include "logmacro.h"
@@ -187,7 +186,8 @@ z80scc_device::z80scc_device(const machine_config &mconfig, device_type type, co
m_out_rxdrqb_cb(*this),
m_out_txdrqb_cb(*this),
m_variant(variant),
- m_wr0_ptrbits(0)
+ m_wr0_ptrbits(0),
+ m_cputag(nullptr)
{
for (auto & elem : m_int_state)
elem = 0;
@@ -371,6 +371,8 @@ int z80scc_device::z80daisy_irq_state()
//-------------------------------------------------
int z80scc_device::z80daisy_irq_ack()
{
+ int ret = -1; // Indicate default vector
+
LOGINT("%s %s \n",tag(), FUNCNAME);
// loop over all interrupt sources
for (auto & elem : m_int_state)
@@ -383,18 +385,28 @@ int z80scc_device::z80daisy_irq_ack()
LOGINT(" - Found an INT request, ");
if (m_wr9 & z80scc_channel::WR9_BIT_VIS)
{
- LOGINT("but WR9 D1 set to use autovector, returning -1\n");
- return -1;
+ LOGINT("but WR9 D1 set to use autovector, returning the default vector\n");
+ break;
}
else
{
LOGINT("returning RR2: %02x\n", m_chanB->m_rr2 );
- return m_chanB->m_rr2;
+ ret = m_chanB->m_rr2;
+ break;
}
}
}
- return -1;
+ // Did we not find a vector? Get the notion of a default vector from the CPU implementation
+ if (ret == -1 && m_cputag != nullptr)
+ {
+ // default irq vector is -1 for 68000 but 0 for z80 for example...
+ ret = owner()->subdevice<cpu_device>(m_cputag)->default_irq_vector();
+ LOGINT(" - failed to find an interrupt to ack, returning default IRQ vector: %02x\n", ret );
+ logerror("z80sio_irq_ack: failed to find an interrupt to ack!\n");
+ }
+
+ return ret;
}
diff --git a/src/devices/machine/z80scc.h b/src/devices/machine/z80scc.h
index 2b0cae0ea76..33729f23efb 100644
--- a/src/devices/machine/z80scc.h
+++ b/src/devices/machine/z80scc.h
@@ -661,6 +661,12 @@ public:
template <class Object> static devcb_base &set_out_rxdrqb_callback(device_t &device, Object &&cb) { return downcast<z80scc_device &>(device).m_out_rxdrqb_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_out_txdrqb_callback(device_t &device, Object &&cb) { return downcast<z80scc_device &>(device).m_out_txdrqb_cb.set_callback(std::forward<Object>(cb)); }
+ static void static_set_cputag(device_t &device, const char *tag)
+ {
+ z80scc_device &dev = downcast<z80scc_device &>(device);
+ dev.m_cputag = tag;
+ }
+
static void configure_channels(device_t &device, int rxa, int txa, int rxb, int txb)
{
z80scc_device &dev = downcast<z80scc_device &>(device);
@@ -798,6 +804,7 @@ protected:
int const m_variant;
uint8_t m_wr0_ptrbits;
+ const char *m_cputag;
};
class scc8030_device : public z80scc_device
diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp
index 4b9ee65b981..ff8b0f18b84 100644
--- a/src/devices/machine/z80sio.cpp
+++ b/src/devices/machine/z80sio.cpp
@@ -142,7 +142,7 @@ z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, co
m_out_rxdrqb_cb(*this),
m_out_txdrqb_cb(*this),
m_variant(variant),
- m_cputag("maincpu")
+ m_cputag(nullptr)
{
for (auto & elem : m_int_state)
elem = 0;
@@ -245,8 +245,7 @@ int z80sio_device::z80daisy_irq_state()
//-------------------------------------------------
int z80sio_device::z80daisy_irq_ack()
{
- // default irq vector is -1 for 68000 but 0 for z80 for example...
- int ret = owner()->subdevice<cpu_device>(m_cputag)->default_irq_vector();
+ int ret = -1; // Indicate default vector
LOGINT("%s %s \n",tag(), FUNCNAME);
// loop over all interrupt sources
@@ -260,12 +259,18 @@ int z80sio_device::z80daisy_irq_ack()
LOGINT(" - Found an INT request, ");
LOGINT("returning RR2: %02x\n", m_chanB->m_rr2 );
check_interrupts();
- return m_chanB->m_rr2;
+ ret = m_chanB->m_rr2;
+ break;
}
}
- ret = m_chanB->m_rr2;
- LOGINT(" - failed to find an interrupt to ack, returning default IRQ vector: %02x\n", ret );
- logerror("z80sio_irq_ack: failed to find an interrupt to ack!\n");
+ // Did we not find a vector? Get the notion of a default vector from the CPU implementation
+ if (ret == -1 && m_cputag != nullptr)
+ {
+ // default irq vector is -1 for 68000 but 0 for z80 for example...
+ ret = owner()->subdevice<cpu_device>(m_cputag)->default_irq_vector();
+ LOGINT(" - failed to find an interrupt to ack [%s], returning default IRQ vector: %02x\n", m_cputag, ret );
+ logerror("z80sio_irq_ack: failed to find an interrupt to ack!\n");
+ }
return ret;
}
diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h
index 3ac63b27c61..ec8c309a394 100644
--- a/src/devices/video/vooddefs.h
+++ b/src/devices/video/vooddefs.h
@@ -775,10 +775,9 @@ do
} \
while (0)
-inline bool ATTR_FORCE_INLINE voodoo_device::alphaTest(voodoo_device *vd, stats_block *stats, uint32_t alphaModeReg, uint8_t alpha)
+inline bool ATTR_FORCE_INLINE voodoo_device::alphaTest(uint8_t alpharef, stats_block *stats, uint32_t alphaModeReg, uint8_t alpha)
{
{
- uint8_t alpharef = vd->reg[alphaMode].rgb.a;
switch (ALPHAMODE_ALPHAFUNCTION(alphaModeReg))
{
case 0: /* alphaOP = never */
@@ -2375,11 +2374,13 @@ do
} \
while (0)
-inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, stats_block *STATS, uint32_t FBZCOLORPATH, uint32_t FBZMODE, uint32_t ALPHAMODE,
+inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, stats_block *STATS, uint32_t FBZCOLORPATH, uint32_t FBZMODE,
rgbaint_t TEXELARGB, int32_t ITERZ, int64_t ITERW, rgbaint_t &srcColor)
{
rgbaint_t c_other;
rgbaint_t c_local;
+ rgbaint_t blend_color, blend_factor;
+ rgbaint_t add_val;
/* compute c_other */
switch (FBZCP_CC_RGBSELECT(FBZCOLORPATH))
@@ -2396,8 +2397,8 @@ inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, sta
c_other.set(vd->reg[color1].u);
break;
- default: /* reserved - voodoo3 framebufferRGB */
- c_other.set(0);
+ default: /* reserved - voodoo3 LFB RGB */
+ c_other.zero();
break;
}
@@ -2422,8 +2423,8 @@ inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, sta
c_other.set_a(vd->reg[color1].rgb.a);
break;
- default: /* reserved */
- c_other.set_a(0);
+ default: /* reserved - voodoo3 LFB Alpha*/
+ c_other.zero_alpha();
break;
}
@@ -2479,32 +2480,35 @@ inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, sta
}
}
- uint8_t a_other = c_other.get_a();
- uint8_t a_local = c_local.get_a();
- uint8_t tmp;
- rgbaint_t add_val(c_local);
-
/* select zero or c_other */
if (FBZCP_CC_ZERO_OTHER(FBZCOLORPATH))
- c_other.and_imm_rgba(-1, 0, 0, 0);
//r = g = b = 0;
+ blend_color.zero();
+ else
+ blend_color.set(c_other);
/* select zero or a_other */
if (FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH))
- c_other.set_a(0);
+ blend_color.zero_alpha();
+ else
+ blend_color.merge_alpha(c_other);
/* subtract a/c_local */
if (FBZCP_CC_SUB_CLOCAL(FBZCOLORPATH) || (FBZCP_CCA_SUB_CLOCAL(FBZCOLORPATH)))
{
- rgbaint_t sub_val = c_local;
+ rgbaint_t sub_val;
if (!FBZCP_CC_SUB_CLOCAL(FBZCOLORPATH))
- sub_val.set(a_local, 0, 0, 0);
+ sub_val.zero();
+ else
+ sub_val.set(c_local);
if (!FBZCP_CCA_SUB_CLOCAL(FBZCOLORPATH))
- sub_val.set_a(0);
+ sub_val.zero_alpha();
+ else
+ sub_val.merge_alpha(c_local);
- c_other.sub(sub_val);
+ blend_color.sub(sub_val);
}
/* blend RGB */
@@ -2512,28 +2516,27 @@ inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, sta
{
default: /* reserved */
case 0: /* 0 */
- c_local.and_imm_rgba(-1, 0, 0, 0);
+ blend_factor.zero();
break;
case 1: /* c_local */
+ blend_factor.set(c_local);
break;
case 2: /* a_other */
- c_local.set(a_local, a_other, a_other, a_other);
+ blend_factor.set(c_other.select_alpha32());
break;
case 3: /* a_local */
- c_local.set(a_local, a_local, a_local, a_local);
+ blend_factor.set(c_local.select_alpha32());
break;
case 4: /* texture alpha */
- tmp = TEXELARGB.get_a();
- c_local.set(a_local, tmp, tmp, tmp);
+ blend_factor.set(TEXELARGB.select_alpha32());
break;
case 5: /* texture RGB (Voodoo 2 only) */
- // Warning wipes out c_local alpha
- c_local.set(TEXELARGB);
+ blend_factor.set(TEXELARGB);
break;
}
@@ -2542,30 +2545,30 @@ inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, sta
{
default: /* reserved */
case 0: /* 0 */
- c_local.set_a(0);
+ blend_factor.zero_alpha();
break;
case 1: /* a_local */
case 3: /* a_local */
- c_local.set_a(a_local);
+ blend_factor.merge_alpha(c_local);
break;
case 2: /* a_other */
- c_local.set_a(a_other);
+ blend_factor.merge_alpha(c_other);
break;
case 4: /* texture alpha */
- c_local.merge_alpha(TEXELARGB);
+ blend_factor.merge_alpha(TEXELARGB);
break;
}
/* reverse the RGB blend */
if (!FBZCP_CC_REVERSE_BLEND(FBZCOLORPATH))
- c_local.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+ blend_factor.xor_imm_rgba(0, 0xff, 0xff, 0xff);
/* reverse the alpha blend */
if (!FBZCP_CCA_REVERSE_BLEND(FBZCOLORPATH))
- c_local.xor_imm_rgba(0xff, 0, 0, 0);
+ blend_factor.xor_imm_rgba(0xff, 0, 0, 0);
/* do the blend */
//color.rgb.a = (color.rgb.a * (blenda + 1)) >> 8;
@@ -2578,44 +2581,41 @@ inline bool ATTR_FORCE_INLINE voodoo_device::combineColor(voodoo_device *vd, sta
{
case 3: /* reserved */
case 0: /* nothing */
- add_val.set(a_local, 0, 0, 0);
+ add_val.zero();
break;
case 1: /* add c_local */
+ add_val.set(c_local);
break;
case 2: /* add_alocal */
- add_val.set(a_local, a_local, a_local, a_local);
+ add_val.set(c_local.select_alpha32());
break;
}
/* add clocal or alocal to alpha */
if (!FBZCP_CCA_ADD_ACLOCAL(FBZCOLORPATH))
- add_val.set_a(0);
+ add_val.zero_alpha();
+ else
//color.rgb.a += c_local.rgb.a;
+ add_val.merge_alpha(c_local);
/* clamp */
//CLAMP(color.rgb.a, 0x00, 0xff);
//CLAMP(color.rgb.r, 0x00, 0xff);
//CLAMP(color.rgb.g, 0x00, 0xff);
//CLAMP(color.rgb.b, 0x00, 0xff);
- c_local.add_imm(1);
- c_other.scale_add_and_clamp(c_local, add_val);
- srcColor.set(c_other);
+ blend_factor.add_imm(1);
+ blend_color.scale_add_and_clamp(blend_factor, add_val);
/* invert */
if (FBZCP_CCA_INVERT_OUTPUT(FBZCOLORPATH))
- srcColor.xor_imm_rgba(0xff, 0, 0, 0);
+ blend_color.xor_imm_rgba(0xff, 0, 0, 0);
/* invert */
if (FBZCP_CC_INVERT_OUTPUT(FBZCOLORPATH))
- srcColor.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+ blend_color.xor_imm_rgba(0, 0xff, 0xff, 0xff);
-
- /* handle alpha test */
- if (ALPHAMODE_ALPHATEST(ALPHAMODE))
- if (!alphaTest(vd, STATS, ALPHAMODE, srcColor.get_a()))
- return false;
- //APPLY_ALPHATEST(vd->m_vds, STATS, ALPHAMODE, color.rgb.a);
+ srcColor.set(blend_color);
return true;
}
@@ -2758,15 +2758,19 @@ void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent *
} \
\
/* colorpath pipeline selects source colors and does blending */ \
- color = clampARGB(iterargb, FBZCOLORPATH); \
- if (!combineColor(vd, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, iterz, iterw, color)) \
- goto skipdrawdepth; \
- \
- /* perform fogging */ \
- preFog.set(color); \
- if (FOGMODE_ENABLE_FOG(FOGMODE)) \
+ color = clampARGB(iterargb, FBZCOLORPATH); \
+ if (!combineColor(vd, stats, FBZCOLORPATH, FBZMODE, texel, iterz, iterw, color)) \
+ goto skipdrawdepth; \
+ /* handle alpha test */ \
+ if (ALPHAMODE_ALPHATEST(ALPHAMODE)) \
+ if (!alphaTest(vd->reg[alphaMode].rgb.a, stats, ALPHAMODE, color.get_a())) \
+ goto skipdrawdepth; \
+ \
+ /* perform fogging */ \
+ preFog.set(color); \
+ if (FOGMODE_ENABLE_FOG(FOGMODE)) \
applyFogging(vd, FBZMODE, FOGMODE, FBZCOLORPATH, x, dither4, wfloat, color, iterz, iterw, iterargb); \
- \
+ \
/* perform alpha blending */ \
if (ALPHAMODE_ALPHABLEND(ALPHAMODE)) \
alphaBlend(FBZMODE, ALPHAMODE, x, dither, dest[x], depth, preFog, color, vd->fbi.rgb565); \
@@ -3019,33 +3023,39 @@ inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::genTexture(int32_t
return result;
}
-inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::combineTexture(const uint32_t TEXMODE, rgbaint_t c_local, rgbaint_t c_other, int32_t lod)
+inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::combineTexture(const uint32_t TEXMODE, const rgbaint_t& c_local, const rgbaint_t& c_other, int32_t lod)
{
- int32_t a_other = c_other.get_a();
- int32_t a_local = c_local.get_a();
- rgbaint_t add_val = c_local;
- uint8_t tmp;
+ rgbaint_t blend_color, blend_factor;
+ rgbaint_t add_val;
/* select zero/other for RGB */
if (TEXMODE_TC_ZERO_OTHER(TEXMODE))
- c_other.and_imm_rgba(-1, 0, 0, 0);
+ blend_color.zero();
+ else
+ blend_color.set(c_other);
/* select zero/other for alpha */
if (TEXMODE_TCA_ZERO_OTHER(TEXMODE))
- c_other.set_a(0);
+ blend_color.zero_alpha();
+ else
+ blend_color.merge_alpha(c_other);
if (TEXMODE_TC_SUB_CLOCAL(TEXMODE) || TEXMODE_TCA_SUB_CLOCAL(TEXMODE))
{
- rgbaint_t sub_val = c_local;
+ rgbaint_t sub_val;
/* potentially subtract c_local */
if (!TEXMODE_TC_SUB_CLOCAL(TEXMODE))
- sub_val.and_imm_rgba(-1, 0, 0, 0);
+ sub_val.zero();
+ else
+ sub_val.set(c_local);
if (!TEXMODE_TCA_SUB_CLOCAL(TEXMODE))
- sub_val.set_a(0);
+ sub_val.zero_alpha();
+ else
+ sub_val.merge_alpha(c_local);
- c_other.sub(sub_val);
+ blend_color.sub(sub_val);
}
/* blend RGB */
@@ -3053,35 +3063,36 @@ inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::combineTexture(cons
{
default: /* reserved */
case 0: /* zero */
- c_local.and_imm_rgba(-1, 0, 0, 0);
+ blend_factor.zero();
break;
case 1: /* c_local */
+ blend_factor.set(c_local);
break;
case 2: /* a_other */
- c_local.set(a_local, a_other, a_other, a_other);
+ blend_factor.set(c_other.select_alpha32());
break;
case 3: /* a_local */
- c_local.set(a_local, a_local, a_local, a_local);
+ blend_factor.set(c_local.select_alpha32());
break;
case 4: /* LOD (detail factor) */
if (detailbias <= lod)
- c_local.and_imm_rgba(-1, 0, 0, 0);
+ blend_factor.zero();
else
{
+ uint8_t tmp;
tmp = (((detailbias - lod) << detailscale) >> 8);
if (tmp > detailmax)
tmp = detailmax;
- c_local.set(a_local, tmp, tmp, tmp);
+ blend_factor.set_all(tmp);
}
break;
case 5: /* LOD fraction */
- tmp = lod & 0xff;
- c_local.set(a_local, tmp, tmp, tmp);
+ blend_factor.set_all(lod & 0xff);
break;
}
@@ -3090,45 +3101,46 @@ inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::combineTexture(cons
{
default: /* reserved */
case 0: /* zero */
- c_local.set_a(0);
+ blend_factor.zero_alpha();
break;
case 1: /* c_local */
+ blend_factor.merge_alpha(c_local);
break;
case 2: /* a_other */
- c_local.set_a(a_other);
+ blend_factor.merge_alpha(c_other);
break;
case 3: /* a_local */
+ blend_factor.merge_alpha(c_local);
break;
case 4: /* LOD (detail factor) */
if (detailbias <= lod)
- c_local.set_a(0);
+ blend_factor.zero_alpha();
else
{
+ uint8_t tmp;
tmp = (((detailbias - lod) << detailscale) >> 8);
if (tmp > detailmax)
tmp = detailmax;
- c_local.set_a(tmp);
+ blend_factor.set_a(tmp);
}
break;
case 5: /* LOD fraction */
- c_local.set_a(lod & 0xff);
+ blend_factor.set_a(lod & 0xff);
break;
}
/* reverse the RGB blend */
if (!TEXMODE_TC_REVERSE_BLEND(TEXMODE))
- {
- c_local.xor_imm_rgba(0, 0xff, 0xff, 0xff);
- }
+ blend_factor.xor_imm_rgba(0, 0xff, 0xff, 0xff);
/* reverse the alpha blend */
if (!TEXMODE_TCA_REVERSE_BLEND(TEXMODE))
- c_local.xor_imm_rgba(0xff, 0, 0, 0);
+ blend_factor.xor_imm_rgba(0xff, 0, 0, 0);
/* do the blend */
//tr = (tr * (blendr + 1)) >> 8;
@@ -3141,39 +3153,38 @@ inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::combineTexture(cons
{
case 3: /* reserved */
case 0: /* nothing */
- add_val.set(a_local, 0, 0, 0);
+ add_val.zero();
break;
case 1: /* add c_local */
+ add_val.set(c_local);
break;
case 2: /* add_alocal */
- add_val.set(a_local, a_local , a_local , a_local);
- //tr += c_local.rgb.a;
- //tg += c_local.rgb.a;
- //tb += c_local.rgb.a;
+ add_val.set(c_local.select_alpha32());
break;
}
/* add clocal or alocal to alpha */
if (!TEXMODE_TCA_ADD_ACLOCAL(TEXMODE))
- add_val.set_a(0);
- //ta += c_local.rgb.a;
+ add_val.zero_alpha();
+ else
+ add_val.merge_alpha(c_local);
/* clamp */
//result.rgb.r = (tr < 0) ? 0 : (tr > 0xff) ? 0xff : tr;
//result.rgb.g = (tg < 0) ? 0 : (tg > 0xff) ? 0xff : tg;
//result.rgb.b = (tb < 0) ? 0 : (tb > 0xff) ? 0xff : tb;
//result.rgb.a = (ta < 0) ? 0 : (ta > 0xff) ? 0xff : ta;
- c_local.add_imm(1);
- c_other.scale_add_and_clamp(c_local, add_val);
- rgbaint_t result(c_other);
+ blend_factor.add_imm(1);
+ blend_color.scale_add_and_clamp(blend_factor, add_val);
+
/* invert */
if (TEXMODE_TC_INVERT_OUTPUT(TEXMODE))
- result.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+ blend_color.xor_imm_rgba(0, 0xff, 0xff, 0xff);
if (TEXMODE_TCA_INVERT_OUTPUT(TEXMODE))
- result.xor_imm_rgba(0xff, 0, 0, 0);
- return result;
+ blend_color.xor_imm_rgba(0xff, 0, 0, 0);
+ return blend_color;
}
#endif // MAME_VIDEO_VOODDEFS_H
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index 3b2e1a2f517..a5ac18a7262 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -3376,7 +3376,7 @@ int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, ui
goto nextpixel;
/* handle alpha test */
if (ALPHAMODE_ALPHATEST(vd->reg[alphaMode].u))
- if (!alphaTest(vd, stats, vd->reg[alphaMode].u, color.get_a()))
+ if (!alphaTest(vd->reg[alphaMode].rgb.a, stats, vd->reg[alphaMode].u, color.get_a()))
goto nextpixel;
/* perform fogging */
diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h
index 6f7618bebb8..af3bd9a17d3 100644
--- a/src/devices/video/voodoo.h
+++ b/src/devices/video/voodoo.h
@@ -1597,7 +1597,7 @@ protected:
void init(uint8_t vdt, tmu_shared_state &share, voodoo_reg *r, void *memory, int tmem);
int32_t prepare();
rgbaint_t genTexture(int32_t x, const uint8_t *dither4, const uint32_t TEXMODE, rgb_t *LOOKUP, int32_t LODBASE, int64_t ITERS, int64_t ITERT, int64_t ITERW, int32_t &lod);
- rgbaint_t combineTexture(const uint32_t TEXMODE, rgbaint_t c_local, rgbaint_t c_other, int32_t lod);
+ rgbaint_t combineTexture(const uint32_t TEXMODE, const rgbaint_t& c_local, const rgbaint_t& c_other, int32_t lod);
struct ncc_table
{
@@ -1862,9 +1862,9 @@ protected:
static bool chromaKeyTest(voodoo_device *vd, stats_block *stats, uint32_t fbzModeReg, rgbaint_t rgaIntColor);
static bool alphaMaskTest(stats_block *stats, uint32_t fbzModeReg, uint8_t alpha);
- static bool alphaTest(voodoo_device *vd, stats_block *stats, uint32_t alphaModeReg, uint8_t alpha);
+ static bool alphaTest(uint8_t alpharef, stats_block *stats, uint32_t alphaModeReg, uint8_t alpha);
static bool depthTest(uint16_t zaColorReg, stats_block *stats, int32_t destDepth, uint32_t fbzModeReg, int32_t biasdepth);
- static bool combineColor(voodoo_device *vd, stats_block *STATS, uint32_t FBZCOLORPATH, uint32_t FBZMODE, uint32_t ALPHAMODE, rgbaint_t TEXELARGB, int32_t ITERZ, int64_t ITERW, rgbaint_t &srcColor);
+ static bool combineColor(voodoo_device *vd, stats_block *STATS, uint32_t FBZCOLORPATH, uint32_t FBZMODE, rgbaint_t TEXELARGB, int32_t ITERZ, int64_t ITERW, rgbaint_t &srcColor);
// FIXME: this stuff should not be public
public:
diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp
index 8b0cd786bff..16f15fbbc60 100644
--- a/src/emu/debug/debugcon.cpp
+++ b/src/emu/debug/debugcon.cpp
@@ -344,7 +344,7 @@ CMDERR debugger_console::execute_command(const std::string &command, bool echo)
if (!echo)
printf(">%s\n", command.c_str());
printf(" %*s^\n", CMDERR_ERROR_OFFSET(result), "");
- printf("%s\n", cmderr_to_string(result));
+ printf("%s\n", cmderr_to_string(result).c_str());
}
/* update all views */
@@ -404,8 +404,9 @@ void debugger_console::register_command(const char *command, u32 flags, int ref,
for a given command error
-------------------------------------------------*/
-const char *debugger_console::cmderr_to_string(CMDERR error)
+std::string debugger_console::cmderr_to_string(CMDERR error)
{
+ int offset = CMDERR_ERROR_OFFSET(error);
switch (CMDERR_ERROR_CLASS(error))
{
case CMDERR_UNKNOWN_COMMAND: return "unknown command";
@@ -414,7 +415,8 @@ const char *debugger_console::cmderr_to_string(CMDERR error)
case CMDERR_UNBALANCED_QUOTES: return "unbalanced quotes";
case CMDERR_NOT_ENOUGH_PARAMS: return "not enough parameters for command";
case CMDERR_TOO_MANY_PARAMS: return "too many parameters for command";
- case CMDERR_EXPRESSION_ERROR: return "error in assignment expression";
+ case CMDERR_EXPRESSION_ERROR: return string_format("error in assignment expression: %s",
+ expression_error(static_cast<expression_error::error_code>(offset)).code_string());
default: return "unknown error";
}
}
diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h
index 54bc3bf6772..7cc1231d4c9 100644
--- a/src/emu/debug/debugcon.h
+++ b/src/emu/debug/debugcon.h
@@ -104,7 +104,7 @@ public:
vprintf_wrap(wrapcol, util::make_format_argument_pack(std::forward<Format>(fmt), std::forward<Params>(args)...));
}
- static const char * cmderr_to_string(CMDERR error);
+ static std::string cmderr_to_string(CMDERR error);
private:
void exit();
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 46ad9e04683..0289ef7f664 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -1559,8 +1559,12 @@ device_debug::device_debug(device_t &device)
std::string tempstr;
for (const auto &entry : m_state->state_entries())
{
- strmakelower(tempstr.assign(entry->symbol()));
- m_symtable.add(tempstr.c_str(), (void *)(uintptr_t)entry->index(), get_state, set_state, entry->format_string());
+ // TODO: floating point registers
+ if (!entry->is_float())
+ {
+ strmakelower(tempstr.assign(entry->symbol()));
+ m_symtable.add(tempstr.c_str(), (void *)(uintptr_t)entry->index(), get_state, entry->writeable() ? set_state : nullptr, entry->format_string());
+ }
}
}
diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp
index 2a1ed9b9ea9..34833a72979 100644
--- a/src/emu/distate.cpp
+++ b/src/emu/distate.cpp
@@ -49,30 +49,18 @@ const u64 device_state_entry::k_decimal_divisor[] =
// device_state_entry - constructor
//-------------------------------------------------
-device_state_entry::device_state_entry(int index, const char *symbol, void *dataptr, u8 size, device_state_interface *dev)
+device_state_entry::device_state_entry(int index, const char *symbol, u8 size, u64 sizemask, u8 flags, device_state_interface *dev)
: m_device_state(dev),
m_index(index),
- m_dataptr(dataptr),
- m_datamask(0),
+ m_datamask(sizemask),
m_datasize(size),
- m_flags(0),
+ m_flags(flags),
m_symbol(symbol),
m_default_format(true),
- m_sizemask(0)
+ m_sizemask(sizemask)
{
- // convert the size to a mask
- assert(size == 1 || size == 2 || size == 4 || size == 8);
- if (size == 1)
- m_sizemask = 0xff;
- else if (size == 2)
- m_sizemask = 0xffff;
- else if (size == 4)
- m_sizemask = 0xffffffff;
- else
- m_sizemask = ~u64(0);
-
- // default the data mask to the same
- m_datamask = m_sizemask;
+ assert(size == 1 || size == 2 || size == 4 || size == 8 || (flags & DSF_FLOATING_POINT) != 0);
+
format_from_mask();
// override well-known symbols
@@ -87,10 +75,9 @@ device_state_entry::device_state_entry(int index, const char *symbol, void *data
device_state_entry::device_state_entry(int index, device_state_interface *dev)
: m_device_state(dev),
m_index(index),
- m_dataptr(nullptr),
m_datamask(0),
m_datasize(0),
- m_flags(DSF_DIVIDER),
+ m_flags(DSF_DIVIDER | DSF_READONLY),
m_symbol(),
m_default_format(true),
m_sizemask(0)
@@ -126,6 +113,12 @@ void device_state_entry::format_from_mask()
if (!m_default_format)
return;
+ if (is_float())
+ {
+ m_format = "%12s";
+ return;
+ }
+
// make up a format based on the mask
int width = 0;
for (u64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4)
@@ -135,22 +128,34 @@ void device_state_entry::format_from_mask()
//-------------------------------------------------
-// value - return the current value as a u64
+// entry_baseptr - return a pointer to where the
+// data lives (if applicable)
//-------------------------------------------------
-u64 device_state_entry::value() const
+void *device_state_entry::entry_baseptr() const
{
- // pick up the value
- u64 result;
- switch (m_datasize)
- {
- default:
- case 1: result = *static_cast<u8 *>(m_dataptr); break;
- case 2: result = *static_cast<u16 *>(m_dataptr); break;
- case 4: result = *static_cast<u32 *>(m_dataptr); break;
- case 8: result = *static_cast<u64 *>(m_dataptr); break;
- }
- return result & m_datamask;
+ return nullptr;
+}
+
+
+//-------------------------------------------------
+// entry_value - return the current value as a u64
+//-------------------------------------------------
+
+u64 device_state_entry::entry_value() const
+{
+ return 0;
+}
+
+
+//-------------------------------------------------
+// entry_dvalue - return the current value as a
+// double
+//-------------------------------------------------
+
+double device_state_entry::entry_dvalue() const
+{
+ return 0.0;
}
@@ -349,6 +354,8 @@ std::string device_state_entry::format(const char *string, bool maxout) const
void device_state_entry::set_value(u64 value) const
{
+ assert((m_flags & DSF_READONLY) == 0);
+
// apply the mask
value &= m_datamask;
@@ -357,14 +364,39 @@ void device_state_entry::set_value(u64 value) const
value |= ~m_datamask;
// store the value
- switch (m_datasize)
- {
- default:
- case 1: *static_cast<u8 *>(m_dataptr) = value; break;
- case 2: *static_cast<u16 *>(m_dataptr) = value; break;
- case 4: *static_cast<u32 *>(m_dataptr) = value; break;
- case 8: *static_cast<u64 *>(m_dataptr) = value; break;
- }
+ entry_set_value(value);
+}
+
+
+//-------------------------------------------------
+// set_dvalue - set the value from a double
+//-------------------------------------------------
+
+void device_state_entry::set_dvalue(double value) const
+{
+ assert((m_flags & DSF_READONLY) == 0);
+
+ // store the value
+ entry_set_dvalue(value);
+}
+
+
+//-------------------------------------------------
+// entry_set_value - set the value from a u64
+//-------------------------------------------------
+
+void device_state_entry::entry_set_value(u64 value) const
+{
+}
+
+
+//-------------------------------------------------
+// entry_set_dvalue - set the value from a double
+//-------------------------------------------------
+
+void device_state_entry::entry_set_dvalue(double value) const
+{
+ set_value(u64(value));
}
@@ -443,6 +475,8 @@ std::string device_state_interface::state_string(int index) const
std::string custom;
if (entry->needs_custom_string())
state_string_export(*entry, custom);
+ else if (entry->is_float())
+ custom = string_format("%-12G", entry->dvalue());
// ask the entry to format itself
return entry->format(custom.c_str());
@@ -509,38 +543,22 @@ void device_state_interface::set_state_string(int index, const char *string)
//-------------------------------------------------
-// state_add - return the value of the given
-// pieces of indexed state as a u64
+// state_add - add a new piece of indexed state
//-------------------------------------------------
-device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, u8 size)
+device_state_entry &device_state_interface::state_add(std::unique_ptr<device_state_entry> &&entry)
{
- // assert validity of incoming parameters
- assert(size == 1 || size == 2 || size == 4 || size == 8);
- assert(symbol != nullptr);
-
// append to the end of the list
- m_state_list.push_back(std::make_unique<device_state_entry>(index, symbol, data, size, this));
+ m_state_list.push_back(std::move(entry));
+ device_state_entry &new_entry = *m_state_list.back();
// set the fast entry if applicable
- if (index >= FAST_STATE_MIN && index <= FAST_STATE_MAX)
- m_fast_state[index - FAST_STATE_MIN] = m_state_list.back().get();
+ if (new_entry.index() >= FAST_STATE_MIN && new_entry.index() <= FAST_STATE_MAX && !new_entry.divider())
+ m_fast_state[new_entry.index() - FAST_STATE_MIN] = &new_entry;
- return *m_state_list.back().get();
+ return new_entry;
}
-//-------------------------------------------------
-// state_add_divider - add a simple divider
-// entry
-//-------------------------------------------------
-
-device_state_entry &device_state_interface::state_add_divider(int index)
-{
- // append to the end of the list
- m_state_list.push_back(std::make_unique<device_state_entry>(index, this));
-
- return *m_state_list.back().get();
-}
//-------------------------------------------------
// state_import - called after new state is
diff --git a/src/emu/distate.h b/src/emu/distate.h
index 22db6cc22af..80ead0c3463 100644
--- a/src/emu/distate.h
+++ b/src/emu/distate.h
@@ -46,7 +46,7 @@ class device_state_entry
friend class device_state_interface;
public:
// construction/destruction
- device_state_entry(int index, const char *symbol, void *dataptr, u8 size, device_state_interface *dev);
+ device_state_entry(int index, const char *symbol, u8 size, u64 sizemask, u8 flags, device_state_interface *dev);
device_state_entry(int index, device_state_interface *dev);
public:
@@ -57,13 +57,17 @@ public:
device_state_entry &callimport() { m_flags |= DSF_IMPORT; return *this; }
device_state_entry &callexport() { m_flags |= DSF_EXPORT; return *this; }
device_state_entry &noshow() { m_flags |= DSF_NOSHOW; return *this; }
+ device_state_entry &readonly() { m_flags |= DSF_READONLY; return *this; }
// query information
int index() const { return m_index; }
- void *dataptr() const { return m_dataptr; }
+ void *dataptr() const { return entry_baseptr(); }
+ u64 datamask() const { return m_datamask; }
const char *symbol() const { return m_symbol.c_str(); }
bool visible() const { return ((m_flags & DSF_NOSHOW) == 0); }
+ bool writeable() const { return ((m_flags & DSF_READONLY) == 0); }
bool divider() const { return m_flags & DSF_DIVIDER; }
+ bool is_float() const { return m_flags & DSF_FLOATING_POINT; }
device_state_interface *parent_state() const {return m_device_state;}
const std::string &format_string() const { return m_format; }
@@ -75,6 +79,8 @@ protected:
static constexpr u8 DSF_EXPORT = 0x08; // call the export function prior to fetching the data
static constexpr u8 DSF_CUSTOM_STRING = 0x10; // set if the format has a custom string
static constexpr u8 DSF_DIVIDER = 0x20; // set if this is a divider entry
+ static constexpr u8 DSF_READONLY = 0x40; // set if this entry does not permit writes
+ static constexpr u8 DSF_FLOATING_POINT = 0x80; // set if this entry represents a floating-point value
// helpers
bool needs_custom_string() const { return ((m_flags & DSF_CUSTOM_STRING) != 0); }
@@ -82,21 +88,29 @@ protected:
// return the current value -- only for our friends who handle export
bool needs_export() const { return ((m_flags & DSF_EXPORT) != 0); }
- u64 value() const;
+ u64 value() const { return entry_value() & m_datamask; }
+ double dvalue() const { return entry_dvalue(); }
std::string format(const char *string, bool maxout = false) const;
// set the current value -- only for our friends who handle import
bool needs_import() const { return ((m_flags & DSF_IMPORT) != 0); }
void set_value(u64 value) const;
+ void set_dvalue(double value) const;
void set_value(const char *string) const;
+ // overrides
+ virtual void *entry_baseptr() const;
+ virtual u64 entry_value() const;
+ virtual void entry_set_value(u64 value) const;
+ virtual double entry_dvalue() const;
+ virtual void entry_set_dvalue(double value) const;
+
// statics
static const u64 k_decimal_divisor[20]; // divisors for outputting decimal values
// public state description
device_state_interface *m_device_state; // link to parent device state
u32 m_index; // index by which this item is referred
- void * m_dataptr; // pointer to where the data lives
u64 m_datamask; // mask that applies to the data
u8 m_datasize; // size of the data
u8 m_flags; // flags for this data
@@ -107,6 +121,84 @@ protected:
};
+// ======================> device_state_register
+
+// class template representing a state register of a specific width
+template<class ItemType>
+class device_state_register : public device_state_entry
+{
+public:
+ // construction/destruction
+ device_state_register(int index, const char *symbol, ItemType &data, device_state_interface *dev)
+ : device_state_entry(index, symbol, sizeof(ItemType), std::numeric_limits<ItemType>::max(), 0, dev),
+ m_data(data)
+ {
+ static_assert(std::is_integral<ItemType>().value, "Registration of non-integer types is not currently supported");
+ }
+
+protected:
+ // device_state_entry overrides
+ virtual void *entry_baseptr() const override { return &m_data; }
+ virtual u64 entry_value() const override { return m_data; }
+ virtual void entry_set_value(u64 value) const override { m_data = value; }
+
+private:
+ ItemType & m_data; // reference to where the data lives
+};
+
+// class template representing a floating-point state register
+template<>
+class device_state_register<double> : public device_state_entry
+{
+public:
+ // construction/destruction
+ device_state_register(int index, const char *symbol, double &data, device_state_interface *dev)
+ : device_state_entry(index, symbol, sizeof(double), ~u64(0), DSF_FLOATING_POINT, dev),
+ m_data(data)
+ {
+ }
+
+protected:
+ // device_state_entry overrides
+ virtual void *entry_baseptr() const override { return &m_data; }
+ virtual u64 entry_value() const override { return u64(m_data); }
+ virtual void entry_set_value(u64 value) const override { m_data = double(value); }
+ virtual double entry_dvalue() const override { return m_data; }
+ virtual void entry_set_dvalue(double value) const override { m_data = value; }
+
+private:
+ double & m_data; // reference to where the data lives
+};
+
+
+// ======================> device_state_register
+
+// class template representing a state register of a specific width
+template<class ItemType>
+class device_pseudo_state_register : public device_state_entry
+{
+public:
+ typedef typename std::function<ItemType ()> getter_func;
+ typedef typename std::function<void (ItemType)> setter_func;
+
+ // construction/destruction
+ device_pseudo_state_register(int index, const char *symbol, getter_func &&getter, setter_func &&setter, device_state_interface *dev)
+ : device_state_entry(index, symbol, sizeof(ItemType), std::numeric_limits<ItemType>::max(), 0, dev),
+ m_getter(std::move(getter)),
+ m_setter(std::move(setter))
+ {
+ }
+
+protected:
+ // device_state_entry overrides
+ virtual u64 entry_value() const override { return m_getter(); }
+ virtual void entry_set_value(u64 value) const override { m_setter(value); }
+
+private:
+ getter_func m_getter; // function to retrieve the data
+ setter_func m_setter; // function to store the data
+};
+
// ======================> device_state_interface
@@ -143,15 +235,32 @@ public:
public: // protected eventually
- // add a new state item
- template<class _ItemType> device_state_entry &state_add(int index, const char *symbol, _ItemType &data)
+ // add a new state register item
+ template<class ItemType> device_state_entry &state_add(int index, const char *symbol, ItemType &data)
+ {
+ assert(symbol != nullptr);
+ return state_add(std::make_unique<device_state_register<ItemType>>(index, symbol, data, this));
+ }
+
+ // add a new state pseudo-register item (template argument must be explicit)
+ template<class ItemType> device_state_entry &state_add(int index, const char *symbol,
+ typename device_pseudo_state_register<ItemType>::getter_func &&getter,
+ typename device_pseudo_state_register<ItemType>::setter_func &&setter)
{
- return state_add(index, symbol, &data, sizeof(data));
+ assert(symbol != nullptr);
+ return state_add(std::make_unique<device_pseudo_state_register<ItemType>>(index, symbol, std::move(getter), std::move(setter), this));
}
- device_state_entry &state_add(int index, const char *symbol, void *data, u8 size);
+ template<class ItemType> device_state_entry &state_add(int index, const char *symbol,
+ typename device_pseudo_state_register<ItemType>::getter_func &&getter)
+ {
+ assert(symbol != nullptr);
+ return state_add(std::make_unique<device_pseudo_state_register<ItemType>>(index, symbol, std::move(getter), [](ItemType){}, this)).readonly();
+ }
+
+ device_state_entry &state_add(std::unique_ptr<device_state_entry> &&entry);
// add a new divider entry
- device_state_entry &state_add_divider(int index);
+ device_state_entry &state_add_divider(int index) { return state_add(std::make_unique<device_state_entry>(index, this)); }
protected:
// derived class overrides
diff --git a/src/emu/video/rgbgen.h b/src/emu/video/rgbgen.h
index 0ba5aa03dc2..b5986915f82 100644
--- a/src/emu/video/rgbgen.h
+++ b/src/emu/video/rgbgen.h
@@ -37,6 +37,12 @@ public:
m_b = b;
}
void set(const rgb_t& rgba) { set(rgba.a(), rgba.r(), rgba.g(), rgba.b()); }
+ // This function sets all elements to the same val
+ void set_all(const s32& val) { set(val, val, val, val); }
+ // This function zeros all elements
+ void zero() { set_all(0); }
+ // This function zeros only the alpha element
+ void zero_alpha() { m_a = 0; }
rgb_t to_rgba() const { return rgb_t(get_a(), get_r(), get_g(), get_b()); }
diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h
index 037515b4754..d8f491e0117 100644
--- a/src/emu/video/rgbsse.h
+++ b/src/emu/video/rgbsse.h
@@ -41,6 +41,12 @@ public:
void set(const u32& rgba) { m_value = _mm_unpacklo_epi16(_mm_unpacklo_epi8(_mm_cvtsi32_si128(rgba), _mm_setzero_si128()), _mm_setzero_si128()); }
void set(s32 a, s32 r, s32 g, s32 b) { m_value = _mm_set_epi32(a, r, g, b); }
void set(const rgb_t& rgb) { set((const u32&) rgb); }
+ // This function sets all elements to the same val
+ void set_all(const s32& val) { m_value = _mm_set1_epi32(val); }
+ // This function zeros all elements
+ void zero() { m_value = _mm_xor_si128(m_value, m_value); }
+ // This function zeros only the alpha element
+ void zero_alpha() { m_value = _mm_and_si128(m_value, alpha_mask()); }
inline rgb_t to_rgba() const
{
diff --git a/src/emu/video/rgbvmx.h b/src/emu/video/rgbvmx.h
index 5c46fc3dcb8..6e239050118 100644
--- a/src/emu/video/rgbvmx.h
+++ b/src/emu/video/rgbvmx.h
@@ -75,6 +75,13 @@ public:
#endif
}
+ // This function sets all elements to the same val
+ void set_all(const s32& val) { set(val, val, val, val); }
+ // This function zeros all elements
+ void zero() { set_all(0); }
+ // This function zeros only the alpha element
+ void zero_alpha() { set_a(0); }
+
inline rgb_t to_rgba() const
{
VECU32 temp = VECU32(vec_packs(m_value, m_value));
diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp
index 4a8ffd557d6..92185adfbe6 100644
--- a/src/frontend/mame/ui/selgame.cpp
+++ b/src/frontend/mame/ui/selgame.cpp
@@ -130,18 +130,14 @@ menu_select_game::menu_select_game(mame_ui_manager &mui, render_container &conta
menu_select_game::~menu_select_game()
{
std::string error_string, last_driver;
- game_driver const *const driver(isfavorite() ? nullptr : reinterpret_cast<game_driver const *>(get_selection_ref()));
- ui_software_info *const swinfo(isfavorite() ? reinterpret_cast<ui_software_info *>(get_selection_ref()) : nullptr);
-
- if (reinterpret_cast<uintptr_t>(driver) > skip_main_items)
- last_driver = driver->name;
- else if (driver && m_prev_selected)
- last_driver = reinterpret_cast<game_driver const *>(m_prev_selected)->name;
-
- if (reinterpret_cast<uintptr_t>(swinfo) > skip_main_items)
+ game_driver const *driver;
+ ui_software_info const *swinfo;
+ get_selection(swinfo, driver);
+ if (swinfo)
last_driver = swinfo->shortname;
- else if (swinfo && m_prev_selected)
- last_driver = reinterpret_cast<ui_software_info *>(m_prev_selected)->shortname;
+ else
+ if (driver)
+ last_driver = driver->name;
std::string filter;
auto const active_filter(main_filters::filters.find(main_filters::actual));
diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp
index 8fd7c144413..f6821f23424 100644
--- a/src/mame/drivers/cyberbal.cpp
+++ b/src/mame/drivers/cyberbal.cpp
@@ -7,7 +7,7 @@
driver by Aaron Giles
Games supported:
- * Cyberball (1988) [3 sets]
+ * Cyberball (1988) [4 sets]
* Cyberball 2072, 2-players (1989) [4 sets]
* Tournament Cyberball 2072 (1989) [2 sets]
@@ -649,6 +649,59 @@ ROM_START( cyberbal2 )
ROM_END
+ROM_START( cyberbal1 ) /* loose chips from upgrade, cannot verify any rev 2 graphics chips as being correct for this set */
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* 4*64k for 68000 code */
+ ROM_LOAD16_BYTE( "136064-1123.1m", 0x000000, 0x010000, CRC(ba01fcdc) SHA1(d0283d68450cb758942df20762e12442687eab78) )
+ ROM_LOAD16_BYTE( "136064-1124.1kl", 0x000001, 0x010000, CRC(d0617f65) SHA1(7c641a2c709ecf40f6977abd94f6320e13faf61b) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */
+ ROM_LOAD( "136064-2131.2f", 0x000000, 0x010000, CRC(bd7e3d84) SHA1(f87878042fc79fa3883136b31ac15ddc22c6023c) ) /* this rev 2 chip was among the loose rev 1 chips */
+
+ ROM_REGION( 0x40000, "extra", 0 ) /* 4*64k for 68000 code */
+ ROM_LOAD16_BYTE( "136064-1127.3cd", 0x000000, 0x010000, CRC(f8d60334) SHA1(e54dabe71a9b943fac408788b19e7add207c6740) )
+ ROM_LOAD16_BYTE( "136064-1128.1b", 0x000001, 0x010000, CRC(7adb1d68) SHA1(a8f4d7d7423791c0c0bd6dfbe8d23a1b01b91aac) )
+ ROM_LOAD16_BYTE( "136064-1129.1cd", 0x020000, 0x010000, CRC(db11d2f0) SHA1(da9f49af533cbc732b17699040c7930070a90644) )
+ ROM_LOAD16_BYTE( "136064-1130.3b", 0x020001, 0x010000, CRC(fd86b8aa) SHA1(46310efed762632ed176a08aaec41e48aad41cc1) )
+
+ ROM_REGION16_BE( 0x40000, "dac", 0 ) /* 256k for 68000 sound code */
+ ROM_LOAD16_BYTE( "136064-1132.3cd", 0x000000, 0x010000, CRC(ca5ce8d8) SHA1(69dc83d43d8c9dc7ce3207e70f48fcfc5ddda0cc) )
+ ROM_LOAD16_BYTE( "136064-1133.1b", 0x000001, 0x010000, CRC(ffeb8746) SHA1(0d8d28b2d997ff3cf01b4ef25b75fa5a69754af4) )
+ ROM_LOAD16_BYTE( "136064-1134.1cd", 0x020000, 0x010000, CRC(bcbd4c00) SHA1(f0bfcdf0b5491e15872b543e99b834ae384cbf18) )
+ ROM_LOAD16_BYTE( "136064-1135.3b", 0x020001, 0x010000, CRC(d520f560) SHA1(fb0b8d021458379188c424a343622c46ad74edaa) )
+
+ ROM_REGION( 0x140000, "gfx1", 0 )
+ ROM_LOAD( "136064-1105.15a", 0x000000, 0x010000, CRC(e770eb3e) SHA1(e9f9e9e05774005c8be3bbdc19985b59a0081ef4) )
+ ROM_LOAD( "136064-1109.16a", 0x010000, 0x010000, CRC(40db00da) SHA1(d92d856b06f6ba11621ba7aab3d40653b3c70159) )
+ ROM_LOAD( "136064-2113.18a", 0x020000, 0x010000, CRC(52bb08fb) SHA1(08caa156923daf444e0caafb2cdff0704c90ef1f) )
+ ROM_LOAD( "136064-1117.19a", 0x030000, 0x010000, CRC(0a11d877) SHA1(876cbeffd815c084d7cbd937067d65c04aeebce5) )
+ ROM_LOAD( "136064-1106.11a", 0x050000, 0x010000, CRC(6f53c7c1) SHA1(5856d714c3af338be58156b404fb1e5a89c24cf9) )
+ ROM_LOAD( "136064-1110.12a", 0x060000, 0x010000, CRC(5de609e5) SHA1(bbea36a4cbbfeab113925951ef097673eddf26a8) )
+ ROM_LOAD( "136064-2114.13a", 0x070000, 0x010000, CRC(e6f95010) SHA1(42b14cf0dadfab9ce1032385fd21339b46edcfc2) )
+ ROM_LOAD( "136064-1118.14a", 0x080000, 0x010000, CRC(47f56ced) SHA1(62e80191e1879ffb6c736aec004bbc30a366363f) )
+ ROM_LOAD( "136064-1107.15c", 0x0a0000, 0x010000, CRC(c8f1f7ff) SHA1(2e0374901871d66a243f87bc4b9cbdde5505f0ec) )
+ ROM_LOAD( "136064-1111.16c", 0x0b0000, 0x010000, CRC(6bf0bf98) SHA1(7d2b3b61da3749b352a6bf3f1ae1cb736b5b8386) )
+ ROM_LOAD( "136064-2115.18c", 0x0c0000, 0x010000, CRC(c3168603) SHA1(43e00fc739d1b3dd6d925bad63058fe74c1efc74) )
+ ROM_LOAD( "136064-1119.19c", 0x0d0000, 0x010000, CRC(7ff29d09) SHA1(81458b058f0b037778f255b5afe94a44aba74829) )
+ ROM_LOAD( "136064-1108.11c", 0x0f0000, 0x010000, CRC(99629412) SHA1(53a91b2a1ac62259ec9f78421b22c7b22f4233d6) )
+ ROM_LOAD( "136064-1112.12c", 0x100000, 0x010000, CRC(aa198cb7) SHA1(aad4a60210289d2e5a93aac336ba995ed6ac4886) )
+ ROM_LOAD( "136064-2116.13c", 0x110000, 0x010000, CRC(6cf79a67) SHA1(7f3271b575cf0b5033b5b19f0e71fae251040fc6) )
+ ROM_LOAD( "136064-1120.14c", 0x120000, 0x010000, CRC(40bdf767) SHA1(c57aaea838abeaea1a0060c45c2f33c38a51edb3) )
+
+ ROM_REGION( 0x040000, "gfx2", 0 )
+ ROM_LOAD( "136064-1101.9lm", 0x000000, 0x010000, CRC(a64b4da8) SHA1(f68778adb56a1eb964acdbc7e9d690a8a83f170b) )
+ ROM_LOAD( "136064-1102.8lm", 0x010000, 0x010000, CRC(ca91ec1b) SHA1(970c64e19893503cae796daee63b2d7d08eaf551) )
+ ROM_LOAD( "136064-1103.11lm", 0x020000, 0x010000, CRC(ee29d1d1) SHA1(2a7fea25728c66ce482de76299413ef5da01beef) )
+ ROM_LOAD( "136064-1104.10lm", 0x030000, 0x010000, CRC(882649f8) SHA1(fbaea597b6e318234e41df245023643f448a4938) )
+
+ ROM_REGION( 0x020000, "gfx3", 0 )
+ ROM_LOAD( "136064-1121.15n", 0x000000, 0x010000, CRC(0ca1e3b3) SHA1(d934bc9a1def4404fb86175878404cbb18127a11) )
+ ROM_LOAD( "136064-1122.16n", 0x010000, 0x010000, CRC(882f4e1c) SHA1(f7517ff03502ff029fb375260a35e45414567433) )
+
+ ROM_REGION( 0x200, "eeprom", 0 )
+ ROM_LOAD( "cyberbal-eeprom.bin", 0x0000, 0x200, CRC(c6f256b2) SHA1(e0c62adcd9fd38e9d3ac60e6b08d468e04a350c6) )
+ROM_END
+
+
ROM_START( cyberbalp )
ROM_REGION( 0x40000, "maincpu", 0 ) /* 4*64k for 68000 code */
ROM_LOAD16_BYTE( "136064-0123.1m", 0x000000, 0x010000, CRC(59bac810) SHA1(d4742b2b554c2ad62a2ea7152db3f06a06cddd67) )
@@ -1022,6 +1075,7 @@ DRIVER_INIT_MEMBER(cyberbal_state,cyberbalt)
GAMEL(1988, cyberbal, 0, cyberbal, cyberbal, cyberbal_state, 0, ROT0, "Atari Games", "Cyberball (rev 4)", 0, layout_dualhsxs )
GAMEL(1988, cyberbal2, cyberbal, cyberbal, cyberbal, cyberbal_state, 0, ROT0, "Atari Games", "Cyberball (rev 2)", 0, layout_dualhsxs )
+GAMEL(1988, cyberbal1, cyberbal, cyberbal, cyberbal, cyberbal_state, 0, ROT0, "Atari Games", "Cyberball (rev 1)", 0, layout_dualhsxs )
GAMEL(1988, cyberbalp, cyberbal, cyberbal, cyberbal, cyberbal_state, 0, ROT0, "Atari Games", "Cyberball (prototype)", 0, layout_dualhsxs )
GAME( 1989, cyberbal2p, cyberbal, cyberbal2p, cyberbal2p, cyberbal_state, 0, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 4)", 0 )
diff --git a/src/mame/drivers/namcos1.cpp b/src/mame/drivers/namcos1.cpp
index cde24c8e279..98c7e79c05c 100644
--- a/src/mame/drivers/namcos1.cpp
+++ b/src/mame/drivers/namcos1.cpp
@@ -1301,8 +1301,8 @@ ROM_START( dspirit2 )
ROM_LOAD_512( "ds1_p3.bin", 0x180000, CRC(c6e5954b) SHA1(586fc108f264e91a4bbbb05153dd1aa19be81b5b) )
ROM_LOAD_512( "ds1_p4.bin", 0x200000, CRC(f3307870) SHA1(a85d28c5dc55cbfa6c384d71e724db44c547d976) )
ROM_LOAD_512( "ds1_p5.bin", 0x280000, CRC(9a3a1028) SHA1(505808834677c433e0a4cfbf387b2874e2d0fc47) )
- ROM_LOAD_512( "ds2-pr6d.s11", 0x300000, CRC(5382447d) SHA1(3034d3a57b493c86673ee0aa7172bae778edd76a) ) // aka 8722-1107.bin for Atari's part number
- ROM_LOAD_512( "ds2-pr7d.t11", 0x380000, CRC(80ff492a) SHA1(716ff7444edc0dfcce0fda2d213feb183435471f) ) // aka 8722-1108.bin for Atari's part number
+ ROM_LOAD_512( "ds2-pr6d.s11", 0x300000, CRC(5382447d) SHA1(3034d3a57b493c86673ee0aa7172bae778edd76a) ) // aka 8722-136055-1107.bin for Atari's part number
+ ROM_LOAD_512( "ds2-pr7d.t11", 0x380000, CRC(80ff492a) SHA1(716ff7444edc0dfcce0fda2d213feb183435471f) ) // aka 8722-136055-1108.bin for Atari's part number
ROM_REGION( 0x1000, "mcu", 0 ) /* MCU internal ROM */
ROM_LOAD( "cus64-64a1.mcu", 0x0000, 0x1000, CRC(ffb5c0bd) SHA1(7a38c0cc2553c627f4ec507fb6e807cf7d537c02) ) /* internal 63701 MCU code */
diff --git a/src/mame/drivers/notechan.cpp b/src/mame/drivers/notechan.cpp
index 84f9d0c6008..606f10def56 100644
--- a/src/mame/drivers/notechan.cpp
+++ b/src/mame/drivers/notechan.cpp
@@ -40,6 +40,9 @@
Clock:
1x Xtal: 8.44800 MHz.
+ Output:
+ 1x TD62309P (six high-current sink drivers)
+
Other:
1x 8-DIP switches bank.
1x volume pot.
@@ -55,7 +58,7 @@
04- GND
05- DC +5V.
06- GND
- 07-
+ 07-
08- ACFAIL
09- DC 12V
10- GND
@@ -70,7 +73,7 @@
Voltage: AC 90/110 V., 50/60 Hz.
Power: 30 W.
-
+
****************************************************************************************
Samples:
@@ -148,7 +151,7 @@
$02E371-$030EDE: Sample #2-31 voice: unknown.
$030EDF-$0333F8: Sample #2-32 voice: unknown.
-
+
****************************************************************************************
Technical info:
@@ -159,7 +162,7 @@
E0 - PCB error, check ROM/RAM.
E1 - Home position sensor error.
E2 - Output sensor error.
- C0 - Freebie / Giveaway (??).
+ C0 - Freebie / Giveaway (??).
DIP Switches:
@@ -180,32 +183,113 @@
| PLAYS PER | 1 CREDIT / 3 PLAYS | | | | | OFF | | | |
| CREDIT | 1 CREDIT / 2 PLAYS | | | | | ON | | | |
+--------------+--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
- | ???? | ??? | | | | | | OFF | | |
- | | ??? | | | | | | ON | | |
+ | PAYOUT RATE | AS CONFIGURED | | | | | | OFF | | |
+ | MULTIPLIER | DOUBLE CONFIGURED | | | | | | ON | | |
+--------------+--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
- | ATTRACT | SOUND OUTPUT | | | | | | | OFF | |
+ | ATTRACT | WITH SOUND OUTPUT | | | | | | | OFF | |
| SOUND | NO SOUND OUTPUT | | | | | | | ON | |
+--------------+--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
| UNUSED | LEAVE IT OFF | | | | | | | | OFF |
+--------------+--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
+ | SETTING AS SHIPPED | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF |
+ +-----------------------------------+-----+-----+-----+-----+-----+-----+-----+-----+
Known Inputs:
- 1x Coin-In (100Y)
1x Start/Stop button.
- 1x (comm with prize dispenser)
+ 1x Coin-In (100Y)
+ 1x Prize Payout Detector (optical)
+ 1x Prizes Empty Sensor
+ 1x Home Position Sensor (optical)
+ 1x Service Switch (allows play without incrementing 100Y counter)
+ 1x Test Switch (used to enter test mode)
Known Outputs:
- 2x 7-seg LEDs for credits counter and error codes.
+ 1x 7-seg LEDs for play count, error code, and test phase.
+ 1x Start/Stop Switch lamp.
+ 1x Prize payout lamp (arrow pointing to prize, blinks when wins).
+ 1x Prizes empty LED.
2x Red panels (2 lamps each).
2x Blue panels (2 lamps each).
2x Yellow panels (2 lamps each).
- 1x Empty prize stock LED.
- 1x Arrow lamp pointing to the prize (blinks when wins).
- 1x Prize dispenser.
+ 1x "Note Vendor" prize dispenser.
+ 1x Coin lockout.
+ 1x 100Y counter (counts 100Y coins).
+ 1x Prize counter (counts prizes paid out).
+
+
+ Error codes:
+
+ Letter and number displayed alternately on the play count display.
+
+ C0 and prize out LED Prizes out.
+ E0 PCB failure.
+ E1 Home position sensor failure.
+ E2 Output sensor failure.
+
+-------------------------------------------------------------------
+
+ Test mode.
+
+ Enter by pressing test switch.
+ Test switch moves to next.
+ Start switch moves to previous.
+
+ 1. Game count display test.
+ * press/hold service to increment displayed digit.
+
+ 2. Lamp/LED test.
+ * press/hold sevice to step through lamps/LEDs in order:
+ - Start/stop switch.
+ - Prize payout lamp.
+ - Prizes empty LED.
+ - Left upper row 1.
+ - Left upper row 2.
+ - Middle upper row 1.
+ - Middle upper row 2.
+ - Right upper row 1.
+ - Right upper row 2.
+ - Left lower row 1.
+ - Left lower row 2.
+ - Middle lower row 1.
+ - Middle lower row 2.
+ - Right lower row 1.
+ - Right lower row 2.
+ - All lamps/LEDs off.
+
+ 3. Sensor/switch test.
+ * start/stop switch -> start switch lamp on=lit, off=unlit
+ * coin detector -> left lower row 1 on=lit, off=unlit
+ * prize payout detector -> left upper row 1 interrupted=lit, continuous=unlit
+ * prizes empty -> middle upper row 1 on=lit, off=unlit
+ * home position -> right upper row 1 interrupted=lit, continuous=unlit
+
+ 4. Audio output test.
+
+ 5. Payout mechanism test.
+ * dispenses one prize each time service swith is pressed.
+ * dispenses prizes while start/stop is held.
+ * counts prizes dispensed and shows sensor state on lamps (as for sensor/switch test).
+
+ 6. Coin mechanism test.
+ * service switch actuates coin lockout.
+ * counts/plays sound for coins.
+ * shows coin detector state on lamp (as for sensor/swtich test).
+
+ 7. DIP SW1..SW4 confirmation.
+ * SW1 -> left upper row 1.
+ * SW2 -> middle upper row 1.
+ * SW3 -> left lower row 1.
+ * SW4 -> middle lower row 1.
+
+ 8. DIP SW5..SW8 confirmation.
+ * SW5 -> left upper row 1.
+ * SW6 -> middle upper row 1.
+ * SW7 -> left lower row 1.
+ * SW8 -> middle lower row 1.
***************************************************************************************/
@@ -367,21 +451,21 @@ static INPUT_PORTS_START( notechan )
Inputs notes...
Port FAh:
-
+
(1) Pulsed under reset, activates port FAh-D5 (lamp 21) and triggers sample #20 (boing
or FX sound, depending of the OKI bank). Maybe it's the 'start' button.
(2) Pulsing and keep pressed under reset, triggers the sample #01 (cling) and starts
a sequence of 4-lines output through port FFh D3-D2-D1-D0 (lamps 27-26-25-24)
- that seems a 4-bits countdown (from 8 to 0) maybe related to the 7segment LEDs
- credits counter). Then triggers sample #04 (voice or effect depending of the OKI
- bank). After a little while also triggers sample #05 (voice).
- Maybe it's some kind of hardware testing mode or boot sequence...
+ that seems a 4-bits countdown (from 8 to 0) maybe related to the 7segment LEDs
+ credits counter). Then triggers sample #04 (voice or effect depending of the OKI
+ bank). After a little while also triggers sample #05 (voice).
+ Maybe it's some kind of hardware testing mode or boot sequence...
(3) Pulsing this input activates port FAh-D1 (lamp 17) and triggers sample #01 (cling).
- Maybe it's the 'coin-in' button.
+ Maybe it's the 'coin-in' button.
-*/
+*/
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
diff --git a/src/mame/drivers/qix.cpp b/src/mame/drivers/qix.cpp
index 6e9ab4c07f2..28dbbf459e8 100644
--- a/src/mame/drivers/qix.cpp
+++ b/src/mame/drivers/qix.cpp
@@ -769,22 +769,24 @@ ROM_START( qixa )
ROM_LOAD( "qq27.u27", 0xf800, 0x0800, CRC(f3782bd0) SHA1(bfc6d29f9668e02857453e96c005c81568ae931d) )
ROM_END
-// same set as above, but with larger roms
+// same set as above, but with larger roms.
+// The same ROMs, with different labels, were also found on an original Taito TT Qix 2 PCB set
+// Main PCB marked LK070001A LKN00001A and sub PCB marked LK070002 LKN00002
ROM_START( qixb )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "lk14.bin", 0xc000, 0x1000, CRC(6d164986) SHA1(c805abe1a441e10080ceca8ba547835bafb61bcc) )
- ROM_LOAD( "lk15.bin", 0xd000, 0x1000, CRC(16c6ce0f) SHA1(b8091d2db476d2acb4b3f0789e1f155336be9b39) )
- ROM_LOAD( "lk16.bin", 0xe000, 0x1000, CRC(698b1f9c) SHA1(7e7637ca5985f072e821e16f8b65aedb87df136b) )
- ROM_LOAD( "lk17.bin", 0xf000, 0x1000, CRC(7e3adde6) SHA1(dfe66317f87e10919f1ea4b4d565703e73039821) )
+ ROM_LOAD( "lk14.bin", 0xc000, 0x1000, CRC(6d164986) SHA1(c805abe1a441e10080ceca8ba547835bafb61bcc) ) // LK05.H1 2732
+ ROM_LOAD( "lk15.bin", 0xd000, 0x1000, CRC(16c6ce0f) SHA1(b8091d2db476d2acb4b3f0789e1f155336be9b39) ) // LK06.J1 2732
+ ROM_LOAD( "lk16.bin", 0xe000, 0x1000, CRC(698b1f9c) SHA1(7e7637ca5985f072e821e16f8b65aedb87df136b) ) // LK07.L1 2732
+ ROM_LOAD( "lk17.bin", 0xf000, 0x1000, CRC(7e3adde6) SHA1(dfe66317f87e10919f1ea4b4d565703e73039821) ) // LK08.M1 2732
ROM_REGION( 0x10000, "videocpu", 0 )
- ROM_LOAD( "lk10.bin", 0xc000, 0x1000, CRC(7eac67d0) SHA1(ca5938422aaa1e380af0afa505876d4682ac69b9) )
- ROM_LOAD( "lk11.bin", 0xd000, 0x1000, CRC(90ccbb6a) SHA1(b65592384597dc2aafc02f49b6b6f477c9112580) )
- ROM_LOAD( "lk12.bin", 0xe000, 0x1000, CRC(be9b9f7d) SHA1(e681bdb9aa8b8c31af1c14e23d0f420577d6db63) )
- ROM_LOAD( "lk13.bin", 0xf000, 0x1000, CRC(51c9853b) SHA1(29a5221f2af866d2ee73110409ecddc2c96404fd) )
+ ROM_LOAD( "lk10.bin", 0xc000, 0x1000, CRC(7eac67d0) SHA1(ca5938422aaa1e380af0afa505876d4682ac69b9) ) // LK01.B1 2732
+ ROM_LOAD( "lk11.bin", 0xd000, 0x1000, CRC(90ccbb6a) SHA1(b65592384597dc2aafc02f49b6b6f477c9112580) ) // LK02.D1 2732
+ ROM_LOAD( "lk12.bin", 0xe000, 0x1000, CRC(be9b9f7d) SHA1(e681bdb9aa8b8c31af1c14e23d0f420577d6db63) ) // LK03.E1 2732
+ ROM_LOAD( "lk13.bin", 0xf000, 0x1000, CRC(51c9853b) SHA1(29a5221f2af866d2ee73110409ecddc2c96404fd) ) // LK04.F1 2732
ROM_REGION( 0x10000, "audiocpu", 0 )
- ROM_LOAD( "qq27.u27", 0xf800, 0x0800, CRC(f3782bd0) SHA1(bfc6d29f9668e02857453e96c005c81568ae931d) )
+ ROM_LOAD( "qq27.u27", 0xf800, 0x0800, CRC(f3782bd0) SHA1(bfc6d29f9668e02857453e96c005c81568ae931d) ) // LK09.D2 2716
ROM_END
diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp
index f386520e5a3..403764ee9ef 100644
--- a/src/mame/drivers/segas16b.cpp
+++ b/src/mame/drivers/segas16b.cpp
@@ -9040,7 +9040,7 @@ GAME( 1987, sdibl6, sdi, system16b_split, sdi, segas16b
// bootlegs with modified hardware
GAME( 1989, fpointbl, fpoint, fpointbl, fpointbl, segas16b_state, generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (World, bootleg)", 0 )
-GAME( 1989, fpointbj, fpoint, fpointbl, fpointbl, segas16b_state, generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (Japan, bootleg)", 0 )
+GAME( 1989, fpointbj, fpoint, fpointbl, fpointbl, segas16b_state, generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (Japan, bootleg set 1)", 0 )
GAME( 1989, fpointbla, fpoint, fpointbla, fpointbl, segas16b_state, fpointbla, ROT0, "bootleg", "Flash Point (Japan, bootleg set 2)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 7652c3c2748..e40ba5b46c3 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -10673,6 +10673,7 @@ hxhdci2k //
@source:cyberbal.cpp
cyberbal // 136064 (c) 1989
+cyberbal1 // 136064 (c) 1989
cyberbal2 // 136064 (c) 1989
cyberbal2p // 136071 (c) 1989
cyberbal2p1 // 136071 (c) 1989