The reason Goldeneye (and Paper Mario) crashes is because it executes code in virtual memory and the dynamic recompiler doesn't check the mapping when it compiles the code so it just bails out. But that's trivial to fix.
There are some bigger issues with the TLB support though. Currently all memory accesses are checked against the range 80000000-80800000 and anything outside this range (including virtual memory) results in a call to the function pointers in readmem/writemem. This is really slow, so any game that does this a lot is going to be unplayable on the Pandora.
So I need to make an inline lookup instead of a function call. The best I could come up with was something like this:
Code:
add r2, fp, r1 lsr #10
bic r2, r2, #3
ldr r2, [r2, #offset]
tst r2, #1
bne io_handler
ldr r0, [r1, r2]
which would replace the current
Code:
cmp r1, #0x800000
bvc io_handler
ldr r0, [r1]
Of course it would be slower, so I would only have the compiler generate this code if the game is actually using the TLB.
To do this I would need to move the mapping tables into dynarec_local (which is what fp contains a pointer to) and set the low bits for the I/O range and unmapped memory. Also allocate another register in load_alloc and store_alloc so there is a register for this pointer to the mapping tables.
I probably won't have time to finish it until January. Then there's the TLB exception handling to do. Most games don't actually cause pagefaults, so maybe I can get some working without that.