Re: [hatari-devel] 68040/060 MMU bug fix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Le 29/12/2023 à 15:25, Andreas Grabher a écrit :
The complexity of interrupt code in WinUAE is very high due to
handling lots of different CPUs and emulation modes. This increases
the chance to mess things up unintentionally. There is interrupt code
in lots of places using SPCFLAG_INT, SPCFLAG_DOINT, regs.ipl[0],
regs,ipl[1], regs.ipl[2], ipl_pin, ipl_pin_p, do_interrupt(),
check_interrupt(), ipl_fetch_xxx(), doint(), checkint(),
m68k_interrupt_delay, m68k_accurate_ipl … just to name a few.
Is there a chance this will be cleaned up a bit which would also
improve performance?
Hi
toni will certainly elaborate more on this, but in the case of the 68000
having cycle accurate emulation of the micro code unfortunately imply to
have sometimes a lot of variables just to emulate a very particular
behaviour.
for example, deciding which value of the hardware ipl pins is sampled to
decide at which stage an opcode will be interrupted in case of a change
in IPL is really tricky. That's why the ipl[] array is needed because
you need to keep an history of the IPL values during the previous cycle
as well as at what cycles the IPL changed
This variable are also there to help improving perfomance : if you
disable m68k_accurate_ipl or m68k_interrupt_delay you will have a less
cycle accurate but slightly faster emulation , which can good enough for
68030 (which is not cycle accurate emulated anyway)
But I agree dealing with all those variables and function can be
difficult when you're trying to follow the code :)
Nicolas