#define SH2_IN_DRC (1 << 7) // DRC in use\r
unsigned int state;\r
uint32_t poll_addr;\r
- int poll_cycles;\r
+ unsigned int poll_cycles;\r
int poll_cnt;\r
// NB MUST be a bit unused in SH2 SR, see also cpu/sh2/compiler.c!\r
#define SH2_NO_POLLING (1 << 10) // poll detection control\r
unsigned int mcycles;
mcycles = msh2.m68krcycles_done;
- if (ssh2.m68krcycles_done < mcycles)
+ if (CYCLES_GT(mcycles, ssh2.m68krcycles_done))
mcycles = ssh2.m68krcycles_done;
- while (mcycles < m68k_target) {
+ while (CYCLES_GT(m68k_target, mcycles)) {
mcycles += STEP_LS;
sync_sh2s_normal(mcycles);
}
// support polling on 2 addresses - seen in Wolfenstein
int match = (a - m68k_poll.addr1 <= 3 || a - m68k_poll.addr2 <= 3);
- if (match && cycles - m68k_poll.cycles <= 64 && !SekNotPolling)
+ if (match && CYCLES_GT(64, cycles - m68k_poll.cycles) && !SekNotPolling)
{
// detect split 32bit access by same cycle count, and ignore those
if (cycles != m68k_poll.cycles && ++m68k_poll.cnt >= POLL_THRESHOLD) {
elprintf_sh2(sh2, EL_32X, "state: %02x->%02x", sh2->state,
sh2->state & ~flags);
- if (sh2->m68krcycles_done < m68k_cycles && !(sh2->state & SH2_STATE_RUN))
+ if (CYCLES_GT(m68k_cycles, sh2->m68krcycles_done) && !(sh2->state & SH2_STATE_RUN))
sh2->m68krcycles_done = m68k_cycles;
pevt_log_sh2_o(sh2, EVT_POLL_END);