Commit 5fe3cbe

Nick committed on
Initial addition of LCL graphics
commit 5fe3cbe77527bb80506473ffdfa22748fa351cdb parent 396c60e
6 changed files +220−179
ModifiedGBEmu.lpi +7−8
@@ -28,12 +28,15 @@
28 <FormatVersion Value="1"/> 28 <FormatVersion Value="1"/>
29 </local> 29 </local>
30 </RunParams> 30 </RunParams>
31 <RequiredPackages Count="1"> 31 <RequiredPackages Count="2">
32 <Item1> 32 <Item1>
33 <PackageName Value="LCL"/> 33 <PackageName Value="BGRABitmapPack"/>
34 </Item1> 34 </Item1>
35 <Item2>
36 <PackageName Value="LCL"/>
37 </Item2>
35 </RequiredPackages> 38 </RequiredPackages>
36 <Units Count="23"> 39 <Units Count="22">
37 <Unit0> 40 <Unit0>
38 <Filename Value="GBEmu.lpr"/> 41 <Filename Value="GBEmu.lpr"/>
39 <IsPartOfProject Value="True"/> 42 <IsPartOfProject Value="True"/>
@@ -128,10 +131,6 @@
128 <IsPartOfProject Value="True"/> 131 <IsPartOfProject Value="True"/>
129 <HasResources Value="True"/> 132 <HasResources Value="True"/>
130 </Unit21> 133 </Unit21>
131 <Unit22>
132 <Filename Value="Components\AgOpenDialog.pas"/>
133 <IsPartOfProject Value="True"/>
134 </Unit22>
135 </Units> 134 </Units>
136 </ProjectOptions> 135 </ProjectOptions>
137 <CompilerOptions> 136 <CompilerOptions>
@@ -139,7 +138,7 @@
139 <PathDelim Value="\"/> 138 <PathDelim Value="\"/>
140 <SearchPaths> 139 <SearchPaths>
141 <IncludeFiles Value="Debugger;Directx;GPU;CPU;Sound;Global;Components;$(ProjOutDir)"/> 140 <IncludeFiles Value="Debugger;Directx;GPU;CPU;Sound;Global;Components;$(ProjOutDir)"/>
142 <OtherUnitFiles Value="Debugger;Directx;GPU;CPU;Sound;Global;Components"/> 141 <OtherUnitFiles Value="Debugger;Directx;GPU;CPU;Sound;Global"/>
143 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 142 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
144 </SearchPaths> 143 </SearchPaths>
145 <Parsing> 144 <Parsing>
ModifiedGBEmu.lps +117−98
@@ -4,14 +4,14 @@
4 <PathDelim Value="\"/> 4 <PathDelim Value="\"/>
5 <Version Value="10"/> 5 <Version Value="10"/>
6 <BuildModes Active="Default"/> 6 <BuildModes Active="Default"/>
7 <Units Count="30"> 7 <Units Count="32">
8 <Unit0> 8 <Unit0>
9 <Filename Value="GBEmu.lpr"/> 9 <Filename Value="GBEmu.lpr"/>
10 <IsPartOfProject Value="True"/> 10 <IsPartOfProject Value="True"/>
11 <EditorIndex Value="-1"/> 11 <EditorIndex Value="-1"/>
12 <TopLine Value="2"/> 12 <TopLine Value="2"/>
13 <CursorPos X="14" Y="7"/> 13 <CursorPos X="14" Y="7"/>
14 <UsageCount Value="53"/> 14 <UsageCount Value="56"/>
15 <DefaultSyntaxHighlighter Value="Delphi"/> 15 <DefaultSyntaxHighlighter Value="Delphi"/>
16 </Unit0> 16 </Unit0>
17 <Unit1> 17 <Unit1>
@@ -20,10 +20,13 @@
20 <ComponentName Value="frmGameboy"/> 20 <ComponentName Value="frmGameboy"/>
21 <HasResources Value="True"/> 21 <HasResources Value="True"/>
22 <ResourceBaseClass Value="Form"/> 22 <ResourceBaseClass Value="Form"/>
23 <EditorIndex Value="-1"/> 23 <IsVisibleTab Value="True"/>
24 <TopLine Value="309"/> 24 <EditorIndex Value="1"/>
25 <CursorPos X="40" Y="313"/> 25 <TopLine Value="500"/>
26 <UsageCount Value="53"/> 26 <CursorPos X="3" Y="514"/>
27 <UsageCount Value="56"/>
28 <Loaded Value="True"/>
29 <LoadedDesigner Value="True"/>
27 <DefaultSyntaxHighlighter Value="Delphi"/> 30 <DefaultSyntaxHighlighter Value="Delphi"/>
28 </Unit1> 31 </Unit1>
29 <Unit2> 32 <Unit2>
@@ -32,7 +35,7 @@
32 <EditorIndex Value="-1"/> 35 <EditorIndex Value="-1"/>
33 <TopLine Value="1374"/> 36 <TopLine Value="1374"/>
34 <CursorPos X="22" Y="1374"/> 37 <CursorPos X="22" Y="1374"/>
35 <UsageCount Value="53"/> 38 <UsageCount Value="56"/>
36 <DefaultSyntaxHighlighter Value="Delphi"/> 39 <DefaultSyntaxHighlighter Value="Delphi"/>
37 </Unit2> 40 </Unit2>
38 <Unit3> 41 <Unit3>
@@ -42,7 +45,7 @@
42 <WindowIndex Value="-1"/> 45 <WindowIndex Value="-1"/>
43 <TopLine Value="-1"/> 46 <TopLine Value="-1"/>
44 <CursorPos X="-1" Y="-1"/> 47 <CursorPos X="-1" Y="-1"/>
45 <UsageCount Value="53"/> 48 <UsageCount Value="56"/>
46 <DefaultSyntaxHighlighter Value="Delphi"/> 49 <DefaultSyntaxHighlighter Value="Delphi"/>
47 </Unit3> 50 </Unit3>
48 <Unit4> 51 <Unit4>
@@ -52,25 +55,25 @@
52 <WindowIndex Value="-1"/> 55 <WindowIndex Value="-1"/>
53 <TopLine Value="-1"/> 56 <TopLine Value="-1"/>
54 <CursorPos X="-1" Y="-1"/> 57 <CursorPos X="-1" Y="-1"/>
55 <UsageCount Value="53"/> 58 <UsageCount Value="56"/>
56 <DefaultSyntaxHighlighter Value="Delphi"/> 59 <DefaultSyntaxHighlighter Value="Delphi"/>
57 </Unit4> 60 </Unit4>
58 <Unit5> 61 <Unit5>
59 <Filename Value="Gpu\ddraw_out.pas"/> 62 <Filename Value="Gpu\ddraw_out.pas"/>
60 <IsPartOfProject Value="True"/> 63 <IsPartOfProject Value="True"/>
61 <EditorIndex Value="-1"/> 64 <EditorIndex Value="4"/>
62 <TopLine Value="210"/> 65 <CursorPos X="13" Y="21"/>
63 <CursorPos X="7" Y="227"/> 66 <UsageCount Value="56"/>
64 <UsageCount Value="53"/> 67 <Loaded Value="True"/>
65 <DefaultSyntaxHighlighter Value="Delphi"/> 68 <DefaultSyntaxHighlighter Value="Delphi"/>
66 </Unit5> 69 </Unit5>
67 <Unit6> 70 <Unit6>
68 <Filename Value="Gpu\dib_out.pas"/> 71 <Filename Value="Gpu\dib_out.pas"/>
69 <IsPartOfProject Value="True"/> 72 <IsPartOfProject Value="True"/>
70 <EditorIndex Value="-1"/> 73 <EditorIndex Value="3"/>
71 <TopLine Value="41"/> 74 <CursorPos X="14" Y="13"/>
72 <CursorPos X="8" Y="44"/> 75 <UsageCount Value="56"/>
73 <UsageCount Value="53"/> 76 <Loaded Value="True"/>
74 <DefaultSyntaxHighlighter Value="Delphi"/> 77 <DefaultSyntaxHighlighter Value="Delphi"/>
75 </Unit6> 78 </Unit6>
76 <Unit7> 79 <Unit7>
@@ -79,7 +82,7 @@
79 <EditorIndex Value="-1"/> 82 <EditorIndex Value="-1"/>
80 <TopLine Value="332"/> 83 <TopLine Value="332"/>
81 <CursorPos Y="332"/> 84 <CursorPos Y="332"/>
82 <UsageCount Value="53"/> 85 <UsageCount Value="56"/>
83 <DefaultSyntaxHighlighter Value="Delphi"/> 86 <DefaultSyntaxHighlighter Value="Delphi"/>
84 </Unit7> 87 </Unit7>
85 <Unit8> 88 <Unit8>
@@ -88,7 +91,7 @@
88 <EditorIndex Value="-1"/> 91 <EditorIndex Value="-1"/>
89 <TopLine Value="284"/> 92 <TopLine Value="284"/>
90 <CursorPos X="10" Y="297"/> 93 <CursorPos X="10" Y="297"/>
91 <UsageCount Value="53"/> 94 <UsageCount Value="56"/>
92 <DefaultSyntaxHighlighter Value="Delphi"/> 95 <DefaultSyntaxHighlighter Value="Delphi"/>
93 </Unit8> 96 </Unit8>
94 <Unit9> 97 <Unit9>
@@ -98,25 +101,25 @@
98 <EditorIndex Value="-1"/> 101 <EditorIndex Value="-1"/>
99 <TopLine Value="7"/> 102 <TopLine Value="7"/>
100 <CursorPos X="15" Y="17"/> 103 <CursorPos X="15" Y="17"/>
101 <UsageCount Value="53"/> 104 <UsageCount Value="56"/>
102 <DefaultSyntaxHighlighter Value="Delphi"/> 105 <DefaultSyntaxHighlighter Value="Delphi"/>
103 </Unit9> 106 </Unit9>
104 <Unit10> 107 <Unit10>
105 <Filename Value="Sound\sound.pas"/> 108 <Filename Value="Sound\sound.pas"/>
106 <IsPartOfProject Value="True"/> 109 <IsPartOfProject Value="True"/>
107 <IsVisibleTab Value="True"/> 110 <TopLine Value="19"/>
108 <CursorPos Y="9"/> 111 <CursorPos X="32" Y="22"/>
109 <UsageCount Value="53"/> 112 <UsageCount Value="56"/>
110 <Loaded Value="True"/> 113 <Loaded Value="True"/>
111 <DefaultSyntaxHighlighter Value="Delphi"/> 114 <DefaultSyntaxHighlighter Value="Delphi"/>
112 </Unit10> 115 </Unit10>
113 <Unit11> 116 <Unit11>
114 <Filename Value="Global\vars.pas"/> 117 <Filename Value="Global\vars.pas"/>
115 <IsPartOfProject Value="True"/> 118 <IsPartOfProject Value="True"/>
116 <EditorIndex Value="1"/> 119 <EditorIndex Value="7"/>
117 <TopLine Value="74"/> 120 <TopLine Value="74"/>
118 <CursorPos X="3" Y="98"/> 121 <CursorPos X="3" Y="98"/>
119 <UsageCount Value="53"/> 122 <UsageCount Value="56"/>
120 <Loaded Value="True"/> 123 <Loaded Value="True"/>
121 <DefaultSyntaxHighlighter Value="Delphi"/> 124 <DefaultSyntaxHighlighter Value="Delphi"/>
122 </Unit11> 125 </Unit11>
@@ -124,9 +127,9 @@
124 <Filename Value="mainloop.pas"/> 127 <Filename Value="mainloop.pas"/>
125 <IsPartOfProject Value="True"/> 128 <IsPartOfProject Value="True"/>
126 <EditorIndex Value="2"/> 129 <EditorIndex Value="2"/>
127 <TopLine Value="311"/> 130 <TopLine Value="12"/>
128 <CursorPos X="22" Y="320"/> 131 <CursorPos X="34" Y="31"/>
129 <UsageCount Value="53"/> 132 <UsageCount Value="56"/>
130 <Loaded Value="True"/> 133 <Loaded Value="True"/>
131 <DefaultSyntaxHighlighter Value="Delphi"/> 134 <DefaultSyntaxHighlighter Value="Delphi"/>
132 </Unit12> 135 </Unit12>
@@ -136,56 +139,56 @@
136 <HasResources Value="True"/> 139 <HasResources Value="True"/>
137 <EditorIndex Value="-1"/> 140 <EditorIndex Value="-1"/>
138 <CursorPos Y="21"/> 141 <CursorPos Y="21"/>
139 <UsageCount Value="53"/> 142 <UsageCount Value="56"/>
140 <DefaultSyntaxHighlighter Value="Delphi"/> 143 <DefaultSyntaxHighlighter Value="Delphi"/>
141 </Unit13> 144 </Unit13>
142 <Unit14> 145 <Unit14>
143 <Filename Value="DirectX\Direct3DRM.pas"/> 146 <Filename Value="DirectX\Direct3DRM.pas"/>
144 <IsPartOfProject Value="True"/> 147 <IsPartOfProject Value="True"/>
145 <EditorIndex Value="-1"/> 148 <EditorIndex Value="-1"/>
146 <UsageCount Value="53"/> 149 <UsageCount Value="56"/>
147 <DefaultSyntaxHighlighter Value="Delphi"/> 150 <DefaultSyntaxHighlighter Value="Delphi"/>
148 </Unit14> 151 </Unit14>
149 <Unit15> 152 <Unit15>
150 <Filename Value="DirectX\DirectInput.pas"/> 153 <Filename Value="DirectX\DirectInput.pas"/>
151 <IsPartOfProject Value="True"/> 154 <IsPartOfProject Value="True"/>
152 <EditorIndex Value="-1"/> 155 <EditorIndex Value="-1"/>
153 <UsageCount Value="53"/> 156 <UsageCount Value="56"/>
154 <DefaultSyntaxHighlighter Value="Delphi"/> 157 <DefaultSyntaxHighlighter Value="Delphi"/>
155 </Unit15> 158 </Unit15>
156 <Unit16> 159 <Unit16>
157 <Filename Value="DirectX\DirectMusic.pas"/> 160 <Filename Value="DirectX\DirectMusic.pas"/>
158 <IsPartOfProject Value="True"/> 161 <IsPartOfProject Value="True"/>
159 <EditorIndex Value="-1"/> 162 <EditorIndex Value="-1"/>
160 <UsageCount Value="53"/> 163 <UsageCount Value="56"/>
161 <DefaultSyntaxHighlighter Value="Delphi"/> 164 <DefaultSyntaxHighlighter Value="Delphi"/>
162 </Unit16> 165 </Unit16>
163 <Unit17> 166 <Unit17>
164 <Filename Value="DirectX\DirectPlay.pas"/> 167 <Filename Value="DirectX\DirectPlay.pas"/>
165 <IsPartOfProject Value="True"/> 168 <IsPartOfProject Value="True"/>
166 <EditorIndex Value="-1"/> 169 <EditorIndex Value="-1"/>
167 <UsageCount Value="53"/> 170 <UsageCount Value="56"/>
168 <DefaultSyntaxHighlighter Value="Delphi"/> 171 <DefaultSyntaxHighlighter Value="Delphi"/>
169 </Unit17> 172 </Unit17>
170 <Unit18> 173 <Unit18>
171 <Filename Value="DirectX\DirectSetup.pas"/> 174 <Filename Value="DirectX\DirectSetup.pas"/>
172 <IsPartOfProject Value="True"/> 175 <IsPartOfProject Value="True"/>
173 <EditorIndex Value="-1"/> 176 <EditorIndex Value="-1"/>
174 <UsageCount Value="53"/> 177 <UsageCount Value="56"/>
175 <DefaultSyntaxHighlighter Value="Delphi"/> 178 <DefaultSyntaxHighlighter Value="Delphi"/>
176 </Unit18> 179 </Unit18>
177 <Unit19> 180 <Unit19>
178 <Filename Value="DirectX\DirectSound.pas"/> 181 <Filename Value="DirectX\DirectSound.pas"/>
179 <IsPartOfProject Value="True"/> 182 <IsPartOfProject Value="True"/>
180 <EditorIndex Value="-1"/> 183 <EditorIndex Value="-1"/>
181 <UsageCount Value="53"/> 184 <UsageCount Value="56"/>
182 <DefaultSyntaxHighlighter Value="Delphi"/> 185 <DefaultSyntaxHighlighter Value="Delphi"/>
183 </Unit19> 186 </Unit19>
184 <Unit20> 187 <Unit20>
185 <Filename Value="DirectX\Direct3D.pas"/> 188 <Filename Value="DirectX\Direct3D.pas"/>
186 <IsPartOfProject Value="True"/> 189 <IsPartOfProject Value="True"/>
187 <EditorIndex Value="-1"/> 190 <EditorIndex Value="-1"/>
188 <UsageCount Value="53"/> 191 <UsageCount Value="56"/>
189 <DefaultSyntaxHighlighter Value="Delphi"/> 192 <DefaultSyntaxHighlighter Value="Delphi"/>
190 </Unit20> 193 </Unit20>
191 <Unit21> 194 <Unit21>
@@ -195,12 +198,11 @@
195 <EditorIndex Value="-1"/> 198 <EditorIndex Value="-1"/>
196 <TopLine Value="372"/> 199 <TopLine Value="372"/>
197 <CursorPos X="33" Y="405"/> 200 <CursorPos X="33" Y="405"/>
198 <UsageCount Value="53"/> 201 <UsageCount Value="56"/>
199 <DefaultSyntaxHighlighter Value="Delphi"/> 202 <DefaultSyntaxHighlighter Value="Delphi"/>
200 </Unit21> 203 </Unit21>
201 <Unit22> 204 <Unit22>
202 <Filename Value="Components\AgOpenDialog.pas"/> 205 <Filename Value="Components\AgOpenDialog.pas"/>
203 <IsPartOfProject Value="True"/>
204 <EditorIndex Value="-1"/> 206 <EditorIndex Value="-1"/>
205 <TopLine Value="154"/> 207 <TopLine Value="154"/>
206 <CursorPos X="21" Y="182"/> 208 <CursorPos X="21" Y="182"/>
@@ -260,127 +262,144 @@
260 <CursorPos X="10" Y="745"/> 262 <CursorPos X="10" Y="745"/>
261 <UsageCount Value="7"/> 263 <UsageCount Value="7"/>
262 </Unit29> 264 </Unit29>
265 <Unit30>
266 <Filename Value="Gpu\lcl_out.pas"/>
267 <EditorIndex Value="5"/>
268 <CursorPos X="4" Y="19"/>
269 <UsageCount Value="11"/>
270 <Loaded Value="True"/>
271 <DefaultSyntaxHighlighter Value="Delphi"/>
272 </Unit30>
273 <Unit31>
274 <Filename Value="..\..\bgracontrols-5.0\bgracontrols-5.0\bcbutton.pas"/>
275 <UnitName Value="BCButton"/>
276 <EditorIndex Value="6"/>
277 <TopLine Value="713"/>
278 <CursorPos X="34" Y="728"/>
279 <UsageCount Value="11"/>
280 <Loaded Value="True"/>
281 </Unit31>
263 </Units> 282 </Units>
264 <JumpHistory Count="30" HistoryIndex="29"> 283 <JumpHistory Count="30" HistoryIndex="29">
265 <Position1> 284 <Position1>
266 <Filename Value="Sound\sound.pas"/> 285 <Filename Value="Gpu\lcl_out.pas"/>
267 <Caret Line="247" Column="15" TopLine="223"/> 286 <Caret Line="36" Column="12" TopLine="21"/>
268 </Position1> 287 </Position1>
269 <Position2> 288 <Position2>
270 <Filename Value="Sound\sound.pas"/> 289 <Filename Value="Gpu\lcl_out.pas"/>
271 <Caret Line="153" Column="7" TopLine="135"/> 290 <Caret Line="46" Column="38" TopLine="21"/>
272 </Position2> 291 </Position2>
273 <Position3> 292 <Position3>
274 <Filename Value="Sound\sound.pas"/> 293 <Filename Value="Gpu\lcl_out.pas"/>
275 <Caret Line="159" Column="5" TopLine="141"/> 294 <Caret Line="45" Column="28" TopLine="21"/>
276 </Position3> 295 </Position3>
277 <Position4> 296 <Position4>
278 <Filename Value="Sound\sound.pas"/> 297 <Filename Value="UnitMain.pas"/>
279 <Caret Line="267" TopLine="258"/> 298 <Caret Line="408" Column="5" TopLine="390"/>
280 </Position4> 299 </Position4>
281 <Position5> 300 <Position5>
282 <Filename Value="Sound\sound.pas"/> 301 <Filename Value="UnitMain.pas"/>
283 <Caret Line="274" Column="50" TopLine="257"/> 302 <Caret Line="214" Column="40" TopLine="199"/>
284 </Position5> 303 </Position5>
285 <Position6> 304 <Position6>
286 <Filename Value="Sound\sound.pas"/> 305 <Filename Value="UnitMain.pas"/>
287 <Caret Line="169" Column="31" TopLine="152"/> 306 <Caret Line="227" TopLine="218"/>
288 </Position6> 307 </Position6>
289 <Position7> 308 <Position7>
290 <Filename Value="Sound\sound.pas"/> 309 <Filename Value="UnitMain.pas"/>
291 <Caret Line="226" Column="3" TopLine="210"/> 310 <Caret Line="143" Column="24" TopLine="132"/>
292 </Position7> 311 </Position7>
293 <Position8> 312 <Position8>
294 <Filename Value="Sound\sound.pas"/> 313 <Filename Value="UnitMain.pas"/>
295 <Caret Line="270" Column="7" TopLine="252"/> 314 <Caret Line="210" Column="25" TopLine="188"/>
296 </Position8> 315 </Position8>
297 <Position9> 316 <Position9>
298 <Filename Value="Sound\sound.pas"/> 317 <Filename Value="UnitMain.pas"/>
299 <Caret Line="316" Column="5" TopLine="299"/> 318 <Caret Line="212" Column="40" TopLine="188"/>
300 </Position9> 319 </Position9>
301 <Position10> 320 <Position10>
302 <Filename Value="Sound\sound.pas"/> 321 <Filename Value="UnitMain.pas"/>
303 <Caret Line="545" Column="21" TopLine="529"/> 322 <Caret Line="252" Column="9" TopLine="246"/>
304 </Position10> 323 </Position10>
305 <Position11> 324 <Position11>
306 <Filename Value="Sound\sound.pas"/> 325 <Filename Value="UnitMain.pas"/>
307 <Caret Line="568" Column="21" TopLine="551"/> 326 <Caret Line="394" Column="51" TopLine="384"/>
308 </Position11> 327 </Position11>
309 <Position12> 328 <Position12>
310 <Filename Value="Sound\sound.pas"/> 329 <Filename Value="Gpu\lcl_out.pas"/>
311 <Caret Line="545" Column="21" TopLine="528"/> 330 <Caret Line="10" Column="47"/>
312 </Position12> 331 </Position12>
313 <Position13> 332 <Position13>
314 <Filename Value="Sound\sound.pas"/> 333 <Filename Value="UnitMain.pas"/>
315 <Caret Line="568" Column="21" TopLine="551"/> 334 <Caret Line="206" TopLine="191"/>
316 </Position13> 335 </Position13>
317 <Position14> 336 <Position14>
318 <Filename Value="Sound\sound.pas"/> 337 <Filename Value="UnitMain.pas"/>
319 <Caret Line="545" Column="21" TopLine="528"/> 338 <Caret Line="389" Column="15" TopLine="362"/>
320 </Position14> 339 </Position14>
321 <Position15> 340 <Position15>
322 <Filename Value="Sound\sound.pas"/> 341 <Filename Value="UnitMain.pas"/>
323 <Caret Line="647" Column="12" TopLine="622"/> 342 <Caret Line="505" Column="20" TopLine="478"/>
324 </Position15> 343 </Position15>
325 <Position16> 344 <Position16>
326 <Filename Value="Sound\sound.pas"/> 345 <Filename Value="mainloop.pas"/>
327 <Caret Line="309" Column="11" TopLine="283"/> 346 <Caret Line="31" Column="34" TopLine="12"/>
328 </Position16> 347 </Position16>
329 <Position17> 348 <Position17>
330 <Filename Value="Sound\sound.pas"/> 349 <Filename Value="UnitMain.pas"/>
331 <Caret Line="314" Column="8" TopLine="283"/> 350 <Caret Line="18" Column="3" TopLine="5"/>
332 </Position17> 351 </Position17>
333 <Position18> 352 <Position18>
334 <Filename Value="Sound\sound.pas"/> 353 <Filename Value="Gpu\ddraw_out.pas"/>
335 <Caret Line="315" Column="7" TopLine="283"/> 354 <Caret Line="221" Column="23" TopLine="210"/>
336 </Position18> 355 </Position18>
337 <Position19> 356 <Position19>
338 <Filename Value="Sound\sound.pas"/> 357 <Filename Value="Gpu\ddraw_out.pas"/>
339 <Caret Line="271" Column="9" TopLine="267"/> 358 <Caret Line="21" Column="13"/>
340 </Position19> 359 </Position19>
341 <Position20> 360 <Position20>
342 <Filename Value="Sound\sound.pas"/> 361 <Filename Value="UnitMain.pas"/>
343 <Caret Line="286" Column="24" TopLine="269"/> 362 <Caret Line="190" Column="38" TopLine="174"/>
344 </Position20> 363 </Position20>
345 <Position21> 364 <Position21>
346 <Filename Value="Sound\sound.pas"/> 365 <Filename Value="UnitMain.pas"/>
347 <Caret Line="289" Column="44" TopLine="272"/> 366 <Caret Line="384" Column="3" TopLine="367"/>
348 </Position21> 367 </Position21>
349 <Position22> 368 <Position22>
350 <Filename Value="Sound\sound.pas"/> 369 <Filename Value="UnitMain.pas"/>
351 <Caret Line="290" Column="47" TopLine="273"/> 370 <Caret Line="476" Column="7" TopLine="460"/>
352 </Position22> 371 </Position22>
353 <Position23> 372 <Position23>
354 <Filename Value="Sound\sound.pas"/> 373 <Filename Value="UnitMain.pas"/>
355 <Caret Line="249" Column="17" TopLine="232"/> 374 <Caret Line="483" Column="7" TopLine="467"/>
356 </Position23> 375 </Position23>
357 <Position24> 376 <Position24>
358 <Filename Value="Sound\sound.pas"/> 377 <Filename Value="UnitMain.pas"/>
359 <Caret Line="291" Column="11" TopLine="278"/> 378 <Caret Line="18" Column="3" TopLine="2"/>
360 </Position24> 379 </Position24>
361 <Position25> 380 <Position25>
362 <Filename Value="Sound\sound.pas"/> 381 <Filename Value="UnitMain.pas"/>
363 <Caret Line="70" Column="13" TopLine="55"/> 382 <Caret Line="190" Column="5" TopLine="175"/>
364 </Position25> 383 </Position25>
365 <Position26> 384 <Position26>
366 <Filename Value="Sound\sound.pas"/> 385 <Filename Value="UnitMain.pas"/>
367 <Caret Line="629" Column="13" TopLine="599"/> 386 <Caret Line="383" Column="5" TopLine="367"/>
368 </Position26> 387 </Position26>
369 <Position27> 388 <Position27>
370 <Filename Value="Sound\sound.pas"/> 389 <Filename Value="UnitMain.pas"/>
371 <Caret Line="352" Column="43" TopLine="332"/> 390 <Caret Line="476" Column="7" TopLine="460"/>
372 </Position27> 391 </Position27>
373 <Position28> 392 <Position28>
374 <Filename Value="Sound\sound.pas"/> 393 <Filename Value="UnitMain.pas"/>
375 <Caret Line="348" Column="47" TopLine="338"/> 394 <Caret Line="483" Column="7" TopLine="467"/>
376 </Position28> 395 </Position28>
377 <Position29> 396 <Position29>
378 <Filename Value="Sound\sound.pas"/> 397 <Filename Value="UnitMain.pas"/>
379 <Caret Line="349" Column="37" TopLine="326"/> 398 <Caret Line="516" Column="5" TopLine="498"/>
380 </Position29> 399 </Position29>
381 <Position30> 400 <Position30>
382 <Filename Value="Sound\sound.pas"/> 401 <Filename Value="UnitMain.pas"/>
383 <Caret Line="10" Column="12"/> 402 <Caret Line="515" Column="5" TopLine="499"/>
384 </Position30> 403 </Position30>
385 </JumpHistory> 404 </JumpHistory>
386 </ProjectSession> 405 </ProjectSession>
AddedGpu/lcl_out.pas +57−0
@@ -0,0 +1,57 @@
1 unit lcl_out;
2
3 {$mode delphi}
4
5 interface
6
7 uses
8 Graphics, BGRABitmap;
9
10 procedure UpdateCanvas(Width, Height: Integer; Canvas: TCanvas);
11
12 implementation
13
14 uses
15 BGRABitmapTypes,
16 vars, ddraw_out,
17 classes;
18
19 var
20 bmp: TBGRABitmap;
21
22 //TODO: Screen tearing issues-- probably double buffer related
23 procedure UpdateCanvas(Width, Height: Integer; Canvas: TCanvas);
24 var
25 stretched: TBGRABitmap;
26 X, Y: Integer;
27 N: Integer;
28 p: PBGRAPixel;
29 Idx: Integer;
30 begin
31 if skip_asm then
32 exit;
33
34 p := bmp.Data;
35
36 for Y := 144-1 downto 0 do
37 for X := 0 to 160-1 do
38 begin
39 Idx := ((Y*160)+X)*4;
40 p^.red := dx_buffer[Idx + 0];
41 p^.blue := dx_buffer[Idx + 1];
42 p^.green := dx_buffer[idx + 2];
43 inc(p);
44 end;
45 bmp.InvalidateBitmap;
46
47 //bmp.Draw(Canvas, 0, 0);
48 Canvas.StretchDraw(Rect(0, 0, Width, Height), bmp.Bitmap);
49 //stretched := bmp.Resample(Canvas.Width, Canvas.Height, rmSimpleStretch) as TBGRABitmap;
50 //stretched.Draw(Canvas,0,0);
51 //stretched.Free;
52 end;
53
54 begin
55 bmp := TBGRABitmap.Create(160, 144);
56 end.
57
ModifiedUnitMain.lfm +13−7
@@ -1,12 +1,12 @@
1 object frmGameboy: TfrmGameboy 1 object frmGameboy: TfrmGameboy
2 Left = 2719 2 Left = 2633
3 Height = 354 3 Height = 354
4 Top = 151 4 Top = 313
5 Width = 318 5 Width = 318
6 Caption = 'Gameboy' 6 Caption = 'Gameboy'
7 ClientHeight = 320 7 ClientHeight = 320
8 ClientWidth = 318 8 ClientWidth = 318
9 Color = clBlack 9 Color = clYellow
10 DefaultMonitor = dmMainForm 10 DefaultMonitor = dmMainForm
11 DesignTimePPI = 168 11 DesignTimePPI = 168
12 Font.CharSet = ANSI_CHARSET 12 Font.CharSet = ANSI_CHARSET
@@ -44,9 +44,16 @@ object frmGameboy: TfrmGameboy
44 ParentColor = False 44 ParentColor = False
45 SimplePanel = False 45 SimplePanel = False
46 end 46 end
47 object PaintBox1: TPaintBox
48 Left = 0
49 Height = 277
50 Top = 0
51 Width = 318
52 Align = alClient
53 OnPaint = PaintBox1Paint
54 end
47 object MainMenu: TMainMenu 55 object MainMenu: TMainMenu
48 left = 40 56 left = 56
49 top = 8
50 object File1: TMenuItem 57 object File1: TMenuItem
51 Caption = '&File' 58 Caption = '&File'
52 object Load1: TMenuItem 59 object Load1: TMenuItem
@@ -396,7 +403,6 @@ object frmGameboy: TfrmGameboy
396 Enabled = False 403 Enabled = False
397 Interval = 17 404 Interval = 17
398 OnTimer = TimerTimer 405 OnTimer = TimerTimer
399 left = 40 406 left = 112
400 top = 40
401 end 407 end
402 end 408 end
ModifiedUnitMain.pas +14−60
@@ -15,11 +15,14 @@ interface
15 15
16 uses 16 uses
17 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 17 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
18 ddraw_out, dib_out, DirectDraw, vars, z80cpu, 18 ddraw_out, dib_out, lcl_out, DirectDraw, vars, z80cpu,
19 gfx, mainloop, machine, debugger, sound, 19 gfx, mainloop, machine, debugger, sound,
20 StdCtrls, ExtCtrls, ComCtrls, Menus; 20 StdCtrls, ExtCtrls, ComCtrls, Menus;
21 21
22 type 22 type
23
24 { TfrmGameboy }
25
23 TfrmGameboy = class(TForm) 26 TfrmGameboy = class(TForm)
24 MainMenu: TMainMenu; 27 MainMenu: TMainMenu;
25 File1: TMenuItem; 28 File1: TMenuItem;
@@ -29,6 +32,7 @@ type
29 N4: TMenuItem; 32 N4: TMenuItem;
30 Exit1: TMenuItem; 33 Exit1: TMenuItem;
31 CPU1: TMenuItem; 34 CPU1: TMenuItem;
35 PaintBox1: TPaintBox;
32 Reset2: TMenuItem; 36 Reset2: TMenuItem;
33 Pause1: TMenuItem; 37 Pause1: TMenuItem;
34 N2: TMenuItem; 38 N2: TMenuItem;
@@ -112,6 +116,7 @@ type
112 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState); 116 procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
113 procedure FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState); 117 procedure FormKeyUp(Sender: TObject; var Key: word; Shift: TShiftState);
114 procedure FrameClick(Sender: TObject); 118 procedure FrameClick(Sender: TObject);
119 procedure PaintBox1Paint(Sender: TObject);
115 procedure Pause(Sender: TObject); 120 procedure Pause(Sender: TObject);
116 procedure ResetClick(Sender: TObject); 121 procedure ResetClick(Sender: TObject);
117 procedure setPriority(Sender: TObject); 122 procedure setPriority(Sender: TObject);
@@ -139,8 +144,6 @@ type
139 public 144 public
140 { Public-Deklarationen} 145 { Public-Deklarationen}
141 timervar: byte; 146 timervar: byte;
142 procedure RealSpeedEmulation;
143 procedure _RealSpeedEmulation;
144 end; 147 end;
145 148
146 var 149 var
@@ -220,46 +223,6 @@ begin
220 application.terminate; 223 application.terminate;
221 end; 224 end;
222 225
223 procedure TFrmGameboy.RealSpeedEmulation;
224 var
225 li: Large_Integer;
226 time, curTime: dword;
227 curTimer: DWord;
228 begin
229 if AutoWait.Checked then
230 begin
231 if lastTime = 0 then
232 begin
233 QueryPerformanceCounter(li.quadpart);
234 lastTime := li.LowPart;
235 end;
236 QueryPerformanceCounter(li.quadpart);
237 curTime := li.LowPart;
238 time := curTime - lastTime;
239 if time < perfFreq then
240 begin
241 while time < perfFreq do
242 begin
243 Sleep(10);
244 QueryPerformanceCounter(li.quadpart);
245 curTime := li.LowPart;
246 time := curTime - lastTime;
247 end;
248 Inc(lastTime, perfFreq);
249 end
250 else
251 lastTime := curTime;
252 end;
253 end;
254
255 procedure TFrmGameboy._RealSpeedEmulation;
256 begin
257 if AutoWait.Checked then
258 while timervar = 0 do
259 application.ProcessMessages;
260 timervar := 0;
261 end;
262
263 const 226 const
264 CyclesPerFrame : Integer = 70224; 227 CyclesPerFrame : Integer = 70224;
265 TimePerFrame: Double = 1.0 / 60.0; 228 TimePerFrame: Double = 1.0 / 60.0;
@@ -295,7 +258,7 @@ begin
295 application.ProcessMessages; 258 application.ProcessMessages;
296 259
297 while (cycles < CyclesPerFrame) do 260 while (cycles < CyclesPerFrame) do
298 cycles += z80_decode; 261 cycles += z80_decode;
299 262
300 cycles -= CyclesPerFrame; 263 cycles -= CyclesPerFrame;
301 264
@@ -309,14 +272,6 @@ begin
309 end; 272 end;
310 273
311 frameStart := frameEnd; 274 frameStart := frameEnd;
312
313 //if screen_updated > 0 then // onpaint :)
314 //begin
315 // screen_updated := 0;
316 // if i = 0 then
317 // RealSpeedEmulation;
318 // i := (i + 1) mod 31;
319 //end;
320 until application.Terminated; 275 until application.Terminated;
321 end; 276 end;
322 277
@@ -372,6 +327,9 @@ begin
372 f_stopped := True; 327 f_stopped := True;
373 gb_speed := 1; 328 gb_speed := 1;
374 setzewindow(handle); 329 setzewindow(handle);
330
331 frmGameboy.DoubleBuffered := True;
332 SetPaintBox(PaintBox1);
375 postmessage(handle, wm_user, 0, 0); 333 postmessage(handle, wm_user, 0, 0);
376 end; 334 end;
377 335
@@ -424,11 +382,11 @@ begin
424 382
425 frameskip := tmenuitem(Sender).tag + 1; 383 frameskip := tmenuitem(Sender).tag + 1;
426 tmenuitem(Sender).Checked := True; 384 tmenuitem(Sender).Checked := True;
385 end;
427 386
428 if not isddraw then 387 procedure TfrmGameboy.PaintBox1Paint(Sender: TObject);
429 UpdateDIB(Window) 388 begin
430 else 389 UpdateCanvas(PaintBox1.Width, PaintBox1.Height, PaintBox1.Canvas);
431 UpdateDDraw(window);
432 end; 390 end;
433 391
434 procedure TfrmGameboy.Pause(Sender: TObject); 392 procedure TfrmGameboy.Pause(Sender: TObject);
@@ -555,10 +513,6 @@ begin
555 exit; 513 exit;
556 oldskip := frameskip; 514 oldskip := frameskip;
557 frameskip := 1; 515 frameskip := 1;
558 if not isddraw then
559 UpdateDIB(Handle)
560 else
561 UpdateDDraw(Handle);
562 frameskip := oldskip; 516 frameskip := oldskip;
563 statusbar.Panels[0].Text := IntToStr(Height) + ':' + IntToStr(Width); 517 statusbar.Panels[0].Text := IntToStr(Height) + ':' + IntToStr(Width);
564 end; 518 end;
Modifiedmainloop.pas +12−6
@@ -13,28 +13,33 @@ unit mainloop;
13 13
14 interface 14 interface
15 15
16 uses Windows; 16 uses Windows, ExtCtrls;
17 17
18 function main_loop(a: DWord): DWORD; 18 function main_loop(a: DWord): DWORD;
19 procedure setzewindow(h_wnd: HWND); 19 procedure setzewindow(h_wnd: HWND);
20 procedure SetPaintBox(pb: TPaintBox);
20 21
21 function z80_decode: byte; pascal; 22 function z80_decode: byte; pascal;
22 procedure z80_reset; 23 procedure z80_reset;
23 24
24 var 25 var
25 window: Hwnd; // is the DirectDraw window 26 window: Hwnd; // is the DirectDraw window
27 PaintBox: TPaintBox;
26 28
27 implementation 29 implementation
28 30
29 uses vars, gfx, machine, z80cpu, 31 uses vars, gfx, machine, z80cpu, sound;
30 ddraw_out, dib_out,
31 sound;
32 32
33 procedure setzewindow(h_wnd: HWND); 33 procedure setzewindow(h_wnd: HWND);
34 begin 34 begin
35 window := h_wnd; 35 window := h_wnd;
36 end; 36 end;
37 37
38 procedure SetPaintBox(pb: TPaintBox);
39 begin
40 PaintBox := pb;
41 end;
42
38 procedure TimerControl; 43 procedure TimerControl;
39 (* 44 (*
40 45
@@ -222,10 +227,11 @@ begin
222 begin 227 begin
223 make_line_finish(143); 228 make_line_finish(143);
224 if (m_iram[$ff40] and 128) > 0 then 229 if (m_iram[$ff40] and 128) > 0 then
225 if not isddraw then 230 PaintBox.Invalidate;
231 (*if not isddraw then
226 UpdateDIB(Window) 232 UpdateDIB(Window)
227 else 233 else
228 UpdateDDraw(window); 234 UpdateDDraw(window);*)
229 vbi_count := vbi_latency; 235 vbi_count := vbi_latency;
230 end; 236 end;
231 make_line_count := -1; 237 make_line_count := -1;