diff options
author | kipcode66 <kipcode66@gmail.com> | 2021-09-18 14:34:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 14:34:10 -0400 |
commit | f778560d80900e6856d1176948e14381b9814e1a (patch) | |
tree | 8cac014f838d27d79f0fb3ee43e4d20a966d2c99 | |
parent | 5ed16457ab46d0439c431f830f8bf9956d290b8a (diff) | |
parent | f3149a7f5e74c9ad2e23ed1339bd88ae31020b79 (diff) |
Merge pull request #55 from zsrtp/fixes
Add Boot/Crash Check
-rw-r--r-- | .github/workflows/c-cpp.yml | 12 | ||||
-rw-r--r-- | CHANGELOG.md | 49 | ||||
-rw-r--r-- | Makefile | 6 | ||||
m--------- | external/libtp_c | 0 | ||||
-rw-r--r-- | include/utils/hook.h | 3 | ||||
-rw-r--r-- | src/utils/hook.cpp | 16 |
6 files changed, 81 insertions, 5 deletions
diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 8ca2493..86ec128 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -6,17 +6,18 @@ on: jobs: build: - runs-on: ubuntu-latest container: - image: ghcr.io/pheenoh/devkitppc-gcn - + image: ghcr.io/pheenoh/zsrtp-tpgz:latest + options: --shm-size=128m --ulimit core=-1 --privileged=true steps: - name: Checkout uses: actions/checkout@v1 with: token: ${{secrets.MY_REPO_PAT}} submodules: recursive + - name: Debug Flag + run: export PR_TEST=1 - name: Run Make run: make - name: Move ISO @@ -24,3 +25,8 @@ jobs: # hacky work around to catch failures since romhack always returns 0 exit code - name: Run Romhack run: ROMHACK=$(romhack build --raw 2>&1) && ROMHACKSTRING=$(echo "$ROMHACK" | tail -c 9) && FINISHEDSTRING="Rom Hack" && echo "$ROMHACK" && if [ "$ROMHACKSTRING" != "$FINISHEDSTRING" ]; then exit 1; fi + - name: Boot Dolphin + run: | + dolphin-emu-nogui --platform=headless --video_backend=Null -e build/tpgz.iso & + sleep 15 + /dme -c 0x80450580
\ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..38ce528 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,49 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.4] - 2021-??-?? + + +## [0.3] - 2021-03-08 + +### Added +- All Dungeons practice saves +- Set savefile spawn location tool (need to be in pause menu) +- Flag change logger (wip) +- Memory File saving / loading +- Setting to swap X/Y button equips when loading practice saves + + +## [0.2] - 2021-02-06 + +### Added +- Waterfall Sidehop savefile +- Quick scroll on some menus (DPAD-Right/Left) +- Saved events / minigame / dungeon bit flag records added +- Initial Wii support + +### Changed +- Reworked temp flags menu into flag records menu +- Flag records / Memory editor menu cursor not line locked +- Tunic changer colors are less vibrant + +### Fixed +- Temp flags now properly reset on Fan Tower and Palace 1 saves +- Practice save stability improvements +- Fifo queue works properly with warping menu + + +## [0.1] - 2020-12-29 + +### Added + +- Initial re-release. + +### Changed + +- Fixed typos in Italian translation from [@lorenzo-arena](https://github.com/lorenzo-arena). +- Fixed typos in Indonesian translation from [@ekojs](https://github.com/ekojs). @@ -32,11 +32,15 @@ INCLUDES := include external MAKEFILES := $(shell find . -mindepth 2 -name Makefile) GZ_VERSION ?= 0.4 +ifdef PR_TEST +RUN_PR_TEST := -D PR_TEST=1 +endif + #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -g -c -O2 -Wall $(MACHDEP) $(INCLUDE) -D $(PLATFORM)_$(REGION) -D $(PLATFORM)_PLATFORM -D GZ_VERSION=$(GZ_VERSION) +CFLAGS = -g -c -O2 -Wall $(MACHDEP) $(INCLUDE) -D $(PLATFORM)_$(REGION) -D $(PLATFORM)_PLATFORM -D GZ_VERSION=$(GZ_VERSION) $(RUN_PR_TEST) CXXFLAGS = $(CFLAGS) #--------------------------------------------------------------------------------- diff --git a/external/libtp_c b/external/libtp_c -Subproject 809551857b58bd3ed6af472fdca53b90778945f +Subproject fe1f60089137627fd770a5f535197806e7e3309 diff --git a/include/utils/hook.h b/include/utils/hook.h index 88ecddb..9670e0c 100644 --- a/include/utils/hook.h +++ b/include/utils/hook.h @@ -1,5 +1,5 @@ -#define HOOK_AMNT 13 +#define HOOK_AMNT 14 enum HookIndex { HK_LIB_INIT_INDEX = 0, HK_LIB_GAME_LOOP_INDEX = 1, @@ -14,6 +14,7 @@ enum HookIndex { HK_OFFEVENTBIT_INDEX = 10, HK_ONSWITCH_INDEX = 11, HK_PUTSAVE_INDEX = 12, + HK_MYEXCEPTIONCALLBACK_INDEX = 13 }; namespace Hook { diff --git a/src/utils/hook.cpp b/src/utils/hook.cpp index 38f46c3..ebf266b 100644 --- a/src/utils/hook.cpp +++ b/src/utils/hook.cpp @@ -17,6 +17,7 @@ HOOK_DEF(void, cDyl_InitAsync, (void*, void*, void*)); HOOK_DEF(void, fapGm_Execute, (void)); +HOOK_DEF(void, ExceptionCallback, (void)); HOOK_DEF(void, draw, (void*)); struct PadStatus { @@ -30,6 +31,10 @@ struct PadStatus { #define PAD_READ_RETURN_OFFSET (0x2DC) #endif +#ifdef GCN_NTSCU +#define CRASH_ADDRESS (0x80450580) +#endif + HOOK_DEF(uint32_t, PADRead, (uint16_t*)); HOOK_DEF(uint32_t, checkHookshotStickBG, (void*, void*)); HOOK_DEF(void, setSpecialGravity, (float, float, int)); @@ -64,6 +69,13 @@ void drawHook(void* p1) { draw(); } +void myExceptionCallbackHook(void) { + ExceptionCallbackTrampoline(); + *reinterpret_cast<uint32_t*>(CRASH_ADDRESS) = 1; + DCFlushRange((void*)(CRASH_ADDRESS), sizeof(uint32_t)); + ICInvalidateRange((void*)(CRASH_ADDRESS), sizeof(uint32_t)); +} + uint32_t readControllerHook(uint16_t* p1) { auto returnValue = PADReadTrampoline(p1); Controller::read_controller(); @@ -177,6 +189,10 @@ void apply_hooks() { APPLY_HOOK(onEventBit, dSv_event_c__onEventBit_addr, HK_ONEVENTBIT_INDEX, onEventBitHook); APPLY_HOOK(offEventBit, dSv_event_c__offEventBit_addr, HK_OFFEVENTBIT_INDEX, offEventBitHook); APPLY_HOOK(putSave, tp_putSave_addr, HK_PUTSAVE_INDEX, putSaveHook); +#ifdef PR_TEST + APPLY_HOOK(ExceptionCallback, tp_myExceptionCallback_addr, HK_MYEXCEPTIONCALLBACK_INDEX, + myExceptionCallbackHook); +#endif #undef APPLY_HOOK } |