Omnimaga

Calculator Community => Casio Calculators => Topic started by: AngelFish on April 24, 2011, 04:39:36 pm

Title: SuperH emulator
Post by: AngelFish on April 24, 2011, 04:39:36 pm
A little internet research turned up this gem of a program. I'm not sure what its capabilities are or exactly what CPU it emulates, but it's still almost certainly useful. Enjoy  :)

http://www.lauterbach.com/cgi-bin/download.pl?file=simsh.zip (http://www.lauterbach.com/cgi-bin/download.pl?file=simsh.zip)
Title: Re: SuperH emulator
Post by: Munchor on April 25, 2011, 09:38:50 am
Will this actually work as a PRIZM Emulator? Or not really?
Title: Re: SuperH emulator
Post by: JosJuice on April 25, 2011, 09:49:08 am
Will this actually work as a PRIZM Emulator? Or not really?
Not really, but maybe someone can expand it to make it work as one. Currently it seems like it only emulates the CPU and nothing else.
Title: Re: SuperH emulator
Post by: AngelFish on April 25, 2011, 01:03:10 pm
This won't work as a Prizm emulator in the least. It's just a way of simulating the CPU that happens to be immensely useful for testing programs that would otherwise be difficult to test.
Title: Re: SuperH emulator
Post by: z80man on April 26, 2011, 01:44:31 am
Just as an emulator of the cpu it is very simple and I almost have all of the cpu up in my emulator. The more complex part of it are all of the nice debugging features in which I did plan on adding. The more complex part of any emulator are the peripherals which need to function just like the originals. 
Title: Re: SuperH emulator
Post by: DJ Omnimaga on May 12, 2011, 05:43:31 pm
THis is interesting. Hopefully this could make the development of an actual emulator much easier.
Title: Re: SuperH emulator
Post by: z80man on May 13, 2011, 02:11:21 am
I found that my current code for the core emulation is faster because I now have inline asm than that emulator, but it does provide extremely valuable code for the hardware and memory which is 80% of the emulator.
Title: Re: SuperH emulator
Post by: DJ Omnimaga on May 23, 2011, 12:10:39 am
That's cool to hear. Hopefully maybe we could manage to have an emulator that isn't too much resource-demanding, especially when emulating the calc in 116 MHz mode.
Title: Re: SuperH emulator
Post by: AngelFish on July 12, 2011, 05:57:39 pm
Okay, the Trace32 simulator I linked in the first post works. Here's how you can load files:

Take your .bin files from assembly/compilation and change the extension to .hex. After you do that, open up the simulator and hit File>Load. This will bring up a file dialog that will allow you to open up your file. Then, do View>List Source and View>Registers. Change PC to 0 and your binaries should be loaded into the source window. You can then step through them as you wish.

EDIT: Okay, I've been trying to track down a bug that I thought was in Khavi for about 4 hours now. Turns out, the simulator itself is pretty bugged and Khavi is fine. The simulator doesn't handle indirect moves very well. For example, the following code won't work:

Code: [Select]
mov.l @(0x01,PC),r1
rts
.long 0xDEADBEEF

The simulator will place 0x01 into register r1, not the value 0xDEADBEEF.

*Edit* Removed duplicate paragraph