Commit 43de8fc

Nick committed on
Removing irrelevant units
commit 43de8fc663f58cafc72b4bdecbd3925f099ab207 parent cf7ee88
12 changed files +45−2834
ModifiedCpu/z80cpu.pas +1−1
@@ -3186,7 +3186,7 @@ end;
3186 function PFX_FD: byte; 3186 function PFX_FD: byte;
3187 begin 3187 begin
3188 // Writeln('[DEBUG] 0xFD Called, A = ', af.h); 3188 // Writeln('[DEBUG] 0xFD Called, A = ', af.h);
3189 if @FDCallback <> nil then FDCallback; 3189 if Assigned(@FDCallback) then FDCallback;
3190 Result := 0; 3190 Result := 0;
3191 end; 3191 end;
3192 3192
DeletedDebugger/UnitDebug.lfm +0−17
@@ -1,17 +0,0 @@
1 object frmDebug: TfrmDebug
2 Left = 286
3 Top = 173
4 BorderIcons = [biSystemMenu, biMinimize]
5 BorderStyle = bsSingle
6 Caption = 'Debugger'
7 ClientHeight = 391
8 ClientWidth = 531
9 Color = clBtnFace
10 Font.Charset = DEFAULT_CHARSET
11 Font.Color = clWindowText
12 Font.Height = -11
13 Font.Name = 'MS Sans Serif'
14 Font.Style = []
15 ShowHint = True
16 PixelsPerInch = 96
17 end
DeletedDebugger/UnitDebug.pas +0−37
@@ -1,37 +0,0 @@
1 {+-----------------------------------------------------------------------------+
2 | Author: Christian Hackbart
3 | Description: Debugger functions
4 | Copyright (c) 2000 Christian Hackbart
5 | last Changes: 31.10.2000
6 |
7 | http://www.tu-ilmenau.de/~hackbart
8 +----------------------------------------------------------------------------+
9 | nothing done yet :(
10 | - should be a dockable window
11 +----------------------------------------------------------------------------+}
12 unit UnitDebug;
13
14 {$MODE Delphi}
15
16 interface
17
18 uses
19 Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
20 debugger, StdCtrls, ComCtrls, Menus;
21
22 type
23 TfrmDebug = class(TForm)
24 private
25 { Private-Deklarationen}
26 public
27 { Public-Deklarationen}
28 end;
29
30 var
31 frmDebug: TfrmDebug;
32
33 implementation
34
35 {$R *.lfm}
36
37 end.
DeletedDebugger/UnitMapview.lfm +0−194
@@ -1,194 +0,0 @@
1 object frmMapview: TfrmMapview
2 Left = 214
3 Top = 202
4 BorderStyle = bsToolWindow
5 Caption = 'Map View'
6 ClientHeight = 360
7 ClientWidth = 501
8 Color = clBtnFace
9 Font.Charset = DEFAULT_CHARSET
10 Font.Color = clWindowText
11 Font.Height = -11
12 Font.Name = 'MS Sans Serif'
13 Font.Style = []
14 PixelsPerInch = 96
15 object Shape1: TShape
16 Left = 341
17 Top = 168
18 Width = 33
19 Height = 25
20 end
21 object Shape2: TShape
22 Left = 381
23 Top = 168
24 Width = 33
25 Height = 25
26 end
27 object Shape3: TShape
28 Left = 421
29 Top = 168
30 Width = 33
31 Height = 25
32 end
33 object Shape4: TShape
34 Left = 461
35 Top = 168
36 Width = 33
37 Height = 25
38 end
39 object Address: TLabel
40 Left = 344
41 Top = 280
42 Width = 69
43 Height = 13
44 Caption = 'Tile address = '
45 end
46 object R0: TLabel
47 Left = 344
48 Top = 200
49 Width = 26
50 Height = 13
51 Caption = 'R=31'
52 end
53 object G0: TLabel
54 Left = 344
55 Top = 216
56 Width = 26
57 Height = 13
58 Caption = 'R=31'
59 end
60 object R1: TLabel
61 Left = 384
62 Top = 200
63 Width = 26
64 Height = 13
65 Caption = 'R=31'
66 end
67 object G1: TLabel
68 Left = 384
69 Top = 216
70 Width = 26
71 Height = 13
72 Caption = 'R=31'
73 end
74 object R2: TLabel
75 Left = 424
76 Top = 200
77 Width = 26
78 Height = 13
79 Caption = 'R=31'
80 end
81 object G2: TLabel
82 Left = 424
83 Top = 216
84 Width = 26
85 Height = 13
86 Caption = 'R=31'
87 end
88 object R3: TLabel
89 Left = 464
90 Top = 200
91 Width = 26
92 Height = 13
93 Caption = 'R=31'
94 end
95 object G3: TLabel
96 Left = 464
97 Top = 216
98 Width = 26
99 Height = 13
100 Caption = 'R=31'
101 end
102 object Number: TLabel
103 Left = 344
104 Top = 264
105 Width = 64
106 Height = 13
107 Caption = 'Tile number ='
108 end
109 object HFlip: TLabel
110 Left = 344
111 Top = 296
112 Width = 44
113 Height = 13
114 Caption = 'HFlip=No'
115 end
116 object VFlip: TLabel
117 Left = 408
118 Top = 296
119 Width = 43
120 Height = 13
121 Caption = 'VFlip=No'
122 end
123 object B3: TLabel
124 Left = 464
125 Top = 232
126 Width = 26
127 Height = 13
128 Caption = 'R=31'
129 end
130 object B2: TLabel
131 Left = 424
132 Top = 232
133 Width = 26
134 Height = 13
135 Caption = 'R=31'
136 end
137 object B1: TLabel
138 Left = 384
139 Top = 232
140 Width = 26
141 Height = 13
142 Caption = 'R=31'
143 end
144 object B0: TLabel
145 Left = 344
146 Top = 232
147 Width = 26
148 Height = 13
149 Caption = 'R=31'
150 end
151 object ZoomView: TGroupBox
152 Left = 344
153 Top = 8
154 Width = 145
155 Height = 153
156 Caption = 'Zoom View'
157 TabOrder = 0
158 object PaintBox2: TPaintBox
159 Left = 6
160 Top = 2
161 Width = 128
162 Height = 128
163 end
164 end
165 object TabControl1: TTabControl
166 Left = 8
167 Top = 8
168 Width = 321
169 Height = 345
170 TabOrder = 1
171 Tabs.Strings = (
172 '$9800'
173 '$9C00'
174 )
175 TabIndex = 0
176 OnChange = TabControl1Change
177 object Map: TGroupBox
178 Left = 8
179 Top = 24
180 Width = 305
181 Height = 313
182 Caption = 'Map'
183 TabOrder = 0
184 object PaintBox1: TPaintBox
185 Left = 6
186 Top = 2
187 Width = 288
188 Height = 288
189 OnMouseMove = PaintBox1MouseMove
190 OnPaint = PaintBox1Paint
191 end
192 end
193 end
194 end
DeletedDebugger/UnitMapview.pas +0−532
@@ -1,532 +0,0 @@
1 // GBColor does´nt work yet
2 unit UnitMapview;
3
4 {$MODE Delphi}
5
6 interface
7
8 uses
9 Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
10 ComCtrls, ExtCtrls, StdCtrls;
11
12 type
13 TfrmMapview = class(TForm)
14 Shape1: TShape;
15 Shape2: TShape;
16 Shape3: TShape;
17 Shape4: TShape;
18 Address: TLabel;
19 R0: TLabel;
20 G0: TLabel;
21 R1: TLabel;
22 G1: TLabel;
23 R2: TLabel;
24 G2: TLabel;
25 R3: TLabel;
26 G3: TLabel;
27 Number: TLabel;
28 HFlip: TLabel;
29 VFlip: TLabel;
30 ZoomView: TGroupBox;
31 PaintBox2: TPaintBox;
32 TabControl1: TTabControl;
33 Map: TGroupBox;
34 PaintBox1: TPaintBox;
35 B3: TLabel;
36 B2: TLabel;
37 B1: TLabel;
38 B0: TLabel;
39 procedure PaintBox1Paint(Sender: TObject);
40 procedure TabControl1Change(Sender: TObject);
41 procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState;
42 X, Y: integer);
43 private
44 { Private-Deklarationen}
45
46 public
47 { Public-Deklarationen}
48 procedure DoUpdate;
49 end;
50
51 var
52 frmMapview: TfrmMapview;
53
54 implementation
55
56 uses vars;
57
58 const
59 mapBase: word = $1800;
60 vidBase = $8000;
61
62
63 {$R *.lfm}
64
65 procedure TfrmMapview.PaintBox1Paint(Sender: TObject);
66 begin
67 DoUpdate;
68 end;
69
70 procedure TfrmMapview.DoUpdate;
71 var
72 bmp: TBitmap;
73
74 i, j, x, y: byte; // Tilepositions
75 n: word;
76
77 pal: byte;
78
79 tileptr: array[0..1] of byte;
80 bmpPtr0: pointer;
81
82 tile_addr: word;
83 bmpPtr0_index: word;
84
85 bit, bit0, bit1: byte;
86 c: word;
87 vflip, hflip: boolean;
88 begin
89
90 case m_iram[$FF40] and $48 of
91 $00:
92 begin
93 TabControl1.Tabs.Strings[0] := '$9800 (BG/Wnd)';
94 TabControl1.Tabs.Strings[1] := '$9C00';
95 end;
96 $08:
97 begin
98 TabControl1.Tabs.Strings[0] := '$9800 (Wnd)';
99 TabControl1.Tabs.Strings[1] := '$9C00 (BG)';
100 end;
101 $40:
102 begin
103 TabControl1.Tabs.Strings[0] := '$9800 (BG)';
104 TabControl1.Tabs.Strings[1] := '$9C00 (Wnd)';
105 end;
106 $48:
107 begin
108 TabControl1.Tabs.Strings[0] := '$9800';
109 TabControl1.Tabs.Strings[1] := '$9C00 (BG/Wnd)';
110 end;
111 end;
112
113 bmp := TBitmap.Create;
114 bmp.Width := 8;
115 bmp.Height := 8;
116 bmp.PixelFormat := pf24bit;
117 for y := 0 to 31 do
118 for x := 0 to 31 do
119 begin
120 vflip := False;
121 hflip := False;
122 if m_Iram[$FF40] and 16 > 0 then
123 n := m_iram[vidbase + mapBase + y * 32 + x]
124 else
125 n := 256 + shortint(m_iram[vidbase + mapBase + y * 32 + x]);
126
127
128 if gb_mode = cgb then
129 begin
130 if m_iram[vidbase + mapBase + y * 32 + x + $2000] and 8 > 0 then
131 Inc(n, 512);
132 vflip := m_iram[vidbase + mapBase + y * 32 + x + $2000] and $40 > 0;
133 hflip := m_iram[vidbase + mapBase + y * 32 + x + $2000] and $20 > 0;
134 end;
135 pal := m_iram[vidbase + mapBase + y * 32 + x + $2000] and 7;
136
137 for j := 0 to 7 do
138 begin
139 if vflip then
140 i := 7 - j
141 else
142 i := j;
143
144 if n >= 512 then
145 tile_Addr := vidbase + $2000 + (n - 512) * 16 + i * 2
146 else
147 tile_Addr := vidbase + n * 16 + i * 2;
148
149 tilePtr[0] := m_iram[tile_Addr];
150 tilePtr[1] := m_iram[tile_Addr + 1];
151
152 bmpPtr0 := bmp.ScanLine[j];
153 bmpPtr0_index := 0;
154
155 if hflip then
156 bit := 1
157 else
158 bit := 128;
159 for i := 0 to 7 do
160 begin
161 if tilePtr[0] and bit > 0 then
162 bit0 := 1
163 else
164 bit0 := 0;
165 if tilePtr[1] and bit > 0 then
166 bit1 := 2
167 else
168 bit1 := 0;
169 if hflip then
170 bit := bit shl 1
171 else
172 bit := bit shr 1;
173
174 if gb_mode <> cgb then
175 begin
176 case bit1 or bit0 of
177 0: c := 3 - m_Iram[$FF47] and 3;
178 1: c := 3 - (m_Iram[$FF47] shr 2) and 3;
179 2: c := 3 - (m_Iram[$FF47] shr 4) and 3;
180 3: c := 3 - (m_Iram[$FF47] shr 6) and 3;
181 end;
182 c := c * 255 div 3;
183
184 byte(PChar(bmpPtr0)[bmpPtr0_index]) := c;
185 Inc(bmpPtr0_index);
186 byte(PChar(bmpPtr0)[bmpPtr0_index]) := c;
187 Inc(bmpPtr0_index);
188 byte(PChar(bmpPtr0)[bmpPtr0_index]) := c;
189 Inc(bmpPtr0_index);
190
191 end
192 else
193 begin
194 c := bit1 or bit0;
195 byte(PChar(bmpPtr0)[bmpPtr0_index]) :=
196 (palramb[(pal shl 2) + c] and 31) shl 3;
197 Inc(bmpPtr0_index);
198 byte(PChar(bmpPtr0)[bmpPtr0_index]) :=
199 ((palramb[(pal shl 2) + c] shr 5) and 31) shl 3;
200 Inc(bmpPtr0_index);
201 byte(PChar(bmpPtr0)[bmpPtr0_index]) :=
202 ((palramb[(pal shl 2) + c] shr 10) and 31) shl 3;
203 Inc(bmpPtr0_index);
204 end;
205
206 end;
207 end;
208 PaintBox1.Canvas.Pen.Color := clSilver;
209 PaintBox1.Canvas.Brush.Color := clSilver;
210 PaintBox1.Canvas.Rectangle(x * 9, y * 9, x * 9 + 9, y * 9 + 9);
211 PaintBox1.Canvas.Draw(x * 9, y * 9, bmp);
212 end;
213 end;
214
215 procedure TfrmMapview.TabControl1Change(Sender: TObject);
216 begin
217 if TabControl1.TabIndex = 0 then
218 mapBase := $1800
219 else
220 mapBase := $1c00;
221 DoUpdate;
222 end;
223
224 procedure TfrmMapview.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState;
225 X, Y: integer);
226 var
227 i, j, n: integer;
228 vflp, hflp: boolean;
229 tile_Addr: word;
230 str: string;
231 p: integer;
232 tilePtr: array[0..1] of byte;
233 bit0, bit1, bit, c: byte;
234 rect: TRect;
235 r, g, b: byte;
236 begin
237 x := X div 9;
238 y := Y div 9;
239
240 vflp := False;
241 hflp := False;
242
243 if m_iram[$FF40] and 16 > 0 then
244 n := m_iram[vidbase + mapBase + y * 32 + x]
245 else
246 n := 256 + shortint(m_iram[vidbase + mapBase + y * 32 + x]);
247
248 if gb_mode = cgb then
249 begin
250 if m_iram[vidbase + mapBase + y * 32 + x + $2000] and 8 > 0 then
251 Inc(n, 512);
252
253 vflp := m_iram[vidbase + mapBase + y * 32 + x + $2000] and $40 > 0;
254 hflp := m_iram[vidbase + mapBase + y * 32 + x + $2000] and $20 > 0;
255 end;
256
257 p := m_iram[vidbase + mapBase + y * 32 + x + $2000] and 7;
258 Number.Caption := 'Tile number = ' + IntToStr(m_iram[vidbase + mapBase + y * 32 + x]);
259 if (n < 512) then
260 Address.Caption := 'Tile address = 0:' + IntToStr(n * 16 + $8000)
261 else
262 Address.Caption := 'Tile address = 1:' + IntToStr((n - 512) * 16 + $8000);
263
264 if HFlp then
265 HFlip.Caption := 'HFlip=Yes'
266 else
267 HFlip.Caption := 'HFlip=No';
268 if vFlp then
269 vFlip.Caption := 'VFlip=Yes'
270 else
271 vFlip.Caption := 'VFlip=No';
272
273 for j := 0 to 7 do
274 begin
275 if vflp then
276 i := 7 - j
277 else
278 i := j;
279
280 if n >= 512 then
281 tile_Addr := vidbase + $2000 + (n - 512) * 16 + i * 2
282 else
283 tile_Addr := vidbase + n * 16 + i * 2;
284
285 tilePtr[0] := m_iram[tile_Addr];
286 tilePtr[1] := m_iram[tile_Addr + 1];
287
288 if hflp then
289 bit := 1
290 else
291 bit := 128;
292 for i := 0 to 7 do
293 begin
294 if tilePtr[0] and bit > 0 then
295 bit0 := 1
296 else
297 bit0 := 0;
298 if tilePtr[1] and bit > 0 then
299 bit1 := 2
300 else
301 bit1 := 0;
302 if hflp then
303 bit := bit shl 1
304 else
305 bit := bit shr 1;
306
307 if gb_mode <> cgb then
308 begin
309 case bit1 or bit0 of
310 0: c := 3 - m_Iram[$FF47] and 3;
311 1: c := 3 - (m_Iram[$FF47] shr 2) and 3;
312 2: c := 3 - (m_Iram[$FF47] shr 4) and 3;
313 3: c := 3 - (m_Iram[$FF47] shr 6) and 3;
314 end;
315
316 Shape1.Brush.Color := ((((3 - m_iram[$FF47] and 3) * 255 div 3) shl 16) or
317 (((3 - m_iram[$FF47] and 3) * 255 div 3) shl 8) or ((3 - m_iram[$FF47] and 3) * 255 div 3));
318 Shape2.Brush.Color :=
319 ((((3 - (m_iram[$FF47] shr 2) and 3) * 255 div 3) shl 16) or
320 (((3 - (m_iram[$FF47] shr 2) and 3) * 255 div 3) shl 8) or
321 ((3 - (m_iram[$FF47] shr 2) and 3) * 255 div 3));
322 Shape3.Brush.Color :=
323 ((((3 - (m_iram[$FF47] shr 4) and 3) * 255 div 3) shl 16) or
324 (((3 - (m_iram[$FF47] shr 4) and 3) * 255 div 3) shl 8) or
325 ((3 - (m_iram[$FF47] shr 4) and 3) * 255 div 3));
326 Shape4.Brush.Color :=
327 ((((3 - (m_iram[$FF47] shr 6) and 3) * 255 div 3) shl 16) or
328 (((3 - (m_iram[$FF47] shr 6) and 3) * 255 div 3) shl 8) or
329 ((3 - (m_iram[$FF47] shr 6) and 3) * 255 div 3));
330
331 R0.Caption := 'R=' + IntToStr((3 - m_iram[$FF47] and 3) * 31 div 3);
332 G0.Caption := 'G=' + IntToStr((3 - m_iram[$FF47] and 3) * 31 div 3);
333 B0.Caption := 'B=' + IntToStr((3 - m_iram[$FF47] and 3) * 31 div 3);
334 R1.Caption := 'R=' + IntToStr((3 - (m_iram[$FF47] shr 2) and 3) * 31 div 3);
335 G1.Caption := 'G=' + IntToStr((3 - (m_iram[$FF47] shr 2) and 3) * 31 div 3);
336 B1.Caption := 'B=' + IntToStr((3 - (m_iram[$FF47] shr 2) and 3) * 31 div 3);
337 R2.Caption := 'R=' + IntToStr((3 - (m_iram[$FF47] shr 4) and 3) * 31 div 3);
338 G2.Caption := 'G=' + IntToStr((3 - (m_iram[$FF47] shr 4) and 3) * 31 div 3);
339 B2.Caption := 'B=' + IntToStr((3 - (m_iram[$FF47] shr 4) and 3) * 31 div 3);
340 R3.Caption := 'R=' + IntToStr((3 - (m_iram[$FF47] shr 6) and 3) * 31 div 3);
341 G3.Caption := 'G=' + IntToStr((3 - (m_iram[$FF47] shr 6) and 3) * 31 div 3);
342 B3.Caption := 'B=' + IntToStr((3 - (m_iram[$FF47] shr 6) and 3) * 31 div 3);
343
344 c := c * 255 div 3;
345
346 PaintBox2.Canvas.Brush.Color := ((c shl 16) or (c shl 8) or c);
347
348 with rect do
349 begin
350 Left := 16 * i;
351 Right := 16 * i + 15;
352 Top := 16 * j;
353 Bottom := 16 * j + 15;
354 end;
355 PaintBox2.Canvas.FillRect(rect);
356 end
357 else
358 begin
359 c := bit1 or bit0;
360 Shape1.Brush.Color := (((palramb[(p shl 2) + 0] and 31) shl 19) or
361 (((palramb[(p shl 2) + 0] shr 5) and 31) shl 11) or
362 (((palramb[(p shl 2) + 0] shr 10) and 31) shl 3));
363 Shape2.Brush.Color := (((palramb[(p shl 2) + 1] and 31) shl 19) or
364 (((palramb[(p shl 2) + 1] shr 5) and 31) shl 11) or
365 (((palramb[(p shl 2) + 1] shr 10) and 31) shl 3));
366 Shape3.Brush.Color := (((palramb[(p shl 2) + 2] and 31) shl 19) or
367 (((palramb[(p shl 2) + 2] shr 5) and 31) shl 11) or
368 (((palramb[(p shl 2) + 2] shr 10) and 31) shl 3));
369 Shape4.Brush.Color := (((palramb[(p shl 2) + 3] and 31) shl 19) or
370 (((palramb[(p shl 2) + 3] shr 5) and 31) shl 11) or
371 (((palramb[(p shl 2) + 3] shr 10) and 31) shl 3));
372 R0.Caption := 'R=' + IntToStr(palramb[(p shl 2) + 0] and 31);
373 G0.Caption := 'G=' + IntToStr(palramb[(p shl 2) + 1] and 31);
374 B0.Caption := 'B=' + IntToStr(palramb[(p shl 2) + 2] and 31);
375 R1.Caption := 'R=' + IntToStr(palramb[(p shl 2) + 3] and 31);
376 G1.Caption := 'G=' + IntToStr((palramb[(p shl 2) + 0] shr 5) and 31);
377 B1.Caption := 'B=' + IntToStr((palramb[(p shl 2) + 1] shr 5) and 31);
378 R2.Caption := 'R=' + IntToStr((palramb[(p shl 2) + 2] shr 5) and 31);
379 G2.Caption := 'G=' + IntToStr((palramb[(p shl 2) + 3] shr 5) and 31);
380 B2.Caption := 'B=' + IntToStr((palramb[(p shl 2) + 0] shr 10) and 31);
381 R3.Caption := 'R=' + IntToStr((palramb[(p shl 2) + 1] shr 10) and 31);
382 G3.Caption := 'G=' + IntToStr((palramb[(p shl 2) + 2] shr 10) and 31);
383 B3.Caption := 'B=' + IntToStr((palramb[(p shl 2) + 3] shr 10) and 31);
384
385 r := (palramb[(p shl 2) + c] and 31) shl 3;
386 g := ((palramb[(p shl 2) + c] shr 5) and 31) shl 3;
387 b := ((palramb[(p shl 2) + c] shr 10) and 31) shl 3;
388 PaintBox2.Canvas.Brush.Color := ((r shl 16) or (g shl 8) or b);
389 with rect do
390 begin
391 Left := 16 * i;
392 Right := 16 * i + 15;
393 Top := 16 * j;
394 Bottom := 16 * j + 15;
395 end;
396 PaintBox2.Canvas.FillRect(rect);
397 end;
398 end;
399 end;
400 end;
401
402 end.
403 //---------------------------------------------------------------------------
404 void __fastcall TMapWnd:: PaintBox1MouseMove(TObject * Sender,
405 TShiftState Shift, int X, int Y)
406 {
407 int x=X/9;
408 int y=Y/9;
409 int n;
410 int vflip=0;
411 int hflip=0;
412 if (m_iram[$FF40] and 16)
413 n={vid} m_iram[mapBase+y*32+x];
414 else
415 n=256+(int)((char){vid} m_iram[mapBase+y*32+x]);
416 if (cgb)
417 {
418 n+=({vid} m_iram[mapBase+y*32+x+$2000] and 8)?512:0;
419 vflip={vid} m_iram[mapBase+y*32+x+$2000] and $40;
420 hflip={vid} m_iram[mapBase+y*32+x+$2000] and $20;
421 }
422 int p={vid} m_iram[mapBase+y*32+x+$2000] and 7;
423 char str[32];
424 sprintf(str,'Tile number = $%2.2X',{vid} m_iram[mapBase+y*32+x]);
425 Number.Caption=str;
426 if (n<512)
427 sprintf(str,'Tile address = 0:$%4.4X',n*16+$8000);
428 else
429 sprintf(str,'Tile address = 1:$%4.4X',(n-512)*16+$8000);
430 Address.Caption=str;
431 sprintf(str,'HFlip=%s',hflip?'Yes':'No');
432 HFlip.Caption=str;
433 sprintf(str,'VFlip=%s',vflip?'Yes':'No');
434 VFlip.Caption=str;
435 for (int j=0;j<8;j++)
436 {
437 char* tilePtr=(n>=512)?( and {vid} m_iram[$2000+(n-512)*16+(vflip?(7-j):j)*2]):( and {vid} m_iram[n*16+(vflip?(7-j):j)*2]);
438 for (int i=0,bit=hflip?1:128;i<8;i++,hflip?bit shl =1:bit shr =1)
439 {
440 int b0=(tilePtr[0] and bit)?1:0;
441 int b1=(tilePtr[1] and bit)?2:0;
442 if (!cgb)
443 {
444 int c=b1 or b0;
445 switch (c)
446 {
447 case 0: c=3-m_iram[$FF47] and 3; break;
448 case 1: c=3-(m_iram[$FF47] shr 2) and 3; break;
449 case 2: c=3-(m_iram[$FF47] shr 4) and 3; break;
450 case 3: c=3-(m_iram[$FF47] shr 6) and 3; break;
451 }
452 Shape1.Brush.Color=(TColor)((((3-m_iram[$FF47] and 3)*255/3) shl 16) or (((3-m_iram[$FF47] and 3)*255/3) shl 8) or ((3-m_iram[$FF47] and 3)*255/3));
453 Shape2.Brush.Color=(TColor)((((3-(m_iram[$FF47] shr 2) and 3)*255/3) shl 16) or (((3-(m_iram[$FF47] shr 2) and 3)*255/3) shl 8) or ((3-(m_iram[$FF47] shr 2) and 3)*255/3));
454 Shape3.Brush.Color=(TColor)((((3-(m_iram[$FF47] shr 4) and 3)*255/3) shl 16) or (((3-(m_iram[$FF47] shr 4) and 3)*255/3) shl 8) or ((3-(m_iram[$FF47] shr 4) and 3)*255/3));
455 Shape4.Brush.Color=(TColor)((((3-(m_iram[$FF47] shr 6) and 3)*255/3) shl 16) or (((3-(m_iram[$FF47] shr 6) and 3)*255/3) shl 8) or ((3-(m_iram[$FF47] shr 6) and 3)*255/3));
456 char str[8];
457 sprintf(str,'R=%d',((3-m_iram[$FF47] and 3)*31/3));
458 R0.Caption=str;
459 sprintf(str,'G=%d',((3-m_iram[$FF47] and 3)*31/3));
460 G0.Caption=str;
461 sprintf(str,'B=%d',((3-m_iram[$FF47] and 3)*31/3));
462 B0.Caption=str;
463 sprintf(str,'R=%d',((3-(m_iram[$FF47] shr 2) and 3)*31/3));
464 R1.Caption=str;
465 sprintf(str,'G=%d',((3-(m_iram[$FF47] shr 2) and 3)*31/3));
466 G1.Caption=str;
467 sprintf(str,'B=%d',((3-(m_iram[$FF47] shr 2) and 3)*31/3));
468 B1.Caption=str;
469 sprintf(str,'R=%d',((3-(m_iram[$FF47] shr 4) and 3)*31/3));
470 R2.Caption=str;
471 sprintf(str,'G=%d',((3-(m_iram[$FF47] shr 4) and 3)*31/3));
472 G2.Caption=str;
473 sprintf(str,'B=%d',((3-(m_iram[$FF47] shr 4) and 3)*31/3));
474 B2.Caption=str;
475 sprintf(str,'R=%d',((3-(m_iram[$FF47] shr 6) and 3)*31/3));
476 R3.Caption=str;
477 sprintf(str,'G=%d',((3-(m_iram[$FF47] shr 6) and 3)*31/3));
478 G3.Caption=str;
479 sprintf(str,'B=%d',((3-(m_iram[$FF47] shr 6) and 3)*31/3));
480 B3.Caption=str;
481 c*=255;
482 c/=3;
483 PaintBox2.Canvas.Brush.Color=(TColor)((c shl 16) or (c shl 8) or c);
484 TRect r;
485 r.Left=16*i; r.Right=16*i+15;
486 r.Top=16*j; r.Bottom=16*j+15;
487 PaintBox2.Canvas.FillRect(r);
488 }
489 else
490 {
491 int c=b1 or b0;
492 Shape1.Brush.Color=(TColor)(((palramb[(p shl 2)+0] and 31) shl 19) or (((palramb[(p shl 2)+0] shr 5) and 31) shl 11) or (((palramb[(p shl 2)+0] shr 10) and 31) shl 3));
493 Shape2.Brush.Color=(TColor)(((palramb[(p shl 2)+1] and 31) shl 19) or (((palramb[(p shl 2)+1] shr 5) and 31) shl 11) or (((palramb[(p shl 2)+1] shr 10) and 31) shl 3));
494 Shape3.Brush.Color=(TColor)(((palramb[(p shl 2)+2] and 31) shl 19) or (((palramb[(p shl 2)+2] shr 5) and 31) shl 11) or (((palramb[(p shl 2)+2] shr 10) and 31) shl 3));
495 Shape4.Brush.Color=(TColor)(((palramb[(p shl 2)+3] and 31) shl 19) or (((palramb[(p shl 2)+3] shr 5) and 31) shl 11) or (((palramb[(p shl 2)+3] shr 10) and 31) shl 3));
496 char str[8];
497 sprintf(str,'B=%d',((palramb[(p shl 2)+0] and 31)));
498 B0.Caption=str;
499 sprintf(str,'B=%d',((palramb[(p shl 2)+1] and 31)));
500 B1.Caption=str;
501 sprintf(str,'B=%d',((palramb[(p shl 2)+2] and 31)));
502 B2.Caption=str;
503 sprintf(str,'B=%d',((palramb[(p shl 2)+3] and 31)));
504 B3.Caption=str;
505 sprintf(str,'G=%d',((palramb[(p shl 2)+0] shr 5) and 31));
506 G0.Caption=str;
507 sprintf(str,'G=%d',((palramb[(p shl 2)+1] shr 5) and 31));
508 G1.Caption=str;
509 sprintf(str,'G=%d',((palramb[(p shl 2)+2] shr 5) and 31));
510 G2.Caption=str;
511 sprintf(str,'G=%d',((palramb[(p shl 2)+3] shr 5) and 31));
512 G3.Caption=str;
513 sprintf(str,'R=%d',((palramb[(p shl 2)+0] shr 10) and 31));
514 R0.Caption=str;
515 sprintf(str,'R=%d',((palramb[(p shl 2)+1] shr 10) and 31));
516 R1.Caption=str;
517 sprintf(str,'R=%d',((palramb[(p shl 2)+2] shr 10) and 31));
518 R2.Caption=str;
519 sprintf(str,'R=%d',((palramb[(p shl 2)+3] shr 10) and 31));
520 R3.Caption=str;
521 int r=(palramb[(p shl 2)+c] and 31) shl 3;
522 int g=((palramb[(p shl 2)+c] shr 5) and 31) shl 3;
523 int b=((palramb[(p shl 2)+c] shr 10) and 31) shl 3;
524 PaintBox2.Canvas.Brush.Color=(TColor)((r shl 16) or (g shl 8) or b);
525 TRect rect;
526 rect.Left=16*i; rect.Right=16*i+15;
527 rect.Top=16*j; rect.Bottom=16*j+15;
528 PaintBox2.Canvas.FillRect(rect);
529 }
530 }
531 }
532 }
DeletedDebugger/debugger.pas +0−1404
@@ -1,1404 +0,0 @@
1 {+-----------------------------------------------------------------------------+
2 | Author: Christian Hackbart
3 | Description: basic Debugger functions
4 | Copyright (c) 2000 Christian Hackbart
5 | last Changes: 31.10.2000
6 |
7 | http://www.tu-ilmenau.de/~hackbart
8 +----------------------------------------------------------------------------+
9 | This Unit is based on YaSE written by myself a few years ago.
10 | It must be changed !! Because this debugger is based on a "real" Z80
11 | ED-Instructions can be removed, also a few other instructions.
12 +----------------------------------------------------------------------------+}
13
14 unit debugger;
15
16 {$MODE Delphi}
17
18 interface
19
20 type
21 format = record {Fr opcodes}
22 op: string[18];
23 leng: shortint
24 end;
25
26 const
27 major: array[0..255] of format = (
28 (op: 'nop'; leng: 0),
29 (op: 'ld bc,####'; leng: 2),
30 (op: 'ld bc,a'; leng: 0),
31 (op: 'inc bc'; leng: 0),
32 (op: 'inc b'; leng: 0),
33 (op: 'dec b'; leng: 0),
34 (op: 'ld b,##'; leng: 1),
35 (op: 'rlc a'; leng: 0),
36 (op: 'ex af,af'''; leng: 0),
37 (op: 'add hl,bc'; leng: 0),
38 (op: 'ld a,(bc)'; leng: 0),
39 (op: 'dec bc'; leng: 0),
40 (op: 'inc c'; leng: 0),
41 (op: 'dec c'; leng: 0),
42 (op: 'ld c,##'; leng: 1),
43 (op: 'rrc a'; leng: 0),
44 (op: 'djnz ####'; leng: -1),
45 (op: 'ld de,####'; leng: 2),
46 (op: 'ld (de),a'; leng: 0),
47 (op: 'inc de'; leng: 0),
48 (op: 'inc d'; leng: 0),
49 (op: 'dec d'; leng: 0),
50 (op: 'ld d,##'; leng: 1),
51 (op: 'rla'; leng: 0),
52 (op: 'jr ####'; leng: -1),
53 (op: 'add hl,de'; leng: 0),
54 (op: 'ld a,(de)'; leng: 0),
55 (op: 'dec de'; leng: 0),
56 (op: 'inc e'; leng: 0),
57 (op: 'dec e'; leng: 0),
58 (op: 'ld e,##'; leng: 1),
59 (op: 'rra'; leng: 0),
60 (op: 'jr nz,####'; leng: -1),
61 (op: 'ld hl,####'; leng: 2),
62 (op: 'ld (####),hl'; leng: 2),
63 (op: 'inc hl'; leng: 0),
64 (op: 'inc h'; leng: 0),
65 (op: 'dec h'; leng: 0),
66 (op: 'ld h,##'; leng: 1),
67 (op: 'daa'; leng: 0),
68 (op: 'jr z,####'; leng: -1),
69 (op: 'add hl,hl'; leng: 0),
70 (op: 'ld hl,(####)'; leng: 2),
71 (op: 'dec hl'; leng: 0),
72 (op: 'inc l'; leng: 0),
73 (op: 'dec l'; leng: 0),
74 (op: 'ld l,##'; leng: 1),
75 (op: 'cpl'; leng: 0),
76 (op: 'jr nc,####'; leng: -1),
77 (op: 'ld sp,####'; leng: 2),
78 (op: 'ld (####),a'; leng: 2),
79 (op: 'inc sp'; leng: 0),
80 (op: 'inc (hl)'; leng: 0),
81 (op: 'dec (hl)'; leng: 0),
82 (op: 'ld (hl),##'; leng: 1),
83 (op: 'scf'; leng: 0),
84 (op: 'jr c,####'; leng: -1),
85 (op: 'add hl,sp'; leng: 0),
86 (op: 'ld a,(####)'; leng: 2),
87 (op: 'dec sp'; leng: 0),
88 (op: 'inc a'; leng: 0),
89 (op: 'dec a'; leng: 0),
90 (op: 'ld a,##'; leng: 1),
91 (op: 'ccf'; leng: 0),
92 (op: 'ld b,b'; leng: 0),
93 (op: 'ld b,c'; leng: 0),
94 (op: 'ld b,d'; leng: 0),
95 (op: 'ld b,e'; leng: 0),
96 (op: 'ld b,h'; leng: 0),
97 (op: 'ld b,l'; leng: 0),
98 (op: 'ld b,(hl)'; leng: 0),
99 (op: 'ld b,a'; leng: 0),
100 (op: 'ld c,b'; leng: 0),
101 (op: 'ld c,c'; leng: 0),
102 (op: 'ld c,d'; leng: 0),
103 (op: 'ld c,e'; leng: 0),
104 (op: 'ld c,h'; leng: 0),
105 (op: 'ld c,l'; leng: 0),
106 (op: 'ld c,(hl)'; leng: 0),
107 (op: 'ld c,a'; leng: 0),
108 (op: 'ld d,b'; leng: 0),
109 (op: 'ld d,c'; leng: 0),
110 (op: 'ld d,d'; leng: 0),
111 (op: 'ld d,e'; leng: 0),
112 (op: 'ld d,h'; leng: 0),
113 (op: 'ld d,l'; leng: 0),
114 (op: 'ld d,(hl)'; leng: 0),
115 (op: 'ld d,a'; leng: 0),
116 (op: 'ld e,b'; leng: 0),
117 (op: 'ld e,c'; leng: 0),
118 (op: 'ld e,d'; leng: 0),
119 (op: 'ld e,e'; leng: 0),
120 (op: 'ld e,h'; leng: 0),
121 (op: 'ld e,l'; leng: 0),
122 (op: 'ld e,(hl)'; leng: 0),
123 (op: 'ld e,a'; leng: 0),
124 (op: 'ld h,b'; leng: 0),
125 (op: 'ld h,c'; leng: 0),
126 (op: 'ld h,d'; leng: 0),
127 (op: 'ld h,e'; leng: 0),
128 (op: 'ld h,h'; leng: 0),
129 (op: 'ld h,l'; leng: 0),
130 (op: 'ld h,(hl)'; leng: 0),
131 (op: 'ld h,a'; leng: 0),
132 (op: 'ld l,b'; leng: 0),
133 (op: 'ld l,c'; leng: 0),
134 (op: 'ld l,d'; leng: 0),
135 (op: 'ld l,e'; leng: 0),
136 (op: 'ld l,h'; leng: 0),
137 (op: 'ld l,l'; leng: 0),
138 (op: 'ld l,(hl)'; leng: 0),
139 (op: 'ld l,a'; leng: 0),
140 (op: 'ld (hl),b'; leng: 0),
141 (op: 'ld (hl),c'; leng: 0),
142 (op: 'ld (hl),d'; leng: 0),
143 (op: 'ld (hl),e'; leng: 0),
144 (op: 'ld (hl),h'; leng: 0),
145 (op: 'ld (hl),l'; leng: 0),
146 (op: 'halt'; leng: 0),
147 (op: 'ld (hl),a'; leng: 0),
148 (op: 'ld a,b'; leng: 0),
149 (op: 'ld a,c'; leng: 0),
150 (op: 'ld a,d'; leng: 0),
151 (op: 'ld a,e'; leng: 0),
152 (op: 'ld a,h'; leng: 0),
153 (op: 'ld a,l'; leng: 0),
154 (op: 'ld a,(hl)'; leng: 0),
155 (op: 'ld a,a'; leng: 0),
156 (op: 'add a,b'; leng: 0),
157 (op: 'add a,c'; leng: 0),
158 (op: 'add a,d'; leng: 0),
159 (op: 'add a,e'; leng: 0),
160 (op: 'add a,h'; leng: 0),
161 (op: 'add a,l'; leng: 0),
162 (op: 'add a,(hl)'; leng: 0),
163 (op: 'add a,a'; leng: 0),
164 (op: 'adc a,b'; leng: 0),
165 (op: 'adc a,c'; leng: 0),
166 (op: 'adc a,d'; leng: 0),
167 (op: 'adc a,e'; leng: 0),
168 (op: 'adc a,h'; leng: 0),
169 (op: 'adc a,l'; leng: 0),
170 (op: 'adc a,(hl)'; leng: 0),
171 (op: 'adc a,a'; leng: 0),
172 (op: 'sub b'; leng: 0),
173 (op: 'sub c'; leng: 0),
174 (op: 'sub d'; leng: 0),
175 (op: 'sub e'; leng: 0),
176 (op: 'sub h'; leng: 0),
177 (op: 'sub l'; leng: 0),
178 (op: 'sub (hl)'; leng: 0),
179 (op: 'sub a'; leng: 0),
180 (op: 'sbc a,b'; leng: 0),
181 (op: 'sbc a,c'; leng: 0),
182 (op: 'sbc a,d'; leng: 0),
183 (op: 'sbc a,e'; leng: 0),
184 (op: 'sbc a,h'; leng: 0),
185 (op: 'sbc a,l'; leng: 0),
186 (op: 'sbc a,(hl)'; leng: 0),
187 (op: 'sbc a,a'; leng: 0),
188 (op: 'and b'; leng: 0),
189 (op: 'and c'; leng: 0),
190 (op: 'and d'; leng: 0),
191 (op: 'and e'; leng: 0),
192 (op: 'and h'; leng: 0),
193 (op: 'and l'; leng: 0),
194 (op: 'and (hl)'; leng: 0),
195 (op: 'and a'; leng: 0),
196 (op: 'xor b'; leng: 0),
197 (op: 'xor c'; leng: 0),
198 (op: 'xor d'; leng: 0),
199 (op: 'xor e'; leng: 0),
200 (op: 'xor h'; leng: 0),
201 (op: 'xor l'; leng: 0),
202 (op: 'xor (hl)'; leng: 0),
203 (op: 'xor a'; leng: 0),
204 (op: 'or b'; leng: 0),
205 (op: 'or c'; leng: 0),
206 (op: 'or d'; leng: 0),
207 (op: 'or e'; leng: 0),
208 (op: 'or h'; leng: 0),
209 (op: 'or l'; leng: 0),
210 (op: 'or (hl)'; leng: 0),
211 (op: 'or a'; leng: 0),
212 (op: 'cp b'; leng: 0),
213 (op: 'cp c'; leng: 0),
214 (op: 'cp d'; leng: 0),
215 (op: 'cp e'; leng: 0),
216 (op: 'cp h'; leng: 0),
217 (op: 'cp l'; leng: 0),
218 (op: 'cp (hl)'; leng: 0),
219 (op: 'cp a'; leng: 0),
220 (op: 'ret nz'; leng: 0),
221 (op: 'pop bc'; leng: 0),
222 (op: 'jp nz,####'; leng: 2),
223 (op: 'jp ####'; leng: 2),
224 (op: 'call nz,####'; leng: 2),
225 (op: 'push bc'; leng: 0),
226 (op: 'add a,##'; leng: 1),
227 (op: 'rst 0'; leng: 0),
228 (op: 'ret z'; leng: 0),
229 (op: 'ret'; leng: 0),
230 (op: 'jp z,####'; leng: 2),
231 (op: ''; leng: 0),
232 (op: 'call z,####'; leng: 2),
233 (op: 'call ####'; leng: 2),
234 (op: 'adc a,##'; leng: 1),
235 (op: 'rst 8'; leng: 0),
236 (op: 'ret nc'; leng: 0),
237 (op: 'pop de'; leng: 0),
238 (op: 'jp nc,####'; leng: 2),
239 (op: 'out (##),a'; leng: 1),
240 (op: 'call nc,####'; leng: 2),
241 (op: 'push de'; leng: 0),
242 (op: 'sub ##'; leng: 1),
243 (op: 'rst 10h'; leng: 0),
244 (op: 'ret c'; leng: 0),
245 (op: 'exx'; leng: 0),
246 (op: 'jp c,####'; leng: 2),
247 (op: 'in a,(##)'; leng: 1),
248 (op: 'call c,####'; leng: 2),
249 (op: ''; leng: 1),
250 (op: 'sbc a,##'; leng: 1),
251 (op: 'rst 18h'; leng: 0),
252 (op: 'ret po'; leng: 0),
253 (op: 'pop hl'; leng: 0),
254 (op: 'jp po,####'; leng: 2),
255 (op: 'ex (sp),hl'; leng: 0),
256 (op: 'call po,####'; leng: 2),
257 (op: 'push hl'; leng: 0),
258 (op: 'and ##'; leng: 1),
259 (op: 'rst 20h'; leng: 0),
260 (op: 'ret pe'; leng: 0),
261 (op: 'jp (hl)'; leng: 0),
262 (op: 'jp pe,####'; leng: 2),
263 (op: 'ex de,hl'; leng: 0),
264 (op: 'call pe,####'; leng: 2),
265 (op: ''; leng: 2),
266 (op: 'xor ##'; leng: 1),
267 (op: 'rst 28h'; leng: 0),
268 (op: 'ret p'; leng: 0),
269 (op: 'pop af'; leng: 0),
270 (op: 'jp p,####'; leng: 2),
271 (op: 'di'; leng: 0),
272 (op: 'call p,####'; leng: 2),
273 (op: 'push af'; leng: 0),
274 (op: 'or ##'; leng: 1),
275 (op: 'rst 30h'; leng: 0),
276 (op: 'ret m'; leng: 0),
277 (op: 'ld sp,hl'; leng: 0),
278 (op: 'jp m,####'; leng: 2),
279 (op: 'ei'; leng: 0),
280 (op: 'call m,####'; leng: 2),
281 (op: ''; leng: 1),
282 (op: 'cp ##'; leng: 1),
283 (op: 'rst 38h'; leng: 0));
284
285 const
286 minor: array[0..3, 0..255] of format = ((
287 (op: 'rlc b'; leng: 0),
288 (op: 'rlc c'; leng: 0),
289 (op: 'rlc d'; leng: 0),
290 (op: 'rlc e'; leng: 0),
291 (op: 'rlc h'; leng: 0),
292 (op: 'rlc l'; leng: 0),
293 (op: 'rlc (hl)'; leng: 0),
294 (op: 'rlc a'; leng: 0),
295 (op: 'rrc b'; leng: 0),
296 (op: 'rrc c'; leng: 0),
297 (op: 'rrc d'; leng: 0),
298 (op: 'rrc e'; leng: 0),
299 (op: 'rrc h'; leng: 0),
300 (op: 'rrc l'; leng: 0),
301 (op: 'rrc (hl)'; leng: 0),
302 (op: 'rrc a'; leng: 0),
303 (op: 'rl b'; leng: 0),
304 (op: 'rl c'; leng: 0),
305 (op: 'rl d'; leng: 0),
306 (op: 'rl e'; leng: 0),
307 (op: 'rl h'; leng: 0),
308 (op: 'rl l'; leng: 0),
309 (op: 'rl (hl)'; leng: 0),
310 (op: 'rl a'; leng: 0),
311 (op: 'rr b'; leng: 0),
312 (op: 'rr c'; leng: 0),
313 (op: 'rr d'; leng: 0),
314 (op: 'rr e'; leng: 0),
315 (op: 'rr h'; leng: 0),
316 (op: 'rr l'; leng: 0),
317 (op: 'rr (hl)'; leng: 0),
318 (op: 'rr a'; leng: 0),
319 (op: 'sla b'; leng: 0),
320 (op: 'sla c'; leng: 0),
321 (op: 'sla d'; leng: 0),
322 (op: 'sla e'; leng: 0),
323 (op: 'sla h'; leng: 0),
324 (op: 'sla l'; leng: 0),
325 (op: 'sla (hl)'; leng: 0),
326 (op: 'sla a'; leng: 0),
327 (op: 'sra b'; leng: 0),
328 (op: 'sra c'; leng: 0),
329 (op: 'sra d'; leng: 0),
330 (op: 'sra e'; leng: 0),
331 (op: 'sra h'; leng: 0),
332 (op: 'sra l'; leng: 0),
333 (op: 'sra (hl)'; leng: 0),
334 (op: 'sra a'; leng: 0),
335 (op: 'slai b'; leng: 0),
336 (op: 'slai c'; leng: 0),
337 (op: 'slai d'; leng: 0),
338 (op: 'slai e'; leng: 0),
339 (op: 'slai h'; leng: 0),
340 (op: 'slai l'; leng: 0),
341 (op: 'slai (hl)'; leng: 0),
342 (op: 'slai a'; leng: 0),
343 (op: 'srl b'; leng: 0),
344 (op: 'srl c'; leng: 0),
345 (op: 'srl d'; leng: 0),
346 (op: 'srl e'; leng: 0),
347 (op: 'srl h'; leng: 0),
348 (op: 'srl l'; leng: 0),
349 (op: 'srl (hl)'; leng: 0),
350 (op: 'srl a'; leng: 0),
351 (op: 'bit 0,b'; leng: 0),
352 (op: 'bit 0,c'; leng: 0),
353 (op: 'bit 0,d'; leng: 0),
354 (op: 'bit 0,e'; leng: 0),
355 (op: 'bit 0,h'; leng: 0),
356 (op: 'bit 0,l'; leng: 0),
357 (op: 'bit 0,(hl)'; leng: 0),
358 (op: 'bit 0,a'; leng: 0),
359 (op: 'bit 1,b'; leng: 0),
360 (op: 'bit 1,c'; leng: 0),
361 (op: 'bit 1,d'; leng: 0),
362 (op: 'bit 1,e'; leng: 0),
363 (op: 'bit 1,h'; leng: 0),
364 (op: 'bit 1,l'; leng: 0),
365 (op: 'bit 1,(hl)'; leng: 0),
366 (op: 'bit 1,a'; leng: 0),
367 (op: 'bit 2,b'; leng: 0),
368 (op: 'bit 2,c'; leng: 0),
369 (op: 'bit 2,d'; leng: 0),
370 (op: 'bit 2,e'; leng: 0),
371 (op: 'bit 2,h'; leng: 0),
372 (op: 'bit 2,l'; leng: 0),
373 (op: 'bit 2,(hl)'; leng: 0),
374 (op: 'bit 2,a'; leng: 0),
375 (op: 'bit 3,b'; leng: 0),
376 (op: 'bit 3,c'; leng: 0),
377 (op: 'bit 3,d'; leng: 0),
378 (op: 'bit 3,e'; leng: 0),
379 (op: 'bit 3,h'; leng: 0),
380 (op: 'bit 3,l'; leng: 0),
381 (op: 'bit 3,(hl)'; leng: 0),
382 (op: 'bit 3,a'; leng: 0),
383 (op: 'bit 4,b'; leng: 0),
384 (op: 'bit 4,c'; leng: 0),
385 (op: 'bit 4,d'; leng: 0),
386 (op: 'bit 4,e'; leng: 0),
387 (op: 'bit 4,h'; leng: 0),
388 (op: 'bit 4,l'; leng: 0),
389 (op: 'bit 4,(hl)'; leng: 0),
390 (op: 'bit 4,a'; leng: 0),
391 (op: 'bit 5,b'; leng: 0),
392 (op: 'bit 5,c'; leng: 0),
393 (op: 'bit 5,d'; leng: 0),
394 (op: 'bit 5,e'; leng: 0),
395 (op: 'bit 5,h'; leng: 0),
396 (op: 'bit 5,l'; leng: 0),
397 (op: 'bit 5,(hl)'; leng: 0),
398 (op: 'bit 5,a'; leng: 0),
399 (op: 'bit 6,b'; leng: 0),
400 (op: 'bit 6,c'; leng: 0),
401 (op: 'bit 6,d'; leng: 0),
402 (op: 'bit 6,e'; leng: 0),
403 (op: 'bit 6,h'; leng: 0),
404 (op: 'bit 6,l'; leng: 0),
405 (op: 'bit 6,(hl)'; leng: 0),
406 (op: 'bit 6,a'; leng: 0),
407 (op: 'bit 7,b'; leng: 0),
408 (op: 'bit 7,c'; leng: 0),
409 (op: 'bit 7,d'; leng: 0),
410 (op: 'bit 7,e'; leng: 0),
411 (op: 'bit 7,h'; leng: 0),
412 (op: 'bit 7,l'; leng: 0),
413 (op: 'bit 7,(hl)'; leng: 0),
414 (op: 'bit 7,a'; leng: 0),
415 (op: 'res 0,b'; leng: 0),
416 (op: 'res 0,c'; leng: 0),
417 (op: 'res 0,d'; leng: 0),
418 (op: 'res 0,e'; leng: 0),
419 (op: 'res 0,h'; leng: 0),
420 (op: 'res 0,l'; leng: 0),
421 (op: 'res 0,(hl)'; leng: 0),
422 (op: 'res 0,a'; leng: 0),
423 (op: 'res 1,b'; leng: 0),
424 (op: 'res 1,c'; leng: 0),
425 (op: 'res 1,d'; leng: 0),
426 (op: 'res 1,e'; leng: 0),
427 (op: 'res 1,h'; leng: 0),
428 (op: 'res 1,l'; leng: 0),
429 (op: 'res 1,(hl)'; leng: 0),
430 (op: 'res 1,a'; leng: 0),
431 (op: 'res 2,b'; leng: 0),
432 (op: 'res 2,c'; leng: 0),
433 (op: 'res 2,d'; leng: 0),
434 (op: 'res 2,e'; leng: 0),
435 (op: 'res 2,h'; leng: 0),
436 (op: 'res 2,l'; leng: 0),
437 (op: 'res 2,(hl)'; leng: 0),
438 (op: 'res 2,a'; leng: 0),
439 (op: 'res 3,b'; leng: 0),
440 (op: 'res 3,c'; leng: 0),
441 (op: 'res 3,d'; leng: 0),
442 (op: 'res 3,e'; leng: 0),
443 (op: 'res 3,h'; leng: 0),
444 (op: 'res 3,l'; leng: 0),
445 (op: 'res 3,(hl)'; leng: 0),
446 (op: 'res 3,a'; leng: 0),
447 (op: 'res 4,b'; leng: 0),
448 (op: 'res 4,c'; leng: 0),
449 (op: 'res 4,d'; leng: 0),
450 (op: 'res 4,e'; leng: 0),
451 (op: 'res 4,h'; leng: 0),
452 (op: 'res 4,l'; leng: 0),
453 (op: 'res 4,(hl)'; leng: 0),
454 (op: 'res 4,a'; leng: 0),
455 (op: 'res 5,b'; leng: 0),
456 (op: 'res 5,c'; leng: 0),
457 (op: 'res 5,d'; leng: 0),
458 (op: 'res 5,e'; leng: 0),
459 (op: 'res 5,h'; leng: 0),
460 (op: 'res 5,l'; leng: 0),
461 (op: 'res 5,(hl)'; leng: 0),
462 (op: 'res 5,a'; leng: 0),
463 (op: 'res 6,b'; leng: 0),
464 (op: 'res 6,c'; leng: 0),
465 (op: 'res 6,d'; leng: 0),
466 (op: 'res 6,e'; leng: 0),
467 (op: 'res 6,h'; leng: 0),
468 (op: 'res 6,l'; leng: 0),
469 (op: 'res 6,(hl)'; leng: 0),
470 (op: 'res 6,a'; leng: 0),
471 (op: 'res 7,b'; leng: 0),
472 (op: 'res 7,c'; leng: 0),
473 (op: 'res 7,d'; leng: 0),
474 (op: 'res 7,e'; leng: 0),
475 (op: 'res 7,h'; leng: 0),
476 (op: 'res 7,l'; leng: 0),
477 (op: 'res 7,(hl)'; leng: 0),
478 (op: 'res 7,a'; leng: 0),
479 (op: 'set 0,b'; leng: 0),
480 (op: 'set 0,c'; leng: 0),
481 (op: 'set 0,d'; leng: 0),
482 (op: 'set 0,e'; leng: 0),
483 (op: 'set 0,h'; leng: 0),
484 (op: 'set 0,l'; leng: 0),
485 (op: 'set 0,(hl)'; leng: 0),
486 (op: 'set 0,a'; leng: 0),
487 (op: 'set 1,b'; leng: 0),
488 (op: 'set 1,c'; leng: 0),
489 (op: 'set 1,d'; leng: 0),
490 (op: 'set 1,e'; leng: 0),
491 (op: 'set 1,h'; leng: 0),
492 (op: 'set 1,l'; leng: 0),
493 (op: 'set 1,(hl)'; leng: 0),
494 (op: 'set 1,a'; leng: 0),
495 (op: 'set 2,b'; leng: 0),
496 (op: 'set 2,c'; leng: 0),
497 (op: 'set 2,d'; leng: 0),
498 (op: 'set 2,e'; leng: 0),
499 (op: 'set 2,h'; leng: 0),
500 (op: 'set 2,l'; leng: 0),
501 (op: 'set 2,(hl)'; leng: 0),
502 (op: 'set 2,a'; leng: 0),
503 (op: 'set 3,b'; leng: 0),
504 (op: 'set 3,c'; leng: 0),
505 (op: 'set 3,d'; leng: 0),
506 (op: 'set 3,e'; leng: 0),
507 (op: 'set 3,h'; leng: 0),
508 (op: 'set 3,l'; leng: 0),
509 (op: 'set 3,(hl)'; leng: 0),
510 (op: 'set 3,a'; leng: 0),
511 (op: 'set 4,b'; leng: 0),
512 (op: 'set 4,c'; leng: 0),
513 (op: 'set 4,d'; leng: 0),
514 (op: 'set 4,e'; leng: 0),
515 (op: 'set 4,h'; leng: 0),
516 (op: 'set 4,l'; leng: 0),
517 (op: 'set 4,(hl)'; leng: 0),
518 (op: 'set 4,a'; leng: 0),
519 (op: 'set 5,b'; leng: 0),
520 (op: 'set 5,c'; leng: 0),
521 (op: 'set 5,d'; leng: 0),
522 (op: 'set 5,e'; leng: 0),
523 (op: 'set 5,h'; leng: 0),
524 (op: 'set 5,l'; leng: 0),
525 (op: 'set 5,(hl)'; leng: 0),
526 (op: 'set 5,a'; leng: 0),
527 (op: 'set 6,b'; leng: 0),
528 (op: 'set 6,c'; leng: 0),
529 (op: 'set 6,d'; leng: 0),
530 (op: 'set 6,e'; leng: 0),
531 (op: 'set 6,h'; leng: 0),
532 (op: 'set 6,l'; leng: 0),
533 (op: 'set 6,(hl)'; leng: 0),
534 (op: 'set 6,a'; leng: 0),
535 (op: 'set 7,b'; leng: 0),
536 (op: 'set 7,c'; leng: 0),
537 (op: 'set 7,d'; leng: 0),
538 (op: 'set 7,e'; leng: 0),
539 (op: 'set 7,h'; leng: 0),
540 (op: 'set 7,l'; leng: 0),
541 (op: 'set 7,(hl)'; leng: 0),
542 (op: 'set 7,a'; leng: 0)), (
543 (op: 'undefined'; leng: 0),
544 (op: 'undefined'; leng: 0),
545 (op: 'undefined'; leng: 0),
546 (op: 'undefined'; leng: 0),
547 (op: 'undefined'; leng: 0),
548 (op: 'undefined'; leng: 0),
549 (op: 'undefined'; leng: 0),
550 (op: 'undefined'; leng: 0),
551 (op: 'undefined'; leng: 0),
552 (op: 'addix,bc'; leng: 0),
553 (op: 'undefined'; leng: 0),
554 (op: 'undefined'; leng: 0),
555 (op: 'undefined'; leng: 0),
556 (op: 'undefined'; leng: 0),
557 (op: 'undefined'; leng: 0),
558 (op: 'undefined'; leng: 0),
559 (op: 'undefined'; leng: 0),
560 (op: 'undefined'; leng: 0),
561 (op: 'undefined'; leng: 0),
562 (op: 'undefined'; leng: 0),
563 (op: 'undefined'; leng: 0),
564 (op: 'undefined'; leng: 0),
565 (op: 'undefined'; leng: 0),
566 (op: 'undefined'; leng: 0),
567 (op: 'undefined'; leng: 0),
568 (op: 'add ix,de'; leng: 0),
569 (op: 'undefined'; leng: 0),
570 (op: 'undefined'; leng: 0),
571 (op: 'undefined'; leng: 0),
572 (op: 'undefined'; leng: 0),
573 (op: 'undefined'; leng: 0),
574 (op: 'undefined'; leng: 0),
575 (op: 'undefined'; leng: 0),
576 (op: 'ld ix,####'; leng: 2),
577 (op: 'ld (####),ix'; leng: 2),
578 (op: 'inc ix'; leng: 0),
579 (op: 'inc ixh'; leng: 0),
580 (op: 'dec ixh'; leng: 0),
581 (op: 'ld ixh,##'; leng: 1),
582 (op: 'undefined'; leng: 0),
583 (op: 'undefined'; leng: 0),
584 (op: 'add ix,ix'; leng: 0),
585 (op: 'ld ix,(####)'; leng: 2),
586 (op: 'dec ix'; leng: 0),
587 (op: 'inc ixl'; leng: 0),
588 (op: 'dec ixl'; leng: 0),
589 (op: 'ld ixl,##'; leng: 1),
590 (op: 'undefined'; leng: 0),
591 (op: 'undefined'; leng: 0),
592 (op: 'undefined'; leng: 0),
593 (op: 'undefined'; leng: 0),
594 (op: 'undefined'; leng: 0),
595 (op: 'inc (ix+##)'; leng: 1),
596 (op: 'dec (ix+##)'; leng: 1),
597 (op: 'ld (ix+##),##'; leng: 2),
598 (op: 'undefined'; leng: 0),
599 (op: 'undefined'; leng: 0),
600 (op: 'add ix,sp'; leng: 0),
601 (op: 'undefined'; leng: 0),
602 (op: 'undefined'; leng: 0),
603 (op: 'undefined'; leng: 0),
604 (op: 'undefined'; leng: 0),
605 (op: 'undefined'; leng: 0),
606 (op: 'undefined'; leng: 0),
607 (op: 'undefined'; leng: 0),
608 (op: 'undefined'; leng: 0),
609 (op: 'undefined'; leng: 0),
610 (op: 'undefined'; leng: 0),
611 (op: 'ld b,ixh'; leng: 0),
612 (op: 'ld b,ixl'; leng: 0),
613 (op: 'ld b,(ix+##)'; leng: 1),
614 (op: 'undefined'; leng: 0),
615 (op: 'undefined'; leng: 0),
616 (op: 'undefined'; leng: 0),
617 (op: 'undefined'; leng: 0),
618 (op: 'undefined'; leng: 0),
619 (op: 'ld c,ixh'; leng: 0),
620 (op: 'ld c,ixl'; leng: 0),
621 (op: 'ld c,(ix+##)'; leng: 1),
622 (op: 'undefined'; leng: 0),
623 (op: 'undefined'; leng: 0),
624 (op: 'undefined'; leng: 0),
625 (op: 'undefined'; leng: 0),
626 (op: 'undefined'; leng: 0),
627 (op: 'ld d,ixh'; leng: 0),
628 (op: 'ld d,ixl'; leng: 0),
629 (op: 'ld d,(ix+##)'; leng: 1),
630 (op: 'undefined'; leng: 0),
631 (op: 'undefined'; leng: 0),
632 (op: 'undefined'; leng: 0),
633 (op: 'undefined'; leng: 0),
634 (op: 'undefined'; leng: 0),
635 (op: 'ld e,ixh'; leng: 0),
636 (op: 'ld e,ixl'; leng: 0),
637 (op: 'ld e,(ix+##)'; leng: 1),
638 (op: 'undefined'; leng: 0),
639 (op: 'ld ixh,b'; leng: 0),
640 (op: 'ld ixh,c'; leng: 0),
641 (op: 'ld ixh,d'; leng: 0),
642 (op: 'ld ixh,e'; leng: 0),
643 (op: 'ld ixh,ixh'; leng: 0),
644 (op: 'ld ixh,ixl'; leng: 0),
645 (op: 'ld h,(ix+##)'; leng: 1),
646 (op: 'ld ixh,a'; leng: 0),
647 (op: 'ld ixl,b'; leng: 0),
648 (op: 'ld ixl,c'; leng: 0),
649 (op: 'ld ixl,d'; leng: 0),
650 (op: 'ld ixl,e'; leng: 0),
651 (op: 'ld ixl,ixh'; leng: 0),
652 (op: 'ld ixl,ixh'; leng: 0),
653 (op: 'ld l,(ix+##)'; leng: 1),
654 (op: 'ld ixl,a'; leng: 0),
655 (op: 'ld (ix+##),b'; leng: 1),
656 (op: 'ld (ix+##),c'; leng: 1),
657 (op: 'ld (ix+##),d'; leng: 1),
658 (op: 'ld (ix+##),e'; leng: 1),
659 (op: 'ld (ix+##),h'; leng: 1),
660 (op: 'ld (ix+##),l'; leng: 1),
661 (op: 'undefined'; leng: 0),
662 (op: 'ld (ix+##),a'; leng: 1),
663 (op: 'undefined'; leng: 0),
664 (op: 'undefined'; leng: 0),
665 (op: 'undefined'; leng: 0),
666 (op: 'undefined'; leng: 0),
667 (op: 'ld a,ixh'; leng: 0),
668 (op: 'ld a,ixl'; leng: 0),
669 (op: 'ld a,(ix+##)'; leng: 1),
670 (op: 'undefined'; leng: 0),
671 (op: 'undefined'; leng: 0),
672 (op: 'undefined'; leng: 0),
673 (op: 'undefined'; leng: 0),
674 (op: 'undefined'; leng: 0),
675 (op: 'add a,ixh'; leng: 0),
676 (op: 'add a,ixl'; leng: 0),
677 (op: 'add a,(ix+##)'; leng: 1),
678 (op: 'undefined'; leng: 0),
679 (op: 'undefined'; leng: 0),
680 (op: 'undefined'; leng: 0),
681 (op: 'undefined'; leng: 0),
682 (op: 'undefined'; leng: 0),
683 (op: 'adc a,ixh'; leng: 0),
684 (op: 'adc a,ixl'; leng: 0),
685 (op: 'adc a,(ix+##)'; leng: 1),
686 (op: 'undefined'; leng: 0),
687 (op: 'undefined'; leng: 0),
688 (op: 'undefined'; leng: 0),
689 (op: 'undefined'; leng: 0),
690 (op: 'undefined'; leng: 0),
691 (op: 'sub a,ixh'; leng: 0),
692 (op: 'sub a,ixl'; leng: 0),
693 (op: 'sub (ix+##)'; leng: 1),
694 (op: 'undefined'; leng: 0),
695 (op: 'undefined'; leng: 0),
696 (op: 'undefined'; leng: 0),
697 (op: 'undefined'; leng: 0),
698 (op: 'undefined'; leng: 0),
699 (op: 'sbc a,ixh'; leng: 0),
700 (op: 'sbc a,ixl'; leng: 0),
701 (op: 'sbc a,(ix+##)'; leng: 1),
702 (op: 'undefined'; leng: 0),
703 (op: 'undefined'; leng: 0),
704 (op: 'undefined'; leng: 0),
705 (op: 'undefined'; leng: 0),
706 (op: 'undefined'; leng: 0),
707 (op: 'and a,ixh'; leng: 0),
708 (op: 'and a,ixl'; leng: 0),
709 (op: 'and a,(ix+##)'; leng: 1),
710 (op: 'undefined'; leng: 0),
711 (op: 'undefined'; leng: 0),
712 (op: 'undefined'; leng: 0),
713 (op: 'undefined'; leng: 0),
714 (op: 'undefined'; leng: 0),
715 (op: 'xor a,ixh'; leng: 0),
716 (op: 'xor a,ixl'; leng: 0),
717 (op: 'xor a,(ix+##)'; leng: 1),
718 (op: 'undefined'; leng: 0),
719 (op: 'undefined'; leng: 0),
720 (op: 'undefined'; leng: 0),
721 (op: 'undefined'; leng: 0),
722 (op: 'undefined'; leng: 0),
723 (op: 'or a,ixh'; leng: 0),
724 (op: 'or a,ixl'; leng: 0),
725 (op: 'or a,(ix+##)'; leng: 1),
726 (op: 'undefined'; leng: 0),
727 (op: 'undefined'; leng: 0),
728 (op: 'undefined'; leng: 0),
729 (op: 'undefined'; leng: 0),
730 (op: 'undefined'; leng: 0),
731 (op: 'cp a,ixh'; leng: 0),
732 (op: 'cp a,ixl'; leng: 0),
733 (op: 'cp a,(ix+##)'; leng: 1),
734 (op: 'undefined'; leng: 0),
735 (op: 'undefined'; leng: 0),
736 (op: 'undefined'; leng: 0),
737 (op: 'undefined'; leng: 0),
738 (op: 'undefined'; leng: 0),
739 (op: 'undefined'; leng: 0),
740 (op: 'undefined'; leng: 0),
741 (op: 'undefined'; leng: 0),
742 (op: 'undefined'; leng: 0),
743 (op: 'undefined'; leng: 0),
744 (op: 'undefined'; leng: 0),
745 (op: 'undefined'; leng: 0),
746 (op: ''; leng: 3),
747 (op: 'undefined'; leng: 0),
748 (op: 'undefined'; leng: 0),
749 (op: 'undefined'; leng: 0),
750 (op: 'undefined'; leng: 0),
751 (op: 'undefined'; leng: 0),
752 (op: 'undefined'; leng: 0),
753 (op: 'undefined'; leng: 0),
754 (op: 'undefined'; leng: 0),
755 (op: 'undefined'; leng: 0),
756 (op: 'undefined'; leng: 0),
757 (op: 'undefined'; leng: 0),
758 (op: 'undefined'; leng: 0),
759 (op: 'undefined'; leng: 0),
760 (op: 'undefined'; leng: 0),
761 (op: 'undefined'; leng: 0),
762 (op: 'undefined'; leng: 0),
763 (op: 'undefined'; leng: 0),
764 (op: 'undefined'; leng: 0),
765 (op: 'undefined'; leng: 0),
766 (op: 'undefined'; leng: 0),
767 (op: 'undefined'; leng: 0),
768 (op: 'pop ix'; leng: 0),
769 (op: 'undefined'; leng: 0),
770 (op: 'ex (sp),ix'; leng: 0),
771 (op: 'undefined'; leng: 0),
772 (op: 'push ix'; leng: 0),
773 (op: 'undefined'; leng: 0),
774 (op: 'undefined'; leng: 0),
775 (op: 'undefined'; leng: 0),
776 (op: 'jp (ix)'; leng: 0),
777 (op: 'undefined'; leng: 0),
778 (op: 'undefined'; leng: 0),
779 (op: 'undefined'; leng: 0),
780 (op: 'undefined'; leng: 0),
781 (op: 'undefined'; leng: 0),
782 (op: 'undefined'; leng: 0),
783 (op: 'undefined'; leng: 0),
784 (op: 'undefined'; leng: 0),
785 (op: 'undefined'; leng: 0),
786 (op: 'undefined'; leng: 0),
787 (op: 'undefined'; leng: 0),
788 (op: 'undefined'; leng: 0),
789 (op: 'undefined'; leng: 0),
790 (op: 'undefined'; leng: 0),
791 (op: 'undefined'; leng: 0),
792 (op: 'ld sp,ix'; leng: 0),
793 (op: 'undefined'; leng: 0),
794 (op: 'undefined'; leng: 0),
795 (op: 'undefined'; leng: 0),
796 (op: 'undefined'; leng: 0),
797 (op: 'undefined'; leng: 0),
798 (op: 'undefined'; leng: 0)),
799 (
800 (op: 'undefined'; leng: 0),
801 (op: 'undefined'; leng: 0),
802 (op: 'undefined'; leng: 0),
803 (op: 'undefined'; leng: 0),
804 (op: 'undefined'; leng: 0),
805 (op: 'undefined'; leng: 0),
806 (op: 'undefined'; leng: 0),
807 (op: 'undefined'; leng: 0),
808 (op: 'undefined'; leng: 0),
809 (op: 'undefined'; leng: 0),
810 (op: 'undefined'; leng: 0),
811 (op: 'undefined'; leng: 0),
812 (op: 'undefined'; leng: 0),
813 (op: 'undefined'; leng: 0),
814 (op: 'undefined'; leng: 0),
815 (op: 'undefined'; leng: 0),
816 (op: 'undefined'; leng: 0),
817 (op: 'undefined'; leng: 0),
818 (op: 'undefined'; leng: 0),
819 (op: 'undefined'; leng: 0),
820 (op: 'undefined'; leng: 0),
821 (op: 'undefined'; leng: 0),
822 (op: 'undefined'; leng: 0),
823 (op: 'undefined'; leng: 0),
824 (op: 'undefined'; leng: 0),
825 (op: 'undefined'; leng: 0),
826 (op: 'undefined'; leng: 0),
827 (op: 'undefined'; leng: 0),
828 (op: 'undefined'; leng: 0),
829 (op: 'undefined'; leng: 0),
830 (op: 'undefined'; leng: 0),
831 (op: 'undefined'; leng: 0),
832 (op: 'undefined'; leng: 0),
833 (op: 'undefined'; leng: 0),
834 (op: 'undefined'; leng: 0),
835 (op: 'undefined'; leng: 0),
836 (op: 'undefined'; leng: 0),
837 (op: 'undefined'; leng: 0),
838 (op: 'undefined'; leng: 0),
839 (op: 'undefined'; leng: 0),
840 (op: 'undefined'; leng: 0),
841 (op: 'undefined'; leng: 0),
842 (op: 'undefined'; leng: 0),
843 (op: 'undefined'; leng: 0),
844 (op: 'undefined'; leng: 0),
845 (op: 'undefined'; leng: 0),
846 (op: 'undefined'; leng: 0),
847 (op: 'undefined'; leng: 0),
848 (op: 'undefined'; leng: 0),
849 (op: 'undefined'; leng: 0),
850 (op: 'undefined'; leng: 0),
851 (op: 'undefined'; leng: 0),
852 (op: 'undefined'; leng: 0),
853 (op: 'undefined'; leng: 0),
854 (op: 'undefined'; leng: 0),
855 (op: 'undefined'; leng: 0),
856 (op: 'undefined'; leng: 0),
857 (op: 'undefined'; leng: 0),
858 (op: 'undefined'; leng: 0),
859 (op: 'undefined'; leng: 0),
860 (op: 'undefined'; leng: 0),
861 (op: 'undefined'; leng: 0),
862 (op: 'undefined'; leng: 0),
863 (op: 'undefined'; leng: 0),
864 (op: 'in b,(c)'; leng: 0),
865 (op: 'out (c),b'; leng: 0),
866 (op: 'sbc hl,bc'; leng: 0),
867 (op: 'ld (####),bc'; leng: 2),
868 (op: 'neg'; leng: 0),
869 (op: 'retn'; leng: 0),
870 (op: 'im '; leng: 0),
871 (op: 'ld i,a'; leng: 0),
872 (op: 'in c,(c)'; leng: 0),
873 (op: 'out (c),c'; leng: 0),
874 (op: 'adc hl,bc'; leng: 0),
875 (op: 'ld bc,(####)'; leng: 2),
876 (op: 'neg'; leng: 0),
877 (op: 'reti'; leng: 0),
878 (op: 'im 0'; leng: 0),
879 (op: 'ld r,a'; leng: 0),
880 (op: 'in d,(c)'; leng: 0),
881 (op: 'out (c),d'; leng: 0),
882 (op: 'sbc hl,de'; leng: 0),
883 (op: 'ld (####),de'; leng: 2),
884 (op: 'neg'; leng: 0),
885 (op: 'retn'; leng: 0),
886 (op: 'im 1'; leng: 0),
887 (op: 'ld a,i'; leng: 0),
888 (op: 'in e,(c)'; leng: 0),
889 (op: 'out (c),e'; leng: 0),
890 (op: 'adc hl,de'; leng: 0),
891 (op: 'ld de,(####)'; leng: 2),
892 (op: 'neg'; leng: 0),
893 (op: 'retn'; leng: 0),
894 (op: 'im 2'; leng: 0),
895 (op: 'ld a,r'; leng: 0),
896 (op: 'in h,(c)'; leng: 0),
897 (op: 'out (c),h'; leng: 0),
898 (op: 'sbc hl,hl'; leng: 0),
899 (op: 'ld (####),hl'; leng: 0),
900 (op: 'neg'; leng: 0),
901 (op: 'retn'; leng: 0),
902 (op: 'im 0'; leng: 0),
903 (op: 'rrd'; leng: 0),
904 (op: 'in l,(c)'; leng: 0),
905 (op: 'out (c),l'; leng: 0),
906 (op: 'adc hl,hl'; leng: 0),
907 (op: 'ld hl,(####)'; leng: 0),
908 (op: 'neg'; leng: 0),
909 (op: 'retn'; leng: 0),
910 (op: 'im 0'; leng: 0),
911 (op: 'rld'; leng: 0),
912 (op: 'in f,(c)'; leng: 0),
913 (op: 'out (c),0'; leng: 0),
914 (op: 'sbc hl,sp'; leng: 0),
915 (op: 'ld (####),sp'; leng: 2),
916 (op: 'neg'; leng: 0),
917 (op: 'retn'; leng: 0),
918 (op: 'im 1'; leng: 0),
919 (op: 'nop'; leng: 0),
920 (op: 'in a,(c)'; leng: 0),
921 (op: 'out (c),a'; leng: 0),
922 (op: 'adc hl,sp'; leng: 0),
923 (op: 'ld sp,(####)'; leng: 2),
924 (op: 'neg'; leng: 0),
925 (op: 'retn'; leng: 0),
926 (op: 'im 2'; leng: 0),
927 (op: 'nop'; leng: 0),
928 (op: 'undefined'; leng: 0),
929 (op: 'undefined'; leng: 0),
930 (op: 'undefined'; leng: 0),
931 (op: 'undefined'; leng: 0),
932 (op: 'undefined'; leng: 0),
933 (op: 'undefined'; leng: 0),
934 (op: 'undefined'; leng: 0),
935 (op: 'undefined'; leng: 0),
936 (op: 'undefined'; leng: 0),
937 (op: 'undefined'; leng: 0),
938 (op: 'undefined'; leng: 0),
939 (op: 'undefined'; leng: 0),
940 (op: 'undefined'; leng: 0),
941 (op: 'undefined'; leng: 0),
942 (op: 'undefined'; leng: 0),
943 (op: 'undefined'; leng: 0),
944 (op: 'undefined'; leng: 0),
945 (op: 'undefined'; leng: 0),
946 (op: 'undefined'; leng: 0),
947 (op: 'undefined'; leng: 0),
948 (op: 'undefined'; leng: 0),
949 (op: 'undefined'; leng: 0),
950 (op: 'undefined'; leng: 0),
951 (op: 'undefined'; leng: 0),
952 (op: 'undefined'; leng: 0),
953 (op: 'undefined'; leng: 0),
954 (op: 'undefined'; leng: 0),
955 (op: 'undefined'; leng: 0),
956 (op: 'undefined'; leng: 0),
957 (op: 'undefined'; leng: 0),
958 (op: 'undefined'; leng: 0),
959 (op: 'undefined'; leng: 0),
960 (op: 'ldi'; leng: 0),
961 (op: 'cpi'; leng: 0),
962 (op: 'ini'; leng: 0),
963 (op: 'outi'; leng: 0),
964 (op: 'undefined'; leng: 0),
965 (op: 'undefined'; leng: 0),
966 (op: 'undefined'; leng: 0),
967 (op: 'undefined'; leng: 0),
968 (op: 'ldd'; leng: 0),
969 (op: 'cpd'; leng: 0),
970 (op: 'ind'; leng: 0),
971 (op: 'outd'; leng: 0),
972 (op: 'undefined'; leng: 0),
973 (op: 'undefined'; leng: 0),
974 (op: 'undefined'; leng: 0),
975 (op: 'undefined'; leng: 0),
976 (op: 'ldir'; leng: 0),
977 (op: 'cpir'; leng: 0),
978 (op: 'inir'; leng: 0),
979 (op: 'otir'; leng: 0),
980 (op: 'undefined'; leng: 0),
981 (op: 'undefined'; leng: 0),
982 (op: 'undefined'; leng: 0),
983 (op: 'undefined'; leng: 0),
984 (op: 'lddr'; leng: 0),
985 (op: 'cpdr'; leng: 0),
986 (op: 'indr'; leng: 0),
987 (op: 'otdr'; leng: 0),
988 (op: 'undefined'; leng: 0),
989 (op: 'undefined'; leng: 0),
990 (op: 'undefined'; leng: 0),
991 (op: 'undefined'; leng: 0),
992 (op: 'undefined'; leng: 0),
993 (op: 'undefined'; leng: 0),
994 (op: 'undefined'; leng: 0),
995 (op: 'undefined'; leng: 0),
996 (op: 'undefined'; leng: 0),
997 (op: 'undefined'; leng: 0),
998 (op: 'undefined'; leng: 0),
999 (op: 'undefined'; leng: 0),
1000 (op: 'undefined'; leng: 0),
1001 (op: 'undefined'; leng: 0),
1002 (op: 'undefined'; leng: 0),
1003 (op: 'undefined'; leng: 0),
1004 (op: 'undefined'; leng: 0),
1005 (op: 'undefined'; leng: 0),
1006 (op: 'undefined'; leng: 0),
1007 (op: 'undefined'; leng: 0),
1008 (op: 'undefined'; leng: 0),
1009 (op: 'undefined'; leng: 0),
1010 (op: 'undefined'; leng: 0),
1011 (op: 'undefined'; leng: 0),
1012 (op: 'undefined'; leng: 0),
1013 (op: 'undefined'; leng: 0),
1014 (op: 'undefined'; leng: 0),
1015 (op: 'undefined'; leng: 0),
1016 (op: 'undefined'; leng: 0),
1017 (op: 'undefined'; leng: 0),
1018 (op: 'undefined'; leng: 0),
1019 (op: 'undefined'; leng: 0),
1020 (op: 'undefined'; leng: 0),
1021 (op: 'undefined'; leng: 0),
1022 (op: 'undefined'; leng: 0),
1023 (op: 'undefined'; leng: 0),
1024 (op: 'undefined'; leng: 0),
1025 (op: 'undefined'; leng: 0),
1026 (op: 'undefined'; leng: 0),
1027 (op: 'undefined'; leng: 0),
1028 (op: 'undefined'; leng: 0),
1029 (op: 'undefined'; leng: 0),
1030 (op: 'undefined'; leng: 0),
1031 (op: 'undefined'; leng: 0),
1032 (op: 'undefined'; leng: 0),
1033 (op: 'undefined'; leng: 0),
1034 (op: 'undefined'; leng: 0),
1035 (op: 'undefined'; leng: 0),
1036 (op: 'undefined'; leng: 0),
1037 (op: 'undefined'; leng: 0),
1038 (op: 'undefined'; leng: 0),
1039 (op: 'undefined'; leng: 0),
1040 (op: 'undefined'; leng: 0),
1041 (op: 'undefined'; leng: 0),
1042 (op: 'undefined'; leng: 0),
1043 (op: 'undefined'; leng: 0),
1044 (op: 'undefined'; leng: 0),
1045 (op: 'undefined'; leng: 0),
1046 (op: 'undefined'; leng: 0),
1047 (op: 'undefined'; leng: 0),
1048 (op: 'undefined'; leng: 0),
1049 (op: 'undefined'; leng: 0),
1050 (op: 'undefined'; leng: 0),
1051 (op: 'undefined'; leng: 0),
1052 (op: 'undefined'; leng: 0),
1053 (op: 'undefined'; leng: 0),
1054 (op: 'undefined'; leng: 0),
1055 (op: 'undefined'; leng: 0)),
1056 (
1057 (op: 'rlc (ix+##),b'; leng: -2),
1058 (op: 'rlc (ix+##),c'; leng: -2),
1059 (op: 'rlc (ix+##),d'; leng: -2),
1060 (op: 'rlc (ix+##),e'; leng: -2),
1061 (op: 'rlc (ix+##),h'; leng: -2),
1062 (op: 'rlc (ix+##),l'; leng: -2),
1063 (op: 'rlc (ix+##)'; leng: -2),
1064 (op: 'rlc (ix+##),a'; leng: -2),
1065 (op: 'rrc (ix+##),b'; leng: -2),
1066 (op: 'rrc (ix+##),c'; leng: -2),
1067 (op: 'rrc (ix+##),d'; leng: -2),
1068 (op: 'rrc (ix+##),e'; leng: -2),
1069 (op: 'rrc (ix+##),h'; leng: -2),
1070 (op: 'rrc (ix+##),l'; leng: -2),
1071 (op: 'rrc (ix+##)'; leng: -2),
1072 (op: 'rrc (ix+##),a'; leng: -2),
1073 (op: 'rl (ix+##),b'; leng: -2),
1074 (op: 'rl (ix+##),c'; leng: -2),
1075 (op: 'rl (ix+##),d'; leng: -2),
1076 (op: 'rl (ix+##),e'; leng: -2),
1077 (op: 'rl (ix+##),h'; leng: -2),
1078 (op: 'rl (ix+##),l'; leng: -2),
1079 (op: 'rl (ix+##)'; leng: -2),
1080 (op: 'rl (ix+##),a'; leng: -2),
1081 (op: 'rr (ix+##),b'; leng: -2),
1082 (op: 'rr (ix+##),c'; leng: -2),
1083 (op: 'rr (ix+##),d'; leng: -2),
1084 (op: 'rr (ix+##),e'; leng: -2),
1085 (op: 'rr (ix+##),h'; leng: -2),
1086 (op: 'rr (ix+##),l'; leng: -2),
1087 (op: 'rr (ix+##)'; leng: -2),
1088 (op: 'rr (ix+##),a'; leng: -2),
1089 (op: 'sla (ix+##),b'; leng: -2),
1090 (op: 'sla (ix+##),c'; leng: -2),
1091 (op: 'sla (ix+##),d'; leng: -2),
1092 (op: 'sla (ix+##),e'; leng: -2),
1093 (op: 'sla (ix+##),h'; leng: -2),
1094 (op: 'sla (ix+##),l'; leng: -2),
1095 (op: 'sla (ix+##)'; leng: -2),
1096 (op: 'sla (ix+##),a'; leng: -2),
1097 (op: 'sra (ix+##),b'; leng: -2),
1098 (op: 'sra (ix+##),c'; leng: -2),
1099 (op: 'sra (ix+##),d'; leng: -2),
1100 (op: 'sra (ix+##),e'; leng: -2),
1101 (op: 'sra (ix+##),h'; leng: -2),
1102 (op: 'sra (ix+##),l'; leng: -2),
1103 (op: 'sra (ix+##)'; leng: -2),
1104 (op: 'sra (ix+##),a'; leng: -2),
1105 (op: 'slai (ix+##),b'; leng: -2),
1106 (op: 'slai (ix+##),c'; leng: -2),
1107 (op: 'slai (ix+##),d'; leng: -2),
1108 (op: 'slai (ix+##),e'; leng: -2),
1109 (op: 'slai (ix+##),h'; leng: -2),
1110 (op: 'slai (ix+##),l'; leng: -2),
1111 (op: 'slai (ix+##)'; leng: -2),
1112 (op: 'slai (ix+##),a'; leng: -2),
1113 (op: 'srl (ix+##),b'; leng: -2),
1114 (op: 'srl (ix+##),c'; leng: -2),
1115 (op: 'srl (ix+##),d'; leng: -2),
1116 (op: 'srl (ix+##),e'; leng: -2),
1117 (op: 'srl (ix+##),h'; leng: -2),
1118 (op: 'srl (ix+##),l'; leng: -2),
1119 (op: 'srl (ix+##)'; leng: -2),
1120 (op: 'srl (ix+##),a'; leng: -2),
1121 (op: 'bit 0,(ix+##)'; leng: -2),
1122 (op: 'bit 0,(ix+##)'; leng: -2),
1123 (op: 'bit 0,(ix+##)'; leng: -2),
1124 (op: 'bit 0,(ix+##)'; leng: -2),
1125 (op: 'bit 0,(ix+##)'; leng: -2),
1126 (op: 'bit 0,(ix+##)'; leng: -2),
1127 (op: 'bit 0,(ix+##)'; leng: -2),
1128 (op: 'bit 0,(ix+##)'; leng: -2),
1129 (op: 'bit 1,(ix+##)'; leng: -2),
1130 (op: 'bit 1,(ix+##)'; leng: -2),
1131 (op: 'bit 1,(ix+##)'; leng: -2),
1132 (op: 'bit 1,(ix+##)'; leng: -2),
1133 (op: 'bit 1,(ix+##)'; leng: -2),
1134 (op: 'bit 1,(ix+##)'; leng: -2),
1135 (op: 'bit 1,(ix+##)'; leng: -2),
1136 (op: 'bit 1,(ix+##)'; leng: -2),
1137 (op: 'bit 2,(ix+##)'; leng: -2),
1138 (op: 'bit 2,(ix+##)'; leng: -2),
1139 (op: 'bit 2,(ix+##)'; leng: -2),
1140 (op: 'bit 2,(ix+##)'; leng: -2),
1141 (op: 'bit 2,(ix+##)'; leng: -2),
1142 (op: 'bit 2,(ix+##)'; leng: -2),
1143 (op: 'bit 2,(ix+##)'; leng: -2),
1144 (op: 'bit 2,(ix+##)'; leng: -2),
1145 (op: 'bit 3,(ix+##)'; leng: -2),
1146 (op: 'bit 3,(ix+##)'; leng: -2),
1147 (op: 'bit 3,(ix+##)'; leng: -2),
1148 (op: 'bit 3,(ix+##)'; leng: -2),
1149 (op: 'bit 3,(ix+##)'; leng: -2),
1150 (op: 'bit 3,(ix+##)'; leng: -2),
1151 (op: 'bit 3,(ix+##)'; leng: -2),
1152 (op: 'bit 3,(ix+##)'; leng: -2),
1153 (op: 'bit 4,(ix+##)'; leng: -2),
1154 (op: 'bit 4,(ix+##)'; leng: -2),
1155 (op: 'bit 4,(ix+##)'; leng: -2),
1156 (op: 'bit 4,(ix+##)'; leng: -2),
1157 (op: 'bit 4,(ix+##)'; leng: -2),
1158 (op: 'bit 4,(ix+##)'; leng: -2),
1159 (op: 'bit 4,(ix+##)'; leng: -2),
1160 (op: 'bit 4,(ix+##)'; leng: -2),
1161 (op: 'bit 5,(ix+##)'; leng: -2),
1162 (op: 'bit 5,(ix+##)'; leng: -2),
1163 (op: 'bit 5,(ix+##)'; leng: -2),
1164 (op: 'bit 5,(ix+##)'; leng: -2),
1165 (op: 'bit 5,(ix+##)'; leng: -2),
1166 (op: 'bit 5,(ix+##)'; leng: -2),
1167 (op: 'bit 5,(ix+##)'; leng: -2),
1168 (op: 'bit 5,(ix+##)'; leng: -2),
1169 (op: 'bit 6,(ix+##)'; leng: -2),
1170 (op: 'bit 6,(ix+##)'; leng: -2),
1171 (op: 'bit 6,(ix+##)'; leng: -2),
1172 (op: 'bit 6,(ix+##)'; leng: -2),
1173 (op: 'bit 6,(ix+##)'; leng: -2),
1174 (op: 'bit 6,(ix+##)'; leng: -2),
1175 (op: 'bit 6,(ix+##)'; leng: -2),
1176 (op: 'bit 6,(ix+##)'; leng: -2),
1177 (op: 'bit 7,(ix+##)'; leng: -2),
1178 (op: 'bit 7,(ix+##)'; leng: -2),
1179 (op: 'bit 7,(ix+##)'; leng: -2),
1180 (op: 'bit 7,(ix+##)'; leng: -2),
1181 (op: 'bit 7,(ix+##)'; leng: -2),
1182 (op: 'bit 7,(ix+##)'; leng: -2),
1183 (op: 'bit 7,(ix+##)'; leng: -2),
1184 (op: 'bit 7,(ix+##)'; leng: -2),
1185 (op: 'res 0,(ix+##),b'; leng: -2),
1186 (op: 'res 0,(ix+##),c'; leng: -2),
1187 (op: 'res 0,(ix+##),d'; leng: -2),
1188 (op: 'res 0,(ix+##),e'; leng: -2),
1189 (op: 'res 0,(ix+##),h'; leng: -2),
1190 (op: 'res 0,(ix+##),l'; leng: -2),
1191 (op: 'res 0,(ix+##)'; leng: -2),
1192 (op: 'res 0,(ix+##),a'; leng: -2),
1193 (op: 'res 1,(ix+##),b'; leng: -2),
1194 (op: 'res 1,(ix+##),c'; leng: -2),
1195 (op: 'res 1,(ix+##),d'; leng: -2),
1196 (op: 'res 1,(ix+##),e'; leng: -2),
1197 (op: 'res 1,(ix+##),h'; leng: -2),
1198 (op: 'res 1,(ix+##),l'; leng: -2),
1199 (op: 'res 1,(ix+##)'; leng: -2),
1200 (op: 'res 1,(ix+##),a'; leng: -2),
1201 (op: 'res 2,(ix+##),b'; leng: -2),
1202 (op: 'res 2,(ix+##),c'; leng: -2),
1203 (op: 'res 2,(ix+##),d'; leng: -2),
1204 (op: 'res 2,(ix+##),e'; leng: -2),
1205 (op: 'res 2,(ix+##),h'; leng: -2),
1206 (op: 'res 2,(ix+##),l'; leng: -2),
1207 (op: 'res 2,(ix+##)'; leng: -2),
1208 (op: 'res 2,(ix+##),a'; leng: -2),
1209 (op: 'res 3,(ix+##),b'; leng: -2),
1210 (op: 'res 3,(ix+##),c'; leng: -2),
1211 (op: 'res 3,(ix+##),d'; leng: -2),
1212 (op: 'res 3,(ix+##),e'; leng: -2),
1213 (op: 'res 3,(ix+##),h'; leng: -2),
1214 (op: 'res 3,(ix+##),l'; leng: -2),
1215 (op: 'res 3,(ix+##)'; leng: -2),
1216 (op: 'res 3,(ix+##),a'; leng: -2),
1217 (op: 'res 4,(ix+##),b'; leng: -2),
1218 (op: 'res 4,(ix+##),c'; leng: -2),
1219 (op: 'res 4,(ix+##),d'; leng: -2),
1220 (op: 'res 4,(ix+##),e'; leng: -2),
1221 (op: 'res 4,(ix+##),h'; leng: -2),
1222 (op: 'res 4,(ix+##),l'; leng: -2),
1223 (op: 'res 4,(ix+##)'; leng: -2),
1224 (op: 'res 4,(ix+##),a'; leng: -2),
1225 (op: 'res 5,(ix+##),b'; leng: -2),
1226 (op: 'res 5,(ix+##),c'; leng: -2),
1227 (op: 'res 5,(ix+##),d'; leng: -2),
1228 (op: 'res 5,(ix+##),e'; leng: -2),
1229 (op: 'res 5,(ix+##),h'; leng: -2),
1230 (op: 'res 5,(ix+##),l'; leng: -2),
1231 (op: 'res 5,(ix+##)'; leng: -2),
1232 (op: 'res 5,(ix+##),a'; leng: -2),
1233 (op: 'res 6,(ix+##),b'; leng: -2),
1234 (op: 'res 6,(ix+##),c'; leng: -2),
1235 (op: 'res 6,(ix+##),d'; leng: -2),
1236 (op: 'res 6,(ix+##),e'; leng: -2),
1237 (op: 'res 6,(ix+##),h'; leng: -2),
1238 (op: 'res 6,(ix+##),l'; leng: -2),
1239 (op: 'res 6,(ix+##)'; leng: -2),
1240 (op: 'res 6,(ix+##),a'; leng: -2),
1241 (op: 'res 7,(ix+##),b'; leng: -2),
1242 (op: 'res 7,(ix+##),c'; leng: -2),
1243 (op: 'res 7,(ix+##),d'; leng: -2),
1244 (op: 'res 7,(ix+##),e'; leng: -2),
1245 (op: 'res 7,(ix+##),h'; leng: -2),
1246 (op: 'res 7,(ix+##),l'; leng: -2),
1247 (op: 'res 7,(ix+##)'; leng: -2),
1248 (op: 'res 7,(ix+##),a'; leng: -2),
1249 (op: 'set 0,(ix+##),b'; leng: -2),
1250 (op: 'set 0,(ix+##),c'; leng: -2),
1251 (op: 'set 0,(ix+##),d'; leng: -2),
1252 (op: 'set 0,(ix+##),e'; leng: -2),
1253 (op: 'set 0,(ix+##),h'; leng: -2),
1254 (op: 'set 0,(ix+##),l'; leng: -2),
1255 (op: 'set 0,(ix+##)'; leng: -2),
1256 (op: 'set 0,(ix+##),a'; leng: -2),
1257 (op: 'set 1,(ix+##),b'; leng: -2),
1258 (op: 'set 1,(ix+##),c'; leng: -2),
1259 (op: 'set 1,(ix+##),d'; leng: -2),
1260 (op: 'set 1,(ix+##),e'; leng: -2),
1261 (op: 'set 1,(ix+##),h'; leng: -2),
1262 (op: 'set 1,(ix+##),l'; leng: -2),
1263 (op: 'set 1,(ix+##)'; leng: -2),
1264 (op: 'set 1,(ix+##),a'; leng: -2),
1265 (op: 'set 2,(ix+##),b'; leng: -2),
1266 (op: 'set 2,(ix+##),c'; leng: -2),
1267 (op: 'set 2,(ix+##),d'; leng: -2),
1268 (op: 'set 2,(ix+##),e'; leng: -2),
1269 (op: 'set 2,(ix+##),h'; leng: -2),
1270 (op: 'set 2,(ix+##),l'; leng: -2),
1271 (op: 'set 2,(ix+##)'; leng: -2),
1272 (op: 'set 2,(ix+##),a'; leng: -2),
1273 (op: 'set 3,(ix+##),b'; leng: -2),
1274 (op: 'set 3,(ix+##),c'; leng: -2),
1275 (op: 'set 3,(ix+##),d'; leng: -2),
1276 (op: 'set 3,(ix+##),e'; leng: -2),
1277 (op: 'set 3,(ix+##),h'; leng: -2),
1278 (op: 'set 3,(ix+##),l'; leng: -2),
1279 (op: 'set 3,(ix+##)'; leng: -2),
1280 (op: 'set 3,(ix+##),a'; leng: -2),
1281 (op: 'set 4,(ix+##),b'; leng: -2),
1282 (op: 'set 4,(ix+##),c'; leng: -2),
1283 (op: 'set 4,(ix+##),d'; leng: -2),
1284 (op: 'set 4,(ix+##),e'; leng: -2),
1285 (op: 'set 4,(ix+##),h'; leng: -2),
1286 (op: 'set 4,(ix+##),l'; leng: -2),
1287 (op: 'set 4,(ix+##)'; leng: -2),
1288 (op: 'set 4,(ix+##),a'; leng: -2),
1289 (op: 'set 5,(ix+##),b'; leng: -2),
1290 (op: 'set 5,(ix+##),c'; leng: -2),
1291 (op: 'set 5,(ix+##),d'; leng: -2),
1292 (op: 'set 5,(ix+##),e'; leng: -2),
1293 (op: 'set 5,(ix+##),h'; leng: -2),
1294 (op: 'set 5,(ix+##),l'; leng: -2),
1295 (op: 'set 5,(ix+##)'; leng: -2),
1296 (op: 'set 5,(ix+##),a'; leng: -2),
1297 (op: 'set 6,(ix+##),b'; leng: -2),
1298 (op: 'set 6,(ix+##),c'; leng: -2),
1299 (op: 'set 6,(ix+##),d'; leng: -2),
1300 (op: 'set 6,(ix+##),e'; leng: -2),
1301 (op: 'set 6,(ix+##),h'; leng: -2),
1302 (op: 'set 6,(ix+##),l'; leng: -2),
1303 (op: 'set 6,(ix+##)'; leng: -2),
1304 (op: 'set 6,(ix+##),a'; leng: -2),
1305 (op: 'set 7,(ix+##),b'; leng: -2),
1306 (op: 'set 7,(ix+##),c'; leng: -2),
1307 (op: 'set 7,(ix+##),d'; leng: -2),
1308 (op: 'set 7,(ix+##),e'; leng: -2),
1309 (op: 'set 7,(ix+##),h'; leng: -2),
1310 (op: 'set 7,(ix+##),l'; leng: -2),
1311 (op: 'set 7,(ix+##)'; leng: -2),
1312 (op: 'set 7,(ix+##),a'; leng: -2)));
1313
1314 function place(s: Format; Value: string): string;
1315 function Disassemble(var str: string; pc: word): word;
1316 function byte2hex(W: byte): string;
1317 function word2hex(W: word): string;
1318
1319 implementation
1320
1321 uses machine;
1322
1323 function place(s: Format; Value: string): string;
1324 var
1325 i, j: byte;
1326 begin
1327 j := 1;
1328 for i := 1 to length(s.op) do
1329 if (s.op[i] = '#') and (j <= length(Value)) then
1330 begin
1331 s.op[i] := Value[j];
1332 Inc(j);
1333 end;
1334 place := s.op;
1335 end;
1336
1337 const
1338 h: string = ('0123456789ABCDEF');
1339
1340 function byte2hex(W: byte): string;
1341 begin
1342 Result := h[W div 16 + 1] + h[W mod 16 + 1];
1343 end;
1344
1345 function word2hex(W: word): string;
1346 begin
1347 Result := byte2hex(Hi(W)) + byte2hex(Lo(W));
1348 end;
1349
1350 function Disassemble(var str: string; pc: word): word;
1351 var
1352 firstByte, i, j: integer;
1353 code: format;
1354 begin
1355 firstByte := speekb(pc);
1356 i := firstbyte;
1357 Inc(pc);
1358 if major[i].op = '' then
1359 begin
1360 j := major[i].leng;
1361 i := speekb(pc);
1362 Inc(pc);
1363 if minor[j][i].op = '' then
1364 begin
1365 j := minor[j][i].leng;
1366 i := speekb(pc + 1);
1367 end;
1368
1369 code := minor[j][i];
1370 end
1371 else
1372 code := major[i];
1373
1374 case (code.leng) of
1375 2:
1376 begin
1377 str := place(code, word2hex(wordpeek(pc)));
1378 Inc(pc, 2);
1379 end;
1380 1:
1381 begin
1382 str := place(code, byte2hex(speekb(pc)));
1383 Inc(pc);
1384 end;
1385 0: str := code.op;
1386 -1:
1387 begin
1388 str := place(code, word2hex((pc + 1 + shortint(speekb(pc)) and $ffff)));
1389 Inc(pc);
1390 end;
1391 -2:
1392 begin
1393 str := place(code, byte2hex(speekb(pc)));
1394 Inc(pc, 2);
1395 end;
1396 end;
1397 if (firstByte = $fd) then
1398 for i := 4 to length(str) do
1399 if str[i] = 'x' then
1400 str[i] := 'y';
1401 disassemble := pc;
1402 end;
1403
1404 end.
ModifiedGBEmu.lpi +37−69
@@ -78,146 +78,114 @@
78 <PackageName Value="LCL"/> 78 <PackageName Value="LCL"/>
79 </Item11> 79 </Item11>
80 </RequiredPackages> 80 </RequiredPackages>
81 <Units Count="27"> 81 <Units Count="21">
82 <Unit0> 82 <Unit0>
83 <Filename Value="GBEmu.lpr"/> 83 <Filename Value="GBEmu.lpr"/>
84 <IsPartOfProject Value="True"/> 84 <IsPartOfProject Value="True"/>
85 </Unit0> 85 </Unit0>
86 <Unit1> 86 <Unit1>
87 <Filename Value="UnitMain.pas"/> 87 <Filename Value="Gpu\gfx.pas"/>
88 <IsPartOfProject Value="True"/> 88 <IsPartOfProject Value="True"/>
89 <ComponentName Value="frmGameboy"/>
90 <HasResources Value="True"/>
91 <ResourceBaseClass Value="Form"/>
92 </Unit1> 89 </Unit1>
93 <Unit2> 90 <Unit2>
94 <Filename Value="Debugger\debugger.pas"/> 91 <Filename Value="Cpu\z80cpu.pas"/>
95 <IsPartOfProject Value="True"/> 92 <IsPartOfProject Value="True"/>
93 <UnitName Value="Z80CPU"/>
96 </Unit2> 94 </Unit2>
97 <Unit3> 95 <Unit3>
98 <Filename Value="Gpu\gfx.pas"/> 96 <Filename Value="Sound\sound.pas"/>
99 <IsPartOfProject Value="True"/> 97 <IsPartOfProject Value="True"/>
100 </Unit3> 98 </Unit3>
101 <Unit4> 99 <Unit4>
102 <Filename Value="Cpu\machine.pas"/> 100 <Filename Value="Global\vars.pas"/>
103 <IsPartOfProject Value="True"/> 101 <IsPartOfProject Value="True"/>
104 </Unit4> 102 </Unit4>
105 <Unit5> 103 <Unit5>
106 <Filename Value="Cpu\z80cpu.pas"/> 104 <Filename Value="mainloop.pas"/>
107 <IsPartOfProject Value="True"/> 105 <IsPartOfProject Value="True"/>
108 <UnitName Value="Z80CPU"/>
109 </Unit5> 106 </Unit5>
110 <Unit6> 107 <Unit6>
111 <Filename Value="Sound\sound.pas"/>
112 <IsPartOfProject Value="True"/>
113 </Unit6>
114 <Unit7>
115 <Filename Value="Global\vars.pas"/>
116 <IsPartOfProject Value="True"/>
117 </Unit7>
118 <Unit8>
119 <Filename Value="mainloop.pas"/>
120 <IsPartOfProject Value="True"/>
121 </Unit8>
122 <Unit9>
123 <Filename Value="Debugger\UnitDebug.pas"/>
124 <IsPartOfProject Value="True"/>
125 <HasResources Value="True"/>
126 </Unit9>
127 <Unit10>
128 <Filename Value="Debugger\UnitMapview.pas"/>
129 <IsPartOfProject Value="True"/>
130 <HasResources Value="True"/>
131 </Unit10>
132 <Unit11>
133 <Filename Value="tracker.pas"/> 108 <Filename Value="tracker.pas"/>
134 <IsPartOfProject Value="True"/> 109 <IsPartOfProject Value="True"/>
135 <ComponentName Value="frmTracker"/> 110 <ComponentName Value="frmTracker"/>
136 <HasResources Value="True"/> 111 <HasResources Value="True"/>
137 <ResourceBaseClass Value="Form"/> 112 <ResourceBaseClass Value="Form"/>
138 <UnitName Value="Tracker"/> 113 <UnitName Value="Tracker"/>
139 </Unit11> 114 </Unit6>
140 <Unit12> 115 <Unit7>
141 <Filename Value="about.pas"/> 116 <Filename Value="about.pas"/>
142 <IsPartOfProject Value="True"/> 117 <IsPartOfProject Value="True"/>
143 <ComponentName Value="frmAbout"/> 118 <ComponentName Value="frmAbout"/>
144 <HasResources Value="True"/> 119 <HasResources Value="True"/>
145 <ResourceBaseClass Value="Form"/> 120 <ResourceBaseClass Value="Form"/>
146 <UnitName Value="About"/> 121 <UnitName Value="About"/>
147 </Unit12> 122 </Unit7>
148 <Unit13> 123 <Unit8>
149 <Filename Value="instruments.pas"/> 124 <Filename Value="instruments.pas"/>
150 <IsPartOfProject Value="True"/> 125 <IsPartOfProject Value="True"/>
151 </Unit13> 126 </Unit8>
152 <Unit14> 127 <Unit9>
153 <Filename Value="song.pas"/> 128 <Filename Value="song.pas"/>
154 <IsPartOfProject Value="True"/> 129 <IsPartOfProject Value="True"/>
155 <UnitName Value="Song"/> 130 <UnitName Value="Song"/>
156 </Unit14> 131 </Unit9>
157 <Unit15> 132 <Unit10>
158 <Filename Value="emulationthread.pas"/> 133 <Filename Value="emulationthread.pas"/>
159 <IsPartOfProject Value="True"/> 134 <IsPartOfProject Value="True"/>
160 <UnitName Value="EmulationThread"/> 135 <UnitName Value="EmulationThread"/>
161 </Unit15> 136 </Unit10>
162 <Unit16> 137 <Unit11>
163 <Filename Value="utils.pas"/> 138 <Filename Value="utils.pas"/>
164 <IsPartOfProject Value="True"/> 139 <IsPartOfProject Value="True"/>
165 <UnitName Value="Utils"/> 140 <UnitName Value="Utils"/>
166 </Unit16> 141 </Unit11>
167 <Unit17> 142 <Unit12>
168 <Filename Value="constants.pas"/> 143 <Filename Value="constants.pas"/>
169 <IsPartOfProject Value="True"/> 144 <IsPartOfProject Value="True"/>
170 <UnitName Value="Constants"/> 145 <UnitName Value="Constants"/>
171 </Unit17> 146 </Unit12>
172 <Unit18> 147 <Unit13>
173 <Filename Value="waves.pas"/> 148 <Filename Value="waves.pas"/>
174 <IsPartOfProject Value="True"/> 149 <IsPartOfProject Value="True"/>
175 <UnitName Value="Waves"/> 150 <UnitName Value="Waves"/>
176 </Unit18> 151 </Unit13>
177 <Unit19> 152 <Unit14>
178 <Filename Value="about_hugetracker.pas"/> 153 <Filename Value="about_hugetracker.pas"/>
179 <IsPartOfProject Value="True"/> 154 <IsPartOfProject Value="True"/>
180 <ComponentName Value="frmAboutHugetracker"/> 155 <ComponentName Value="frmAboutHugetracker"/>
181 <HasResources Value="True"/> 156 <HasResources Value="True"/>
182 <ResourceBaseClass Value="Form"/> 157 <ResourceBaseClass Value="Form"/>
183 </Unit19> 158 </Unit14>
184 <Unit20> 159 <Unit15>
185 <Filename Value="trackergrid.pas"/> 160 <Filename Value="trackergrid.pas"/>
186 <IsPartOfProject Value="True"/> 161 <IsPartOfProject Value="True"/>
187 <UnitName Value="TrackerGrid"/> 162 <UnitName Value="TrackerGrid"/>
188 </Unit20> 163 </Unit15>
189 <Unit21> 164 <Unit16>
190 <Filename Value="patterns.pas"/> 165 <Filename Value="patterns.pas"/>
191 <IsPartOfProject Value="True"/> 166 <IsPartOfProject Value="True"/>
192 <UnitName Value="Patterns"/> 167 <UnitName Value="Patterns"/>
193 </Unit21> 168 </Unit16>
194 <Unit22> 169 <Unit17>
195 <Filename Value="clipboardutils.pas"/> 170 <Filename Value="clipboardutils.pas"/>
196 <IsPartOfProject Value="True"/> 171 <IsPartOfProject Value="True"/>
197 <UnitName Value="ClipboardUtils"/> 172 <UnitName Value="ClipboardUtils"/>
198 </Unit22> 173 </Unit17>
199 <Unit23> 174 <Unit18>
200 <Filename Value="hugedatatypes.pas"/> 175 <Filename Value="hugedatatypes.pas"/>
201 <IsPartOfProject Value="True"/> 176 <IsPartOfProject Value="True"/>
202 <UnitName Value="HugeDatatypes"/> 177 <UnitName Value="HugeDatatypes"/>
203 </Unit23> 178 </Unit18>
204 <Unit24> 179 <Unit19>
205 <Filename Value="codegen.pas"/> 180 <Filename Value="codegen.pas"/>
206 <IsPartOfProject Value="True"/> 181 <IsPartOfProject Value="True"/>
207 <UnitName Value="Codegen"/> 182 <UnitName Value="Codegen"/>
208 </Unit24> 183 </Unit19>
209 <Unit25> 184 <Unit20>
210 <Filename Value="unit1.pas"/>
211 <IsPartOfProject Value="True"/>
212 <ComponentName Value="Form1"/>
213 <ResourceBaseClass Value="Form"/>
214 <UnitName Value="Unit1"/>
215 </Unit25>
216 <Unit26>
217 <Filename Value="symparser.pas"/> 185 <Filename Value="symparser.pas"/>
218 <IsPartOfProject Value="True"/> 186 <IsPartOfProject Value="True"/>
219 <UnitName Value="SymParser"/> 187 <UnitName Value="SymParser"/>
220 </Unit26> 188 </Unit20>
221 </Units> 189 </Units>
222 </ProjectOptions> 190 </ProjectOptions>
223 <CompilerOptions> 191 <CompilerOptions>
@@ -225,7 +193,7 @@
225 <PathDelim Value="\"/> 193 <PathDelim Value="\"/>
226 <SearchPaths> 194 <SearchPaths>
227 <IncludeFiles Value="Debugger;Directx;GPU;CPU;Sound;Global;Components;$(ProjOutDir)"/> 195 <IncludeFiles Value="Debugger;Directx;GPU;CPU;Sound;Global;Components;$(ProjOutDir)"/>
228 <OtherUnitFiles Value="Debugger;GPU;CPU;Sound;Global"/> 196 <OtherUnitFiles Value="GPU;CPU;Sound;Global"/>
229 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 197 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
230 </SearchPaths> 198 </SearchPaths>
231 <Parsing> 199 <Parsing>
ModifiedGBEmu.lpr +5−6
@@ -3,19 +3,18 @@ program GBEmu;
3 {$MODE Delphi} 3 {$MODE Delphi}
4 4
5 uses 5 uses
6 {$ifdef unix}
7 cthreads,
8 cmem, // the c memory manager is on some systems much faster for multi-threading
9 {$endif}
6 Forms, 10 Forms,
7 Interfaces, 11 Interfaces,
8 UnitMain in 'UnitMain.pas' {frmGameboy},
9 Tracker in 'Tracker.pas', 12 Tracker in 'Tracker.pas',
10 debugger in 'Debugger\debugger.pas',
11 gfx in 'GPU\gfx.pas', 13 gfx in 'GPU\gfx.pas',
12 machine in 'CPU\machine.pas',
13 Z80CPU in 'CPU\z80cpu.pas', 14 Z80CPU in 'CPU\z80cpu.pas',
14 sound in 'Sound\sound.pas', 15 sound in 'Sound\sound.pas',
15 vars in 'Global\vars.pas', 16 vars in 'Global\vars.pas',
16 mainloop in 'mainloop.pas', 17 mainloop in 'mainloop.pas';
17 UnitDebug in 'Debugger\UnitDebug.pas' {frmDebug},
18 UnitMapview in 'Debugger\UnitMapview.pas' {frmMapview};
19 18
20 {.$R *.RES} 19 {.$R *.RES}
21 20
DeletedUnitMain.pas +0−568
@@ -1,568 +0,0 @@
1 {+-----------------------------------------------------------------------------+
2 | Author: Christian Hackbart
3 | Description: main Unit
4 | Copyright (c) 2000 Christian Hackbart
5 | Stand: 15.12.2000
6 |
7 | http://www.tu-ilmenau.de/~hackbart
8 +----------------------------------------------------------------------------+}
9
10 unit UnitMain;
11
12 {$MODE Delphi}
13
14 interface
15
16 uses
17 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
18 lcl_out, vars, z80cpu, mainloop, machine, debugger, sound,
19 StdCtrls, ExtCtrls, ComCtrls, Menus;
20
21 type
22
23 { TfrmGameboy }
24
25 TfrmGameboy = class(TForm)
26 MainMenu: TMainMenu;
27 File1: TMenuItem;
28 Load1: TMenuItem;
29 N3: TMenuItem;
30 Message1: TMenuItem;
31 N4: TMenuItem;
32 Exit1: TMenuItem;
33 CPU1: TMenuItem;
34 PaintBox1: TPaintBox;
35 Reset2: TMenuItem;
36 Pause1: TMenuItem;
37 N2: TMenuItem;
38 LoadStat: TMenuItem;
39 SaveStat: TMenuItem;
40 N8: TMenuItem;
41 Dump1: TMenuItem;
42 MemoryMap1: TMenuItem;
43 RamBank1: TMenuItem;
44 ChrData1: TMenuItem;
45 N1: TMenuItem;
46 CGBVRAM1: TMenuItem;
47 CGBWRAM1: TMenuItem;
48 CGBCRAM1: TMenuItem;
49 N9: TMenuItem;
50 SGBVRAM1: TMenuItem;
51 sgbtiledata1: TMenuItem;
52 Option3: TMenuItem;
53 AutoWait: TMenuItem;
54 FrameSkip1: TMenuItem;
55 N01: TMenuItem;
56 N11: TMenuItem;
57 N21: TMenuItem;
58 N31: TMenuItem;
59 N41: TMenuItem;
60 N51: TMenuItem;
61 Priority: TMenuItem;
62 priority1: TMenuItem;
63 priority2: TMenuItem;
64 priority3: TMenuItem;
65 N14: TMenuItem;
66 priority4: TMenuItem;
67 N12: TMenuItem;
68 Video1: TMenuItem;
69 x11: TMenuItem;
70 x21: TMenuItem;
71 x31: TMenuItem;
72 x41: TMenuItem;
73 N7: TMenuItem;
74 full1: TMenuItem;
75 fullscreen1: TMenuItem;
76 full2: TMenuItem;
77 full3: TMenuItem;
78 full4: TMenuItem;
79 Sound1: TMenuItem;
80 Off: TMenuItem;
81 N6: TMenuItem;
82 Ch1: TMenuItem;
83 Ch2: TMenuItem;
84 Ch3: TMenuItem;
85 Ch4: TMenuItem;
86 Net1: TMenuItem;
87 N15: TMenuItem;
88 SerialIF1: TMenuItem;
89 serial1: TMenuItem;
90 serial2: TMenuItem;
91 serial3: TMenuItem;
92 Palette1: TMenuItem;
93 preset11: TMenuItem;
94 preset21: TMenuItem;
95 preset31: TMenuItem;
96 preset41: TMenuItem;
97 preset51: TMenuItem;
98 N10: TMenuItem;
99 Setting1: TMenuItem;
100 StatusBar: TStatusBar;
101 OpenDialog: TOpenDialog;
102 Debugger: TMenuItem;
103 SaveDialog: TSaveDialog;
104 Timer: TTimer;
105 procedure FormCreate(Sender: TObject);
106 procedure FormClose(Sender: TObject; var Action: TCloseAction);
107 procedure FileOpenClick(Sender: TObject);
108 procedure KillClick(Sender: TObject);
109 procedure FormActivate(Sender: TObject);
110 procedure Exit1Click(Sender: TObject);
111 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
112 procedure FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
113 procedure FrameClick(Sender: TObject);
114 procedure PaintBox1Paint(Sender: TObject);
115 procedure Pause(Sender: TObject);
116 procedure ResetClick(Sender: TObject);
117 procedure setPriority(Sender: TObject);
118 procedure setResolution(Sender: TObject);
119 procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
120 Shift: TShiftState; X, Y: integer);
121 procedure DebuggerClick(Sender: TObject);
122 procedure FormResize(Sender: TObject);
123 procedure AutoWaitClick(Sender: TObject);
124 procedure LoadStatClick(Sender: TObject);
125 procedure SaveStatClick(Sender: TObject);
126 procedure SetSound(Sender: TObject);
127 procedure TimerTimer(Sender: TObject);
128 procedure SetAudioChannel(Sender: TObject);
129 private
130 { Private-Deklarationen}
131 fullwindow: boolean;
132 FDiff: integer; // Caption Height
133 RomFileName: String;
134
135 procedure Emulation(var msg: TMessage); message wm_user;
136 procedure SetWindow;
137 procedure LoadRom(Rom: String);
138
139 procedure ShowCaption;
140 procedure RemoveCaption;
141 public
142 { Public-Deklarationen}
143 timervar: byte;
144 end;
145
146 var
147 frmGameboy: TfrmGameboy;
148
149 implementation
150
151 uses UnitMapview;
152
153 {$R *.lfm}
154
155
156 procedure TfrmGameboy.RemoveCaption;
157 begin
158 FDiff := GetSystemMetrics(SM_CYCAPTION);
159 SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_Style) and not WS_Caption);
160 Height := Height - FDiff;
161 Height := Height + FDiff;
162 end;
163
164 procedure TfrmGameboy.ShowCaption;
165 begin
166 if Self.ComponentState = [csDestroying] then
167 exit;
168 SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_Style) + WS_Caption);
169 Height := Height + FDiff;
170 Height := Height - FDiff;
171 end;
172
173 procedure TfrmGameboy.FormCreate(Sender: TObject);
174 begin
175 loadstat.Enabled := False;
176 savestat.Enabled := False;
177
178 f_stopped := True;
179 randomize;
180 Height := 144 * 2;
181 Width := 160 * 2;
182
183 StartLCL;
184
185 make_pix;
186 SetPriority(priority2); // normal Priority
187
188 if assigned(cart) then
189 freemem(cart, cartsize);
190 z80_reset;
191
192 SetAudioChannel(Self);
193 enablesound;
194 end;
195
196 procedure TfrmGameboy.FormClose(Sender: TObject; var Action: TCloseAction);
197 begin
198 if assigned(cart) then
199 freemem(cart, cartsize);
200 f_stopped := False;
201 application.terminate;
202 end;
203
204 const
205 CyclesPerFrame : Integer = 70224;
206 TimePerFrame: Double = 1.0 / 60.0;
207
208 procedure TfrmGameboy.Emulation(var Msg: TMessage);
209 var
210 li: Large_Integer;
211 tickFreq, cycles: Integer;
212 frameStart, frameEnd: Integer;
213 frameElapsedInSec: Double;
214 function GetCounter: Integer;
215 begin
216 QueryPerformanceCounter(@li);
217 Result := li.QuadPart
218 end;
219 begin
220 lastTime := 0;
221
222 cycles := 0;
223
224 QueryPerformanceFrequency(@li);
225 tickFreq := li.QuadPart;
226 FrameStart := GetCounter;
227
228 repeat
229 application.ProcessMessages;
230
231 // Pause
232 if f_stopped then begin
233 while f_stopped do
234 application.ProcessMessages;
235
236 FrameStart := GetCounter;
237 frameEnd := 0
238 end;
239
240 while (cycles < CyclesPerFrame) do
241 cycles += z80_decode;
242
243 cycles -= CyclesPerFrame;
244
245 repeat
246 FrameEnd := GetCounter;
247
248 frameElapsedInSec := (frameEnd - frameStart) / tickFreq;
249 until (frameElapsedInSec > TimePerFrame) and (not SoundBufferTooFull);
250
251 frameStart := frameEnd;
252 until application.Terminated;
253 end;
254
255 procedure TfrmGameboy.LoadRom(Rom: String);
256 begin
257 RomFileName := Rom;
258
259 f_stopped := True;
260 load(Rom);
261 statusbar.Panels[2].Text := getcompany;
262 statusbar.Panels[1].Text := speicher;
263 statusbar.panels[0].Text := romname;
264 z80_reset;
265 z80_reset;
266 ResetSound;
267 f_stopped := False;
268 gb_speed := 1;
269 loadstat.Enabled := True;
270 savestat.Enabled := True;
271 end;
272
273 procedure TfrmGameboy.FileOpenClick(Sender: TObject);
274 begin
275 loadstat.Enabled := False;
276 savestat.Enabled := False;
277
278 opendialog.Filter :=
279 'All Roms [*.gb;*.gbc;*.rom]|*.gb;*.gbc;*.rom|Gameboy [*.gb]|*.gb|Gameboy Color [*.gbc]|*.gbc|All Files [*.*]|*.*';
280
281 if opendialog.Execute then LoadRom(opendialog.filename);
282 end;
283
284 procedure TfrmGameboy.KillClick(Sender: TObject);
285 var
286 i: byte;
287 begin
288 for i := 1 to 4 do
289 z80_Reset;
290 end;
291
292 procedure TfrmGameboy.FormActivate(Sender: TObject);
293 begin
294 onActivate := nil;
295 repaint;
296 with statusbar do
297 begin
298 Panels[2].Text := getcompany;
299 Panels[1].Text := speicher;
300 panels[0].Text := romname;
301 end;
302 z80_reset;
303 z80_reset;
304 f_stopped := True;
305 gb_speed := 1;
306
307 frmGameboy.DoubleBuffered := True;
308 //SetPaintBox(PaintBox1);
309 postmessage(handle, wm_user, 0, 0);
310
311 if ParamCount >= 1 then
312 LoadRom(ParamStr(1));
313 end;
314
315 procedure TfrmGameboy.Exit1Click(Sender: TObject);
316 begin
317 Close;
318 end;
319
320 procedure TfrmGameboy.FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
321 begin
322 case key of
323 Ord('Y'): k_b := 0;
324 Ord('X'): k_a := 0;
325 Ord('A'): k_start := 0;
326 Ord('S'): k_select := 0;
327 Ord('P'):
328 begin
329 f_stopped := not f_stopped;
330 pause1.Checked := f_stopped;
331 end;
332 Ord('R'): LoadRom(RomFileName);
333 VK_UP: k_up := 0;
334 VK_DOWN: k_down := 0;
335 VK_LEFT: k_left := 0;
336 VK_RIGHT: k_right := 0;
337 VK_F1:
338 begin
339 ch1.Checked := not Ch1.Checked;
340 snd[1].ChannelOFF := not ch1.Checked;
341 end;
342 VK_F2:
343 begin
344 ch2.Checked := not Ch2.Checked;
345 snd[2].ChannelOFF := not ch2.Checked;
346 end;
347 VK_F3:
348 begin
349 ch3.Checked := not Ch3.Checked;
350 snd[3].ChannelOFF := not ch3.Checked;
351 end;
352 VK_F4:
353 begin
354 ch4.Checked := not Ch4.Checked;
355 snd[4].ChannelOFF := not ch4.Checked;
356 end;
357 end;
358 end;
359
360 procedure TfrmGameboy.FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
361 begin
362 case KEY of
363 Ord('Y'): k_b := 1;
364 Ord('X'): k_a := 1;
365 Ord('A'): k_start := 1;
366 Ord('B'): k_select := 1;
367 VK_UP: k_up := 1;
368 VK_DOWN: k_down := 1;
369 VK_LEFT: k_left := 1;
370 VK_RIGHT: k_right := 1;
371 end;
372 end;
373
374 procedure TfrmGameboy.FrameClick(Sender: TObject);
375 begin
376 n01.Checked := False;
377 n11.Checked := False;
378 n21.Checked := False;
379 n31.Checked := False;
380 n41.Checked := False;
381 n51.Checked := False;
382
383 tmenuitem(Sender).Checked := True;
384 end;
385
386 procedure TfrmGameboy.PaintBox1Paint(Sender: TObject);
387 begin
388 UpdateCanvas(PaintBox1.Width, PaintBox1.Height, PaintBox1.Canvas);
389 end;
390
391 procedure TfrmGameboy.Pause(Sender: TObject);
392 begin
393 pause1.Checked := not pause1.Checked;
394 f_stopped := pause1.Checked;
395 end;
396
397 procedure TfrmGameboy.ResetClick(Sender: TObject);
398 begin
399 z80_reset;
400 end;
401
402 procedure TfrmGameboy.setPriority(Sender: TObject);
403 var
404 ProcessID: DWORD;
405 ProcessHandle: THandle;
406 Priority: integer;
407 begin
408 { HIGH_PRIORITY_CLASS,
409 IDLE_PRIORITY_CLASS,
410 NORMAL_PRIORITY_CLASS
411 REALTIME_PRIORITY_CLASS}
412 {THREAD_PRIORITY_ABOVE_NORMAL,
413 THREAD_PRIORITY_BELOW_NORMAL,
414 THREAD_PRIORITY_HIGHEST,
415 THREAD_PRIORITY_IDLE,
416 THREAD_PRIORITY_LOWEST,
417 THREAD_PRIORITY_NORMAL,
418 THREAD_PRIORITY_TIME_CRITICAL}
419
420 priority1.Checked := False;
421 priority2.Checked := False;
422 priority3.Checked := False;
423 priority4.Checked := False;
424 tmenuitem(Sender).Checked := True;
425
426 if Sender = priority1 then
427 priority := IDLE_PRIORITY_CLASS;
428 if Sender = priority2 then
429 priority := NORMAL_PRIORITY_CLASS;
430 if Sender = priority3 then
431 priority := HIGH_PRIORITY_CLASS;
432 if Sender = priority4 then
433 priority := REALTIME_PRIORITY_CLASS;
434
435 ProcessID := GetCurrentProcessID;
436 ProcessHandle := OpenProcess(PROCESS_SET_INFORMATION, False, ProcessID);
437 SetPriorityClass(ProcessHandle, Priority);
438 { ThreadHandle := GetCurrentThread;
439 SetThreadPriority(ThreadHandle, THREAD_PRIORITY_HIGHEST);}
440 end;
441
442 procedure TfrmGameboy.setResolution(Sender: TObject);
443 begin
444 // Resolution
445 Width := 160;
446 Height := 144;
447 if Sender = x21 then
448 begin
449 Width := 160 * 2;
450 Height := 144 * 2;
451 end;
452 if Sender = x31 then
453 begin
454 Width := 160 * 3;
455 Height := 144 * 3;
456 end;
457 if Sender = x41 then
458 begin
459 Width := 160 * 4;
460 Height := 144 * 4;
461 end;
462 Width := Width + 8;
463 if not fullwindow then
464 Height := Height + statusbar.Height + 46;
465 end;
466
467 procedure TfrmGameboy.SetWindow;
468 begin
469 fullwindow := not fullwindow;
470 if fullwindow then
471 begin
472 Menu := nil;
473 statusbar.Hide;
474 RemoveCaption;
475 end
476 else
477 begin
478 Menu := mainmenu;
479 statusbar.Show;
480 ShowCaption;
481 end;
482 end;
483
484 procedure TfrmGameboy.FormMouseDown(Sender: TObject; Button: TMouseButton;
485 Shift: TShiftState; X, Y: integer);
486 begin
487 if button = mbRight then
488 SetWindow
489 else
490 if (button = mbleft) and (fullwindow) then
491 begin
492 releasecapture;
493 TWincontrol(Self).Perform(WM_syscommand, $F012, 0);
494 end;
495 end;
496
497 procedure TfrmGameboy.DebuggerClick(Sender: TObject);
498 begin
499 //frmdebug.show;
500 frmMapview.Show;
501 frmMapview.Update;
502 end;
503
504 procedure TfrmGameboy.FormResize(Sender: TObject);
505 begin
506 if f_stopped then
507 exit;
508 statusbar.Panels[0].Text := IntToStr(Height) + ':' + IntToStr(Width);
509 end;
510
511 procedure TfrmGameboy.AutoWaitClick(Sender: TObject);
512 begin
513 AutoWait.Checked := not AutoWait.Checked;
514 end;
515
516 procedure TfrmGameboy.LoadStatClick(Sender: TObject);
517 begin
518 openDialog.filter := 'Savestate (*.gbs)|*.gbs';
519 if opendialog.Execute then
520 case ReadGameState(opendialog.filename) of
521 1: ShowMessage('This ROM does not use a RAM...');
522 2: ShowMessage('File not found...');
523 3: ShowMessage('Not a valid Savegame...');
524 end;
525 end;
526
527 procedure TfrmGameboy.SaveStatClick(Sender: TObject);
528 begin
529 saveDialog.filter := 'Savestate (*.gbs)|*.gbs';
530 if savedialog.Execute then
531 SaveGameState(savedialog.filename);
532 end;
533
534 procedure TfrmGameboy.SetSound(Sender: TObject);
535 begin
536 off.Checked := not off.Checked;
537 if not off.Checked then
538 enablesound
539 else
540 disablesound;
541 end;
542
543 procedure TfrmGameboy.TimerTimer(Sender: TObject);
544 begin
545 Inc(timervar);
546 end;
547
548 procedure TfrmGameboy.SetAudioChannel(Sender: TObject);
549 begin
550 if Sender = ch1 then
551 ch1.Checked := not ch1.Checked
552 else
553 if Sender = ch2 then
554 ch2.Checked := not ch2.Checked
555 else
556 if Sender = ch3 then
557 ch3.Checked := not ch3.Checked
558 else
559 if Sender = ch4 then
560 ch4.Checked := not ch4.Checked;
561
562 snd[1].ChannelOFF := not CH1.Checked;
563 snd[2].ChannelOFF := not CH2.Checked;
564 snd[3].ChannelOFF := not CH3.Checked;
565 snd[4].ChannelOFF := not CH4.Checked;
566 end;
567
568 end.
Modifiedemulationthread.pas +0−4
@@ -5,10 +5,6 @@ unit EmulationThread;
5 interface 5 interface
6 6
7 uses 7 uses
8 {$ifdef unix}
9 cthreads,
10 cmem, // the c memory manager is on some systems much faster for multi-threading
11 {$endif}
12 Classes, SysUtils, epiktimer; 8 Classes, SysUtils, epiktimer;
13 9
14 type 10 type
Modifiedtracker.pas +1−1
@@ -491,7 +491,7 @@ end;
491 491
492 procedure TfrmTracker.RecreateTrackerGrid; 492 procedure TfrmTracker.RecreateTrackerGrid;
493 begin 493 begin
494 if TrackerGrid <> nil then TrackerGrid.Free; 494 if Assigned(TrackerGrid) then TrackerGrid.Free;
495 TrackerGrid := TTrackerGrid.Create(Self, ScrollBox1, Song.Patterns); 495 TrackerGrid := TTrackerGrid.Create(Self, ScrollBox1, Song.Patterns);
496 end; 496 end;
497 497
Modifiedtrackergrid.pas +1−1
@@ -691,7 +691,7 @@ begin
691 Pen.Color := RGBToColor(58, 52, 39); 691 Pen.Color := RGBToColor(58, 52, 39);
692 692
693 for I := 0 to High(Patterns) do 693 for I := 0 to High(Patterns) do
694 if Patterns[I] <> nil then 694 if Assigned(Patterns[I]) then
695 RenderCell(Patterns[I]^[Row]); 695 RenderCell(Patterns[I]^[Row]);
696 end; 696 end;
697 end; 697 end;