Commit 5d6eae8

Nick committed on
64 bit CPU seems to be pretty much working
commit 5d6eae812b7f3678167f27079b7cd3037b9d34d5 parent e3fc1b5
2 changed files +106−42
ModifiedCpu/z80cpu.pas +39−37
@@ -527,7 +527,7 @@ begin
527 //LEA ESP,[ESP+4] 527 //LEA ESP,[ESP+4]
528 //INC word ptr [rip+pc.w] 528 //INC word ptr [rip+pc.w]
529 MOV AH, 0 529 MOV AH, 0
530 MOV AL, b1 530 MOV AL, [rip+b1]
531 TEST [rip+af.l],64 531 TEST [rip+af.l],64
532 MOV [rip+cycle],8 532 MOV [rip+cycle],8
533 JNZ @ende 533 JNZ @ende
@@ -670,7 +670,7 @@ begin
670 //LEA ESP,[ESP+4] 670 //LEA ESP,[ESP+4]
671 //INC word ptr [rip+pc.w] 671 //INC word ptr [rip+pc.w]
672 MOV AH, 0 672 MOV AH, 0
673 MOV AL, b1 673 MOV AL, [rip+b1]
674 TEST [rip+af.l],64 674 TEST [rip+af.l],64
675 MOV [rip+cycle],8 675 MOV [rip+cycle],8
676 JZ @ende 676 JZ @ende
@@ -799,7 +799,7 @@ begin
799 //LEA ESP,[ESP+4] 799 //LEA ESP,[ESP+4]
800 //INC word ptr [rip+pc.w] 800 //INC word ptr [rip+pc.w]
801 MOV AH, 0 801 MOV AH, 0
802 MOV AL, b1 802 MOV AL, [rip+b1]
803 TEST [rip+af.l],1 803 TEST [rip+af.l],1
804 MOV [rip+cycle],8 804 MOV [rip+cycle],8
805 JNZ @ende 805 JNZ @ende
@@ -887,7 +887,7 @@ begin
887 //CALL SpokeB 887 //CALL SpokeB
888 //LEA ESP,[ESP+8] 888 //LEA ESP,[ESP+8]
889 MOV [rip+w1], BX 889 MOV [rip+w1], BX
890 MOV w2, AX 890 MOV [rip+w2], AX
891 end; 891 end;
892 spokeb(w1, w2); 892 spokeb(w1, w2);
893 893
@@ -916,7 +916,7 @@ begin
916 //CALL SpokeB 916 //CALL SpokeB
917 //LEA ESP,[ESP+8] 917 //LEA ESP,[ESP+8]
918 MOV [rip+w1], BX 918 MOV [rip+w1], BX
919 MOV w2, AX 919 MOV [rip+w2], AX
920 end; 920 end;
921 spokeb(w1, w2); 921 spokeb(w1, w2);
922 922
@@ -2522,38 +2522,40 @@ end;
2522 function RET_NZ: byte; 2522 function RET_NZ: byte;
2523 2523
2524 begin 2524 begin
2525 if (af.l and 64) = 1 then Exit(8); 2525 if (af.l and 64) <> 0 then
2526 2526 cycle := 8
2527 i1 := speekb(sp_.w); 2527 else begin
2528 Inc(sp_.w); 2528 i1 := speekb(sp_.w);
2529 i2 := speekb(sp_.w); 2529 Inc(sp_.w);
2530 Inc(sp_.w); 2530 i2 := speekb(sp_.w);
2531 2531 Inc(sp_.w);
2532 asm
2533 //TEST [rip+af.l],64
2534 //MOV [rip+cycle],8
2535 //JNZ @ende
2536 //PUSH dword ptr [rip+sp_.w]
2537 //CALL speekb
2538 //LEA ESP,[ESP+4]
2539 //
2540 //INC word ptr [rip+sp_.w]
2541 //PUSH EAX
2542 //PUSH dword ptr [rip+sp_.w]
2543 //CALL speekb
2544 //LEA ESP,[ESP+4]
2545 //INC word ptr [rip+sp_.w]
2546 MOV EAX,i2
2547
2548 SHL EAX,8
2549
2550 //POP EBX
2551 MOV EBX,[rip+i1]
2552 2532
2553 MOV AL,BL 2533 asm
2554 MOV [rip+pc.w],AX 2534 //TEST [rip+af.l],64
2555 MOV [rip+cycle],20 2535 //MOV [rip+cycle],8
2556 @ende: 2536 //JNZ @ende
2537 //PUSH dword ptr [rip+sp_.w]
2538 //CALL speekb
2539 //LEA ESP,[ESP+4]
2540 //
2541 //INC word ptr [rip+sp_.w]
2542 //PUSH EAX
2543 //PUSH dword ptr [rip+sp_.w]
2544 //CALL speekb
2545 //LEA ESP,[ESP+4]
2546 //INC word ptr [rip+sp_.w]
2547 MOV EAX,[rip+i2]
2548
2549 SHL EAX,8
2550
2551 //POP EBX
2552 MOV EBX,[rip+i1]
2553
2554 MOV AL,BL
2555 MOV [rip+pc.w],AX
2556 MOV [rip+cycle],20
2557 //@ende:
2558 end;
2557 end; 2559 end;
2558 2560
2559 Result := cycle; 2561 Result := cycle;
@@ -3102,7 +3104,7 @@ begin
3102 //CALL speekb 3104 //CALL speekb
3103 //LEA ESP,[ESP+4] 3105 //LEA ESP,[ESP+4]
3104 //INC word ptr [rip+pc.w] 3106 //INC word ptr [rip+pc.w]
3105 MOV EAX,i2 3107 MOV EAX,[rip+i2]
3106 3108
3107 SHL EAX,8 3109 SHL EAX,8
3108 3110
ModifiedGBEmu.lpi +67−5
@@ -17,9 +17,9 @@
17 </XPManifest> 17 </XPManifest>
18 <Icon Value="0"/> 18 <Icon Value="0"/>
19 </General> 19 </General>
20 <BuildModes Count="3"> 20 <BuildModes Count="4">
21 <Item1 Name="Development" Default="True"/> 21 <Item1 Name="Development" Default="True"/>
22 <Item2 Name="Production"> 22 <Item2 Name="Production Windows">
23 <CompilerOptions> 23 <CompilerOptions>
24 <Version Value="11"/> 24 <Version Value="11"/>
25 <PathDelim Value="\"/> 25 <PathDelim Value="\"/>
@@ -40,8 +40,8 @@
40 <CodeGeneration> 40 <CodeGeneration>
41 <SmartLinkUnit Value="True"/> 41 <SmartLinkUnit Value="True"/>
42 <RelocatableUnit Value="True"/> 42 <RelocatableUnit Value="True"/>
43 <TargetCPU Value="i386"/> 43 <TargetCPU Value="x86_64"/>
44 <TargetOS Value="win32"/> 44 <TargetOS Value="win64"/>
45 <Optimizations> 45 <Optimizations>
46 <OptimizationLevel Value="4"/> 46 <OptimizationLevel Value="4"/>
47 </Optimizations> 47 </Optimizations>
@@ -96,7 +96,7 @@
96 </Parsing> 96 </Parsing>
97 <CodeGeneration> 97 <CodeGeneration>
98 <SmartLinkUnit Value="True"/> 98 <SmartLinkUnit Value="True"/>
99 <TargetCPU Value="i386"/> 99 <TargetCPU Value="x86_64"/>
100 <TargetOS Value="linux"/> 100 <TargetOS Value="linux"/>
101 <Optimizations> 101 <Optimizations>
102 <OptimizationLevel Value="4"/> 102 <OptimizationLevel Value="4"/>
@@ -132,6 +132,68 @@
132 </Other> 132 </Other>
133 </CompilerOptions> 133 </CompilerOptions>
134 </Item3> 134 </Item3>
135 <Item4 Name="Production Mac">
136 <MacroValues Count="1">
137 <Macro1 Name="LCLWidgetType" Value="cocoa"/>
138 </MacroValues>
139 <CompilerOptions>
140 <Version Value="11"/>
141 <PathDelim Value="\"/>
142 <Target>
143 <Filename Value="Release\hUGETracker"/>
144 </Target>
145 <SearchPaths>
146 <IncludeFiles Value="Cpu;Sound;Global;$(ProjOutDir)"/>
147 <OtherUnitFiles Value="Cpu;Sound;Global;Pascal-SDL-2-Headers"/>
148 <UnitOutputDirectory Value="lib\Production\$(TargetCPU)-$(TargetOS)"/>
149 </SearchPaths>
150 <Parsing>
151 <SyntaxOptions>
152 <CStyleOperator Value="False"/>
153 <CPPInline Value="False"/>
154 </SyntaxOptions>
155 </Parsing>
156 <CodeGeneration>
157 <SmartLinkUnit Value="True"/>
158 <TargetCPU Value="x86_64"/>
159 <TargetOS Value="darwin"/>
160 <Optimizations>
161 <OptimizationLevel Value="4"/>
162 </Optimizations>
163 </CodeGeneration>
164 <Linking>
165 <Debugging>
166 <GenerateDebugInfo Value="False"/>
167 <UseLineInfoUnit Value="False"/>
168 <StripSymbols Value="True"/>
169 </Debugging>
170 <LinkSmart Value="True"/>
171 <Options>
172 <Win32>
173 <GraphicApplication Value="True"/>
174 </Win32>
175 </Options>
176 </Linking>
177 <Other>
178 <Verbosity>
179 <ShoLineNum Value="True"/>
180 <ShowAll Value="True"/>
181 <ShowDebugInfo Value="True"/>
182 <ShowUsedFiles Value="True"/>
183 <ShowTriedFiles Value="True"/>
184 <ShowCompProc Value="True"/>
185 <ShowCond Value="True"/>
186 <ShowExecInfo Value="True"/>
187 <ShowHintsForUnusedUnitsInMainSrc Value="True"/>
188 <ShowHintsForSenderNotUsed Value="True"/>
189 </Verbosity>
190 <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL -CfAVX2 -CpCOREAVX2 OpCOREAVX2 -Si -Sv -dPRODUCTION"/>
191 </Other>
192 </CompilerOptions>
193 </Item4>
194 <SharedMatrixOptions Count="1">
195 <Item1 ID="895605429442" Modes="Production Mac" Type="IDEMacro" MacroName="LCLWidgetType" Value="cocoa"/>
196 </SharedMatrixOptions>
135 </BuildModes> 197 </BuildModes>
136 <PublishOptions> 198 <PublishOptions>
137 <Version Value="2"/> 199 <Version Value="2"/>