Compare commits

...

6 Commits

Author SHA1 Message Date
oltolm
c7a53703b1 iR5900: fix heap-buffer-overflow in recompileNextInstruction 2024-08-10 17:47:39 -04:00
JordanTheToaster
2151ffcb6a GameDB: Various fixes 2024-08-10 22:21:46 +02:00
TheLastRar
e25cb92041 Build: Copy resources when building for ARM64 with MSBuild 2024-08-10 14:12:28 -04:00
TheLastRar
c3ed4faec1 gitignore: Fix ignore of bin-arm64
Reverts 2d4313cc5b and provides a correct ignore entry
2024-08-10 14:12:28 -04:00
TheLastRar
01de02677f Build: Set Page/Cache line sizes on Windows ARM 2024-08-10 14:12:28 -04:00
TheLastRar
6c44e985b1 Core: Replace 'Mac' with 'system' in page size error message 2024-08-10 14:12:28 -04:00
9 changed files with 100 additions and 34 deletions

62
.gitignore vendored
View File

@@ -63,35 +63,39 @@ oprofile_data/
*.kdev4
/.kdev4*
/bin*/**/*.dll
/bin*/**/*.dmp
/bin*/**/*.exp
/bin*/**/*.ilk
/bin*/**/*.lib
/bin*/**/*.pdb
/bin*/pcsx2*
/bin*/qt.conf
/bin*/bios
/bin*/cache
/bin*/cheats
/bin*/patches
/bin*/covers
/bin*/dumps
/bin*/gamesettings
/bin*/help
/bin*/inis
/bin*/inis/debuggersettings
/bin*/logs
/bin*/memcards
/bin*/plugins
/bin*/snaps
/bin*/sstates
/bin*/textures
/bin*/translations
/bin*/inputprofiles
/bin*/videos
/bin*/portable.ini
/bin*/portable.txt
# Resources and docs in /bin are tracked
/bin/**/*.dll
/bin/**/*.dmp
/bin/**/*.exp
/bin/**/*.ilk
/bin/**/*.lib
/bin/**/*.pdb
/bin/pcsx2*
/bin/qt.conf
/bin/bios
/bin/cache
/bin/cheats
/bin/patches
/bin/covers
/bin/dumps
/bin/gamesettings
/bin/help
/bin/inis
/bin/inis/debuggersettings
/bin/logs
/bin/memcards
/bin/plugins
/bin/snaps
/bin/sstates
/bin/textures
/bin/translations
/bin/inputprofiles
/bin/videos
/bin/portable.ini
/bin/portable.txt
# Resources and docs copied from /bin
/bin-arm64
# Manually added by user.
/bin/resources/patches.zip

View File

@@ -12079,6 +12079,8 @@ SLAJ-25018:
SLAJ-25019:
name: "The Lord of the Rings - The Return of the King"
region: "NTSC-C"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLAJ-25023:
name: "Shin Sangoku Musou 3 - Moushouden"
region: "NTSC-Unk"
@@ -13236,10 +13238,10 @@ SLES-50024:
name: "NBA Live 2001"
region: "PAL-G"
SLES-50025:
name: "NBA 2001"
name: "NBA Live 2001"
region: "PAL-I"
SLES-50026:
name: "NBA 2001"
name: "NBA Live 2001"
region: "PAL-S"
SLES-50027:
name: "NHL 2001"
@@ -13249,7 +13251,7 @@ SLES-50028:
region: "PAL-G"
SLES-50029:
name: "NHL 2001"
region: "PAL-F"
region: "PAL-M2"
SLES-50030:
name: "SSX"
region: "PAL-M3"
@@ -17975,18 +17977,28 @@ SLES-52017:
name-sort: "Lord of the Rings, The - Return of the King"
region: "PAL-M5"
compat: 5
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLES-52018:
name: "Herr der Ringe, Der - Die Rückkehr des Königs"
region: "PAL-G"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLES-52019:
name: "Seigneur des Anneaux, Le - Le Retour du roi"
region: "PAL-F"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLES-52020:
name: "Señor de Los Anillos, El - El Retorno del Rey"
region: "PAL-S"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLES-52021:
name: "Signore degli Anelli, Il - Il Ritorno del Re"
region: "PAL-I"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLES-52022:
name: "Total Club Manager 2004"
region: "PAL-M4"
@@ -29243,6 +29255,8 @@ SLKA-25098:
name: "The Lord of the Rings - The Return of the King"
name-sort: "Lord of the Rings, The - The Return of the King"
region: "NTSC-K"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLKA-25099:
name: "The Urbz - Sims in the City"
region: "NTSC-K"
@@ -39691,6 +39705,8 @@ SLPM-65503:
name-en: "Lord of the Rings, The - The Return of the King"
region: "NTSC-J"
compat: 5
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLPM-65504:
name: "COOL GIRL 初回限定版 [ディスク1/2]"
name-sort: "COOL GIRL しょかいげんていばん [でぃすく1/2]"
@@ -40890,6 +40906,8 @@ SLPM-65727:
name-sort: "ろーど おぶ ざ りんぐ おうのきかん [EA BEST HITS]"
name-en: "Lord of the Rings, The - The Return of the King [EA Best Hits]"
region: "NTSC-J"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLPM-65728:
name: "ホビットの冒険 ロード オブ ザ リング はじまりの物語"
name-sort: "ほびっとのぼうけん ろーど おぶ ざ りんぐ はじまりのものがたり"
@@ -61992,6 +62010,8 @@ SLUS-20770:
name: "The Lord of the Rings - The Return of the King"
name-sort: "Lord of the Rings, The - The Return of the King"
region: "NTSC-U"
clampModes:
vu1ClampMode: 3 # Fixes broken skybox and missing textures.
SLUS-20771:
name: "NCAA March Madness 2004"
region: "NTSC-U"

