PandTomB / uae4arm

UAE4ARM for the Pandora (branch master, but no longer maintained) and RaspberryPi (branch Raspi, current development version)
GNU General Public License v2.0
8 stars 2 forks source link

Looking for help to split out the JIT #12

Open scrameta opened 3 years ago

scrameta commented 3 years ago

I'm trying hybrid emulation on the MiSTer FPGA. i.e. where we have minimig in hardware on the FPGA and the cpu on the arm. See https://misterfpga.org/viewtopic.php?f=4&t=2397

I have it working reasonably well with musashi. I'd like to switch to a jit 68k though and am looking for one that I can split out since most of them are highly integrated into various emulators.

Would it be possible to give me some hints on how to split this out please. e.g. Keep this bunch of files, plug in memory like this and this is the entry point?

My email is my git username at gmail.

PandTomB commented 3 years ago

Most parts for JIT are in subfolder src/jit. Some more functions are located in newcpu.cpp (search for #ifdef JIT and #ifdef USE_JIT_FPU). Importand is also the layout of "struct regstruct". Some code expects elements at specific locations. Memory access is done by two different ways depending if special hardware was accessed. Simple and fast access is done by expecting the entire memory of the emulated device as a continues block of memory starting at some address. The second options is done by using the memory access functions from "typedef struct {...} addrbank;".

scrameta commented 3 years ago

Many thanks, I'll take a more of a look at this following your comments above.

I've been trying to plug in qemu m68k in the meantime. It seems really fast though when e.g. polling the raster for timing I miss some scanlines. I wonder if that'd be an issue with any jit, where it can go away for some time to compile, start another block etc.

PandTomB commented 3 years ago

In UAE, the estimated times for finishing scanlines or frames are calculated and if there is enough time left when emulation of custom chips is finished, the CPU emulation gets another block of more cycles to use if cpu speed is "fastest possible".