summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/cpu/rsp/rsp.cpp282
-rw-r--r--src/devices/cpu/rsp/rsp.h46
-rw-r--r--src/devices/cpu/z80/nsc800.cpp12
-rw-r--r--src/devices/cpu/z80/z80.cpp33
-rw-r--r--src/devices/cpu/z80/z80.h15
-rw-r--r--src/devices/cpu/z80/z80.lst110
-rw-r--r--src/devices/cpu/z80/z80make.py28
-rw-r--r--src/devices/cpu/z80/z80n.h2
-rw-r--r--src/devices/machine/netlist.cpp13
-rw-r--r--src/frontend/mame/ui/info.cpp5
-rw-r--r--src/mame/bmc/koftball.cpp158
-rw-r--r--src/mame/igs/igs011.cpp97
-rw-r--r--src/mame/igs/igs_m027.cpp207
-rw-r--r--src/mame/misc/sshanghai.cpp146
14 files changed, 699 insertions, 455 deletions
diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp
index f39d79b21bb..b58b7169e80 100644
--- a/src/devices/cpu/rsp/rsp.cpp
+++ b/src/devices/cpu/rsp/rsp.cpp
@@ -62,11 +62,6 @@ DEFINE_DEVICE_TYPE(RSP, rsp_device, "rsp", "Nintendo & SGI Reality Signal Proces
#define ZERO 3
#define CLIP2 4
-#define SLICE_H 3
-#define SLICE_M 2
-#define SLICE_L 1
-#define SLICE_LL 0
-
#define WRITEBACK_RESULT() memcpy(m_v[VDREG].s, vres, sizeof(uint16_t) * 8);
static const int vector_elements_2[16][8] =
@@ -265,7 +260,7 @@ void rsp_device::device_start()
for (int regIdx = 0; regIdx < 32; regIdx++)
m_r[regIdx] = 0;
- for(auto & elem : m_v)
+ for (auto & elem : m_v)
{
elem.d[0] = 0;
elem.d[1] = 0;
@@ -284,7 +279,7 @@ void rsp_device::device_start()
m_vector_busy = false;
m_paired_busy = false;
- for(auto & elem : m_accum)
+ for (auto & elem : m_accum)
{
elem.q = 0;
}
@@ -294,6 +289,35 @@ void rsp_device::device_start()
m_sr = RSP_STATUS_HALT;
m_step_count = 0;
+ // register for savestates
+ save_item(NAME(m_pc));
+ save_item(NAME(m_r));
+ save_item(NAME(m_ideduct));
+ save_item(NAME(m_scalar_busy));
+ save_item(NAME(m_vector_busy));
+ save_item(NAME(m_paired_busy));
+
+ save_item(NAME(m_sr));
+ save_item(NAME(m_step_count));
+ save_item(NAME(m_ppc));
+ save_item(NAME(m_nextpc));
+
+ save_item(NAME(m_vres));
+ save_item(NAME(m_accum));
+ save_item(NAME(m_vcarry));
+ save_item(NAME(m_vcompare));
+ save_item(NAME(m_vclip1));
+ save_item(NAME(m_vzero));
+ save_item(NAME(m_vclip2));
+
+ for (int i = 0; i < std::size(m_v); i++)
+ save_item(NAME(m_v[i].d), i);
+
+ save_item(NAME(m_reciprocal_res));
+ save_item(NAME(m_reciprocal_high));
+ save_item(NAME(m_dp_allowed));
+
+ // register state for debugger
state_add( RSP_PC, "PC", m_pc).callimport().callexport().formatstr("%08X");
state_add( RSP_R0, "R0", m_r[0]).formatstr("%08X");
state_add( RSP_R1, "R1", m_r[1]).formatstr("%08X");
@@ -528,15 +552,15 @@ void rsp_device::device_reset()
uint16_t rsp_device::SATURATE_ACCUM(int accum, int slice, uint16_t negative, uint16_t positive)
{
- if ((int16_t)m_accum[accum].w[SLICE_H] < 0)
+ if ((int16_t)m_accum[accum].w.h3 < 0)
{
- if ((uint16_t)m_accum[accum].w[SLICE_H] != 0xffff)
+ if ((uint16_t)m_accum[accum].w.h3 != 0xffff)
{
return negative;
}
else
{
- if ((int16_t)m_accum[accum].w[SLICE_M] >= 0)
+ if ((int16_t)m_accum[accum].w.h2 >= 0)
{
return negative;
}
@@ -544,24 +568,24 @@ uint16_t rsp_device::SATURATE_ACCUM(int accum, int slice, uint16_t negative, uin
{
if (slice == 0)
{
- return m_accum[accum].w[SLICE_L];
+ return m_accum[accum].w.h;
}
else if (slice == 1)
{
- return m_accum[accum].w[SLICE_M];
+ return m_accum[accum].w.h2;
}
}
}
}
else
{
- if ((uint16_t)m_accum[accum].w[SLICE_H] != 0)
+ if ((uint16_t)m_accum[accum].w.h3 != 0)
{
return positive;
}
else
{
- if ((int16_t)m_accum[accum].w[SLICE_M] < 0)
+ if ((int16_t)m_accum[accum].w.h2 < 0)
{
return positive;
}
@@ -569,11 +593,11 @@ uint16_t rsp_device::SATURATE_ACCUM(int accum, int slice, uint16_t negative, uin
{
if (slice == 0)
{
- return m_accum[accum].w[SLICE_L];
+ return m_accum[accum].w.h;
}
else
{
- return m_accum[accum].w[SLICE_M];
+ return m_accum[accum].w.h2;
}
}
}
@@ -610,19 +634,19 @@ void rsp_device::handle_vector_ops(uint32_t op)
if (s1 == -32768 && s2 == -32768)
{
// overflow
- m_accum[i].w[SLICE_H] = 0;
- m_accum[i].w[SLICE_M] = -32768;
- m_accum[i].w[SLICE_L] = -32768;
+ m_accum[i].w.h3 = 0;
+ m_accum[i].w.h2 = -32768;
+ m_accum[i].w.h = -32768;
vres[i] = 0x7fff;
}
else
{
int64_t r = s1 * s2 * 2;
r += 0x8000; // rounding ?
- m_accum[i].w[SLICE_H] = (r < 0) ? 0xffff : 0; // Sign-extend to 48-bit
- m_accum[i].w[SLICE_M] = (int16_t)(r >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)r;
- vres[i] = m_accum[i].w[SLICE_M];
+ m_accum[i].w.h3 = (r < 0) ? 0xffff : 0; // Sign-extend to 48-bit
+ m_accum[i].w.h2 = (int16_t)(r >> 16);
+ m_accum[i].w.h = (uint16_t)r;
+ vres[i] = m_accum[i].w.h2;
}
}
WRITEBACK_RESULT();
@@ -645,21 +669,21 @@ void rsp_device::handle_vector_ops(uint32_t op)
int64_t r = s1 * s2 * 2;
r += 0x8000; // rounding ?
- m_accum[i].w[SLICE_H] = (uint16_t)(r >> 32);
- m_accum[i].w[SLICE_M] = (uint16_t)(r >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)r;
+ m_accum[i].w.h3 = (uint16_t)(r >> 32);
+ m_accum[i].w.h2 = (uint16_t)(r >> 16);
+ m_accum[i].w.h = (uint16_t)r;
if (r < 0)
{
vres[i] = 0;
}
- else if (((int16_t)m_accum[i].w[SLICE_H] ^ (int16_t)m_accum[i].w[SLICE_M]) < 0)
+ else if (((int16_t)m_accum[i].w.h3 ^ (int16_t)m_accum[i].w.h2) < 0)
{
vres[i] = -1;
}
else
{
- vres[i] = m_accum[i].w[SLICE_M];
+ vres[i] = m_accum[i].w.h2;
}
}
WRITEBACK_RESULT();
@@ -683,11 +707,11 @@ void rsp_device::handle_vector_ops(uint32_t op)
uint32_t s2 = m_v[VS2REG].w[VEC_EL_2(EL, i)];
uint32_t r = s1 * s2;
- m_accum[i].w[SLICE_H] = 0;
- m_accum[i].w[SLICE_M] = 0;
- m_accum[i].w[SLICE_L] = (uint16_t)(r >> 16);
+ m_accum[i].w.h3 = 0;
+ m_accum[i].w.h2 = 0;
+ m_accum[i].w.h = (uint16_t)(r >> 16);
- vres[i] = m_accum[i].w[SLICE_L];
+ vres[i] = m_accum[i].w.h;
}
WRITEBACK_RESULT();
break;
@@ -710,11 +734,11 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s2 = m_v[VS2REG].w[VEC_EL_2(EL, i)]; // not sign-extended
int32_t r = s1 * s2;
- m_accum[i].w[SLICE_H] = (r < 0) ? 0xffff : 0; // sign-extend to 48-bit
- m_accum[i].w[SLICE_M] = (int16_t)(r >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)r;
+ m_accum[i].w.h3 = (r < 0) ? 0xffff : 0; // sign-extend to 48-bit
+ m_accum[i].w.h2 = (int16_t)(r >> 16);
+ m_accum[i].w.h = (uint16_t)r;
- vres[i] = m_accum[i].w[SLICE_M];
+ vres[i] = m_accum[i].w.h2;
}
WRITEBACK_RESULT();
break;
@@ -737,11 +761,11 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
int32_t r = s1 * s2;
- m_accum[i].w[SLICE_H] = (r < 0) ? 0xffff : 0; // sign-extend to 48-bit
- m_accum[i].w[SLICE_M] = (int16_t)(r >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)(r);
+ m_accum[i].w.h3 = (r < 0) ? 0xffff : 0; // sign-extend to 48-bit
+ m_accum[i].w.h2 = (int16_t)(r >> 16);
+ m_accum[i].w.h = (uint16_t)(r);
- vres[i] = m_accum[i].w[SLICE_L];
+ vres[i] = m_accum[i].w.h;
}
WRITEBACK_RESULT();
break;
@@ -764,9 +788,9 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
int32_t r = s1 * s2;
- m_accum[i].w[SLICE_H] = (int16_t)(r >> 16);
- m_accum[i].w[SLICE_M] = (uint16_t)(r);
- m_accum[i].w[SLICE_L] = 0;
+ m_accum[i].w.h3 = (int16_t)(r >> 16);
+ m_accum[i].w.h2 = (uint16_t)(r);
+ m_accum[i].w.h = 0;
if (r < -32768) r = -32768;
if (r > 32767) r = 32767;
@@ -792,17 +816,17 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
int32_t r = s1 * s2;
- uint64_t q = (uint64_t)(uint16_t)m_accum[i].w[SLICE_LL];
- q |= (((uint64_t)(uint16_t)m_accum[i].w[SLICE_L]) << 16);
- q |= (((uint64_t)(uint16_t)m_accum[i].w[SLICE_M]) << 32);
- q |= (((uint64_t)(uint16_t)m_accum[i].w[SLICE_H]) << 48);
+ uint64_t q = (uint64_t)(uint16_t)m_accum[i].w.l;
+ q |= (((uint64_t)(uint16_t)m_accum[i].w.h) << 16);
+ q |= (((uint64_t)(uint16_t)m_accum[i].w.h2) << 32);
+ q |= (((uint64_t)(uint16_t)m_accum[i].w.h3) << 48);
q += (int64_t)(r) << 17;
- m_accum[i].w[SLICE_LL] = (uint16_t)q;
- m_accum[i].w[SLICE_L] = (uint16_t)(q >> 16);
- m_accum[i].w[SLICE_M] = (uint16_t)(q >> 32);
- m_accum[i].w[SLICE_H] = (uint16_t)(q >> 48);
+ m_accum[i].w.l = (uint16_t)q;
+ m_accum[i].w.h = (uint16_t)(q >> 16);
+ m_accum[i].w.h2 = (uint16_t)(q >> 32);
+ m_accum[i].w.h3 = (uint16_t)(q >> 48);
vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff);
}
@@ -823,32 +847,32 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s1 = m_v[VS1REG].s[i];
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
int32_t r1 = s1 * s2;
- uint32_t r2 = m_accum[i].w[SLICE_L] + ((uint16_t)r1 * 2);
- uint32_t r3 = m_accum[i].w[SLICE_M] + (uint16_t)((r1 >> 16) * 2) + (uint16_t)(r2 >> 16);
+ uint32_t r2 = m_accum[i].w.h + ((uint16_t)r1 * 2);
+ uint32_t r3 = m_accum[i].w.h2 + (uint16_t)((r1 >> 16) * 2) + (uint16_t)(r2 >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)r2;
- m_accum[i].w[SLICE_M] = (uint16_t)r3;
- m_accum[i].w[SLICE_H] += (uint16_t)(r3 >> 16) + (uint16_t)(r1 >> 31);
+ m_accum[i].w.h = (uint16_t)r2;
+ m_accum[i].w.h2 = (uint16_t)r3;
+ m_accum[i].w.h3 += (uint16_t)(r3 >> 16) + (uint16_t)(r1 >> 31);
- if ((int16_t)m_accum[i].w[SLICE_H] < 0)
+ if ((int16_t)m_accum[i].w.h3 < 0)
{
vres[i] = 0;
}
else
{
- if (m_accum[i].w[SLICE_H] != 0)
+ if (m_accum[i].w.h3 != 0)
{
vres[i] = 0xffff;
}
else
{
- if ((int16_t)m_accum[i].w[SLICE_M] < 0)
+ if ((int16_t)m_accum[i].w.h2 < 0)
{
vres[i] = 0xffff;
}
else
{
- vres[i] = m_accum[i].w[SLICE_M];
+ vres[i] = m_accum[i].w.h2;
}
}
}
@@ -873,12 +897,12 @@ void rsp_device::handle_vector_ops(uint32_t op)
uint32_t s1 = m_v[VS1REG].w[i];
uint32_t s2 = m_v[VS2REG].w[VEC_EL_2(EL, i)];
uint32_t r1 = s1 * s2;
- uint32_t r2 = m_accum[i].w[SLICE_L] + (r1 >> 16);
- uint32_t r3 = m_accum[i].w[SLICE_M] + (r2 >> 16);
+ uint32_t r2 = m_accum[i].w.h + (r1 >> 16);
+ uint32_t r3 = m_accum[i].w.h2 + (r2 >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)r2;
- m_accum[i].w[SLICE_M] = (uint16_t)r3;
- m_accum[i].w[SLICE_H] += (int16_t)(r3 >> 16);
+ m_accum[i].w.h = (uint16_t)r2;
+ m_accum[i].w.h2 = (uint16_t)r3;
+ m_accum[i].w.h3 += (int16_t)(r3 >> 16);
vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff);
}
@@ -902,14 +926,14 @@ void rsp_device::handle_vector_ops(uint32_t op)
uint32_t s1 = m_v[VS1REG].s[i];
uint32_t s2 = m_v[VS2REG].w[VEC_EL_2(EL, i)]; // not sign-extended
uint32_t r1 = s1 * s2;
- uint32_t r2 = (uint16_t)m_accum[i].w[SLICE_L] + (uint16_t)(r1);
- uint32_t r3 = (uint16_t)m_accum[i].w[SLICE_M] + (r1 >> 16) + (r2 >> 16);
+ uint32_t r2 = (uint16_t)m_accum[i].w.h + (uint16_t)(r1);
+ uint32_t r3 = (uint16_t)m_accum[i].w.h2 + (r1 >> 16) + (r2 >> 16);
- m_accum[i].w[SLICE_L] = (uint16_t)r2;
- m_accum[i].w[SLICE_M] = (uint16_t)r3;
- m_accum[i].w[SLICE_H] += (uint16_t)(r3 >> 16);
+ m_accum[i].w.h = (uint16_t)r2;
+ m_accum[i].w.h2 = (uint16_t)r3;
+ m_accum[i].w.h3 += (uint16_t)(r3 >> 16);
if ((int32_t)r1 < 0)
- m_accum[i].w[SLICE_H] -= 1;
+ m_accum[i].w.h3 -= 1;
vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff);
}
@@ -933,16 +957,16 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s1 = m_v[VS1REG].w[i]; // not sign-extended
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
- uint64_t q = (uint64_t)m_accum[i].w[SLICE_LL];
- q |= (((uint64_t)m_accum[i].w[SLICE_L]) << 16);
- q |= (((uint64_t)m_accum[i].w[SLICE_M]) << 32);
- q |= (((uint64_t)m_accum[i].w[SLICE_H]) << 48);
+ uint64_t q = (uint64_t)m_accum[i].w.l;
+ q |= (((uint64_t)m_accum[i].w.h) << 16);
+ q |= (((uint64_t)m_accum[i].w.h2) << 32);
+ q |= (((uint64_t)m_accum[i].w.h3) << 48);
q += (int64_t)(s1*s2) << 16;
- m_accum[i].w[SLICE_LL] = (uint16_t)q;
- m_accum[i].w[SLICE_L] = (uint16_t)(q >> 16);
- m_accum[i].w[SLICE_M] = (uint16_t)(q >> 32);
- m_accum[i].w[SLICE_H] = (uint16_t)(q >> 48);
+ m_accum[i].w.l = (uint16_t)q;
+ m_accum[i].w.h = (uint16_t)(q >> 16);
+ m_accum[i].w.h2 = (uint16_t)(q >> 32);
+ m_accum[i].w.h3 = (uint16_t)(q >> 48);
vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff);
}
@@ -967,12 +991,12 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s1 = m_v[VS1REG].s[i];
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
- int32_t accum = (uint32_t)(uint16_t)m_accum[i].w[SLICE_M];
- accum |= ((uint32_t)((uint16_t)m_accum[i].w[SLICE_H])) << 16;
+ int32_t accum = (uint32_t)(uint16_t)m_accum[i].w.h2;
+ accum |= ((uint32_t)((uint16_t)m_accum[i].w.h3)) << 16;
accum += s1 * s2;
- m_accum[i].w[SLICE_H] = (uint16_t)(accum >> 16);
- m_accum[i].w[SLICE_M] = (uint16_t)accum;
+ m_accum[i].w.h3 = (uint16_t)(accum >> 16);
+ m_accum[i].w.h2 = (uint16_t)accum;
vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff);
}
@@ -997,7 +1021,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
int32_t r = s1 + s2 + BIT(m_vcarry, i);
- m_accum[i].w[SLICE_L] = (int16_t)r;
+ m_accum[i].w.h = (int16_t)r;
if (r > 32767) r = 32767;
if (r < -32768) r = -32768;
@@ -1026,7 +1050,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t s2 = m_v[VS2REG].s[VEC_EL_2(EL, i)];
int32_t r = s1 - s2 - BIT(m_vcarry, i);
- m_accum[i].w[SLICE_L] = (int16_t)r;
+ m_accum[i].w.h = (int16_t)r;
if (r > 32767) r = 32767;
if (r < -32768) r = -32768;
@@ -1074,7 +1098,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = 0;
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1101,7 +1125,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t r = s1 + s2;
vres[i] = (int16_t)r;
- m_accum[i].w[SLICE_L] = (int16_t)r;
+ m_accum[i].w.h = (int16_t)r;
if (r & 0xffff0000)
{
@@ -1133,7 +1157,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
int32_t r = s1 - s2;
vres[i] = (int16_t)(r);
- m_accum[i].w[SLICE_L] = (uint16_t)r;
+ m_accum[i].w.h = (uint16_t)r;
if ((uint16_t)r != 0)
{
@@ -1163,7 +1187,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
for (int i = 0; i < 8; i++)
{
- m_v[VDREG].w[i] = m_accum[i].w[SLICE_H];
+ m_v[VDREG].w[i] = m_accum[i].w.h3;
}
break;
}
@@ -1171,7 +1195,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
for (int i = 0; i < 8; i++)
{
- m_v[VDREG].w[i] = m_accum[i].w[SLICE_M];
+ m_v[VDREG].w[i] = m_accum[i].w.h2;
}
break;
}
@@ -1179,7 +1203,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
for (int i = 0; i < 8; i++)
{
- m_v[VDREG].w[i] = m_accum[i].w[SLICE_L];
+ m_v[VDREG].w[i] = m_accum[i].w.h;
}
break;
}
@@ -1228,7 +1252,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = s2;
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
m_vzero = 0;
@@ -1264,7 +1288,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
vres[i] = s2;
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
m_vzero = 0;
@@ -1301,7 +1325,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = s2;
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
m_vzero = 0;
@@ -1338,7 +1362,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = s2;
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
m_vzero = 0;
@@ -1367,11 +1391,11 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
if (BIT(m_vcompare, i)) // vcc_lo
{
- m_accum[i].w[SLICE_L] = -(uint16_t)s2;
+ m_accum[i].w.h = -(uint16_t)s2;
}
else
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
}
}
else
@@ -1380,12 +1404,12 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
if (((uint32_t)(uint16_t)(s1) + (uint32_t)(uint16_t)(s2)) > 0x10000)
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
m_vcompare &= ~(1 << i);
}
else
{
- m_accum[i].w[SLICE_L] = -(uint16_t)s2;
+ m_accum[i].w.h = -(uint16_t)s2;
m_vcompare |= 1 << i;
}
}
@@ -1393,12 +1417,12 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
if (((uint32_t)(uint16_t)(s1) + (uint32_t)(uint16_t)(s2)) != 0)
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
m_vcompare &= ~(1 << i);
}
else
{
- m_accum[i].w[SLICE_L] = -(uint16_t)s2;
+ m_accum[i].w.h = -(uint16_t)s2;
m_vcompare |= 1 << i;
}
}
@@ -1410,29 +1434,29 @@ void rsp_device::handle_vector_ops(uint32_t op)
{
if (BIT(m_vclip2, i)) // vcc_hi
{
- m_accum[i].w[SLICE_L] = s2;
+ m_accum[i].w.h = s2;
}
else
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
}
}
else
{
if (((int32_t)(uint16_t)s1 - (int32_t)(uint16_t)s2) >= 0)
{
- m_accum[i].w[SLICE_L] = s2;
+ m_accum[i].w.h = s2;
m_vclip2 |= 1 << i;
}
else
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
m_vclip2 &= ~(1 << i);
}
}
}
- vres[i] = m_accum[i].w[SLICE_L];
+ vres[i] = m_accum[i].w.h;
}
m_vzero = 0;
@@ -1521,7 +1545,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
m_vclip1 |= 1 << i;
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1555,12 +1579,12 @@ void rsp_device::handle_vector_ops(uint32_t op)
}
if ((s1 + s2) <= 0)
{
- m_accum[i].w[SLICE_L] = ~(uint16_t)s2;
+ m_accum[i].w.h = ~(uint16_t)s2;
m_vcompare |= 1 << i;
}
else
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
}
}
else
@@ -1571,16 +1595,16 @@ void rsp_device::handle_vector_ops(uint32_t op)
}
if ((s1 - s2) >= 0)
{
- m_accum[i].w[SLICE_L] = s2;
+ m_accum[i].w.h = s2;
m_vclip2 |= 1 << i;
}
else
{
- m_accum[i].w[SLICE_L] = s1;
+ m_accum[i].w.h = s1;
}
}
- vres[i] = m_accum[i].w[SLICE_L];
+ vres[i] = m_accum[i].w.h;
}
WRITEBACK_RESULT();
break;
@@ -1606,7 +1630,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = m_v[VS2REG].s[VEC_EL_2(EL, i)];
}
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1624,7 +1648,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = m_v[VS1REG].w[i] & m_v[VS2REG].w[VEC_EL_2(EL, i)];
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1642,7 +1666,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = ~(m_v[VS1REG].w[i] & m_v[VS2REG].w[VEC_EL_2(EL, i)]);
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1660,7 +1684,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = m_v[VS1REG].w[i] | m_v[VS2REG].w[VEC_EL_2(EL, i)];
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1678,7 +1702,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = ~(m_v[VS1REG].w[i] | m_v[VS2REG].w[VEC_EL_2(EL, i)]);
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1696,7 +1720,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = m_v[VS1REG].w[i] ^ m_v[VS2REG].w[VEC_EL_2(EL, i)];
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1714,7 +1738,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = ~(m_v[VS1REG].w[i] ^ m_v[VS2REG].w[VEC_EL_2(EL, i)]);
- m_accum[i].w[SLICE_L] = vres[i];
+ m_accum[i].w.h = vres[i];
}
WRITEBACK_RESULT();
break;
@@ -1737,7 +1761,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = 0;
uint16_t e1 = m_v[VS1REG].w[i];
uint16_t e2 = m_v[VS2REG].w[VEC_EL_2(EL, i)];
- m_accum[i].w[SLICE_L] = e1 + e2;
+ m_accum[i].w.h = e1 + e2;
}
WRITEBACK_RESULT();
break;
@@ -1796,7 +1820,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[VEC_EL_2(EL, i)];
+ m_accum[i].w.h = m_v[VS2REG].w[VEC_EL_2(EL, i)];
}
break;
}
@@ -1871,7 +1895,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[VEC_EL_2(EL, i)];
+ m_accum[i].w.h = m_v[VS2REG].w[VEC_EL_2(EL, i)];
}
break;
}
@@ -1890,7 +1914,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[VEC_EL_2(EL, i)];
+ m_accum[i].w.h = m_v[VS2REG].w[VEC_EL_2(EL, i)];
}
m_v[VDREG].s[VS1REG & 7] = (int16_t)(m_reciprocal_res >> 16);
@@ -1909,7 +1933,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
m_v[VDREG].w[VS1REG & 7] = m_v[VS2REG].w[VEC_EL_2(EL, VS1REG & 7)];
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[i];
+ m_accum[i].w.h = m_v[VS2REG].w[i];
}
break;
}
@@ -1969,7 +1993,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[VEC_EL_2(EL, i)];
+ m_accum[i].w.h = m_v[VS2REG].w[VEC_EL_2(EL, i)];
}
break;
@@ -2048,7 +2072,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[VEC_EL_2(EL, i)];
+ m_accum[i].w.h = m_v[VS2REG].w[VEC_EL_2(EL, i)];
}
break;
@@ -2068,7 +2092,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
- m_accum[i].w[SLICE_L] = m_v[VS2REG].w[VEC_EL_2(EL, i)];
+ m_accum[i].w.h = m_v[VS2REG].w[VEC_EL_2(EL, i)];
}
m_v[VDREG].s[VS1REG & 7] = (int16_t)(m_reciprocal_res >> 16); // store high part
@@ -2103,7 +2127,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
vres[i] = 0;
uint16_t e1 = m_v[VS1REG].w[i];
uint16_t e2 = m_v[VS2REG].w[VEC_EL_2(EL, i)];
- m_accum[i].w[SLICE_L] = e1 + e2;
+ m_accum[i].w.h = e1 + e2;
}
WRITEBACK_RESULT();
break;
@@ -2123,7 +2147,7 @@ void rsp_device::handle_vector_ops(uint32_t op)
for (int i = 0; i < 8; i++)
{
vres[i] = m_v[VS1REG].w[i];
- m_accum[i].w[SLICE_L] = 0;
+ m_accum[i].w.h = 0;
}
WRITEBACK_RESULT();
break;
diff --git a/src/devices/cpu/rsp/rsp.h b/src/devices/cpu/rsp/rsp.h
index 0007e96714c..4e7378af089 100644
--- a/src/devices/cpu/rsp/rsp.h
+++ b/src/devices/cpu/rsp/rsp.h
@@ -148,7 +148,7 @@ protected:
memory_access<12, 2, 0, ENDIANNESS_BIG>::specific m_dmem;
private:
- union VECTOR_REG
+ union VECTOR_REG // PAIR128
{
uint64_t d[2];
uint32_t l[4];
@@ -157,13 +157,6 @@ private:
uint8_t b[16];
};
- union ACCUMULATOR_REG
- {
- uint64_t q;
- uint32_t l[2];
- uint16_t w[4];
- };
-
uint32_t m_debugger_temp;
uint16_t m_pc_temp;
uint16_t m_ppc_temp;
@@ -188,26 +181,23 @@ private:
// COP2 (vectors)
uint16_t SATURATE_ACCUM(int accum, int slice, uint16_t negative, uint16_t positive);
- uint16_t m_vres[8];
- VECTOR_REG m_v[32];
- ACCUMULATOR_REG m_accum[8];
- uint8_t m_vcarry;
- uint8_t m_vcompare;
- uint8_t m_vclip1;
- uint8_t m_vzero;
- uint8_t m_vclip2;
-
- int32_t m_reciprocal_res;
- uint32_t m_reciprocal_high;
- int32_t m_dp_allowed;
-
- void handle_cop2(uint32_t op);
- void handle_lwc2(uint32_t op);
- void handle_swc2(uint32_t op);
- void handle_vector_ops(uint32_t op);
-
- uint32_t m_div_in;
- uint32_t m_div_out;
+ uint16_t m_vres[8];
+ VECTOR_REG m_v[32];
+ PAIR64 m_accum[8];
+ uint8_t m_vcarry;
+ uint8_t m_vcompare;
+ uint8_t m_vclip1;
+ uint8_t m_vzero;
+ uint8_t m_vclip2;
+
+ int32_t m_reciprocal_res;
+ uint32_t m_reciprocal_high;
+ int32_t m_dp_allowed;
+
+ void handle_cop2(uint32_t op);
+ void handle_lwc2(uint32_t op);
+ void handle_swc2(uint32_t op);
+ void handle_vector_ops(uint32_t op);
};
DECLARE_DEVICE_TYPE(RSP, rsp_device)
diff --git a/src/devices/cpu/z80/nsc800.cpp b/src/devices/cpu/z80/nsc800.cpp
index d7af9a67fe2..e2c0bfd0087 100644
--- a/src/devices/cpu/z80/nsc800.cpp
+++ b/src/devices/cpu/z80/nsc800.cpp
@@ -54,17 +54,21 @@ void nsc800_device::execute_run()
void nsc800_device::execute_set_input(int inputnum, int state)
{
+ bool update_irq_attention = false;
switch (inputnum)
{
case NSC800_RSTA:
+ update_irq_attention = true;
m_nsc800_irq_state[0] = state;
break;
case NSC800_RSTB:
+ update_irq_attention = true;
m_nsc800_irq_state[1] = state;
break;
case NSC800_RSTC:
+ update_irq_attention = true;
m_nsc800_irq_state[2] = state;
break;
@@ -72,4 +76,12 @@ void nsc800_device::execute_set_input(int inputnum, int state)
z80_device::execute_set_input(inputnum, state);
break;
}
+
+ if (update_irq_attention)
+ {
+ if (m_nsc800_irq_state[0] != CLEAR_LINE || m_nsc800_irq_state[1] != CLEAR_LINE || m_nsc800_irq_state[2] != CLEAR_LINE)
+ set_service_attention<SA_NSC800_IRQ_ON, 1>();
+ else
+ set_service_attention<SA_NSC800_IRQ_ON, 0>();
+ }
}
diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp
index ab4d79d5120..c95474999d5 100644
--- a/src/devices/cpu/z80/z80.cpp
+++ b/src/devices/cpu/z80/z80.cpp
@@ -50,6 +50,7 @@ void z80_device::halt()
if (!m_halt)
{
m_halt = 1;
+ set_service_attention<SA_HALT, 1>();
m_halt_cb(1);
}
}
@@ -62,6 +63,7 @@ void z80_device::leave_halt()
if (m_halt)
{
m_halt = 0;
+ set_service_attention<SA_HALT, 0>();
m_halt_cb(0);
}
}
@@ -468,7 +470,7 @@ void z80_device::block_io_interrupted_flags()
void z80_device::ei()
{
m_iff1 = m_iff2 = 1;
- m_after_ei = true;
+ set_service_attention<SA_AFTER_EI, 1>();
}
void z80_device::set_f(u8 f)
@@ -562,14 +564,12 @@ void z80_device::device_start()
save_item(NAME(m_im));
save_item(NAME(m_i));
save_item(NAME(m_nmi_state));
- save_item(NAME(m_nmi_pending));
save_item(NAME(m_irq_state));
save_item(NAME(m_wait_state));
save_item(NAME(m_busrq_state));
save_item(NAME(m_busack_state));
- save_item(NAME(m_after_ei));
- save_item(NAME(m_after_ldair));
save_item(NAME(m_ea));
+ save_item(NAME(m_service_attention));
save_item(NAME(m_tmp_irq_vector));
save_item(NAME(m_shared_addr.w));
save_item(NAME(m_shared_data.w));
@@ -602,14 +602,12 @@ void z80_device::device_start()
m_im = 0;
m_i = 0;
m_nmi_state = 0;
- m_nmi_pending = false;
m_irq_state = 0;
m_wait_state = 0;
m_busrq_state = 0;
m_busack_state = 0;
- m_after_ei = false;
- m_after_ldair = false;
m_ea = 0;
+ m_service_attention = 0;
m_rtemp = 0;
space(AS_PROGRAM).cache(m_args);
@@ -667,11 +665,9 @@ void z80_device::device_reset()
m_i = 0;
m_r = 0;
m_r2 = 0;
- m_nmi_pending = false;
- m_after_ei = false;
- m_after_ldair = false;
m_iff1 = 0;
m_iff2 = 0;
+ m_service_attention = 0;
}
/****************************************************************************
@@ -688,12 +684,18 @@ void z80_device::execute_set_input(int inputnum, int state)
{
case Z80_INPUT_LINE_BUSRQ:
m_busrq_state = state;
+ if (state != CLEAR_LINE)
+ set_service_attention<SA_BUSRQ, 1>();
+ else
+ set_service_attention<SA_BUSRQ, 0>();
break;
case INPUT_LINE_NMI:
// mark an NMI pending on the rising edge
if (m_nmi_state == CLEAR_LINE && state != CLEAR_LINE)
- m_nmi_pending = true;
+ {
+ set_service_attention<SA_NMI_PENDING, 1>();
+ }
m_nmi_state = state;
break;
@@ -702,6 +704,10 @@ void z80_device::execute_set_input(int inputnum, int state)
m_irq_state = state;
if (daisy_chain_present())
m_irq_state = (daisy_update_irq_state() == ASSERT_LINE) ? ASSERT_LINE : m_irq_state;
+ if (state != CLEAR_LINE)
+ set_service_attention<SA_IRQ_ON, 1>();
+ else
+ set_service_attention<SA_IRQ_ON, 0>();
// the main execute loop will take the interrupt
break;
@@ -728,8 +734,9 @@ void z80_device::state_import(const device_state_entry &entry)
case STATE_GENPC:
m_prvpc = m_pc;
m_ref = 0xffff00;
- m_after_ei = false;
- m_after_ldair = false;
+ set_service_attention<SA_AFTER_EI, 0>();
+ if (HAS_LDAIR_QUIRK)
+ set_service_attention<SA_AFTER_LDAIR, 0>();
break;
case Z80_R:
diff --git a/src/devices/cpu/z80/z80.h b/src/devices/cpu/z80/z80.h
index ec111c3cd32..b40e697d81f 100644
--- a/src/devices/cpu/z80/z80.h
+++ b/src/devices/cpu/z80/z80.h
@@ -78,6 +78,8 @@ protected:
void illegal_1();
void illegal_2();
u8 flags_szyxc(u16 value);
+ template <u8 Bit, bool State> void set_service_attention() { static_assert(Bit < 8, "out of range bit index"); if (State) m_service_attention |= (1 << Bit); else m_service_attention &= ~(1 << Bit); };
+ template <u8 Bit> bool get_service_attention() { static_assert(Bit < 8, "out of range bit index"); return m_service_attention & (1 << Bit); };
void halt();
void leave_halt();
@@ -137,6 +139,16 @@ protected:
devcb_write_line m_halt_cb;
devcb_write_line m_busack_cb;
+ static constexpr u8 SA_BUSRQ = 0;
+ static constexpr u8 SA_BUSACK = 1;
+ static constexpr u8 SA_NMI_PENDING = 2;
+ static constexpr u8 SA_IRQ_ON = 3;
+ static constexpr u8 SA_HALT = 4;
+ static constexpr u8 SA_AFTER_EI = 5;
+ static constexpr u8 SA_AFTER_LDAIR = 6;
+ static constexpr u8 SA_NSC800_IRQ_ON = 7;
+ u8 m_service_attention; // bitmap for required handling in service step
+
PAIR16 m_prvpc;
PAIR16 m_pc;
PAIR16 m_sp;
@@ -161,13 +173,10 @@ protected:
u8 m_im;
u8 m_i;
u8 m_nmi_state; // nmi pin state
- bool m_nmi_pending; // nmi pending
u8 m_irq_state; // irq pin state
int m_wait_state; // wait pin state
int m_busrq_state; // bus request pin state
u8 m_busack_state; // bus acknowledge pin state
- bool m_after_ei; // are we in the EI shadow?
- bool m_after_ldair; // same, but for LD A,I or LD A,R
u16 m_ea;
int m_icount;
diff --git a/src/devices/cpu/z80/z80.lst b/src/devices/cpu/z80/z80.lst
index 12bd39360ba..a31e651748b 100644
--- a/src/devices/cpu/z80/z80.lst
+++ b/src/devices/cpu/z80/z80.lst
@@ -206,10 +206,14 @@ macro r800:ld_r_a
macro ld_a_r
call nomreq_ir 1
- A = (m_r & 0x7f) | m_r2; set_f((F & CF) | SZ[A] | (m_iff2 << 2)); m_after_ldair = true;
+ A = (m_r & 0x7f) | m_r2; set_f((F & CF) | SZ[A] | (m_iff2 << 2));
+ if (HAS_LDAIR_QUIRK)
+ set_service_attention<SA_AFTER_LDAIR, 1>();
macro r800:ld_a_r
- A = (m_r & 0x7f) | m_r2; set_f((F & CF) | SZ[A] | (m_iff2 << 2)); m_after_ldair = true;
+ A = (m_r & 0x7f) | m_r2; set_f((F & CF) | SZ[A] | (m_iff2 << 2));
+ if (HAS_LDAIR_QUIRK)
+ set_service_attention<SA_AFTER_LDAIR, 1>();
macro ld_i_a
call nomreq_ir 1
@@ -220,10 +224,14 @@ macro r800:ld_i_a
macro ld_a_i
call nomreq_ir 1
- A = m_i; set_f((F & CF) | SZ[A] | (m_iff2 << 2)); m_after_ldair = true;
+ A = m_i; set_f((F & CF) | SZ[A] | (m_iff2 << 2));
+ if (HAS_LDAIR_QUIRK)
+ set_service_attention<SA_AFTER_LDAIR, 1>();
macro r800:ld_a_i
- A = m_i; set_f((F & CF) | SZ[A] | (m_iff2 << 2)); m_after_ldair = true;
+ A = m_i; set_f((F & CF) | SZ[A] | (m_iff2 << 2));
+ if (HAS_LDAIR_QUIRK)
+ set_service_attention<SA_AFTER_LDAIR, 1>();
macro rst addr
TDAT = PC;
@@ -531,8 +539,8 @@ macro r800:otdr
PC -= 2; block_io_interrupted_flags();
}
-macro jump %opcode
- m_ref = 0x%opcode00;
+macro jump %po
+ m_ref = 0x%po00;
goto process;
macro jump_prefixed %prefix
@@ -542,10 +550,9 @@ macro jump_prefixed %prefix
macro take_nmi
// Check if processor was halted
leave_halt();
- #if HAS_LDAIR_QUIRK
+ if (HAS_LDAIR_QUIRK)
// reset parity flag after LD A,I or LD A,R
- if (m_after_ldair) F &= ~PF;
- #endif
+ if (get_service_attention<SA_AFTER_LDAIR>()) F &= ~PF;
m_iff1 = 0;
m_r++;
+ 5
@@ -553,7 +560,7 @@ macro take_nmi
call wm16_sp
PC = 0x0066;
WZ = PC;
- m_nmi_pending = false;
+ set_service_attention<SA_NMI_PENDING, 0>();
macro irqfetch
{
@@ -640,27 +647,26 @@ macro take_interrupt
}
}
WZ = PC;
- #if HAS_LDAIR_QUIRK
+ if (HAS_LDAIR_QUIRK)
// reset parity flag after LD A,I or LD A,R
- if (m_after_ldair) F &= ~PF;
- #endif
+ if (get_service_attention<SA_AFTER_LDAIR>()) F &= ~PF;
macro check_interrupts
- if (m_nmi_pending) {
+ if (get_service_attention<SA_NMI_PENDING>()) {
call take_nmi
- } else if (m_irq_state != CLEAR_LINE && m_iff1 && !m_after_ei) {
+ } else if (m_irq_state != CLEAR_LINE && m_iff1 && !get_service_attention<SA_AFTER_EI>()) { // SA_IRQ_ON
call take_interrupt
}
macro z80n:check_interrupts
- if (m_nmi_pending) {
+ if (get_service_attention<SA_NMI_PENDING>()) {
if (m_stackless) {
// on take_nmi
m_out_nextreg_cb(0xc2, m_pc.b.l);
m_out_nextreg_cb(0xc3, m_pc.b.h);
}
call take_nmi
- } else if (m_irq_state != CLEAR_LINE && m_iff1 && !m_after_ei) {
+ } else if (m_irq_state != CLEAR_LINE && m_iff1 && !get_service_attention<SA_AFTER_EI>()) {
call take_interrupt
}
@@ -688,17 +694,16 @@ macro nsc800_take_interrupt
;
}
WZ = PC;
- #if HAS_LDAIR_QUIRK
+ if (HAS_LDAIR_QUIRK)
// reset parity flag after LD A,I or LD A,R
- if (m_after_ldair) F &= ~PF;
- #endif
+ if (get_service_attention<SA_AFTER_LDAIR>()) F &= ~PF;
macro nsc800:check_interrupts
- if (m_nmi_pending) {
+ if (get_service_attention<SA_NMI_PENDING>()) {
call take_nmi
- } else if ((m_nsc800_irq_state[0] != CLEAR_LINE || m_nsc800_irq_state[1] != CLEAR_LINE || m_nsc800_irq_state[2] != CLEAR_LINE) && m_iff1 && !m_after_ei) {
+ } else if (get_service_attention<SA_NSC800_IRQ_ON>() && m_iff1 && !get_service_attention<SA_AFTER_EI>()) {
call nsc800_take_interrupt
- } else if (m_irq_state != CLEAR_LINE && m_iff1 && !m_after_ei) {
+ } else if (m_irq_state != CLEAR_LINE && m_iff1 && !get_service_attention<SA_AFTER_EI>()) { // SA_IRQ_ON
call take_interrupt
}
@@ -707,35 +712,42 @@ macro nsc800:check_interrupts
# ROP
##########################################################
ffff
- m_ref = 0xffff00;
- if (m_icount <= 0) return;
- if (m_busrq_state) {
- if (!m_busack_state) {
- m_busack_state = 1;
- m_busack_cb(1);
- }
- if (m_icount > 0)
- m_icount = 0;
+ if (m_icount <= 0) {
+ m_ref = 0xffff00;
return;
- } else if (m_busack_state) {
- m_busack_state = 0;
- m_busack_cb(0);
}
- call check_interrupts
- m_after_ei = false;
- m_after_ldair = false;
- if (m_halt) {
- debugger_wait_hook();
- call rop
- PC--;
- continue;
- } else {
- PRVPC = PC;
- debugger_instruction_hook(PC);
- call rop
- m_ref = (0x00 << 16) | (TDAT8 << 8);
- goto process;
+ if (m_service_attention) {
+ if (m_busrq_state) { // SA_BUSRQ
+ if (!m_busack_state) {
+ m_busack_state = 1;
+ set_service_attention<SA_BUSACK, 1>();
+ m_busack_cb(1);
+ }
+ if (m_icount > 0)
+ m_icount = 0;
+ m_ref = 0xffff00;
+ return;
+ } else if (m_busack_state) { // SA_BUSACK
+ m_busack_state = 0;
+ set_service_attention<SA_BUSACK, 0>();
+ m_busack_cb(0);
+ }
+ call check_interrupts
+ set_service_attention<SA_AFTER_EI, 0>(); // SA_AFTER_EI
+ if (HAS_LDAIR_QUIRK)
+ set_service_attention<SA_AFTER_LDAIR, 0>(); // SA_AFTER_LDAIR
+ if (m_halt) { // SA_HALT
+ debugger_wait_hook();
+ call rop
+ PC--;
+ continue;
+ }
}
+ PRVPC = PC;
+ debugger_instruction_hook(PC);
+ call rop
+ m_ref = (0x00 << 16) | (TDAT8 << 8);
+ goto process;
##########################################################
diff --git a/src/devices/cpu/z80/z80make.py b/src/devices/cpu/z80/z80make.py
index 0aa7ee1a55e..023cdfd29ba 100644
--- a/src/devices/cpu/z80/z80make.py
+++ b/src/devices/cpu/z80/z80make.py
@@ -31,6 +31,10 @@ class IndStr:
def has_indent(self):
return self.indent != ''
+ def strip_indent(self, n):
+ if self.indent != '':
+ self.indent = self.indent[n:]
+
def replace(self, new):
self.str = new
@@ -77,7 +81,7 @@ class Opcode:
for i in range(0, len(self.source)):
il = self.source[i]
if not has_steps or not step_switch:
- il.indent = ""
+ il.strip_indent(1)
line = il.line()
tokens = line.split()
last_line = i + 1 == len(self.source)
@@ -240,7 +244,7 @@ class OpcodeList:
name = line_toc[1]
arg = None
if len(line_toc) > 2:
- arg = line_toc[2]
+ arg = " ".join(line_toc[2:])
if name in self.macros:
macro = self.macros[name]
([out.extend(self.pre_process(il)) for il in macro.apply(arg)])
@@ -260,21 +264,22 @@ class OpcodeList:
for prefix in sorted(prefixes):
is_rop = prefix == 'ff'
+ opc_switch = not is_rop
if prefix_switch:
print("case 0x%s:" % (prefix), file=f)
print("{", file=f)
- if not is_rop:
+ if opc_switch:
print("\tswitch (u8(m_ref >> 8)) // opcode", file=f)
print("\t{", file=f)
for opc in self.opcode_info[prefix]:
# reenter loop only process steps > 0
if not reenter or opc.with_steps():
- if not is_rop:
+ if opc_switch:
print("\tcase 0x%s:" % (opc.code), file=f)
opc.save_dasm(step_switch=reenter, f=f)
print("\t\tcontinue;", file=f)
print("", file=f)
- if not is_rop:
+ if opc_switch:
print("\t}", file=f)
if prefix_switch:
@@ -295,6 +300,7 @@ class OpcodeList:
print("", file=f)
print("bool interrupted = true;", file=f)
print("while (u8(m_ref) != 0x00) {", file=f)
+ print("// slow re-enter", file=f)
print("\t// workaround to simulate main loop behavior where continue statement relays on having it set after", file=f)
print("\tif (!interrupted) {", file=f)
print("\t\tm_ref = 0xffff00;", file=f)
@@ -305,19 +311,17 @@ class OpcodeList:
self.switch_prefix(self.opcode_info.keys(), reenter=True, f=f)
print("", file=f)
print('assert((void("switch statement above must cover all possible cases!"), false));', file=f)
- print("}", file=f)
- print("", file=f)
+ print("} // end: slow", file=f)
print("if (m_ref != 0xffff00) goto process;", file=f)
print("", file=f)
- print("while (true) {", file=f)
- print("", file=f)
- print("\t\t// unwrapped ff prefix", file=f)
+ print("while (true) { // fast process", file=f)
+ print("\t\t// rop: unwrapped ff prefix", file=f)
self.switch_prefix(['ff'], reenter=False, f=f)
print("", file=f)
print("process:", file=f)
self.switch_prefix(self.opcode_info.keys() - ['ff'], reenter=False, f=f)
- print("", file=f)
- print("} // while (true)", file=f)
+ print("} // end: fast", file=f)
+ print('assert((void("unreachable!"), false));', file=f)
def main(argv):
if len(argv) != 3 and len(argv) != 4:
diff --git a/src/devices/cpu/z80/z80n.h b/src/devices/cpu/z80/z80n.h
index 8198412074c..d4d452955fd 100644
--- a/src/devices/cpu/z80/z80n.h
+++ b/src/devices/cpu/z80/z80n.h
@@ -20,7 +20,7 @@ public:
bool nmi_stackless_r() { return m_stackless; }
void nmi_stackless_w(bool data) { m_stackless = data; }
- void nmi() { m_nmi_pending = true; }
+ void nmi() { set_service_attention<SA_NMI_PENDING, 1>(); }
protected:
virtual void device_start() override ATTR_COLD;
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index c9d91704cce..8d4d6cedf4d 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -33,7 +33,6 @@
#define LOG_TIMING (1U << 3)
//#define LOG_MASK (LOG_GENERAL | LOG_DEV_CALLS | LOG_DEBUG)
-//#define LOG_MASK (LOG_TIMING)
#define LOG_MASK (0)
#define LOGDEVCALLS(...) LOGMASKED(LOG_DEV_CALLS, __VA_ARGS__)
@@ -815,11 +814,15 @@ void netlist_mame_stream_output_device::device_reset()
void netlist_mame_stream_output_device::sound_update_fill(sound_stream &stream, int output)
{
- if (stream.samples() < m_buffer.size())
- osd_printf_warning("sound %s: samples %d less bufsize %d\n", name(), stream.samples(), m_buffer.size());
+ int samples = m_buffer.size();
+ if (stream.samples() < samples)
+ {
+ osd_printf_warning("sound %s: samples %d less bufsize %d\n", name(), stream.samples(), samples);
+ samples = stream.samples();
+ }
int sampindex;
- for (sampindex = 0; sampindex < m_buffer.size(); sampindex++)
+ for (sampindex = 0; sampindex < samples; sampindex++)
stream.put(output, sampindex, m_buffer[sampindex]);
if (sampindex < stream.samples())
stream.fill(output, m_cur, sampindex);
@@ -858,7 +861,7 @@ void netlist_mame_stream_output_device::process(netlist::netlist_time_ext tim, n
int pos = (tim - m_last_buffer_time) / m_sample_time;
//if (pos > m_bufsize)
// throw emu_fatalerror("sound %s: pos %d exceeded bufsize %d\n", name().c_str(), pos, m_bufsize);
- while (m_buffer.size() < pos )
+ while (m_buffer.size() < pos)
{
m_buffer.push_back(static_cast<sound_stream::sample_t>(m_cur));
}
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 8c08af9a4c6..8db48046bc4 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -182,7 +182,7 @@ void get_system_warnings(
std::set<std::add_pointer_t<device_type> > seen;
for (device_t &device : device_enumerator(machine.root_device()))
{
- if ((device.type().emulation_flags() & device_t::flags::NOT_WORKING) && seen.insert(&device.type()).second)
+ if ((&machine.root_device() != &device) && (device.type().emulation_flags() & device_t::flags::NOT_WORKING) && seen.insert(&device.type()).second)
{
util::stream_format(buf, first ? _("%s") : _(", %s"), device.type().fullname());
first = false;
@@ -281,7 +281,8 @@ machine_static_info::machine_static_info(const ui_options &options, machine_conf
m_emulation_flags |= device.type().emulation_flags() & ~device_t::flags::NOT_WORKING;
m_unemulated_features |= device.type().unemulated_features();
m_imperfect_features |= device.type().imperfect_features();
- m_has_nonworking_devices = m_has_nonworking_devices || (device.type().emulation_flags() & device_t::flags::NOT_WORKING);
+ if (&config.root_device() != &device)
+ m_has_nonworking_devices = m_has_nonworking_devices || (device.type().emulation_flags() & device_t::flags::NOT_WORKING);
// look for BIOS options
device_t const *const parent(device.owner());
diff --git a/src/mame/bmc/koftball.cpp b/src/mame/bmc/koftball.cpp
index 56944d3e4f9..a29413b5391 100644
--- a/src/mame/bmc/koftball.cpp
+++ b/src/mame/bmc/koftball.cpp
@@ -41,6 +41,7 @@ ft5_v6_c4.u58 /
#include "cpu/m68000/m68000.h"
#include "machine/nvram.h"
+#include "machine/ticket.h"
#include "machine/timer.h"
#include "sound/okim6295.h"
#include "sound/ymopl.h"
@@ -77,7 +78,8 @@ public:
m_videoram(*this, "videoram%u", 0U),
m_pixram(*this, "pixram"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_hopper(*this, "hopper")
{ }
void jxzh(machine_config &config) ATTR_COLD;
@@ -97,6 +99,8 @@ private:
required_shared_ptr<u16> m_pixram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_device<hopper_device> m_hopper;
+
tilemap_t *m_tilemap[4]{};
u16 m_prot_data = 0;
u8 m_irq_enable = 0;
@@ -107,6 +111,7 @@ private:
u8 m_pixpal = 0;
void irq_ack_w(u8 data);
+ void outputs_w(u8 data);
u16 random_number_r();
u16 prot_r();
u16 kaimenhu_prot_r();
@@ -295,6 +300,14 @@ void koftball_state::irq_ack_w(u8 data)
m_maincpu->set_input_line(i, CLEAR_LINE);
}
+void koftball_state::outputs_w(u8 data)
+{
+ m_hopper->motor_w(BIT(data, 0));
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); // credits in
+ machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // credits paid out by hopper or key-out
+ // bit 7 always set?
+}
+
// FIXME: merge video maps
void koftball_state::koftball_mem(address_map &map)
{
@@ -353,7 +366,7 @@ void koftball_state::jxzh_mem(address_map &map)
map(0x2a001a, 0x2a001d).nopw();
map(0x2a0000, 0x2a001f).r(FUNC(koftball_state::random_number_r));
map(0x2b0000, 0x2b0001).portr("DSW");
- map(0x2da000, 0x2da003).w("ymsnd", FUNC(ym2413_device::write)).umask16(0xff00);
+ map(0x2da000, 0x2da003).umask16(0xff00).w("ymsnd", FUNC(ym2413_device::write));
map(0x2db001, 0x2db001).w("ramdac", FUNC(ramdac_device::index_w));
map(0x2db002, 0x2db003).nopr(); // reads here during some scene changes
@@ -362,7 +375,7 @@ void koftball_state::jxzh_mem(address_map &map)
map(0x2dc000, 0x2dc000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x2f0000, 0x2f0001).portr("INPUTS");
- map(0x300000, 0x300001).nopw();
+ map(0x300001, 0x300001).w(FUNC(koftball_state::outputs_w));
map(0x320000, 0x320000).lw8(NAME([this] (u8 data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl $320000 (layer enable) %02x\n", data); }));
map(0x340000, 0x340001).r(FUNC(koftball_state::prot_r));
map(0x360000, 0x360001).w(FUNC(koftball_state::prot_w));
@@ -384,23 +397,23 @@ void koftball_state::ramdac_map(address_map &map)
static INPUT_PORTS_START( koftball )
PORT_START("INPUTS")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BILL1 )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) // also decrease in sound test
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) // also increase in sound test
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("unknown1") PORT_CODE(KEYCODE_A)
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START1 )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("unknown2") PORT_CODE(KEYCODE_S)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW ) // test mode enter
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("unknown3") PORT_CODE(KEYCODE_D)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("unknown4") PORT_CODE(KEYCODE_F)
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("unknown5") PORT_CODE(KEYCODE_G)
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_LOW )
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH )
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )
PORT_START("DSW")
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!8")
@@ -453,75 +466,86 @@ static INPUT_PORTS_START( koftball )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
INPUT_PORTS_END
-static INPUT_PORTS_START( jxzh )
+static INPUT_PORTS_START( kaimenhu )
PORT_START("INPUTS")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("hopper switch") PORT_CODE(KEYCODE_H)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) PORT_NAME("Change Tile / Double Up")
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_NAME("%p Mahjong Small / Right")
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_NAME("%p Mahjong Big / Left")
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) PORT_NAME("%p Mahjong Double Up / Change Tile")
PORT_START("DSW")
- PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!8")
- PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!7")
- PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!6")
- PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!5")
- PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!4")
- PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!3")
- PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!2")
- PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!1")
- PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW2:!8")
- PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:!7")
- PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:!6")
- PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:!5")
- PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:!4")
- PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:!3")
- PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:!2")
- PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!1")
- PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0001, 0x0001, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:8")
+ PORT_DIPSETTING( 0x0001, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0002, 0x0002, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:7")
+ PORT_DIPSETTING( 0x0002, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0004, 0x0004, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:6")
+ PORT_DIPSETTING( 0x0004, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0008, 0x0008, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:5")
+ PORT_DIPSETTING( 0x0008, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0010, 0x0010, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:4")
+ PORT_DIPSETTING( 0x0010, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0020, 0x0020, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:3")
+ PORT_DIPSETTING( 0x0020, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0040, 0x0040, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:2")
+ PORT_DIPSETTING( 0x0040, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0080, 0x0080, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:1")
+ PORT_DIPSETTING( 0x0080, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0100, 0x0100, DEF_STR(Service_Mode) ) PORT_DIPLOCATION("SW2:8")
+ PORT_DIPSETTING( 0x0100, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0200, 0x0200, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW2:7")
+ PORT_DIPSETTING( 0x0200, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0400, 0x0400, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW2:6")
+ PORT_DIPSETTING( 0x0400, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x0800, 0x0800, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW2:5")
+ PORT_DIPSETTING( 0x0800, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x1000, 0x1000, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW2:4")
+ PORT_DIPSETTING( 0x1000, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x2000, 0x2000, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW2:3")
+ PORT_DIPSETTING( 0x2000, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x4000, 0x0000, "In-Game Music" ) PORT_DIPLOCATION("SW2:2")
+ PORT_DIPSETTING( 0x4000, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+ PORT_DIPNAME( 0x8000, 0x0000, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:1")
+ PORT_DIPSETTING( 0x8000, DEF_STR(Off) )
+ PORT_DIPSETTING( 0x0000, DEF_STR(On) )
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( jxzh )
+ PORT_INCLUDE(kaimenhu)
+
+ PORT_MODIFY("DSW")
+ PORT_DIPNAME( 0x0003, 0x0003, "Odds Rate" ) PORT_DIPLOCATION("SW1:8,7")
+ PORT_DIPSETTING( 0x0003, "1 2 3 4 6 8 10 15" )
+ PORT_DIPSETTING( 0x0002, "1 2 4 8 12 16 24 32" )
+ PORT_DIPSETTING( 0x0001, "1 2 3 5 8 15 30 50" )
+ PORT_DIPSETTING( 0x0000, "1 2 3 5 10 25 50 100" )
INPUT_PORTS_END
@@ -596,6 +620,8 @@ void koftball_state::jxzh(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &koftball_state::jxzh_mem);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+
+ HOPPER(config, m_hopper, attotime::from_msec(50));
}
void koftball_state::kaimenhu(machine_config &config)
@@ -745,4 +771,4 @@ void koftball_state::init_koftball()
GAME( 1995, koftball, 0, koftball, koftball, koftball_state, init_koftball, ROT0, "BMC", "King of Football", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1996, jxzh, 0, jxzh, jxzh, koftball_state, empty_init, ROT0, "BMC", "Jinxiu Zhonghua", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
-GAME( 1996, kaimenhu, jxzh, kaimenhu, jxzh, koftball_state, empty_init, ROT0, "BMC", "Kaimen Hu", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAME( 1996, kaimenhu, jxzh, kaimenhu, kaimenhu, koftball_state, empty_init, ROT0, "BMC", "Kaimen Hu", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/igs/igs011.cpp b/src/mame/igs/igs011.cpp
index ec6c08faa8a..8513a663336 100644
--- a/src/mame/igs/igs011.cpp
+++ b/src/mame/igs/igs011.cpp
@@ -592,17 +592,14 @@ void igs011_state::igs011_blit_flags_w(offs_t offset, u16 data, u16 mem_mask)
clear_pen = m_blitter.pen;
}
- const int xstart = (m_blitter.x & 0x1ff) - (m_blitter.x & 0x200);
- const int ystart = (m_blitter.y & 0x0ff) - (m_blitter.y & 0x100);
-
- int xend, xinc;
- int yend, yinc;
-
- if (flipx) { xend = xstart - (m_blitter.w & 0x1ff) - 1; xinc = -1; }
- else { xend = xstart + (m_blitter.w & 0x1ff) + 1; xinc = 1; }
-
- if (flipy) { yend = ystart - (m_blitter.h & 0x0ff) - 1; yinc = -1; }
- else { yend = ystart + (m_blitter.h & 0x0ff) + 1; yinc = 1; }
+ const int xstart = util::sext(m_blitter.x, 10);
+ const int ystart = util::sext(m_blitter.y, 9);
+ const int xsize = (m_blitter.w & 0x1ff) + 1;
+ const int ysize = (m_blitter.h & 0x0ff) + 1;
+ const int xend = flipx ? (xstart - xsize) : (xstart + xsize);
+ const int yend = flipy ? (ystart - ysize) : (ystart + ysize);
+ const int xinc = flipx ? -1 : 1;
+ const int yinc = flipy ? -1 : 1;
for (int y = ystart; y != yend; y += yinc)
{
@@ -3397,7 +3394,7 @@ static INPUT_PORTS_START( lhb2 )
PORT_DIPSETTING( 0x02, "70%" )
PORT_DIPSETTING( 0x01, "74%" )
PORT_DIPSETTING( 0x00, "78%" )
- PORT_DIPNAME( 0x08, 0x00, "Odds Rate" ) PORT_DIPLOCATION("SW1:4") // 倍數?
+ PORT_DIPNAME( 0x08, 0x00, "Odds Rate" ) PORT_DIPLOCATION("SW1:4") // 倍數表
PORT_DIPSETTING( 0x00, "1,2,3,4,5,6,7,8" )
PORT_DIPSETTING( 0x08, "1,2,3,5,8,15,30,50" )
PORT_DIPNAME( 0x10, 0x00, "Maximum Bet" ) PORT_DIPLOCATION("SW1:5") // 最大押注
@@ -3408,9 +3405,9 @@ static INPUT_PORTS_START( lhb2 )
PORT_DIPSETTING( 0x40, "2" )
PORT_DIPSETTING( 0x20, "3" )
PORT_DIPSETTING( 0x00, "5" )
- PORT_DIPNAME( 0x80, 0x80, "Credit Timer" ) PORT_DIPLOCATION("SW1:8") // ??清除 (clears credits after timeout if you don't start a game)
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) // ?
- PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // ?
+ PORT_DIPNAME( 0x80, 0x80, "Credit Timer" ) PORT_DIPLOCATION("SW1:8") // 自動清除 (clears credits after timeout if you don't start a game)
+ PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // ?
+ PORT_DIPSETTING( 0x00, DEF_STR(On) ) // ?
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2") // 投幣比率
@@ -3430,13 +3427,15 @@ static INPUT_PORTS_START( lhb2 )
PORT_DIPNAME( 0x20, 0x20, "Payout Mode" ) PORT_DIPLOCATION("SW2:6") // 退分方式
PORT_DIPSETTING( 0x20, "Key-Out" ) // 洗分
PORT_DIPSETTING( 0x00, "Return Coins" ) // 退幣 (doesn't seem to work properly)
- PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) // ????
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") // ??音?
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // ?
- PORT_DIPSETTING( 0x80, DEF_STR( On ) ) // ?
+ PORT_DIPNAME( 0x40, 0x40, "Auto Reach" ) PORT_DIPLOCATION("SW2:7") // 自動摸打 (automatically draws and discards tiles after reach)
+ PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ?
+ PORT_DIPSETTING( 0x40, DEF_STR(On) ) // ?
+ PORT_DIPNAME( 0x80, 0x80, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:8") // 示範音樂
+ PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ?
+ PORT_DIPSETTING( 0x80, DEF_STR(On) ) // ?
PORT_START("DSW3")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1,2") // ??限?
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1,2") // 破台限制
PORT_DIPSETTING( 0x03, "500" )
PORT_DIPSETTING( 0x02, "1000" )
PORT_DIPSETTING( 0x01, "2000" )
@@ -3582,37 +3581,39 @@ INPUT_PORTS_END
// basically same game as lhb2 and nkishusp but with joystick controls
static INPUT_PORTS_START( tygn )
PORT_START("DSW1")
- PORT_DIPNAME( 0x07, 0x07, "Pay Out (%)" ) PORT_DIPLOCATION("DSW1:1,2,3")
- PORT_DIPSETTING( 0x07, "50" )
- PORT_DIPSETTING( 0x06, "54" )
- PORT_DIPSETTING( 0x05, "58" )
- PORT_DIPSETTING( 0x04, "62" )
- PORT_DIPSETTING( 0x03, "66" )
- PORT_DIPSETTING( 0x02, "70" )
- PORT_DIPSETTING( 0x01, "74" )
- PORT_DIPSETTING( 0x00, "78" )
- PORT_DIPNAME( 0x08, 0x08, "Minimum Bet" ) PORT_DIPLOCATION("DSW1:4")
+ PORT_DIPNAME( 0x07, 0x02, "Payout Rate" ) PORT_DIPLOCATION("SW1:1,2,3") // 機率調整
+ PORT_DIPSETTING( 0x07, "50%" )
+ PORT_DIPSETTING( 0x06, "54%" )
+ PORT_DIPSETTING( 0x05, "58%" )
+ PORT_DIPSETTING( 0x04, "62%" )
+ PORT_DIPSETTING( 0x03, "66%" )
+ PORT_DIPSETTING( 0x02, "70%" )
+ PORT_DIPSETTING( 0x01, "74%" )
+ PORT_DIPSETTING( 0x00, "78%" )
+ PORT_DIPNAME( 0x08, 0x08, "Minimum Bet" ) PORT_DIPLOCATION("SW1:4") // 最小押注
PORT_DIPSETTING( 0x08, "1" )
PORT_DIPSETTING( 0x00, "2" )
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:5,6")
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:7")
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPUNKNOWN( 0x80, 0x80 ) PORT_DIPLOCATION("DSW1:8")
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR(Coinage) ) PORT_DIPLOCATION("SW1:5,6") // 投幣比率
+ PORT_DIPSETTING( 0x00, DEF_STR(2C_1C) )
+ PORT_DIPSETTING( 0x30, DEF_STR(1C_1C) )
+ PORT_DIPSETTING( 0x20, DEF_STR(1C_2C) )
+ PORT_DIPSETTING( 0x10, DEF_STR(1C_3C) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:7") // 示範音樂
+ PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ?
+ PORT_DIPSETTING( 0x40, DEF_STR(On) ) // ?
+ PORT_DIPNAME( 0x80, 0x80, "Credit Timer" ) PORT_DIPLOCATION("SW1:8") // 自動清除 (clears credits after timeout if you don't start a game)
+ PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // ?
+ PORT_DIPSETTING( 0x00, DEF_STR(On) ) // ?
PORT_START("DSW2") // not shown in test mode
- PORT_DIPUNKNOWN( 0x01, 0x01 ) PORT_DIPLOCATION("DSW2:1")
- PORT_DIPUNKNOWN( 0x02, 0x02 ) PORT_DIPLOCATION("DSW2:2")
- PORT_DIPUNKNOWN( 0x04, 0x04 ) PORT_DIPLOCATION("DSW2:3")
- PORT_DIPUNKNOWN( 0x08, 0x08 ) PORT_DIPLOCATION("DSW2:4")
- PORT_DIPUNKNOWN( 0x10, 0x10 ) PORT_DIPLOCATION("DSW2:5")
- PORT_DIPUNKNOWN( 0x20, 0x20 ) PORT_DIPLOCATION("DSW2:6")
- PORT_DIPUNKNOWN( 0x40, 0x40 ) PORT_DIPLOCATION("DSW2:7")
- PORT_DIPUNKNOWN( 0x80, 0x80 ) PORT_DIPLOCATION("DSW2:8")
+ PORT_DIPUNKNOWN( 0x01, 0x01 ) PORT_DIPLOCATION("SW2:1")
+ PORT_DIPUNKNOWN( 0x02, 0x02 ) PORT_DIPLOCATION("SW2:2")
+ PORT_DIPUNKNOWN( 0x04, 0x04 ) PORT_DIPLOCATION("SW2:3")
+ PORT_DIPUNKNOWN( 0x08, 0x08 ) PORT_DIPLOCATION("SW2:4")
+ PORT_DIPUNKNOWN( 0x10, 0x10 ) PORT_DIPLOCATION("SW2:5")
+ PORT_DIPUNKNOWN( 0x20, 0x20 ) PORT_DIPLOCATION("SW2:6")
+ PORT_DIPUNKNOWN( 0x40, 0x40 ) PORT_DIPLOCATION("SW2:7")
+ PORT_DIPUNKNOWN( 0x80, 0x80 ) PORT_DIPLOCATION("SW2:8")
PORT_START("DSW3") // only 2 out of 4 DIP banks phisically present
PORT_DIPNAME( 0xff, 0xff, DEF_STR( Unused ) )
@@ -5108,7 +5109,7 @@ GAME( 1995, dbc, lhb, lhb, lhb, igs011_state, i
GAME( 1995, ryukobou, lhb, lhb, lhb, igs011_state, init_ryukobou, ROT0, "IGS / Alta", "Mahjong Ryukobou (Japan, V030J)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, lhb2, 0, lhb2, lhb2, igs011_state, init_lhb2, ROT0, "IGS", "Lung Fu Bong II (Hong Kong, V185H)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, tygn, lhb2, tygn, tygn, igs011_state, init_tygn, ROT0, "IGS", "Te Yi Gong Neng (China, V632C)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // ROM patches
-GAME( 1996, lhb3, lhb2, nkishusp, nkishusp, igs011_state, init_lhb3, ROT0, "IGS", "Long Hu Bang III: Cuo Pai Gaoshou (China, V242C)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // ROM patches
+GAME( 1996, lhb3, lhb2, nkishusp, lhb2, igs011_state, init_lhb3, ROT0, "IGS", "Long Hu Bang III: Cuo Pai Gaoshou (China, V242C)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // ROM patches
GAME( 1996, xymg, 0, xymg, xymg, igs011_state, init_xymg, ROT0, "IGS", "Xingyun Manguan (China, V651C, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, xymga, xymg, xymga, xymg, igs011_state, init_xymga, ROT0, "IGS", "Xingyun Manguan (China, V651C, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // different encryption and without IGS003
GAME( 1996, wlcc, xymg, wlcc, wlcc, igs011_state, init_wlcc, ROT0, "IGS", "Wanli Changcheng (China, V638C)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp
index ef1e018c4e7..45a2f96fba3 100644
--- a/src/mame/igs/igs_m027.cpp
+++ b/src/mame/igs/igs_m027.cpp
@@ -76,11 +76,15 @@
small 猜小
cancel 放弃
+ Known issues:
+ * ccly shows a black screen when it should show its bookeeping and input test modes
+ * klxyj102cn/klxyj104cn occasionally think the hopper is empty in "Joystick" mode - why?
+
TODO:
* Communication for games that support linked mode
* IGS025 protection for Chess Challenge II
* Emulate necessary peripherals for Extra Draw (might not belong here)
- * I/O for remaining games (klxyj102cn, klxyj104cn)
+ * I/O for remaining games
*/
#include "emu.h"
@@ -752,49 +756,60 @@ INPUT_PORTS_START( jking02 )
PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" )
INPUT_PORTS_END
-INPUT_PORTS_START( tct2p )
- // uses the kan/pon/chi/reach/ron buttons as the main controls in mahjong panel mode
+INPUT_PORTS_START( klxyj )
+ // Mahjong panel controls:
+ // Start Start Stop All Take Score
+ // Mahjong Bet Bet
+ // Mahjong A Stop 1 Double Up (twice winnings)
+ // Mahjong B Stop 2
+ // Mahjong C Stop 3 Double Up (winnings)
+ // Mahjong D Stop 4
+ // Mahjong E Double Up (half winnings)
+ // Mahjong K Show Odds Big
+ // Mahjong M Show Odds Small
+ // TODO: how do you show hidden credit/bets/winnings in mahjong panel mode?
IGS_MAHJONG_MATRIX_CONDITIONAL("DSW2", 0x01, 0x00)
PORT_START("PORTB")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
PORT_START("PORTC")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Show Odds") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Small / Half Gamble")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Bet / Double Up")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Big / Show Odds")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Start / Take Score")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
PORT_START("PLAYER")
- PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x1fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_state::kbd_ioport_r))
- PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
- PORT_BIT( 0x00f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x1c000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
- PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Show Credits") // hold to show credits/bets/wins when hidden
+ PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_state::kbd_ioport_r))
+ PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
+ PORT_BIT( 0x00f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x1c000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
PORT_START("PPIB")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w))
@@ -807,6 +822,118 @@ INPUT_PORTS_START( tct2p )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE
PORT_START("DSW1")
+ PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No.") PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机编号
+ SATELLITE_NO_SETTINGS
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" )
+ PORT_DIPNAME( 0x80, 0x80, "Link Mode" ) PORT_DIPLOCATION("SW1:8") // 连线模式
+ PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // 无
+ PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有
+
+ PORT_START("DSW2")
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作界面
+ PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // 揺杆
+ PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻雀键盘
+ PORT_DIPNAME( 0x02, 0x02, "Hide Credits") PORT_DIPLOCATION("SW2:2") // 隐分功能 (hides credits/bets/wins, game plays normally)
+ PORT_DIPSETTING( 0x02, DEF_STR(Off) ) // 无
+ PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有
+ PORT_DIPNAME( 0x04, 0x04, "Number Type" ) PORT_DIPLOCATION("SW2:3") // 数字型态
+ PORT_DIPSETTING( 0x04, "Numbers" ) // 数字
+ PORT_DIPSETTING( 0x00, "Circle Tiles" ) // 筒子
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:4") // 示范音乐
+ PORT_DIPSETTING( 0x08, DEF_STR(Off) ) // 无
+ PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有
+ PORT_DIPNAME( 0x10, 0x10, "Background Color Mode" ) PORT_DIPLOCATION("SW2:5") // 底色模式
+ PORT_DIPSETTING( 0x10, "Monochrome" ) // 黑白
+ PORT_DIPSETTING( 0x00, "Color" ) // 彩色
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" )
+
+ PORT_START("DSW3")
+ PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" )
+INPUT_PORTS_END
+
+INPUT_PORTS_START( tct2p )
+ // Mahjong panel controls:
+ // Start Start Stop All Take Score
+ // Mahjong Bet Bet
+ // Mahjong Kan Stop 1
+ // Mahjong Pon Stop 2
+ // Mahjong Chi Stop 3
+ // Mahjong Reach Stop 4
+ // Mahjong Ron Start Stop All Take Score
+ // Mahjong Double Up Double Up (winnings)
+ // Mahjong Big Big Double Up (twice winnings)
+ // Mahjong Small Small Double Up (half winnings)
+ // Mahjong A Double Up (twice winnings)
+ // Mahjong C Double Up (winnings)
+ // Mahjong E Double Up (half winnings)
+ // Mahjong K Show Odds Big
+ // Mahjong M Show Odds Small
+ // Mahjong N Deal
+ IGS_MAHJONG_MATRIX_CONDITIONAL("DSW2", 0x01, 0x00)
+
+ PORT_START("PORTB")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+
+ PORT_START("PORTC")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Small / Show Odds")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Bet / Double Up")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Big")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Start / Take Score")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+
+ PORT_START("PLAYER")
+ PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+
+ PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_state::kbd_ioport_r))
+ PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r))
+ PORT_BIT( 0x00f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x1c000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+
+ PORT_START("PPIB")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w))
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_state::counter_w<0>)) // payout/keyout
+
+ PORT_START("PPIC")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w))
+
+ PORT_START("CLEARMEM")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE
+
+ PORT_START("DSW1")
PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No.") PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机編号
SATELLITE_NO_SETTINGS
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
@@ -2530,6 +2657,7 @@ ROM_START( sdwx )
ROM_LOAD( "sp.u2", 0x00000, 0x80000, CRC(216b5418) SHA1(b7bc24ced0ccb5476c974420aa506c13b971fc9f) )
ROM_END
+// 快乐西游记 (Kuàilè Xīyóu Jì)
ROM_START( klxyj104cn )
ROM_REGION( 0x04000, "maincpu", 0 )
// Internal ROM of IGS027A ARM based MCU. Not dumped for this set, but it works.
@@ -2548,6 +2676,7 @@ ROM_START( klxyj104cn )
ROM_LOAD( "w4201.u2", 0x00000, 0x100000, CRC(464f11ab) SHA1(56e45bd31f667fc30387fcd4c940a94819b7ef0f) )
ROM_END
+// 快乐西游记 (Kuàilè Xīyóu Jì)
ROM_START( klxyj102cn ) // IGS PCB-0351-05-FM. 1 82C55, 3 banks of 8 DIP switches
ROM_REGION( 0x04000, "maincpu", 0 )
// Internal ROM of IGS027A ARM based MCU
@@ -3427,7 +3556,7 @@ ROM_START( mgcs3 )
ROM_END
/*
-Tarzan Chuǎng Tiānguān 2 Jiāqiáng Bǎn
+Tarzan Chuǎng Tiān Guān 2 Jiāqiáng Bǎn
泰山闯天关 2 加强版
IGS, 2003
@@ -3821,9 +3950,9 @@ GAME( 2004, lhzb4dhb, 0, lhzb4, lhzb4, igs_m027_stat
GAME( 1999, lthyp, 0, lthyp, lthyp, igs_m027_state, init_slqz3, ROT0, "IGS", "Long Teng Hu Yao Duizhan Jiaqiang Ban (S104CN)", MACHINE_NODEVICE_LAN )
GAME( 2000, zhongguo, 0, zhongguo, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D (V102C)", 0 )
GAMEL( 2001, jking02, 0, jking02, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NODEVICE_LAN, layout_jking02 ) // shows V212US in bookkeeping menu
-GAME( 2001, klxyj104cn, jking02, m027_1ppi<true>, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji (V104CN)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
-GAME( 2001, klxyj102cn, jking02, m027_1ppi<true>, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji (V102CN)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
-GAME( 2003, tct2p, 0, tct2p, tct2p, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", 0 )
+GAME( 2001, klxyj104cn, jking02, tct2p, klxyj, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuaile Xiyou Ji (V104CN)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
+GAME( 2001, klxyj102cn, jking02, tct2p, klxyj, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuaile Xiyou Ji (V102CN)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
+GAME( 2003, tct2p, 0, tct2p, tct2p, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tian Guan 2 Jiaqiang Ban (V306CN)", 0 )
GAME( 2003, mgzz, 0, mgzz, mgzz101cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", 0 )
GAME( 2003, mgzz100cn, mgzz, mgzz, mgzz100cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", 0 )
GAME( 2007, mgcs3, 0, lhzb4, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", 0 )
diff --git a/src/mame/misc/sshanghai.cpp b/src/mame/misc/sshanghai.cpp
index 9a5eb3e6b74..9a215d83e33 100644
--- a/src/mame/misc/sshanghai.cpp
+++ b/src/mame/misc/sshanghai.cpp
@@ -6,14 +6,37 @@
Super Shanghai 2000.
Super Shanghai 2000 - Wrestle Fiesta.
+ 3-reel 5-liner with an extra reel, plus a front game to hide the slots game.
+
+ Rare stealth video slots machine platform based on a Z80 CPU and a AY-3-8910 for sound.
+ 5 DIP switches banks.
+
Driver by Roberto Fresca & Grull Osgo.
- 3-reel 5-liner with an extra reel.
- Rare video slots machine platform based on a Z80 CPU and a AY-3-8910 for sound.
- 5 DIP switchs banks.
+*********************************************************************************************
+
+ Notes:
+
+ This platform hosts various slot games featuring different themes,
+ including classic fruit symbols (7s, bells, plums, oranges, grapes, etc.),
+ Easter-themed graphics (eggs, rabbits), and fish-themed designs.
- Unknown manufacturer.
+ To comply with local gambling restrictions, these games are concealed behind
+ a front-game interface. The system initially boots into a Pairs-style front-game.
+ Hidden input sequences allow switching between the slots game and the front-game.
+ Some machines further protect this mechanism with a 4-digit password, which can
+ be entered using the joystick or directional buttons and confirmed with the action button.
+
+ The platform support games with three operational modes:
+
+ * Pairs Mode (front-game only)
+ * Stealth Mode (hides the slots game)
+ * Direct Slots Mode (boots directly into the slots game)
+
+
+ If a set request password, use Right, Left, Up, Down, to change the code digits in order.
+ Action button to validate and switch to slots mode.
********************************************************************************************/
@@ -246,10 +269,10 @@ static INPUT_PORTS_START( ssh2000 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Clear/Reset")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(KEYCODE_Z) PORT_NAME("Fire 1")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(KEYCODE_Z) PORT_NAME("Action")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_0) PORT_NAME("Port Test")
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(KEYCODE_X) PORT_NAME("Fire 2")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_CODE(KEYCODE_C) PORT_NAME("Fire 3")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(KEYCODE_X) PORT_NAME("Switch to Slots (gambling game)")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_CODE(KEYCODE_C) PORT_NAME("Switch to Pairs (front Game)")
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
@@ -258,108 +281,109 @@ static INPUT_PORTS_START( ssh2000 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("Test 2")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_NAME("Coin A")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_NAME("Coin B")
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start (Automatic)")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start (Automatic Mode)")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Bet / Stop / Up")
PORT_START("DSWA")
- PORT_DIPNAME( 0x03, 0x00, "Percentage" ) PORT_DIPLOCATION("DSWA:8,7")
+ PORT_DIPNAME( 0x03, 0x00, "Percentage" ) PORT_DIPLOCATION("DSWA:8,7")
PORT_DIPSETTING( 0x00, "80%" )
PORT_DIPSETTING( 0x01, "75%" )
PORT_DIPSETTING( 0x02, "70%" )
PORT_DIPSETTING( 0x03, "65%" )
- PORT_DIPNAME( 0x04, 0x04, "Sprites" ) PORT_DIPLOCATION("DSWA:6")
+ PORT_DIPNAME( 0x04, 0x04, "Sprites" ) PORT_DIPLOCATION("DSWA:6")
PORT_DIPSETTING( 0x04, "Fruits")
PORT_DIPSETTING( 0x00, "Tiles")
- PORT_DIPNAME( 0x08, 0x00, "Game Name" ) PORT_DIPLOCATION("DSWA:5")
+ PORT_DIPNAME( 0x08, 0x00, "Game Name" ) PORT_DIPLOCATION("DSWA:5")
PORT_DIPSETTING( 0x08, "NAME 2")
PORT_DIPSETTING( 0x00, "NAME 1")
- PORT_DIPNAME( 0x10, 0x00, "Extra Take") PORT_DIPLOCATION("DSWA:4")
+ PORT_DIPNAME( 0x10, 0x00, "Extra Take") PORT_DIPLOCATION("DSWA:4")
PORT_DIPSETTING( 0x10, "OFF: NO" )
PORT_DIPSETTING( 0x00, "ON: YES" )
- PORT_DIPNAME( 0x20, 0x00, "Demo Sound" ) PORT_DIPLOCATION("DSWA:3")
+ PORT_DIPNAME( 0x20, 0x00, "Demo Sound" ) PORT_DIPLOCATION("DSWA:3")
PORT_DIPSETTING( 0x20, "OFF: NO" )
PORT_DIPSETTING( 0x00, "ON: YES" )
- PORT_DIPNAME( 0x40, 0x00, "Max. BET" ) PORT_DIPLOCATION("DSWA:2")
+ PORT_DIPNAME( 0x40, 0x00, "Max. BET" ) PORT_DIPLOCATION("DSWA:2")
PORT_DIPSETTING( 0x40, "OFF: 9" )
PORT_DIPSETTING( 0x00, "ON: 5" )
- PORT_DIPNAME( 0x80, 0x00, "Demostration") PORT_DIPLOCATION("DSWA:1")
+ PORT_DIPNAME( 0x80, 0x00, "Demostration") PORT_DIPLOCATION("DSWA:1")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSWB")
- PORT_DIPNAME( 0x0f, 0x0f, "Coinage A") PORT_DIPLOCATION("DSWB:8,7,6,5")
+ PORT_DIPNAME( 0x0f, 0x00, "Coinage A") PORT_DIPLOCATION("DSWB:8,7,6,5")
PORT_DIPSETTING( 0x00, "1" )
- PORT_DIPSETTING( 0x1, "2" )
- PORT_DIPSETTING( 0x2, "5" )
- PORT_DIPSETTING( 0x3, "10" )
- PORT_DIPSETTING( 0x4, "20" )
- PORT_DIPSETTING( 0x5, "50" )
- PORT_DIPSETTING( 0x6, "100" )
- PORT_DIPSETTING( 0x7, "500" )
- PORT_DIPSETTING( 0x8, "1000" )
- PORT_DIPSETTING( 0x9, "4" )
- PORT_DIPSETTING( 0xa, "8" )
- PORT_DIPSETTING( 0xb, "20" )
- PORT_DIPSETTING( 0xc, "40" )
- PORT_DIPSETTING( 0xd, "200" )
- PORT_DIPSETTING( 0xe, "400" )
- PORT_DIPSETTING( 0xf, "10" )
- PORT_DIPNAME( 0xf0, 0xf0, "Coinage B") PORT_DIPLOCATION("DSWB:4,3,2,1")
+ PORT_DIPSETTING( 0x01, "2" )
+ PORT_DIPSETTING( 0x09, "4" )
+ PORT_DIPSETTING( 0x02, "5" )
+ PORT_DIPSETTING( 0x0a, "8" )
+ PORT_DIPSETTING( 0x03, "10" )
+ PORT_DIPSETTING( 0x0f, "10" )
+ PORT_DIPSETTING( 0x04, "20" )
+ PORT_DIPSETTING( 0x0b, "20" )
+ PORT_DIPSETTING( 0x0c, "40" )
+ PORT_DIPSETTING( 0x05, "50" )
+ PORT_DIPSETTING( 0x06, "100" )
+ PORT_DIPSETTING( 0x0d, "200" )
+ PORT_DIPSETTING( 0x0e, "400" )
+ PORT_DIPSETTING( 0x07, "500" )
+ PORT_DIPSETTING( 0x08, "1000" )
+ PORT_DIPNAME( 0xf0, 0x00, "Coinage B") PORT_DIPLOCATION("DSWB:4,3,2,1")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x10, "2" )
+ PORT_DIPSETTING( 0x90, "4" )
PORT_DIPSETTING( 0x20, "5" )
+ PORT_DIPSETTING( 0xa0, "8" )
PORT_DIPSETTING( 0x30, "10" )
+ PORT_DIPSETTING( 0xf0, "10" )
PORT_DIPSETTING( 0x40, "20" )
- PORT_DIPSETTING( 0x50, "50" )
- PORT_DIPSETTING( 0x60, "100" )
- PORT_DIPSETTING( 0x70, "500" )
- PORT_DIPSETTING( 0x80, "1000" )
- PORT_DIPSETTING( 0x90, "4" )
- PORT_DIPSETTING( 0xa0, "8" )
PORT_DIPSETTING( 0xb0, "20" )
PORT_DIPSETTING( 0xc0, "40" )
+ PORT_DIPSETTING( 0x50, "50" )
+ PORT_DIPSETTING( 0x60, "100" )
PORT_DIPSETTING( 0xd0, "200" )
PORT_DIPSETTING( 0xe0, "400" )
- PORT_DIPSETTING( 0xf0, "10" )
+ PORT_DIPSETTING( 0x70, "500" )
+ PORT_DIPSETTING( 0x80, "1000" )
PORT_START("DSWC")
- PORT_DIPNAME( 0x01, 0x01, "Found") PORT_DIPLOCATION("DSWC:8")
+ PORT_DIPNAME( 0x01, 0x00, "Found") PORT_DIPLOCATION("DSWC:8")
PORT_DIPSETTING( 0x01, "Auto" )
PORT_DIPSETTING( 0x00, "Hand" )
- PORT_DIPNAME( 0x02, 0x02, "Found Pay" ) PORT_DIPLOCATION("DSWC:7")
+ PORT_DIPNAME( 0x02, 0x00, "Found Pay" ) PORT_DIPLOCATION("DSWC:7")
PORT_DIPSETTING( 0x02, "By One" )
PORT_DIPSETTING( 0x00, "All" )
- PORT_DIPNAME( 0x04, 0x04, "Papas Pay" ) PORT_DIPLOCATION("DSWC:6")
+ PORT_DIPNAME( 0x04, 0x00, "Papas Pay" ) PORT_DIPLOCATION("DSWC:6")
PORT_DIPSETTING( 0x04, "By One" )
PORT_DIPSETTING( 0x00, "All" )
- PORT_DIPNAME( 0x08, 0x08, "Flip Type" ) PORT_DIPLOCATION("DSWC:5")
+ PORT_DIPNAME( 0x08, 0x00, "Flip Type" ) PORT_DIPLOCATION("DSWC:5")
PORT_DIPSETTING( 0x08, "on Tape" )
PORT_DIPSETTING( 0x00, "on Kare" )
- PORT_DIPNAME( 0xf0, 0xf0, "Coinage C") PORT_DIPLOCATION("DSWC:4,3,2,1")
+ PORT_DIPNAME( 0xf0, 0x00, "Coinage C") PORT_DIPLOCATION("DSWC:4,3,2,1")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x10, "2" )
+ PORT_DIPSETTING( 0x90, "4" )
PORT_DIPSETTING( 0x20, "5" )
+ PORT_DIPSETTING( 0xa0, "8" )
PORT_DIPSETTING( 0x30, "10" )
+ PORT_DIPSETTING( 0xf0, "10" )
PORT_DIPSETTING( 0x40, "20" )
- PORT_DIPSETTING( 0x50, "50" )
- PORT_DIPSETTING( 0x60, "100" )
- PORT_DIPSETTING( 0x70, "500" )
- PORT_DIPSETTING( 0x80, "1000" )
- PORT_DIPSETTING( 0x90, "4" )
- PORT_DIPSETTING( 0xa0, "8" )
PORT_DIPSETTING( 0xb0, "20" )
PORT_DIPSETTING( 0xc0, "40" )
+ PORT_DIPSETTING( 0x50, "50" )
+ PORT_DIPSETTING( 0x60, "100" )
PORT_DIPSETTING( 0xd0, "200" )
PORT_DIPSETTING( 0xe0, "400" )
- PORT_DIPSETTING( 0xf0, "10" )
+ PORT_DIPSETTING( 0x70, "500" )
+ PORT_DIPSETTING( 0x80, "1000" )
PORT_START("DSWD")
- PORT_DIPNAME( 0x0f, 0x0f, "Credit Limit") PORT_DIPLOCATION("DSWD:8,7,6,5")
+ PORT_DIPNAME( 0x0f, 0x00, "Credit Limit") PORT_DIPLOCATION("DSWD:8,7,6,5")
PORT_DIPSETTING( 0x00, " 5000" )
PORT_DIPSETTING( 0x01, " 7500" )
PORT_DIPSETTING( 0x02, "10000" )
PORT_DIPSETTING( 0x03, "15000" )
PORT_DIPSETTING( 0x04, "20000" )
+ PORT_DIPSETTING( 0x0f, "20000" )
PORT_DIPSETTING( 0x05, "25000" )
PORT_DIPSETTING( 0x06, "30000" )
PORT_DIPSETTING( 0x07, "35000" )
@@ -370,21 +394,20 @@ static INPUT_PORTS_START( ssh2000 )
PORT_DIPSETTING( 0x0c, "70000" )
PORT_DIPSETTING( 0x0d, "80000" )
PORT_DIPSETTING( 0x0e, "90000" )
- PORT_DIPSETTING( 0x0f, "20000" )
- PORT_DIPNAME( 0x10, 0x10, "Swap Code" ) PORT_DIPLOCATION("DSWD:4")
+ PORT_DIPNAME( 0x10, 0x00, "Swap Code" ) PORT_DIPLOCATION("DSWD:4")
PORT_DIPSETTING( 0x10, "Code 2" )
PORT_DIPSETTING( 0x00, "Code 1" )
- PORT_DIPNAME( 0x20, 0x20, "Return In" ) PORT_DIPLOCATION("DSWD:3")
+ PORT_DIPNAME( 0x20, 0x00, "Return In" ) PORT_DIPLOCATION("DSWD:3")
PORT_DIPSETTING( 0x20, "Main" )
PORT_DIPSETTING( 0x00, "Amusement" )
- PORT_DIPNAME( 0x40, 0x40, "Must be Off" ) PORT_DIPLOCATION("DSWD:2")
+ PORT_DIPNAME( 0x40, 0x00, "Must be Off" ) PORT_DIPLOCATION("DSWD:2")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPNAME( 0x80, 0x80, "Amusement" ) PORT_DIPLOCATION("DSWD:1")
+ PORT_DIPNAME( 0x80, 0x00, "Amusement" ) PORT_DIPLOCATION("DSWD:1")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSWE")
- PORT_DIPNAME( 0x0f, 0x0f, "CoinIn Limit") PORT_DIPLOCATION("DSWE:8,7,6,5")
+ PORT_DIPNAME( 0x0f, 0x00, "CoinIn Limit") PORT_DIPLOCATION("DSWE:8,7,6,5")
PORT_DIPSETTING( 0x00, " 1000" )
PORT_DIPSETTING( 0x01, " 2000" )
PORT_DIPSETTING( 0x02, " 3000" )
@@ -401,12 +424,12 @@ static INPUT_PORTS_START( ssh2000 )
PORT_DIPSETTING( 0x0d, "40000" )
PORT_DIPSETTING( 0x0e, "50000" )
PORT_DIPSETTING( 0x0f, " 5000" )
- PORT_DIPNAME( 0x30, 0x30, "Preset BONUS" ) PORT_DIPLOCATION("DSWE:4,3")
+ PORT_DIPNAME( 0x30, 0x00, "Preset BONUS" ) PORT_DIPLOCATION("DSWE:4,3")
PORT_DIPSETTING( 0x00, "1000" )
PORT_DIPSETTING( 0x10, "2000" )
PORT_DIPSETTING( 0x20, "3000" )
PORT_DIPSETTING( 0x30, "4000" )
- PORT_DIPNAME( 0xc0, 0xc0, "Preset LEFT" ) PORT_DIPLOCATION("DSWE:2,1")
+ PORT_DIPNAME( 0xc0, 0x00, "Preset LEFT" ) PORT_DIPLOCATION("DSWE:2,1")
PORT_DIPSETTING( 0x00, "1000" )
PORT_DIPSETTING( 0x40, "2000" )
PORT_DIPSETTING( 0x80, "3000" )
@@ -466,6 +489,7 @@ void ssh2000_state::ssh2000(machine_config &config)
/*
Super Shanghai 2000 (set 1)
+ No code to enter the game.
type: SHG-47
version: 2000
@@ -510,6 +534,7 @@ ROM_END
/*
Super Shanghai 2000 (set 2)
+ Code 1234 to enter the game.
type: SHG-47
version: 2000
@@ -545,6 +570,7 @@ ROM_END
Super Shanghai 2000
Wrestle Fiesta.
Main program 30% bonus by Vegas (red board)
+ No code to enter the game.
type: SHG-47
version: 2000