Fix disassembly window updating when you set pc/curpc on 68000 and z80. Remove masking from sh2 curpc to be consistent with old versions and the pc passed by the interpreter to the hook to be consistent with the drc. (nw)

This commit is contained in:
smf- 2016-10-08 18:39:00 +01:00
parent 48ff916037
commit 84f4180a43
7 changed files with 29 additions and 30 deletions

View File

@ -101,7 +101,7 @@ enum
enum
{
/* NOTE: M68K_SP fetches the current SP, be it USP, ISP, or MSP */
M68K_PC, M68K_SP, M68K_ISP, M68K_USP, M68K_MSP, M68K_SR, M68K_VBR,
M68K_PC = STATE_GENPC, M68K_SP = 1, M68K_ISP, M68K_USP, M68K_MSP, M68K_SR, M68K_VBR,
M68K_SFC, M68K_DFC, M68K_CACR, M68K_CAAR, M68K_PREF_ADDR, M68K_PREF_DATA,
M68K_D0, M68K_D1, M68K_D2, M68K_D3, M68K_D4, M68K_D5, M68K_D6, M68K_D7,
M68K_A0, M68K_A1, M68K_A2, M68K_A3, M68K_A4, M68K_A5, M68K_A6, M68K_A7,

View File

@ -1060,6 +1060,14 @@ void m68000_base_device::state_import(const device_state_entry &entry)
{
switch (entry.index())
{
case STATE_GENPC:
ppc = pc;
break;
case STATE_GENPCBASE:
pc = ppc;
break;
case M68K_SR:
case STATE_GENFLAGS:
m68ki_set_sr(this, iotemp);
@ -1687,9 +1695,8 @@ void m68000_base_device::define_state(void)
{
UINT32 addrmask = (cpu_type & MASK_24BIT_SPACE) ? 0xffffff : 0xffffffff;
state_add(M68K_PC, "PC", pc).mask(addrmask);
state_add(STATE_GENPC, "GENPC", pc).mask(addrmask).noshow();
state_add(STATE_GENPCBASE, "CURPC", ppc).mask(addrmask).noshow();
state_add(STATE_GENPC, "PC", pc).mask(addrmask).callimport();
state_add(STATE_GENPCBASE, "CURPC", ppc).mask(addrmask).callimport().noshow();
state_add(M68K_SP, "SP", dar[15]);
state_add(STATE_GENSP, "GENSP", dar[15]).noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", iotemp).noshow().callimport().callexport().formatstr("%16s");

View File

@ -2309,7 +2309,7 @@ void sh2_device::execute_run()
{
UINT32 opcode;
debugger_instruction_hook(this, m_sh2_state->pc & AM);
debugger_instruction_hook(this, m_sh2_state->pc);
opcode = m_program->read_word(m_sh2_state->pc & AM);
@ -2421,7 +2421,7 @@ void sh2_device::device_start()
save_item(NAME(m_wtcsr));
save_item(NAME(m_sh2_state->sleep_mode));
state_add( SH2_PC, "PC", m_debugger_temp).callimport().callexport().formatstr("%08X");
state_add( STATE_GENPC, "PC", m_sh2_state->pc).mask(AM).callimport();
state_add( SH2_SR, "SR", m_sh2_state->sr).callimport().formatstr("%08X");
state_add( SH2_PR, "PR", m_sh2_state->pr).formatstr("%08X");
state_add( SH2_GBR, "GBR", m_sh2_state->gbr).formatstr("%08X");
@ -2446,8 +2446,7 @@ void sh2_device::device_start()
state_add( SH2_R15, "R15", m_sh2_state->r[15]).formatstr("%08X");
state_add( SH2_EA, "EA", m_sh2_state->ea).formatstr("%08X");
state_add( STATE_GENPC, "GENPC", m_sh2_state->pc ).noshow();
state_add( STATE_GENPCBASE, "CURPC", m_sh2_state->pc ).noshow();
state_add( STATE_GENPCBASE, "CURPC", m_sh2_state->pc ).callimport().noshow();
state_add( STATE_GENSP, "GENSP", m_sh2_state->r[15] ).noshow();
state_add( STATE_GENFLAGS, "GENFLAGS", m_sh2_state->sr ).formatstr("%6s").noshow();
@ -2590,8 +2589,8 @@ void sh2_device::state_import(const device_state_entry &entry)
{
switch (entry.index())
{
case SH2_PC:
m_sh2_state->pc = m_debugger_temp;
case STATE_GENPC:
case STATE_GENPCBASE:
m_delay = 0;
break;
@ -2602,17 +2601,6 @@ void sh2_device::state_import(const device_state_entry &entry)
}
void sh2_device::state_export(const device_state_entry &entry)
{
switch (entry.index())
{
case SH2_PC:
m_debugger_temp = m_sh2_state->pc & AM;
break;
}
}
void sh2_device::execute_set_input(int irqline, int state)
{
if (irqline == INPUT_LINE_NMI)

View File

@ -42,7 +42,7 @@
enum
{
SH2_PC=1, SH2_SR, SH2_PR, SH2_GBR, SH2_VBR, SH2_MACH, SH2_MACL,
SH2_PC = STATE_GENPC, SH2_SR=1, SH2_PR, SH2_GBR, SH2_VBR, SH2_MACH, SH2_MACL,
SH2_R0, SH2_R1, SH2_R2, SH2_R3, SH2_R4, SH2_R5, SH2_R6, SH2_R7,
SH2_R8, SH2_R9, SH2_R10, SH2_R11, SH2_R12, SH2_R13, SH2_R14, SH2_R15, SH2_EA
};
@ -130,7 +130,6 @@ protected:
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry) override;
virtual void state_export(const device_state_entry &entry) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
// device_disasm_interface overrides

View File

@ -3415,9 +3415,8 @@ void z80_device::device_start()
F = ZF; /* Zero flag is set */
/* set up the state table */
state_add(Z80_PC, "PC", m_pc.w.l);
state_add(STATE_GENPC, "GENPC", m_pc.w.l).noshow();
state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w.l).noshow();
state_add(STATE_GENPC, "PC", m_pc.w.l).callimport();
state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w.l).callimport().noshow();
state_add(Z80_SP, "SP", SP);
state_add(STATE_GENSP, "GENSP", SP).noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", F).noshow().formatstr("%8s");
@ -3615,6 +3614,14 @@ void z80_device::state_import( const device_state_entry &entry )
{
switch (entry.index())
{
case STATE_GENPC:
m_prvpc = m_pc;
break;
case STATE_GENPCBASE:
m_pc = m_prvpc;
break;
case Z80_R:
m_r = m_rtemp & 0x7f;
m_r2 = m_rtemp & 0x80;

View File

@ -25,7 +25,7 @@ enum
enum
{
Z80_PC, Z80_SP,
Z80_PC = STATE_GENPC, Z80_SP = 1,
Z80_A, Z80_B, Z80_C, Z80_D, Z80_E, Z80_H, Z80_L,
Z80_AF, Z80_BC, Z80_DE, Z80_HL,
Z80_IX, Z80_IY, Z80_AF2, Z80_BC2, Z80_DE2, Z80_HL2,

View File

@ -76,9 +76,7 @@ device_state_entry::device_state_entry(int index, const char *symbol, void *data
format_from_mask();
// override well-known symbols
if (index == STATE_GENPC)
m_symbol.assign("GENPC");
else if (index == STATE_GENPCBASE)
if (index == STATE_GENPCBASE)
m_symbol.assign("CURPC");
else if (index == STATE_GENSP)
m_symbol.assign("CURSP");