diff --git a/orao/timer.py b/orao/timer.py index 4f3a604..abef45b 100644 --- a/orao/timer.py +++ b/orao/timer.py @@ -1,11 +1,14 @@ timer = {} +timer_pos = {} def mem_listener(addr, val, cpu): if addr >= 0xa000 and addr <= 0xa0ff: timer_ix = addr & 0xff if timer_ix in timer: - print('timer(%s):duration %d cy' % (timer_ix, cpu.cycles - timer[timer_ix] - 4)) + print('timer(%3d:%04x-%04x):duration %d cy' % (timer_ix, timer_pos[timer_ix], cpu.pc-1, cpu.cycles - timer[timer_ix] - 4)) del timer[timer_ix] + del timer_pos[timer_ix] else: timer[timer_ix] = cpu.cycles + timer_pos[timer_ix] = cpu.pc+2