From 0c078049c015f680b6e7773b994ab576c5eff76c Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 26 Sep 2022 12:53:14 +0930 Subject: [PATCH] Android: Update android build --- Android/build.gradle | 2 +- Android/jni/3rdParty/png/build.gradle | 2 +- Android/jni/3rdParty/zlib/build.gradle | 2 +- Android/jni/Common/build.gradle | 2 +- Android/jni/Plugin-Input/build.gradle | 2 +- Android/jni/Plugin-RspHle/build.gradle | 2 +- Android/jni/Project64-audio/build.gradle | 2 +- Android/jni/Project64-bridge/build.gradle | 2 +- Android/jni/Project64-core/CMakeLists.txt | 5 + Android/jni/Project64-core/build.gradle | 2 +- Android/jni/Project64-video/build.gradle | 2 +- Android/jni/Settings/build.gradle | 2 +- Source/Android/Bridge/Notification.cpp | 2 +- Source/Project64-audio/AudioMain.cpp | 2 +- .../Aarch64/Aarch64RecompilerOps.cpp | 895 ++++++++++++++++++ .../Recompiler/Aarch64/Aarch64RecompilerOps.h | 236 +++++ .../Recompiler/Aarch64/Aarch64RegInfo.cpp | 29 +- .../Recompiler/Aarch64/Aarch64RegInfo.h | 12 +- .../Recompiler/Aarch64/Aarch64ops.cpp | 11 + .../N64System/Recompiler/Aarch64/Aarch64ops.h | 19 + .../N64System/Recompiler/Aarch64/stdafx.h | 1 + .../N64System/Recompiler/Arm/ArmOps.h | 3 +- .../Recompiler/Arm/ArmRecompilerOps.cpp | 161 ++-- .../N64System/Recompiler/RecompilerOps.h | 4 + .../N64System/Recompiler/x86/x86ops.cpp | 4 +- Source/Project64-core/Project64-core.vcxproj | 5 + .../Project64-core.vcxproj.filters | 18 + Source/Project64-plugin-spec/Audio.h | 2 +- Source/Project64-plugin-spec/Video.h | 2 +- 29 files changed, 1333 insertions(+), 100 deletions(-) create mode 100644 Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.cpp create mode 100644 Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.h create mode 100644 Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.cpp create mode 100644 Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.h create mode 100644 Source/Project64-core/N64System/Recompiler/Aarch64/stdafx.h diff --git a/Android/build.gradle b/Android/build.gradle index 63f420a16..30ae637d2 100644 --- a/Android/build.gradle +++ b/Android/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath "com.android.tools.build:gradle:4.2.1" + classpath 'com.android.tools.build:gradle:7.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/Android/jni/3rdParty/png/build.gradle b/Android/jni/3rdParty/png/build.gradle index 729d6173e..eb642a43d 100644 --- a/Android/jni/3rdParty/png/build.gradle +++ b/Android/jni/3rdParty/png/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/3rdParty/zlib/build.gradle b/Android/jni/3rdParty/zlib/build.gradle index 729d6173e..eb642a43d 100644 --- a/Android/jni/3rdParty/zlib/build.gradle +++ b/Android/jni/3rdParty/zlib/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Common/build.gradle b/Android/jni/Common/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Common/build.gradle +++ b/Android/jni/Common/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Plugin-Input/build.gradle b/Android/jni/Plugin-Input/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Plugin-Input/build.gradle +++ b/Android/jni/Plugin-Input/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Plugin-RspHle/build.gradle b/Android/jni/Plugin-RspHle/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Plugin-RspHle/build.gradle +++ b/Android/jni/Plugin-RspHle/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Project64-audio/build.gradle b/Android/jni/Project64-audio/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Project64-audio/build.gradle +++ b/Android/jni/Project64-audio/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Project64-bridge/build.gradle b/Android/jni/Project64-bridge/build.gradle index d2f846f4a..e93d9dc73 100644 --- a/Android/jni/Project64-bridge/build.gradle +++ b/Android/jni/Project64-bridge/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Project64-core/CMakeLists.txt b/Android/jni/Project64-core/CMakeLists.txt index 4acfa4075..36f84710c 100644 --- a/Android/jni/Project64-core/CMakeLists.txt +++ b/Android/jni/Project64-core/CMakeLists.txt @@ -57,10 +57,15 @@ add_library(Project64-core STATIC N64System/Recompiler/Recompiler.cpp N64System/Recompiler/RecompilerMemory.cpp N64System/Recompiler/RegBase.cpp + N64System/Recompiler/Aarch64/Aarch64ops.cpp + N64System/Recompiler/Aarch64/Aarch64RecompilerOps.cpp N64System/Recompiler/Aarch64/Aarch64RegInfo.cpp N64System/Recompiler/Arm/ArmOps.cpp N64System/Recompiler/Arm/ArmRecompilerOps.cpp N64System/Recompiler/Arm/ArmRegInfo.cpp + N64System/Recompiler/x64-86/x64ops.cpp + N64System/Recompiler/x64-86/x64RecompilerOps.cpp + N64System/Recompiler/x64-86/x64RegInfo.cpp N64System/Recompiler/x86/x86ops.cpp N64System/Recompiler/x86/x86RecompilerOps.cpp N64System/Recompiler/x86/x86RegInfo.cpp diff --git a/Android/jni/Project64-core/build.gradle b/Android/jni/Project64-core/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Project64-core/build.gradle +++ b/Android/jni/Project64-core/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Project64-video/build.gradle b/Android/jni/Project64-video/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Project64-video/build.gradle +++ b/Android/jni/Project64-video/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Android/jni/Settings/build.gradle b/Android/jni/Settings/build.gradle index 38dab2657..c4b7a750a 100644 --- a/Android/jni/Settings/build.gradle +++ b/Android/jni/Settings/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version "3.22.1" path "CMakeLists.txt" } } diff --git a/Source/Android/Bridge/Notification.cpp b/Source/Android/Bridge/Notification.cpp index 859e901b2..0f221b51f 100644 --- a/Source/Android/Bridge/Notification.cpp +++ b/Source/Android/Bridge/Notification.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index d3e3c75dd..2dc782205 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -122,7 +122,7 @@ EXPORT void CALL AiDacrateChanged(int SystemType) BufferSize = (Frequency / divider) + 3 & ~0x3; - if (hack == 'BH' && SystemType != SYSTEM_PAL) BufferSize -= 16; + if (hack == 0x4248 /*BH*/ && SystemType != SYSTEM_PAL) BufferSize -= 16; g_SoundDriver->AI_SetFrequency(Frequency, BufferSize); } diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.cpp new file mode 100644 index 000000000..9b1a8801f --- /dev/null +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.cpp @@ -0,0 +1,895 @@ +#include "stdafx.h" +#if defined(__aarch64__) + +#include +#include + +CAarch64RecompilerOps::CAarch64RecompilerOps(CMipsMemoryVM & /*MMU*/, CCodeBlock & CodeBlock) : + m_Assembler(CodeBlock), + m_RegWorkingSet(CodeBlock, m_Assembler) +{ +} + +CAarch64RecompilerOps::~CAarch64RecompilerOps() +{ +} + +void CAarch64RecompilerOps::Compile_TrapCompare(RecompilerTrapCompare /*CompareType*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::Compile_BranchCompare(RecompilerBranchCompare /*CompareType*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::Compile_Branch(RecompilerBranchCompare /*CompareType*/, bool /*Link*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::Compile_BranchLikely(RecompilerBranchCompare /*CompareType*/, bool /*Link*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::BNE_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::BEQ_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::BGTZ_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::BLEZ_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::BLTZ_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::BGEZ_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_BCF_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_BCT_Compare() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::J() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::JAL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::ADDI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::ADDIU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SLTI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SLTIU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::ANDI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::ORI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::XORI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LUI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::DADDI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::DADDIU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LDL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LDR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LB() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LH() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LWL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LW() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LBU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LHU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LWR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LWU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SB() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SH() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SWL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SW() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SWR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SDL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SDR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CACHE() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LWC1() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LDC1() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::LD() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SC() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SWC1() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SDC1() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SD() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SLL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SRL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SRA() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SLLV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SRLV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SRAV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_JR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_JALR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SYSCALL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_MFLO() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_MTLO() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_MFHI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_MTHI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSLLV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSRLV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSRAV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_MULT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_MULTU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DIV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DIVU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DMULT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DMULTU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DDIV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DDIVU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_ADD() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_ADDU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SUB() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SUBU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_AND() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_OR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_XOR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_NOR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SLT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_SLTU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DADD() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DADDU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSUB() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSUBU() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSLL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSRL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSRA() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSLL32() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSRL32() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SPECIAL_DSRA32() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_MF() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_MT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_CO_TLBR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_CO_TLBWI() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_CO_TLBWR() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_CO_TLBP() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP0_CO_ERET() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_MF() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_DMF() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_CF() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_MT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_DMT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_CT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_ADD() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_SUB() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_MUL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_DIV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_ABS() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_NEG() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_SQRT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_MOV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_ROUND_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_TRUNC_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_CEIL_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_FLOOR_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_ROUND_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_TRUNC_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_CEIL_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_FLOOR_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_CVT_D() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_CVT_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_CVT_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_S_CMP() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_ADD() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_SUB() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_MUL() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_DIV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_ABS() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_NEG() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_SQRT() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_MOV() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_ROUND_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_TRUNC_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_CEIL_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_FLOOR_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_ROUND_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_TRUNC_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_CEIL_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_FLOOR_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_CVT_S() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_CVT_W() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_CVT_L() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_D_CMP() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_W_CVT_S() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_W_CVT_D() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_L_CVT_S() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::COP1_L_CVT_D() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::UnknownOpcode() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::EnterCodeBlock() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CompileExitCode() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CompileInPermLoop(CRegInfo & /*RegSet*/, uint32_t /*ProgramCounter*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SyncRegState(const CRegInfo & /*SyncTo*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +CRegInfo & CAarch64RecompilerOps::GetRegWorkingSet(void) +{ + return m_RegWorkingSet; +} + +void CAarch64RecompilerOps::SetRegWorkingSet(const CRegInfo & /*RegInfo*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +bool CAarch64RecompilerOps::InheritParentInfo() +{ + g_Notify->BreakPoint(__FILE__, __LINE__); + return false; +} + +void CAarch64RecompilerOps::LinkJump(CJumpInfo & /*JumpInfo*/, uint32_t /*SectionID*/, uint32_t /*FromSectionID*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::JumpToSection(CCodeSection * /*Section*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::JumpToUnknown(CJumpInfo * /*JumpInfo*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SetCurrentPC(uint32_t /*ProgramCounter*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +uint32_t CAarch64RecompilerOps::GetCurrentPC(void) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); + return 0; +} + +void CAarch64RecompilerOps::SetCurrentSection(CCodeSection * /*section*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::SetNextStepType(PIPELINE_STAGE /*StepType*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +PIPELINE_STAGE CAarch64RecompilerOps::GetNextStepType(void) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); + return PIPELINE_STAGE_NORMAL; +} + +const R4300iOpcode & CAarch64RecompilerOps::GetOpcode(void) const +{ + return m_Opcode; +} + +void CAarch64RecompilerOps::PreCompileOpcode(void) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::PostCompileOpcode(void) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CompileExit(uint32_t /*JumpPC*/, uint32_t /*TargetPC*/, CRegInfo & /*ExitRegSet*/, ExitReason /*reason*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::UpdateCounters(CRegInfo & /*RegSet*/, bool /*CheckTimer*/, bool /*ClearValues*/, bool /*UpdateTimer*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CompileSystemCheck(uint32_t /*TargetPC*/, const CRegInfo & /*RegSet*/) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CompileExecuteBP(void) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +void CAarch64RecompilerOps::CompileExecuteDelaySlotBP(void) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + +#endif \ No newline at end of file diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.h b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.h new file mode 100644 index 000000000..40f015bc6 --- /dev/null +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RecompilerOps.h @@ -0,0 +1,236 @@ +#pragma once +#if defined(__aarch64__) + +#include +#include +#include +#include +#include + +class CMipsMemoryVM; +class CCodeBlock; +class CCodeSection; +class CAarch64Ops; +struct CJumpInfo; + +class CAarch64RecompilerOps +{ +public: + CAarch64RecompilerOps(CMipsMemoryVM & MMU, CCodeBlock & CodeBlock); + ~CAarch64RecompilerOps(); + + // Trap functions + void Compile_TrapCompare(RecompilerTrapCompare CompareType); + + // Branch functions + void Compile_BranchCompare(RecompilerBranchCompare CompareType); + void Compile_Branch(RecompilerBranchCompare CompareType, bool Link); + void Compile_BranchLikely(RecompilerBranchCompare CompareType, bool Link); + void BNE_Compare(); + void BEQ_Compare(); + void BGTZ_Compare(); + void BLEZ_Compare(); + void BLTZ_Compare(); + void BGEZ_Compare(); + void COP1_BCF_Compare(); + void COP1_BCT_Compare(); + + // Opcode functions + void J(); + void JAL(); + void ADDI(); + void ADDIU(); + void SLTI(); + void SLTIU(); + void ANDI(); + void ORI(); + void XORI(); + void LUI(); + void DADDI(); + void DADDIU(); + void LDL(); + void LDR(); + void LB(); + void LH(); + void LWL(); + void LW(); + void LBU(); + void LHU(); + void LWR(); + void LWU(); + void SB(); + void SH(); + void SWL(); + void SW(); + void SWR(); + void SDL(); + void SDR(); + void CACHE(); + void LL(); + void LWC1(); + void LDC1(); + void LD(); + void SC(); + void SWC1(); + void SDC1(); + void SD(); + + // R4300i opcodes: Special + void SPECIAL_SLL(); + void SPECIAL_SRL(); + void SPECIAL_SRA(); + void SPECIAL_SLLV(); + void SPECIAL_SRLV(); + void SPECIAL_SRAV(); + void SPECIAL_JR(); + void SPECIAL_JALR(); + void SPECIAL_SYSCALL(); + void SPECIAL_MFLO(); + void SPECIAL_MTLO(); + void SPECIAL_MFHI(); + void SPECIAL_MTHI(); + void SPECIAL_DSLLV(); + void SPECIAL_DSRLV(); + void SPECIAL_DSRAV(); + void SPECIAL_MULT(); + void SPECIAL_MULTU(); + void SPECIAL_DIV(); + void SPECIAL_DIVU(); + void SPECIAL_DMULT(); + void SPECIAL_DMULTU(); + void SPECIAL_DDIV(); + void SPECIAL_DDIVU(); + void SPECIAL_ADD(); + void SPECIAL_ADDU(); + void SPECIAL_SUB(); + void SPECIAL_SUBU(); + void SPECIAL_AND(); + void SPECIAL_OR(); + void SPECIAL_XOR(); + void SPECIAL_NOR(); + void SPECIAL_SLT(); + void SPECIAL_SLTU(); + void SPECIAL_DADD(); + void SPECIAL_DADDU(); + void SPECIAL_DSUB(); + void SPECIAL_DSUBU(); + void SPECIAL_DSLL(); + void SPECIAL_DSRL(); + void SPECIAL_DSRA(); + void SPECIAL_DSLL32(); + void SPECIAL_DSRL32(); + void SPECIAL_DSRA32(); + + // COP0 functions + void COP0_MF(); + void COP0_MT(); + + // COP0 CO functions + void COP0_CO_TLBR(); + void COP0_CO_TLBWI(); + void COP0_CO_TLBWR(); + void COP0_CO_TLBP(); + void COP0_CO_ERET(); + + // COP1 functions + void COP1_MF(); + void COP1_DMF(); + void COP1_CF(); + void COP1_MT(); + void COP1_DMT(); + void COP1_CT(); + + // COP1: S functions + void COP1_S_ADD(); + void COP1_S_SUB(); + void COP1_S_MUL(); + void COP1_S_DIV(); + void COP1_S_ABS(); + void COP1_S_NEG(); + void COP1_S_SQRT(); + void COP1_S_MOV(); + void COP1_S_ROUND_L(); + void COP1_S_TRUNC_L(); + void COP1_S_CEIL_L(); + void COP1_S_FLOOR_L(); + void COP1_S_ROUND_W(); + void COP1_S_TRUNC_W(); + void COP1_S_CEIL_W(); + void COP1_S_FLOOR_W(); + void COP1_S_CVT_D(); + void COP1_S_CVT_W(); + void COP1_S_CVT_L(); + void COP1_S_CMP(); + + // COP1: D functions + void COP1_D_ADD(); + void COP1_D_SUB(); + void COP1_D_MUL(); + void COP1_D_DIV(); + void COP1_D_ABS(); + void COP1_D_NEG(); + void COP1_D_SQRT(); + void COP1_D_MOV(); + void COP1_D_ROUND_L(); + void COP1_D_TRUNC_L(); + void COP1_D_CEIL_L(); + void COP1_D_FLOOR_L(); + void COP1_D_ROUND_W(); + void COP1_D_TRUNC_W(); + void COP1_D_CEIL_W(); + void COP1_D_FLOOR_W(); + void COP1_D_CVT_S(); + void COP1_D_CVT_W(); + void COP1_D_CVT_L(); + void COP1_D_CMP(); + + // COP1: W functions + void COP1_W_CVT_S(); + void COP1_W_CVT_D(); + + // COP1: L functions + void COP1_L_CVT_S(); + void COP1_L_CVT_D(); + + // Other functions + void UnknownOpcode(); + + void EnterCodeBlock(); + void CompileExitCode(); + void CompileInPermLoop(CRegInfo & RegSet, uint32_t ProgramCounter); + void SyncRegState(const CRegInfo & SyncTo); + CRegInfo & GetRegWorkingSet(void); + void SetRegWorkingSet(const CRegInfo & RegInfo); + bool InheritParentInfo(); + void LinkJump(CJumpInfo & JumpInfo, uint32_t SectionID = -1, uint32_t FromSectionID = -1); + void JumpToSection(CCodeSection * Section); + void JumpToUnknown(CJumpInfo * JumpInfo); + void SetCurrentPC(uint32_t ProgramCounter); + uint32_t GetCurrentPC(void); + void SetCurrentSection(CCodeSection * section); + void SetNextStepType(PIPELINE_STAGE StepType); + PIPELINE_STAGE GetNextStepType(void); + const R4300iOpcode & GetOpcode(void) const; + void PreCompileOpcode(void); + void PostCompileOpcode(void); + void CompileExit(uint32_t JumpPC, uint32_t TargetPC, CRegInfo &ExitRegSet, ExitReason reason); + + void UpdateCounters(CRegInfo & RegSet, bool CheckTimer, bool ClearValues = false, bool UpdateTimer = true); + void CompileSystemCheck(uint32_t TargetPC, const CRegInfo & RegSet); + void CompileExecuteBP(void); + void CompileExecuteDelaySlotBP(void); + + CAarch64Ops & Assembler() { return m_Assembler; } + +private: + CAarch64RecompilerOps(const CAarch64RecompilerOps&); + CAarch64RecompilerOps& operator=(const CAarch64RecompilerOps&); + + CAarch64RegInfo m_RegWorkingSet; + CAarch64Ops m_Assembler; + R4300iOpcode m_Opcode; +}; + +typedef CAarch64RecompilerOps CRecompilerOps; + +#endif diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.cpp b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.cpp index caf81a23f..f895724a1 100644 --- a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.cpp @@ -1,11 +1,38 @@ +#include "stdafx.h" + #if defined(__aarch64__) #include -CAarch64RegInfo::CAarch64RegInfo() +CAarch64RegInfo::CAarch64RegInfo(CCodeBlock & /*CodeBlock*/, CAarch64Ops & /*Assembler*/) { } +CAarch64RegInfo::CAarch64RegInfo(const CAarch64RegInfo&) +{ + g_Notify->BreakPoint(__FILE__, __LINE__); +} + CAarch64RegInfo::~CAarch64RegInfo() { } + +CAarch64RegInfo& CAarch64RegInfo::operator=(const CAarch64RegInfo & right) +{ + CRegBase::operator=(right); + g_Notify->BreakPoint(__FILE__, __LINE__); + return *this; +} + +bool CAarch64RegInfo::operator==(const CAarch64RegInfo & /*right*/) const +{ + g_Notify->BreakPoint(__FILE__, __LINE__); + return false; +} + +bool CAarch64RegInfo::operator!=(const CAarch64RegInfo & /*right*/) const +{ + g_Notify->BreakPoint(__FILE__, __LINE__); + return false; +} + #endif diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.h b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.h index 0e9dbcaca..5c3a68fb0 100644 --- a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.h +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64RegInfo.h @@ -2,13 +2,21 @@ #if defined(__aarch64__) #include +class CCodeBlock; +class CAarch64Ops; + class CAarch64RegInfo : public CRegBase { public: - CAarch64RegInfo(); + CAarch64RegInfo(CCodeBlock & CodeBlock, CAarch64Ops & Assembler); + CAarch64RegInfo(const CAarch64RegInfo&); ~CAarch64RegInfo(); -private: + CAarch64RegInfo& operator=(const CAarch64RegInfo&); + + bool operator==(const CAarch64RegInfo& right) const; + bool operator!=(const CAarch64RegInfo& right) const; }; + #endif diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.cpp b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.cpp new file mode 100644 index 000000000..3bc57a793 --- /dev/null +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.cpp @@ -0,0 +1,11 @@ +#include "stdafx.h" +#if defined(__aarch64__) + +#include + +CAarch64Ops::CAarch64Ops(CCodeBlock & CodeBlock) : + m_CodeBlock(CodeBlock) +{ +} + +#endif \ No newline at end of file diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.h b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.h new file mode 100644 index 000000000..a145feedd --- /dev/null +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/Aarch64ops.h @@ -0,0 +1,19 @@ +#pragma once +#if defined(__aarch64__) + +class CCodeBlock; + +class CAarch64Ops +{ +public: + CAarch64Ops(CCodeBlock & CodeBlock); + +private: + CAarch64Ops(void); + CAarch64Ops(const CAarch64Ops&); + CAarch64Ops& operator=(const CAarch64Ops&); + + CCodeBlock & m_CodeBlock; +}; + +#endif diff --git a/Source/Project64-core/N64System/Recompiler/Aarch64/stdafx.h b/Source/Project64-core/N64System/Recompiler/Aarch64/stdafx.h new file mode 100644 index 000000000..8b696d0b1 --- /dev/null +++ b/Source/Project64-core/N64System/Recompiler/Aarch64/stdafx.h @@ -0,0 +1 @@ +#include "../stdafx.h" diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.h b/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.h index 61eba27d0..f549d1242 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.h +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.h @@ -206,7 +206,6 @@ public: void XorArmRegToArmReg(ArmReg DestReg, ArmReg SourceReg); void XorArmRegToArmReg(ArmReg DestReg, ArmReg SourceReg1, ArmReg SourceReg2); - void * GetAddressOf(int32_t value, ...); void SetJump8(uint8_t * Loc, uint8_t * JumpLoc); void SetJump20(uint32_t * Loc, uint32_t * JumpLoc); void FlushPopArmReg(void); @@ -215,6 +214,8 @@ public: uint32_t PushPopRegisterSize(uint16_t Registers); std::string PushPopRegisterList(uint16_t Registers); + static void * GetAddressOf(int32_t value, ...); + private: CArmOps(void); CArmOps(const CArmOps&); diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp index bb4f359f9..0f5ffe0ce 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp @@ -58,7 +58,7 @@ void CArmRecompilerOps::PreCompileOpcode(void) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1,m_CompilePC); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2,(uint32_t)&TestValue, "TestValue"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R1,CArmOps::Arm_R2,0); - CallFunction(AddressOf(&TestFunc), "TestFunc"); + m_Assembler.CallFunction(AddressOf(&TestFunc), "TestFunc"); m_RegWorkingSet.AfterCallDirect();*/ /*if ((m_CompilePC == 0x8027F564 || m_CompilePC == 0x8027F574) && m_PipelineStage == PIPELINE_STAGE_NORMAL) @@ -66,7 +66,7 @@ void CArmRecompilerOps::PreCompileOpcode(void) m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0,(uint32_t)&TestValue, "TestValue"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R1,CArmOps::Arm_R0,0); - CallFunction(AddressOf(&TestFunc), "TestFunc"); + m_Assembler.CallFunction(AddressOf(&TestFunc), "TestFunc"); m_RegWorkingSet.AfterCallDirect(); for (int32_t i = 1; i < 32; i++) @@ -81,7 +81,7 @@ void CArmRecompilerOps::PreCompileOpcode(void) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, (uint32_t)&g_Reg->m_PROGRAM_COUNTER, "PROGRAM_COUNTER"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R1, CArmOps::Arm_R2, 0); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_BaseSystem, "g_BaseSystem"); - CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); + m_Assembler.CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); m_RegWorkingSet.AfterCallDirect(); } }*/ @@ -94,7 +94,7 @@ void CArmRecompilerOps::PreCompileOpcode(void) if (g_SyncSystem) { m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_BaseSystem, "g_BaseSystem"); - CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); + m_Assembler.CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } }*/ m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp()); @@ -563,7 +563,10 @@ void CArmRecompilerOps::Compile_BranchLikely(RecompilerBranchCompare CompareType } LinkJump(m_Section->m_Cont); + g_Notify->BreakPoint(__FILE__, __LINE__); +#ifdef tofix CompileExit(m_CompilePC, m_CompilePC + 8, m_Section->m_Cont.RegSet, ExitReason_Normal, true, nullptr); +#endif return; } else @@ -1846,7 +1849,7 @@ void CArmRecompilerOps::J() m_Section->m_Jump.JumpPC = m_CompilePC; if (m_Section->m_JumpSection != nullptr) { - m_Section->m_Jump.BranchLabel.Format("Section_%d", ((CCodeSection *)m_Section->m_JumpSection)->m_SectionID); + m_Section->m_Jump.BranchLabel = stdstr_f("Section_%d", ((CCodeSection *)m_Section->m_JumpSection)->m_SectionID); } else { @@ -1892,7 +1895,7 @@ void CArmRecompilerOps::JAL() m_Section->m_Jump.JumpPC = m_CompilePC; if (m_Section->m_JumpSection != nullptr) { - m_Section->m_Jump.BranchLabel.Format("Section_%d", ((CCodeSection *)m_Section->m_JumpSection)->m_SectionID); + m_Section->m_Jump.BranchLabel = stdstr_f("Section_%d", ((CCodeSection *)m_Section->m_JumpSection)->m_SectionID); } else { @@ -2554,7 +2557,7 @@ void CArmRecompilerOps::CACHE() m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((int16_t)m_Opcode.offset)); m_Assembler.AddArmRegToArmReg(CArmOps::Arm_R1, CArmOps::Arm_R0, CArmOps::Arm_R1); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Recompiler, "g_Recompiler"); - CallFunction((void *)AddressOf(&CRecompiler::ClearRecompCode_Virt), "CRecompiler::ClearRecompCode_Virt"); + m_Assembler.CallFunction((void *)AddressOf(&CRecompiler::ClearRecompCode_Virt), "CRecompiler::ClearRecompCode_Virt"); m_RegWorkingSet.AfterCallDirect(); break; case 1: @@ -3991,13 +3994,13 @@ void CArmRecompilerOps::COP0_CO_TLBWR() m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp()); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_SystemTimer, "g_SystemTimer"); - CallFunction((void *)AddressOf(&CSystemTimer::UpdateTimers), "CSystemTimer::UpdateTimers"); + m_Assembler.CallFunction((void *)AddressOf(&CSystemTimer::UpdateTimers), "CSystemTimer::UpdateTimers"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, (uint32_t)true, "true"); m_Assembler.MoveVariableToArmReg(&g_Reg->RANDOM_REGISTER, "RANDOM_REGISTER", CArmOps::Arm_R1); m_Assembler.AndConstToArmReg(CArmOps::Arm_R1, CArmOps::Arm_R1, 0x1F); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_TLB, "g_TLB"); - CallFunction((void *)AddressOf(&CTLB::WriteEntry), "CTLB::WriteEntry"); + m_Assembler.CallFunction((void *)AddressOf(&CTLB::WriteEntry), "CTLB::WriteEntry"); m_RegWorkingSet.AfterCallDirect(); } @@ -4032,7 +4035,7 @@ void arm_compiler_COP0_CO_ERET() void CArmRecompilerOps::COP0_CO_ERET() { m_RegWorkingSet.WriteBackRegisters(); - CallFunction((void *)arm_compiler_COP0_CO_ERET, "arm_compiler_COP0_CO_ERET"); + m_Assembler.CallFunction((void *)arm_compiler_COP0_CO_ERET, "arm_compiler_COP0_CO_ERET"); UpdateCounters(m_RegWorkingSet, true, true); CompileExit(m_CompilePC, (uint32_t)-1, m_RegWorkingSet, ExitReason_Normal); @@ -4173,12 +4176,12 @@ void CArmRecompilerOps::COP1_S_MUL() CArmOps::ArmReg FprReg = Map_Variable(CArmRegInfo::VARIABLE_FPR); CArmOps::ArmReg TempReg = m_RegWorkingSet.Map_TempReg(CArmOps::Arm_Any, -1, false); m_Assembler.LoadArmRegPointerToArmReg(TempReg, FprReg, (uint8_t)(m_Opcode.fs << 2)); - LoadArmRegPointerToFloatReg(TempReg, CArmOps::Arm_S14, 0); + m_Assembler.LoadArmRegPointerToFloatReg(TempReg, CArmOps::Arm_S14, 0); m_Assembler.LoadArmRegPointerToArmReg(TempReg, FprReg, (uint8_t)(m_Opcode.ft << 2)); - LoadArmRegPointerToFloatReg(TempReg, CArmOps::Arm_S15, 0); - MulF32(CArmOps::Arm_S0, CArmOps::Arm_S14, CArmOps::Arm_S15); + m_Assembler.LoadArmRegPointerToFloatReg(TempReg, CArmOps::Arm_S15, 0); + m_Assembler.MulF32(CArmOps::Arm_S0, CArmOps::Arm_S14, CArmOps::Arm_S15); m_Assembler.LoadArmRegPointerToArmReg(TempReg, FprReg, (uint8_t)(m_Opcode.fd << 2)); - StoreFloatRegToArmRegPointer(CArmOps::Arm_S0, TempReg, 0); + m_Assembler.StoreFloatRegToArmRegPointer(CArmOps::Arm_S0, TempReg, 0); } void CArmRecompilerOps::COP1_S_DIV() @@ -4723,11 +4726,11 @@ void CArmRecompilerOps::UnknownOpcode() if (g_SyncSystem) { m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_BaseSystem, "g_BaseSystem"); - CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); + m_Assembler.CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } m_Assembler.MoveConstToVariable(m_Opcode.Value, &R4300iOp::m_Opcode.Value, "R4300iOp::m_Opcode.Value"); - CallFunction((void *)R4300iOp::UnknownOpcode, "R4300iOp::UnknownOpcode"); + m_Assembler.CallFunction((void *)R4300iOp::UnknownOpcode, "R4300iOp::UnknownOpcode"); ExitCodeBlock(); if (m_PipelineStage == PIPELINE_STAGE_NORMAL) { m_PipelineStage = PIPELINE_STAGE_END_BLOCK; } } @@ -4742,7 +4745,7 @@ void CArmRecompilerOps::ExitCodeBlock() if (g_SyncSystem) { m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_BaseSystem, "g_BaseSystem"); - CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); + m_Assembler.CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } PopArmReg(ArmPushPop_R2 | ArmPushPop_R3 | ArmPushPop_R4 | ArmPushPop_R5 | ArmPushPop_R6 | ArmPushPop_R7 | ArmPushPop_R8 | ArmPushPop_R9 | ArmPushPop_R10 | ArmPushPop_R11 | ArmPushPop_R12 | ArmPushPop_PC); } @@ -4781,15 +4784,15 @@ void CArmRecompilerOps::CompileInPermLoop(CRegInfo & RegSet, uint32_t ProgramCou m_Assembler.MoveConstToVariable(ProgramCounter, _PROGRAM_COUNTER, "PROGRAM_COUNTER"); RegSet.WriteBackRegisters(); UpdateCounters(RegSet, false, true); - CallFunction(AddressOf(CInterpreterCPU::InPermLoop), "CInterpreterCPU::InPermLoop"); + m_Assembler.CallFunction(AddressOf(CInterpreterCPU::InPermLoop), "CInterpreterCPU::InPermLoop"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_SystemTimer); - CallFunction(AddressOf(&CSystemTimer::TimerDone), "CSystemTimer::TimerDone"); + m_Assembler.CallFunction(AddressOf(&CSystemTimer::TimerDone), "CSystemTimer::TimerDone"); m_CodeBlock.Log("CompileSystemCheck 3"); CompileSystemCheck((uint32_t)-1, RegSet); if (g_SyncSystem) { m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_BaseSystem); - CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); + m_Assembler.CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } } @@ -5315,7 +5318,7 @@ void CArmRecompilerOps::CompileExit(uint32_t JumpPC, uint32_t TargetPC, CRegInfo bDelay = m_PipelineStage == PIPELINE_STAGE_JUMP || m_PipelineStage == PIPELINE_STAGE_DELAY_SLOT; m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)bDelay, bDelay ? "true" : "false"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg); - CallFunction(AddressOf(&CRegisters::DoSysCallException), "CRegisters::DoSysCallException"); + m_Assembler.CallFunction(AddressOf(&CRegisters::DoSysCallException), "CRegisters::DoSysCallException"); ExitCodeBlock(); break; case ExitReason_COP1Unuseable: @@ -5323,7 +5326,7 @@ void CArmRecompilerOps::CompileExit(uint32_t JumpPC, uint32_t TargetPC, CRegInfo m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, (uint32_t)1, "1"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)bDelay, bDelay ? "true" : "false"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg); - CallFunction(AddressOf(&CRegisters::DoCopUnusableException), "CRegisters::DoCopUnusableException"); + m_Assembler.CallFunction(AddressOf(&CRegisters::DoCopUnusableException), "CRegisters::DoCopUnusableException"); ExitCodeBlock(); break; case ExitReason_TLBReadMiss: @@ -5331,7 +5334,7 @@ void CArmRecompilerOps::CompileExit(uint32_t JumpPC, uint32_t TargetPC, CRegInfo m_Assembler.MoveVariableToArmReg(g_TLBLoadAddress, "g_TLBLoadAddress", CArmOps::Arm_R2); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)bDelay, bDelay ? "true" : "false"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg); - CallFunction(AddressOf(&CRegisters::DoTLBReadMiss), "CRegisters::DoTLBReadMiss"); + m_Assembler.CallFunction(AddressOf(&CRegisters::DoTLBReadMiss), "CRegisters::DoTLBReadMiss"); ExitCodeBlock(); break; case ExitReason_TLBWriteMiss: @@ -5376,7 +5379,7 @@ void CArmRecompilerOps::CompileSystemCheck(uint32_t TargetPC, const CRegInfo & R m_RegWorkingSet.WriteBackRegisters(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_SystemEvents, "g_SystemEvents"); - CallFunction(AddressOf(&CSystemEvents::ExecuteEvents), "CSystemEvents::ExecuteEvents"); + m_Assembler.CallFunction(AddressOf(&CSystemEvents::ExecuteEvents), "CSystemEvents::ExecuteEvents"); ExitCodeBlock(); m_CodeBlock.Log(""); @@ -5930,7 +5933,7 @@ void CArmRecompilerOps::UpdateSyncCPU(CRegInfo & RegSet, uint32_t Cycles) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, Cycles); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)g_SyncSystem, "g_SyncSystem"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_System); - CallFunction((void *)AddressOf(&CN64System::UpdateSyncCPU), "CN64System::UpdateSyncCPU"); + m_Assembler.CallFunction((void *)AddressOf(&CN64System::UpdateSyncCPU), "CN64System::UpdateSyncCPU"); RegSet.AfterCallDirect(); } @@ -5973,7 +5976,7 @@ void CArmRecompilerOps::UpdateCounters(CRegInfo & RegSet, bool CheckTimer, bool m_Assembler.BranchLabel8(CArmOps::ArmBranch_GreaterThanOrEqual, "Continue_From_Timer_Test"); RegSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_SystemTimer, "g_SystemTimer"); - CallFunction(AddressOf(&CSystemTimer::TimerDone), "CSystemTimer::TimerDone"); + m_Assembler.CallFunction(AddressOf(&CSystemTimer::TimerDone), "CSystemTimer::TimerDone"); RegSet.AfterCallDirect(); FlushPopArmReg(); @@ -5989,7 +5992,7 @@ void CArmRecompilerOps::CompileInterpterCall(void * Function, const char * Funct m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, m_Opcode.Value); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, (uint32_t)(void *)&R4300iOp::m_Opcode.Value, "&R4300iOp::m_Opcode.Value"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R1, CArmOps::Arm_R2, 0); - m_Assembler.CallFunction(Function, FunctionName); + m_Assembler.m_Assembler.CallFunction(Function, FunctionName); m_RegWorkingSet.AfterCallDirect(); } @@ -6002,7 +6005,7 @@ void CArmRecompilerOps::OverflowDelaySlot(bool TestTimer) if (g_SyncSystem) { m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_BaseSystem, "g_BaseSystem"); - CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); + m_Assembler.CallFunction(AddressOf(&CN64System::SyncSystem), "CN64System::SyncSystem"); } m_Assembler.MoveConstToVariable(PIPELINE_STAGE_JUMP, &g_System->m_PipelineStage, "g_System->m_PipelineStage"); @@ -6013,12 +6016,12 @@ void CArmRecompilerOps::OverflowDelaySlot(bool TestTimer) } m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, g_System->CountPerOp()); - CallFunction((void *)CInterpreterCPU::ExecuteOps, "CInterpreterCPU::ExecuteOps"); + m_Assembler.CallFunction((void *)CInterpreterCPU::ExecuteOps, "CInterpreterCPU::ExecuteOps"); if (g_System->bFastSP() && g_Recompiler) { m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Recompiler); - CallFunction(AddressOf(&CRecompiler::ResetMemoryStackPos), "CRecompiler::ResetMemoryStackPos"); + m_Assembler.CallFunction(AddressOf(&CRecompiler::ResetMemoryStackPos), "CRecompiler::ResetMemoryStackPos"); } if (g_SyncSystem) { @@ -6113,7 +6116,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) PushImm32(Value); PushImm32(PAddr & 0x1FFFFFFF);*/ m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(MemoryHandler *)&g_MMU->m_SPRegistersHandler, "(MemoryHandler *)g_MMU->m_SPRegistersHandler"); - CallFunction((void *)((long**)(MemoryHandler *)&g_MMU->m_SPRegistersHandler)[0][1], "SPRegistersHandler::Write32"); + m_Assembler.CallFunction((void *)((long**)(MemoryHandler *)&g_MMU->m_SPRegistersHandler)[0][1], "SPRegistersHandler::Write32"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04040010: @@ -6125,7 +6128,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, Value); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr | 0xA0000000); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(g_MMU), "g_MMU"); - CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); m_RegWorkingSet.AfterCallDirect(); break; case 0x0404001C: m_Assembler.MoveConstToVariable(0, &g_Reg->SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG"); break; @@ -6147,7 +6150,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, Value); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr | 0xA0000000); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(g_MMU), "g_MMU"); - CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); m_RegWorkingSet.AfterCallDirect(); break; default: @@ -6292,7 +6295,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) CArmOps::ArmReg VariableReg = TempValueReg != CArmOps::Arm_R1 ? CArmOps::Arm_R1 : CArmOps::Arm_R2; m_Assembler.MoveConstToArmReg(VariableReg, (uint32_t)&g_Reg->VI_STATUS_REG, "VI_STATUS_REG"); m_Assembler.StoreArmRegToArmRegPointer(TempValueReg, VariableReg, 0); - CallFunction((void *)g_Plugins->Gfx()->ViStatusChanged, "ViStatusChanged"); + m_Assembler.CallFunction((void *)g_Plugins->Gfx()->ViStatusChanged, "ViStatusChanged"); m_RegWorkingSet.AfterCallDirect(); FlushPopArmReg(); m_CodeBlock.Log(""); @@ -6315,7 +6318,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveArmRegToVariable(TempValueReg, &g_Reg->VI_WIDTH_REG, "VI_WIDTH_REG"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction((void *)g_Plugins->Gfx()->ViWidthChanged, "ViWidthChanged"); + m_Assembler.CallFunction((void *)g_Plugins->Gfx()->ViWidthChanged, "ViWidthChanged"); m_RegWorkingSet.AfterCallDirect(); FlushPopArmReg(); m_CodeBlock.Log(""); @@ -6328,7 +6331,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) AndConstToVariable(&g_Reg->MI_INTR_REG, "MI_INTR_REG", (uint32_t)~MI_INTR_VI); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04400014: m_Assembler.MoveConstToVariable(Value, &g_Reg->VI_BURST_REG, "VI_BURST_REG"); break; @@ -6360,11 +6363,11 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { ArmBreakPoint(__FILE__, __LINE__); //m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Audio, "g_Audio"); - //CallFunction(AddressOf(&CAudio::LenChanged), "LenChanged"); + //m_Assembler.CallFunction(AddressOf(&CAudio::LenChanged), "LenChanged"); } else { - CallFunction((void *)g_Plugins->Audio()->AiLenChanged, "AiLenChanged"); + m_Assembler.CallFunction((void *)g_Plugins->Audio()->AiLenChanged, "AiLenChanged"); } m_RegWorkingSet.AfterCallDirect(); break; @@ -6375,7 +6378,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) AndConstToVariable(&g_Reg->m_AudioIntrReg, "m_AudioIntrReg", (uint32_t)~MI_INTR_AI); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04500010: @@ -6383,7 +6386,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, Value); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr | 0xA0000000); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(g_MMU), "g_MMU"); - CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04500014: m_Assembler.MoveConstToVariable(Value, &g_Reg->AI_BITRATE_REG, "AI_BITRATE_REG"); break; @@ -6406,7 +6409,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) /*m_Assembler.MoveConstToVariable(Value, &g_Reg->PI_RD_LEN_REG, "PI_RD_LEN_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CDMA *)g_MMU), "(CDMA *)g_MMU"); - CallFunction(AddressOf(&CDMA::PI_DMA_READ), "CDMA::PI_DMA_READ"); + m_Assembler.CallFunction(AddressOf(&CDMA::PI_DMA_READ), "CDMA::PI_DMA_READ"); m_RegWorkingSet.AfterCallDirect();*/ break; case 0x0460000C: @@ -6417,7 +6420,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToVariable(Value, &g_Reg->PI_WR_LEN_REG, "PI_WR_LEN_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CDMA *)g_MMU), "(CDMA *)g_MMU"); - CallFunction(AddressOf(&CDMA::PI_DMA_WRITE), "CDMA::PI_DMA_WRITE"); + m_Assembler.CallFunction(AddressOf(&CDMA::PI_DMA_WRITE), "CDMA::PI_DMA_WRITE"); m_RegWorkingSet.AfterCallDirect();*/ break; case 0x04600010: @@ -6426,7 +6429,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) AndConstToVariable(&g_Reg->MI_INTR_REG, "MI_INTR_REG", (uint32_t)~MI_INTR_PI); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); } break; @@ -6474,7 +6477,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToVariable(Value, &g_Reg->SI_PIF_ADDR_RD64B_REG, "SI_PIF_ADDR_RD64B_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CPifRam *)g_MMU), "CPifRam *)g_MMU"); - CallFunction(AddressOf(&CPifRam::SI_DMA_READ), "CPifRam::SI_DMA_READ"); + m_Assembler.CallFunction(AddressOf(&CPifRam::SI_DMA_READ), "CPifRam::SI_DMA_READ"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04800010: @@ -6484,7 +6487,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToVariable(Value, &g_Reg->SI_PIF_ADDR_WR64B_REG, "SI_PIF_ADDR_WR64B_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CPifRam *)g_MMU), "CPifRam *)g_MMU"); - CallFunction(AddressOf(&CPifRam::SI_DMA_WRITE), "CPifRam::SI_DMA_WRITE"); + m_Assembler.CallFunction(AddressOf(&CPifRam::SI_DMA_WRITE), "CPifRam::SI_DMA_WRITE"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04800018: @@ -6492,7 +6495,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) AndConstToVariable(&g_Reg->SI_STATUS_REG, "SI_STATUS_REG", (uint32_t)~SI_STATUS_INTERRUPT); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; default: @@ -6511,7 +6514,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { case 0x05000520: m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&DiskReset), "DiskReset"); + m_Assembler.CallFunction(AddressOf(&DiskReset), "DiskReset"); m_RegWorkingSet.AfterCallDirect(); break; default: @@ -6532,7 +6535,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, Value); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr | 0xA0000000); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(g_MMU), "g_MMU"); - CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); m_RegWorkingSet.AfterCallDirect(); break; default: @@ -6615,7 +6618,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) Push(Reg); PushImm32(PAddr & 0x1FFFFFFF);*/ m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(MemoryHandler *)&g_MMU->m_SPRegistersHandler, "(MemoryHandler *)g_MMU->m_SPRegistersHandler"); - CallFunction((void *)((long**)(MemoryHandler *)&g_MMU->m_SPRegistersHandler)[0][1], "SPRegistersHandler::Write32"); + m_Assembler.CallFunction((void *)((long**)(MemoryHandler *)&g_MMU->m_SPRegistersHandler)[0][1], "SPRegistersHandler::Write32"); m_RegWorkingSet.AfterCallDirect(); break; case 0x0404000C: @@ -6623,7 +6626,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) /*m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->SP_WR_LEN_REG, "SP_WR_LEN_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CDMA *)g_MMU), "(CDMA *)g_MMU"); - CallFunction(AddressOf(&CDMA::SP_DMA_WRITE), "CDMA::SP_DMA_WRITE"); + m_Assembler.CallFunction(AddressOf(&CDMA::SP_DMA_WRITE), "CDMA::SP_DMA_WRITE"); m_RegWorkingSet.AfterCallDirect();*/ break; case 0x04040010: @@ -6632,7 +6635,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp()); m_Assembler.MoveArmRegToVariable(Reg, &CMipsMemoryVM::RegModValue, "CMipsMemoryVM::RegModValue"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&CMipsMemoryVM::ChangeSpStatus), "CMipsMemoryVM::ChangeSpStatus"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::ChangeSpStatus), "CMipsMemoryVM::ChangeSpStatus"); m_RegWorkingSet.AfterCallDirect(); break; case 0x0404001C: m_Assembler.MoveConstToVariable(0, &g_Reg->SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG"); break; @@ -6669,7 +6672,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) } m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr | 0xA0000000); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(g_MMU), "g_MMU"); - CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04300000: @@ -6680,13 +6683,13 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) /*m_Assembler.MoveArmRegToVariable(Reg, &CMipsMemoryVM::m_MemLookupValue.UW[0], "CMipsMemoryVM::m_MemLookupValue.UW[0]"); m_Assembler.MoveConstToVariable(PAddr, &CMipsMemoryVM::m_MemLookupAddress, "m_MemLookupAddress"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction((void *)CMipsMemoryVM::Write32MIPSInterface, "CMipsMemoryVM::Write32MIPSInterface"); + m_Assembler.CallFunction((void *)CMipsMemoryVM::Write32MIPSInterface, "CMipsMemoryVM::Write32MIPSInterface"); m_RegWorkingSet.AfterCallDirect();*/ break; case 0x0430000C: m_Assembler.MoveArmRegToVariable(Reg, &CMipsMemoryVM::RegModValue, "CMipsMemoryVM::RegModValue"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction((void *)CMipsMemoryVM::ChangeMiIntrMask, "CMipsMemoryVM::ChangeMiIntrMask"); + m_Assembler.CallFunction((void *)CMipsMemoryVM::ChangeMiIntrMask, "CMipsMemoryVM::ChangeMiIntrMask"); m_RegWorkingSet.AfterCallDirect(); break; default: @@ -6711,7 +6714,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->VI_STATUS_REG, "VI_STATUS_REG"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction((void *)g_Plugins->Gfx()->ViStatusChanged, "ViStatusChanged"); + m_Assembler.CallFunction((void *)g_Plugins->Gfx()->ViStatusChanged, "ViStatusChanged"); m_RegWorkingSet.AfterCallDirect(); FlushPopArmReg(); m_CodeBlock.Log(""); @@ -6735,7 +6738,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->VI_WIDTH_REG, "VI_WIDTH_REG"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction((void *)g_Plugins->Gfx()->ViWidthChanged, "ViWidthChanged"); + m_Assembler.CallFunction((void *)g_Plugins->Gfx()->ViWidthChanged, "ViWidthChanged"); m_RegWorkingSet.AfterCallDirect(); FlushPopArmReg(); m_CodeBlock.Log(""); @@ -6748,7 +6751,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) AndConstToVariable(&g_Reg->MI_INTR_REG, "MI_INTR_REG", (uint32_t)~MI_INTR_VI); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04400014: m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->VI_BURST_REG, "VI_BURST_REG"); break; @@ -6781,11 +6784,11 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) { ArmBreakPoint(__FILE__, __LINE__); //m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Audio, "g_Audio"); - //CallFunction(AddressOf(&CAudio::LenChanged), "LenChanged"); + //m_Assembler.CallFunction(AddressOf(&CAudio::LenChanged), "LenChanged"); } else { - CallFunction((void *)g_Plugins->Audio()->AiLenChanged, "g_Plugins->Audio()->LenChanged"); + m_Assembler.CallFunction((void *)g_Plugins->Audio()->AiLenChanged, "g_Plugins->Audio()->LenChanged"); } m_RegWorkingSet.AfterCallDirect(); break; @@ -6798,7 +6801,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) AndConstToVariable(&g_Reg->m_AudioIntrReg, "m_AudioIntrReg", (uint32_t)~MI_INTR_AI); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04500010: @@ -6809,7 +6812,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) } m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr | 0xA0000000); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)(g_MMU), "g_MMU"); - CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::SW_NonMemory), "CMipsMemoryVM::SW_NonMemory"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04500014: m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->AI_BITRATE_REG, "AI_BITRATE_REG"); break; @@ -6830,7 +6833,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) if (EnableDisk()) { m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&DiskDMACheck), "DiskDMACheck"); + m_Assembler.CallFunction(AddressOf(&DiskDMACheck), "DiskDMACheck"); m_RegWorkingSet.AfterCallDirect(); } break; @@ -6839,7 +6842,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) /*m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->PI_RD_LEN_REG, "PI_RD_LEN_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CDMA *)g_MMU), "(CDMA *)g_MMU"); - CallFunction(AddressOf(&CDMA::PI_DMA_READ), "CDMA::PI_DMA_READ"); + m_Assembler.CallFunction(AddressOf(&CDMA::PI_DMA_READ), "CDMA::PI_DMA_READ"); m_RegWorkingSet.AfterCallDirect();*/ break; case 0x0460000C: @@ -6850,7 +6853,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->PI_WR_LEN_REG, "PI_WR_LEN_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CDMA *)g_MMU), "(CDMA *)g_MMU"); - CallFunction(AddressOf(&CDMA::PI_DMA_WRITE), "CDMA::PI_DMA_WRITE"); + m_Assembler.CallFunction(AddressOf(&CDMA::PI_DMA_WRITE), "CDMA::PI_DMA_WRITE"); m_RegWorkingSet.AfterCallDirect();*/ break; case 0x04600010: @@ -6861,7 +6864,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) AndConstToVariable(&g_Reg->MI_INTR_REG, "MI_INTR_REG", (uint32_t)~MI_INTR_PI); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04600014: @@ -6927,14 +6930,14 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->SI_PIF_ADDR_RD64B_REG, "SI_PIF_ADDR_RD64B_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CPifRam *)g_MMU), "CPifRam *)g_MMU"); - CallFunction(AddressOf(&CPifRam::SI_DMA_READ), "CPifRam::SI_DMA_READ"); + m_Assembler.CallFunction(AddressOf(&CPifRam::SI_DMA_READ), "CPifRam::SI_DMA_READ"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04800010: m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->SI_PIF_ADDR_WR64B_REG, "SI_PIF_ADDR_WR64B_REG"); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)((CPifRam *)g_MMU), "CPifRam *)g_MMU"); - CallFunction(AddressOf(&CPifRam::SI_DMA_WRITE), "CPifRam::SI_DMA_WRITE"); + m_Assembler.CallFunction(AddressOf(&CPifRam::SI_DMA_WRITE), "CPifRam::SI_DMA_WRITE"); m_RegWorkingSet.AfterCallDirect(); break; case 0x04800018: @@ -6942,7 +6945,7 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) AndConstToVariable(&g_Reg->SI_STATUS_REG, "SI_STATUS_REG", (uint32_t)~SI_STATUS_INTERRUPT); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; default: @@ -6964,27 +6967,27 @@ void CArmRecompilerOps::SW_Register(CArmOps::ArmReg Reg, uint32_t VAddr) // ASIC_CMD m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->ASIC_CMD, "ASIC_CMD"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&DiskCommand), "DiskCommand"); + m_Assembler.CallFunction(AddressOf(&DiskCommand), "DiskCommand"); m_RegWorkingSet.AfterCallDirect(); OrConstToVariable(&g_Reg->ASIC_STATUS, "ASIC_STATUS", (uint32_t)DD_STATUS_MECHA_INT); OrConstToVariable(&g_Reg->FAKE_CAUSE_REGISTER, "FAKE_CAUSE_REGISTER", (uint32_t)CAUSE_IP3); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Reg, "g_Reg"); - CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); + m_Assembler.CallFunction(AddressOf(&CRegisters::CheckInterrupts), "CRegisters::CheckInterrupts"); m_RegWorkingSet.AfterCallDirect(); break; case 0x05000510: // ASIC_BM_CTL m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->ASIC_BM_CTL, "ASIC_BM_CTL"); m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&DiskBMControl), "DiskBMControl"); + m_Assembler.CallFunction(AddressOf(&DiskBMControl), "DiskBMControl"); m_RegWorkingSet.AfterCallDirect(); break; case 0x05000518: break; case 0x05000520: m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&DiskReset), "DiskReset"); + m_Assembler.CallFunction(AddressOf(&DiskReset), "DiskReset"); m_RegWorkingSet.AfterCallDirect(); break; case 0x05000528: m_Assembler.MoveArmRegToVariable(Reg, &g_Reg->ASIC_HOST_SECBYTE, "ASIC_HOST_SECBYTE"); break; @@ -7116,7 +7119,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, (uint32_t)&CMipsMemoryVM::m_MemLookupAddress, "m_MemLookupAddress"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R1, CArmOps::Arm_R2, 0); - CallFunction((void *)CMipsMemoryVM::Load32DPCommand, "CMipsMemoryVM::Load32DPCommand"); + m_Assembler.CallFunction((void *)CMipsMemoryVM::Load32DPCommand, "CMipsMemoryVM::Load32DPCommand"); m_RegWorkingSet.AfterCallDirect(); m_Assembler.MoveVariableToArmReg(&CMipsMemoryVM::m_MemLookupValue.UW[0], "CMipsMemoryVM::m_MemLookupValue.UW[0]", Reg);*/ break; @@ -7146,7 +7149,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp()); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_MMU); - CallFunction(AddressOf(&CMipsMemoryVM::UpdateHalfLine), "CMipsMemoryVM::UpdateHalfLine"); + m_Assembler.CallFunction(AddressOf(&CMipsMemoryVM::UpdateHalfLine), "CMipsMemoryVM::UpdateHalfLine"); m_RegWorkingSet.AfterCallDirect(); m_Assembler.MoveVariableToArmReg((void *)&g_MMU->m_HalfLine, "MMU->m_HalfLine", Reg);*/ break; @@ -7171,7 +7174,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp()); m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Audio, "g_Audio"); - CallFunction(AddressOf(&CAudio::GetLength), "CAudio::GetLength"); + m_Assembler.CallFunction(AddressOf(&CAudio::GetLength), "CAudio::GetLength"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)&m_TempValue, "m_TempValue"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R0, CArmOps::Arm_R1, 0); m_RegWorkingSet.AfterCallDirect(); @@ -7182,7 +7185,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) if (g_Plugins->Audio()->AiReadLength != nullptr) { m_RegWorkingSet.BeforeCallDirect(); - CallFunction((void *)g_Plugins->Audio()->AiReadLength, "AiReadLength"); + m_Assembler.CallFunction((void *)g_Plugins->Audio()->AiReadLength, "AiReadLength"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)&m_TempValue, "m_TempValue"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R0, CArmOps::Arm_R1, 0); m_RegWorkingSet.AfterCallDirect(); @@ -7200,7 +7203,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) ArmBreakPoint(__FILE__, __LINE__); /*m_RegWorkingSet.BeforeCallDirect(); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R0, (uint32_t)g_Audio, "g_Audio"); - CallFunction(AddressOf(&CAudio::GetStatus), "CAudio::GetStatus"); + m_Assembler.CallFunction(AddressOf(&CAudio::GetStatus), "CAudio::GetStatus"); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, (uint32_t)&m_TempValue, "m_TempValue"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R0, CArmOps::Arm_R1, 0); m_RegWorkingSet.AfterCallDirect(); @@ -7284,7 +7287,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) case 0x05000508: m_Assembler.MoveVariableToArmReg(&g_Reg->ASIC_STATUS, "ASIC_STATUS", Reg); m_RegWorkingSet.BeforeCallDirect(); - CallFunction(AddressOf(&DiskGapSectorCheck), "DiskGapSectorCheck"); + m_Assembler.CallFunction(AddressOf(&DiskGapSectorCheck), "DiskGapSectorCheck"); m_RegWorkingSet.AfterCallDirect(); break; case 0x0500050C: m_Assembler.MoveVariableToArmReg(&g_Reg->ASIC_CUR_TK, "ASIC_CUR_TK", Reg); break; @@ -7323,7 +7326,7 @@ void CArmRecompilerOps::LW_KnownAddress(CArmOps::ArmReg Reg, uint32_t VAddr) m_Assembler.MoveConstToArmReg(CArmOps::Arm_R1, PAddr); m_Assembler.MoveConstToArmReg(CArmOps::Arm_R2, (uint32_t)&CMipsMemoryVM::m_MemLookupAddress, "m_MemLookupAddress"); m_Assembler.StoreArmRegToArmRegPointer(CArmOps::Arm_R1, CArmOps::Arm_R2, 0); - CallFunction((void *)CMipsMemoryVM::Load32CartridgeDomain1Address1, "CMipsMemoryVM::Load32CartridgeDomain1Address1"); + m_Assembler.CallFunction((void *)CMipsMemoryVM::Load32CartridgeDomain1Address1, "CMipsMemoryVM::Load32CartridgeDomain1Address1"); m_RegWorkingSet.AfterCallDirect(); m_Assembler.MoveVariableToArmReg(&CMipsMemoryVM::m_MemLookupValue.UW[0], "CMipsMemoryVM::m_MemLookupValue.UW[0]", Reg);*/ break; diff --git a/Source/Project64-core/N64System/Recompiler/RecompilerOps.h b/Source/Project64-core/N64System/Recompiler/RecompilerOps.h index 74490862d..19195f7f7 100644 --- a/Source/Project64-core/N64System/Recompiler/RecompilerOps.h +++ b/Source/Project64-core/N64System/Recompiler/RecompilerOps.h @@ -48,4 +48,8 @@ typedef CX86RecompilerOps CRecompilerOps; typedef CArmRecompilerOps CRecompilerOps; +#elif defined(__aarch64__) + +#include + #endif diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp index 36a61a7ee..b375b402e 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp @@ -209,9 +209,9 @@ void CX86Ops::CallThis(uint32_t ThisPtr, uint32_t FunctPtr, char * FunctName, ui #else void CX86Ops::CallThis(uint32_t ThisPtr, uint32_t FunctPtr, char * FunctName, uint32_t StackSize) { - m_Assembler.PushImm32(ThisPtr); + PushImm32(ThisPtr); CallFunc(FunctPtr, FunctName); - m_Assembler.AddConstToX86Reg(CX86Ops::x86_ESP, StackSize); + AddConstToX86Reg(CX86Ops::x86_ESP, StackSize); } #endif diff --git a/Source/Project64-core/Project64-core.vcxproj b/Source/Project64-core/Project64-core.vcxproj index 8a8b4bbd6..515e3d46c 100644 --- a/Source/Project64-core/Project64-core.vcxproj +++ b/Source/Project64-core/Project64-core.vcxproj @@ -88,6 +88,9 @@ + + + @@ -212,6 +215,8 @@ + + diff --git a/Source/Project64-core/Project64-core.vcxproj.filters b/Source/Project64-core/Project64-core.vcxproj.filters index bc1fdab00..909f55f34 100644 --- a/Source/Project64-core/Project64-core.vcxproj.filters +++ b/Source/Project64-core/Project64-core.vcxproj.filters @@ -118,6 +118,9 @@ {56644680-2b82-4343-8619-660b68685cba} + + {bdaed3ea-5ef7-4bd9-814c-566a672c8140} + @@ -426,6 +429,15 @@ Source Files\N64 System\Recompiler\x64-86 + + Source Files\N64 System\Recompiler\Aarch64 + + + Source Files\N64 System\Recompiler\Aarch64 + + + Source Files\N64 System\Recompiler\Aarch64 + @@ -821,6 +833,12 @@ Header Files\N64 System\Recompiler\x64-86 + + Header Files\N64 System\Recompiler\Aarch64 + + + Header Files\N64 System\Recompiler\Aarch64 + diff --git a/Source/Project64-plugin-spec/Audio.h b/Source/Project64-plugin-spec/Audio.h index bd92d61e3..cba291fa0 100644 --- a/Source/Project64-plugin-spec/Audio.h +++ b/Source/Project64-plugin-spec/Audio.h @@ -1,5 +1,5 @@ #pragma once -#include "base.h" +#include "Base.h" #if defined(__cplusplus) extern "C" { diff --git a/Source/Project64-plugin-spec/Video.h b/Source/Project64-plugin-spec/Video.h index 8e8d89793..4d5dcc609 100644 --- a/Source/Project64-plugin-spec/Video.h +++ b/Source/Project64-plugin-spec/Video.h @@ -1,5 +1,5 @@ #pragma once -#include "base.h" +#include "Base.h" #if defined(__cplusplus) extern "C" {