Skip to content

Commit

Permalink
Keep asm_processor by default, use --no-asm-processor instead for pro…
Browse files Browse the repository at this point in the history
…gress calculation only
  • Loading branch information
cadmic committed Sep 20, 2024
1 parent 25ed79c commit 4c7e98a
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 106 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:
- name: Build (non-matching)
if: ${{ !matrix.matching }}
run: |
python configure.py --map --binutils /binutils --compilers /compilers --non-matching
ninja all_source
python configure.py --map --binutils /binutils --compilers /compilers --non-matching --no-asm-processor
ninja all_source build/{mq-j,mq-u,mq-e,ce-j,ce-u,ce-e}/progress.json build/report.json
# Upload progress if we're on the main branch
- name: Upload progress
if: matrix.matching && github.ref == 'refs/heads/main'
if: ${{ !matrix.matching && github.ref == 'refs/heads/main' }}
continue-on-error: true
env:
PROGRESS_SLUG: oot-gc
Expand Down
9 changes: 6 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
action="store_true",
help="create non-matching build for modding",
)
parser.add_argument(
"--no-asm-processor",
action="store_true",
help="disable asm_processor for progress calculation",
)
parser.add_argument(
"--build-dir",
metavar="DIR",
Expand Down Expand Up @@ -136,7 +141,7 @@
config.generate_map = args.map
config.sjiswrap_path = args.sjiswrap
config.non_matching = args.non_matching
config.asm_processor = args.non_matching
config.asm_processor = not args.no_asm_processor

if not is_windows():
config.wrapper = args.wrapper
Expand Down Expand Up @@ -190,8 +195,6 @@

if config.non_matching:
cflags_base.append("-DNON_MATCHING")
if config.asm_processor:
cflags_base.append("-DASM_PROCESSOR")

### Helper functions

Expand Down
58 changes: 29 additions & 29 deletions src/emulator/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ s32 ganMapGPR[] = {
0x0000001B, 0x0000001C, 0x0000001D, 0x0000001E, 0x0000011C, 0x0000001F, 0x0000011E, 0x0000011F,
};

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuOpcodeChecksum
void* jtbl_800EBEF0[25] = {
&lbl_80030EFC, &lbl_80030F7C, &lbl_80030F7C, &lbl_80030EFC, &lbl_80030EFC, &lbl_80030F7C, &lbl_80030EFC,
Expand All @@ -177,7 +177,7 @@ void* jtbl_800EBEF0[25] = {
void* jtbl_800EBEF0[25] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuOpcodeChecksum
void* jtbl_800EBF54[64] = {
&lbl_80030F7C, &lbl_80030EA8, &lbl_80030F58, &lbl_80030F60, &lbl_80030F68, &lbl_80030F68, &lbl_80030F68,
Expand All @@ -200,7 +200,7 @@ char D_800EC078[] = "tree range (%p - %p)\n";
char D_800EC090[] = "total nodes: %d (tree height: %d %d)\n";
char D_800EC0B8[] = "total memory: %d\n";

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuFindFunction
void* jtbl_800EC0CC[25] = {
&lbl_8003381C, &lbl_80033A68, &lbl_80033A68, &lbl_8003381C, &lbl_8003381C, &lbl_80033A68, &lbl_8003381C,
Expand All @@ -212,7 +212,7 @@ void* jtbl_800EC0CC[25] = {
void* jtbl_800EC0CC[25] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuFindFunction
void* jtbl_800EC130[44] = {
&lbl_800334D8, &lbl_800335A0, &lbl_80033564, &lbl_80033A5C, &lbl_80033644, &lbl_80033768, &lbl_80033768,
Expand All @@ -229,7 +229,7 @@ void* jtbl_800EC130[44] = {0};

char D_800EC1E0[] = "_cpuGCN.c";

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteLoadStoreF
void* jtbl_800EC1EC[15] = {
&lbl_8003789C, &lbl_80038010, &lbl_80038010, &lbl_80038010, &lbl_80037AF0,
Expand All @@ -240,7 +240,7 @@ void* jtbl_800EC1EC[15] = {
void* jtbl_800EC1EC[15] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteLoadStore
void* jtbl_800EC228[12] = {
&lbl_800383F4, &lbl_800386AC, &lbl_80038E70, &lbl_80038964, &lbl_80038560, &lbl_80038818,
Expand All @@ -250,7 +250,7 @@ void* jtbl_800EC228[12] = {
void* jtbl_800EC228[12] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC258[64] = {
&lbl_8003C690, &lbl_8003C6CC, &lbl_8003C708, &lbl_8003C754, &lbl_8003C78C, &lbl_8003C85C, &lbl_8003C88C,
Expand All @@ -268,7 +268,7 @@ void* jtbl_800EC258[64] = {
void* jtbl_800EC258[64] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC358[64] = {
&lbl_8003BEA4, &lbl_8003BED0, &lbl_8003BEFC, &lbl_8003BF28, &lbl_8003BF54, &lbl_8003C030, &lbl_8003C078,
Expand All @@ -286,7 +286,7 @@ void* jtbl_800EC358[64] = {
void* jtbl_800EC358[64] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC458[64] = {
&lbl_8003B774, &lbl_8003B7A0, &lbl_8003B7CC, &lbl_8003B7F8, &lbl_8003B824, &lbl_8003B8C8, &lbl_8003B8E8,
Expand All @@ -304,7 +304,7 @@ void* jtbl_800EC458[64] = {
void* jtbl_800EC458[64] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC558[64] = {
&lbl_8003B040, &lbl_8003B06C, &lbl_8003B098, &lbl_8003B0C4, &lbl_8003B0F0, &lbl_8003B198, &lbl_8003B1BC,
Expand All @@ -322,7 +322,7 @@ void* jtbl_800EC558[64] = {
void* jtbl_800EC558[64] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC658[7] = {
&lbl_8003AD84, &lbl_8003ADD4, &lbl_8003ADF8, &lbl_8003DEAC, &lbl_8003AE14, &lbl_8003AE98, &lbl_8003AEBC,
Expand All @@ -331,7 +331,7 @@ void* jtbl_800EC658[7] = {
void* jtbl_800EC658[7] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC674[9] = {
&lbl_8003AC94, &lbl_8003ACD8, &lbl_8003DEAC, &lbl_8003DEAC, &lbl_8003AD0C,
Expand All @@ -341,7 +341,7 @@ void* jtbl_800EC674[9] = {
void* jtbl_800EC674[9] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC698[25] = {
&lbl_8003AC70, &lbl_8003A824, &lbl_8003A87C, &lbl_8003AC70, &lbl_8003AC70, &lbl_8003A894, &lbl_8003AC70,
Expand All @@ -353,7 +353,7 @@ void* jtbl_800EC698[25] = {
void* jtbl_800EC698[25] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC6FC[20] = {
&lbl_8003A1A8, &lbl_8003A1D8, &lbl_8003A208, &lbl_8003A254, &lbl_8003DEAC, &lbl_8003DEAC, &lbl_8003DEAC,
Expand All @@ -364,7 +364,7 @@ void* jtbl_800EC6FC[20] = {
void* jtbl_800EC6FC[20] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC74C[64] = {
&lbl_80039680, &lbl_8003DEAC, &lbl_800396A4, &lbl_800396C8, &lbl_800396EC, &lbl_8003DEAC, &lbl_8003971C,
Expand All @@ -382,7 +382,7 @@ void* jtbl_800EC74C[64] = {
void* jtbl_800EC74C[64] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuExecuteOpcode
void* jtbl_800EC84C[64] = {
&lbl_8003965C, &lbl_8003A184, &lbl_8003A4F0, &lbl_8003A558, &lbl_8003A58C, &lbl_8003A61C, &lbl_8003A658,
Expand Down Expand Up @@ -561,7 +561,7 @@ void* jtbl_800ED3B0[64] = {
&lbl_800678FC,
};

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuCheckDelaySlot
void* jtbl_800ED4B0[25] = {
&lbl_800682F0, &lbl_80068360, &lbl_80068360, &lbl_800682F0, &lbl_800682F0, &lbl_80068360, &lbl_800682F0,
Expand All @@ -573,7 +573,7 @@ void* jtbl_800ED4B0[25] = {
void* jtbl_800ED4B0[25] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuCheckDelaySlot
void* jtbl_800ED514[24] = {
&lbl_80068270, &lbl_8006829C, &lbl_8006834C, &lbl_80068354, &lbl_8006835C, &lbl_8006835C,
Expand All @@ -585,7 +585,7 @@ void* jtbl_800ED514[24] = {
void* jtbl_800ED514[24] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuGetRegisterCP0
void* jtbl_800ED574[32] = {
&lbl_8003551C, &lbl_800352F8, &lbl_8003551C, &lbl_8003551C, &lbl_8003551C, &lbl_8003551C, &lbl_8003551C,
Expand All @@ -598,7 +598,7 @@ void* jtbl_800ED574[32] = {
void* jtbl_800ED574[32] = {0};
#endif

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
// cpuSetRegisterCP0
void* jtbl_800ED5F4[32] = {
&lbl_800356F4, &lbl_800356F8, &lbl_800356F4, &lbl_800356F4, &lbl_800356F4, &lbl_800356F4, &lbl_800356F4,
Expand Down Expand Up @@ -1778,7 +1778,7 @@ static bool cpuCompile_LWR(Cpu* pCPU, s32* addressGCN) {
}

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuCheckDelaySlot.s")
#else
static bool cpuCheckDelaySlot(u32 opcode) {
Expand Down Expand Up @@ -2241,7 +2241,7 @@ static bool cpuExecuteUpdate(Cpu* pCPU, s32* pnAddressGCN, u32 nCount) {
}

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
static bool cpuExecuteOpcode(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAddressGCN);
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuExecuteOpcode.s")
#else
Expand Down Expand Up @@ -3891,7 +3891,7 @@ static bool cpuExecuteCall(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAddressG
}

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
static bool cpuExecuteLoadStore(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAddressGCN);
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuExecuteLoadStore.s")
#else
Expand Down Expand Up @@ -4168,7 +4168,7 @@ static bool cpuExecuteLoadStore(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAdd
#endif

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
static bool cpuExecuteLoadStoreF(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAddressGCN);
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuExecuteLoadStoreF.s")
#else
Expand Down Expand Up @@ -5108,7 +5108,7 @@ static bool cpuSetCP0_Status(Cpu* pCPU, u64 nStatus, u32 unknown) {
}

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
bool cpuSetRegisterCP0(Cpu* pCPU, s32 iRegister, s64 nData);
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuSetRegisterCP0.s")
#else
Expand Down Expand Up @@ -5169,7 +5169,7 @@ bool cpuSetRegisterCP0(Cpu* pCPU, s32 iRegister, s64 nData) {
#endif

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
bool cpuGetRegisterCP0(Cpu* pCPU, s32 iRegister, s64* pnData);
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuGetRegisterCP0.s")
#else
Expand Down Expand Up @@ -5327,7 +5327,7 @@ bool cpuSetCodeHack(Cpu* pCPU, s32 nAddress, s32 nOpcodeOld, s32 nOpcodeNew) {
}

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuReset.s")
#else
bool cpuReset(Cpu* pCPU) {
Expand Down Expand Up @@ -5823,7 +5823,7 @@ static inline bool cpuTreeFree(CpuFunction* pFunction) {
return false;
}

#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuFindFunction.s")
#else
bool cpuFindFunction(Cpu* pCPU, s32 theAddress, CpuFunction** tree_node) {
Expand Down Expand Up @@ -7504,7 +7504,7 @@ static inline s32 treeMemory(Cpu* pCPU) {
}

// Matches but data doesn't
#ifdef ASM_PROCESSOR
#ifndef NON_MATCHING
#pragma GLOBAL_ASM("asm/non_matchings/cpu/cpuOpcodeChecksum.s")
#else
s32 cpuOpcodeChecksum(u32 opcode) {
Expand Down
Loading

0 comments on commit 4c7e98a

Please sign in to comment.