There is reason why I'm building it from scratch.
I want
different system.
As I mentioned in wiki, I want to implement Cycle step emulation.
What does it mean? I know, may be it's mad, but whatever...
Cycle step emulation would be implemented in such way:
Code: Select all
while(true)
{
m68k_update();
vdp_update();
z80_update();
ym2612_update();
}
It's pseudocode. Did you notice, that there is no cycles argument. That is IT! Main point of whole approach. It advancing by exactly one cycle. No more, no less.
What about accuracy? I didn't say that it will be cycle accurate. I want to achieve only one thing: it will emulate in perfect sync. As you can see, from implementation, all chips advancing exactly by one cycle. You don't need any synchronization, and you don't need any threads.
Also, it's how hardware actually works. It's strictly synchronized by clock pulse. There is nothing parallel. It's more synchronized than parallel if you think for a while.
I need to write from scratch, or rewrite almost all code.
I don't like "rewrite almost all code" for two reasons:
1) It would still have all collaborators from past in dependency. Don't blame me, but I think of it as some "garbage".
2) Some code, that wasn't rewrited, would be difficult to see. I want full image of emulator work.
I have done some analysis about current most popular code. And, today I even view some of your code of BlastEm. But I haven't found any emulator with system what I want to implement.
Also, as feature, it will support save states at certain clock.
I know, all this is mad. But, I hope, it might work GREAT!
If it will be slow, as Exodus for example

.
Don't be afraid, I'll do my best to speed up it with dirty hacks

.
I don't need slow emulator.
By the way, there is my first bunch of code. I'm going sleep.
As I understand, your M68k implementation using recompilation from M68k into x86. It's not good for me because I want:
1) Cross platform
2) Cycle step
Recompiling idea is to gain speed from native x86 code emulating multiple opcodes in row.
But, as I mentioned before I need to change context very frequently.
M68k->VDP->Z80->YM2162... (I don't know correct order).