Commit f8129f5

Nick committed on
Initial commit of Hackbart's UGE gameboy emulator.
commit f8129f512d5980b2ed662f2949167ef26ec4ace9
44 changed files +39210−0
Added.gitignore +6−0
@@ -0,0 +1,6 @@
1 AutomaticConversion.log
2 backup
3 ConverterBackup
4 **/backup
5 lib
6 *.exe
AddedComponents/AgOpenDialog.pas +186−0
@@ -0,0 +1,186 @@
1 (************************************************************
2 Author: Deepak Shenoy
3 [email protected]
4 Copyright (C) 2000 Agni Software Pvt. Ltd.
5 All Rights Reserved.
6 http://www.agnisoft.com
7
8 Change Log:
9 11.09.2000
10 Now works for Windows ME too. Thanks to Petri Mustonen <[email protected]>
11 and Mark Carrington <[email protected]> for their help and code.
12 06.03.2000
13 Bug fix on suggestion from Jean-Fabien Connault <[email protected]> (Thanks)
14 Save Dialog on Win9x/NT would show "Open" as the caption if no title was
15 assigned. Added DoExecute Procedure.
16
17 22.01.2000
18 IsWin2000 fix on suggestion from Jean-Fabien Connault <[email protected]>
19 - Major Version check should be >= 5
20 ********************************************************)
21
22 unit AgOpenDialog;
23
24 {$MODE Delphi}
25
26 interface
27
28 uses
29 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, CommDlg;
30
31 type
32 TAgOpenDialog = class(TOpenDialog)
33 protected
34 FShowPlacesBar : boolean; // shows the left bar
35 FInterceptor : Pointer; // pointer to intercepting function
36 function IsWin2000 : boolean; // are we on Windows2000?
37 public
38 constructor Create(AOwner: TComponent); override;
39 function Execute: Boolean; override;
40 published
41 property ShowPlacesBar : boolean read FShowPlacesBar write FShowPlacesBar;
42 end;
43
44 TAgSaveDialog = class(TAgOpenDialog)
45 public
46 constructor Create(AOwner: TComponent); override;
47 function Execute: Boolean; override;
48 end;
49
50
51 procedure Register;
52
53 type
54 TOpenFileNameEx = packed record
55 lStructSize: DWORD;
56 hWndOwner: HWND;
57 hInstance: HINST;
58 lpstrFilter: PAnsiChar;
59 lpstrCustomFilter: PAnsiChar;
60 nMaxCustFilter: DWORD;
61 nFilterIndex: DWORD;
62 lpstrFile: PAnsiChar;
63 nMaxFile: DWORD;
64 lpstrFileTitle: PAnsiChar;
65 nMaxFileTitle: DWORD;
66 lpstrInitialDir: PAnsiChar;
67 lpstrTitle: PAnsiChar;
68 Flags: DWORD;
69 nFileOffset: Word;
70 nFileExtension: Word;
71 lpstrDefExt: PAnsiChar;
72 lCustData: LPARAM;
73 lpfnHook: function(Wnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
74 lpTemplateName: PAnsiChar;
75 pvReserved : Pointer;
76 dwReserved : DWORD;
77 FlagsEx : DWORD;
78 end;
79
80 const OFN_EX_NOPLACESBAR = 1;
81
82 function GetOpenFileNameEx(var OpenFile: TOpenFilenameEx): Bool; stdcall;
83 function GetSaveFileNameEx(var OpenFile: TOpenFilenameEx): Bool; stdcall;
84 implementation
85
86 {$R *.res}
87
88 function GetOpenFileNameEx; external 'comdlg32.dll' name 'GetOpenFileNameA';
89 function GetSaveFileNameEx; external 'comdlg32.dll' name 'GetSaveFileNameA';
90
91 procedure Register;
92 begin
93 RegisterComponents('Samples', [TAgOpenDialog, TAgSaveDialog]);
94 end;
95
96 var
97 CurInstanceShowPlacesBar : boolean;
98
99 function OpenInterceptor(var DialogData: TOpenFileName): Bool; stdcall;
100 var DialogDataEx : TOpenFileNameEx;
101 begin
102 Move(DialogData, DialogDataEx, sizeof(DialogData));
103 if CurInstanceShowPlacesBar then
104 DialogDataEx.FlagsEx := 0
105 else
106 DialogDataEx.FlagsEx := OFN_EX_NOPLACESBAR;
107 DialogDataEx.lStructSize := sizeof(TOpenFileNameEx); // size of new structure
108 Result := GetOpenFileNameEx( DialogDataEx );
109 end;
110
111 function SaveInterceptor(var DialogData: TOpenFileName): Bool; stdcall;
112 var DialogDataEx : TOpenFileNameEx;
113 begin
114 Move(DialogData, DialogDataEx, sizeof(DialogData));
115 if CurInstanceShowPlacesBar then
116 DialogDataEx.FlagsEx := 0
117 else
118 DialogDataEx.FlagsEx := 1;
119 DialogDataEx.lStructSize := sizeof(TOpenFileNameEx); // size of new structure
120 Result := GetSaveFileNameEx( DialogDataEx );
121 end;
122
123 { TAgOpenDialog }
124
125 constructor TAgOpenDialog.Create(AOwner: TComponent);
126 begin
127 inherited;
128 FShowPlacesBar := TRUE;
129 FInterceptor := @OpenInterceptor;
130 end;
131
132 function TAgOpenDialog.Execute: Boolean;
133 begin
134 if IsWin2000 then
135 begin
136 CurInstanceShowPlacesBar := FShowPlacesBar;
137 Result := True; //DoExecute(FInterceptor);
138 end
139 else
140 Result := inherited Execute;
141 end;
142
143 // CHANGED - 11 Sep 2000
144 // Function returns true on Windows ME too. Should change the name.
145 function TAgOpenDialog.IsWin2000: boolean;
146 var ver : TOSVersionInfo;
147 begin
148 Result := FALSE;
149 ver.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
150 if not GetVersionEx(ver ) then
151 Exit;
152
153 if ( ver.dwPlatformId=VER_PLATFORM_WIN32_NT) then
154 begin // Detect Windows 2000
155 if (ver.dwMajorVersion >= 5 ) then
156 Result := TRUE;
157 end
158 else // Detect Windows ME
159 if ((ver.dwPlatformId=VER_PLATFORM_WIN32_WINDOWS) and
160 (ver.dwMajorVersion >= 4) and
161 (ver.dwMinorVersion >= 90)
162 ) then
163 Result := TRUE;
164 end;
165
166
167 { TAgSaveDialog }
168
169 constructor TAgSaveDialog.Create(AOwner: TComponent);
170 begin
171 inherited;
172 FInterceptor := @SaveInterceptor;
173 end;
174
175 function TAgSaveDialog.Execute: Boolean;
176 begin
177 if IsWin2000 then
178 begin
179 Result := Inherited Execute; // TAgOpenDialog has the functionality
180 end
181 else
182 Result := True; //DoExecute(@GetSaveFileName); // can't call inherited because
183 // it will call opendialogs DoExecute
184 end;
185
186 end.
AddedCpu/machine.pas +561−0
@@ -0,0 +1,561 @@
1 {+-----------------------------------------------------------------------------+
2 | Description: Memory functions
3 | last changes: 15.12.2000
4 |
5 | http://www.tu-ilmenau.de/~hackbart
6 +----------------------------------------------------------------------------+}
7
8 unit machine;
9
10 {$MODE Delphi}
11
12 interface uses windows;
13
14 const
15 MaxCompanies=74;
16
17 Companies:Array[0..maxCompanies] of record Code:Word;Name:String end=
18 (
19 ( code:$3301;Name:'Nintendo' ),( code:$7901;Name:'Accolade' ),( code:$A400;Name:'Konami' ),
20 ( code:$6701;Name:'Ocean' ),( code:$5601;Name:'LJN' ),( code:$9900;Name:'ARC?' ),
21 ( code:$0101;Name:'Nintendo' ),( code:$0801;Name:'Capcom' ),( code:$0100;Name:'Nintendo' ),
22 ( code:$BB01;Name:'SunSoft' ),( code:$A401;Name:'Konami' ),( code:$AF01;Name:'Namcot?' ),
23 ( code:$4901;Name:'Irem' ),( code:$9C01;Name:'Imagineer' ),( code:$A600;Name:'Kawada?' ),
24 ( code:$B101;Name:'Nexoft' ),( code:$5101;Name:'Acclaim' ),( code:$6001;Name:'Titus' ),
25 ( code:$B601;Name:'HAL' ),( code:$3300;Name:'Nintendo' ),( code:$0B00;Name:'Coconuts?' ),
26 ( code:$5401;Name:'Gametek' ),( code:$7F01;Name:'Kemco?' ),( code:$C001;Name:'Taito' ),
27 ( code:$EB01;Name:'Atlus' ),( code:$E800;Name:'Asmik?' ),( code:$DA00;Name:'Tomy?' ),
28 ( code:$B100;Name:'ASCII?' ),( code:$EB00;Name:'Atlus' ),( code:$C000;Name:'Taito' ),
29 ( code:$9C00;Name:'Imagineer' ),( code:$C201;Name:'Kemco?' ),( code:$D101;Name:'Sofel?' ),
30 ( code:$6101;Name:'Virgin' ),( code:$BB00;Name:'SunSoft' ),( code:$CE01;Name:'FCI?' ),
31 ( code:$B400;Name:'Enix?' ),( code:$BD01;Name:'Imagesoft' ),( code:$0A01;Name:'Jaleco?' ),
32 ( code:$DF00;Name:'Altron?' ),( code:$A700;Name:'Takara?' ),( code:$EE00;Name:'IGS?' ),
33 ( code:$8300;Name:'Lozc?' ),( code:$5001;Name:'Absolute?' ),( code:$DD00;Name:'NCS?' ),
34 ( code:$E500;Name:'Epoch?' ),( code:$CB00;Name:'VAP?' ),( code:$8C00;Name:'Vic Tokai' ),
35 ( code:$C200;Name:'Kemco?' ),( code:$BF00;Name:'Sammy?' ),
36 ( code:$1800;Name:'Hudson Soft' ),( code:$CA01;Name:'Palcom/Ultra' ),
37 ( code:$CA00;Name:'Palcom/Ultra' ),( code:$C500;Name:'Data East?' ),
38 ( code:$A900;Name:'Technos Japan?' ),( code:$D900;Name:'Banpresto?' ),
39 ( code:$7201;Name:'Broderbund?' ),( code:$7A01;Name:'Triffix Entertainment?' ),
40 ( code:$E100;Name:'Towachiki?' ),( code:$9300;Name:'Tsuburava?' ),
41 ( code:$C600;Name:'Tonkin House?' ),( code:$CE00;Name:'Pony Canyon' ),
42 ( code:$7001;Name:'Infogrames?' ),( code:$8B01;Name:'Bullet-Proof Software?' ),
43 ( code:$5501;Name:'Park Place?' ),( code:$EA00;Name:'King Records?' ),
44 ( code:$5D01;Name:'Tradewest?' ),( code:$6F01;Name:'ElectroBrain?' ),
45 ( code:$AA01;Name:'Broderbund?' ),( code:$C301;Name:'SquareSoft' ),
46 ( code:$5201;Name:'Activision?' ),( code:$5A01;Name:'Bitmap Brothers/Mindscape' ),
47 ( code:$5301;Name:'American Sammy' ),( code:$4701;Name:'Spectrum Holobyte' ),
48 ( code:$1801;Name:'Hudson Soft'));
49
50
51 {+ Wichtig !! die beiden Speicherfunktionen müssen
52 unbedingt CDECL deklariert sein !!! +}
53
54 function speekb(address:Word):Byte;cdecl;
55 procedure spokeb(address:WORD;data:byte);cdecl;
56
57 function wordpeek(Addr:Word):Word;
58 procedure wordpoke(addr:Word;val:Word);
59 procedure push_pc;
60
61 procedure set_bank(number:DWORD);
62 procedure set_bank_mbc1_hi(data:DWORD);
63 procedure set_bank_mbc1_lo(data:DWORD);
64 procedure set_bank_mbc5_lo(data:DWORD);
65 procedure set_bank_mbc5_hi(data:DWORD);
66 procedure set_ff0f(number:Byte);
67 function getcompany:String;
68 implementation uses vars,sound;
69
70 function getCompany:String;
71 var j:word;
72 i:integer;
73 begin
74 if cart=nil then exit;
75 J:=byte(pchar(cart)[$014B]) shl 8+byte(pchar(cart)[$014A]);
76 for I:=low(companies) to high(companies) do
77 if Companies[I].Code=J then
78 begin
79 result:=Companies[I].Name;exit;
80 end;
81 result:='';
82 end;
83 procedure set_bank(number:DWORD);
84 begin
85 if number=0 then number:=1;
86 number:=number mod srom;
87 if number=0 then number:=1;
88 addr_bank:=number*$4000-$4000;
89 end;
90
91 procedure set_bank_mbc1_hi(data:DWord);
92 begin
93 data:=(data and 3) shl 5;
94 rom_priv:=(rom_priv and 31) or Data;
95 set_bank(rom_priv);
96 end;
97
98 procedure set_bank_mbc1_lo(data:Dword);
99 begin
100 rom_priv:=(rom_priv and 96) or data;
101 set_bank(rom_priv);
102 end;
103
104 procedure set_bank_mbc5_lo(data:DWORD);
105 begin
106 rom_priv:=(rom_priv and 256) or data;
107 set_bank(rom_priv);
108 end;
109
110 procedure set_bank_mbc5_hi(data:Dword);
111 begin
112 if(data and 1>0) then rom_priv:=rom_priv or 256
113 else
114 rom_priv:=rom_priv and 255;
115 set_bank(rom_priv);
116 end;
117
118 procedure set_ff0f(number:Byte);
119 (*
120
121 FF0F - IFLAGS [RW] Interrupt Flags
122
123 ----------------------------------------------+----------+----------
124 FFFF -- ISWITCH [RW] Interrupt Enable/Disable | set to 1 | set to 0
125 Bit4 Transition High->Low on pins P10-P13 | ENABLED | DISABLED
126 Bit3 End of serial I/O transfer | ENABLED | DISABLED
127 Bit2 Timer overflow | ENABLED | DISABLED
128 Bit1 LCD controller interrupt [see LCDSTAT] | ENABLED | DISABLED
129 Bit0 LCD vertical blanking impulse | ENABLED | DISABLED
130 ----------------------------------------------+----------+----------
131
132 *)
133 begin
134 if m_iram[$ffff] and number>0 then
135 m_iram[$ff0f]:=m_iram[$ff0f] or number;
136 end;
137
138
139
140 function wordpeek(Addr:Word):Word;
141 begin
142 result:=((speekb((addr)+1) shl 8) or speekb(addr));
143 end;
144
145 procedure wordpoke(addr:Word;val:Word);
146 begin
147 spokeb(addr, LO(val));spokeb(addr + 1, HI(val));
148 end;
149
150 function speekb(address:Word):Byte;
151 var cr,res:byte;
152 begin
153 if cart=NIL then begin result:=0;exit;end;
154 if address<$8000 then
155 begin
156 if (memc=ROM) or (address<$4000) then
157 res:=byte(pchar(cart)[address])
158 else
159 res:=byte(pchar(cart)[address+addr_bank]);
160
161 asm mov al,res;end;result:=res;exit;
162 // Problem mit cdecl, keine Registerübergabe !!
163 end;
164
165 if (address>=$e000) and (address<$fe00) then dec(address,$2000);
166
167 if gb_mode=CGB then
168 begin
169 if (m_iram[$ff4f] and 1>0) and (address>=$8000) and (address<$a000) then
170 begin
171 res:=m_iram2[address];
172 asm mov al,res;end; result:=res;exit;
173 end;
174 if (address>=$d000) and (address<=$dfff) then
175 begin
176 cr:=(m_iram[$ff70]) and 7;
177 if cr=0 then cr:=1;
178 res:=m_cgbram[4096*cr+address-$d000];
179 asm mov al,res; end; result:=res;exit;
180 end;
181
182 case address of
183 $ff26: begin // sound
184 m_iram[$ff26]:=(m_iram[$ff26] and $f0) or (byte(snd[4].Enable) shl 3) or
185 (byte(snd[3].Enable) shl 2) or (byte(snd[2].Enable) shl 1) or byte(snd[1].Enable);
186 res:=m_iram[$ff26];
187 asm mov al,res end; result:=res;
188 end;
189 $ff69: begin
190 res:=palramb[(m_iram[$ff68]) and 63];
191 asm mov al,res; end; result:=res;exit;
192 end;
193 $ff6b: begin
194 res:=palramo[(m_iram[$ff68]) and 63];
195 asm mov al,res; end; result:=res;exit;
196 end;
197 end; // case
198 end; // end CGB
199
200
201 if (sram>0) and ((address>=$a000) and (address<$c000)) then
202 begin
203 res:=m_ram[address-$a000+n_ram*$8912];
204 asm mov al,res; end; result:=res;exit;
205 end;
206
207 res:=m_iram[address];
208 asm mov al,res; end; result:=res;
209 end;
210
211 procedure spokeb(address:WORD;data:byte);cdecl; // neu
212 var cr:byte;
213 ji,pi:longint;
214 sAddr,Offset:Word;
215 templ,tempr:Byte;
216
217 begin
218 if cart=NIL then exit;
219 if (address<$8000) then
220 begin
221 case memc of
222 MBC3: begin
223 if((address>=$2000) and (address<=$3fff)) then
224 begin
225 if(data=0) then data:=1;
226 set_bank(data);
227 exit;
228 end else
229 if ((address>=$4000) and (address<$6000)) then
230 begin
231 n_ram:=data and 3;
232 exit;
233 end;
234 end;
235 MBC1: begin
236 if((address>=$6000) and (address<$8000)) then
237 begin
238 mbc1_type:=data and 1;
239 exit;
240 end
241 else
242 if((address>=$2000) and (address<$4000)) then
243 begin
244 data:=data and 31;
245 set_bank_mbc1_lo(data);
246 exit;
247 end else
248 if((address>=$4000) and (address<$6000)) then
249 begin
250 if mbc1_type>0 then
251 begin
252 n_ram:=data and 3;
253 exit;
254 end;
255 end
256 else
257 begin
258 set_bank_mbc1_hi(data);
259 exit;
260 end;
261 end;
262 MBC5: begin
263 if((address>=$2000) and (address<=$2fff)) then
264 begin
265 set_bank_mbc5_lo(data);
266 exit;
267 end;
268 if((address>=$3000) and (address<=$3fff)) then
269 begin
270 set_bank_mbc5_hi(data);
271 exit;
272 end;
273 if((address>=$4000) and (address<=$5fff)) then
274 begin
275 n_ram:=data and 15;
276 exit;
277 end;
278 end;
279 MBC2: begin
280 if((address>=$2000) and (address<$4000) and (address and 256>0)) then
281 begin
282 data:=data and 15;
283 set_bank(data);
284 exit;
285 end;
286 end;
287 end;
288 end;
289
290
291 if gb_mode=CGB then
292 begin
293 if ((address>=$d000) and (address<=$dfff)) then
294 begin
295 cr:=(m_iram[$ff70]) and 7;
296 if(cr=0) then cr:=1;
297 m_cgbram[4096*cr+address-$d000]:=data;
298 exit;
299 end;
300
301 if (address=$ff55) then
302 begin
303 if(data and 128=0) then
304 begin
305 if hdma>0 then hdma:=0 else
306 begin
307 adr_s:=((m_iram[$ff51]) shl 8) or (m_iram[$ff52] and 240);
308 adr_p:=((((m_iram[$ff53]) and 31) shl 8) or (m_iram[$ff54] and 240)) or $8000;
309 for ji:=0 to ((data and 127)*16+16)-1 do
310 begin
311 spokeb(adr_p,speekb(adr_s));
312 inc(adr_p);inc(adr_s);
313 end;
314 inc(cnumber,data*32+928 div gb_speed);
315 data:=$ff;
316 end
317 end
318 else
319 begin
320 data:=data and 127;
321 if(m_iram[$ff40] and 128>0) then
322 begin
323 hdma:=1;
324 hdma_count:=data+1;
325 adr_s:=((m_iram[$ff51]) shl 8) or (m_iram[$ff52] and 240);
326 adr_p:=((((m_iram[$ff53]) and 31) shl 8) or (m_iram[$ff54] and 240)) or $8000;
327 end;
328 end;
329 end;
330
331
332 if((address>=$8000) and (address<$a000) and ((m_iram[$ff4f] and 1>0))) then
333 begin
334 m_iram2[address]:=data;
335 exit;
336 end;
337
338 case address of
339 $ff69: begin
340 palramb[(m_iram[$ff68]) and 63]:=data;
341 if(m_iram[$ff68] and 1)>0 then
342 begin
343 tempL:=((m_iram[$ff68]) and 56) shr 3;
344 tempR:=((m_iram[$ff68]) and 6) shr 1;
345 pal_b[templ][tempr][0]:=(data and 124) shl 1;
346 pal_b[templ][tempr][1]:=pal_b[templ][tempr][1] and 63;
347 pal_b[templ][tempr][1]:=pal_b[templ][tempr][1] or (data shl 6);
348 end
349 else
350 begin
351 templ:=((m_iram[$ff68]) and 56) shr 3;
352 tempr:=((m_iram[$ff68]) and 6) shr 1;
353
354 pal_b[templ][tempr][2]:=(data and 31) shl 3;
355 pal_b[templ][tempr][1]:=pal_b[templ][tempr][1] and 192;
356 pal_b[templ][tempr][1]:=pal_b[templ][tempr][1] or ((data and 224) shr 2);
357 end;
358
359 pal_dx_b[((m_iram[$ff68]) and 56) shr 3][((m_iram[$ff68]) and 6) shr 1]:=
360 (((pal_b[((m_iram[$ff68]) and 56) shr 3][((m_iram[$ff68]) and 6) shr 1][2]) shr (8-dx_r)) shl dx_sr) or (((pal_b[((m_iram[$ff68]) and 56) shr 3][((m_iram[$ff68]) and 6) shr 1][1]) shr (8-dx_g)) shl dx_sg) or (((pal_b[((m_iram[$ff68]) and 56) shr 3][((m_iram[$ff68]) and 6) shr 1][0]) shr (8-dx_b)) shl dx_sb);
361 if(m_iram[$ff68] and 128)>0 then
362 begin
363 m_iram[$ff68]:=m_iram[$ff68] and $3f;
364 inc(m_iram[$ff68]);
365 m_iram[$ff68]:=m_iram[$ff68] or 128;
366 end;
367 end;
368 $ff6b: begin
369 palramo[(m_iram[$ff6a]) and 63]:=data;
370 if(m_iram[$ff6a] and 1)>0 then
371 begin
372 templ:=((m_iram[$ff6a]) and 56) shr 3;
373 tempr:=((m_iram[$ff6a]) and 6) shr 1;
374
375 pal_o[templ][tempr][0]:=(data and 124) shl 1;
376 pal_o[templ][tempr][1]:=pal_o[templ][tempr][1] and 63;
377 pal_o[templ][tempr][1]:=pal_o[templ][tempr][1] or (data shl 6);
378 end
379 else
380 begin
381 templ:=((m_iram[$ff6a]) and 56) shr 3;
382 tempr:=((m_iram[$ff6a]) and 6) shr 1;
383
384 pal_o[templ][tempr][2]:=(data and 31) shl 3;
385 pal_o[templ][tempr][1]:=pal_o[templ][tempr][1] and 192;
386 pal_o[templ][tempr][1]:=pal_o[templ][tempr][1] or ((data and 224) shr 2);
387 end;
388 pal_dx_o[((m_iram[$ff6a]) and 56) shr 3][((m_iram[$ff6a]) and 6) shr 1]:=(((pal_o[((m_iram[$ff6a]) and 56) shr 3][((m_iram[$ff6a]) and 6) shr 1][2]) shr (8-dx_r)) shl dx_sr) or (((pal_o[((m_iram[$ff6a]) and 56) shr 3][((m_iram[$ff6a]) and 6) shr 1][1]) shr (8-dx_g)) shl dx_sg) or (((pal_o[((m_iram[$ff6a]) and 56) shr 3][((m_iram[$ff6a]) and 6) shr 1][0]) shr (8-dx_b)) shl dx_sb);
389 if(m_iram[$ff6a] and 128)>0 then
390 begin
391 m_iram[$ff6a]:=m_iram[$ff6a] and $3f;
392 inc(m_iram[$ff6a]);
393 m_iram[$ff6a]:=m_iram[$ff6a] or 128;
394 end;
395 end;
396 end;
397 end;
398
399 if ((address>=$e000) and (address<$fe00)) then dec(address,$2000);
400
401 if (address>=$ff00) then
402 begin
403 case address of
404 $ff00: begin
405 if (data=3) then data:=$ff else
406 if((data and $30)=$30) then data:=$ff
407 else
408 begin
409 if((data and $30)=$20) then
410 data:=$20 or (k_down shl 3) or (k_up shl 2) or (k_left shl 1) or k_right
411 else
412 if((data and $30)=$10) then
413 data:=$10 or (k_start shl 3) or (k_select shl 2) or(k_b shl 1) or k_a;
414 end;
415 data:=data or $c0;
416 end;
417 $ff02: begin
418 if((data and 128>0) and (data and 1>0)) then sio_count:=8;
419 data:=data or 126;
420 end;
421 $ff04: begin
422 data:=0;
423 n_ff04:=0;
424 end;
425 $ff07: begin
426 if(data and 4)>0 then
427 begin
428 c_count:=0;
429 t_count:=m_iram[$ff06];
430 end;
431 end;
432 $ff40: begin
433 if(data and 128=0) then vbioff_count:=1 else
434 if(m_iram[$ff40] and 128)=0 then
435 begin
436 old_mode:=5;
437 cycles:=1;
438 cur_c:=2;
439 nr_t:=0;
440 end;
441 end;
442 $ff0f: begin
443 if(data and 16)>0 then set_ff0f(16);
444 if(data and 8)>0 then set_ff0f(8);
445 if(data and 4)>0 then set_ff0f(4);
446 if(data and 2)>0 then set_ff0f(2);
447 if(data and 1)>0 then set_ff0f(1);
448 end;
449 $ff10..$ff3F: begin
450 sndRegChange:=true;
451 if address=$ff26 then
452 begin
453 m_iram[$ff26]:=data;
454 if data and $80=0 then
455 begin
456 snd[1].Enable:=false;
457 snd[2].Enable:=false;
458 snd[3].Enable:=false;
459 snd[4].Enable:=false;
460 end;
461 exit;
462 end;
463 m_iram[address]:=data;
464 exit;
465 end;
466
467 $ff47: begin
468 if(gb_mode<>CGB) then
469 begin
470 gb_mode:=CGB;
471 spokeb($ff68,128);
472 spokeb($ff69,(colors[data and 3]) and $ff);
473 spokeb($ff69,(colors[data and 3]) shr 8);
474 spokeb($ff69,(colors[(data and $c) shr 2]) and $ff);
475 spokeb($ff69,(colors[(data and $c) shr 2]) shr 8);
476 spokeb($ff69,(colors[(data and $30) shr 4]) and $ff);
477 spokeb($ff69,(colors[(data and $30) shr 4]) shr 8);
478 spokeb($ff69,(colors[(data and $c0) shr 6]) and $ff);
479 spokeb($ff69,(colors[(data and $c0) shr 6]) shr 8);
480 gb_mode:=DMG;
481 end;
482 end;
483 $ff48: begin
484 if(gb_mode<>CGB) then
485 begin
486 gb_mode:=CGB;
487 spokeb($ff6a,128);
488 spokeb($ff6b,(colors[data and 3]) and $ff);
489 spokeb($ff6b,(colors[data and 3]) shr 8);
490 spokeb($ff6b,(colors[(data and $c) shr 2]) and $ff);
491 spokeb($ff6b,(colors[(data and $c) shr 2]) shr 8);
492 spokeb($ff6b,(colors[(data and $30) shr 4]) and $ff);
493 spokeb($ff6b,(colors[(data and $30) shr 4]) shr 8);
494 spokeb($ff6b,(colors[(data and $c0) shr 6]) and $ff);
495 spokeb($ff6b,(colors[(data and $c0) shr 6]) shr 8);
496 gb_mode:=DMG;
497 end;
498 end;
499 $ff49: begin
500 if gb_mode<>CGB then
501 begin
502 gb_mode:=CGB;
503 spokeb($ff6a,128+8);
504 spokeb($ff6b,(colors[data and 3]) and $ff);
505 spokeb($ff6b,(colors[data and 3]) shr 8);
506 spokeb($ff6b,(colors[(data and $c) shr 2]) and $ff);
507 spokeb($ff6b,(colors[(data and $c) shr 2]) shr 8);
508 spokeb($ff6b,(colors[(data and $30) shr 4]) and $ff);
509 spokeb($ff6b,(colors[(data and $30) shr 4]) shr 8);
510 spokeb($ff6b,(colors[(data and $c0) shr 6]) and $ff);
511 spokeb($ff6b,(colors[(data and $c0) shr 6]) shr 8);
512 gb_mode:=DMG;
513 end;
514 end;
515 $ff41: begin
516 if((mode=0) or (mode=1)) then
517 begin
518 m_iram[$ff0f]:=m_iram[$ff0f] or 2;
519 set_ff0f(2);
520 end;
521 end;
522 $ff46: begin
523 sAddr:=data shl 8;
524 Offset:=$fe00;
525 for pi:=0 to $9f do
526 begin
527 m_iram[Offset]:=speekb(sAddr);
528 inc(Offset);inc(sAddr);
529 end;
530 end;
531
532 end;
533 end;
534
535 if(sram>0) and (address>=$a000) and (address<$c000) then
536 m_ram[address-$a000+n_ram*$8912]:=data
537 else
538 m_iram[address]:=data;
539 end;
540
541
542 procedure push_pc;assembler;
543 asm
544 mov ax,pc.w
545 dec sp_.w
546 xchg ah,al
547 push eax
548 push dword ptr sp_.w
549 call spokeb
550 lea esp,[esp+8]
551 mov ax,pc.w
552 push eax
553 dec sp_.w
554 push dword ptr sp_.w
555 call spokeb
556 lea esp,[esp+8]
557 end;
558 (* dec(sp_.W,2);wordpoke(sp_.W,pc.w);*)
559
560
561 end.
AddedCpu/z80cpu.pas +6365−0
@@ -0,0 +1,6365 @@
1 {+-----------------------------------------------------------------------------+
2 | Description: Gameboy Z80-CPU emulation
3 | last changes: 02.11.2000
4 |
5 | http://www.tu-ilmenau.de/~hackbart
6 +----------------------------------------------------------------------------+}
7
8 unit Z80CPU;
9
10 {$MODE Delphi}
11
12 interface
13
14 var z80:array[0..511] of function:byte;
15
16 implementation uses vars,machine,windows;
17
18 // temporäre Variablen
19 var b:Pair;
20 cycle:byte;
21 w1,w2:Word;
22
23 function NOP:byte;
24 begin
25 result:=4;
26 end;
27
28 function LD_BC_WORD:byte;
29 begin
30 asm
31 push dword ptr pc.w
32 call speekb
33 lea esp,[esp+4]
34 mov bc.l,al
35 inc word ptr pc.w
36 push dword ptr pc.w
37 call speekb
38 lea esp,[esp+4]
39 mov bc.h,al
40 inc word ptr pc.w
41 end;
42 result:=12;
43 end;
44
45 function LD_xBC_A:byte;
46 begin
47 asm
48 mov ax,bc.w
49 push dword ptr af.h
50 push eax
51 call SpokeB
52 lea esp,[esp+8]
53 end;
54 result:=8;
55 end;
56
57 function INC_BC:byte;
58 begin
59 asm
60 inc bc.w
61 end;
62 result:=8;
63 end;
64
65 function INC_B:byte;
66 begin
67 asm
68 inc bc.h
69 lahf
70 and eax,$5100
71 and af.l,1
72 or af.l,ah
73 end;
74
75 result:=4;
76 end;
77
78 function DEC_B:byte;
79 begin
80 asm
81 dec bc.h
82 lahf
83 and af.l,1
84 and eax,$5500
85 or eax,$400
86 or af.l,ah
87 end;
88
89 result:=4;
90
91 end;
92
93 function LD_B_BYTE:byte;
94 begin
95 asm
96 push dword ptr pc.w
97 call speekb
98 lea esp,[esp+4]
99 mov bc.h,al
100 inc word ptr pc.w
101 end;
102 result:=8;
103 end;
104
105 function RLCA:byte;
106 begin
107 asm
108 rol af.h,1
109 lahf
110 and eax,$100
111 mov af.l,ah
112 end;
113
114
115 result:=4;
116 end;
117
118 function EX_AF_AF:byte;
119 begin
120 asm
121 push dword ptr pc.w
122 call speekb
123 lea esp,[esp+4]
124 inc word ptr pc.w
125 push eax
126
127 push dword ptr pc.w
128 call speekb
129 lea esp,[esp+4]
130 inc word ptr pc.w
131 xchg ah,al
132 pop ebx
133 mov al,bl
134 mov bx,sp_.w
135 push ebx
136 push eax
137
138 push ebx
139 push eax
140 call SpokeB
141 lea esp,[esp+8]
142
143 pop eax
144 pop ebx
145 inc eax
146 xchg bh,bl
147 push ebx
148 push eax
149 call SpokeB
150 lea esp,[esp+8]
151 end;
152 result:=20;
153 end;
154
155 function ADD_HL_BC:byte;
156 begin
157 asm
158 and af.l,64
159 mov ax,hl.w
160 mov bx,bc.w
161
162
163 mov ecx,eax
164 xor ecx,ebx
165
166 add ax,bx
167 jnc @1
168 or af.l,1
169 @1:
170 xor ecx,eax
171 test ecx,4096
172 jz @ende
173 or af.l,16
174 @ende:
175 mov hl.w,ax
176
177 end;
178 result:=8;
179 end;
180
181 function LD_A_xBC:byte;
182 begin
183 asm
184 mov ax,bc.w
185 push eax
186 call speekb
187 lea esp,[esp+4]
188 mov af.h,al
189 end;
190 result:=8;
191 end;
192
193 function DEC_BC:byte;
194 begin
195 asm
196 dec bc.w
197 end;
198
199 result:=8;
200 end;
201
202 function INC_C:byte;
203 begin
204 asm
205 inc bc.l
206 lahf
207 and eax,$5100
208 and af.l,1
209 or af.l,ah
210 end;
211
212 result:=4;
213 end;
214
215 function DEC_C:byte;
216 begin
217 asm
218 dec bc.l
219 lahf
220 and af.l,1
221 and eax,$5500
222 or eax,$400
223 or af.l,ah
224 end;
225
226 result:=4;
227 end;
228
229 function LD_C_BYTE:byte;
230 begin
231 asm
232 push dword ptr pc.w
233 call speekb
234 lea esp,[esp+4]
235 mov bc.l,al
236 inc word ptr pc.w
237 end;
238 result:=8;
239 end;
240
241 function RRCA:byte;
242 begin
243 asm
244 ror af.h,1
245 lahf
246 and eax,$100
247 mov af.l,ah
248 end;
249
250
251 result:=4;
252 end;
253
254 function DJNZ:byte;
255 begin
256 stop_mode:=1;
257 inc(pc.w);
258 result:=10;
259 end;
260
261 function LD_DE_WORD:byte;
262 begin
263 asm
264 push dword ptr pc.w
265 call speekb
266 lea esp,[esp+4]
267 mov de.l,al
268 inc word ptr pc.w
269
270 push dword ptr pc.w
271 call speekb
272 lea esp,[esp+4]
273 mov de.h,al
274 inc word ptr pc.w
275 end;
276 result:=12;
277 end;
278
279 function LD_xDE_A:byte;
280 begin
281 asm
282 mov ax,de.w
283 push dword ptr af.h
284 push eax
285 call SpokeB
286 lea esp,[esp+8]
287 end;
288
289 result:=8;
290 end;
291
292 function INC_DE:byte;
293 begin
294 asm
295 inc de.w
296 end;
297 result:=8;
298 end;
299
300 function INC_D:byte;
301 begin
302 asm
303 inc de.h
304 lahf
305 and eax,$5100
306 and af.l,1
307 or af.l,ah
308 end;
309
310 result:=4;
311 end;
312
313 function DEC_D:byte;
314 begin
315 asm
316 dec de.h
317 lahf
318 and af.l,1
319 and eax,$5500
320 or eax,$400
321 or af.l,ah
322 end;
323
324 result:=4;
325 end;
326
327 function LD_D_BYTE:byte;
328 begin
329 asm
330 push dword ptr pc.w
331 call speekb
332 lea esp,[esp+4]
333 mov de.h,al
334 inc word ptr pc.w
335 end;
336
337 result:=8;
338 end;
339
340 function RLA:byte;
341 begin
342 asm
343 mov ah,af.l
344 and eax,$100
345 sahf
346 rcl af.h,1
347 lahf
348 and eax,$100
349 mov af.l,ah
350 end;
351
352 result:=4;
353 end;
354
355 function JR:byte;
356 begin
357 asm
358 xor eax,eax
359 mov ax,pc.w
360 push eax
361 call speekb
362 lea esp,[esp+4]
363 inc word ptr pc.w
364 cbw
365 add pc.w,ax
366 end;
367
368 result:=8;
369 end;
370
371 function ADD_HL_DE:byte;
372 begin
373 asm
374 and af.l,64
375 mov ax,hl.w
376 mov bx,de.w
377
378
379 mov ecx,eax
380 xor cx,bx
381
382 add ax,bx
383 jnc @1
384 or af.l,1
385 @1:
386 xor cx,ax
387 test cx,4096
388 jz @ende
389 or af.l,16
390 @ende:
391 mov hl.w,ax
392
393 end;
394 result:=8;
395 end;
396
397 function LD_A_xDE:byte;
398 begin
399 asm
400 mov ax,de.w
401 push eax
402 call speekb
403 lea esp,[esp+4]
404 mov af.h,al
405 end;
406
407 result:=8;
408 end;
409
410 function DEC_DE:byte;
411 begin
412 asm
413 dec de.w
414 end;
415
416 result:=8;
417 end;
418
419 function INC_E:byte;
420 begin
421 asm
422 inc de.l
423 lahf
424 and eax,$5100
425 and af.l,1
426 or af.l,ah
427 end;
428
429 result:=4;
430 end;
431
432 function DEC_E:byte;
433 begin
434 asm
435 dec de.l
436 lahf
437 and af.l,1
438 and eax,$5500
439 or eax,$400
440 or af.l,ah
441 end;
442
443 result:=4;
444 end;
445
446 function LD_E_BYTE:byte;
447 begin
448 asm
449 push dword ptr pc.w
450 call speekb
451 lea esp,[esp+4]
452 mov de.l,al
453 inc word ptr pc.w
454 end;
455
456 result:=8;
457 end;
458
459 function RRA:byte;
460 begin
461 asm
462 mov ah,af.l
463 sahf
464 rcr af.h,1
465 lahf
466 and ah,1
467 mov af.l,ah
468 end;
469 result:=4;
470 end;
471
472 function JR_NZ:byte;
473 begin
474 asm
475 push dword ptr pc.w
476 call speekb
477 lea esp,[esp+4]
478 inc word ptr pc.w
479 test af.l,64
480 mov cycle,8
481 jnz @ende
482 mov cycle,12
483 cbw
484 add pc.w,ax
485 @ende:
486 end;
487 result:=cycle;
488 end;
489
490 function LD_HL_WORD:byte;
491 begin
492 asm
493 push dword ptr pc.w
494 call speekb
495 lea esp,[esp+4]
496 mov hl.l,al
497 inc word ptr pc.w
498 push dword ptr pc.w
499 call speekb
500 lea esp,[esp+4]
501 mov hl.h,al
502 inc word ptr pc.w
503 end;
504 result:=12;
505 end;
506
507 function LD_xWORD_HL:byte;
508 begin
509 asm
510 mov ax,hl.w
511 push eax
512 push dword ptr af.h
513 push eax
514 call SpokeB
515 lea esp,[esp+8]
516 pop eax
517 inc eax
518 mov hl.w,ax
519 end;
520 result:=8;
521 end;
522
523 function INC_HL:byte;
524 begin
525 asm
526 inc hl.w
527 end;
528 result:=8;
529 end;
530
531 function INC_H:byte;
532 begin
533 asm
534 inc hl.h
535 lahf
536 and eax,$5100
537 and af.l,1
538 or af.l,ah
539 end;
540
541 result:=4;
542 end;
543
544 function DEC_H:byte;
545 begin
546 asm
547 dec hl.h
548 lahf
549 and af.l,1
550 and eax,$5500
551 or eax,$400
552 or af.l,ah
553 end;
554
555 result:=4;
556 end;
557
558 function LD_H_BYTE:byte;
559 begin
560 asm
561 push dword ptr pc.w
562 call speekb
563 lea esp,[esp+4]
564 mov hl.h,al
565 inc word ptr pc.w
566 end;
567
568 result:=8;
569 end;
570
571 function DAA:byte;
572 begin
573 asm
574 mov ah,af.l
575 mov bl,ah
576 and bl,4
577 sahf
578 mov al,af.h
579 jp @dec_adjust
580 daa
581 jmp @ddld
582
583 @dec_adjust:
584 das
585
586 @ddld:
587 mov af.h,al
588 lahf
589 and ah,65
590 or ah,bl
591 mov af.l,ah
592 end;
593
594
595
596 result:=4;
597 end;
598
599 function JR_Z:byte;
600
601 begin
602 asm
603 push dword ptr pc.w
604 call speekb
605 lea esp,[esp+4]
606 inc word ptr pc.w
607 test af.l,64
608 mov cycle,8
609 jz @ende
610 mov cycle,12
611 cbw
612 add pc.w,ax
613 @ende:
614 end;
615
616 result:=cycle;
617 end;
618
619 function ADD_HL_HL:byte;
620 begin
621 asm
622 and af.l,64
623 mov ax,hl.w
624 xor ecx,ecx
625
626 add ax,ax
627 jnc @1
628 or af.l,1
629 @1:
630 xor ecx,eax
631 test cx,4096
632 jz @ende
633 or af.l,16
634 @ende:
635 mov hl.w,ax
636
637 end;
638
639 result:=8;
640 end;
641
642 function LD_HL_xWORD:byte;
643 begin
644
645 asm
646 mov ax,hl.w
647 push eax
648 push eax
649 call speekb
650 lea esp,[esp+4]
651 mov af.h,al
652 pop eax
653 inc ax
654 mov hl.w,ax
655 end;
656
657 result:=8;
658 end;
659
660 function DEC_HL:byte;
661 begin
662 asm
663 dec hl.w
664 end;
665
666 result:=8;
667 end;
668
669 function INC_L:byte;
670 begin
671 asm
672 inc hl.l
673 lahf
674 and eax,$5100
675 and af.l,1
676 or af.l,ah
677 end;
678
679 result:=4;
680 end;
681
682 function DEC_L:byte;
683 begin
684 asm
685 dec hl.l
686 lahf
687 and af.l,1
688 and eax,$5500
689 or eax,$400
690 or af.l,ah
691 end;
692
693 result:=4;
694 end;
695
696 function LD_L_BYTE:byte;
697 begin
698 asm
699 push dword ptr pc.w
700 call speekb
701 lea esp,[esp+4]
702 inc word ptr pc.w
703 mov hl.l,al
704 end;
705
706 result:=8;
707 end;
708
709 function CPL:byte;
710 begin
711 asm
712 xor af.h,255
713
714 or af.l,$14
715
716 end;
717
718 result:=4;
719 end;
720
721 function JR_NC:byte;
722
723 begin
724 asm
725 push dword ptr pc.w
726 call speekb
727 lea esp,[esp+4]
728 inc word ptr pc.w
729 test af.l,1
730 mov cycle,8
731 jnz @ende
732 mov cycle,12
733 cbw
734 add pc.w,ax
735 @ende:
736 end;
737
738 result:=cycle;
739 end;
740
741 function LD_SP_WORD:byte;
742 begin
743 asm
744 push dword ptr pc.w
745 call speekb
746 lea esp,[esp+4]
747 inc word ptr pc.w
748 push eax
749 push dword ptr pc.w
750 call speekb
751 lea esp,[esp+4]
752 inc word ptr pc.w
753 shl eax,8
754 pop ebx
755 mov al,bl
756
757 mov sp_.w,ax
758 end;
759 //sp_.w:=wordpeek(pc.w);inc(pc.w,2);
760 result:=12;
761 end;
762
763 function LD_xWORD_A:byte;
764 begin
765 asm
766 mov ax,hl.w
767 push eax
768 push dword ptr af.h
769 push eax
770 call SpokeB
771 lea esp,[esp+8]
772 pop eax
773 dec ax
774 mov hl.w,ax
775 end;
776
777
778
779
780 result:=8;
781 end;
782
783 function INC_SP:byte;
784 begin
785 asm
786 inc sp_.w
787 end;
788
789 result:=8;
790 end;
791
792 function INC_xHL:byte;
793 begin
794 asm
795 mov ax,hl.w
796 push eax
797 push eax
798 call speekb
799 lea esp,[esp+4]
800 inc al
801 lahf
802 and ah,$51
803 and af.l,1
804 or af.l,ah
805 pop ebx
806 push eax
807 push ebx
808 call SpokeB
809 lea esp,[esp+8]
810 end;
811
812
813 result:=12;
814 end;
815
816 function DEC_xHL:byte;
817 begin
818 asm
819 mov ax,hl.w
820 push eax
821 push eax
822 call speekb
823 lea esp,[esp+4]
824 dec al
825 lahf
826 and af.l,1
827 and ah,$55
828 or eax,$400
829 or af.l,ah
830 pop ebx
831 push eax
832 push ebx
833 call SpokeB
834 lea esp,[esp+8]
835 end;
836 result:=12;
837 end;
838
839 function LD_xHL_BYTE:byte;
840 begin
841 asm
842 push dword ptr pc.w
843 call speekb
844 lea esp,[esp+4]
845 inc word ptr pc.w
846 push eax
847 mov ax,hl.w
848 push eax
849 call SpokeB
850 lea esp,[esp+8]
851 end;
852
853
854 result:=12;
855 end;
856
857 function SCF:byte;
858 begin
859 asm
860 and af.l,64
861 or af.l,1
862 end;
863
864 result:=4;
865 end;
866
867 function JR_C:byte;
868
869 begin
870 asm
871 push dword ptr pc.w
872 call speekb
873 lea esp,[esp+4]
874 inc word ptr pc.w
875 test af.l,1
876 mov cycle,8
877 jz @ende
878 mov cycle,12
879 cbw
880 add pc.w,ax
881 @ende:
882 end;
883
884 result:=cycle;
885 end;
886
887 function ADD_HL_SP:byte;
888 begin
889 asm
890 and af.l,64
891 mov ax,hl.w
892 mov bx,sp_.w
893
894
895 mov ecx,eax
896 xor ecx,ebx
897
898 add ax,bx
899 jnc @1
900 or af.l,1
901 @1:
902 xor ecx,eax
903 test ecx,4096
904 jz @ende
905 or af.l,16
906 @ende:
907 mov hl.w,ax
908 end;
909 result:=8;
910 end;
911
912 function LD_A_xWORD:byte;
913 begin
914
915 asm
916 mov ax,hl.w
917 push eax
918 push eax
919 call speekb
920 lea esp,[esp+4]
921 mov af.h,al
922 pop eax
923 dec ax
924 mov hl.w,ax
925 end;
926
927 result:=8;
928 end;
929
930 function DEC_SP:byte;
931 begin
932 asm
933 dec sp_.w
934 end;
935 result:=8;
936 end;
937
938 function INC_A:byte;
939 begin
940 asm
941 inc af.h
942 lahf
943 and eax,$5100
944 and af.l,1
945 or af.l,ah
946 end;
947
948 result:=4;
949 end;
950
951 function DEC_A:byte;
952 begin
953 asm
954 dec af.h
955 lahf
956 and af.l,1
957 and eax,$5500
958 or eax,$400
959 or af.l,ah
960 end;
961
962 result:=4;
963 end;
964
965 function LD_A_BYTE:byte;
966 begin
967 asm
968 push dword ptr pc.w
969 call speekb
970 lea esp,[esp+4]
971 mov af.h,al
972 inc word ptr pc.w
973 end;
974
975 result:=8;
976 end;
977
978 function CCF:byte;
979 begin
980 asm
981 mov ah,af.l
982 sahf
983 cmc
984 lahf
985 and ah,65
986 mov af.l,ah
987 end;
988
989 result:=4;
990 end;
991
992 function LD_B_B:byte;
993 begin
994 result:=4;
995 end;
996
997 function LD_B_C:byte;
998 begin
999 bc.h:=bc.l;
1000 result:=4;
1001 end;
1002
1003 function LD_B_D:byte;
1004 begin
1005 bc.h:=de.h;
1006 result:=4;
1007 end;
1008
1009 function LD_B_E:byte;
1010 begin
1011 bc.h:=de.l;
1012 result:=4;
1013 end;
1014
1015 function LD_B_H:byte;
1016 begin
1017 bc.h:=hl.h;
1018 result:=4;
1019 end;
1020
1021 function LD_B_L:byte;
1022 begin
1023 bc.h:=hl.l;
1024 result:=4;
1025 end;
1026
1027 function LD_B_xHL:byte;
1028 begin
1029 asm
1030 mov ax,hl.w
1031 push eax
1032 call speekb
1033 lea esp,[esp+4]
1034 mov bc.h,al
1035 end;
1036
1037
1038 result:=8;
1039 end;
1040
1041 function LD_B_A:byte;
1042 begin
1043 bc.h:=af.h;
1044 result:=4;
1045 end;
1046
1047 function LD_C_B:byte;
1048 begin
1049 bc.l:=bc.h;
1050 result:=4;
1051 end;
1052
1053 function LD_C_C:byte;
1054 begin
1055 result:=4;
1056 end;
1057
1058 function LD_C_D:byte;
1059 begin
1060 bc.l:=de.h;
1061 result:=4;
1062 end;
1063
1064 function LD_C_E:byte;
1065 begin
1066 bc.l:=de.l;
1067 result:=4;
1068 end;
1069
1070 function LD_C_H:byte;
1071 begin
1072 bc.l:=hl.h;
1073 result:=4;
1074 end;
1075
1076 function LD_C_L:byte;
1077 begin
1078 bc.l:=hl.l;
1079 result:=4;
1080 end;
1081
1082 function LD_C_xHL:byte;
1083 begin
1084 asm
1085 mov ax,hl.w
1086 push eax
1087 call speekb
1088 lea esp,[esp+4]
1089 mov bc.l,al
1090 end;
1091
1092 result:=8;
1093 end;
1094
1095 function LD_C_A:byte;
1096 begin
1097 bc.l:=af.h;
1098 result:=4;
1099 end;
1100
1101 function LD_D_B:byte;
1102 begin
1103 de.h:=bc.h;
1104
1105 result:=4;
1106 end;
1107
1108 function LD_D_C:byte;
1109 begin
1110 de.h:=bc.l;
1111 result:=4;
1112 end;
1113
1114 function LD_D_D:byte;
1115 begin
1116 result:=4;
1117 end;
1118
1119 function LD_D_E:byte;
1120 begin
1121 de.h:=de.l;
1122 result:=4;
1123 end;
1124
1125 function LD_D_H:byte;
1126 begin
1127 de.h:=hl.h;
1128 result:=4;
1129 end;
1130
1131 function LD_D_L:byte;
1132 begin
1133 de.h:=hl.l;
1134 result:=4;
1135 end;
1136
1137 function LD_D_xHL:byte;
1138 begin
1139 asm
1140 mov ax,hl.w
1141 push eax
1142 call speekb
1143 lea esp,[esp+4]
1144 mov de.h,al
1145 end;
1146
1147 result:=8;
1148 end;
1149
1150 function LD_D_A:byte;
1151 begin
1152 de.h:=af.h;
1153 result:=4;
1154 end;
1155
1156 function LD_E_B:byte;
1157 begin
1158 de.l:=bc.h;
1159 result:=4;
1160 end;
1161
1162 function LD_E_C:byte;
1163 begin
1164 de.l:=bc.l;
1165 result:=4;
1166 end;
1167
1168 function LD_E_D:byte;
1169 begin
1170 de.l:=de.h;
1171 result:=4;
1172 end;
1173
1174 function LD_E_E:byte;
1175 begin
1176 result:=4;
1177 end;
1178
1179 function LD_E_H:byte;
1180 begin
1181 de.l:=hl.h;
1182 result:=4;
1183 end;
1184
1185 function LD_E_L:byte;
1186 begin
1187 de.l:=hl.l;
1188 result:=4;
1189 end;
1190
1191 function LD_E_xHL:byte;
1192 begin
1193 asm
1194 mov ax,hl.w
1195 push eax
1196 call speekb
1197 lea esp,[esp+4]
1198 mov de.l,al
1199 end;
1200 ;
1201 result:=8;
1202 end;
1203
1204 function LD_E_A:byte;
1205 begin
1206 de.l:=af.h;
1207 result:=4;
1208 end;
1209
1210 function LD_H_B:byte;
1211 begin
1212 hl.h:=bc.h;
1213 result:=4;
1214 end;
1215
1216 function LD_H_C:byte;
1217 begin
1218 hl.h:=bc.l;
1219 result:=4;
1220 end;
1221
1222 function LD_H_D:byte;
1223 begin
1224 hl.h:=de.h;
1225 result:=4;
1226 end;
1227
1228 function LD_H_E:byte;
1229 begin
1230 hl.h:=de.l;
1231 result:=4;
1232 end;
1233
1234 function LD_H_H:byte;
1235 begin
1236 result:=4;
1237 end;
1238
1239 function LD_H_L:byte;
1240 begin
1241 hl.h:=hl.l;
1242 result:=4;
1243 end;
1244
1245 function LD_H_xHL:byte;
1246 begin
1247 asm
1248 mov ax,hl.w
1249 push eax
1250 call speekb
1251 lea esp,[esp+4]
1252 mov hl.h,al
1253 end;
1254
1255 result:=8;
1256 end;
1257
1258 function LD_H_A:byte;
1259 begin
1260 hl.h:=af.h;
1261 result:=4;
1262 end;
1263
1264 function LD_L_B:byte;
1265 begin
1266 hl.l:=bc.h;
1267 result:=4;
1268 end;
1269
1270 function LD_L_C:byte;
1271 begin
1272 hl.l:=bc.l;
1273 result:=4;
1274 end;
1275
1276 function LD_L_D:byte;
1277 begin
1278 hl.l:=de.h;
1279 result:=4;
1280 end;
1281
1282 function LD_L_E:byte;
1283 begin
1284 hl.l:=de.l;
1285 result:=4;
1286 end;
1287
1288 function LD_L_H:byte;
1289 begin
1290 hl.l:=hl.h;
1291 result:=4;
1292 end;
1293
1294 function LD_L_L:byte;
1295 begin
1296 result:=4;
1297 end;
1298
1299 function LD_L_xHL:byte;
1300 begin
1301 asm
1302 mov ax,hl.w
1303 push eax
1304 call speekb
1305 lea esp,[esp+4]
1306 mov hl.l,al
1307 end;
1308
1309 result:=8;
1310 end;
1311
1312 function LD_L_A:byte;
1313 begin
1314 hl.l:=af.h;
1315 result:=4;
1316 end;
1317
1318 function LD_xHL_B:byte;
1319 begin
1320 asm
1321 mov ax,hl.w
1322 push dword ptr bc.h
1323 push eax
1324 call SpokeB
1325 lea esp,[esp+8]
1326 end;
1327
1328 result:=8;
1329 end;
1330
1331 function LD_xHL_C:byte;
1332 begin
1333 asm
1334 mov ax,hl.w
1335 push dword ptr bc.l
1336 push eax
1337 call SpokeB
1338 lea esp,[esp+8]
1339 end;
1340
1341 result:=8;
1342 end;
1343
1344 function LD_xHL_D:byte;
1345 begin
1346 asm
1347 mov ax,hl.w
1348 push dword ptr de.h
1349 push eax
1350 call SpokeB
1351 lea esp,[esp+8]
1352 end;
1353
1354 result:=8;
1355 end;
1356
1357 function LD_xHL_E:byte;
1358 begin
1359 asm
1360 mov ax,hl.w
1361 push dword ptr de.l
1362 push eax
1363 call SpokeB
1364 lea esp,[esp+8]
1365 end;
1366
1367 result:=8;
1368 end;
1369
1370 function LD_xHL_H:byte;
1371 begin
1372 asm
1373 mov ax,hl.w
1374 push dword ptr hl.h
1375 push eax
1376 call SpokeB
1377 lea esp,[esp+8]
1378 end;
1379
1380 result:=8;
1381 end;
1382
1383 function LD_xHL_L:byte;
1384 begin
1385 asm
1386 mov ax,hl.w
1387 push dword ptr hl.l
1388 push eax
1389 call SpokeB
1390 lea esp,[esp+8]
1391 end;
1392
1393 result:=8;
1394 end;
1395
1396 function HALT:byte;
1397 begin
1398 if gbr_ime then halt_mode:=1 else halt_mode:=2;
1399 result:=4;
1400 end;
1401
1402 function LD_xHL_A:byte;
1403 begin
1404 asm
1405 mov ax,hl.w
1406 push dword ptr af.h
1407 push eax
1408 call SpokeB
1409 lea esp,[esp+8]
1410 end;
1411
1412 result:=8;
1413 end;
1414
1415 function LD_A_B:byte;
1416 begin
1417 af.h:=bc.h;
1418 result:=4;
1419 end;
1420
1421 function LD_A_C:byte;
1422 begin
1423 af.h:=bc.l;
1424 result:=4;
1425 end;
1426
1427 function LD_A_D:byte;
1428 begin
1429 af.h:=de.h;
1430 result:=4;
1431 end;
1432
1433 function LD_A_E:byte;
1434 begin
1435 af.h:=de.l;
1436 result:=4;
1437 end;
1438
1439 function LD_A_H:byte;
1440 begin
1441 af.h:=hl.h;
1442 result:=4;
1443 end;
1444
1445 function LD_A_L:byte;
1446 begin
1447 af.h:=hl.l;
1448 result:=4;
1449 end;
1450
1451 function LD_A_xHL:byte;
1452 begin
1453 asm
1454 mov ax,hl.w
1455 push eax
1456 call speekb
1457 lea esp,[esp+4]
1458 mov af.h,al
1459 end;
1460
1461 result:=8;
1462 end;
1463
1464 function LD_A_A:byte;
1465 begin
1466 result:=4;
1467 end;
1468
1469 function ADD_B:byte;
1470 begin
1471 asm
1472 mov al,bc.h
1473 add af.h,al
1474 lahf
1475 and eax,$5100
1476 mov af.l,ah
1477
1478 end;
1479 result:=4;
1480 end;
1481
1482 function ADD_C:byte;
1483 begin
1484 asm
1485 mov al,bc.l
1486 add af.h,al
1487 lahf
1488 and ah,81
1489 mov af.l,ah
1490
1491 end;
1492 result:=4;
1493 end;
1494
1495 function ADD_D:byte;
1496 begin
1497 asm
1498 mov al,de.h
1499 add af.h,al
1500 lahf
1501 and ah,81
1502 mov af.l,ah
1503
1504 end;
1505
1506 result:=4;
1507 end;
1508
1509 function ADD_E:byte;
1510 begin
1511 asm
1512 mov al,de.l
1513 add af.h,al
1514 lahf
1515 and ah,81
1516 mov af.l,ah
1517
1518 end;
1519
1520 result:=4;
1521 end;
1522
1523 function ADD_H:byte;
1524 begin
1525 asm
1526 mov al,hl.h
1527 add af.h,al
1528 lahf
1529 and ah,81
1530 mov af.l,ah
1531
1532 end;
1533
1534 result:=4;
1535 end;
1536
1537 function ADD_L:byte;
1538 begin
1539 asm
1540 mov al,hl.l
1541 add af.h,al
1542 lahf
1543 and ah,81
1544 mov af.l,ah
1545
1546 end;
1547 result:=4;
1548 end;
1549
1550 function ADD_xHL:byte;
1551 begin
1552
1553 asm
1554 mov ax,hl.w
1555 push eax
1556 call speekb
1557 lea esp,[esp+4]
1558
1559 add af.h,al
1560 lahf
1561 and eax,$5100
1562 mov af.l,ah
1563
1564 end;
1565 result:=8;
1566 end;
1567
1568 function ADD_A:byte;
1569 begin
1570 asm
1571 mov al,af.h
1572 add af.h,al
1573 lahf
1574 and ah,81
1575 mov af.l,ah
1576
1577 end;
1578
1579 result:=4;
1580 end;
1581
1582 function ADC_B:byte;
1583 begin
1584 asm
1585 mov ah,af.l
1586 sahf
1587 mov al,bc.h
1588 adc af.h,al
1589 lahf
1590 and eax,$5100
1591 mov af.l,ah
1592
1593 end;
1594
1595 result:=4;
1596 end;
1597
1598 function ADC_C:byte;
1599 begin
1600 asm
1601 mov ah,af.l
1602 sahf
1603 mov al,bc.l
1604 adc af.h,al
1605 lahf
1606 and eax,$5100
1607 mov af.l,ah
1608
1609 end;
1610
1611 result:=4;
1612 end;
1613
1614 function ADC_D:byte;
1615 begin
1616 asm
1617 mov ah,af.l
1618 sahf
1619 mov al,de.h
1620 adc af.h,al
1621 lahf
1622 and eax,$5100
1623 mov af.l,ah
1624
1625 end;
1626 result:=4;
1627 end;
1628
1629 function ADC_E:byte;
1630 begin
1631 asm
1632 mov ah,af.l
1633 sahf
1634 mov al,de.l
1635 adc af.h,al
1636 lahf
1637 and eax,$5100
1638 mov af.l,ah
1639
1640 end;
1641
1642 result:=4;
1643 end;
1644
1645 function ADC_H:byte;
1646 begin
1647 asm
1648 mov ah,af.l
1649 sahf
1650 mov al,hl.h
1651 adc af.h,al
1652 lahf
1653 and eax,$5100
1654 mov af.l,ah
1655
1656 end;
1657
1658 result:=4;
1659 end;
1660
1661 function ADC_L:byte;
1662 begin
1663 asm
1664 mov ah,af.l
1665 sahf
1666 mov al,hl.l
1667 adc af.h,al
1668 lahf
1669 and eax,$5100
1670 mov af.l,ah
1671
1672 end;
1673
1674 result:=4;
1675 end;
1676
1677 function ADC_xHL:byte;
1678 begin
1679
1680 asm
1681 mov ax,hl.w
1682 push eax
1683 call speekb
1684 lea esp,[esp+4]
1685 mov ah,af.l
1686 and ah,1
1687 sahf
1688
1689 adc af.h,al
1690 lahf
1691 and eax,$5100
1692 mov af.l,ah
1693
1694 end;
1695
1696 result:=8;
1697 end;
1698
1699 function ADC_A:byte;
1700 begin
1701 asm
1702 mov ah,af.l
1703 sahf
1704 mov al,af.h
1705 adc af.h,al
1706 lahf
1707 and eax,$5100
1708 mov af.l,ah
1709
1710 end;
1711
1712 result:=4;
1713 end;
1714
1715 function SUB_B:byte;
1716 begin
1717 asm
1718 mov al,bc.h
1719 sub af.h,al
1720 lahf
1721 or eax,$400
1722 mov af.l,ah
1723
1724 end;
1725 result:=4;
1726 end;
1727
1728 function SUB_C:byte;
1729 begin
1730 asm
1731 mov al,bc.l
1732 sub af.h,al
1733 lahf
1734 or eax,$400
1735 mov af.l,ah
1736
1737 end;
1738
1739 result:=4;
1740 end;
1741
1742 function SUB_D:byte;
1743 begin
1744 asm
1745 mov al,de.h
1746 sub af.h,al
1747 lahf
1748 or eax,$400
1749 mov af.l,ah
1750
1751 end;
1752
1753 result:=4;
1754 end;
1755
1756 function SUB_E:byte;
1757 begin
1758 asm
1759 mov al,de.l
1760 sub af.h,al
1761 lahf
1762 or eax,$400
1763 mov af.l,ah
1764
1765 end;
1766
1767
1768 result:=4;
1769 end;
1770
1771 function SUB_H:byte;
1772 begin
1773 asm
1774 mov al,hl.h
1775 sub af.h,al
1776 lahf
1777 or eax,$400
1778 mov af.l,ah
1779
1780 end;
1781
1782 result:=4;
1783 end;
1784
1785 function SUB_L:byte;
1786 begin
1787 asm
1788 mov al,hl.l
1789 sub af.h,al
1790 lahf
1791 or eax,$400
1792 mov af.l,ah
1793
1794 end;
1795
1796 result:=4;
1797 end;
1798
1799 function SUB_xHL:byte;
1800 begin
1801
1802 asm
1803 mov ax,hl.w
1804 push eax
1805 call speekb
1806 lea esp,[esp+4]
1807
1808 sub af.h,al
1809 lahf
1810 or eax,$400
1811 mov af.l,ah
1812
1813 end;
1814
1815 result:=8;
1816 end;
1817
1818 function SUB_A:byte;
1819 begin
1820 asm
1821 mov al,af.h
1822 sub af.h,al
1823 lahf
1824 or eax,$400
1825 mov af.l,ah
1826
1827 end;
1828 result:=4;
1829
1830 end;
1831
1832 function SBC_B:byte;
1833 begin
1834 asm
1835 mov ah,af.l
1836 sahf
1837 mov al,bc.h
1838 sbb af.h,al
1839 lahf
1840 or eax,$400
1841 mov af.l,ah
1842
1843 end;
1844
1845 result:=4;
1846
1847 end;
1848
1849 function SBC_C:byte;
1850 begin
1851 asm
1852 mov ah,af.l
1853 sahf
1854 mov al,bc.l
1855 sbb af.h,al
1856 lahf
1857 or eax,$400
1858 mov af.l,ah
1859
1860 end;
1861
1862 result:=4;
1863 end;
1864
1865 function SBC_D:byte;
1866 begin
1867 asm
1868 mov ah,af.l
1869 sahf
1870 mov al,de.h
1871 sbb af.h,al
1872 lahf
1873 or eax,$400
1874 mov af.l,ah
1875
1876 end;
1877
1878 result:=4;
1879 end;
1880
1881 function SBC_E:byte;
1882 begin
1883 asm
1884 mov ah,af.l
1885 sahf
1886 mov al,de.l
1887 sbb af.h,al
1888 lahf
1889 or eax,$400
1890 mov af.l,ah
1891
1892 end;
1893
1894 result:=4;
1895 end;
1896
1897 function SBC_H:byte;
1898 begin
1899 asm
1900 mov ah,af.l
1901 sahf
1902 mov al,hl.h
1903 sbb af.h,al
1904 lahf
1905 or eax,$400
1906 mov af.l,ah
1907
1908 end;
1909
1910 result:=4;
1911 end;
1912
1913 function SBC_L:byte;
1914 begin
1915 asm
1916 mov ah,af.l
1917 sahf
1918 mov al,hl.l
1919 sbb af.h,al
1920 lahf
1921 or eax,$400
1922 mov af.l,ah
1923
1924 end;
1925
1926 result:=4;
1927 end;
1928
1929 function SBC_xHL:byte;
1930 begin
1931
1932 asm
1933 mov ax,hl.w
1934 push eax
1935 call speekb
1936 lea esp,[esp+4]
1937 mov ah,af.l
1938 sahf
1939
1940 sbb af.h,al
1941 lahf
1942 or eax,$400
1943 mov af.l,ah
1944
1945 end;
1946 result:=8;
1947 end;
1948
1949 function SBC_A:byte;
1950 begin
1951 asm
1952 mov ah,af.l
1953 sahf
1954 mov al,af.h
1955 sbb af.h,al
1956 lahf
1957 or eax,$400
1958 mov af.l,ah
1959
1960 end;
1961 result:=4;
1962 end;
1963
1964 function AND_B:byte;
1965 begin
1966 asm
1967 mov al,bc.h
1968 and af.h,al
1969 lahf
1970 and eax,$4000
1971 or eax,$1000
1972 mov af.l,ah
1973 end;
1974 result:=4;
1975 end;
1976
1977 function AND_C:byte;
1978 begin
1979 asm
1980 mov al,bc.l
1981 and af.h,al
1982 lahf
1983 and eax,$4000
1984 or eax,$1000
1985 mov af.l,ah
1986 end;
1987
1988 result:=4;
1989 end;
1990
1991 function AND_D:byte;
1992 begin
1993 asm
1994 mov al,de.h
1995 and af.h,al
1996 lahf
1997 and eax,$4000
1998 or eax,$1000
1999 mov af.l,ah
Diff truncated after the static-page render limit. Clone the repository to inspect the complete change.
AddedDebugger/UnitDebug.lfm +17−0
@@ -0,0 +1,17 @@
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
AddedDebugger/UnitDebug.pas +36−0
@@ -0,0 +1,36 @@
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 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
20 debugger, StdCtrls, ComCtrls, Menus;
21 type
22 TfrmDebug = class(TForm)
23 private
24 { Private-Deklarationen}
25 public
26 { Public-Deklarationen}
27 end;
28
29 var
30 frmDebug: TfrmDebug;
31
32 implementation
33
34 {$R *.lfm}
35
36 end.
AddedDebugger/UnitMapview.lfm +194−0
@@ -0,0 +1,194 @@
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
AddedDebugger/UnitMapview.pas +450−0
@@ -0,0 +1,450 @@
1 // GBColor does´nt work yet
2 unit UnitMapview;
3
4 {$MODE Delphi}
5
6 interface
7
8 uses
9 Windows, 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; X,
42 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 uses vars;
55
56 const mapBase:word=$1800;
57 vidBase=$8000;
58
59
60 {$R *.lfm}
61
62 procedure TfrmMapview.PaintBox1Paint(Sender: TObject);
63 begin
64 DoUpdate;
65 end;
66
67 procedure TfrmMapview.DoUpdate;
68 var bmp:TBitmap;
69
70 i,j,x,y:byte; // Tilepositions
71 n: Word;
72
73 pal:byte;
74
75 tileptr:Array[0..1] of byte;
76 bmpPtr0:pointer;
77
78 tile_addr:Word;
79 bmpPtr0_index:word;
80
81 bit,bit0,bit1:byte;
82 c:Word;
83 vflip,hflip:boolean;
84 begin
85
86 case m_iram[$FF40] and $48 of
87 $00: begin
88 TabControl1.Tabs.Strings[0]:='$9800 (BG/Wnd)';
89 TabControl1.Tabs.Strings[1]:='$9C00';
90 end;
91 $08: begin
92 TabControl1.Tabs.Strings[0]:='$9800 (Wnd)';
93 TabControl1.Tabs.Strings[1]:='$9C00 (BG)';
94 end;
95 $40: begin
96 TabControl1.Tabs.Strings[0]:='$9800 (BG)';
97 TabControl1.Tabs.Strings[1]:='$9C00 (Wnd)';
98 end;
99 $48: begin
100 TabControl1.Tabs.Strings[0]:='$9800';
101 TabControl1.Tabs.Strings[1]:='$9C00 (BG/Wnd)';
102 end;
103 end;
104
105 bmp:=TBitmap.Create;
106 bmp.Width:=8;
107 bmp.Height:=8;
108 bmp.PixelFormat:=pf24bit;
109 for y:=0 to 31 do
110 for x:=0 to 31 do
111 begin
112 vflip:=false;
113 hflip:=false;
114 if m_Iram[$FF40] and 16>0 then
115 n:=m_iram[vidbase+mapBase+y*32+x]
116 else
117 n:=256+shortint(m_iram[vidbase+mapBase+y*32+x]);
118
119
120 if gb_mode=cgb then
121 begin
122 if m_iram[vidbase+mapBase+y*32+x+$2000] and 8>0 then inc(n,512);
123 vflip:=m_iram[vidbase+mapBase+y*32+x+$2000] and $40>0;
124 hflip:=m_iram[vidbase+mapBase+y*32+x+$2000] and $20>0;
125 end;
126 pal:=m_iram[vidbase+mapBase+y*32+x+$2000] and 7;
127
128 for j:=0 to 7 do
129 begin
130 if vflip then
131 i:=7-j else i:=j;
132
133 if n>=512 then
134 tile_Addr:=vidbase+$2000+(n-512)*16+i*2 else
135 tile_Addr:=vidbase+n*16+i*2;
136
137 tilePtr[0]:=m_iram[tile_Addr];
138 tilePtr[1]:=m_iram[tile_Addr+1];
139
140 bmpPtr0:=bmp.ScanLine[j];bmpPtr0_index:=0;
141
142 if hflip then bit:=1 else bit:=128;
143 for i:=0 to 7 do
144 begin
145 if tilePtr[0] and bit>0 then bit0:=1 else bit0:=0;
146 if tilePtr[1] and bit>0 then bit1:=2 else bit1:=0;
147 if hflip then bit:=bit shl 1 else bit:=bit shr 1;
148
149 if gb_mode<>cgb then
150 begin
151 case bit1 or bit0 of
152 0: c:=3-m_Iram[$FF47] and 3;
153 1: c:=3-(m_Iram[$FF47] shr 2) and 3;
154 2: c:=3-(m_Iram[$FF47] shr 4) and 3;
155 3: c:=3-(m_Iram[$FF47] shr 6) and 3;
156 end;
157 c:=c*255 div 3;
158
159 byte(pchar(bmpPtr0)[bmpPtr0_index]):=c;inc(bmpPtr0_index);
160 byte(pchar(bmpPtr0)[bmpPtr0_index]):=c;inc(bmpPtr0_index);
161 byte(pchar(bmpPtr0)[bmpPtr0_index]):=c;inc(bmpPtr0_index);
162
163 end
164 else
165 begin
166 c:=bit1 or bit0;
167 byte(pchar(bmpPtr0)[bmpPtr0_index]):= (palramb[(pal shl 2)+c] and 31) shl 3;inc(bmpPtr0_index);
168 byte(pchar(bmpPtr0)[bmpPtr0_index]):=((palramb[(pal shl 2)+c] shr 5) and 31) shl 3;inc(bmpPtr0_index);
169 byte(pchar(bmpPtr0)[bmpPtr0_index]):=((palramb[(pal shl 2)+c] shr 10) and 31) shl 3;inc(bmpPtr0_index);
170 end;
171
172 end;
173 end;
174 PaintBox1.Canvas.Pen.Color:=clSilver;
175 PaintBox1.Canvas.Brush.Color:=clSilver;
176 PaintBox1.Canvas.Rectangle(x*9,y*9,x*9+9,y*9+9);
177 PaintBox1.Canvas.Draw(x*9,y*9,bmp);
178 end;
179 end;
180
181 procedure TfrmMapview.TabControl1Change(Sender: TObject);
182 begin
183 if TabControl1.TabIndex=0 then mapBase:=$1800 else mapBase:=$1c00;
184 DoUpdate;
185 end;
186
187 procedure TfrmMapview.PaintBox1MouseMove(Sender: TObject;
188 Shift: TShiftState; X, Y: Integer);
189 var i,j,n:integer;
190 vflp,hflp:Boolean;
191 tile_Addr: Word;
192 str:String;
193 p:integer;
194 tilePtr:Array[0..1] of byte;
195 bit0,bit1,bit,c:Byte;
196 rect:TRect;
197 r,g,b:byte;
198 begin
199 x:=X div 9;
200 y:=Y div 9;
201
202 vflp:=false;
203 hflp:=false;
204
205 if m_iram[$FF40] and 16>0 then
206 n:=m_iram[vidbase+mapBase+y*32+x]
207 else
208 n:=256+shortint(m_iram[vidbase+mapBase+y*32+x]);
209
210 if gb_mode=cgb then
211 begin
212 if m_iram[vidbase+mapBase+y*32+x+$2000] and 8>0 then inc(n,512);
213
214 vflp:=m_iram[vidbase+mapBase+y*32+x+$2000] and $40>0;
215 hflp:=m_iram[vidbase+mapBase+y*32+x+$2000] and $20>0;
216 end;
217
218 p:=m_iram[vidbase+mapBase+y*32+x+$2000] and 7;
219 Number.Caption:='Tile number = '+inttostr(m_iram[vidbase+mapBase+y*32+x]);
220 if (n<512) then
221 Address.Caption:='Tile address = 0:'+inttostr(n*16+$8000)
222 else
223 Address.Caption:='Tile address = 1:'+inttostr((n-512)*16+$8000);
224
225 if HFlp then HFlip.Caption:='HFlip=Yes' else HFlip.Caption:='HFlip=No';
226 if vFlp then vFlip.Caption:='VFlip=Yes' else vFlip.Caption:='VFlip=No';
227
228 for j:=0 to 7 do
229 begin
230 if vflp then i:=7-j else i:=j;
231
232 if n>=512 then
233 tile_Addr:=vidbase+$2000+(n-512)*16+i*2 else
234 tile_Addr:=vidbase+n*16+i*2;
235
236 tilePtr[0]:=m_iram[tile_Addr];
237 tilePtr[1]:=m_iram[tile_Addr+1];
238
239 if hflp then bit:=1 else bit:=128;
240 for i:=0 to 7 do
241 begin
242 if tilePtr[0] and bit>0 then bit0:=1 else bit0:=0;
243 if tilePtr[1] and bit>0 then bit1:=2 else bit1:=0;
244 if hflp then bit:=bit shl 1 else bit:=bit shr 1;
245
246 if gb_mode<>cgb then
247 begin
248 case bit1 or bit0 of
249 0: c:=3-m_Iram[$FF47] and 3;
250 1: c:=3-(m_Iram[$FF47] shr 2) and 3;
251 2: c:=3-(m_Iram[$FF47] shr 4) and 3;
252 3: c:=3-(m_Iram[$FF47] shr 6) and 3;
253 end;
254
255 Shape1.Brush.Color:=((((3-m_iram[$FF47] and 3)*255 div 3) shl 16) or (((3-m_iram[$FF47] and 3)*255 div 3) shl 8) or ((3-m_iram[$FF47] and 3)*255 div 3));
256 Shape2.Brush.Color:=((((3-(m_iram[$FF47] shr 2) and 3)*255 div 3) shl 16) or (((3-(m_iram[$FF47] shr 2) and 3)*255 div 3) shl 8) or ((3-(m_iram[$FF47] shr 2) and 3)*255 div 3));
257 Shape3.Brush.Color:=((((3-(m_iram[$FF47] shr 4) and 3)*255 div 3) shl 16) or (((3-(m_iram[$FF47] shr 4) and 3)*255 div 3) shl 8) or ((3-(m_iram[$FF47] shr 4) and 3)*255 div 3));
258 Shape4.Brush.Color:=((((3-(m_iram[$FF47] shr 6) and 3)*255 div 3) shl 16) or (((3-(m_iram[$FF47] shr 6) and 3)*255 div 3) shl 8) or ((3-(m_iram[$FF47] shr 6) and 3)*255 div 3));
259
260 R0.Caption:='R='+inttostr((3-m_iram[$FF47] and 3)*31 div 3);
261 G0.Caption:='G='+inttostr((3-m_iram[$FF47] and 3)*31 div 3);
262 B0.Caption:='B='+inttostr((3-m_iram[$FF47] and 3)*31 div 3);
263 R1.Caption:='R='+inttostr((3-(m_iram[$FF47] shr 2) and 3)*31 div 3);
264 G1.Caption:='G='+inttostr((3-(m_iram[$FF47] shr 2) and 3)*31 div 3);
265 B1.Caption:='B='+inttostr((3-(m_iram[$FF47] shr 2) and 3)*31 div 3);
266 R2.Caption:='R='+inttostr((3-(m_iram[$FF47] shr 4) and 3)*31 div 3);
267 G2.Caption:='G='+inttostr((3-(m_iram[$FF47] shr 4) and 3)*31 div 3);
268 B2.Caption:='B='+inttostr((3-(m_iram[$FF47] shr 4) and 3)*31 div 3);
269 R3.Caption:='R='+inttostr((3-(m_iram[$FF47] shr 6) and 3)*31 div 3);
270 G3.Caption:='G='+inttostr((3-(m_iram[$FF47] shr 6) and 3)*31 div 3);
271 B3.Caption:='B='+inttostr((3-(m_iram[$FF47] shr 6) and 3)*31 div 3);
272
273 c:=c*255 div 3;
274
275 PaintBox2.Canvas.Brush.Color:=((c shl 16) or (c shl 8) or c);
276
277 with rect do
278 begin
279 Left:=16*i; Right:=16*i+15;
280 Top:=16*j; Bottom:=16*j+15;
281 end;
282 PaintBox2.Canvas.FillRect(rect);
283 end
284 else
285 begin
286 c:=bit1 or bit0;
287 Shape1.Brush.Color:=(((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));
288 Shape2.Brush.Color:=(((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));
289 Shape3.Brush.Color:=(((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));
290 Shape4.Brush.Color:=(((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));
291 R0.Caption:='R='+inttostr(palramb[(p shl 2)+0] and 31);
292 G0.Caption:='G='+inttostr(palramb[(p shl 2)+1] and 31);
293 B0.Caption:='B='+inttostr(palramb[(p shl 2)+2] and 31);
294 R1.Caption:='R='+inttostr(palramb[(p shl 2)+3] and 31);
295 G1.Caption:='G='+inttostr((palramb[(p shl 2)+0] shr 5) and 31);
296 B1.Caption:='B='+inttostr((palramb[(p shl 2)+1] shr 5) and 31);
297 R2.Caption:='R='+inttostr((palramb[(p shl 2)+2] shr 5) and 31);
298 G2.Caption:='G='+inttostr((palramb[(p shl 2)+3] shr 5) and 31);
299 B2.Caption:='B='+inttostr((palramb[(p shl 2)+0] shr 10) and 31);
300 R3.Caption:='R='+inttostr((palramb[(p shl 2)+1] shr 10) and 31);
301 G3.Caption:='G='+inttostr((palramb[(p shl 2)+2] shr 10) and 31);
302 B3.Caption:='B='+inttostr((palramb[(p shl 2)+3] shr 10) and 31);
303
304 r:=(palramb[(p shl 2)+c] and 31) shl 3;
305 g:=((palramb[(p shl 2)+c] shr 5) and 31) shl 3;
306 b:=((palramb[(p shl 2)+c] shr 10) and 31) shl 3;
307 PaintBox2.Canvas.Brush.Color:=((r shl 16) or (g shl 8) or b);
308 with rect do
309 begin
310 Left:=16*i; Right:=16*i+15;
311 Top:=16*j; Bottom:=16*j+15;
312 end;
313 PaintBox2.Canvas.FillRect(rect);
314 end;
315 end;
316 end;
317 end;
318
319 end.
320 //---------------------------------------------------------------------------
321
322 void __fastcall TMapWnd::PaintBox1MouseMove(TObject *Sender,
323 TShiftState Shift, int X, int Y)
324 {
325 int x=X/9;
326 int y=Y/9;
327 int n;
328 int vflip=0;
329 int hflip=0;
330 if (m_iram[$FF40] and 16)
331 n={vid} m_iram[mapBase+y*32+x];
332 else
333 n=256+(int)((char){vid} m_iram[mapBase+y*32+x]);
334 if (cgb)
335 {
336 n+=({vid} m_iram[mapBase+y*32+x+$2000] and 8)?512:0;
337 vflip={vid} m_iram[mapBase+y*32+x+$2000] and $40;
338 hflip={vid} m_iram[mapBase+y*32+x+$2000] and $20;
339 }
340 int p={vid} m_iram[mapBase+y*32+x+$2000] and 7;
341 char str[32];
342 sprintf(str,'Tile number = $%2.2X',{vid} m_iram[mapBase+y*32+x]);
343 Number.Caption=str;
344 if (n<512)
345 sprintf(str,'Tile address = 0:$%4.4X',n*16+$8000);
346 else
347 sprintf(str,'Tile address = 1:$%4.4X',(n-512)*16+$8000);
348 Address.Caption=str;
349 sprintf(str,'HFlip=%s',hflip?'Yes':'No');
350 HFlip.Caption=str;
351 sprintf(str,'VFlip=%s',vflip?'Yes':'No');
352 VFlip.Caption=str;
353 for (int j=0;j<8;j++)
354 {
355 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]);
356 for (int i=0,bit=hflip?1:128;i<8;i++,hflip?bit shl =1:bit shr =1)
357 {
358 int b0=(tilePtr[0] and bit)?1:0;
359 int b1=(tilePtr[1] and bit)?2:0;
360 if (!cgb)
361 {
362 int c=b1 or b0;
363 switch (c)
364 {
365 case 0: c=3-m_iram[$FF47] and 3; break;
366 case 1: c=3-(m_iram[$FF47] shr 2) and 3; break;
367 case 2: c=3-(m_iram[$FF47] shr 4) and 3; break;
368 case 3: c=3-(m_iram[$FF47] shr 6) and 3; break;
369 }
370 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));
371 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));
372 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));
373 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));
374 char str[8];
375 sprintf(str,'R=%d',((3-m_iram[$FF47] and 3)*31/3));
376 R0.Caption=str;
377 sprintf(str,'G=%d',((3-m_iram[$FF47] and 3)*31/3));
378 G0.Caption=str;
379 sprintf(str,'B=%d',((3-m_iram[$FF47] and 3)*31/3));
380 B0.Caption=str;
381 sprintf(str,'R=%d',((3-(m_iram[$FF47] shr 2) and 3)*31/3));
382 R1.Caption=str;
383 sprintf(str,'G=%d',((3-(m_iram[$FF47] shr 2) and 3)*31/3));
384 G1.Caption=str;
385 sprintf(str,'B=%d',((3-(m_iram[$FF47] shr 2) and 3)*31/3));
386 B1.Caption=str;
387 sprintf(str,'R=%d',((3-(m_iram[$FF47] shr 4) and 3)*31/3));
388 R2.Caption=str;
389 sprintf(str,'G=%d',((3-(m_iram[$FF47] shr 4) and 3)*31/3));
390 G2.Caption=str;
391 sprintf(str,'B=%d',((3-(m_iram[$FF47] shr 4) and 3)*31/3));
392 B2.Caption=str;
393 sprintf(str,'R=%d',((3-(m_iram[$FF47] shr 6) and 3)*31/3));
394 R3.Caption=str;
395 sprintf(str,'G=%d',((3-(m_iram[$FF47] shr 6) and 3)*31/3));
396 G3.Caption=str;
397 sprintf(str,'B=%d',((3-(m_iram[$FF47] shr 6) and 3)*31/3));
398 B3.Caption=str;
399 c*=255;
400 c/=3;
401 PaintBox2.Canvas.Brush.Color=(TColor)((c shl 16) or (c shl 8) or c);
402 TRect r;
403 r.Left=16*i; r.Right=16*i+15;
404 r.Top=16*j; r.Bottom=16*j+15;
405 PaintBox2.Canvas.FillRect(r);
406 }
407 else
408 {
409 int c=b1 or b0;
410 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));
411 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));
412 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));
413 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));
414 char str[8];
415 sprintf(str,'B=%d',((palramb[(p shl 2)+0] and 31)));
416 B0.Caption=str;
417 sprintf(str,'B=%d',((palramb[(p shl 2)+1] and 31)));
418 B1.Caption=str;
419 sprintf(str,'B=%d',((palramb[(p shl 2)+2] and 31)));
420 B2.Caption=str;
421 sprintf(str,'B=%d',((palramb[(p shl 2)+3] and 31)));
422 B3.Caption=str;
423 sprintf(str,'G=%d',((palramb[(p shl 2)+0] shr 5) and 31));
424 G0.Caption=str;
425 sprintf(str,'G=%d',((palramb[(p shl 2)+1] shr 5) and 31));
426 G1.Caption=str;
427 sprintf(str,'G=%d',((palramb[(p shl 2)+2] shr 5) and 31));
428 G2.Caption=str;
429 sprintf(str,'G=%d',((palramb[(p shl 2)+3] shr 5) and 31));
430 G3.Caption=str;
431 sprintf(str,'R=%d',((palramb[(p shl 2)+0] shr 10) and 31));
432 R0.Caption=str;
433 sprintf(str,'R=%d',((palramb[(p shl 2)+1] shr 10) and 31));
434 R1.Caption=str;
435 sprintf(str,'R=%d',((palramb[(p shl 2)+2] shr 10) and 31));
436 R2.Caption=str;
437 sprintf(str,'R=%d',((palramb[(p shl 2)+3] shr 10) and 31));
438 R3.Caption=str;
439 int r=(palramb[(p shl 2)+c] and 31) shl 3;
440 int g=((palramb[(p shl 2)+c] shr 5) and 31) shl 3;
441 int b=((palramb[(p shl 2)+c] shr 10) and 31) shl 3;
442 PaintBox2.Canvas.Brush.Color=(TColor)((r shl 16) or (g shl 8) or b);
443 TRect rect;
444 rect.Left=16*i; rect.Right=16*i+15;
445 rect.Top=16*j; rect.Bottom=16*j+15;
446 PaintBox2.Canvas.FillRect(rect);
447 }
448 }
449 }
450 }
AddedDebugger/debugger.pas +1376−0
@@ -0,0 +1,1376 @@
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 type format=record {Fr opcodes}
20 op:string[18];
21 leng:shortint
22 end;
23
24 const major:array[0..255] of format=(
25 (op:'nop';leng:0),
26 (op:'ld bc,####';leng:2),
27 (op:'ld bc,a';leng:0),
28 (op:'inc bc';leng:0),
29 (op:'inc b';leng:0),
30 (op:'dec b';leng:0),
31 (op:'ld b,##';leng:1),
32 (op:'rlc a';leng:0),
33 (op:'ex af,af''';leng:0),
34 (op:'add hl,bc';leng:0),
35 (op:'ld a,(bc)';leng:0),
36 (op:'dec bc';leng:0),
37 (op:'inc c';leng:0),
38 (op:'dec c';leng:0),
39 (op:'ld c,##';leng:1),
40 (op:'rrc a';leng:0),
41 (op:'djnz ####';leng:-1),
42 (op:'ld de,####';leng:2),
43 (op:'ld (de),a';leng:0),
44 (op:'inc de';leng:0),
45 (op:'inc d';leng:0),
46 (op:'dec d';leng:0),
47 (op:'ld d,##';leng:1),
48 (op:'rla';leng:0),
49 (op:'jr ####';leng:-1),
50 (op:'add hl,de';leng:0),
51 (op:'ld a,(de)';leng:0),
52 (op:'dec de';leng:0),
53 (op:'inc e';leng:0),
54 (op:'dec e';leng:0),
55 (op:'ld e,##';leng:1),
56 (op:'rra';leng:0),
57 (op:'jr nz,####';leng:-1),
58 (op:'ld hl,####';leng:2),
59 (op:'ld (####),hl';leng:2),
60 (op:'inc hl';leng:0),
61 (op:'inc h';leng:0),
62 (op:'dec h';leng:0),
63 (op:'ld h,##';leng:1),
64 (op:'daa';leng:0),
65 (op:'jr z,####';leng:-1),
66 (op:'add hl,hl';leng:0),
67 (op:'ld hl,(####)';leng:2),
68 (op:'dec hl';leng:0),
69 (op:'inc l';leng:0),
70 (op:'dec l';leng:0),
71 (op:'ld l,##';leng:1),
72 (op:'cpl';leng:0),
73 (op:'jr nc,####';leng:-1),
74 (op:'ld sp,####';leng:2),
75 (op:'ld (####),a';leng:2),
76 (op:'inc sp';leng:0),
77 (op:'inc (hl)';leng:0),
78 (op:'dec (hl)';leng:0),
79 (op:'ld (hl),##';leng:1),
80 (op:'scf';leng:0),
81 (op:'jr c,####';leng:-1),
82 (op:'add hl,sp';leng:0),
83 (op:'ld a,(####)';leng:2),
84 (op:'dec sp';leng:0),
85 (op:'inc a';leng:0),
86 (op:'dec a';leng:0),
87 (op:'ld a,##';leng:1),
88 (op:'ccf';leng:0),
89 (op:'ld b,b';leng:0),
90 (op:'ld b,c';leng:0),
91 (op:'ld b,d';leng:0),
92 (op:'ld b,e';leng:0),
93 (op:'ld b,h';leng:0),
94 (op:'ld b,l';leng:0),
95 (op:'ld b,(hl)';leng:0),
96 (op:'ld b,a';leng:0),
97 (op:'ld c,b';leng:0),
98 (op:'ld c,c';leng:0),
99 (op:'ld c,d';leng:0),
100 (op:'ld c,e';leng:0),
101 (op:'ld c,h';leng:0),
102 (op:'ld c,l';leng:0),
103 (op:'ld c,(hl)';leng:0),
104 (op:'ld c,a';leng:0),
105 (op:'ld d,b';leng:0),
106 (op:'ld d,c';leng:0),
107 (op:'ld d,d';leng:0),
108 (op:'ld d,e';leng:0),
109 (op:'ld d,h';leng:0),
110 (op:'ld d,l';leng:0),
111 (op:'ld d,(hl)';leng:0),
112 (op:'ld d,a';leng:0),
113 (op:'ld e,b';leng:0),
114 (op:'ld e,c';leng:0),
115 (op:'ld e,d';leng:0),
116 (op:'ld e,e';leng:0),
117 (op:'ld e,h';leng:0),
118 (op:'ld e,l';leng:0),
119 (op:'ld e,(hl)';leng:0),
120 (op:'ld e,a';leng:0),
121 (op:'ld h,b';leng:0),
122 (op:'ld h,c';leng:0),
123 (op:'ld h,d';leng:0),
124 (op:'ld h,e';leng:0),
125 (op:'ld h,h';leng:0),
126 (op:'ld h,l';leng:0),
127 (op:'ld h,(hl)';leng:0),
128 (op:'ld h,a';leng:0),
129 (op:'ld l,b';leng:0),
130 (op:'ld l,c';leng:0),
131 (op:'ld l,d';leng:0),
132 (op:'ld l,e';leng:0),
133 (op:'ld l,h';leng:0),
134 (op:'ld l,l';leng:0),
135 (op:'ld l,(hl)';leng:0),
136 (op:'ld l,a';leng:0),
137 (op:'ld (hl),b';leng:0),
138 (op:'ld (hl),c';leng:0),
139 (op:'ld (hl),d';leng:0),
140 (op:'ld (hl),e';leng:0),
141 (op:'ld (hl),h';leng:0),
142 (op:'ld (hl),l';leng:0),
143 (op:'halt';leng:0),
144 (op:'ld (hl),a';leng:0),
145 (op:'ld a,b';leng:0),
146 (op:'ld a,c';leng:0),
147 (op:'ld a,d';leng:0),
148 (op:'ld a,e';leng:0),
149 (op:'ld a,h';leng:0),
150 (op:'ld a,l';leng:0),
151 (op:'ld a,(hl)';leng:0),
152 (op:'ld a,a';leng:0),
153 (op:'add a,b';leng:0),
154 (op:'add a,c';leng:0),
155 (op:'add a,d';leng:0),
156 (op:'add a,e';leng:0),
157 (op:'add a,h';leng:0),
158 (op:'add a,l';leng:0),
159 (op:'add a,(hl)';leng:0),
160 (op:'add a,a';leng:0),
161 (op:'adc a,b';leng:0),
162 (op:'adc a,c';leng:0),
163 (op:'adc a,d';leng:0),
164 (op:'adc a,e';leng:0),
165 (op:'adc a,h';leng:0),
166 (op:'adc a,l';leng:0),
167 (op:'adc a,(hl)';leng:0),
168 (op:'adc a,a';leng:0),
169 (op:'sub b';leng:0),
170 (op:'sub c';leng:0),
171 (op:'sub d';leng:0),
172 (op:'sub e';leng:0),
173 (op:'sub h';leng:0),
174 (op:'sub l';leng:0),
175 (op:'sub (hl)';leng:0),
176 (op:'sub a';leng:0),
177 (op:'sbc a,b';leng:0),
178 (op:'sbc a,c';leng:0),
179 (op:'sbc a,d';leng:0),
180 (op:'sbc a,e';leng:0),
181 (op:'sbc a,h';leng:0),
182 (op:'sbc a,l';leng:0),
183 (op:'sbc a,(hl)';leng:0),
184 (op:'sbc a,a';leng:0),
185 (op:'and b';leng:0),
186 (op:'and c';leng:0),
187 (op:'and d';leng:0),
188 (op:'and e';leng:0),
189 (op:'and h';leng:0),
190 (op:'and l';leng:0),
191 (op:'and (hl)';leng:0),
192 (op:'and a';leng:0),
193 (op:'xor b';leng:0),
194 (op:'xor c';leng:0),
195 (op:'xor d';leng:0),
196 (op:'xor e';leng:0),
197 (op:'xor h';leng:0),
198 (op:'xor l';leng:0),
199 (op:'xor (hl)';leng:0),
200 (op:'xor a';leng:0),
201 (op:'or b';leng:0),
202 (op:'or c';leng:0),
203 (op:'or d';leng:0),
204 (op:'or e';leng:0),
205 (op:'or h';leng:0),
206 (op:'or l';leng:0),
207 (op:'or (hl)';leng:0),
208 (op:'or a';leng:0),
209 (op:'cp b';leng:0),
210 (op:'cp c';leng:0),
211 (op:'cp d';leng:0),
212 (op:'cp e';leng:0),
213 (op:'cp h';leng:0),
214 (op:'cp l';leng:0),
215 (op:'cp (hl)';leng:0),
216 (op:'cp a';leng:0),
217 (op:'ret nz';leng:0),
218 (op:'pop bc';leng:0),
219 (op:'jp nz,####';leng:2),
220 (op:'jp ####';leng:2),
221 (op:'call nz,####';leng:2),
222 (op:'push bc';leng:0),
223 (op:'add a,##';leng:1),
224 (op:'rst 0';leng:0),
225 (op:'ret z';leng:0),
226 (op:'ret';leng:0),
227 (op:'jp z,####';leng:2),
228 (op:'';leng:0),
229 (op:'call z,####';leng:2),
230 (op:'call ####';leng:2),
231 (op:'adc a,##';leng:1),
232 (op:'rst 8';leng:0),
233 (op:'ret nc';leng:0),
234 (op:'pop de';leng:0),
235 (op:'jp nc,####';leng:2),
236 (op:'out (##),a';leng:1),
237 (op:'call nc,####';leng:2),
238 (op:'push de';leng:0),
239 (op:'sub ##';leng:1),
240 (op:'rst 10h';leng:0),
241 (op:'ret c';leng:0),
242 (op:'exx';leng:0),
243 (op:'jp c,####';leng:2),
244 (op:'in a,(##)';leng:1),
245 (op:'call c,####';leng:2),
246 (op:'';leng:1),
247 (op:'sbc a,##';leng:1),
248 (op:'rst 18h';leng:0),
249 (op:'ret po';leng:0),
250 (op:'pop hl';leng:0),
251 (op:'jp po,####';leng:2),
252 (op:'ex (sp),hl';leng:0),
253 (op:'call po,####';leng:2),
254 (op:'push hl';leng:0),
255 (op:'and ##';leng:1),
256 (op:'rst 20h';leng:0),
257 (op:'ret pe';leng:0),
258 (op:'jp (hl)';leng:0),
259 (op:'jp pe,####';leng:2),
260 (op:'ex de,hl';leng:0),
261 (op:'call pe,####';leng:2),
262 (op:'';leng:2),
263 (op:'xor ##';leng:1),
264 (op:'rst 28h';leng:0),
265 (op:'ret p';leng:0),
266 (op:'pop af';leng:0),
267 (op:'jp p,####';leng:2),
268 (op:'di';leng:0),
269 (op:'call p,####';leng:2),
270 (op:'push af';leng:0),
271 (op:'or ##';leng:1),
272 (op:'rst 30h';leng:0),
273 (op:'ret m';leng:0),
274 (op:'ld sp,hl';leng:0),
275 (op:'jp m,####';leng:2),
276 (op:'ei';leng:0),
277 (op:'call m,####';leng:2),
278 (op:'';leng:1),
279 (op:'cp ##';leng:1),
280 (op:'rst 38h';leng:0));
281
282 const minor:array[0..3,0..255] of format=((
283 (op:'rlc b';leng:0),
284 (op:'rlc c';leng:0),
285 (op:'rlc d';leng:0),
286 (op:'rlc e';leng:0),
287 (op:'rlc h';leng:0),
288 (op:'rlc l';leng:0),
289 (op:'rlc (hl)';leng:0),
290 (op:'rlc a';leng:0),
291 (op:'rrc b';leng:0),
292 (op:'rrc c';leng:0),
293 (op:'rrc d';leng:0),
294 (op:'rrc e';leng:0),
295 (op:'rrc h';leng:0),
296 (op:'rrc l';leng:0),
297 (op:'rrc (hl)';leng:0),
298 (op:'rrc a';leng:0),
299 (op:'rl b';leng:0),
300 (op:'rl c';leng:0),
301 (op:'rl d';leng:0),
302 (op:'rl e';leng:0),
303 (op:'rl h';leng:0),
304 (op:'rl l';leng:0),
305 (op:'rl (hl)';leng:0),
306 (op:'rl a';leng:0),
307 (op:'rr b';leng:0),
308 (op:'rr c';leng:0),
309 (op:'rr d';leng:0),
310 (op:'rr e';leng:0),
311 (op:'rr h';leng:0),
312 (op:'rr l';leng:0),
313 (op:'rr (hl)';leng:0),
314 (op:'rr a';leng:0),
315 (op:'sla b';leng:0),
316 (op:'sla c';leng:0),
317 (op:'sla d';leng:0),
318 (op:'sla e';leng:0),
319 (op:'sla h';leng:0),
320 (op:'sla l';leng:0),
321 (op:'sla (hl)';leng:0),
322 (op:'sla a';leng:0),
323 (op:'sra b';leng:0),
324 (op:'sra c';leng:0),
325 (op:'sra d';leng:0),
326 (op:'sra e';leng:0),
327 (op:'sra h';leng:0),
328 (op:'sra l';leng:0),
329 (op:'sra (hl)';leng:0),
330 (op:'sra a';leng:0),
331 (op:'slai b';leng:0),
332 (op:'slai c';leng:0),
333 (op:'slai d';leng:0),
334 (op:'slai e';leng:0),
335 (op:'slai h';leng:0),
336 (op:'slai l';leng:0),
337 (op:'slai (hl)';leng:0),
338 (op:'slai a';leng:0),
339 (op:'srl b';leng:0),
340 (op:'srl c';leng:0),
341 (op:'srl d';leng:0),
342 (op:'srl e';leng:0),
343 (op:'srl h';leng:0),
344 (op:'srl l';leng:0),
345 (op:'srl (hl)';leng:0),
346 (op:'srl a';leng:0),
347 (op:'bit 0,b';leng:0),
348 (op:'bit 0,c';leng:0),
349 (op:'bit 0,d';leng:0),
350 (op:'bit 0,e';leng:0),
351 (op:'bit 0,h';leng:0),
352 (op:'bit 0,l';leng:0),
353 (op:'bit 0,(hl)';leng:0),
354 (op:'bit 0,a';leng:0),
355 (op:'bit 1,b';leng:0),
356 (op:'bit 1,c';leng:0),
357 (op:'bit 1,d';leng:0),
358 (op:'bit 1,e';leng:0),
359 (op:'bit 1,h';leng:0),
360 (op:'bit 1,l';leng:0),
361 (op:'bit 1,(hl)';leng:0),
362 (op:'bit 1,a';leng:0),
363 (op:'bit 2,b';leng:0),
364 (op:'bit 2,c';leng:0),
365 (op:'bit 2,d';leng:0),
366 (op:'bit 2,e';leng:0),
367 (op:'bit 2,h';leng:0),
368 (op:'bit 2,l';leng:0),
369 (op:'bit 2,(hl)';leng:0),
370 (op:'bit 2,a';leng:0),
371 (op:'bit 3,b';leng:0),
372 (op:'bit 3,c';leng:0),
373 (op:'bit 3,d';leng:0),
374 (op:'bit 3,e';leng:0),
375 (op:'bit 3,h';leng:0),
376 (op:'bit 3,l';leng:0),
377 (op:'bit 3,(hl)';leng:0),
378 (op:'bit 3,a';leng:0),
379 (op:'bit 4,b';leng:0),
380 (op:'bit 4,c';leng:0),
381 (op:'bit 4,d';leng:0),
382 (op:'bit 4,e';leng:0),
383 (op:'bit 4,h';leng:0),
384 (op:'bit 4,l';leng:0),
385 (op:'bit 4,(hl)';leng:0),
386 (op:'bit 4,a';leng:0),
387 (op:'bit 5,b';leng:0),
388 (op:'bit 5,c';leng:0),
389 (op:'bit 5,d';leng:0),
390 (op:'bit 5,e';leng:0),
391 (op:'bit 5,h';leng:0),
392 (op:'bit 5,l';leng:0),
393 (op:'bit 5,(hl)';leng:0),
394 (op:'bit 5,a';leng:0),
395 (op:'bit 6,b';leng:0),
396 (op:'bit 6,c';leng:0),
397 (op:'bit 6,d';leng:0),
398 (op:'bit 6,e';leng:0),
399 (op:'bit 6,h';leng:0),
400 (op:'bit 6,l';leng:0),
401 (op:'bit 6,(hl)';leng:0),
402 (op:'bit 6,a';leng:0),
403 (op:'bit 7,b';leng:0),
404 (op:'bit 7,c';leng:0),
405 (op:'bit 7,d';leng:0),
406 (op:'bit 7,e';leng:0),
407 (op:'bit 7,h';leng:0),
408 (op:'bit 7,l';leng:0),
409 (op:'bit 7,(hl)';leng:0),
410 (op:'bit 7,a';leng:0),
411 (op:'res 0,b';leng:0),
412 (op:'res 0,c';leng:0),
413 (op:'res 0,d';leng:0),
414 (op:'res 0,e';leng:0),
415 (op:'res 0,h';leng:0),
416 (op:'res 0,l';leng:0),
417 (op:'res 0,(hl)';leng:0),
418 (op:'res 0,a';leng:0),
419 (op:'res 1,b';leng:0),
420 (op:'res 1,c';leng:0),
421 (op:'res 1,d';leng:0),
422 (op:'res 1,e';leng:0),
423 (op:'res 1,h';leng:0),
424 (op:'res 1,l';leng:0),
425 (op:'res 1,(hl)';leng:0),
426 (op:'res 1,a';leng:0),
427 (op:'res 2,b';leng:0),
428 (op:'res 2,c';leng:0),
429 (op:'res 2,d';leng:0),
430 (op:'res 2,e';leng:0),
431 (op:'res 2,h';leng:0),
432 (op:'res 2,l';leng:0),
433 (op:'res 2,(hl)';leng:0),
434 (op:'res 2,a';leng:0),
435 (op:'res 3,b';leng:0),
436 (op:'res 3,c';leng:0),
437 (op:'res 3,d';leng:0),
438 (op:'res 3,e';leng:0),
439 (op:'res 3,h';leng:0),
440 (op:'res 3,l';leng:0),
441 (op:'res 3,(hl)';leng:0),
442 (op:'res 3,a';leng:0),
443 (op:'res 4,b';leng:0),
444 (op:'res 4,c';leng:0),
445 (op:'res 4,d';leng:0),
446 (op:'res 4,e';leng:0),
447 (op:'res 4,h';leng:0),
448 (op:'res 4,l';leng:0),
449 (op:'res 4,(hl)';leng:0),
450 (op:'res 4,a';leng:0),
451 (op:'res 5,b';leng:0),
452 (op:'res 5,c';leng:0),
453 (op:'res 5,d';leng:0),
454 (op:'res 5,e';leng:0),
455 (op:'res 5,h';leng:0),
456 (op:'res 5,l';leng:0),
457 (op:'res 5,(hl)';leng:0),
458 (op:'res 5,a';leng:0),
459 (op:'res 6,b';leng:0),
460 (op:'res 6,c';leng:0),
461 (op:'res 6,d';leng:0),
462 (op:'res 6,e';leng:0),
463 (op:'res 6,h';leng:0),
464 (op:'res 6,l';leng:0),
465 (op:'res 6,(hl)';leng:0),
466 (op:'res 6,a';leng:0),
467 (op:'res 7,b';leng:0),
468 (op:'res 7,c';leng:0),
469 (op:'res 7,d';leng:0),
470 (op:'res 7,e';leng:0),
471 (op:'res 7,h';leng:0),
472 (op:'res 7,l';leng:0),
473 (op:'res 7,(hl)';leng:0),
474 (op:'res 7,a';leng:0),
475 (op:'set 0,b';leng:0),
476 (op:'set 0,c';leng:0),
477 (op:'set 0,d';leng:0),
478 (op:'set 0,e';leng:0),
479 (op:'set 0,h';leng:0),
480 (op:'set 0,l';leng:0),
481 (op:'set 0,(hl)';leng:0),
482 (op:'set 0,a';leng:0),
483 (op:'set 1,b';leng:0),
484 (op:'set 1,c';leng:0),
485 (op:'set 1,d';leng:0),
486 (op:'set 1,e';leng:0),
487 (op:'set 1,h';leng:0),
488 (op:'set 1,l';leng:0),
489 (op:'set 1,(hl)';leng:0),
490 (op:'set 1,a';leng:0),
491 (op:'set 2,b';leng:0),
492 (op:'set 2,c';leng:0),
493 (op:'set 2,d';leng:0),
494 (op:'set 2,e';leng:0),
495 (op:'set 2,h';leng:0),
496 (op:'set 2,l';leng:0),
497 (op:'set 2,(hl)';leng:0),
498 (op:'set 2,a';leng:0),
499 (op:'set 3,b';leng:0),
500 (op:'set 3,c';leng:0),
501 (op:'set 3,d';leng:0),
502 (op:'set 3,e';leng:0),
503 (op:'set 3,h';leng:0),
504 (op:'set 3,l';leng:0),
505 (op:'set 3,(hl)';leng:0),
506 (op:'set 3,a';leng:0),
507 (op:'set 4,b';leng:0),
508 (op:'set 4,c';leng:0),
509 (op:'set 4,d';leng:0),
510 (op:'set 4,e';leng:0),
511 (op:'set 4,h';leng:0),
512 (op:'set 4,l';leng:0),
513 (op:'set 4,(hl)';leng:0),
514 (op:'set 4,a';leng:0),
515 (op:'set 5,b';leng:0),
516 (op:'set 5,c';leng:0),
517 (op:'set 5,d';leng:0),
518 (op:'set 5,e';leng:0),
519 (op:'set 5,h';leng:0),
520 (op:'set 5,l';leng:0),
521 (op:'set 5,(hl)';leng:0),
522 (op:'set 5,a';leng:0),
523 (op:'set 6,b';leng:0),
524 (op:'set 6,c';leng:0),
525 (op:'set 6,d';leng:0),
526 (op:'set 6,e';leng:0),
527 (op:'set 6,h';leng:0),
528 (op:'set 6,l';leng:0),
529 (op:'set 6,(hl)';leng:0),
530 (op:'set 6,a';leng:0),
531 (op:'set 7,b';leng:0),
532 (op:'set 7,c';leng:0),
533 (op:'set 7,d';leng:0),
534 (op:'set 7,e';leng:0),
535 (op:'set 7,h';leng:0),
536 (op:'set 7,l';leng:0),
537 (op:'set 7,(hl)';leng:0),
538 (op:'set 7,a';leng:0)),(
539 (op:'undefined';leng:0),
540 (op:'undefined';leng:0),
541 (op:'undefined';leng:0),
542 (op:'undefined';leng:0),
Diff truncated after the static-page render limit. Clone the repository to inspect the complete change.
AddedDirectX/DXCommon.pas +77−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/Direct3D.pas +4060−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/Direct3DRM.pas +2974−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/DirectDraw.pas +5835−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/DirectInput.pas +2746−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/DirectMusic.pas +4085−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/DirectPlay.pas +2511−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/DirectSetup.pas +347−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/DirectSound.pas +765−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/Readme.txt +13−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/comswitch.inc +7−0
Diff omitted because this commit exceeds the static-page render limit.
AddedDirectX/stringswitch.inc +7−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGBEmu.lpi +170−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGBEmu.lpr +37−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGBEmu.lps +234−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGameboy.lpi +127−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGameboy.lpr +198−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGameboy.lps +158−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGlobal/vars.pas +489−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGpu/ddraw_out.pas +230−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGpu/dib_out.pas +116−0
Diff omitted because this commit exceeds the static-page render limit.
AddedGpu/gfx.pas +354−0
Diff omitted because this commit exceeds the static-page render limit.
AddedSound/sound.pas +711−0
Diff omitted because this commit exceeds the static-page render limit.
AddedUnitMain.lfm +401−0
Diff omitted because this commit exceeds the static-page render limit.
AddedUnitMain.pas +545−0
Diff omitted because this commit exceeds the static-page render limit.
Addeddoc/COPYRIGHT +20−0
Diff omitted because this commit exceeds the static-page render limit.
Addeddoc/ChangeLog +21−0
Diff omitted because this commit exceeds the static-page render limit.
Addeddoc/Copying +339−0
Diff omitted because this commit exceeds the static-page render limit.
Addeddoc/GBSPEC.TXT +1377−0
Diff omitted because this commit exceeds the static-page render limit.
Addeddoc/HARDWARE.TXT +492−0
Diff omitted because this commit exceeds the static-page render limit.
Addeddoc/Todo +23−0
Diff omitted because this commit exceeds the static-page render limit.
Addedmainloop.pas +550−0
Diff omitted because this commit exceeds the static-page render limit.