Edit: The latest version (NikonEmulator v2.49) is available here
(requires Java 1.7). More info and help about the emulator is available on this wiki page
(Obsolete versions, including the last FrEmulator v1.98 compatible with Java 1.6, are archived here
I think it's time to share the tool I'm working on for the last few weeks: a Fujitsu Fr processor Emulator.
Basically, what it does is load the firmware (after decoding it first if needed) and run it, behaving exactly like the processor would. Currently, only two components are correctly emulated: the Processor and the Memory space.
The emulator can be paused, resumed, or restarted, and the delay between instructions can be selected.
A few windows are available for debugging:
- CPU State: shows all CPU internal registers. Once the emulator is paused, values can also be modified for testing.
- Memory Hex Viewer. Once the emulator is paused, values can also be modified for testing.
- Real-time disassembly.
- Screen emulator: should present what would be on the screen (currently black unfortunately, see next post) Edit: fixed in 1.52
- Visual memory activity viewer. A few words about it: each pixel in the first big black square represents the "pages" (64k pixels x 64k bytes/page). The R/G/B components are incremented each time a byte is resp. Stored/Loaded/Executed in the given page. The big red line is the result of the "clear memory" routine. The yellow (= Red+Green) on the left around 0x68000800 is the stack which is constantly read and written. If you want to zoom into a given page, just click on the corresponding "page pixel". A smaller black square appears, with the same logic, except that this time, each pixel is one byte. If you zoom on the "screen area", you see it almost black because each byte has been written only once, so the RGB is (1,0,0). In the stack area, however, the same line can be seen even when zooming in because the program reads and writes the same addresses all the time.
Of course, this is based on many software components I didn't write myself (see About box for more information), the most important being Dfr for the disassembly, and its port to C# by Simeon.
Well, speaking of languages, as you guess by the look and feel of the application, this is 100% java. The good thing is it is portable and easy to understand. The bad thing is that it is not the fastest language (you could be surprised, but in any case, I'm not looking for speed).
Another bad aspect that I'm aware of is that Java hasn't been cited until now in this project... Sorry, I don't intend to exclude anyone or start a language war of course, but Java is the language I'm using everyday and I can code at least 5 times faster in Java than .Net, and probably 20 times faster than in any other language.
I hope this tool can help us understand things a bit further, and if we can emulate other components, it could also be used as a testbed to validate modifications without any risk (no bricks policy
The binary and source distributions are attached below.
Usage is straightforward if you have a Java Virtual Machine installed (and java.exe is in your path): unzip the binary and run the batch file (for Windows), or just run the equivalent command on other platforms.
(by the way, other executable parts are also included, such as the full Dfr disassembler (Java port), Unit tests for all FR instructions, and so on).
Hope you'll have as much fun using it as I did writing it. Any comment is welcome of course.
PS: I chose to distribute it under GPL. Simeon, maybe we could host it on Google code if you like