README
1Only in this directory hardware further auxilary programs may be maintained.
2If z80-mon is running, the files .CPU and --- in the case hardware/port_buffer
3is linked to z80-mon --- .Z80_ports are updated by z80-mon.
4Asynchronly other tasks/threads may use these files to read the Z80-CPU status
5via .CPU or even exchange data with the Z80-CPU or other hardware
6components via .Z80_ports . The following first five example programs
7demonstrate this technique using this two interface files.
8
9In contrast the five last example sources are linked into z80-mon if this
10is enabled in the Makefile. They represent true real-world hardware which runs
11synchroniously with the z80-mon. Typically necessary calls are included via
12#defines in z80-mon.c , hardware/system_wired , hardware/includes and
13perhaps in hardware/quartz.c .
14In z80-mon.c look at reset_cpu() also to initialize your special hardware if
15necessary.
16The file hardware/includes contains all necessary include files for z80-cpu.c
17and z80-mon.c .
18The file hardware/system_wired is appended at the end of the function
19 set_cpu_pin in z80-cpu.c for directly wired hardware.
20In hardware/quartz.c the single clock ticks can be observed by your hardware!
21Moreover the whole data-, address- and controlbus is accessable by including
22 z80-cpu.h in your special hardware emulation. Use the cpu-pins busrq and
23 busack to get/check bus control. To manipulate the busses put your code
24into hardware/bus_masters (don't forget to release bus_req if finished!).
25
26
27Firstly there are two example implementations of buffered port usage:
28
29 * hardware_clock uses ports 0x1c, 0x1d, 0x1e, 0x1f
30 to write the current time in seconds elapsed since z80 system start.
31 to these four ports (lower bytes to lower ports)
32
33 * lcd_display uses ports 0x0a and 0x0b and stdout
34 and runs in an ascii-terminal with 4*8+1 lines and 2*6*20 columns
35
36Secondly, two auxilary programs to maintain the ports:
37
38 * make_ports create the file Z80_PORTS and initialze these to 0
39
40 * port_io is a simple user interface to read or write a port
41
42Thirdly, a program to monitor the cpu online:
43
44 * monitor_cpu displays all data inside the CPU in real time
45
46Lastly an example of a bank layout file (from TI-86 pocket computer):
47
48 * banks-ti86 defines 16 ROM banks and 8 RAM banks on port 0x05 and 0x06.
49
50
51Finally, there are different hardware circuits for Z80-Systems directly wired:
52
53 * a quartz (the internal oscillator is a bit faked :)
54
55 * a port_buffer buffering the last value for each port (to enable asychcron
56 access by external programs)
57 * a daisy_chain for interrupt queueing of different hardware components
58
59 * a simple logic analyzer to observe the Z80-CPU pins with tick resolution
60
61 * a Z80-CTC: you should improve and debugg it [synchronized with quartz] :)
62
63
64Have fun,
652005-06-10
66