summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2021-09-18 15:41:00 -0700
committerTakaRikka <38417346+TakaRikka@users.noreply.github.com>2021-09-18 15:41:00 -0700
commit14db43b4c9747bfa4e06825457657ee2fa534b40 (patch)
treedeba4713e7d45a9c005e59b8c3b775b51f9b74ba
parent9a58ff8cb87bc127aca0597966b5c579d0c8d3dc (diff)
parentf778560d80900e6856d1176948e14381b9814e1a (diff)
Merge branch 'master' of https://github.com/zsrtp/tpgz into pr_pr_
-rw-r--r--.github/workflows/c-cpp.yml12
-rw-r--r--CHANGELOG.md49
-rw-r--r--Makefile6
-rw-r--r--include/utils/hook.h3
-rw-r--r--src/utils/hook.cpp16
5 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).
diff --git a/Makefile b/Makefile
index 15b9d0e..b0ba574 100644
--- a/Makefile
+++ b/Makefile
@@ -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/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 d2ca83e..a783d2d 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
}