==== Clock sequence : mirror VRAM (performance) ====
In order to get a better external RAM performance, and getting more luck about porting my project into others FPGA platform, I do now use a "Mirror VRAM" : external is just used by Z80 read and write (no more clock sequence finally ^^'). And a write in video RAM zone (like "poke &C000,255") does just write also in another parallel RAM, a FPGA internal RAM, that I call VRAM, this VRAM can be written at a certain speed and read at another for VGA purpose (FPGA internal RAM can be used like that)
=== How to tickle JavaCPC ===
JavaCPC is developed in Java, and Java is so cool (Java is better computer language ever, and VHDL is better FPGA language ever =P)
I tickle JavaCPC in order to compare its components to my ones.
==== Emulator Architecture ====
while (¡stop_emulation)
{
executeCPU(cycles_to_execute);
generateInterrupts();
emulateGraphics();
emulateSound();
emulateOtherSoftware();
timeSincronization();
}
Figura 2. Basic Emulator Algorithm.
Extracted from the book [[http://www.scribd.com/doc/53571848/27/Appendix-A-Space-Invaders-i8080-tutorial]],
Using this way, emulators reach a better running time. They don't need to implement the system-bus architecture[[http://en.wikipedia.org/wiki/System_bus]] (CONTROL DATA ADDRESS) crossing Von Neumann architecture[[http://en.wikipedia.org/wiki/John_von_Neumann]] (CU ALU MEM IO).
==== Component Architecture ====
Java is an object language, so having new, set, get, for each of its objects.
A Component Architecture in object language has a special cycle life :
*Build all components (new new new new new)
*Plug all components together (set set set set set)
*Run a main component.
Main component is Z80 on JavaCPC. In fact, JavaCPC's Z80 is already configured in order to run each instruction with a certain timing : a timing already synchronized with CRTC (each instruction takes 4 Tstates or 8 Tstates, Z80@4MHz CRTC@16bit@1MHz so drawing 8 colored pixels on mode 1 takes 4 Tstates)
My main component is [[#Clock_sequence]]
In real Amstrad, main component is GateArray.
The fact of choosing Z80 as main component just respects the emulation architecture.
==== Java debug mode ====
You can run JavaCPC on debug mode in Eclipse, and insert breakpoints.
It's useful for listening wires, and cut them. You can in live pause debug, cut a function and continue run.
==== Cut a wire, cut a function ====
Wire are done for sending message, a message in programming is a function call.
When we cut a input wire, we generally plug it to GND or Vcc.
For cutting a function, you have to insert a cut on it. A cut it's a return. You can insert a (very bad) forcing cut as:
if (1==1) return 0;
everywhere. So function is ended at this moment and next lines became death code. It exists quality code program for checking death code, because it's generally a bug of development, normally we put code in comment.
It is the way I used in order to induce JavaCPC, comparing it with my project.
=== USB joystick ===