View File

@@ -116,6 +116,13 @@ elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64" OR "${CMAKE_HOST_SYSTEM
detect_cache_line_size()
list(APPEND PCSX2_DEFS OVERRIDE_HOST_CACHE_LINE_SIZE=${HOST_CACHE_LINE_SIZE})
endif()
# Windows page/cache line size seems to match x68-64
if(WIN32)
list(APPEND PCSX2_DEFS OVERRIDE_HOST_PAGE_SIZE=0x1000)
# Value of std::hardware_destructive_interference_size for ARM64 on MSVC toolset 14.40.33807
list(APPEND PCSX2_DEFS OVERRIDE_HOST_CACHE_LINE_SIZE=64)
endif()
else()
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copy resources for ARM -->
<ItemGroup>
<BinRes Include="$(SolutionDir)bin\resources\**\*" />
</ItemGroup>
<ItemGroup>
<BinDocs Include="$(SolutionDir)bin\docs\**\*" />
</ItemGroup>
<Target Name="CopyBinResources"
AfterTargets="Build"
Inputs="@(BinRes)"
Outputs="@(BinRes -> '$(OutDir)resources\%(RecursiveDir)%(Filename)%(Extension)')">
<Message Text="Copying Resources" Importance="High" />
<Copy
SourceFiles="@(BinRes)"
DestinationFolder="$(OutDir)resources\%(RecursiveDir)"
SkipUnchangedFiles="true"
/>
</Target>
<Target Name="CopyBinDocs"
AfterTargets="Build"
Inputs="@(BinDocs)"
Outputs="@(BinDocs -> '$(OutDir)docs\%(RecursiveDir)%(Filename)%(Extension)')">
<Message Text="Copying Docs" Importance="High" />
<Copy
SourceFiles="@(BinDocs)"
DestinationFolder="$(OutDir)docs\%(RecursiveDir)"
SkipUnchangedFiles="true"
/>
</Target>
</Project>

View File

@@ -29,6 +29,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories);$(DepsIncludeDir)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;NOMINMAX;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;WINVER=0x0A00;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='ARM64'">OVERRIDE_HOST_PAGE_SIZE=0x1000;OVERRIDE_HOST_CACHE_LINE_SIZE=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -22,6 +22,7 @@
<Import Project="$(SolutionDir)common\vsprops\BaseProperties.props" />
<Import Project="$(SolutionDir)common\vsprops\GenerateSCMVersion.props" />
<Import Project="$(SolutionDir)common\vsprops\LinkPCSX2Deps.props" />
<Import Condition="'$(Platform)'=='ARM64'" Project="$(SolutionDir)common\vsprops\CopyResources.props" />
<Import Condition="$(Configuration.Contains(Debug))" Project="$(SolutionDir)common\vsprops\CodeGen_Debug.props" />
<Import Condition="$(Configuration.Contains(Devel))" Project="$(SolutionDir)common\vsprops\CodeGen_Devel.props" />
<Import Condition="$(Configuration.Contains(Release))" Project="$(SolutionDir)common\vsprops\CodeGen_Release.props" />

View File

@@ -23,6 +23,7 @@
<Import Project="$(SolutionDir)common\vsprops\GenerateSCMVersion.props" />
<Import Project="$(SolutionDir)common\vsprops\QtCompile.props" />
<Import Project="$(SolutionDir)common\vsprops\LinkPCSX2Deps.props" />
<Import Condition="'$(Platform)'=='ARM64'" Project="$(SolutionDir)common\vsprops\CopyResources.props" />
<Import Condition="$(Configuration.Contains(Debug))" Project="$(SolutionDir)common\vsprops\CodeGen_Debug.props" />
<Import Condition="$(Configuration.Contains(Devel))" Project="$(SolutionDir)common\vsprops\CodeGen_Devel.props" />
<Import Condition="$(Configuration.Contains(Release))" Project="$(SolutionDir)common\vsprops\CodeGen_Release.props" />

View File

@@ -233,7 +233,7 @@ bool VMManager::PerformEarlyHardwareChecks(const char** error)
const size_t runtime_host_page_size = HostSys::GetRuntimePageSize();
if (__pagesize != runtime_host_page_size)
{
*error = "Page size mismatch. This build cannot run on your Mac.\n\n" COMMON_DOWNLOAD_MESSAGE;
*error = "Page size mismatch. This build cannot run on your system.\n\n" COMMON_DOWNLOAD_MESSAGE;
return false;
}
#endif

View File

@@ -1707,7 +1707,7 @@ void recompileNextInstruction(bool delayslot, bool swapped_delay_slot)
g_pCurInstInfo++;
// pc might be past s_nEndBlock if the last instruction in the block is a DI.
if (pc <= s_nEndBlock)
if (pc <= s_nEndBlock && (g_pCurInstInfo + (s_nEndBlock - pc) / 4 + 1) <= s_pInstCache + s_nInstCacheSize)
{
int count;
for (u32 i = 0; i < iREGCNT_GPR; ++i)