Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/devices/cpu/sharc/sharc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,8 @@ void adsp21062_device::execute_run()

m_core->opcode = m_program->read_qword(m_core->pc);

m_core->flag_stalled = false;

// handle looping
if (m_core->pc == m_core->laddr.addr)
{
Expand All @@ -1101,6 +1103,10 @@ void adsp21062_device::execute_run()
else
{
CHANGE_PC(TOP_PC());

// if a flag is causing us to loop, stall
if ((condition & 0xf) >= 0x9 && (condition & 0xf) <= 0xc)
m_core->flag_stalled = true;
}

m_core->astat = m_core->astat_old;
Expand Down
1 change: 1 addition & 0 deletions src/devices/cpu/sharc/sharc.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ class adsp21062_device : public cpu_device
SHARC_DMA_OP dma_op[12];
uint32_t dma_status;
bool write_stalled;
bool flag_stalled;

int32_t interrupt_active;

Expand Down
6 changes: 6 additions & 0 deletions src/devices/cpu/sharc/sharcops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,10 @@ void adsp21062_device::sharcop_relative_jump()
else
{
CHANGE_PC(m_core->pc + util::sext(address, 24));

// if a flag is causing the instruction to jump to itself, eat the remaining cycles
if (address == 0 && (cond & 0xf) >= 0x9 && (cond & 0xf) <= 0xc)
eat_cycles(m_core->icount);
}
}
}
Expand Down Expand Up @@ -2704,6 +2708,8 @@ void adsp21062_device::sharcop_push_pop_stacks()

void adsp21062_device::sharcop_nop()
{
if (m_core->flag_stalled)
eat_cycles(m_core->icount);
}

/*****************************************************************************/
Expand Down
Loading