![Surprised :o](./images/smilies/icon_eek.gif)
That's such a great moment...
![Image](http://www.assemblergames.com/phpbb2/images/smiles/022.gif)
Hope that it helps Stef D as much as I think.
Chris
Thanks for the linkDcSteve wrote:Sayten himself gave me the link to his unfinished z80 sh4 core. It has a basic exec loop, and has ~ 1/2-2/3 of the opcodes implemented. He didn't implement opcodes as he needed them. He took the opcode list for the z80 and started at the top and worked his way down. While he's tested what he's written and it seems to work ok, he hasnt actually used the core in anything real. Its not pretty or fast. Just a basic interpreted cpu emu. He figured max speed on a dc was about 20MHz. Here is his work.
http://www.wolfnet.org/~jkf/dc/src/dc_z80.tar.gz
As i done in C68K : in a standard CPU emulator, you store the current PC of emulated cpu in a variable (register is better) we can just call "PC"Warmtoe wrote:Stef,
I made an initial stab at doing z80 work with a jump table - it's working but I have only implemented a fraction of the opcodes at the moment .
How do you remove the call for each fetch though? I will carry on with my hack - I'm sure yours will be much better - but I don't see how you can eliminate the fetch. One thought I had is to use the much-maligned cache to speed things up - by pointing it at the location that represents the current PC for the z80 - will that help?
Anyway - any insight!
It still sucks - I'm not going to release it until it sucks a lot less - don't fret, it will get out - but it's just not worth it at the moment. Remember too that others are working on bits for this:-DcSteve wrote:warmtoe- how do you have sound working now? Does it still loop like it did in preview 3?
Code: Select all
// nAddr is unsigned int with memory address
unsigned int char nFirstByte = nAddr >> 8;
unsigned int nSecondByte = nAddr & 255;
switch (nFirstByte)
{
case 0x60:
switch (nSecondByte)
{
// do bank register stuff
}
break;
case 0x70:
switch (nSecondByte)
{
// i/o stuff here
}
break;
default:
if (nFirstByte <= 0x40)
// RAM
else
// banked area
}