diff options
Diffstat (limited to 'src')
65 files changed, 57 insertions, 299 deletions
diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp index 2f0b609ad5b..4ef6cc1676a 100644 --- a/src/devices/cpu/adsp2100/adsp2100.cpp +++ b/src/devices/cpu/adsp2100/adsp2100.cpp @@ -570,7 +570,6 @@ void adsp21xx_device::device_start() state_add(ADSP2100_MSTAT, "MSTAT", m_mstat).mask((m_chip_type == CHIP_TYPE_ADSP2100) ? 0x0f : 0x7f).callimport(); state_add(ADSP2100_PCSP, "PCSP", m_pc_sp).mask(0xff); - state_add(STATE_GENSP, "CURSP", m_pc_sp).mask(0xff).noshow(); state_add(ADSP2100_CNTRSP, "CNTRSP", m_cntr_sp).mask(0xf); state_add(ADSP2100_STATSP, "STATSP", m_stat_sp).mask(0xf); state_add(ADSP2100_LOOPSP, "LOOPSP", m_loop_sp).mask(0xf); diff --git a/src/devices/cpu/asap/asap.cpp b/src/devices/cpu/asap/asap.cpp index 9df9049d5ba..8edc3734b08 100644 --- a/src/devices/cpu/asap/asap.cpp +++ b/src/devices/cpu/asap/asap.cpp @@ -187,7 +187,6 @@ void asap_device::device_start() // register our state for the debugger state_add(STATE_GENPC, "GENPC", m_pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_ppc).noshow(); - state_add(STATE_GENSP, "GENSP", m_src2val[REGBASE + 31]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_flagsio).callimport().callexport().formatstr("%6s").noshow(); state_add(ASAP_PC, "PC", m_pc); state_add(ASAP_PS, "PS", m_flagsio).callimport().callexport(); diff --git a/src/devices/cpu/dsp32/dsp32.cpp b/src/devices/cpu/dsp32/dsp32.cpp index c7452161137..3519f941c69 100644 --- a/src/devices/cpu/dsp32/dsp32.cpp +++ b/src/devices/cpu/dsp32/dsp32.cpp @@ -195,7 +195,6 @@ void dsp32c_device::device_start() // register our state for the debugger state_add(STATE_GENPC, "GENPC", m_r[15]).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_ppc).noshow(); - state_add(STATE_GENSP, "GENSP", m_r[21]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_iotemp).callimport().callexport().formatstr("%6s").noshow(); state_add(DSP32_PC, "PC", m_r[15]).mask(0xffffff); for (int regnum = 0; regnum <= 14; regnum++) diff --git a/src/devices/cpu/dsp56156/dsp56156.cpp b/src/devices/cpu/dsp56156/dsp56156.cpp index 04952c0f7d3..85f0e4a5333 100644 --- a/src/devices/cpu/dsp56156/dsp56156.cpp +++ b/src/devices/cpu/dsp56156/dsp56156.cpp @@ -345,7 +345,6 @@ void dsp56156_device::device_start() state_add(STATE_GENPC, "GENPC", m_core.PCU.pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_core.ppc).noshow(); - state_add(STATE_GENSP, "GENSP", m_core.PCU.sp).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_core.PCU.sr).formatstr("%14s").noshow(); set_icountptr(m_core.icount); diff --git a/src/devices/cpu/dspp/dspp.cpp b/src/devices/cpu/dspp/dspp.cpp index 3479e461af5..cadb788dee0 100644 --- a/src/devices/cpu/dspp/dspp.cpp +++ b/src/devices/cpu/dspp/dspp.cpp @@ -169,7 +169,6 @@ void dspp_device::device_start() #if 0 state_add(STATE_GENFLAGS, "GENFLAGS", m_core->m_flags).callimport().callexport().formatstr("%6s").noshow(); state_add(STATE_GENPCBASE, "GENPCBASE", m_ppc).noshow(); - state_add(STATE_GENSP, "GENSP", m_src2val[REGBASE + 31]).noshow(); state_add(DSPP_PS, "PS", m_core->m_flagsio).callimport().callexport(); for (int regnum = 0; regnum < 32; regnum++) diff --git a/src/devices/cpu/es5510/es5510.cpp b/src/devices/cpu/es5510/es5510.cpp index cde4b4be4ee..61a25f915db 100644 --- a/src/devices/cpu/es5510/es5510.cpp +++ b/src/devices/cpu/es5510/es5510.cpp @@ -363,12 +363,12 @@ uint8_t es5510_device::host_r(address_space &space, offs_t offset) { // printf("%06x: DSP read offset %04x (data is %04x)\n",pc(),offset,dsp_ram[offset]); - // VFX hack + // VFX hack (FIXME: this is disgusting) if (core_stricmp(machine().system().name, "vfx") == 0) { if (pc == 0xc091f0) { - return space.device().state().state_int(M68K_D2); + return downcast<m68000_base_device &>(space.device()).state_int(M68K_D2); } } diff --git a/src/devices/cpu/g65816/g65816.cpp b/src/devices/cpu/g65816/g65816.cpp index 2a5c52c2d58..89ecc44167b 100644 --- a/src/devices/cpu/g65816/g65816.cpp +++ b/src/devices/cpu/g65816/g65816.cpp @@ -771,6 +771,7 @@ void g65816_device::g65816_set_pc(unsigned val) g65816_jumping(REGISTER_PB | REGISTER_PC); } +#ifdef UNUSED_FUNCTION /* Get the current Stack Pointer */ unsigned g65816_device::g65816_get_sp() { @@ -782,6 +783,7 @@ void g65816_device::g65816_set_sp(unsigned val) { REGISTER_S = FLAG_E ? MAKE_UINT_8(val) | 0x100 : MAKE_UINT_16(val); } +#endif /* Get a register */ unsigned g65816_device::g65816_get_reg(int regnum) @@ -922,7 +924,6 @@ void g65816_device::device_start() state_add( STATE_GENPC, "GENPC", m_debugger_temp).callimport().callexport().formatstr("%06X").noshow(); state_add( STATE_GENPCBASE, "CURPC", m_debugger_temp).callimport().callexport().formatstr("%06X").noshow(); - state_add( STATE_GENSP, "GENSP", m_debugger_temp).callimport().callexport().formatstr("%06X").noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).formatstr("%8s").noshow(); set_icountptr(m_ICount); @@ -936,9 +937,6 @@ void g65816_device::state_import(const device_state_entry &entry) case STATE_GENPCBASE: g65816_set_pc(m_debugger_temp); break; - case STATE_GENSP: - g65816_set_sp(m_debugger_temp); - break; case G65816_PC: case G65816_PB: case G65816_DB: @@ -983,9 +981,6 @@ void g65816_device::state_export(const device_state_entry &entry) case G65816_PC: m_debugger_temp = g65816_get_pc(); break; - case STATE_GENSP: - m_debugger_temp = g65816_get_sp(); - break; case G65816_PB: m_debugger_temp = m_pb>>16; break; diff --git a/src/devices/cpu/g65816/g65816.h b/src/devices/cpu/g65816/g65816.h index 5d88d3d5fde..3c6acf9f6d1 100644 --- a/src/devices/cpu/g65816/g65816.h +++ b/src/devices/cpu/g65816/g65816.h @@ -140,8 +140,10 @@ protected: int bus_5A22_cycle_burst(unsigned addr); unsigned g65816_get_pc(); void g65816_set_pc(unsigned val); +#ifdef UNUSED_FUNCTION unsigned g65816_get_sp(); void g65816_set_sp(unsigned val); +#endif public: unsigned g65816_get_reg(int regnum); void g65816_set_reg(int regnum, unsigned value); diff --git a/src/devices/cpu/g65816/g65816op.h b/src/devices/cpu/g65816/g65816op.h index d1ae11d84c6..6dc51066428 100644 --- a/src/devices/cpu/g65816/g65816op.h +++ b/src/devices/cpu/g65816/g65816op.h @@ -1867,7 +1867,6 @@ TABLE_FUNCTION(unsigned, get_reg, (int regnum)) case G65816_A: return REGISTER_B | REGISTER_A; case G65816_X: return REGISTER_X; case G65816_Y: return REGISTER_Y; - case STATE_GENSP: return REGISTER_S; case G65816_S: return REGISTER_S; case STATE_GENPC: return REGISTER_PC; case G65816_PC: return REGISTER_PC; @@ -1891,9 +1890,9 @@ TABLE_FUNCTION(void, set_reg, (int regnum, unsigned val)) { case STATE_GENPC: case G65816_PC: REGISTER_PC = MAKE_UINT_16(val); break; #if FLAG_SET_E - case STATE_GENSP: case G65816_S: REGISTER_S = MAKE_UINT_8(val) | 0x100; break; + case G65816_S: REGISTER_S = MAKE_UINT_8(val) | 0x100; break; #else - case STATE_GENSP: case G65816_S: REGISTER_S = MAKE_UINT_16(val); break; + case G65816_S: REGISTER_S = MAKE_UINT_16(val); break; #endif case G65816_P: g65816i_set_reg_p(val); break; #if FLAG_SET_M diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp index fae3b8474c7..5897672ca53 100644 --- a/src/devices/cpu/hphybrid/hphybrid.cpp +++ b/src/devices/cpu/hphybrid/hphybrid.cpp @@ -208,7 +208,6 @@ void hp_hybrid_cpu_device::device_start() state_add(STATE_GENPC, "GENPC", m_genpc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_genpc).noshow(); state_add(HPHYBRID_R, "R", m_reg_R); - state_add(STATE_GENSP, "GENSP", m_reg_R).noshow(); state_add(HPHYBRID_IV, "IV", m_reg_IV); state_add(HPHYBRID_PA, "PA", m_reg_PA[ 0 ]); state_add(HPHYBRID_W, "W", m_reg_W).noshow(); diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp index e8fdf6a12ea..ce92ca6b679 100644 --- a/src/devices/cpu/i386/i386.cpp +++ b/src/devices/cpu/i386/i386.cpp @@ -2123,7 +2123,6 @@ void i386_device::register_state_i386() state_add( STATE_GENPC, "GENPC", m_pc).noshow(); state_add( STATE_GENPCBASE, "CURPC", m_pc).noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).formatstr("%32s").noshow(); - state_add( STATE_GENSP, "GENSP", REG32(ESP)).noshow(); } void i386_device::register_state_i386_x87() diff --git a/src/devices/cpu/i8085/i8085.cpp b/src/devices/cpu/i8085/i8085.cpp index 7fddcb77af5..65d0896c401 100644 --- a/src/devices/cpu/i8085/i8085.cpp +++ b/src/devices/cpu/i8085/i8085.cpp @@ -320,7 +320,6 @@ void i8085a_cpu_device::device_start() state_add(STATE_GENPC, "GENPC", m_PC.w.l).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_PC.w.l).noshow(); state_add(I8085_SP, "SP", m_SP.w.l); - state_add(STATE_GENSP, "GENSP", m_SP.w.l).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_AF.b.l).noshow().formatstr("%8s"); state_add(I8085_A, "A", m_AF.b.h).noshow(); state_add(I8085_B, "B", m_BC.b.h).noshow(); diff --git a/src/devices/cpu/ks0164/ks0164.cpp b/src/devices/cpu/ks0164/ks0164.cpp index 8bb447993a4..b77cf5d5114 100644 --- a/src/devices/cpu/ks0164/ks0164.cpp +++ b/src/devices/cpu/ks0164/ks0164.cpp @@ -28,7 +28,6 @@ void ks0164_cpu_device::device_start() state_add(STATE_GENPC, "GENPC", m_r[R_PC]).callexport().noshow(); state_add(STATE_GENPCBASE, "CURPC", m_r[R_PC]).callexport().noshow(); - state_add(STATE_GENSP, "GENSP", m_r[R_SP]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_r[R_PSW]).callimport().formatstr("%8s").noshow(); state_add(KS0164_PC, "PC", m_r[R_PC]).callimport(); state_add(KS0164_PSW, "PSW", m_r[R_PSW]).callimport(); diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index f69e672ed31..cad49add447 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -57,7 +57,6 @@ void m6502_device::init() state_add(STATE_GENPC, "GENPC", XPC).callexport().noshow(); state_add(STATE_GENPCBASE, "CURPC", XPC).callexport().noshow(); - state_add(STATE_GENSP, "GENSP", SP).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", P).callimport().formatstr("%6s").noshow(); state_add(M6502_PC, "PC", NPC).callimport(); state_add(M6502_A, "A", A); diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index 6f47f9b9a4e..dd2938aba61 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -1681,7 +1681,6 @@ void m68000_base_device::define_state(void) state_add(M68K_SR, "SR", m_iotemp).callimport().callexport().mask(m_sr_mask); state_add(STATE_GENFLAGS, "GENFLAGS", m_iotemp).noshow().callimport().callexport().formatstr("%16s"); state_add(M68K_SP, "SP", m_dar[15]); - state_add(STATE_GENSP, "GENSP", m_dar[15]).noshow(); state_add(M68K_USP, "USP", m_iotemp).callimport().callexport(); if (m_cpu_type & MASK_020_OR_LATER) { diff --git a/src/devices/cpu/mb86233/mb86233.cpp b/src/devices/cpu/mb86233/mb86233.cpp index b3abdb85b44..6e624b1c295 100644 --- a/src/devices/cpu/mb86233/mb86233.cpp +++ b/src/devices/cpu/mb86233/mb86233.cpp @@ -96,7 +96,7 @@ void mb86233_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc); state_add(STATE_GENPCBASE, "PC", m_ppc).noshow(); - state_add(STATE_GENSP, "SP", m_sp); + state_add(REG_SP, "SP", m_sp); state_add(STATE_GENFLAGS, "ST", m_st); state_add(REG_A, "A", m_a); diff --git a/src/devices/cpu/mb86233/mb86233.h b/src/devices/cpu/mb86233/mb86233.h index 5e8c0b10d16..4b1915dc836 100644 --- a/src/devices/cpu/mb86233/mb86233.h +++ b/src/devices/cpu/mb86233/mb86233.h @@ -19,7 +19,8 @@ public: REG_R, REG_C0, REG_C1, REG_B0, REG_B1, REG_X0, REG_X1, REG_I0, REG_I1, REG_SFT, REG_VSM, REG_MASK, REG_M, - REG_PCS0, REG_PCS1, REG_PCS2, REG_PCS3 + REG_PCS0, REG_PCS1, REG_PCS2, REG_PCS3, + REG_SP }; enum st_flags { diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index 34d89693bf2..865da42c104 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -1148,7 +1148,7 @@ void mcs48_cpu_device::device_start() state_add(MCS48_PC, "PC", m_pc).mask(0xfff); state_add(STATE_GENPC, "GENPC", m_pc).mask(0xfff).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_prevpc).mask(0xfff).noshow(); - state_add(STATE_GENSP, "GENSP", m_psw).mask(0x7).noshow(); + state_add(MCS48_SP, "SP", m_psw).mask(0x7).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_psw).noshow().formatstr("%11s"); state_add(MCS48_A, "A", m_a); state_add(MCS48_TC, "TC", m_timer); diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h index fa73d33e5b6..df143df239c 100644 --- a/src/devices/cpu/mcs48/mcs48.h +++ b/src/devices/cpu/mcs48/mcs48.h @@ -24,6 +24,7 @@ enum { MCS48_PC, MCS48_PSW, + MCS48_SP, MCS48_A, MCS48_TC, MCS48_TPRE, diff --git a/src/devices/cpu/mcs96/mcs96.cpp b/src/devices/cpu/mcs96/mcs96.cpp index e1524462f13..a7a3f112c5d 100644 --- a/src/devices/cpu/mcs96/mcs96.cpp +++ b/src/devices/cpu/mcs96/mcs96.cpp @@ -38,7 +38,6 @@ void mcs96_device::device_start() state_add(STATE_GENPC, "GENPC", PC).noshow(); state_add(STATE_GENPCBASE, "CURPC", PPC).noshow(); - state_add(STATE_GENSP, "GENSP", register_file[0]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", PSW).formatstr("%16s").noshow(); state_add(MCS96_PC, "PC", PC); state_add(MCS96_PSW, "PSW", PSW); diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index f82ae82da50..b209baa6558 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -728,7 +728,6 @@ void mips3_device::device_start() state_add( MIPS3_LLADDR, "LLAddr", m_core->cpr[0][COP0_LLAddr]).formatstr("%08X"); state_add( STATE_GENPCBASE, "CURPC", m_core->pc).noshow(); - state_add( STATE_GENSP, "CURSP", m_core->r[31]).noshow(); state_add( STATE_GENFLAGS, "CURFLAGS", m_debugger_temp).formatstr("%1s").noshow(); set_icountptr(m_core->icount); diff --git a/src/devices/cpu/nec/nec.cpp b/src/devices/cpu/nec/nec.cpp index b46910bc4d9..052e6a6f348 100644 --- a/src/devices/cpu/nec/nec.cpp +++ b/src/devices/cpu/nec/nec.cpp @@ -544,7 +544,6 @@ void nec_common_device::device_start() state_add( STATE_GENPC, "GENPC", m_debugger_temp).callexport().noshow(); state_add( STATE_GENPCBASE, "CURPC", m_debugger_temp).callexport().noshow(); - state_add( STATE_GENSP, "GENSP", m_debugger_temp).callimport().callexport().noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).formatstr("%16s").noshow(); set_icountptr(m_icount); @@ -614,10 +613,6 @@ void nec_common_device::state_export(const device_state_entry &entry) m_debugger_temp = (Sreg(PS)<<4) + m_prev_ip; break; - case STATE_GENSP: - m_debugger_temp = (Sreg(SS)<<4) + Wreg(SP); - break; - case NEC_PSW: m_debugger_temp = CompressFlags(); break; diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index 8a44732d07d..f851717aaf2 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -670,7 +670,6 @@ void v25_common_device::device_start() state_add( STATE_GENPC, "GENPC", m_debugger_temp).callexport().noshow(); state_add( STATE_GENPCBASE, "CURPC", m_debugger_temp).callexport().noshow(); - state_add( STATE_GENSP, "GENSP", m_debugger_temp).callimport().callexport().noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).formatstr("%16s").noshow(); set_icountptr(m_icount); @@ -738,10 +737,6 @@ void v25_common_device::state_export(const device_state_entry &entry) case STATE_GENPCBASE: m_debugger_temp = (Sreg(PS)<<4) + m_prev_ip; break; - - case STATE_GENSP: - m_debugger_temp = (Sreg(SS)<<4) + Wreg(SP); - break; } } diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp index 1ff153ca1b6..342c6434a96 100644 --- a/src/devices/cpu/powerpc/ppccom.cpp +++ b/src/devices/cpu/powerpc/ppccom.cpp @@ -842,7 +842,6 @@ void ppc_device::device_start() state_add(STATE_GENPC, "GENPC", m_core->pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_core->pc).noshow(); - state_add(STATE_GENSP, "GENSP", m_core->r[31]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).noshow().formatstr("%1s"); set_icountptr(m_core->icount); diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp index 5d8cccff5af..5fac263418f 100644 --- a/src/devices/cpu/rsp/rsp.cpp +++ b/src/devices/cpu/rsp/rsp.cpp @@ -379,7 +379,6 @@ void rsp_device::device_start() state_add( STATE_GENPC, "GENPC", m_pc).noshow(); state_add( STATE_GENPCBASE, "CURPC", m_pc).noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_r[31]).formatstr("%1s").noshow(); - state_add( STATE_GENSP, "GENSP", m_r[31]).noshow(); set_icountptr(m_icount); } diff --git a/src/devices/cpu/sc61860/sc61860.cpp b/src/devices/cpu/sc61860/sc61860.cpp index bd99080a9b5..461e52c786e 100644 --- a/src/devices/cpu/sc61860/sc61860.cpp +++ b/src/devices/cpu/sc61860/sc61860.cpp @@ -170,7 +170,6 @@ void sc61860_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%04X").noshow(); state_add(STATE_GENPCBASE, "CURPC", m_oldpc).formatstr("%04X").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).formatstr("%2s").noshow(); - state_add(STATE_GENSP, "GENSP", m_r).mask(0x7f).formatstr("%02X").noshow(); set_icountptr(m_icount); } diff --git a/src/devices/cpu/se3208/se3208.cpp b/src/devices/cpu/se3208/se3208.cpp index 6e5a15bef2c..71235c9423d 100644 --- a/src/devices/cpu/se3208/se3208.cpp +++ b/src/devices/cpu/se3208/se3208.cpp @@ -1807,7 +1807,6 @@ void se3208_device::device_start() state_add(STATE_GENPC, "GENPC", m_PC).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_PPC).noshow(); - state_add(STATE_GENSP, "GENSP", m_SP).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_SR).formatstr("%10s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/sh/sh.cpp b/src/devices/cpu/sh/sh.cpp index 4779871d597..f7560ba28f2 100644 --- a/src/devices/cpu/sh/sh.cpp +++ b/src/devices/cpu/sh/sh.cpp @@ -77,7 +77,7 @@ void sh_common_execution::device_start() state_add(SH4_R15, "R15", m_sh2_state->r[15]).formatstr("%08X"); state_add(SH4_EA, "EA", m_sh2_state->ea).formatstr("%08X"); - state_add(STATE_GENSP, "GENSP", m_sh2_state->r[15]).noshow(); + state_add(SH4_SP, "SP", m_sh2_state->r[15]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_sh2_state->sr).formatstr("%20s").noshow(); set_icountptr(m_sh2_state->icount); diff --git a/src/devices/cpu/sh/sh.h b/src/devices/cpu/sh/sh.h index 6920d85fd3b..09a97128a56 100644 --- a/src/devices/cpu/sh/sh.h +++ b/src/devices/cpu/sh/sh.h @@ -94,7 +94,7 @@ enum { SH4_PC = 1, SH_SR, SH4_PR, SH4_GBR, SH4_VBR, SH4_DBR, SH4_MACH, SH4_MACL, SH4_R0, SH4_R1, SH4_R2, SH4_R3, SH4_R4, SH4_R5, SH4_R6, SH4_R7, - SH4_R8, SH4_R9, SH4_R10, SH4_R11, SH4_R12, SH4_R13, SH4_R14, SH4_R15, SH4_EA + SH4_R8, SH4_R9, SH4_R10, SH4_R11, SH4_R12, SH4_R13, SH4_R14, SH4_R15, SH4_EA, SH4_SP }; class sh_common_execution : public cpu_device diff --git a/src/devices/cpu/spc700/spc700.cpp b/src/devices/cpu/spc700/spc700.cpp index 7be3d1633df..e4d150310e7 100644 --- a/src/devices/cpu/spc700/spc700.cpp +++ b/src/devices/cpu/spc700/spc700.cpp @@ -1244,7 +1244,6 @@ void spc700_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%04X").noshow(); state_add(STATE_GENPCBASE, "CURPC", m_ppc).formatstr("%04X").noshow(); - state_add(STATE_GENSP, "GENSP", m_debugger_temp).mask(0x1ff).callexport().formatstr("%04X").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).formatstr("%8s").noshow(); set_icountptr(m_ICount); @@ -1296,10 +1295,6 @@ void spc700_device::state_export(const device_state_entry &entry) ((!FLAG_Z) << 1) | ((FLAG_C >> 8)&1)); break; - - case STATE_GENSP: - m_debugger_temp = m_s + STACK_PAGE; - break; } } diff --git a/src/devices/cpu/tlcs870/tlcs870.cpp b/src/devices/cpu/tlcs870/tlcs870.cpp index 2766804a50a..d35b3183a57 100644 --- a/src/devices/cpu/tlcs870/tlcs870.cpp +++ b/src/devices/cpu/tlcs870/tlcs870.cpp @@ -1235,7 +1235,7 @@ void tlcs870_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc.w.l).formatstr("%04X"); state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w.l).formatstr("%04X").noshow(); - state_add(STATE_GENSP, "GENSP", m_sp.w.l).formatstr("%04X"); + state_add(DEBUGGER_REG_SP, "SP", m_sp.w.l).formatstr("%04X"); state_add(STATE_GENFLAGS, "GENFLAGS", m_F).formatstr("%8s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/tlcs870/tlcs870.h b/src/devices/cpu/tlcs870/tlcs870.h index f6794127fdd..b6c3d73478d 100644 --- a/src/devices/cpu/tlcs870/tlcs870.h +++ b/src/devices/cpu/tlcs870/tlcs870.h @@ -127,7 +127,8 @@ private: DEBUGGER_REG_BC, DEBUGGER_REG_DE, DEBUGGER_REG_HL, - DEBUGGER_REG_RB + DEBUGGER_REG_RB, + DEBUGGER_REG_SP }; enum _conditions diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index bd02b9cc197..a8392f698b0 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -2973,7 +2973,6 @@ void tlcs90_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc.w.l).formatstr("%04X").noshow(); state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w.l).formatstr("%04X").noshow(); - state_add(STATE_GENSP, "GENSP", m_sp.w.l).formatstr("%04X").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", F ).formatstr("%8s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/tms32010/tms32010.cpp b/src/devices/cpu/tms32010/tms32010.cpp index 01c18fb4471..44c1c1af4f5 100644 --- a/src/devices/cpu/tms32010/tms32010.cpp +++ b/src/devices/cpu/tms32010/tms32010.cpp @@ -869,8 +869,6 @@ void tms32010_device::device_start() state_add(STATE_GENPC, "GENPC", m_PC).formatstr("%04X").noshow(); state_add(STATE_GENPCBASE, "CURPC", m_PREVPC).formatstr("%04X").noshow(); - /* This is actually not a stack pointer, but the stack contents */ - state_add(STATE_GENSP, "GENSP", m_STACK[3]).formatstr("%04X").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_STR).formatstr("%16s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/tms32025/tms32025.cpp b/src/devices/cpu/tms32025/tms32025.cpp index 11444c83b23..b629cdc97a5 100644 --- a/src/devices/cpu/tms32025/tms32025.cpp +++ b/src/devices/cpu/tms32025/tms32025.cpp @@ -1754,8 +1754,6 @@ void tms32025_device::device_start() state_add(STATE_GENPC, "GENPC", m_PC).formatstr("%04X").noshow(); state_add(STATE_GENPCBASE, "CURPC", m_PREVPC).formatstr("%04X").noshow(); - /* This is actually not a stack pointer, but the stack contents */ - state_add(STATE_GENSP, "GENSP", m_STACK[7]).formatstr("%04X").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_STR0).formatstr("%33s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp index 6eaf63b96ae..1e3c099425c 100644 --- a/src/devices/cpu/tms34010/tms34010.cpp +++ b/src/devices/cpu/tms34010/tms34010.cpp @@ -727,7 +727,6 @@ void tms340x0_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_ppc).noshow(); state_add(TMS34010_SP, "SP", m_regs[15].reg); - state_add(STATE_GENSP, "GENSP", m_regs[15].reg).noshow(); state_add(TMS34010_ST, "ST", m_st); state_add(STATE_GENFLAGS, "GENFLAGS", m_st).noshow().formatstr("%18s"); diff --git a/src/devices/cpu/tms7000/tms7000.cpp b/src/devices/cpu/tms7000/tms7000.cpp index ea7893f8cea..5f1cb0f1308 100644 --- a/src/devices/cpu/tms7000/tms7000.cpp +++ b/src/devices/cpu/tms7000/tms7000.cpp @@ -260,7 +260,6 @@ void tms7000_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).formatstr("%04X").noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc).formatstr("%04X").noshow(); - state_add(STATE_GENSP, "GENSP", m_sp).formatstr("%02X").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_sr).formatstr("%8s").noshow(); } diff --git a/src/devices/cpu/upd7810/upd7810.cpp b/src/devices/cpu/upd7810/upd7810.cpp index 1e212dfe24e..3ddbbb64612 100644 --- a/src/devices/cpu/upd7810/upd7810.cpp +++ b/src/devices/cpu/upd7810/upd7810.cpp @@ -1720,7 +1720,6 @@ void upd7810_device::device_start() state_add( STATE_GENPC, "GENPC", m_pc.w.l ).formatstr("%04X").noshow(); state_add( STATE_GENPCBASE, "CURPC", m_ppc.w.l ).formatstr("%04X").noshow(); - state_add( STATE_GENSP, "GENSP", m_sp.w.l ).formatstr("%04X").noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_psw ).formatstr("%17s").noshow(); } @@ -1751,9 +1750,7 @@ void upd78c05_device::device_start() state_add( STATE_GENPC, "GENPC", m_pc.w.l ).formatstr("%04X").noshow(); state_add( STATE_GENPCBASE, "CURPC", m_ppc.w.l ).formatstr("%04X").noshow(); - state_add( STATE_GENSP, "GENSP", m_sp.w.l ).formatstr("%04X").noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_psw ).formatstr("%17s").noshow(); - } void upd7810_device::state_string_export(const device_state_entry &entry, std::string &str) const diff --git a/src/devices/cpu/v60/v60.cpp b/src/devices/cpu/v60/v60.cpp index 0a9030ad313..46220d8637e 100644 --- a/src/devices/cpu/v60/v60.cpp +++ b/src/devices/cpu/v60/v60.cpp @@ -497,7 +497,6 @@ void v60_device::device_start() state_add( STATE_GENPC, "GENPC", PC).noshow(); state_add( STATE_GENPCBASE, "CURPC", m_PPC ).noshow(); - state_add( STATE_GENSP, "GENSP", SP ).noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_debugger_temp).callimport().formatstr("%7s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/v810/v810.cpp b/src/devices/cpu/v810/v810.cpp index a5a7e8dfc52..42a73ca9149 100644 --- a/src/devices/cpu/v810/v810.cpp +++ b/src/devices/cpu/v810/v810.cpp @@ -1316,7 +1316,6 @@ void v810_device::device_start() state_add(STATE_GENPC, "GENPC", PC).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_PPC).noshow(); - state_add(STATE_GENSP, "GENSP", SP).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", PSW).formatstr("%8s").noshow(); set_icountptr(m_icount); diff --git a/src/devices/cpu/xavix2/xavix2.cpp b/src/devices/cpu/xavix2/xavix2.cpp index 84a6da150ce..5527a1c6d78 100644 --- a/src/devices/cpu/xavix2/xavix2.cpp +++ b/src/devices/cpu/xavix2/xavix2.cpp @@ -23,7 +23,6 @@ void xavix2_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).callexport().noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc).callexport().noshow(); - state_add(STATE_GENSP, "GENSP", m_r[7]).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_hr[4]).callimport().formatstr("%5s").noshow(); state_add(XAVIX2_PC, "PC", m_pc).callimport(); state_add(XAVIX2_FLAGS, "FLAGS", m_hr[4]).callimport(); diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp index 1c1f8f3df54..18ded716eb7 100644 --- a/src/devices/cpu/z180/z180.cpp +++ b/src/devices/cpu/z180/z180.cpp @@ -1683,7 +1683,6 @@ void z180_device::device_start() state_add(STATE_GENPC, "GENPC", _PCD).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_PREPC.w.l).noshow(); state_add(Z180_SP, "SP", m_SP.w.l); - state_add(STATE_GENSP, "GENSP", m_SP.w.l).noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_AF.b.l).noshow().formatstr("%8s"); state_add(Z180_A, "A", _A).noshow(); state_add(Z180_B, "B", _B).noshow(); diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp index b2f4a20e4fe..c4a64029792 100644 --- a/src/devices/cpu/z8/z8.cpp +++ b/src/devices/cpu/z8/z8.cpp @@ -1219,7 +1219,6 @@ void z8_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).callimport().noshow(); state_add(STATE_GENPCBASE, "CURPC", m_ppc).callimport().noshow(); state_add(Z8_SP, "SP", m_sp.w); - state_add(STATE_GENSP, "GENSP", m_sp.w).noshow(); state_add(Z8_RP, "RP", m_rp); state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%6s"); state_add(Z8_IMR, "IMR", m_imr); diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index e3575a90af7..bdce00888ae 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -3416,7 +3416,6 @@ void z80_device::device_start() 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"); state_add(Z80_A, "A", A).noshow(); state_add(Z80_B, "B", B).noshow(); diff --git a/src/devices/cpu/z8000/z8000.cpp b/src/devices/cpu/z8000/z8000.cpp index 4ce857cecb5..d000f3aa2b7 100644 --- a/src/devices/cpu/z8000/z8000.cpp +++ b/src/devices/cpu/z8000/z8000.cpp @@ -520,7 +520,6 @@ void z8002_device::register_debug_state() state_add( STATE_GENPC, "GENPC", m_pc ).noshow(); state_add( STATE_GENPCBASE, "CURPC", m_ppc ).noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_fcw ).formatstr("%16s").noshow(); - state_add( STATE_GENSP, "GENSP", m_nspoff ).noshow(); } void z8002_device::state_string_export(const device_state_entry &entry, std::string &str) const diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index ace535f1084..d4bb6724f8c 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -225,8 +225,6 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu m_console.register_command("rpenable", CMDFLAG_NONE, 1, 0, 1, std::bind(&debugger_commands::execute_rpdisenable, this, _1, _2)); m_console.register_command("rplist", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_rplist, this, _1, _2)); - m_console.register_command("hotspot", CMDFLAG_NONE, 0, 0, 3, std::bind(&debugger_commands::execute_hotspot, this, _1, _2)); - m_console.register_command("statesave", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_statesave, this, _1, _2)); m_console.register_command("ss", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_statesave, this, _1, _2)); m_console.register_command("stateload", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_stateload, this, _1, _2)); @@ -1342,7 +1340,7 @@ void debugger_commands::execute_cpulist(int ref, const std::vector<std::string> int index = 0; for (device_execute_interface &exec : execute_interface_enumerator(m_machine.root_device())) { - device_state_interface *state; + const device_state_interface *state; if (exec.device().interface(state) && state->state_find_entry(STATE_GENPCBASE) != nullptr) m_console.printf("[%s%d] %s\n", &exec.device() == m_console.get_visible_cpu() ? "*" : "", index++, exec.device().tag()); } @@ -1896,49 +1894,6 @@ void debugger_commands::execute_rplist(int ref, const std::vector<std::string> & /*------------------------------------------------- - execute_hotspot - execute the hotspot - command --------------------------------------------------*/ - -void debugger_commands::execute_hotspot(int ref, const std::vector<std::string> ¶ms) -{ - /* if no params, and there are live hotspots, clear them */ - if (params.empty()) - { - bool cleared = false; - - /* loop over CPUs and find live spots */ - for (device_t &device : device_enumerator(m_machine.root_device())) - if (device.debug()->hotspot_tracking_enabled()) - { - device.debug()->hotspot_track(0, 0); - m_console.printf("Cleared hotspot tracking on CPU '%s'\n", device.tag()); - cleared = true; - } - - /* if we cleared, we're done */ - if (cleared) - return; - } - - /* extract parameters */ - device_t *device = nullptr; - if (!validate_cpu_parameter(!params.empty() ? params[0].c_str() : nullptr, device)) - return; - u64 count = 64; - if (params.size() > 1 && !validate_number_parameter(params[1], count)) - return; - u64 threshhold = 250; - if (params.size() > 2 && !validate_number_parameter(params[2], threshhold)) - return; - - /* attempt to install */ - device->debug()->hotspot_track(count, threshhold); - m_console.printf("Now tracking hotspots on CPU '%s' using %d slots with a threshold of %d\n", device->tag(), (int)count, (int)threshhold); -} - - -/*------------------------------------------------- execute_statesave - execute the statesave command -------------------------------------------------*/ @@ -3559,6 +3514,13 @@ void debugger_commands::execute_trackpc(int ref, const std::vector<std::string> if (!validate_cpu_parameter((params.size() > 1) ? params[1].c_str() : nullptr, cpu)) return; + const device_state_interface *state; + if (!cpu->interface(state)) + { + m_console.printf("Device has no PC to be tracked\n"); + return; + } + // Should we clear the existing data? bool clear = false; if (params.size() > 2 && !validate_boolean_parameter(params[2], clear)) @@ -3570,7 +3532,7 @@ void debugger_commands::execute_trackpc(int ref, const std::vector<std::string> // Insert current pc if (m_console.get_visible_cpu() == cpu) { - const offs_t pc = cpu->state().pcbase(); + const offs_t pc = state->pcbase(); cpu->debug()->set_track_pc_visited(pc); } m_console.printf("PC tracking enabled\n"); diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index 0bda10ac299..7ed81ce9f00 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -143,7 +143,6 @@ private: void execute_rpclear(int ref, const std::vector<std::string> ¶ms); void execute_rpdisenable(int ref, const std::vector<std::string> ¶ms); void execute_rplist(int ref, const std::vector<std::string> ¶ms); - void execute_hotspot(int ref, const std::vector<std::string> ¶ms); void execute_statesave(int ref, const std::vector<std::string> ¶ms); void execute_stateload(int ref, const std::vector<std::string> ¶ms); void execute_rewind(int ref, const std::vector<std::string> ¶ms); diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index cf1d8eb5318..1399a6b8ec2 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -439,7 +439,6 @@ device_debug::device_debug(device_t &device) , m_triggered_breakpoint(nullptr) , m_triggered_watchpoint(nullptr) , m_trace(nullptr) - , m_hotspot_threshhold(0) , m_track_pc_set() , m_track_pc(false) , m_comment_set() @@ -458,7 +457,6 @@ device_debug::device_debug(device_t &device) // set up notifiers and clear the passthrough handlers if (m_memory) { int count = m_memory->max_space_count(); - m_phr.resize(count, nullptr); m_phw.resize(count, nullptr); for (int i=0; i != count; i++) if (m_memory->has_space(i)) { @@ -552,7 +550,7 @@ device_debug::~device_debug() void device_debug::write_tracking(address_space &space, offs_t address, u64 data) { - dasm_memory_access const newAccess(space.spacenum(), address, data, history_pc(0)); + dasm_memory_access const newAccess(space.spacenum(), address, data, m_state->pcbase()); std::pair<std::set<dasm_memory_access>::iterator, bool> trackedAccess = m_track_mem_set.insert(newAccess); if (!trackedAccess.second) trackedAccess.first->m_pc = newAccess.m_pc; @@ -561,19 +559,6 @@ void device_debug::write_tracking(address_space &space, offs_t address, u64 data void device_debug::reinstall(address_space &space, read_or_write mode) { int id = space.spacenum(); - if (u32(mode) & u32(read_or_write::READ)) - { - if (m_phr[id]) - m_phr[id]->remove(); - if (!m_hotspots.empty()) - switch (space.data_width()) - { - case 8: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u8 &, u8 ) { hotspot_check(space, address); }, m_phr[id]); break; - case 16: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u16 &, u16) { hotspot_check(space, address); }, m_phr[id]); break; - case 32: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u32 &, u32) { hotspot_check(space, address); }, m_phr[id]); break; - case 64: m_phr[id] = space.install_read_tap(0, space.addrmask(), "hotspot", [this, &space](offs_t address, u64 &, u64) { hotspot_check(space, address); }, m_phr[id]); break; - } - } if (u32(mode) & u32(read_or_write::WRITE)) { if (m_phw[id]) @@ -1348,30 +1333,6 @@ void device_debug::registerpoint_enable_all(bool enable) //------------------------------------------------- -// hotspot_track - enable/disable tracking of -// hotspots -//------------------------------------------------- - -void device_debug::hotspot_track(int numspots, int threshhold) -{ - // if we already have tracking enabled, kill it - m_hotspots.clear(); - - // only start tracking if we have a non-zero count - if (numspots > 0) - { - // allocate memory for hotspots - m_hotspots.resize(numspots); - memset(&m_hotspots[0], 0xff, numspots*sizeof(m_hotspots[0])); - - // fill in the info - m_hotspot_threshhold = threshhold; - } - reinstall_all(read_or_write::READ); -} - - -//------------------------------------------------- // history_pc - return an entry from the PC // history //------------------------------------------------- @@ -1749,56 +1710,6 @@ void device_debug::breakpoint_check(offs_t pc) } -//------------------------------------------------- -// watchpoint_check - check the watchpoints -// for a given CPU and address space -//------------------------------------------------- - -//------------------------------------------------- -// hotspot_check - check for hotspots on a -// memory read access -//------------------------------------------------- - -void device_debug::hotspot_check(address_space &space, offs_t address) -{ - offs_t curpc = m_device.state().pcbase(); - - // see if we have a match in our list - unsigned int hotindex; - for (hotindex = 0; hotindex < m_hotspots.size(); hotindex++) - if (m_hotspots[hotindex].m_access == address && m_hotspots[hotindex].m_pc == curpc && m_hotspots[hotindex].m_space == &space) - break; - - // if we didn't find any, make a new entry - if (hotindex == m_hotspots.size()) - { - // if the bottom of the list is over the threshold, print it - hotspot_entry &spot = m_hotspots[m_hotspots.size() - 1]; - if (spot.m_count > m_hotspot_threshhold) - m_device.machine().debugger().console().printf("Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count); - - // move everything else down and insert this one at the top - memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * (m_hotspots.size() - 1)); - m_hotspots[0].m_access = address; - m_hotspots[0].m_pc = curpc; - m_hotspots[0].m_space = &space; - m_hotspots[0].m_count = 1; - } - - // if we did find one, increase the count and move it to the top - else - { - m_hotspots[hotindex].m_count++; - if (hotindex != 0) - { - hotspot_entry temp = m_hotspots[hotindex]; - memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * hotindex); - m_hotspots[0] = temp; - } - } -} - - //************************************************************************** // TRACER diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 720c400b1ac..11a2f55843e 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -118,10 +118,6 @@ public: bool registerpoint_enable(int index, bool enable = true); void registerpoint_enable_all(bool enable = true ); - // hotspots - bool hotspot_tracking_enabled() const { return !m_hotspots.empty(); } - void hotspot_track(int numspots, int threshhold); - // comments void comment_add(offs_t address, const char *comment, rgb_t color); bool comment_remove(offs_t addr); @@ -170,7 +166,6 @@ private: // breakpoint and watchpoint helpers void breakpoint_update_flags(); void breakpoint_check(offs_t pc); - void hotspot_check(address_space &space, offs_t address); void reinstall_all(read_or_write mode); void reinstall(address_space &space, read_or_write mode); void write_tracking(address_space &space, offs_t address, u64 data); @@ -244,18 +239,6 @@ private: }; std::unique_ptr<tracer> m_trace; // tracer state - // hotspots - struct hotspot_entry - { - offs_t m_access; // access address - offs_t m_pc; // PC of the access - address_space * m_space; // space where the access occurred - u32 m_count; // number of hits - }; - std::vector<hotspot_entry> m_hotspots; // hotspot list - int m_hotspot_threshhold; // threshhold for the number of hits to print - - std::vector<memory_passthrough_handler *> m_phr; // passthrough handler reference for each space, read mode std::vector<memory_passthrough_handler *> m_phw; // passthrough handler reference for each space, write mode std::vector<int> m_notifiers; // notifiers for each space diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index 74d6b7f29ea..99fda175735 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -188,7 +188,6 @@ static const help_item static_help_list[] = " wpdisable [<wpnum>] -- disables a given watchpoint or all if no <wpnum> specified\n" " wpenable [<wpnum>] -- enables a given watchpoint or all if no <wpnum> specified\n" " wplist -- lists all the watchpoints\n" - " hotspot [<CPU>,[<depth>[,<hits>]]] -- attempt to find hotspots\n" }, { "registerpoints", @@ -1215,36 +1214,6 @@ static const help_item static_help_list[] = "conditions or actions attached to them.\n" }, { - "hotspot", - "\n" - " hotspot [<CPU>,[<depth>[,<hits>]]]\n" - "\n" - "The hotspot command attempts to help locate hotspots in the code where speedup opportunities " - "might be present. <CPU>, which defaults to the currently active CPU, specified which " - "processor's memory to track. <depth>, which defaults to 64, controls the depth of the search " - "buffer. The search buffer tracks the last <depth> memory reads from unique PCs. The <hits> " - "parameter, which defaults to 250, specifies the minimum number of hits to report.\n" - "\n" - "The basic theory of operation is like this: each memory read is trapped by the debugger and " - "logged in the search buffer according to the address which was read and the PC that executed " - "the opcode. If the search buffer already contains a matching entry, that entry's count is " - "incremented and the entry is moved to the top of the list. If the search buffer does not " - "contain a matching entry, the entry from the bottom of the list is removed, and a new entry " - "is created at the top with an initial count of 1. Entries which fall off the bottom are " - "examined and if their count is larger than <hits>, they are reported to the debugger " - "console.\n" - "\n" - "Examples:\n" - "\n" - "hotspot 0,10\n" - " Looks for hotspots on CPU 0 using a search buffer of 16 entries, reporting any entries which " - "end up with 250 or more hits.\n" - "\n" - "hotspot 1,40,#1000\n" - " Looks for hotspots on CPU 1 using a search buffer of 64 entries, reporting any entries which " - "end up with 1000 or more hits.\n" - }, - { "rpset", "\n" " rp[set] {<condition>}[,<action>]]\n" diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index ab24206ff90..5c371b37426 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -25,8 +25,12 @@ debug_view_disasm_source::debug_view_disasm_source(std::string &&name, device_t &device) : debug_view_source(std::move(name), &device), m_space(device.memory().space(AS_PROGRAM)), - m_decrypted_space(device.memory().has_space(AS_OPCODES) ? device.memory().space(AS_OPCODES) : device.memory().space(AS_PROGRAM)) + m_decrypted_space(device.memory().has_space(AS_OPCODES) ? device.memory().space(AS_OPCODES) : device.memory().space(AS_PROGRAM)), + m_pcbase(nullptr) { + const device_state_interface *state; + if (device.interface(state)) + m_pcbase = state->state_find_entry(STATE_GENPCBASE); } @@ -164,7 +168,7 @@ void debug_view_disasm::view_char(int chval) case DCH_HOME: // set the active column to the PC { const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); - offs_t pc = source.device()->state().pcbase() & source.m_space.logaddrmask(); + offs_t pc = source.pcbase(); // figure out which row the pc is on for(unsigned int curline = 0; curline < m_dasm.size(); curline++) @@ -377,7 +381,7 @@ void debug_view_disasm::view_update() { const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); debug_disasm_buffer buffer(*source.device()); - offs_t pc = source.device()->state().pcbase() & source.m_space.logaddrmask(); + offs_t pc = source.pcbase(); generate_dasm(buffer, pc); diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h index e445481a0e3..0a16f95d5fe 100644 --- a/src/emu/debug/dvdisasm.h +++ b/src/emu/debug/dvdisasm.h @@ -49,11 +49,13 @@ public: // getters address_space &space() const { return m_space; } + offs_t pcbase() const { return m_pcbase != nullptr ? m_pcbase->value() & m_space.logaddrmask() : 0; } private: // internal state address_space & m_space; // address space to display address_space & m_decrypted_space; // address space to display for decrypted opcodes + const device_state_entry *m_pcbase; }; diff --git a/src/emu/debug/points.cpp b/src/emu/debug/points.cpp index 688881a40e6..5bb85fa2ea2 100644 --- a/src/emu/debug/points.cpp +++ b/src/emu/debug/points.cpp @@ -379,9 +379,10 @@ void debug_watchpoint::triggered(read_or_write type, offs_t address, u64 data, u data, address); - if (debug.cpu().live_cpu() == &m_debugInterface->device()) + const device_state_interface *state; + if (debug.cpu().live_cpu() == &m_debugInterface->device() && m_debugInterface->device().interface(state)) { - offs_t pc = m_debugInterface->device().state().pcbase(); + offs_t pc = state->pcbase(); debug.console().printf("%s (PC=%X)\n", buffer, pc); m_debugInterface->compute_debug_flags(); } diff --git a/src/emu/device.h b/src/emu/device.h index 774930690b7..21ac3bcba6e 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -434,7 +434,6 @@ class device_t : public delegate_late_bind friend class device_t; friend class device_interface; friend class device_memory_interface; - friend class device_state_interface; friend class device_execute_interface; public: @@ -464,7 +463,7 @@ class device_t : public delegate_late_bind }; // construction/destruction - interface_list() : m_head(nullptr), m_execute(nullptr), m_memory(nullptr), m_state(nullptr) { } + interface_list() : m_head(nullptr), m_execute(nullptr), m_memory(nullptr) { } // getters device_interface *first() const { return m_head; } @@ -477,7 +476,6 @@ class device_t : public delegate_late_bind device_interface *m_head; // head of interface list device_execute_interface *m_execute; // pre-cached pointer to execute interface device_memory_interface *m_memory; // pre-cached pointer to memory interface - device_state_interface *m_state; // pre-cached pointer to state interface }; protected: @@ -558,11 +556,8 @@ public: bool interface(device_execute_interface *&intf) const { intf = m_interfaces.m_execute; return (intf != nullptr); } bool interface(device_memory_interface *&intf) { intf = m_interfaces.m_memory; return (intf != nullptr); } bool interface(device_memory_interface *&intf) const { intf = m_interfaces.m_memory; return (intf != nullptr); } - bool interface(device_state_interface *&intf) { intf = m_interfaces.m_state; return (intf != nullptr); } - bool interface(device_state_interface *&intf) const { intf = m_interfaces.m_state; return (intf != nullptr); } device_execute_interface &execute() const { assert(m_interfaces.m_execute != nullptr); return *m_interfaces.m_execute; } device_memory_interface &memory() const { assert(m_interfaces.m_memory != nullptr); return *m_interfaces.m_memory; } - device_state_interface &state() const { assert(m_interfaces.m_state != nullptr); return *m_interfaces.m_state; } // owned object helpers subdevice_list &subdevices() { return m_subdevices; } diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp index 215f140efd1..0d94c4dcf81 100644 --- a/src/emu/distate.cpp +++ b/src/emu/distate.cpp @@ -65,8 +65,6 @@ device_state_entry::device_state_entry(int index, const char *symbol, u8 size, u // override well-known symbols if (index == STATE_GENPCBASE) m_symbol.assign("CURPC"); - else if (index == STATE_GENSP) - m_symbol.assign("CURSP"); else if (index == STATE_GENFLAGS) m_symbol.assign("CURFLAGS"); } @@ -491,9 +489,6 @@ device_state_interface::device_state_interface(const machine_config &mconfig, de : device_interface(device, "state") { memset(m_fast_state, 0, sizeof(m_fast_state)); - - // configure the fast accessor - device.interfaces().m_state = this; } diff --git a/src/emu/distate.h b/src/emu/distate.h index 0155d2afb11..f0cf04eadeb 100644 --- a/src/emu/distate.h +++ b/src/emu/distate.h @@ -27,8 +27,7 @@ enum { STATE_GENPC = -1, // generic program counter (live) STATE_GENPCBASE = -2, // generic program counter (base of current instruction) - STATE_GENSP = -3, // generic stack pointer - STATE_GENFLAGS = -4 // generic flags + STATE_GENFLAGS = -3 // generic flags }; @@ -295,12 +294,11 @@ public: const std::vector<std::unique_ptr<device_state_entry>> &state_entries() const { return m_state_list; } // state getters - u64 state_int(int index) { const device_state_entry *entry = state_find_entry(index); return (entry == nullptr) ? 0 : entry->value(); } + u64 state_int(int index) const { const device_state_entry *entry = state_find_entry(index); return (entry == nullptr) ? 0 : entry->value(); } std::string state_string(int index) const { const device_state_entry *entry = state_find_entry(index); return (entry == nullptr) ? std::string("???") : entry->to_string(); } - offs_t pc() { return state_int(STATE_GENPC); } - offs_t pcbase() { return state_int(STATE_GENPCBASE); } - offs_t sp() { return state_int(STATE_GENSP); } - u64 flags() { return state_int(STATE_GENFLAGS); } + offs_t pc() const { return state_int(STATE_GENPC); } + offs_t pcbase() const { return state_int(STATE_GENPCBASE); } + u64 flags() const { return state_int(STATE_GENFLAGS); } // state setters void set_state_int(int index, u64 value) { const device_state_entry *entry = state_find_entry(index); if (entry != nullptr) entry->set_value(value); } @@ -309,10 +307,6 @@ public: // find the entry for a given index const device_state_entry *state_find_entry(int index) const; - // deliberately ambiguous functions; if you have the state interface - // just use it directly - device_state_interface &state() { return *this; } - public: // protected eventually // add a new state register item diff --git a/src/emu/machine.h b/src/emu/machine.h index 83e1c512268..f3aef08d265 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -51,12 +51,6 @@ enum machine_notification // debug flags constexpr int DEBUG_FLAG_ENABLED = 0x00000001; // debugging is enabled constexpr int DEBUG_FLAG_CALL_HOOK = 0x00000002; // CPU cores must call instruction hook -constexpr int DEBUG_FLAG_WPR_PROGRAM = 0x00000010; // watchpoints are enabled for PROGRAM memory reads -constexpr int DEBUG_FLAG_WPR_DATA = 0x00000020; // watchpoints are enabled for DATA memory reads -constexpr int DEBUG_FLAG_WPR_IO = 0x00000040; // watchpoints are enabled for IO memory reads -constexpr int DEBUG_FLAG_WPW_PROGRAM = 0x00000100; // watchpoints are enabled for PROGRAM memory writes -constexpr int DEBUG_FLAG_WPW_DATA = 0x00000200; // watchpoints are enabled for DATA memory writes -constexpr int DEBUG_FLAG_WPW_IO = 0x00000400; // watchpoints are enabled for IO memory writes constexpr int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 2e93d725ed3..9dfc9aeee0b 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1424,10 +1424,11 @@ void lua_engine::initialize() [this] (device_t &dev) { sol::table st_table = sol().create_table(); - if(!dynamic_cast<device_state_interface *>(&dev)) + const device_state_interface *state; + if(!dev.interface(state)) return st_table; // XXX: refrain from exporting non-visible entries? - for(auto &s : dev.state().state_entries()) + for(auto &s : state->state_entries()) st_table[s->symbol()] = s.get(); return st_table; }); diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp index acc53bd5ef6..685dd184dec 100644 --- a/src/mame/drivers/groundfx.cpp +++ b/src/mame/drivers/groundfx.cpp @@ -319,7 +319,7 @@ ROM_END u32 groundfx_state::irq_speedup_r() { int ptr; - offs_t sp = m_maincpu->sp(); + offs_t sp = m_maincpu->state_int(M68K_SP); if ((sp & 2) == 0) ptr = m_ram[(sp & 0x1ffff) / 4]; else ptr = (((m_ram[(sp & 0x1ffff) / 4]) & 0x1ffff) << 16) | (m_ram[((sp & 0x1ffff) / 4) + 1] >> 16); diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index f31d60b76b7..d03cabc76c9 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -1967,7 +1967,7 @@ image_init_result jaguar_state::quickload_cb(device_image_interface &image) /* Some programs are too lazy to set a stack pointer */ - m_maincpu->set_state_int(STATE_GENSP, 0x1000); + m_maincpu->set_state_int(M68K_SP, 0x1000); m_shared_ram[0]=0x1000; /* Transfer control to image */ diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp index 0ce284a9a44..05fd4f0a850 100644 --- a/src/mame/drivers/jupace.cpp +++ b/src/mame/drivers/jupace.cpp @@ -249,7 +249,7 @@ SNAPSHOT_LOAD_MEMBER(ace_state::snapshot_cb) cpu->set_state_int(Z80_R, RAM[0x2140]); if ((RAM[0x2119] < 0x80) || !ace_index) - cpu->set_state_int(STATE_GENSP, RAM[0x2118] | (RAM[0x2119] << 8)); + cpu->set_state_int(Z80_SP, RAM[0x2118] | (RAM[0x2119] << 8)); } /* Copy data to the address space */ diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 4062bf5d7dd..c8b37acd746 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -2245,12 +2245,9 @@ void amstrad_state::amstrad_handle_snapshot(unsigned char *pSnapshot) RegData = (pSnapshot[0x021] & 0x0ff) | ((pSnapshot[0x022] & 0x0ff)<<8); m_maincpu->set_state_int(Z80_SP, RegData); - m_maincpu->set_state_int(STATE_GENSP, RegData); RegData = (pSnapshot[0x023] & 0x0ff) | ((pSnapshot[0x024] & 0x0ff)<<8); - m_maincpu->set_state_int(Z80_PC, RegData); -// m_maincpu->set_state_int(REG_SP, RegData); RegData = (pSnapshot[0x025] & 0x0ff); m_maincpu->set_state_int(Z80_IM, RegData); diff --git a/src/mame/machine/nb1413m3.cpp b/src/mame/machine/nb1413m3.cpp index c67a13f6ce2..00f99cd24ac 100644 --- a/src/mame/machine/nb1413m3.cpp +++ b/src/mame/machine/nb1413m3.cpp @@ -202,8 +202,8 @@ uint8_t nb1413m3_device::sndrom_r(address_space &space, offs_t offset) { int rombank; - /* get top 8 bits of the I/O port address */ - offset = (offset << 8) | (space.device().state().state_int(Z80_BC) >> 8); + // get top 8 bits of the I/O port address (FIXME: do this the correct way with 16-bit addressing) + offset = (offset << 8) | (downcast<z80_device &>(space.device()).state_int(Z80_BC) >> 8); switch (m_nb1413m3_type) { diff --git a/src/mame/machine/sorcerer.cpp b/src/mame/machine/sorcerer.cpp index 6e3f547784f..d4eac2ac17d 100644 --- a/src/mame/machine/sorcerer.cpp +++ b/src/mame/machine/sorcerer.cpp @@ -655,7 +655,7 @@ QUICKLOAD_LOAD_MEMBER(sorcerer_state::quickload_cb) m_maincpu->set_state_int(Z80_IFF2, header[19]&4 ? 1 : 0); m_maincpu->set_state_int(Z80_R, header[20]); m_maincpu->set_state_int(Z80_AF, header[21] | (header[22] << 8)); - m_maincpu->set_state_int(STATE_GENSP, header[23] | (header[24] << 8)); + m_maincpu->set_state_int(Z80_SP, header[23] | (header[24] << 8)); m_maincpu->set_state_int(Z80_IM, header[25]); m_maincpu->set_pc(header[26] | (header[27] << 8)); } diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp index 8a6dc2226e3..52289b9997d 100644 --- a/src/osd/modules/debugger/debuggdbstub.cpp +++ b/src/osd/modules/debugger/debuggdbstub.cpp @@ -647,7 +647,8 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop) if ( it == gdb_register_maps.end() ) fatalerror("gdbstub: cpuname %s not found in gdb stub descriptions\n", cpuname); - m_state = &m_maincpu->state(); + m_maincpu->interface(m_state); + assert(m_state != nullptr); m_memory = &m_maincpu->memory(); m_address_space = &m_memory->space(AS_PROGRAM); m_debugger_cpu = &m_machine->debugger().cpu(); |