From 3aa854c0c54cfef5f15f41be29f89cd20573fa77 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 12 Oct 2020 14:46:04 -0400 Subject: [PATCH] splat update --- Makefile | 3 +++ src/code_1a1f0_len_5390.c | 22 +++++++++++++++------- tools/n64splat | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 50100618b6..05e770f3ba 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,9 @@ submodules: split: rm -rf $(DATA_DIRS) && ./tools/n64splat/split.py baserom.z64 tools/splat.yaml . +splitld: tools/splat.yaml + ./tools/n64splat/split.py baserom.z64 tools/splat.yaml . --modes ld + setup: clean submodules split print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true diff --git a/src/code_1a1f0_len_5390.c b/src/code_1a1f0_len_5390.c index aa581809d5..ababb7eae0 100644 --- a/src/code_1a1f0_len_5390.c +++ b/src/code_1a1f0_len_5390.c @@ -9,14 +9,22 @@ s32 get_defeated(s32 mapID, s32 encounterID) { } void set_defeated(s32 mapID, s32 encounterID) { - EncounterStatus* currentEncounter = &gCurrentEncounter; - s32 encounterIdx; + EncounterStatus *currentEncounter = &gCurrentEncounter; + s32 encounterIdx = encounterID / 32; s32 encounterShift; - - encounterIdx = encounterID / 32; - encounterShift = encounterID % 32; - - currentEncounter->defeatFlags[mapID][encounterIdx] |= (1 << encounterShift); + s32 flag; + + flag = encounterID % 32; + encounterShift = flag; + flag = currentEncounter->defeatFlags[mapID][encounterIdx]; + currentEncounter->defeatFlags[mapID][encounterIdx] = flag | (1 << encounterShift); + + // TODO: The below should work but has regalloc issues: + /*EncounterStatus *currentEncounter = &gCurrentEncounter; + s32 encounterIdx = encounterID / 32; + s32 encounterShift = encounterID % 32; + + currentEncounter->defeatFlags[mapID][encounterIdx] |= (1 << encounterShift);*/ } INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003EE98); diff --git a/tools/n64splat b/tools/n64splat index 5d0ddef55b..fce3c89074 160000 --- a/tools/n64splat +++ b/tools/n64splat @@ -1 +1 @@ -Subproject commit 5d0ddef55b38563641d40dea7d0f662c1025e638 +Subproject commit fce3c8907426d99597dd401f2843a9f54b199a31