That's the way I did it when I was working on that SMS emulator.Fonzie wrote:I think that 512 (or 512-emulator) KB is quite good...
I wonder if its possible to use the segacd communication table to fake the I/O (vdp ports of the nes).
Well it will introduce some delay, but it means the main CPU can do the heavy lifting of the video emulation (which isn't that heavy in the case of the SMS, but you get the idea).I mean, if the maincpu runs at fullspeed on pooling the I/O, it may be no lag.
I would push the full 256KB to the SUB CPU for SMS and split it or give it all to the main CPU if there is a CHAR ROM that won't fit in Genesis RAM. The video emulation doesn't need to be very big since the Genesis VDP is still going to do a lot of the work for us.The flip/flap 128KB ram can be used to store some additional stuff on subcpu
and the emulator on maincpu...
What can I say? I can't resist an interesting problem.Btw, It seems I awaken some of yours old deamons, MOD ;P
In the case of our simple interpretter it would be slower to check for nops than to just "emulate" them. I was using nops for my timing examples because it made things simple and provided a sort of "best case" for instructions that take 2 cycles on the 6502 or 4 on the Z80. In a dynarec you'd probably skip them.Also, why emulating the nops? Just skipping them woundn't damage the code, isn't it?
If you stick with a simple dynarec that doesn't have an interpretter fallback, it would probably fit okay. Given the relatively high number of registers in the 68K versus the 8-bit procs (especially the 6502) you could use a relatively simple register mapping scheme. You could probably do a simple lookup table for many instructions with some lookahead to recognize instruction combinations that can be executed more efficiently on the 68K (i.e. 4 or more bit shifts in a row will be faster as a single 68k shift instruction). Branches are complicated of courseBut the problem is the recompiler code itself... it's a complex stuff to do, i don't know if the recompiler code plus compiled code can fit in sega available ram :-/