change cpu cores pcbase handling to be consistent with the majority of cpu cores, now that the debugger relies on it. (nw)

This commit is contained in:
smf- 2016-09-27 20:55:42 +01:00 committed by Vas Crabb
parent fd279ffffa
commit 00f6256e4a
16 changed files with 19 additions and 36 deletions

View File

@ -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 = -1;
m_ppc = m_pc;
m_loop = 0xffff;
m_loop_condition = 0;

View File

@ -125,6 +125,7 @@ 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

View File

@ -201,8 +201,6 @@ 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;
@ -335,6 +333,8 @@ 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,8 +348,6 @@ void hd61700_cpu_device::execute_run()
check_irqs();
m_ppc = m_curpc;
// instruction fetch
op = read_op();
@ -2739,6 +2737,7 @@ 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;
}

View File

@ -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)
{

View File

@ -797,6 +797,9 @@ 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));
@ -804,9 +807,6 @@ 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)

View File

@ -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();

View File

@ -863,9 +863,8 @@ 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_PC).noshow();
state_add( STATE_GENPCBASE, "CURPC", m_PREVPC).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_OPTION).formatstr("%13s").noshow();
state_add( STATE_GENPCBASE, "PREVPC", m_PREVPC).noshow();
m_icountptr = &m_icount;
}

View File

@ -937,9 +937,8 @@ 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_PC).noshow();
state_add( STATE_GENPCBASE, "CURPC", m_PREVPC).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_OPTION).formatstr("%13s").noshow();
state_add( STATE_GENPCBASE, "PREVPC", m_PREVPC).noshow();
m_icountptr = &m_icount;
}

View File

@ -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", m_ppc).formatstr("%5s").noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", REG_CR).callexport().formatstr("%5s").noshow();
// save state
save_item(NAME(m_pc));
@ -168,9 +168,8 @@ void score7_cpu_device::execute_run()
{
do
{
debugger_instruction_hook(this, m_pc);
m_ppc = m_pc;
debugger_instruction_hook(this, m_pc);
check_irq();

View File

@ -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)

View File

@ -742,8 +742,8 @@ void tms340x0_device::execute_run()
do
{
UINT16 op;
debugger_instruction_hook(this, m_pc);
m_ppc = m_pc;
debugger_instruction_hook(this, m_pc);
op = ROPCODE();
(this->*s_opcode_table[op >> 4])(op);
} while (m_icount > 0);

View File

@ -2346,7 +2346,6 @@ 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!! */

View File

@ -298,9 +298,6 @@ 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();

View File

@ -3126,9 +3126,6 @@ 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();
@ -3149,9 +3146,6 @@ 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();
@ -3236,9 +3230,6 @@ 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();

View File

@ -584,7 +584,6 @@ 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");
@ -783,6 +782,7 @@ 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,7 +793,6 @@ 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]];

View File

@ -11,7 +11,7 @@
enum
{
Z8000_PC=1,
Z8000_PPC, Z8000_NSPSEG, Z8000_NSPOFF, Z8000_FCW,
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,