OpenCores
URL https://opencores.org/ocsvn/z3/z3/trunk

Subversion Repositories z3

[/] [z3/] [trunk/] [instructions.txt] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 charcole
BUILDING THE BIOS
2
-----------------
3
 
4
TO BUILD PATCHED INFORM 6
5
 
6
Clone the git repository of...
7
https://github.com/charcole/Inform6.git
8
 
9
git checkout inform6b
10
clang -O3 *.c -o inform6b.out
11
 
12
 
13
ASSEMBLE THE ROM
14
 
15
Obtain 4 Z machine V3 games that are less than 120Kb. Update the roms array in
16
combinedata.c to reference the games you are using. The first game in the
17
array must be around 90Kb (like Zork I) as the icons are stored in this space.
18
 
19
cd bios
20
clang makefont.c -o makefont.out && ./makefont.out
21
clang -O3 compressicon.c -o compressicon.out && ./compressicon.out
22
clang -O3 combinedata.c -o combinedata.out && ./combinedata.out
23
inform6b.out -v3 -t -l -y bios.inf
24
 
25
To alter font, load zfont2.xcf in the GIMP. Alter the image as needed. Bottom
26
row is for specifying how wide each character should be. Save image as
27
zfont2.h. Recompile and run makefont.out.
28
 
29
To alter icons, create an image 100x480 in the GIMP. Make indexed using 128
30
colour palette. Save as icons.h. Recompile and run compressicon then
31
combinedata. The compression ratio achieved must be better than around 60% to
32
fit after Zork I.
33
 
34
 
35
 
36
SIMULATING
37
----------
38
 
39
I used: Icarus-0.8.1-2005Sep12
40
 
41
Make sure you'll built the BIOS and it's in the same directory you are going
42
to run the Verilog simulation in.
43
 
44
iverilog z3.vl && ./a.out
45
 
46
If you want to run passed first request for input then touch.txt can be
47
generated using TouchGenerator in the utilities. Using this a script can be
48
provided which can be typed automatically during the simulation.
49
 
50
To check screen output Screen (in utilties) can be run on the output from
51
a.out. You may have to remove this section from the z3.vl...
52
 
53
                if (b.operNum==`OP_VAR && b.op==`OPVAR_BLIT1 && b.phase==0 && b.state==`STATE_DO_OP) begin
54
                        b.operand[1]=1;
55
                end
56
 
57
Another way of checking output is to look at ram.dat. At the end it contains
58
the scroll back buffer from the BIOS decoded and can be viewed in a text
59
editor.
60
 
61
 
62
 
63
RUNNING ON HARDWARE
64
-------------------
65
 
66
THE HARDWARE
67
 
68
A "EP2C5 Cyclone II Mini Board" AKA "CycloneII EP2C5T144 Learning Board".
69
These contain an EP2C5T144 which is an Cyclone II FPGA with around 4600 LEs.
70
They are very reasonably priced on eBay (~$10).
71
 
72
'2.4" TFT LCD Shield' by http://mcufriend.com was used as a screen. Again very
73
cheap off eBay (~$3). It's a colour screen with resistive touch screen.
74
 
75
RS Part No. Part No.            Description                                                                     Price
76
7118029         A29L040-70F     Parallel FLASH 4MB, 512Kx8, 3V, DIP32       £1.24
77
7444542         AS6C1008-55PCN  SRAM,1M,128Kx8,55ns,3V,Low Power,DIP32      £1.65
78
6696064         MCP3008-I/P             A/D Converter 10Bit 8-ch 2.7V SPI PDIP16        £1.53
79
 
80
 
81
TO PROGRAM THE FPGA
82
 
83
Obtain Altera Quantus II 13.0sp1. I believe this was the last version to
84
support Cyclone II. Open project altera/ZMachine.qpf and hit compile.
85
Nb. ZMachine.v is identical to z3.vl.
86
 
87
 
88
TO PROGRAM THE ROM
89
 
90
Using a Minipro TL866CS
91
 
92
minipro -w rom.z3 -p "A29L040 @DIP32"
93
 
94
 
95
 
96
OPTIONAL EXTRAS
97
---------------
98
 
99
TO BUILD THE BENCHMARK
100
 
101
inform6.out -v3 -t -l -y benchmark.inf \$MAX_STATIC_DATA=20000
102
 
103
Nb. This is the unpatched version of Inform 6.
104
 
105
You can include this in as one of the games in combinedata.c.
106
 
107
 
108
TO BUILD UTILITIES
109
 
110
Z-Ops: High level emulator. Useful for working on the BIOS.
111
clang -framework SDL2 -F/Users/charlie/Library/Frameworks
112
-I/Users/charlie/Library/Frameworks/SDL2.framework/Headers -I../../lib -O3 -g zops.c ../../lib/cclib64.a -o zops.out
113
 
114
16BitColor: Takes hex colours and turns them into 16 bit needed by screen
115
eg. ./16bitcolor.out 0xffe1a2
116
clang 16bitcolor.c -o 16bitcolor.out
117
 
118
TouchGenerator: Takes script2.txt and generates a list of simulated touch data
119
to type out the script. Used to automatically test the simulation.
120
clang touchgenerator.c -o touchgenerator.out
121
 
122
MakeGradient: Makes gradient for Mandelbrot generator easter egg. Image is
123
from gradient.h saved from the GIMP as a header in indexed mode. Output needs
124
pasting into bios.inf.
125
clang -O3 makegradient.c -o makegradient.out && ./makegradient.out
126
 
127
Screen: Takes the output from the simulator and draws the resultant screen
128
output. Outdated now, use zops instead.
129
clang -framework SDL2 -F/Users/charlie/Library/Frameworks -I/Users/charlie/Library/Frameworks/SDL2.framework/Headers screen.c -o screen.out

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.