Updated GBA core
This commit is contained in:
parent
e9afc98da1
commit
280282d723
656
VBA.vcproj
656
VBA.vcproj
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="VisualBoyAdvance"
|
||||
ProjectGUID="{6D4C5EC8-933F-4C05-A1BF-498E658576DF}"
|
||||
RootNamespace="VBA"
|
||||
|
@ -128,114 +128,6 @@
|
|||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="MASM"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\dependencies\msvc";"$(SolutionDir)..\dependencies\zlib";"$(SolutionDir)..\dependencies\libpng";"$(SolutionDir)..\dependencies\cximage";$(SolutionDir)..\dependencies\File_Extractor-0.4.2\fex"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;DEV_VERSION;BKPT_SUPPORT;CRT_SECURE_NO_WARNINGS;HAS_FILE_EXTRACTOR;C_CORE"
|
||||
StringPooling="false"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="false"
|
||||
RuntimeLibrary="1"
|
||||
StructMemberAlignment="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="false"
|
||||
EnableEnhancedInstructionSet="0"
|
||||
TreatWChar_tAsBuiltInType="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib Vfw32.Lib OpenGL32.Lib dinput8.lib dxguid.lib ddraw.lib dxerr9.lib winmm.lib d3dx9.lib d3d9.lib Dsound.lib"
|
||||
OutputFile="$(ProjectDir)VisualBoyAdvance.exe"
|
||||
Version=""
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateManifest="true"
|
||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||
IgnoreDefaultLibraryNames="nafxcwd.lib;LIBCMTD.lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="1"
|
||||
EnableCOMDATFolding="1"
|
||||
OptimizeForWindows98="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
|
@ -357,128 +249,6 @@
|
|||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="1"
|
||||
UseOfATL="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
ManagedExtensions="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="MASM"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D_ST_MODEL
/D_SECURE_SCL=0
/Zc:forScope-
/MP"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\dependencies\msvc";"$(SolutionDir)..\dependencies\zlib";"$(SolutionDir)..\dependencies\libpng";"$(SolutionDir)..\dependencies\cximage";$(SolutionDir)..\dependencies\File_Extractor-0.4.2\fex"
|
||||
PreprocessorDefinitions="WIN32;WINVER=0x0500;NDEBUG;_WINDOWS;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableEnhancedInstructionSet="1"
|
||||
FloatingPointModel="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="false"
|
||||
IgnoreImportLibrary="false"
|
||||
AdditionalDependencies="nafxcw.lib LIBCMT.lib Vfw32.Lib OpenGL32.Lib dinput8.lib winmm.lib dxguid.lib ddraw.lib d3d9.lib d3dx9.lib Dsound.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="$(ProjectDir)VisualBoyAdvance.exe"
|
||||
Version=""
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateManifest="true"
|
||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames="nafxcw.lib;LIBCMT.lib"
|
||||
GenerateDebugInformation="false"
|
||||
AssemblyDebug="2"
|
||||
GenerateMapFile="false"
|
||||
MapExports="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="0"
|
||||
EnableCOMDATFolding="0"
|
||||
OptimizeForWindows98="1"
|
||||
LinkTimeCodeGeneration="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
ExcludedFromBuild="true"
|
||||
RelativePath=""
|
||||
UnloadBeforeCopy="false"
|
||||
RegisterOutput="false"
|
||||
VirtualDirectoryName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Optimized|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
|
@ -624,6 +394,236 @@
|
|||
ExcludedFromBuild="false"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="MASM"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/MP"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\dependencies\msvc";"$(SolutionDir)..\dependencies\zlib";"$(SolutionDir)..\dependencies\libpng";"$(SolutionDir)..\dependencies\cximage";$(SolutionDir)..\dependencies\File_Extractor-0.4.2\fex"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;DEV_VERSION;BKPT_SUPPORT;CRT_SECURE_NO_WARNINGS;HAS_FILE_EXTRACTOR;C_CORE"
|
||||
StringPooling="false"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="false"
|
||||
RuntimeLibrary="1"
|
||||
StructMemberAlignment="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="false"
|
||||
EnableEnhancedInstructionSet="0"
|
||||
TreatWChar_tAsBuiltInType="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib Vfw32.Lib OpenGL32.Lib dinput8.lib dxguid.lib ddraw.lib dxerr9.lib winmm.lib d3dx9.lib d3d9.lib Dsound.lib"
|
||||
OutputFile="$(ProjectDir)VisualBoyAdvance.exe"
|
||||
Version=""
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateManifest="true"
|
||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||
IgnoreDefaultLibraryNames="nafxcwd.lib;LIBCMTD.lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="1"
|
||||
EnableCOMDATFolding="1"
|
||||
OptimizeForWindows98="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="1"
|
||||
UseOfATL="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
ManagedExtensions="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="MASM"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D_ST_MODEL
/D_SECURE_SCL=0
/Zc:forScope-
/MP"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\dependencies\msvc";"$(SolutionDir)..\dependencies\zlib";"$(SolutionDir)..\dependencies\libpng";"$(SolutionDir)..\dependencies\cximage";$(SolutionDir)..\dependencies\File_Extractor-0.4.2\fex"
|
||||
PreprocessorDefinitions="WIN32;WINVER=0x0500;NDEBUG;_WINDOWS;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableEnhancedInstructionSet="1"
|
||||
FloatingPointModel="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="false"
|
||||
IgnoreImportLibrary="false"
|
||||
AdditionalDependencies="nafxcw.lib LIBCMT.lib Vfw32.Lib OpenGL32.Lib dinput8.lib winmm.lib dxguid.lib ddraw.lib d3d9.lib d3dx9.lib Dsound.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="$(ProjectDir)VisualBoyAdvance.exe"
|
||||
Version=""
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateManifest="true"
|
||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames="nafxcw.lib;LIBCMT.lib"
|
||||
GenerateDebugInformation="false"
|
||||
AssemblyDebug="2"
|
||||
GenerateMapFile="false"
|
||||
MapExports="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="0"
|
||||
EnableCOMDATFolding="0"
|
||||
OptimizeForWindows98="1"
|
||||
LinkTimeCodeGeneration="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
ExcludedFromBuild="true"
|
||||
RelativePath=""
|
||||
UnloadBeforeCopy="false"
|
||||
RegisterOutput="false"
|
||||
VirtualDirectoryName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Optimized|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
|
@ -815,16 +815,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -836,7 +826,17 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
Name="Optimized|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -f win32 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
|
@ -846,12 +846,12 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|Win32"
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -f win32 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
|
@ -930,16 +930,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="yasm.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -950,16 +940,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|Win32"
|
||||
>
|
||||
|
@ -970,6 +950,26 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="yasm.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|x64"
|
||||
>
|
||||
|
@ -994,16 +994,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="yasm -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -1014,16 +1004,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|Win32"
|
||||
>
|
||||
|
@ -1034,6 +1014,26 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="yasm -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|x64"
|
||||
>
|
||||
|
@ -1058,16 +1058,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -1079,7 +1069,17 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
Name="Optimized|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
|
@ -1089,12 +1089,12 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|Win32"
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
|
@ -1122,16 +1122,6 @@
|
|||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -1143,7 +1133,17 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
Name="Optimized|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
|
@ -1153,12 +1153,12 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|Win32"
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o "$(ProjectDir)$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs=""$(ProjectDir)$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
|
@ -1302,6 +1302,14 @@
|
|||
RelativePath=".\src\Flash.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\GBA-arm.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\GBA-thumb.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\GBA.cpp"
|
||||
>
|
||||
|
@ -1697,14 +1705,6 @@
|
|||
CompileAs="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -1714,7 +1714,7 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
Name="Optimized|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
|
@ -1722,7 +1722,15 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Optimized|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
|
@ -1852,10 +1860,6 @@
|
|||
RelativePath=".\src\agbprint.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\arm-new.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\bios.h"
|
||||
>
|
||||
|
@ -1904,10 +1908,6 @@
|
|||
RelativePath=".\src\System.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\thumb.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Functionality"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
520
src/GBA.cpp
520
src/GBA.cpp
|
@ -23,6 +23,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "GBA.h"
|
||||
#include "GBAcpu.h"
|
||||
#include "GBAinline.h"
|
||||
#include "Globals.h"
|
||||
#include "Gfx.h"
|
||||
|
@ -42,29 +43,6 @@
|
|||
#include "prof/prof.h"
|
||||
#endif
|
||||
|
||||
#define UPDATE_REG(address, value)\
|
||||
{\
|
||||
WRITE16LE(((u16 *)&ioMem[address]),value);\
|
||||
}\
|
||||
|
||||
#define ARM_PREFETCH \
|
||||
{\
|
||||
cpuPrefetch[0] = CPUReadMemoryQuick(armNextPC);\
|
||||
cpuPrefetch[1] = CPUReadMemoryQuick(armNextPC+4);\
|
||||
}
|
||||
|
||||
#define THUMB_PREFETCH \
|
||||
{\
|
||||
cpuPrefetch[0] = CPUReadHalfWordQuick(armNextPC);\
|
||||
cpuPrefetch[1] = CPUReadHalfWordQuick(armNextPC+2);\
|
||||
}
|
||||
|
||||
#define ARM_PREFETCH_NEXT \
|
||||
cpuPrefetch[1] = CPUReadMemoryQuick(armNextPC+4);
|
||||
|
||||
#define THUMB_PREFETCH_NEXT\
|
||||
cpuPrefetch[1] = CPUReadHalfWordQuick(armNextPC+2);
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define _stricmp strcasecmp
|
||||
#endif
|
||||
|
@ -118,12 +96,14 @@ int profilingTicksReload = 0;
|
|||
static profile_segment *profilSegment = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef BKPT_SUPPORT
|
||||
u8 freezeWorkRAM[0x40000];
|
||||
u8 freezeInternalRAM[0x8000];
|
||||
u8 freezeVRAM[0x18000];
|
||||
u8 freezePRAM[0x400];
|
||||
u8 freezeOAM[0x400];
|
||||
bool debugger_last;
|
||||
#endif
|
||||
|
||||
int lcdTicks = (useBios && !skipBios) ? 1008 : 208;
|
||||
u8 timerOnOffDelay = 0;
|
||||
|
@ -522,208 +502,6 @@ void cpuEnableProfiling(int hz)
|
|||
#endif
|
||||
|
||||
|
||||
// Waitstates when accessing data
|
||||
inline int dataTicksAccess16(u32 address) // DATA 8/16bits NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWait[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((++busPrefetchCount)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline int dataTicksAccess32(u32 address) // DATA 32bits NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWait32[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((++busPrefetchCount)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline int dataTicksAccessSeq16(u32 address)// DATA 8/16bits SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWaitSeq[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((++busPrefetchCount)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline int dataTicksAccessSeq32(u32 address)// DATA 32bits SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWaitSeq32[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((++busPrefetchCount)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// Waitstates when executing opcode
|
||||
inline int codeTicksAccess16(u32 address) // THUMB NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
if (busPrefetchCount&0x2)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>2) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr]-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
}
|
||||
|
||||
inline int codeTicksAccess32(u32 address) // ARM NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
if (busPrefetchCount&0x2)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>2) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr] - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
}
|
||||
|
||||
inline int codeTicksAccessSeq16(u32 address) // THUMB SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount>0xFF)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
}
|
||||
|
||||
inline int codeTicksAccessSeq32(u32 address) // ARM SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
if (busPrefetchCount&0x2)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>2) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount>0xFF)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq32[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
return memoryWaitSeq32[addr];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline int CPUUpdateTicks()
|
||||
|
@ -2316,15 +2094,14 @@ void doDMA(u32 &s, u32 &d, u32 si, u32 di, u32 c, int transfer32)
|
|||
|
||||
}
|
||||
|
||||
bool CPUCheckDMA(int reason, int dmamask)
|
||||
void CPUCheckDMA(int reason, int dmamask)
|
||||
{
|
||||
bool res = false;
|
||||
cpuDmaHack = 0;
|
||||
|
||||
|
||||
// DMA 0
|
||||
if((DM0CNT_H & 0x8000) && (dmamask & 1)) {
|
||||
if(((DM0CNT_H >> 12) & 3) == reason) {
|
||||
res = true;
|
||||
|
||||
u32 sourceIncrement = 4;
|
||||
u32 destIncrement = 4;
|
||||
switch((DM0CNT_H >> 7) & 3) {
|
||||
|
@ -2382,7 +2159,7 @@ bool CPUCheckDMA(int reason, int dmamask)
|
|||
// DMA 1
|
||||
if((DM1CNT_H & 0x8000) && (dmamask & 2)) {
|
||||
if(((DM1CNT_H >> 12) & 3) == reason) {
|
||||
res = true;
|
||||
|
||||
|
||||
u32 sourceIncrement = 4;
|
||||
u32 destIncrement = 4;
|
||||
|
@ -2453,7 +2230,7 @@ bool CPUCheckDMA(int reason, int dmamask)
|
|||
// DMA 2
|
||||
if((DM2CNT_H & 0x8000) && (dmamask & 4)) {
|
||||
if(((DM2CNT_H >> 12) & 3) == reason) {
|
||||
res = true;
|
||||
|
||||
u32 sourceIncrement = 4;
|
||||
u32 destIncrement = 4;
|
||||
switch((DM2CNT_H >> 7) & 3) {
|
||||
|
@ -2524,7 +2301,7 @@ bool CPUCheckDMA(int reason, int dmamask)
|
|||
// DMA 3
|
||||
if((DM3CNT_H & 0x8000) && (dmamask & 8)) {
|
||||
if(((DM3CNT_H >> 12) & 3) == reason) {
|
||||
res = true;
|
||||
|
||||
u32 sourceIncrement = 4;
|
||||
u32 destIncrement = 4;
|
||||
switch((DM3CNT_H >> 7) & 3) {
|
||||
|
@ -2577,7 +2354,7 @@ bool CPUCheckDMA(int reason, int dmamask)
|
|||
}
|
||||
}
|
||||
//cpuDmaHack = false;
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
void CPUUpdateRegister(u32 address, u16 value)
|
||||
|
@ -3187,248 +2964,6 @@ void applyTimer ()
|
|||
timerOnOffDelay = 0;
|
||||
}
|
||||
|
||||
void CPUWriteHalfWord(u32 address, u16 value)
|
||||
{
|
||||
#ifdef DEV_VERSION
|
||||
if(address & 1) {
|
||||
if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) {
|
||||
log("Unaligned halfword write: %04x to %08x from %08x\n",
|
||||
value,
|
||||
address,
|
||||
armMode ? armNextPC - 4 : armNextPC - 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(address >> 24) {
|
||||
case 2:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeWorkRAM[address & 0x3FFFE]))
|
||||
cheatsWriteHalfWord(address & 0x203FFFE,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&workRAM[address & 0x3FFFE]),value);
|
||||
break;
|
||||
case 3:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeInternalRAM[address & 0x7ffe]))
|
||||
cheatsWriteHalfWord(address & 0x3007ffe,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&internalRAM[address & 0x7ffe]), value);
|
||||
break;
|
||||
case 4:
|
||||
if(address < 0x4000400)
|
||||
CPUUpdateRegister(address & 0x3fe, value);
|
||||
else goto unwritable;
|
||||
break;
|
||||
case 5:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezePRAM[address & 0x03fe]))
|
||||
cheatsWriteHalfWord(address & 0x70003fe,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&paletteRAM[address & 0x3fe]), value);
|
||||
break;
|
||||
case 6:
|
||||
address = (address & 0x1fffe);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
return;
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeVRAM[address]))
|
||||
cheatsWriteHalfWord(address + 0x06000000,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&vram[address]), value);
|
||||
break;
|
||||
case 7:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeOAM[address & 0x03fe]))
|
||||
cheatsWriteHalfWord(address & 0x70003fe,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&oam[address & 0x3fe]), value);
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
if(address == 0x80000c4 || address == 0x80000c6 || address == 0x80000c8) {
|
||||
if(!rtcWrite(address, value))
|
||||
goto unwritable;
|
||||
} else if(!agbPrintWrite(address, value)) goto unwritable;
|
||||
break;
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled) {
|
||||
eepromWrite(address, (u8)value);
|
||||
break;
|
||||
}
|
||||
goto unwritable;
|
||||
case 14:
|
||||
if(!eepromInUse | cpuSramEnabled | cpuFlashEnabled) {
|
||||
(*cpuSaveGameFunc)(address, (u8)value);
|
||||
break;
|
||||
}
|
||||
goto unwritable;
|
||||
default:
|
||||
unwritable:
|
||||
#ifdef DEV_VERSION
|
||||
if(systemVerbose & VERBOSE_ILLEGAL_WRITE) {
|
||||
log("Illegal halfword write: %04x to %08x from %08x\n",
|
||||
value,
|
||||
address,
|
||||
armMode ? armNextPC - 4 : armNextPC - 2);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CPUWriteByte(u32 address, u8 b)
|
||||
{
|
||||
switch(address >> 24) {
|
||||
case 2:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(freezeWorkRAM[address & 0x3FFFF])
|
||||
cheatsWriteByte(address & 0x203FFFF, b);
|
||||
else
|
||||
#endif
|
||||
workRAM[address & 0x3FFFF] = b;
|
||||
break;
|
||||
case 3:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(freezeInternalRAM[address & 0x7fff])
|
||||
cheatsWriteByte(address & 0x3007fff, b);
|
||||
else
|
||||
#endif
|
||||
internalRAM[address & 0x7fff] = b;
|
||||
break;
|
||||
case 4:
|
||||
if(address < 0x4000400) {
|
||||
switch(address & 0x3FF) {
|
||||
case 0x301:
|
||||
if(b == 0x80)
|
||||
stopState = true;
|
||||
holdState = 1;
|
||||
holdType = -1;
|
||||
cpuNextEvent = cpuTotalTicks;
|
||||
break;
|
||||
case 0x60:
|
||||
case 0x61:
|
||||
case 0x62:
|
||||
case 0x63:
|
||||
case 0x64:
|
||||
case 0x65:
|
||||
case 0x68:
|
||||
case 0x69:
|
||||
case 0x6c:
|
||||
case 0x6d:
|
||||
case 0x70:
|
||||
case 0x71:
|
||||
case 0x72:
|
||||
case 0x73:
|
||||
case 0x74:
|
||||
case 0x75:
|
||||
case 0x78:
|
||||
case 0x79:
|
||||
case 0x7c:
|
||||
case 0x7d:
|
||||
case 0x80:
|
||||
case 0x81:
|
||||
case 0x84:
|
||||
case 0x85:
|
||||
case 0x90:
|
||||
case 0x91:
|
||||
case 0x92:
|
||||
case 0x93:
|
||||
case 0x94:
|
||||
case 0x95:
|
||||
case 0x96:
|
||||
case 0x97:
|
||||
case 0x98:
|
||||
case 0x99:
|
||||
case 0x9a:
|
||||
case 0x9b:
|
||||
case 0x9c:
|
||||
case 0x9d:
|
||||
case 0x9e:
|
||||
case 0x9f:
|
||||
soundEvent(address&0xFF, b);
|
||||
break;
|
||||
default:
|
||||
if(address & 1)
|
||||
CPUUpdateRegister(address & 0x3fe,
|
||||
((READ16LE(((u16 *)&ioMem[address & 0x3fe])))
|
||||
& 0x00FF) |
|
||||
b<<8);
|
||||
else
|
||||
CPUUpdateRegister(address & 0x3fe,
|
||||
((READ16LE(((u16 *)&ioMem[address & 0x3fe])) & 0xFF00) | b));
|
||||
}
|
||||
break;
|
||||
} else goto unwritable;
|
||||
break;
|
||||
case 5:
|
||||
// no need to switch
|
||||
*((u16 *)&paletteRAM[address & 0x3FE]) = (b << 8) | b;
|
||||
break;
|
||||
case 6:
|
||||
address = (address & 0x1fffe);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
return;
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
|
||||
// no need to switch
|
||||
// byte writes to OBJ VRAM are ignored
|
||||
if ((address) < objTilesAddress[((DISPCNT&7)+1)>>2])
|
||||
{
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(freezeVRAM[address])
|
||||
cheatsWriteByte(address + 0x06000000, b);
|
||||
else
|
||||
#endif
|
||||
*((u16 *)&vram[address]) = (b << 8) | b;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
// no need to switch
|
||||
// byte writes to OAM are ignored
|
||||
// *((u16 *)&oam[address & 0x3FE]) = (b << 8) | b;
|
||||
break;
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled) {
|
||||
eepromWrite(address, b);
|
||||
break;
|
||||
}
|
||||
goto unwritable;
|
||||
case 14:
|
||||
if (!(saveType == 5) && (!eepromInUse | cpuSramEnabled | cpuFlashEnabled)) {
|
||||
|
||||
//if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) {
|
||||
|
||||
(*cpuSaveGameFunc)(address, b);
|
||||
break;
|
||||
}
|
||||
// default
|
||||
default:
|
||||
unwritable:
|
||||
#ifdef DEV_VERSION
|
||||
if(systemVerbose & VERBOSE_ILLEGAL_WRITE) {
|
||||
log("Illegal byte write: %02x to %08x from %08x\n",
|
||||
b,
|
||||
address,
|
||||
armMode ? armNextPC - 4 : armNextPC -2 );
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
u8 cpuBitsSet[256];
|
||||
u8 cpuLowestBitSet[256];
|
||||
|
@ -3883,7 +3418,7 @@ void CPULoop(int ticks)
|
|||
// variable used by the CPU core
|
||||
cpuTotalTicks = 0;
|
||||
#ifdef LINK_EMULATION
|
||||
if(linkenable && cpuDmaHack2)
|
||||
if(linkenable)
|
||||
cpuNextEvent = 1;
|
||||
#endif
|
||||
cpuBreakLoop = false;
|
||||
|
@ -3929,28 +3464,17 @@ void CPULoop(int ticks)
|
|||
#endif /* FINAL_VERSION */
|
||||
|
||||
if(!holdState && !SWITicks) {
|
||||
|
||||
// Emulates the Cheat System (m) code
|
||||
if((cheatsEnabled) && (mastercode) && (mastercode == armNextPC))
|
||||
{
|
||||
u32 joy = 0;
|
||||
if(systemReadJoypads())
|
||||
joy = systemReadJoypad(-1);
|
||||
u32 ext = (joy >> 10);
|
||||
cpuTotalTicks += cheatsCheckKeys(P1^0x3FF, ext);
|
||||
}
|
||||
|
||||
if ((armNextPC & 0x0803FFFF) == 0x08020000)
|
||||
busPrefetchCount=0x100;
|
||||
|
||||
if(armState) {
|
||||
#include "arm-new.h"
|
||||
if (!armExecute())
|
||||
return;
|
||||
} else {
|
||||
#include "thumb.h"
|
||||
}
|
||||
} else
|
||||
if (!thumbExecute())
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
clockTicks = CPUUpdateTicks();
|
||||
|
||||
|
||||
cpuTotalTicks += clockTicks;
|
||||
|
||||
|
||||
|
@ -4084,7 +3608,7 @@ void CPULoop(int ticks)
|
|||
IF |= 1;
|
||||
UPDATE_REG(0x202, IF);
|
||||
}
|
||||
cpuDmaHack2 = CPUCheckDMA(1, 0x0f);
|
||||
CPUCheckDMA(1, 0x0f);
|
||||
if(frameCount >= framesToSkip) {
|
||||
systemDrawScreen();
|
||||
frameCount = 0;
|
||||
|
@ -4204,7 +3728,7 @@ void CPULoop(int ticks)
|
|||
DISPSTAT |= 2;
|
||||
UPDATE_REG(0x04, DISPSTAT);
|
||||
lcdTicks += 224;
|
||||
cpuDmaHack2 = CPUCheckDMA(2, 0x0f);
|
||||
CPUCheckDMA(2, 0x0f);
|
||||
if(DISPSTAT & 16) {
|
||||
IF |= 2;
|
||||
UPDATE_REG(0x202, IF);
|
||||
|
@ -4367,7 +3891,7 @@ void CPULoop(int ticks)
|
|||
goto updateLoop;
|
||||
}
|
||||
#ifdef LINK_EMULATION
|
||||
if(linkenable && cpuDmaHack2)
|
||||
if(linkenable)
|
||||
cpuNextEvent = 1;
|
||||
#endif
|
||||
if(IF && (IME & 1) && armIrqEnable) {
|
||||
|
|
|
@ -84,6 +84,7 @@ extern bool armState;
|
|||
extern int armMode;
|
||||
extern void (*cpuSaveGameFunc)(u32,u8);
|
||||
|
||||
#ifdef BKPT_SUPPORT
|
||||
extern u8 freezeWorkRAM[0x40000];
|
||||
extern u8 freezeInternalRAM[0x8000];
|
||||
extern u8 freezeVRAM[0x18000];
|
||||
|
@ -92,6 +93,7 @@ extern u8 freezePRAM[0x400];
|
|||
extern bool debugger_last;
|
||||
extern int oldreg[17];
|
||||
extern char oldbuffer[10];
|
||||
#endif
|
||||
|
||||
extern bool CPUReadGSASnapshot(const char *);
|
||||
extern bool CPUWriteGSASnapshot(const char *, const char *, const char *, const char *);
|
||||
|
@ -111,12 +113,10 @@ extern int CPULoadRom(const char *);
|
|||
extern void doMirroring(bool);
|
||||
extern void CPUUpdateRegister(u32, u16);
|
||||
extern void applyTimer ();
|
||||
extern void CPUWriteHalfWord(u32, u16);
|
||||
extern void CPUWriteByte(u32, u8);
|
||||
extern void CPUInit(const char *,bool);
|
||||
extern void CPUReset();
|
||||
extern void CPULoop(int);
|
||||
extern bool CPUCheckDMA(int,int);
|
||||
extern void CPUCheckDMA(int,int);
|
||||
extern bool CPUIsGBAImage(const char *);
|
||||
extern bool CPUIsZipFile(const char *);
|
||||
#ifdef PROFILING
|
||||
|
|
|
@ -0,0 +1,302 @@
|
|||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef VBA_GBAcpu_H
|
||||
#define VBA_GBAcpu_H
|
||||
|
||||
extern int armExecute();
|
||||
extern int thumbExecute();
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define INSN_REGPARM __attribute__((regparm(1)))
|
||||
# define LIKELY(x) __builtin_expect(!!(x),1)
|
||||
# define UNLIKELY(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define INSN_REGPARM /*nothing*/
|
||||
# define LIKELY(x) (x)
|
||||
# define UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
#define UPDATE_REG(address, value)\
|
||||
{\
|
||||
WRITE16LE(((u16 *)&ioMem[address]),value);\
|
||||
}\
|
||||
|
||||
#define ARM_PREFETCH \
|
||||
{\
|
||||
cpuPrefetch[0] = CPUReadMemoryQuick(armNextPC);\
|
||||
cpuPrefetch[1] = CPUReadMemoryQuick(armNextPC+4);\
|
||||
}
|
||||
|
||||
#define THUMB_PREFETCH \
|
||||
{\
|
||||
cpuPrefetch[0] = CPUReadHalfWordQuick(armNextPC);\
|
||||
cpuPrefetch[1] = CPUReadHalfWordQuick(armNextPC+2);\
|
||||
}
|
||||
|
||||
#define ARM_PREFETCH_NEXT \
|
||||
cpuPrefetch[1] = CPUReadMemoryQuick(armNextPC+4);
|
||||
|
||||
#define THUMB_PREFETCH_NEXT\
|
||||
cpuPrefetch[1] = CPUReadHalfWordQuick(armNextPC+2);
|
||||
|
||||
|
||||
extern int SWITicks;
|
||||
extern u32 mastercode;
|
||||
extern bool busPrefetch;
|
||||
extern bool busPrefetchEnable;
|
||||
extern u32 busPrefetchCount;
|
||||
extern int cpuNextEvent;
|
||||
extern bool holdState;
|
||||
extern u32 cpuPrefetch[2];
|
||||
extern int cpuTotalTicks;
|
||||
extern u8 memoryWait[16];
|
||||
extern u8 memoryWait32[16];
|
||||
extern u8 memoryWaitSeq[16];
|
||||
extern u8 memoryWaitSeq32[16];
|
||||
extern u8 cpuBitsSet[256];
|
||||
extern u8 cpuLowestBitSet[256];
|
||||
extern void CPUSwitchMode(int mode, bool saveState, bool breakLoop);
|
||||
extern void CPUSwitchMode(int mode, bool saveState);
|
||||
extern void CPUUpdateCPSR();
|
||||
extern void CPUUpdateFlags(bool breakLoop);
|
||||
extern void CPUUpdateFlags();
|
||||
extern void CPUUndefinedException();
|
||||
extern void CPUSoftwareInterrupt();
|
||||
extern void CPUSoftwareInterrupt(int comment);
|
||||
|
||||
|
||||
// Waitstates when accessing data
|
||||
inline int dataTicksAccess16(u32 address) // DATA 8/16bits NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWait[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((busPrefetchCount+1)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline int dataTicksAccess32(u32 address) // DATA 32bits NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWait32[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((busPrefetchCount+1)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline int dataTicksAccessSeq16(u32 address)// DATA 8/16bits SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWaitSeq[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((busPrefetchCount+1)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
inline int dataTicksAccessSeq32(u32 address)// DATA 32bits SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWaitSeq32[addr];
|
||||
|
||||
if ((addr>=0x08) || (addr < 0x02))
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (!waitState)
|
||||
waitState = 1;
|
||||
busPrefetchCount = ((busPrefetchCount+1)<<waitState) - 1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// Waitstates when executing opcode
|
||||
inline int codeTicksAccess16(u32 address) // THUMB NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
if (busPrefetchCount&0x2)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>2) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr]-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
}
|
||||
|
||||
inline int codeTicksAccess32(u32 address) // ARM NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
if (busPrefetchCount&0x2)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>2) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr] - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
}
|
||||
|
||||
inline int codeTicksAccessSeq16(u32 address) // THUMB SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount>0xFF)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
}
|
||||
|
||||
inline int codeTicksAccessSeq32(u32 address) // ARM SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
if (busPrefetchCount&0x2)
|
||||
{
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>2) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
busPrefetchCount = ((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount>0xFF)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq32[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
return memoryWaitSeq32[addr];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Emulates the Cheat System (m) code
|
||||
inline void cpuMasterCodeCheck()
|
||||
{
|
||||
if((cheatsEnabled) && (mastercode) && (mastercode == armNextPC))
|
||||
{
|
||||
u32 joy = 0;
|
||||
if(systemReadJoypads())
|
||||
joy = systemReadJoypad(-1);
|
||||
u32 ext = (joy >> 10);
|
||||
cpuTotalTicks += cheatsCheckKeys(P1^0x3FF, ext);
|
||||
}
|
||||
}
|
||||
|
||||
#endif //VBA_GBAcpu_H
|
258
src/GBAinline.h
258
src/GBAinline.h
|
@ -23,6 +23,15 @@
|
|||
#include "System.h"
|
||||
#include "Port.h"
|
||||
#include "RTC.h"
|
||||
#include "Sound.h"
|
||||
#include "agbprint.h"
|
||||
|
||||
extern const u32 objTilesAddress[3];
|
||||
|
||||
extern bool stopState;
|
||||
extern bool holdState;
|
||||
extern int holdType;
|
||||
extern int cpuNextEvent;
|
||||
|
||||
extern bool cpuSramEnabled;
|
||||
extern bool cpuFlashEnabled;
|
||||
|
@ -34,7 +43,6 @@ extern bool linkenable;
|
|||
extern void LinkSStop(void);
|
||||
#endif /* LINK_EMULATION */
|
||||
extern bool cpuDmaHack;
|
||||
extern bool cpuDmaHack2;
|
||||
extern u32 cpuDmaLast;
|
||||
extern bool timer0On;
|
||||
extern int timer0Ticks;
|
||||
|
@ -150,7 +158,7 @@ static inline u32 CPUReadMemory(u32 address)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(cpuDmaHack || cpuDmaHack2) {
|
||||
if(cpuDmaHack) {
|
||||
value = cpuDmaLast;
|
||||
} else {
|
||||
if(armState) {
|
||||
|
@ -292,7 +300,7 @@ static inline u32 CPUReadHalfWord(u32 address)
|
|||
armNextPC - 4 : armNextPC - 2);
|
||||
}
|
||||
#endif
|
||||
if(cpuDmaHack2 || cpuDmaHack) {
|
||||
if(cpuDmaHack) {
|
||||
value = cpuDmaLast & 0xFFFF;
|
||||
} else {
|
||||
if(armState) {
|
||||
|
@ -392,7 +400,7 @@ static inline u8 CPUReadByte(u32 address)
|
|||
armNextPC - 4 : armNextPC - 2);
|
||||
}
|
||||
#endif
|
||||
if(cpuDmaHack || cpuDmaHack2) {
|
||||
if(cpuDmaHack) {
|
||||
return cpuDmaLast & 0xFF;
|
||||
} else {
|
||||
if(armState) {
|
||||
|
@ -503,4 +511,246 @@ static inline void CPUWriteMemory(u32 address, u32 value)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void CPUWriteHalfWord(u32 address, u16 value)
|
||||
{
|
||||
#ifdef DEV_VERSION
|
||||
if(address & 1) {
|
||||
if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) {
|
||||
log("Unaligned halfword write: %04x to %08x from %08x\n",
|
||||
value,
|
||||
address,
|
||||
armMode ? armNextPC - 4 : armNextPC - 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(address >> 24) {
|
||||
case 2:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeWorkRAM[address & 0x3FFFE]))
|
||||
cheatsWriteHalfWord(address & 0x203FFFE,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&workRAM[address & 0x3FFFE]),value);
|
||||
break;
|
||||
case 3:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeInternalRAM[address & 0x7ffe]))
|
||||
cheatsWriteHalfWord(address & 0x3007ffe,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&internalRAM[address & 0x7ffe]), value);
|
||||
break;
|
||||
case 4:
|
||||
if(address < 0x4000400)
|
||||
CPUUpdateRegister(address & 0x3fe, value);
|
||||
else goto unwritable;
|
||||
break;
|
||||
case 5:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezePRAM[address & 0x03fe]))
|
||||
cheatsWriteHalfWord(address & 0x70003fe,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&paletteRAM[address & 0x3fe]), value);
|
||||
break;
|
||||
case 6:
|
||||
address = (address & 0x1fffe);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
return;
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeVRAM[address]))
|
||||
cheatsWriteHalfWord(address + 0x06000000,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&vram[address]), value);
|
||||
break;
|
||||
case 7:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(*((u16 *)&freezeOAM[address & 0x03fe]))
|
||||
cheatsWriteHalfWord(address & 0x70003fe,
|
||||
value);
|
||||
else
|
||||
#endif
|
||||
WRITE16LE(((u16 *)&oam[address & 0x3fe]), value);
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
if(address == 0x80000c4 || address == 0x80000c6 || address == 0x80000c8) {
|
||||
if(!rtcWrite(address, value))
|
||||
goto unwritable;
|
||||
} else if(!agbPrintWrite(address, value)) goto unwritable;
|
||||
break;
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled) {
|
||||
eepromWrite(address, (u8)value);
|
||||
break;
|
||||
}
|
||||
goto unwritable;
|
||||
case 14:
|
||||
if(!eepromInUse | cpuSramEnabled | cpuFlashEnabled) {
|
||||
(*cpuSaveGameFunc)(address, (u8)value);
|
||||
break;
|
||||
}
|
||||
goto unwritable;
|
||||
default:
|
||||
unwritable:
|
||||
#ifdef DEV_VERSION
|
||||
if(systemVerbose & VERBOSE_ILLEGAL_WRITE) {
|
||||
log("Illegal halfword write: %04x to %08x from %08x\n",
|
||||
value,
|
||||
address,
|
||||
armMode ? armNextPC - 4 : armNextPC - 2);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void CPUWriteByte(u32 address, u8 b)
|
||||
{
|
||||
switch(address >> 24) {
|
||||
case 2:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(freezeWorkRAM[address & 0x3FFFF])
|
||||
cheatsWriteByte(address & 0x203FFFF, b);
|
||||
else
|
||||
#endif
|
||||
workRAM[address & 0x3FFFF] = b;
|
||||
break;
|
||||
case 3:
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(freezeInternalRAM[address & 0x7fff])
|
||||
cheatsWriteByte(address & 0x3007fff, b);
|
||||
else
|
||||
#endif
|
||||
internalRAM[address & 0x7fff] = b;
|
||||
break;
|
||||
case 4:
|
||||
if(address < 0x4000400) {
|
||||
switch(address & 0x3FF) {
|
||||
case 0x301:
|
||||
if(b == 0x80)
|
||||
stopState = true;
|
||||
holdState = 1;
|
||||
holdType = -1;
|
||||
cpuNextEvent = cpuTotalTicks;
|
||||
break;
|
||||
case 0x60:
|
||||
case 0x61:
|
||||
case 0x62:
|
||||
case 0x63:
|
||||
case 0x64:
|
||||
case 0x65:
|
||||
case 0x68:
|
||||
case 0x69:
|
||||
case 0x6c:
|
||||
case 0x6d:
|
||||
case 0x70:
|
||||
case 0x71:
|
||||
case 0x72:
|
||||
case 0x73:
|
||||
case 0x74:
|
||||
case 0x75:
|
||||
case 0x78:
|
||||
case 0x79:
|
||||
case 0x7c:
|
||||
case 0x7d:
|
||||
case 0x80:
|
||||
case 0x81:
|
||||
case 0x84:
|
||||
case 0x85:
|
||||
case 0x90:
|
||||
case 0x91:
|
||||
case 0x92:
|
||||
case 0x93:
|
||||
case 0x94:
|
||||
case 0x95:
|
||||
case 0x96:
|
||||
case 0x97:
|
||||
case 0x98:
|
||||
case 0x99:
|
||||
case 0x9a:
|
||||
case 0x9b:
|
||||
case 0x9c:
|
||||
case 0x9d:
|
||||
case 0x9e:
|
||||
case 0x9f:
|
||||
soundEvent(address&0xFF, b);
|
||||
break;
|
||||
default:
|
||||
if(address & 1)
|
||||
CPUUpdateRegister(address & 0x3fe,
|
||||
((READ16LE(((u16 *)&ioMem[address & 0x3fe])))
|
||||
& 0x00FF) |
|
||||
b<<8);
|
||||
else
|
||||
CPUUpdateRegister(address & 0x3fe,
|
||||
((READ16LE(((u16 *)&ioMem[address & 0x3fe])) & 0xFF00) | b));
|
||||
}
|
||||
break;
|
||||
} else goto unwritable;
|
||||
break;
|
||||
case 5:
|
||||
// no need to switch
|
||||
*((u16 *)&paletteRAM[address & 0x3FE]) = (b << 8) | b;
|
||||
break;
|
||||
case 6:
|
||||
address = (address & 0x1fffe);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
return;
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
|
||||
// no need to switch
|
||||
// byte writes to OBJ VRAM are ignored
|
||||
if ((address) < objTilesAddress[((DISPCNT&7)+1)>>2])
|
||||
{
|
||||
#ifdef BKPT_SUPPORT
|
||||
if(freezeVRAM[address])
|
||||
cheatsWriteByte(address + 0x06000000, b);
|
||||
else
|
||||
#endif
|
||||
*((u16 *)&vram[address]) = (b << 8) | b;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
// no need to switch
|
||||
// byte writes to OAM are ignored
|
||||
// *((u16 *)&oam[address & 0x3FE]) = (b << 8) | b;
|
||||
break;
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled) {
|
||||
eepromWrite(address, b);
|
||||
break;
|
||||
}
|
||||
goto unwritable;
|
||||
case 14:
|
||||
if (!(saveType == 5) && (!eepromInUse | cpuSramEnabled | cpuFlashEnabled)) {
|
||||
|
||||
//if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) {
|
||||
|
||||
(*cpuSaveGameFunc)(address, b);
|
||||
break;
|
||||
}
|
||||
// default
|
||||
default:
|
||||
unwritable:
|
||||
#ifdef DEV_VERSION
|
||||
if(systemVerbose & VERBOSE_ILLEGAL_WRITE) {
|
||||
log("Illegal byte write: %02x to %08x from %08x\n",
|
||||
b,
|
||||
address,
|
||||
armMode ? armNextPC - 4 : armNextPC -2 );
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif //VBA_GBAinline_H
|
||||
|
|
|
@ -949,13 +949,13 @@ void soundChannel4()
|
|||
}
|
||||
|
||||
|
||||
extern bool cpuDmaHack2;
|
||||
|
||||
|
||||
void soundDirectSoundATimer()
|
||||
{
|
||||
if(soundDSAEnabled) {
|
||||
if(soundDSFifoACount <= 16) {
|
||||
cpuDmaHack2 = CPUCheckDMA(3, 2);
|
||||
CPUCheckDMA(3, 2);
|
||||
if(soundDSFifoACount <= 16) {
|
||||
soundEvent(FIFOA_L, (u16)0);
|
||||
soundEvent(FIFOA_H, (u16)0);
|
||||
|
@ -989,7 +989,7 @@ void soundDirectSoundBTimer()
|
|||
{
|
||||
if(soundDSBEnabled) {
|
||||
if(soundDSFifoBCount <= 16) {
|
||||
cpuDmaHack2 = CPUCheckDMA(3, 4);
|
||||
CPUCheckDMA(3, 4);
|
||||
if(soundDSFifoBCount <= 16) {
|
||||
soundEvent(FIFOB_L, (u16)0);
|
||||
soundEvent(FIFOB_H, (u16)0);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "../System.h"
|
||||
#include "../GBA.h"
|
||||
#include "../Globals.h"
|
||||
|
||||
#include "../GBAinline.h"
|
||||
#include "IOViewerRegs.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
|
Loading…
Reference in New Issue