Changes

FPGAmstrad

2,004 bytes added, 14:46, 20 July 2011
/* Agile method */
Real Amstrad use buffer memory in front of each address and data access, and real z80 is clock low state active. Normally if you follow datasheet of z80 you know how to map memory following CU comportment. Or you do as Amstrad, saying that z80 CU sucks, I create my own sequencer, managing all my memories access, alternating CRTC work and z80 work with little synchronization, insert by the way more pixels that can support my small CRTC...
 
=== 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)
==== 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]],
 
==== Component Architecture ====
Java is 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, Z80 is already configured in order to run each instruction with a certain timing, timing already synchronized with CRTC.
 
My main component is [[#Clock_sequence]]
 
In real Amstrad, main component is GateArray.
 
Choosing Z80 as main component just respect the classic emulation architecture.
 
==== Java debug mode ====
 
You can run JavaCPC on debug mode in Eclipse, and insert breakpoint.
 
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, an 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 line 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.
=== Why NEXYS2 500kgates starter kit ===
1,200
edits