Fixed COSMAC CPU debugger PC. [Curt Coder]

This commit is contained in:
Curt Coder 2011-06-29 07:47:50 +00:00
parent 6bd42bd8df
commit 5bdbd34778
2 changed files with 10 additions and 2 deletions

View File

@ -16,7 +16,6 @@
TODO:
- debugger cursor is not on R(P)
- divide clock by 8
- min cycles -> 2 and 3
@ -237,7 +236,7 @@ void cosmac_device::device_start()
m_io = space(AS_IO);
// register our state for the debugger
state_add(STATE_GENPC, "GENPC", R[P]).noshow();
state_add(STATE_GENPC, "GENPC", m_pc).callimport().callexport().noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", m_flagsio).mask(0x7).callimport().callexport().noshow().formatstr("%3s");
state_add(COSMAC_P, "P", m_p).mask(0xf);
@ -339,6 +338,10 @@ void cosmac_device::state_import(const device_state_entry &entry)
{
switch (entry.index())
{
case STATE_GENPC:
R[P] = m_pc;
break;
case STATE_GENFLAGS:
SET_FLAGS(m_flagsio);
break;
@ -355,6 +358,10 @@ void cosmac_device::state_export(const device_state_entry &entry)
{
switch (entry.index())
{
case STATE_GENPC:
m_pc = R[P];
break;
case STATE_GENFLAGS:
m_flagsio = GET_FLAGS();
break;

View File

@ -339,6 +339,7 @@ protected:
};
// internal state
UINT16 m_pc; // fake program counter
UINT8 m_op; // current opcode
UINT8 m_flagsio; // flags storage for state saving
cosmac_state m_state; // state