[hatari-devel] Changes to improve integration between Hatari and WinUAE cpu core

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi

As old UAE cpu core had a rather limited set of cpu options, parts of the code to interact with the cpu core was called directly from m68000.c and hatari-glue.c

With WinUAE cpu core, we have many more options (cpu family, CE mode, MMU, FPU, ...) and keeping a similar way to call directly some functions in newcpu.c was starting to be really complicated, sometimes resulting in lot of duplicated code and too much Hatari's specific code that could be avoided by reusing the same logic as WinUAE (for example, I noticed that our support for softfloat fpu mode was not correct, as it could be lost on next reset when changing some cpu options...)

Also when starting Hatari and restoring a snapshot, one could see that some cpu init functions were called twice in several places ; not really a problem, but some waste of ressources.

Basically, interactions with the cpu core are now made using regs.spcflags and SPCFLAG_MODE_CHANGE, as well as using 'quit_program'.

Instead of calling ourselves the required cpu init/build functions when some settings are changed, which was made while processing the current instruction, we now set those 2 variables and when current instruction is complete, do_specialties() will cleanly exit the emulation loop and go back to "m68k_go()" where the changed preferences will be taken into account.


In short, this affects doing a reset (hard or soft), restoring cpu state from a memory snapshot, patching some opcodes when Gemdos HD is enabled and of course starting cpu emulation and changing some cpu/fpu parameters.

Please, report any problem that would happen since these changes (although I made a lot of tests in various scenario, one never knows :) )


Regarding old UAE cpu core, I just updated it to keep working with some of those changes, but that's all, I didn't apply the same "cleanup" process.


Nicolas


PS : some extra printf as well as some no-more used code are still there, I need them for some pending changes and they will be removed after that.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/