-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTODO
More file actions
219 lines (153 loc) · 6.62 KB
/
TODO
File metadata and controls
219 lines (153 loc) · 6.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
- fix Elite
- implement colour border
- honour the colour in SNA format
- infer filename format (SNA, z80) from extension
- drop format arg
DONE - find out which instruction is pausing
- DJNZ error
DONE - jetpac works
- just too fast
- need to work on timings/t-states
- maybe have single goro and 'wait until T-state X'?
- yes, have main loop:
- keep track of t-states
- everything in terms of t-states
- machine supplies intervals (in t-states) and callbacks (method callbacks on speccy obj)
- speccy provides 50 Hz hw interrupt
- that resets scan position
- speccy provides per-byte interrupt http://www.zxdesign.info/vidparam.shtml
- which is NOP unless painting screen
- returns number of t-states 'taken'
- careful - if processor is halted, we don't want to account for these
- make screen refresh per-line and interleave t-states
- better LD tstate handling
DONE - keyboard handling:
func keyboardByte(addrHi byte, keysDown []keys) byte
is a pure func which can be tested :-)
also, a 'key' is/should have an 'addr bit' and a 'data bit', and the above function
is a fairly simple combination of those
i.e. don't loop over all possible keys and see if they are depressed
- 256x256 memory visualiser
- read/write/execute (RGB :-)
- "PRESS ANY KEY" in arnhem is running IN A, (0xFE)
- which keyboard port should that read? all of them?
- http://faqwiki.zxnet.co.uk/wiki/ZX_Spectrum_ULA
"IN from port xxFE will read the keyboard state and tape input. Each bit of the high byte selects a keyboard half-row; that row is read if the bit is low. If a key is pressed on any selected half-row, the corresponding bit of the data byte is low; this accounts for bits d0–d4. d6 is the value at the EAR socket (polarity?); d5 and d7 are not used. "
- so LD A, 0 : IN A, (0xfe) has all high byte bits low, reads all keyboard ports
- hanging loop is using HALT to wait for an interrupt
- should interrupt return after HALT
- and inspects system variable incremented during interrupt (FRAMES)
- hanging loop is reading from system variable FRAMES (0x5c78)
which should be being updated every 20ms
- BEEP code is doing DI, should that stop IM1 interrupt?
- add debugging hooks
- callbacks or channels for execution info
- and for control (set breakpt at addr X, single-step, set execution speed)
- expose those channels/controls over http/json (websocket)
- write debugging UI which drives http api
- language/ui toolkit?
- post-process err output (equivalent to getting step-by-step debugging)
to visualise or feed into a visualisation tool
- or add call/ret tracing to emulator
- use debugger to work out what is going on with arnhem hang
- races:
- if we want to remove them, we'd have to have screen refresh properly isolated
(as well as keyboard?)
- the correct way would be either a lock on peek/poke/peekbuf or an actor
(r/w, addr)
- hang happens while running sound
- with interrupts disabled
- is there an NMI expected to break the loop?
- add IM 0
- add beep/border colour output port support
DONE - IM 2
- diagnose 'hang' when playing games
- CPU is still running
- look at before/after difference of hang
- start with PC
- remove races
- add PC/mem visualisation
- show memory
- use watchfunc (need to add read/write flag, add to read)
- reads and writes (decaying colour change? r == write g == read)
- stack will look nice
- different colour (b) for PC?
DONE - implement colour attributes
DONE - implement flash (every 32 refreshes)
DONE - sort out state setup/load (EI frigged in on Run)
- remove 'z80' from methods on file/z80 and make it an interface
suitable for different load types
DONE - scale (3x) screen
DONE - saying 'n' to scroll causes exit
DONE - need to map 'backspace' key to something useful
- perhaps map more convenience keys (e.g. ")
- just do SDL key "backspace" depresses multiple spectrum keys
DONE - create a 'machine' interface
- CP/M and Speccy
- loaded by zog
- start on spectrum hardware
DONE - add hardware interrupt hook
- ei/di
- im 0/1/2
DONE - how does machine run interrupt?
// load ROMs, start hardware (including interrupt goro, screen refresh)
DONE - machine.Start(z)
DONE - add keyboard IO ports
- work out how to interrupt main loop to do screen refresh
(happens progressively)
DONE YES (maybe just have a 'tick' function to update screen)
DONE (and call that in a time loop to start with)
DONE - try loading a ROM
DONE - will need read-only memory at some pt
- could trigger "which key is being pressed" from input handlers
- will work better for games
- Fix remaining z80test problems
DONE - ldi/ldir/etc
- LD A, I : LD A, R
- super ops
- add some kind of ULA interrupt to read memory and display image
- use SDL to draw image
DONE - write spectrum-like print routines for z80test
- find (and remove boilerplate) of the F_Z/F_S etc setting
- zexall
- huh. of course CRC is only compared at the end of the run, so don't know
which instruction in the batch error'd the CRC...
- bug:
RES/SET use InstU8 hence set S+Z flags
(CP uses explicit save/restore to avoid)
- impl add/adc16 with same exec helper
- see if it passes zexall adc
- performance
- don't allocate an executeTrace in each instruction execution
instead, re-initialise the slot in the haltTrace ring buffer
(different re-init may have different perf characteristics. e.g. map is normally entry
or small, may be worth scan+delete rather than re-alloc empty)
DONE - redo mem watches as callback
- so can hook into ET without checking every instruction
- consider working labels in assembler
- JP foo, JR foo, LD A, (foo)
- grab a ROM and see where it dies! (spectrum-roms ubuntu pkg)
- try and find some example programs
- write a test rom/prelude of some kind
- use it if cmdline to execute given
DONE - CP/M has simple I/O for zexall
- add 'zexall/cp/m support' option
- write some Z80 assembly
- drive an I/O port to write chars
- register I/O handlers
- write enable-able logging streams (e.g. 'Z:' logging for locations)
- tagged logging streams?
- spin up http server (gop?)
- serve machine state (num cycles, registers, ...?) over http
- ? serve zx spectrum display image over ws?
- emulator
- implement some debug hook (zexall compatible)
- conout to write to console
- RST 16 :-)
- jp 0 to "reboot cp/m"
- zexdoc
- zexall
- add cmdline disassembler
- try on some big files
- add (made up) labels for jump targets in disassembler
- add some directives (org, data bytes)