This time I'm doing something that is alot different to the normal interperative emulators I've seen, and was wondering if anyone could give some advice on implementing it properly. What I have so far (started yesterday, it runs a single game but with no controls implemented) can be seen here: http://www.elephantsneverforget.co.uk/c8x.html
What I do is:
I have an array called TranslatedBlocks.
The emulator starts at "ProgramCounter=0x200",
If TranslatedBlocks[ProgramCounter] isn't null, (it's a function) it is executed.
Whenever a "translatedblock" is executed the ProgramCounter is either set by an instruction (jmp/rts/etc) or incremented by the length of the block.
I would like to do something like this on GBA or GP32 (the translatedblocks would be arrays of hexcode right?) but am not sure if they would have the memory.. I figure that most games might only need a few translatedblocks active once, would that be the case?
I could allocate enough memory for 3 or 4 translated blocks and keep track of when the last block was executed. If a new block is to be translated and I don't have any room left I replace the one that was used last. However blocks would be variable length.. Anyway something like this would be possible?