summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2016-09-27 18:02:46 -0400
committer Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2016-09-27 18:02:46 -0400
commit7f1bb873d19bc81907e800b2ab6ed00e82a79f28 (patch)
tree3692225de7c985b5d34eaf2a9329322e1785c466
parent98eab769704caaae57caf7e42b3d63187e879ad2 (diff)
Revert "change cpu cores pcbase handling to be consistent with the majority of cpu cores, now that the debugger relies on it. (nw)"
This reverts commit 2a6cbb70c4a8b2cdd6dbf6488cee92bd60fcc55e.
-rw-r--r--src/devices/cpu/adsp2100/adsp2100.cpp2
-rw-r--r--src/devices/cpu/dsp32/dsp32ops.hxx1
-rw-r--r--src/devices/cpu/hd61700/hd61700.cpp7
-rw-r--r--src/devices/cpu/lc8670/lc8670.cpp2
-rw-r--r--src/devices/cpu/m68000/m68kcpu.cpp6
-rw-r--r--src/devices/cpu/mcs96/mcs96ops.lst4
-rw-r--r--src/devices/cpu/pic16c5x/pic16c5x.cpp3
-rw-r--r--src/devices/cpu/pic16c62x/pic16c62x.cpp3
-rw-r--r--src/devices/cpu/score/score.cpp5
-rw-r--r--src/devices/cpu/se3208/se3208.cpp2
-rw-r--r--src/devices/cpu/tms34010/tms34010.cpp2
-rw-r--r--src/devices/cpu/z180/z180.cpp1
-rw-r--r--src/devices/cpu/z180/z180op.hxx3
-rw-r--r--src/devices/cpu/z80/z80.cpp9
-rw-r--r--src/devices/cpu/z8000/z8000.cpp3
-rw-r--r--src/devices/cpu/z8000/z8000.h2
16 files changed, 36 insertions, 19 deletions
diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp
index 42627c3d5e2..a83614b04c3 100644
--- a/src/devices/cpu/adsp2100/adsp2100.cpp
+++ b/src/devices/cpu/adsp2100/adsp2100.cpp
@@ -606,7 +606,7 @@ void adsp21xx_device::device_reset()
// reset PC and loops
m_pc = (m_chip_type >= CHIP_TYPE_ADSP2101) ? 0 : 4;
- m_ppc = m_pc;
+ m_ppc = -1;
m_loop = 0xffff;
m_loop_condition = 0;
diff --git a/src/devices/cpu/dsp32/dsp32ops.hxx b/src/devices/cpu/dsp32/dsp32ops.hxx
index 696e4f14885..e89aa74fed7 100644
--- a/src/devices/cpu/dsp32/dsp32ops.hxx
+++ b/src/devices/cpu/dsp32/dsp32ops.hxx
@@ -125,7 +125,6 @@ inline void dsp32c_device::execute_one()
UINT32 op;
PROCESS_DEFERRED_MEMORY();
- m_ppc = PC;
debugger_instruction_hook(this, PC);
op = ROPCODE(PC);
m_icount -= 4; // 4 clocks per cycle
diff --git a/src/devices/cpu/hd61700/hd61700.cpp b/src/devices/cpu/hd61700/hd61700.cpp
index e48b83a576f..ce96d03c699 100644
--- a/src/devices/cpu/hd61700/hd61700.cpp
+++ b/src/devices/cpu/hd61700/hd61700.cpp
@@ -201,6 +201,8 @@ void hd61700_cpu_device::device_start()
void hd61700_cpu_device::device_reset()
{
+ m_ppc = 0x0000;
+ m_curpc = 0x0000;
set_pc(0x0000);
m_flags = FLAG_SW;
m_state = 0;
@@ -333,8 +335,6 @@ void hd61700_cpu_device::execute_run()
{
do
{
- m_ppc = m_curpc;
-
debugger_instruction_hook(this, m_curpc);
// verify that CPU is not in sleep
@@ -348,6 +348,8 @@ void hd61700_cpu_device::execute_run()
check_irqs();
+ m_ppc = m_curpc;
+
// instruction fetch
op = read_op();
@@ -2737,7 +2739,6 @@ inline void hd61700_cpu_device::set_pc(INT32 new_pc)
{
m_curpc = (m_curpc & 0x30000) | new_pc;
m_pc = new_pc & 0xffff;
- m_ppc = m_curpc;
m_fetch_addr = new_pc<<1;
}
diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp
index 9ea32374479..026cb1c8756 100644
--- a/src/devices/cpu/lc8670/lc8670.cpp
+++ b/src/devices/cpu/lc8670/lc8670.cpp
@@ -417,10 +417,10 @@ void lc8670_cpu_device::execute_run()
{
check_irqs();
- m_ppc = m_pc;
debugger_instruction_hook(this, m_pc);
int cycles;
+ m_ppc = m_pc;
if (REG_PCON & HALT_MODE)
{
diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp
index 573673f800b..053ab3d6976 100644
--- a/src/devices/cpu/m68000/m68kcpu.cpp
+++ b/src/devices/cpu/m68000/m68kcpu.cpp
@@ -797,9 +797,6 @@ inline void m68000_base_device::cpu_execute(void)
/* Set tracing accodring to T1. (T0 is done inside instruction) */
m68ki_trace_t1(this); /* auto-disable (see m68kcpu.h) */
- /* Record previous program counter */
- REG_PPC(this) = REG_PC(this);
-
/* Call external hook to peek at CPU */
debugger_instruction_hook(this, REG_PC(this));
@@ -807,6 +804,9 @@ inline void m68000_base_device::cpu_execute(void)
if (!instruction_hook.isnull())
instruction_hook(*program, REG_PC(this), 0xffffffff);
+ /* Record previous program counter */
+ REG_PPC(this) = REG_PC(this);
+
try
{
if (!pmmu_enabled)
diff --git a/src/devices/cpu/mcs96/mcs96ops.lst b/src/devices/cpu/mcs96/mcs96ops.lst
index 3c2516ae54a..372acb44218 100644
--- a/src/devices/cpu/mcs96/mcs96ops.lst
+++ b/src/devices/cpu/mcs96/mcs96ops.lst
@@ -15,9 +15,9 @@ fetch
standard_irq_callback(OP1);
check_irq();
}
- PPC = PC;
if(machine().debug_flags & DEBUG_FLAG_ENABLED)
debugger_instruction_hook(this, PC);
+ PPC = PC;
OP1 = read_pc();
if(OP1 == 0xfe) {
OP1 = read_pc();
@@ -26,9 +26,9 @@ fetch
inst_state = OP1;
fetch_noirq
- PPC = PC;
if(machine().debug_flags & DEBUG_FLAG_ENABLED)
debugger_instruction_hook(this, PC);
+ PPC = PC;
OP1 = read_pc();
if(OP1 == 0xfe) {
OP1 = read_pc();
diff --git a/src/devices/cpu/pic16c5x/pic16c5x.cpp b/src/devices/cpu/pic16c5x/pic16c5x.cpp
index 3a4193db730..2844fc04a58 100644
--- a/src/devices/cpu/pic16c5x/pic16c5x.cpp
+++ b/src/devices/cpu/pic16c5x/pic16c5x.cpp
@@ -863,8 +863,9 @@ void pic16c5x_device::device_start()
state_add( PIC16C5x_PSCL, "PSCL", m_debugger_temp).callimport().formatstr("%3s");
state_add( STATE_GENPC, "GENPC", m_PC).noshow();
- state_add( STATE_GENPCBASE, "CURPC", m_PREVPC).noshow();
+ state_add( STATE_GENPCBASE, "CURPC", m_PC).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_OPTION).formatstr("%13s").noshow();
+ state_add( STATE_GENPCBASE, "PREVPC", m_PREVPC).noshow();
m_icountptr = &m_icount;
}
diff --git a/src/devices/cpu/pic16c62x/pic16c62x.cpp b/src/devices/cpu/pic16c62x/pic16c62x.cpp
index baf29483185..1d990c23794 100644
--- a/src/devices/cpu/pic16c62x/pic16c62x.cpp
+++ b/src/devices/cpu/pic16c62x/pic16c62x.cpp
@@ -937,8 +937,9 @@ void pic16c62x_device::device_start()
state_add( PIC16C62x_PSCL, "PSCL", m_debugger_temp).callimport().formatstr("%3s");
state_add( STATE_GENPC, "GENPC", m_PC).noshow();
- state_add( STATE_GENPCBASE, "CURPC", m_PREVPC).noshow();
+ state_add( STATE_GENPCBASE, "CURPC", m_PC).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_OPTION).formatstr("%13s").noshow();
+ state_add( STATE_GENPCBASE, "PREVPC", m_PREVPC).noshow();
m_icountptr = &m_icount;
}
diff --git a/src/devices/cpu/score/score.cpp b/src/devices/cpu/score/score.cpp
index f9ae1e5d291..bb5f9cd5255 100644
--- a/src/devices/cpu/score/score.cpp
+++ b/src/devices/cpu/score/score.cpp
@@ -94,7 +94,7 @@ void score7_cpu_device::device_start()
state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%08X").noshow();
state_add(STATE_GENPCBASE, "CURPC", m_ppc).formatstr("%8X").noshow();
- state_add(STATE_GENFLAGS, "GENFLAGS", REG_CR).callexport().formatstr("%5s").noshow();
+ state_add(STATE_GENFLAGS, "GENFLAGS", m_ppc).formatstr("%5s").noshow();
// save state
save_item(NAME(m_pc));
@@ -168,9 +168,10 @@ void score7_cpu_device::execute_run()
{
do
{
- m_ppc = m_pc;
debugger_instruction_hook(this, m_pc);
+ m_ppc = m_pc;
+
check_irq();
UINT32 op = fetch();
diff --git a/src/devices/cpu/se3208/se3208.cpp b/src/devices/cpu/se3208/se3208.cpp
index 8889d1def61..ec8ddaf0649 100644
--- a/src/devices/cpu/se3208/se3208.cpp
+++ b/src/devices/cpu/se3208/se3208.cpp
@@ -1752,10 +1752,10 @@ void se3208_device::execute_run()
{
UINT16 Opcode=m_direct->read_word(m_PC, WORD_XOR_LE(0));
- m_PPC = m_PC;
debugger_instruction_hook(this, m_PC);
(this->*OpTable[Opcode])(Opcode);
+ m_PPC=m_PC;
m_PC+=2;
//Check interrupts
if(m_NMI==ASSERT_LINE)
diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp
index c2e67ccee7c..dd45a91a848 100644
--- a/src/devices/cpu/tms34010/tms34010.cpp
+++ b/src/devices/cpu/tms34010/tms34010.cpp
@@ -742,8 +742,8 @@ void tms340x0_device::execute_run()
do
{
UINT16 op;
- m_ppc = m_pc;
debugger_instruction_hook(this, m_pc);
+ m_ppc = m_pc;
op = ROPCODE();
(this->*s_opcode_table[op >> 4])(op);
} while (m_icount > 0);
diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp
index 26fee676f7e..c904ea33eec 100644
--- a/src/devices/cpu/z180/z180.cpp
+++ b/src/devices/cpu/z180/z180.cpp
@@ -2346,6 +2346,7 @@ void z180_device::execute_run()
if (m_nmi_pending)
{
LOG(("Z180 '%s' take NMI\n", tag()));
+ _PPC = -1; /* there isn't a valid previous program counter */
LEAVE_HALT(); /* Check if processor was halted */
/* disable DMA transfers!! */
diff --git a/src/devices/cpu/z180/z180op.hxx b/src/devices/cpu/z180/z180op.hxx
index 2479479344a..c00515ee9a5 100644
--- a/src/devices/cpu/z180/z180op.hxx
+++ b/src/devices/cpu/z180/z180op.hxx
@@ -298,6 +298,9 @@ int z180_device::take_interrupt(int irq)
int irq_vector;
int cycles = 0;
+ /* there isn't a valid previous program counter */
+ _PPC = -1;
+
/* Check if processor was halted */
LEAVE_HALT();
diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp
index ffbb57fd723..e0a3bbb8863 100644
--- a/src/devices/cpu/z80/z80.cpp
+++ b/src/devices/cpu/z80/z80.cpp
@@ -3126,6 +3126,9 @@ OP(op,ff) { rst(0x38);
void z80_device::take_nmi()
{
+ /* there isn't a valid previous program counter */
+ PRVPC = -1;
+
/* Check if processor was halted */
leave_halt();
@@ -3146,6 +3149,9 @@ void z80_device::take_interrupt()
{
int irq_vector;
+ /* there isn't a valid previous program counter */
+ PRVPC = -1;
+
/* Check if processor was halted */
leave_halt();
@@ -3230,6 +3236,9 @@ void z80_device::take_interrupt()
void nsc800_device::take_interrupt_nsc800()
{
+ /* there isn't a valid previous program counter */
+ PRVPC = -1;
+
/* Check if processor was halted */
leave_halt();
diff --git a/src/devices/cpu/z8000/z8000.cpp b/src/devices/cpu/z8000/z8000.cpp
index 2b8b874bceb..114faab7441 100644
--- a/src/devices/cpu/z8000/z8000.cpp
+++ b/src/devices/cpu/z8000/z8000.cpp
@@ -584,6 +584,7 @@ void z8002_device::clear_internal_state()
void z8002_device::register_debug_state()
{
+ state_add( Z8000_PPC, "prev PC", m_ppc ).formatstr("%08X");
state_add( Z8000_PC, "PC", m_pc ).formatstr("%08X");
state_add( Z8000_NSPOFF, "NSPOFF", m_nspoff ).formatstr("%04X");
state_add( Z8000_NSPSEG, "NSPSEG", m_nspseg ).formatstr("%04X");
@@ -782,7 +783,6 @@ void z8002_device::execute_run()
if (z8k_segm_mode == Z8K_SEGM_MODE_AUTO)
z8k_segm = (m_fcw & F_SEG_Z8001()) ? 1 : 0;
- m_ppc = m_pc;
debugger_instruction_hook(this, m_pc);
if (m_irq_req & Z8000_HALT)
@@ -793,6 +793,7 @@ void z8002_device::execute_run()
{
Z8000_exec *exec;
+ m_ppc = m_pc;
m_op[0] = RDOP();
m_op_valid = 1;
exec = &z8000_exec[m_op[0]];
diff --git a/src/devices/cpu/z8000/z8000.h b/src/devices/cpu/z8000/z8000.h
index 577b82a0935..2a0f00c3266 100644
--- a/src/devices/cpu/z8000/z8000.h
+++ b/src/devices/cpu/z8000/z8000.h
@@ -11,7 +11,7 @@
enum
{
Z8000_PC=1,
- Z8000_NSPSEG, Z8000_NSPOFF, Z8000_FCW,
+ Z8000_PPC, Z8000_NSPSEG, Z8000_NSPOFF, Z8000_FCW,
Z8000_PSAPSEG, Z8000_PSAPOFF, Z8000_REFRESH,
Z8000_IRQ_REQ, Z8000_IRQ_SRV, Z8000_IRQ_VEC,
Z8000_R0, Z8000_R1, Z8000_R2, Z8000_R3,