Move all core types into namespaces (#1886)

* Reorganize namespaces

- Most types are now moved into the `melonDS` namespace
- Only good chance to do this for a while, since a big refactor is next

* Fix the build
This commit is contained in:
Jesse Talavera-Greenberg
2023-11-25 12:32:09 -05:00
committed by GitHub
parent 651b0f680c
commit 346dd4006e
178 changed files with 529 additions and 268 deletions

View File

@ -21,7 +21,7 @@
using namespace Gen;
namespace ARMJIT
namespace melonDS
{
// uses RSCRATCH3
@ -129,7 +129,7 @@ OpArg Compiler::A_Comp_GetALUOp2(bool S, bool& carryUsed)
Comp_AddCycles_C();
u32 shift = (CurInstr.Instr >> 7) & 0x1E;
u32 imm = ::ROR(CurInstr.Instr & 0xFF, shift);
u32 imm = melonDS::ROR(CurInstr.Instr & 0xFF, shift);
carryUsed = false;
if (S && shift)

View File

@ -21,7 +21,7 @@
using namespace Gen;
namespace ARMJIT
namespace melonDS
{
template <typename T>

View File

@ -34,10 +34,11 @@
#endif
using namespace Gen;
using namespace Common;
extern "C" void ARM_Ret();
namespace ARMJIT
namespace melonDS
{
template <>
const X64Reg RegisterCache<Compiler, X64Reg>::NativeRegAllocOrder[] =
@ -141,7 +142,7 @@ void Compiler::A_Comp_MSR()
Comp_AddCycles_C();
OpArg val = CurInstr.Instr & (1 << 25)
? Imm32(::ROR((CurInstr.Instr & 0xFF), ((CurInstr.Instr >> 7) & 0x1E)))
? Imm32(melonDS::ROR((CurInstr.Instr & 0xFF), ((CurInstr.Instr >> 7) & 0x1E)))
: MapReg(CurInstr.A_Reg(0));
u32 mask = 0;

View File

@ -30,11 +30,11 @@
#include <unordered_map>
class ARMJIT_Memory;
namespace ARMJIT
namespace melonDS
{
class ARMJIT;
class ARMJIT_Memory;
const Gen::X64Reg RCPU = Gen::RBP;
const Gen::X64Reg RCPSR = Gen::R15;
@ -172,7 +172,7 @@ public:
memop_SubtractOffset = 1 << 4
};
void Comp_MemAccess(int rd, int rn, const Op2& op2, int size, int flags);
s32 Comp_MemAccessBlock(int rn, BitSet16 regs, bool store, bool preinc, bool decrement, bool usermode, bool skipLoadingRn);
s32 Comp_MemAccessBlock(int rn, Common::BitSet16 regs, bool store, bool preinc, bool decrement, bool usermode, bool skipLoadingRn);
bool Comp_MemLoadLiteral(int size, bool signExtend, int rd, u32 addr);
void Comp_ArithTriOp(void (Compiler::*op)(int, const Gen::OpArg&, const Gen::OpArg&),

View File

@ -17,7 +17,7 @@
*/
#include "../ARM.h"
using namespace melonDS;
int main(int argc, char* argv[])
{
FILE* f = fopen("ARMJIT_Offsets.h", "w");

View File

@ -21,7 +21,7 @@
using namespace Gen;
namespace ARMJIT
namespace melonDS
{
template <typename T>
@ -85,7 +85,7 @@ bool Compiler::Comp_MemLoadLiteral(int size, bool signExtend, int rd, u32 addr)
if (size == 32)
{
CurCPU->DataRead32(addr & ~0x3, &val);
val = ::ROR(val, (addr & 0x3) << 3);
val = melonDS::ROR(val, (addr & 0x3) << 3);
}
else if (size == 16)
{