Updated GBA core

This commit is contained in:
mudlord 2007-12-01 22:27:30 +00:00
parent e9afc98da1
commit 280282d723
9 changed files with 6206 additions and 837 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8.00"
Name="VisualBoyAdvance" Name="VisualBoyAdvance"
ProjectGUID="{6D4C5EC8-933F-4C05-A1BF-498E658576DF}" ProjectGUID="{6D4C5EC8-933F-4C05-A1BF-498E658576DF}"
RootNamespace="VBA" RootNamespace="VBA"
@ -128,114 +128,6 @@
ExcludedFromBuild="true" ExcludedFromBuild="true"
/> />
</Configuration> </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="&quot;$(SolutionDir)..\dependencies\msvc&quot;;&quot;$(SolutionDir)..\dependencies\zlib&quot;;&quot;$(SolutionDir)..\dependencies\libpng&quot;;&quot;$(SolutionDir)..\dependencies\cximage&quot;;$(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=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;amd64&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
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 <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
@ -357,128 +249,6 @@
ExcludedFromBuild="true" ExcludedFromBuild="true"
/> />
</Configuration> </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&#x0D;&#x0A;/D_SECURE_SCL=0&#x0D;&#x0A;/Zc:forScope-&#x0D;&#x0A;/MP"
Optimization="2"
InlineFunctionExpansion="2"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)..\dependencies\msvc&quot;;&quot;$(SolutionDir)..\dependencies\zlib&quot;;&quot;$(SolutionDir)..\dependencies\libpng&quot;;&quot;$(SolutionDir)..\dependencies\cximage&quot;;$(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=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;amd64&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
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 <Configuration
Name="Optimized|Win32" Name="Optimized|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
@ -624,6 +394,236 @@
ExcludedFromBuild="false" ExcludedFromBuild="false"
/> />
</Configuration> </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="&quot;$(SolutionDir)..\dependencies\msvc&quot;;&quot;$(SolutionDir)..\dependencies\zlib&quot;;&quot;$(SolutionDir)..\dependencies\libpng&quot;;&quot;$(SolutionDir)..\dependencies\cximage&quot;;$(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=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;amd64&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
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&#x0D;&#x0A;/D_SECURE_SCL=0&#x0D;&#x0A;/Zc:forScope-&#x0D;&#x0A;/MP"
Optimization="2"
InlineFunctionExpansion="2"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)..\dependencies\msvc&quot;;&quot;$(SolutionDir)..\dependencies\zlib&quot;;&quot;$(SolutionDir)..\dependencies\libpng&quot;;&quot;$(SolutionDir)..\dependencies\cximage&quot;;$(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=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;amd64&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
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 <Configuration
Name="Optimized|x64" Name="Optimized|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)" OutputDirectory="$(PlatformName)\$(ConfigurationName)"
@ -815,16 +815,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Release|Win32"
> >
@ -836,7 +826,17 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|x64" Name="Optimized|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -846,12 +846,12 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|Win32" Name="Release|x64"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..." Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
@ -930,16 +930,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="yasm.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Release|Win32"
> >
@ -950,16 +940,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|Win32" Name="Optimized|Win32"
> >
@ -970,6 +950,26 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="yasm.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|x64" Name="Optimized|x64"
> >
@ -994,16 +994,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="yasm -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Release|Win32"
> >
@ -1014,16 +1004,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|Win32" Name="Optimized|Win32"
> >
@ -1034,6 +1014,26 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="yasm -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|x64" Name="Optimized|x64"
> >
@ -1058,16 +1058,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Release|Win32"
> >
@ -1079,7 +1069,17 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|x64" Name="Optimized|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -1089,12 +1089,12 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|Win32" Name="Release|x64"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..." Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
@ -1122,16 +1122,6 @@
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Release|Win32"
> >
@ -1143,7 +1133,17 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|x64" Name="Optimized|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -1153,12 +1153,12 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|Win32" Name="Release|x64"
> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..." Description="Assembling $(InputFileName)..."
CommandLine="nasmw.exe -D__DJGPP__ -O1 -f win32 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw.exe -D__DJGPP__ -Isrc/ -O1 -f win64 -o &quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;" Outputs="&quot;$(ProjectDir)$(IntDir)\$(InputName).obj&quot;"
/> />
</FileConfiguration> </FileConfiguration>
@ -1302,6 +1302,14 @@
RelativePath=".\src\Flash.cpp" RelativePath=".\src\Flash.cpp"
> >
</File> </File>
<File
RelativePath=".\src\GBA-arm.cpp"
>
</File>
<File
RelativePath=".\src\GBA-thumb.cpp"
>
</File>
<File <File
RelativePath=".\src\GBA.cpp" RelativePath=".\src\GBA.cpp"
> >
@ -1697,14 +1705,6 @@
CompileAs="1" CompileAs="1"
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
CompileAs="1"
/>
</FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Release|Win32"
> >
@ -1714,7 +1714,7 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|x64" Name="Optimized|Win32"
> >
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
@ -1722,7 +1722,15 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Optimized|Win32" Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
CompileAs="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
> >
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
@ -1852,10 +1860,6 @@
RelativePath=".\src\agbprint.h" RelativePath=".\src\agbprint.h"
> >
</File> </File>
<File
RelativePath=".\src\arm-new.h"
>
</File>
<File <File
RelativePath=".\src\bios.h" RelativePath=".\src\bios.h"
> >
@ -1904,10 +1908,6 @@
RelativePath=".\src\System.h" RelativePath=".\src\System.h"
> >
</File> </File>
<File
RelativePath=".\src\thumb.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Functionality" Name="Functionality"

2964
src/GBA-arm.cpp Normal file

File diff suppressed because it is too large Load Diff

2329
src/GBA-thumb.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
#include <string.h> #include <string.h>
#include "GBA.h" #include "GBA.h"
#include "GBAcpu.h"
#include "GBAinline.h" #include "GBAinline.h"
#include "Globals.h" #include "Globals.h"
#include "Gfx.h" #include "Gfx.h"
@ -42,29 +43,6 @@
#include "prof/prof.h" #include "prof/prof.h"
#endif #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__ #ifdef __GNUC__
#define _stricmp strcasecmp #define _stricmp strcasecmp
#endif #endif
@ -118,12 +96,14 @@ int profilingTicksReload = 0;
static profile_segment *profilSegment = NULL; static profile_segment *profilSegment = NULL;
#endif #endif
#ifdef BKPT_SUPPORT
u8 freezeWorkRAM[0x40000]; u8 freezeWorkRAM[0x40000];
u8 freezeInternalRAM[0x8000]; u8 freezeInternalRAM[0x8000];
u8 freezeVRAM[0x18000]; u8 freezeVRAM[0x18000];
u8 freezePRAM[0x400]; u8 freezePRAM[0x400];
u8 freezeOAM[0x400]; u8 freezeOAM[0x400];
bool debugger_last; bool debugger_last;
#endif
int lcdTicks = (useBios && !skipBios) ? 1008 : 208; int lcdTicks = (useBios && !skipBios) ? 1008 : 208;
u8 timerOnOffDelay = 0; u8 timerOnOffDelay = 0;
@ -522,208 +502,6 @@ void cpuEnableProfiling(int hz)
#endif #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() 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 // DMA 0
if((DM0CNT_H & 0x8000) && (dmamask & 1)) { if((DM0CNT_H & 0x8000) && (dmamask & 1)) {
if(((DM0CNT_H >> 12) & 3) == reason) { if(((DM0CNT_H >> 12) & 3) == reason) {
res = true;
u32 sourceIncrement = 4; u32 sourceIncrement = 4;
u32 destIncrement = 4; u32 destIncrement = 4;
switch((DM0CNT_H >> 7) & 3) { switch((DM0CNT_H >> 7) & 3) {
@ -2382,7 +2159,7 @@ bool CPUCheckDMA(int reason, int dmamask)
// DMA 1 // DMA 1
if((DM1CNT_H & 0x8000) && (dmamask & 2)) { if((DM1CNT_H & 0x8000) && (dmamask & 2)) {
if(((DM1CNT_H >> 12) & 3) == reason) { if(((DM1CNT_H >> 12) & 3) == reason) {
res = true;
u32 sourceIncrement = 4; u32 sourceIncrement = 4;
u32 destIncrement = 4; u32 destIncrement = 4;
@ -2453,7 +2230,7 @@ bool CPUCheckDMA(int reason, int dmamask)
// DMA 2 // DMA 2
if((DM2CNT_H & 0x8000) && (dmamask & 4)) { if((DM2CNT_H & 0x8000) && (dmamask & 4)) {
if(((DM2CNT_H >> 12) & 3) == reason) { if(((DM2CNT_H >> 12) & 3) == reason) {
res = true;
u32 sourceIncrement = 4; u32 sourceIncrement = 4;
u32 destIncrement = 4; u32 destIncrement = 4;
switch((DM2CNT_H >> 7) & 3) { switch((DM2CNT_H >> 7) & 3) {
@ -2524,7 +2301,7 @@ bool CPUCheckDMA(int reason, int dmamask)
// DMA 3 // DMA 3
if((DM3CNT_H & 0x8000) && (dmamask & 8)) { if((DM3CNT_H & 0x8000) && (dmamask & 8)) {
if(((DM3CNT_H >> 12) & 3) == reason) { if(((DM3CNT_H >> 12) & 3) == reason) {
res = true;
u32 sourceIncrement = 4; u32 sourceIncrement = 4;
u32 destIncrement = 4; u32 destIncrement = 4;
switch((DM3CNT_H >> 7) & 3) { switch((DM3CNT_H >> 7) & 3) {
@ -2577,7 +2354,7 @@ bool CPUCheckDMA(int reason, int dmamask)
} }
} }
//cpuDmaHack = false; //cpuDmaHack = false;
return res;
} }
void CPUUpdateRegister(u32 address, u16 value) void CPUUpdateRegister(u32 address, u16 value)
@ -3187,248 +2964,6 @@ void applyTimer ()
timerOnOffDelay = 0; 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 cpuBitsSet[256];
u8 cpuLowestBitSet[256]; u8 cpuLowestBitSet[256];
@ -3883,7 +3418,7 @@ void CPULoop(int ticks)
// variable used by the CPU core // variable used by the CPU core
cpuTotalTicks = 0; cpuTotalTicks = 0;
#ifdef LINK_EMULATION #ifdef LINK_EMULATION
if(linkenable && cpuDmaHack2) if(linkenable)
cpuNextEvent = 1; cpuNextEvent = 1;
#endif #endif
cpuBreakLoop = false; cpuBreakLoop = false;
@ -3929,26 +3464,15 @@ void CPULoop(int ticks)
#endif /* FINAL_VERSION */ #endif /* FINAL_VERSION */
if(!holdState && !SWITicks) { 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) { if(armState) {
#include "arm-new.h" if (!armExecute())
return;
} else { } else {
#include "thumb.h" if (!thumbExecute())
return;
}
} }
} else
clockTicks = CPUUpdateTicks(); clockTicks = CPUUpdateTicks();
cpuTotalTicks += clockTicks; cpuTotalTicks += clockTicks;
@ -4084,7 +3608,7 @@ void CPULoop(int ticks)
IF |= 1; IF |= 1;
UPDATE_REG(0x202, IF); UPDATE_REG(0x202, IF);
} }
cpuDmaHack2 = CPUCheckDMA(1, 0x0f); CPUCheckDMA(1, 0x0f);
if(frameCount >= framesToSkip) { if(frameCount >= framesToSkip) {
systemDrawScreen(); systemDrawScreen();
frameCount = 0; frameCount = 0;
@ -4204,7 +3728,7 @@ void CPULoop(int ticks)
DISPSTAT |= 2; DISPSTAT |= 2;
UPDATE_REG(0x04, DISPSTAT); UPDATE_REG(0x04, DISPSTAT);
lcdTicks += 224; lcdTicks += 224;
cpuDmaHack2 = CPUCheckDMA(2, 0x0f); CPUCheckDMA(2, 0x0f);
if(DISPSTAT & 16) { if(DISPSTAT & 16) {
IF |= 2; IF |= 2;
UPDATE_REG(0x202, IF); UPDATE_REG(0x202, IF);
@ -4367,7 +3891,7 @@ void CPULoop(int ticks)
goto updateLoop; goto updateLoop;
} }
#ifdef LINK_EMULATION #ifdef LINK_EMULATION
if(linkenable && cpuDmaHack2) if(linkenable)
cpuNextEvent = 1; cpuNextEvent = 1;
#endif #endif
if(IF && (IME & 1) && armIrqEnable) { if(IF && (IME & 1) && armIrqEnable) {

View File

@ -84,6 +84,7 @@ extern bool armState;
extern int armMode; extern int armMode;
extern void (*cpuSaveGameFunc)(u32,u8); extern void (*cpuSaveGameFunc)(u32,u8);
#ifdef BKPT_SUPPORT
extern u8 freezeWorkRAM[0x40000]; extern u8 freezeWorkRAM[0x40000];
extern u8 freezeInternalRAM[0x8000]; extern u8 freezeInternalRAM[0x8000];
extern u8 freezeVRAM[0x18000]; extern u8 freezeVRAM[0x18000];
@ -92,6 +93,7 @@ extern u8 freezePRAM[0x400];
extern bool debugger_last; extern bool debugger_last;
extern int oldreg[17]; extern int oldreg[17];
extern char oldbuffer[10]; extern char oldbuffer[10];
#endif
extern bool CPUReadGSASnapshot(const char *); extern bool CPUReadGSASnapshot(const char *);
extern bool CPUWriteGSASnapshot(const char *, const char *, const char *, 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 doMirroring(bool);
extern void CPUUpdateRegister(u32, u16); extern void CPUUpdateRegister(u32, u16);
extern void applyTimer (); extern void applyTimer ();
extern void CPUWriteHalfWord(u32, u16);
extern void CPUWriteByte(u32, u8);
extern void CPUInit(const char *,bool); extern void CPUInit(const char *,bool);
extern void CPUReset(); extern void CPUReset();
extern void CPULoop(int); extern void CPULoop(int);
extern bool CPUCheckDMA(int,int); extern void CPUCheckDMA(int,int);
extern bool CPUIsGBAImage(const char *); extern bool CPUIsGBAImage(const char *);
extern bool CPUIsZipFile(const char *); extern bool CPUIsZipFile(const char *);
#ifdef PROFILING #ifdef PROFILING

302
src/GBAcpu.h Normal file
View File

@ -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

View File

@ -23,6 +23,15 @@
#include "System.h" #include "System.h"
#include "Port.h" #include "Port.h"
#include "RTC.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 cpuSramEnabled;
extern bool cpuFlashEnabled; extern bool cpuFlashEnabled;
@ -34,7 +43,6 @@ extern bool linkenable;
extern void LinkSStop(void); extern void LinkSStop(void);
#endif /* LINK_EMULATION */ #endif /* LINK_EMULATION */
extern bool cpuDmaHack; extern bool cpuDmaHack;
extern bool cpuDmaHack2;
extern u32 cpuDmaLast; extern u32 cpuDmaLast;
extern bool timer0On; extern bool timer0On;
extern int timer0Ticks; extern int timer0Ticks;
@ -150,7 +158,7 @@ static inline u32 CPUReadMemory(u32 address)
} }
#endif #endif
if(cpuDmaHack || cpuDmaHack2) { if(cpuDmaHack) {
value = cpuDmaLast; value = cpuDmaLast;
} else { } else {
if(armState) { if(armState) {
@ -292,7 +300,7 @@ static inline u32 CPUReadHalfWord(u32 address)
armNextPC - 4 : armNextPC - 2); armNextPC - 4 : armNextPC - 2);
} }
#endif #endif
if(cpuDmaHack2 || cpuDmaHack) { if(cpuDmaHack) {
value = cpuDmaLast & 0xFFFF; value = cpuDmaLast & 0xFFFF;
} else { } else {
if(armState) { if(armState) {
@ -392,7 +400,7 @@ static inline u8 CPUReadByte(u32 address)
armNextPC - 4 : armNextPC - 2); armNextPC - 4 : armNextPC - 2);
} }
#endif #endif
if(cpuDmaHack || cpuDmaHack2) { if(cpuDmaHack) {
return cpuDmaLast & 0xFF; return cpuDmaLast & 0xFF;
} else { } else {
if(armState) { 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 #endif //VBA_GBAinline_H

View File

@ -949,13 +949,13 @@ void soundChannel4()
} }
extern bool cpuDmaHack2;
void soundDirectSoundATimer() void soundDirectSoundATimer()
{ {
if(soundDSAEnabled) { if(soundDSAEnabled) {
if(soundDSFifoACount <= 16) { if(soundDSFifoACount <= 16) {
cpuDmaHack2 = CPUCheckDMA(3, 2); CPUCheckDMA(3, 2);
if(soundDSFifoACount <= 16) { if(soundDSFifoACount <= 16) {
soundEvent(FIFOA_L, (u16)0); soundEvent(FIFOA_L, (u16)0);
soundEvent(FIFOA_H, (u16)0); soundEvent(FIFOA_H, (u16)0);
@ -989,7 +989,7 @@ void soundDirectSoundBTimer()
{ {
if(soundDSBEnabled) { if(soundDSBEnabled) {
if(soundDSFifoBCount <= 16) { if(soundDSFifoBCount <= 16) {
cpuDmaHack2 = CPUCheckDMA(3, 4); CPUCheckDMA(3, 4);
if(soundDSFifoBCount <= 16) { if(soundDSFifoBCount <= 16) {
soundEvent(FIFOB_L, (u16)0); soundEvent(FIFOB_L, (u16)0);
soundEvent(FIFOB_H, (u16)0); soundEvent(FIFOB_H, (u16)0);

View File

@ -26,7 +26,7 @@
#include "../System.h" #include "../System.h"
#include "../GBA.h" #include "../GBA.h"
#include "../Globals.h" #include "../Globals.h"
#include "../GBAinline.h"
#include "IOViewerRegs.h" #include "IOViewerRegs.h"
#ifdef _DEBUG #ifdef _DEBUG