Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TLCS-900/H prefetch instruction queue test
#1
Download ROM + source code

This is a small test ROM I wrote that might be of interest to someone writing a TLCS-900/H emulator. It performs a few tests that relies on a correct implementation of the prefetching mechanism of the TLCS-900/h and prints the results on the screen.

Mednafen and NeoPop fail on all of these tests. I haven't tried MESS.
On a real NGPC the tests all pass (of course), as can be seen here:
[Image: ngpc_iq.png]
Reply
#2
(10-16-2012, 05:05 AM)mic_ Wrote: Mednafen and NeoPop fail on all of these tests. I haven't tried MESS. On a real NGPC the tests all pass (of course)

Nice. Is there a NGP emulator that's still being actively developed, though? Aside from the multi-platform ones, that is. I tried the ROM with Koyote 0.5.0 under Win, but it failed. Same goes for NeoPocott, which doesn't even display the values.
Reply
#3
Quote:Is there a NGP emulator that's still being actively developed, though? Aside from the multi-platform ones

I guess not.
And I'd be very surprised if there's any actual software (as in Games) for the NGPC that relies on the prefetching on this level (though if they had wanted to be a bit evil they could've easily added code that would cause games to lock up in any emulator that doesn't emulate the prefetching accurately Tongue ). This was just something that picked my interest when I saw it mentioned in various reference manuals, and I wondered whether there were any emulators that actually emulates this - and how I could test whether they do.
Reply
#4
There's a guy that recently contacted me about wanting a Flash Masta bundle. In his email, he said, "My "final" goal is to write a much more accurate emulator than NeoPop and do some homebrew work."

So, I guess there may be an emulator in the works.

Also, you guys ought to know about the RACE! emulator. I know it doesn't get a lot of mention, but it is a good one.
http://sourceforge.net/projects/koyote-l...land/RACE/

The main problem is that it was never a great emu on the PC. However, it was quite nice on other handhelds like the PSP.
http://psp.akop.org/race
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#5
MESS doesn't even display something Sad

I guess I got work to do Smile

By the way, did you test this on a color or a mono unit?
Reply
#6
The tests rely on register bank switching working correctly (the INCF instruction is being used to switch to the next register bank, and registers in other banks are also referenced explicitly).
And since self-modifying code is used in the tests they'll fail in any emulator that does some sort of dynarec CPU emulation and doesn't recompile an already compiled block if it's being written to.
Reply
#7
[Image: ngpc_ngp_iq.png]
Reply
#8
What did you have to fix?
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#9
I simply implemented the actual prefetch queue Wink
Reply
#10
That's cool.

Two things I haven't figured out how to test yet:
* When exactly a byte in the instruction queue is discarded / marked as free. The 900-series is supposed to have a 3-stage pipeline, which I assume to mean Fetch->Decode->Execute. But whether or not all bytes in the queue belonging to the currently executing instruction are discarded before the Execute stage begins is something I don't know for sure.
* The order of prefetching and memory transfer in a microDMA transfer. The documentation states clearly that the first two states of a microDMA transfer are spent prefetching code unless the instruction queue is full, but to create a test to demonstrate this is kinda difficult since it needs to be synchronized perfectly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)