Clean up and fix comments (nw)

This commit is contained in:
jbu 2014-12-16 02:09:22 +01:00
parent 339bafcc88
commit e92761316a
2 changed files with 241 additions and 237 deletions

View File

@ -116,7 +116,7 @@ offs_t pps4_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr
inline UINT8 pps4_device::ROP() inline UINT8 pps4_device::ROP()
{ {
const UINT8 op = m_direct->read_decrypted_byte(m_P & 0xFFF); const UINT8 op = m_direct->read_decrypted_byte(m_P & 0xFFF);
m_Ip = m_I; // save previous opcode m_Ip = m_I1; // save previous opcode
m_P = (m_P + 1) & 0xFFF; m_P = (m_P + 1) & 0xFFF;
m_icount -= 1; m_icount -= 1;
return op; return op;
@ -158,12 +158,12 @@ inline UINT8 pps4_device::ARG()
/** /**
* @brief pps4_device::iAD Add * @brief pps4_device::iAD Add
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1011 1 cyc AD * 0x0b 0000 1011 1 AD
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* C, A <- A + M * C, A <- A + M
* *
* The result of the binary addition of contents of accumulator * The result of the binary addition of contents of accumulator
@ -180,12 +180,12 @@ void pps4_device::iAD()
/** /**
* @brief pps4_device::iADC Add with carry-in * @brief pps4_device::iADC Add with carry-in
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1010 1 cyc ADC * 0x0a 0000 1010 1 ADC
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* C, A <- A + M + C * C, A <- A + M + C
* *
* Same as AD except the C flip-flop serves as a carry-in * Same as AD except the C flip-flop serves as a carry-in
@ -200,12 +200,12 @@ void pps4_device::iADC()
/** /**
* @brief pps4_device::iADSK Add and skip if carry-out * @brief pps4_device::iADSK Add and skip if carry-out
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1001 1 cyc ADSK * 0x09 0000 1001 1 ADSK
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* C, A <- A + M * C, A <- A + M
* Skip if C = 1 * Skip if C = 1
* *
@ -222,12 +222,12 @@ void pps4_device::iADSK()
/** /**
* @brief pps4_device::iADCSK Add with carry-in and skip if carry-out * @brief pps4_device::iADCSK Add with carry-in and skip if carry-out
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1000 1 cyc ADCSK * 0x08 0000 1000 1 ADCSK
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* C, A <- A + M + C * C, A <- A + M + C
* Skip if C = 1 * Skip if C = 1
* *
@ -244,12 +244,12 @@ void pps4_device::iADCSK()
/** /**
* @brief pps4_device::iADI Add immediate * @brief pps4_device::iADI Add immediate
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0110 xxxx 1 cyc ADI x * 0x6* 0110 xxxx 1 ADI x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- A + [I(4:1)] * A <- A + [I(4:1)]
* *
* The result of the binary addition of contents of * The result of the binary addition of contents of
@ -265,7 +265,7 @@ void pps4_device::iADCSK()
*/ */
void pps4_device::iADI() void pps4_device::iADI()
{ {
const UINT8 imm = ~m_I & 15; const UINT8 imm = ~m_I1 & 15;
m_A = m_A + imm; m_A = m_A + imm;
m_Skip = (m_A >> 4) & 1; m_Skip = (m_A >> 4) & 1;
m_A = m_A & 15; m_A = m_A & 15;
@ -273,12 +273,12 @@ void pps4_device::iADI()
/** /**
* @brief pps4_device::iDC Decimal correction * @brief pps4_device::iDC Decimal correction
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0110 0101 1 cyc DC * 0x65 0110 0101 1 DC
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- A + 1010 * A <- A + 1010
* *
* Decimal correction of accumulator. * Decimal correction of accumulator.
@ -293,12 +293,12 @@ void pps4_device::iDC()
/** /**
* @brief pps4_device::iAND Logical AND * @brief pps4_device::iAND Logical AND
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1101 1 cyc AND * 0x0d 0000 1101 1 AND
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- A & M * A <- A & M
* *
* The result of logical AND of accumulator and * The result of logical AND of accumulator and
@ -312,12 +312,12 @@ void pps4_device::iAND()
/** /**
* @brief pps4_device::iOR Logical OR * @brief pps4_device::iOR Logical OR
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1111 1 cyc OR * 0x0f 0000 1111 1 OR
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- A | M * A <- A | M
* *
* The result of logical OR of accumulator and * The result of logical OR of accumulator and
@ -331,12 +331,12 @@ void pps4_device::iOR()
/** /**
* @brief pps4_device::iEOR Logical exclusive-OR * @brief pps4_device::iEOR Logical exclusive-OR
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1100 1 cyc EOR * 0x0c 0000 1100 1 EOR
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- A ^ M * A <- A ^ M
* *
* The result of logical exclusive-OR of * The result of logical exclusive-OR of
@ -351,12 +351,12 @@ void pps4_device::iEOR()
/** /**
* @brief pps4_device::iCOMP Complement * @brief pps4_device::iCOMP Complement
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 1110 1 cyc COMP * 0x0e 0000 1110 1 COMP
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- ~A * A <- ~A
* *
* Each bit of the accumulator is logically * Each bit of the accumulator is logically
@ -369,12 +369,12 @@ void pps4_device::iCOMP()
/** /**
* @brief pps4_device::iSC Set carry flip-flop * @brief pps4_device::iSC Set carry flip-flop
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0000 1 cyc SC * 0x20 0010 0000 1 SC
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* C <- 1 * C <- 1
* *
* The C flip-flop is set to 1. * The C flip-flop is set to 1.
@ -386,12 +386,12 @@ void pps4_device::iSC()
/** /**
* @brief pps4_device::iRC Reset carry flip-flop * @brief pps4_device::iRC Reset carry flip-flop
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0100 1 cyc RC * 0x28 0010 0100 1 RC
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* C <- 0 * C <- 0
* *
* The C flip-flop is set to 0. * The C flip-flop is set to 0.
@ -403,12 +403,12 @@ void pps4_device::iRC()
/** /**
* @brief pps4_device::iSF1 Set flip-flop FF1 * @brief pps4_device::iSF1 Set flip-flop FF1
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0010 1 cyc SF1 * 0x22 0010 0010 1 SF1
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* FF1 <- 1 * FF1 <- 1
* *
* The Flip-flop FF1 is set to 1. * The Flip-flop FF1 is set to 1.
@ -420,12 +420,12 @@ void pps4_device::iSF1()
/** /**
* @brief pps4_device::iRF1 Reset flip-flop FF1 * @brief pps4_device::iRF1 Reset flip-flop FF1
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0110 1 cyc RF1 * 0x26 0010 0110 1 RF1
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* FF1 <- 0 * FF1 <- 0
* *
* The Flip-flop FF1 is set to 0. * The Flip-flop FF1 is set to 0.
@ -437,12 +437,12 @@ void pps4_device::iRF1()
/** /**
* @brief pps4_device::iSF2 Set flip-flop FF2 * @brief pps4_device::iSF2 Set flip-flop FF2
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0001 1 cyc SF2 * 0x21 0010 0001 1 SF2
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* FF2 <- 1 * FF2 <- 1
* *
* The Flip-flop FF2 is set to 1. * The Flip-flop FF2 is set to 1.
@ -454,12 +454,12 @@ void pps4_device::iSF2()
/** /**
* @brief pps4_device::iRF2 Reset flip-flop FF2 * @brief pps4_device::iRF2 Reset flip-flop FF2
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0101 1 cyc RF2 * 0x25 0010 0101 1 RF2
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* FF2 <- 0 * FF2 <- 0
* *
* The flip-flop FF2 is set to 0. * The flip-flop FF2 is set to 0.
@ -471,12 +471,12 @@ void pps4_device::iRF2()
/** /**
* @brief pps4_device::iLD Load accumulator from memory * @brief pps4_device::iLD Load accumulator from memory
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0011 0xxx 1 cyc LD x * 0x30+ 0011 0xxx 1 LD x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- M * A <- M
* B(7:5) <- B(7:5) ^ [I(3:1)] * B(7:5) <- B(7:5) ^ [I(3:1)]
* *
@ -490,19 +490,19 @@ void pps4_device::iRF2()
*/ */
void pps4_device::iLD() void pps4_device::iLD()
{ {
const UINT16 i3c = ~m_I & 7; const UINT16 i3c = ~m_I1 & 7;
m_A = M(); m_A = M();
m_B = m_B ^ (i3c << 4); m_B = m_B ^ (i3c << 4);
} }
/** /**
* @brief pps4_device::iEX Exchange accumulator and memory * @brief pps4_device::iEX Exchange accumulator and memory
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0011 1xxx 1 cyc EX x * 0x38+ 0011 1xxx 1 EX x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <-> M * A <-> M
* B(7:5) <- B(7:5) ^ [I(3:1)] * B(7:5) <- B(7:5) ^ [I(3:1)]
* *
@ -513,7 +513,7 @@ void pps4_device::iLD()
*/ */
void pps4_device::iEX() void pps4_device::iEX()
{ {
const UINT16 i3c = ~m_I & 7; const UINT16 i3c = ~m_I1 & 7;
const UINT8 mem = M(); const UINT8 mem = M();
W(m_A); W(m_A);
m_A = mem; m_A = mem;
@ -522,12 +522,12 @@ void pps4_device::iEX()
/** /**
* @brief pps4_device::iEXD Exchange accumulator and memory and decrement BL * @brief pps4_device::iEXD Exchange accumulator and memory and decrement BL
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 1xxx 1 cyc EXD x * 0x28+ 0010 1xxx 1 EXD x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <-> M * A <-> M
* B(7:5) <- B(7:5) ^ [I(3:1)] * B(7:5) <- B(7:5) ^ [I(3:1)]
* BL <- BL - 1 * BL <- BL - 1
@ -542,7 +542,7 @@ void pps4_device::iEX()
*/ */
void pps4_device::iEXD() void pps4_device::iEXD()
{ {
const UINT8 i3c = ~m_I & 7; const UINT8 i3c = ~m_I1 & 7;
const UINT8 mem = M(); const UINT8 mem = M();
UINT8 bl = m_B & 15; UINT8 bl = m_B & 15;
W(m_A); W(m_A);
@ -560,12 +560,12 @@ void pps4_device::iEXD()
/** /**
* @brief pps4_device::iLDI Load accumualtor immediate * @brief pps4_device::iLDI Load accumualtor immediate
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0111 xxxx 1 cyc LDI x * 0x7* 0111 xxxx 1 LDI x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- [I(4:1)] * A <- [I(4:1)]
* *
* The 4-bit contents, immediate field I(4:1), * The 4-bit contents, immediate field I(4:1),
@ -581,20 +581,20 @@ void pps4_device::iLDI()
{ {
// previous LDI instruction? // previous LDI instruction?
if (0x70 == (m_Ip & 0xf0)) { if (0x70 == (m_Ip & 0xf0)) {
LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I)); LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1));
return; return;
} }
m_A = ~m_I & 15; m_A = ~m_I1 & 15;
} }
/** /**
* @brief pps4_device::iLAX * @brief pps4_device::iLAX
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0010 1 cyc LAX * 0x12 0001 0010 1 LAX
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- X * A <- X
* *
* The 4-bit contents of the X register are * The 4-bit contents of the X register are
@ -607,12 +607,12 @@ void pps4_device::iLAX()
/** /**
* @brief pps4_device::iLXA * @brief pps4_device::iLXA
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1011 1 cyc LXA * 0x1b 0001 1011 1 LXA
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* X <- A * X <- A
* *
* The contents of the accumulator are * The contents of the accumulator are
@ -625,12 +625,12 @@ void pps4_device::iLXA()
/** /**
* @brief pps4_device::iLABL * @brief pps4_device::iLABL
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0001 1 cyc LABL * 0x11 0001 0001 1 LABL
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- BL * A <- BL
* *
* The contents of BL register are * The contents of BL register are
@ -643,12 +643,12 @@ void pps4_device::iLABL()
/** /**
* @brief pps4_device::iLBMX * @brief pps4_device::iLBMX
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0000 1 cyc LBMX * 0x10 0001 0000 1 LBMX
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* BM <- X * BM <- X
* *
* The contents of X register are * The contents of X register are
@ -661,12 +661,12 @@ void pps4_device::iLBMX()
/** /**
* @brief pps4_device::iLBUA * @brief pps4_device::iLBUA
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 0100 1 cyc LBUA * 0x08 0000 0100 1 LBUA
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* BU <- A * BU <- A
* A <- M * A <- M
* *
@ -682,12 +682,12 @@ void pps4_device::iLBUA()
/** /**
* @brief pps4_device::iXABL * @brief pps4_device::iXABL
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1001 1 cyc XABL * 0x19 0001 1001 1 XABL
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <-> BL * A <-> BL
* *
* The contents of accumulator and BL register * The contents of accumulator and BL register
@ -703,12 +703,12 @@ void pps4_device::iXABL()
/** /**
* @brief pps4_device::iXMBX * @brief pps4_device::iXMBX
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1000 1 cyc XMBX * 0x18 0001 1000 1 XMBX
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* X <-> BM * X <-> BM
* *
* The contents of accumulator and BL register * The contents of accumulator and BL register
@ -724,12 +724,12 @@ void pps4_device::iXBMX()
/** /**
* @brief pps4_device::iXAX * @brief pps4_device::iXAX
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1010 1 cyc XAX * 0x1a 0001 1010 1 XAX
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <-> X * A <-> X
* *
* The contents of accumulator and X register * The contents of accumulator and X register
@ -745,12 +745,12 @@ void pps4_device::iXAX()
/** /**
* @brief pps4_device::iXS * @brief pps4_device::iXS
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 0110 1 cyc XS * 0x06 0000 0110 1 XS
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* SA <-> SB * SA <-> SB
* *
* The 12-bit contents of SA and SB register * The 12-bit contents of SA and SB register
@ -766,12 +766,12 @@ void pps4_device::iXS()
/** /**
* @brief pps4_device::iCYS * @brief pps4_device::iCYS
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0110 1111 1 cyc CYS * 0x6f 0110 1111 1 CYS
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- SA(4:1) * A <- SA(4:1)
* SA(4:1) <- SA(8:5) * SA(4:1) <- SA(8:5)
* SA(8:5) <- SA(12:9) * SA(8:5) <- SA(12:9)
@ -793,12 +793,12 @@ void pps4_device::iCYS()
/** /**
* @brief pps4_device::iLB Load B indirect * @brief pps4_device::iLB Load B indirect
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 1100 xxxx 2 cyc LB x * 0xc* 1100 xxxx 2 LB x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* SB <- SA, SA <- P * SB <- SA, SA <- P
* P(12:5) <- 0000 1100 * P(12:5) <- 0000 1100
* P(4:1) <- I(4:1) * P(4:1) <- I(4:1)
@ -828,12 +828,12 @@ void pps4_device::iLB()
{ {
// previous LB or LBL instruction? // previous LB or LBL instruction?
if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) { if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) {
LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I)); LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1));
return; return;
} }
m_SB = m_SA; m_SB = m_SA;
m_SA = (m_P + 1) & 0xFFF; m_SA = (m_P + 1) & 0xFFF;
m_P = (3 << 6) | (m_I & 15); m_P = (3 << 6) | (m_I1 & 15);
m_B = ~ARG() & 255; m_B = ~ARG() & 255;
m_P = m_SA; m_P = m_SA;
// swap SA and SB // swap SA and SB
@ -844,12 +844,12 @@ void pps4_device::iLB()
/** /**
* @brief pps4_device::iLBL Load B long * @brief pps4_device::iLBL Load B long
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 0000 2 cyc LBL * 0x00 0000 0000 2 LBL
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* BU <- 0000 * BU <- 0000
* B(8:1) <- [I2(8:1)] * B(8:1) <- [I2(8:1)]
* *
@ -870,7 +870,7 @@ void pps4_device::iLBL()
m_I2 = ARG(); m_I2 = ARG();
// previous LB or LBL instruction? // previous LB or LBL instruction?
if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) { if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) {
LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I)); LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1));
return; return;
} }
m_B = ~m_I2 & 255; // Note: immediate is 1's complement m_B = ~m_I2 & 255; // Note: immediate is 1's complement
@ -878,12 +878,12 @@ void pps4_device::iLBL()
/** /**
* @brief pps4_device::INCB Increment B lower, skip if 0000 * @brief pps4_device::INCB Increment B lower, skip if 0000
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0111 1 cyc INCB * 0x17 0001 0111 1 INCB
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* BL <- BL + 1 * BL <- BL + 1
* Skip on BL = 0000 * Skip on BL = 0000
* *
@ -904,12 +904,12 @@ void pps4_device::iINCB()
/** /**
* @brief pps4_device::iDECB Decrement B lower, skip if 1111 * @brief pps4_device::iDECB Decrement B lower, skip if 1111
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1111 1 cyc DECB * 0x1f 0001 1111 1 DECB
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* BL <- BL - 1 * BL <- BL - 1
* Skip on BL = 1111 * Skip on BL = 1111
* *
@ -930,12 +930,12 @@ void pps4_device::iDECB()
/** /**
* @brief pps4_device::iT Transfer * @brief pps4_device::iT Transfer
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 10xx xxxx 1 cyc T *xx * 0x80+ 10xx xxxx 1 T *xx
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* P(6:1) <- I(6:1) * P(6:1) <- I(6:1)
* *
* An unconditional transfer to a ROM word on the current * An unconditional transfer to a ROM word on the current
@ -945,20 +945,20 @@ void pps4_device::iDECB()
*/ */
void pps4_device::iT() void pps4_device::iT()
{ {
const UINT16 p = (m_P & ~63) | (m_I & 63); const UINT16 p = (m_P & ~63) | (m_I1 & 63);
LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I, p)); LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I1, p));
m_P = p; m_P = p;
} }
/** /**
* @brief pps4_device::iTM Transfer and mark indirect * @brief pps4_device::iTM Transfer and mark indirect
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 11xx xxxx 2 cyc TM x * 0xc0+ 11xx xxxx 2 TM x
* yyyy yyyy from page 3 * yyyy yyyy from page 3
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* SB <- SA, SA <- P * SB <- SA, SA <- P
* P(12:7) <- 000011 * P(12:7) <- 000011
* P(6:1) <- I1(6:1) * P(6:1) <- I1(6:1)
@ -979,20 +979,20 @@ void pps4_device::iTM()
{ {
m_SB = m_SA; m_SB = m_SA;
m_SA = m_P; m_SA = m_P;
m_P = (3 << 6) | (m_I & 63); m_P = (3 << 6) | (m_I1 & 63);
m_I2 = ARG(); m_I2 = ARG();
m_P = (1 << 8) | m_I2; m_P = (1 << 8) | m_I2;
} }
/** /**
* @brief pps4_device::iTL Transfer long * @brief pps4_device::iTL Transfer long
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0101 xxxx 2 cyc TL xyy * 0x5x 0101 xxxx 2 TL xyy
* yyyy yyyy * yyyy yyyy
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* P(12:9) <- I1(4:1) * P(12:9) <- I1(4:1)
* P(8:1) <- I2(8:1) * P(8:1) <- I2(8:1)
* *
@ -1004,18 +1004,18 @@ void pps4_device::iTM()
void pps4_device::iTL() void pps4_device::iTL()
{ {
m_I2 = ARG(); m_I2 = ARG();
m_P = ((m_I & 15) << 8) | m_I2; m_P = ((m_I1 & 15) << 8) | m_I2;
} }
/** /**
* @brief pps4_device::iTML Transfer and mark long * @brief pps4_device::iTML Transfer and mark long
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0101 xxxx 2 cyc TML xyy * 0x0* 0000 xxxx 2 TML xyy
* yyyy yyyy * yyyy yyyy
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* SB <- SA, SA <- P * SB <- SA, SA <- P
* P(12:9) <- I1(4:1) * P(12:9) <- I1(4:1)
* P(8:1) <- I2(8:1) * P(8:1) <- I2(8:1)
@ -1031,17 +1031,17 @@ void pps4_device::iTML()
m_I2 = ARG(); m_I2 = ARG();
m_SB = m_SA; m_SB = m_SA;
m_SA = m_P; m_SA = m_P;
m_P = ((m_I & 15) << 8) | m_I2; m_P = ((m_I1 & 15) << 8) | m_I2;
} }
/** /**
* @brief pps4_device::iSKC Skip on carry flip-flop * @brief pps4_device::iSKC Skip on carry flip-flop
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0101 1 cyc SKC * 0x15 0001 0101 1 SKC
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* Skip if C = 1 * Skip if C = 1
* *
* The next ROM word will be ignored if C flip-flop is 1. * The next ROM word will be ignored if C flip-flop is 1.
@ -1053,12 +1053,12 @@ void pps4_device::iSKC()
/** /**
* @brief pps4_device::iSKC Skip on carry flip-flop * @brief pps4_device::iSKC Skip on carry flip-flop
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1110 1 cyc SKZ * 0x1e 0001 1110 1 SKZ
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* Skip if A = 0 * Skip if A = 0
* *
* The next ROM word will be ignored if C flip-flop is 1. * The next ROM word will be ignored if C flip-flop is 1.
@ -1070,12 +1070,12 @@ void pps4_device::iSKZ()
/** /**
* @brief pps4_device::iSKBI Skip if BL equal to immediate * @brief pps4_device::iSKBI Skip if BL equal to immediate
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0100 xxxx 1 cyc SKBI x * 0x4* 0100 xxxx 1 SKBI x
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* Skip if BL = I(4:1) * Skip if BL = I(4:1)
* *
* The next ROM word will be ignored if the least significant * The next ROM word will be ignored if the least significant
@ -1084,19 +1084,19 @@ void pps4_device::iSKZ()
*/ */
void pps4_device::iSKBI() void pps4_device::iSKBI()
{ {
const UINT8 i4 = m_I & 15; const UINT8 i4 = m_I1 & 15;
const UINT8 bl = m_B & 15; const UINT8 bl = m_B & 15;
m_Skip = bl == i4 ? 1 : 0; m_Skip = bl == i4 ? 1 : 0;
} }
/** /**
* @brief pps4_device::iSKF1 Skip if FF1 equals 1 * @brief pps4_device::iSKF1 Skip if FF1 equals 1
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0110 1 cyc SKF1 * 0x16 0001 0110 1 SKF1
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* Skip if FF1 = 1 * Skip if FF1 = 1
*/ */
void pps4_device::iSKF1() void pps4_device::iSKF1()
@ -1106,12 +1106,12 @@ void pps4_device::iSKF1()
/** /**
* @brief pps4_device::iSKF2 Skip if FF2 equals 1 * @brief pps4_device::iSKF2 Skip if FF2 equals 1
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 0100 1 cyc SKF2 * 0x14 0001 0100 1 SKF2
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* Skip if FF2 = 1 * Skip if FF2 = 1
*/ */
void pps4_device::iSKF2() void pps4_device::iSKF2()
@ -1121,12 +1121,12 @@ void pps4_device::iSKF2()
/** /**
* @brief pps4_device::iRTN Return * @brief pps4_device::iRTN Return
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 0101 1 cyc RTN * 0x05 0000 0101 1 RTN
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* P <- SA, SA <-> SB * P <- SA, SA <-> SB
* *
* This instruction executes a return from subroutine * This instruction executes a return from subroutine
@ -1143,13 +1143,13 @@ void pps4_device::iRTN()
} }
/** /**
* @brief pps4_device::iRTN Return * @brief pps4_device::iRTNSK Return and skip
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0000 0111 1 cyc RTNSK * 0x07 0000 0111 1 RTNSK
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* P <- SA, SA <-> SB * P <- SA, SA <-> SB
* P <- P + 1 * P <- P + 1
* *
@ -1167,14 +1167,14 @@ void pps4_device::iRTNSK()
} }
/** /**
* @brief pps4_device::IOL * @brief pps4_device::IOL Input / Output Long
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1100 2 cyc IOL yy * 0x1c 0001 1100 2 IOL yy
* yyyy yyyy * yyyy yyyy
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* ~A -> Data Bus * ~A -> Data Bus
* A <- ~Data Bus * A <- ~Data Bus
* I2 -> I/O device * I2 -> I/O device
@ -1189,6 +1189,9 @@ void pps4_device::iRTNSK()
* device is transferred to the accumulator inverted. * device is transferred to the accumulator inverted.
* *
* FIXME: Is BL on the I/D:8-5 lines during the I/O cycle? * FIXME: Is BL on the I/D:8-5 lines during the I/O cycle?
* The ROM, RAM, I/O chips A17xx suggest this, because they
* expect the value of BL to address one of the sixteen
* input/output lines.
*/ */
void pps4_device::iIOL() void pps4_device::iIOL()
{ {
@ -1203,12 +1206,12 @@ void pps4_device::iIOL()
/** /**
* @brief pps4_device::iDIA Discrete input group A * @brief pps4_device::iDIA Discrete input group A
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0111 1 cyc DIA * 0x27 0010 0111 1 DIA
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- DIA * A <- DIA
* *
* Data at the inputs to discrete group A is * Data at the inputs to discrete group A is
@ -1221,12 +1224,12 @@ void pps4_device::iDIA()
/** /**
* @brief pps4_device::iDIB Discrete input group B * @brief pps4_device::iDIB Discrete input group B
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 0011 1 cyc DIB * 0x23 0010 0011 1 DIB
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A <- DIB * A <- DIB
* *
* Data at the inputs to discrete group B is * Data at the inputs to discrete group B is
@ -1239,12 +1242,12 @@ void pps4_device::iDIB()
/** /**
* @brief pps4_device::iDOA Discrete output * @brief pps4_device::iDOA Discrete output
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0001 1101 1 cyc DOA * 0x1d 0001 1101 1 DOA
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* DOA <- A * DOA <- A
* *
* The contents of the accumulator are transferred * The contents of the accumulator are transferred
@ -1257,12 +1260,12 @@ void pps4_device::iDOA()
/** /**
* @brief pps4_device::iSAG Special address generation * @brief pps4_device::iSAG Special address generation
* OPCODE cycles mnemonic * HEX BINARY CYCLES MNEMONIC
* ----------------------------- * ----------------------------------
* 0010 1101 1 cyc SAG * 0x2d 0001 0011 1 SAG
* *
* Symbolic equation * Symbolic equation
* ----------------------------- * ----------------------------------
* A/B Bus (12:5) <- 0000 0000 * A/B Bus (12:5) <- 0000 0000
* A/B Bus (4:1) <- BL(4:1) * A/B Bus (4:1) <- BL(4:1)
* Contents of B remains unchanged * Contents of B remains unchanged
@ -1283,13 +1286,13 @@ void pps4_device::iSAG()
***************************************************************************/ ***************************************************************************/
void pps4_device::execute_one() void pps4_device::execute_one()
{ {
m_I = ROP(); m_I1 = ROP();
if (m_Skip) { if (m_Skip) {
m_Skip = 0; m_Skip = 0;
LOG(("%s: skip op:%02x\n", __FUNCTION__, m_I)); LOG(("%s: skip op:%02x\n", __FUNCTION__, m_I1));
return; return;
} }
switch (m_I) { switch (m_I1) {
case 0x00: case 0x00:
iLBL(); iLBL();
break; break;
@ -1528,22 +1531,22 @@ void pps4_device::device_start()
save_item(NAME(m_C)); save_item(NAME(m_C));
save_item(NAME(m_FF1)); save_item(NAME(m_FF1));
save_item(NAME(m_FF2)); save_item(NAME(m_FF2));
save_item(NAME(m_I)); save_item(NAME(m_I1));
save_item(NAME(m_I2)); save_item(NAME(m_I2));
save_item(NAME(m_Ip)); save_item(NAME(m_Ip));
state_add( PPS4_PC, "PC", m_P ).mask(0xFFF).formatstr("%03X"); state_add( PPS4_PC, "PC", m_P ).mask(0xFFF).formatstr("%03X");
state_add( PPS4_A, "A", m_A ).formatstr("%01X"); state_add( PPS4_A, "A", m_A ).formatstr("%01X");
state_add( PPS4_X, "X", m_X ).formatstr("%01X"); state_add( PPS4_X, "X", m_X ).formatstr("%01X");
state_add( PPS4_SA, "SA", m_SA ).formatstr("%03X"); state_add( PPS4_SA, "SA", m_SA ).formatstr("%03X");
state_add( PPS4_SB, "SB", m_SB ).formatstr("%03X"); state_add( PPS4_SB, "SB", m_SB ).formatstr("%03X");
state_add( PPS4_Skip, "Skip", m_Skip ).formatstr("%01X"); state_add( PPS4_Skip, "Skip", m_Skip ).formatstr("%01X");
state_add( PPS4_SAG, "SAG", m_SAG ).formatstr("%03X"); state_add( PPS4_SAG, "SAG", m_SAG ).formatstr("%03X");
state_add( PPS4_B, "B", m_B ).formatstr("%03X"); state_add( PPS4_B, "B", m_B ).formatstr("%03X");
state_add( PPS4_I2, "I", m_I ).formatstr("%02X").noshow(); state_add( PPS4_I1, "I1", m_I1 ).formatstr("%02X").noshow();
state_add( PPS4_I2, "I2", m_I2 ).formatstr("%02X").noshow(); state_add( PPS4_I2, "I2", m_I2 ).formatstr("%02X").noshow();
state_add( PPS4_Ip, "Ip", m_Ip ).formatstr("%02X").noshow(); state_add( PPS4_Ip, "Ip", m_Ip ).formatstr("%02X").noshow();
state_add( STATE_GENPC, "GENPC", m_P ).noshow(); state_add( STATE_GENPC, "GENPC", m_P ).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_C).formatstr("%3s").noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_C).formatstr("%3s").noshow();
m_icountptr = &m_icount; m_icountptr = &m_icount;
@ -1578,7 +1581,7 @@ void pps4_device::device_reset()
m_C = 0; // Carry flip-flop m_C = 0; // Carry flip-flop
m_FF1 = 0; // Flip-flop 1 m_FF1 = 0; // Flip-flop 1
m_FF2 = 0; // Flip-flop 2 m_FF2 = 0; // Flip-flop 2
m_I = 0; // Most recent instruction I(8:1) m_I1 = 0; // Most recent instruction I(8:1)
m_I2 = 0; // Most recent parameter I2(8:1) m_I2 = 0; // Most recent parameter I2(8:1)
m_Ip = 0; // Previous instruction I(8:1) m_Ip = 0; // Previous instruction I(8:1)
} }

View File

@ -17,6 +17,7 @@ enum
PPS4_B, PPS4_B,
PPS4_Skip, PPS4_Skip,
PPS4_SAG, PPS4_SAG,
PPS4_I1,
PPS4_I2, PPS4_I2,
PPS4_Ip, PPS4_Ip,
PPS4_GENPC = STATE_GENPC, PPS4_GENPC = STATE_GENPC,
@ -90,7 +91,7 @@ private:
UINT8 m_C; //!< Carry flip-flop UINT8 m_C; //!< Carry flip-flop
UINT8 m_FF1; //!< Flip-flop 1 UINT8 m_FF1; //!< Flip-flop 1
UINT8 m_FF2; //!< Flip-flop 2 UINT8 m_FF2; //!< Flip-flop 2
UINT8 m_I; //!< Most recent instruction I(8:1) UINT8 m_I1; //!< Most recent instruction I(8:1)
UINT8 m_I2; //!< Most recent parameter I2(8:1) UINT8 m_I2; //!< Most recent parameter I2(8:1)
UINT8 m_Ip; //!< Previous instruction I(8:1) UINT8 m_Ip; //!< Previous instruction I(8:1)