summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2022-07-11 17:25:46 -0700
committerTakaRikka <38417346+TakaRikka@users.noreply.github.com>2022-07-11 17:25:46 -0700
commitc35c1693b1d3817a85fe03964d9f59a5cee3ffd3 (patch)
tree5edf75fa685e7d07d40eb1fa079d71dd0c370908
parent1709d6c0b759bc1ec217fdf9b63615c50ba4c3e7 (diff)
wii fixes
m---------external/libtp_c0
-rw-r--r--include/bit.h2
-rw-r--r--include/commands.h27
-rw-r--r--src/controller.cpp25
-rw-r--r--src/corotdcheck.cpp1
-rw-r--r--src/free_cam.cpp15
-rw-r--r--src/lib.cpp4
-rw-r--r--src/menus/general_flags_menu.cpp2
-rw-r--r--src/menus/item_wheel_menu.cpp14
-rw-r--r--src/movelink.cpp10
-rw-r--r--src/utils/audio.cpp1
11 files changed, 60 insertions, 41 deletions
diff --git a/external/libtp_c b/external/libtp_c
-Subproject 43aa2555100a19ad8c8b3bd3bbef7c72e70d2d4
+Subproject cfe853cb005156713983ff8a1d4e8f9ae8b6cd3
diff --git a/include/bit.h b/include/bit.h
index 9c161c5..7e17fc6 100644
--- a/include/bit.h
+++ b/include/bit.h
@@ -1,6 +1,6 @@
#pragma once
-#ifdef WII_PLATFORM
+#ifdef WII_PLATFORM
namespace BiTIndicator {
void execute();
void setPosition();
diff --git a/include/commands.h b/include/commands.h
index a3ec866..44bafdf 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -1,5 +1,6 @@
#pragma once
#include <stdint.h>
+#include "libtp_c/include/m_Do/m_Re_controller_pad.h"
#ifdef GCN_PLATFORM
#define COMMANDS_AMNT 10
@@ -28,18 +29,18 @@
#ifdef WII_PLATFORM
#define COMMANDS_AMNT 11
-#define GORGE_VOID_BUTTONS (GZPad::Z | GZPad::C | GZPad::A | GZPad::ONE)
-#define BACK_IN_TIME_BUTTONS (GZPad::Z | GZPad::C | GZPad::A | GZPad::TWO)
-#define STORE_POSITION_BUTTONS (GZPad::Z | GZPad::C | GZPad::ONE)
-#define LOAD_POSITION_BUTTONS (GZPad::Z | GZPad::C | GZPad::TWO)
-#define MOON_JUMP_BUTTONS (GZPad::Z | GZPad::C | GZPad::A)
-#define RELOAD_AREA_BUTTONS (GZPad::Z | GZPad::C | GZPad::B | GZPad::TWO)
-#define TIMER_TOGGLE_BUTTONS (GZPad::Z | GZPad::C | GZPad::A | GZPad::B)
-#define TIMER_RESET_BUTTONS (GZPad::Z | GZPad::C | GZPad::B | GZPad::ONE)
-#define FREE_CAM_BUTTONS (GZPad::Z | GZPad::C | GZPad::B | GZPad::MINUS)
-#define MOVE_LINK_BUTTONS (GZPad::Z | GZPad::C | GZPad::B | GZPad::PLUS)
-#define FRAME_PAUSE_BUTTONS (GZPad::Z | GZPad::DPAD_UP)
-#define FRAME_ADVANCE_BUTTONS (GZPad::Z | GZPad::C | GZPad::B | GZPad::DPAD_RIGHT)
+#define GORGE_VOID_BUTTONS (CButton::Z | CButton::C | CButton::A | CButton::ONE)
+#define BACK_IN_TIME_BUTTONS (CButton::Z | CButton::C | CButton::A | CButton::TWO)
+#define STORE_POSITION_BUTTONS (CButton::Z | CButton::C | CButton::ONE)
+#define LOAD_POSITION_BUTTONS (CButton::Z | CButton::C | CButton::TWO)
+#define MOON_JUMP_BUTTONS (CButton::Z | CButton::C | CButton::A)
+#define RELOAD_AREA_BUTTONS (CButton::Z | CButton::C | CButton::B | CButton::TWO)
+#define TIMER_TOGGLE_BUTTONS (CButton::Z | CButton::C | CButton::A | CButton::B)
+#define TIMER_RESET_BUTTONS (CButton::Z | CButton::C | CButton::B | CButton::ONE)
+#define FREE_CAM_BUTTONS (CButton::Z | CButton::C | CButton::B | CButton::MINUS)
+#define MOVE_LINK_BUTTONS (CButton::Z | CButton::C | CButton::B | CButton::PLUS)
+#define FRAME_PAUSE_BUTTONS (CButton::Z | CButton::DPAD_UP)
+#define FRAME_ADVANCE_BUTTONS (CButton::Z | CButton::DPAD_RIGHT)
#define GORGE_VOID_TEXT "Z+C+A+1"
#define BACK_IN_TIME_TEXT "Z+C+A+2"
#define STORE_POSITION_TEXT "Z+C+1"
@@ -50,7 +51,7 @@
#define TIMER_RESET_TEXT "Z+C+B+1"
#define FREE_CAM_TEXT "Z+C+B+Minus"
#define MOVE_LINK_TEXT "Z+C+B+Plus"
-#define FRAME_ADVANCE_TEXT "Z+C+B+D-PAD right"
+#define FRAME_ADVANCE_TEXT "Z+D-PAD up"
#endif
extern bool reload_area_flag;
diff --git a/src/controller.cpp b/src/controller.cpp
index 679cb2a..2d52e83 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -25,9 +25,9 @@
#endif
#ifdef WII_PLATFORM
#define buttonStatus (tp_mPad.mHoldButton)
-#define A_BUTTON (GZPad::A)
-#define ITEM_WHEEL_BUTTON (GZPad::MINUS)
-#define TRIGGER_BUTTONS (GZPad::Z | GZPad::C)
+#define A_BUTTON (CButton::A)
+#define ITEM_WHEEL_BUTTON (CButton::MINUS)
+#define TRIGGER_BUTTONS (CButton::Z | CButton::C)
#endif
static uint16_t sButtonsLastFrame = 0;
@@ -53,13 +53,13 @@ static ButtonState buttonStates[BUTTON_STATES] = {
#endif
#ifdef WII_PLATFORM
static ButtonState buttonStates[BUTTON_STATES] = {
- {GZPad::DPAD_LEFT, 0xFFFFFFFF, false}, {GZPad::DPAD_RIGHT, 0xFFFFFFFF, false},
- {GZPad::DPAD_DOWN, 0xFFFFFFFF, false}, {GZPad::DPAD_UP, 0xFFFFFFFF, false},
- {GZPad::PLUS, 0xFFFFFFFF, false}, {GZPad::TWO, 0xFFFFFFFF, false},
- {GZPad::ONE, 0xFFFFFFFF, false}, {GZPad::B, 0xFFFFFFFF, false},
- {GZPad::A, 0xFFFFFFFF, false}, {GZPad::MINUS, 0xFFFFFFFF, false},
- {GZPad::Z, 0xFFFFFFFF, false}, {GZPad::C, 0xFFFFFFFF, false},
- {GZPad::HOME, 0xFFFFFFFF, false},
+ {CButton::DPAD_LEFT, 0xFFFFFFFF, false}, {CButton::DPAD_RIGHT, 0xFFFFFFFF, false},
+ {CButton::DPAD_DOWN, 0xFFFFFFFF, false}, {CButton::DPAD_UP, 0xFFFFFFFF, false},
+ {CButton::PLUS, 0xFFFFFFFF, false}, {CButton::TWO, 0xFFFFFFFF, false},
+ {CButton::ONE, 0xFFFFFFFF, false}, {CButton::B, 0xFFFFFFFF, false},
+ {CButton::A, 0xFFFFFFFF, false}, {CButton::MINUS, 0xFFFFFFFF, false},
+ {CButton::Z, 0xFFFFFFFF, false}, {CButton::C, 0xFFFFFFFF, false},
+ {CButton::HOME, 0xFFFFFFFF, false},
};
#endif
@@ -102,6 +102,11 @@ void GZ_readController() {
setGamepadButtons(0);
setGamepadTrig(0);
+
+#ifdef WII_PLATFORM
+ tp_mPad.mTrigButton = 0;
+#endif
+
#ifdef GCN_PLATFORM
buttonStatus = 0x0;
tp_mPadButton.mRepeat = 0x0;
diff --git a/src/corotdcheck.cpp b/src/corotdcheck.cpp
index b7a9130..4cae71a 100644
--- a/src/corotdcheck.cpp
+++ b/src/corotdcheck.cpp
@@ -11,6 +11,7 @@
#define ITEM_BUTTON_DOWN_CHECK (GZ_getButtonPressed(GZPad::Y) || GZ_getButtonPressed(GZPad::X))
#define PAD Pad
#endif // GCN_PLATFORM
+
#ifdef WII_PLATFORM
#define ITEM_BUTTON_HELD_CHECK \
(!GZ_getButtonHold(GZPad::B) || !GZ_getButtonHold(GZPad::DPAD_LEFT) || \
diff --git a/src/free_cam.cpp b/src/free_cam.cpp
index 5c6c71a..324c31c 100644
--- a/src/free_cam.cpp
+++ b/src/free_cam.cpp
@@ -24,15 +24,16 @@ double yaw = 0.0;
#define PITCH_CONTROL (tp_mPadStatus.substick_y)
#define YAW_CONTROL (tp_mPadStatus.substick_x)
#endif
+
#ifdef WII_PLATFORM
-#define CONTROL_Y ((tp_mPad.mHoldButton & GZPad::C) == 0 ? tp_mPad.stick.y * 0x48 : 0)
-#define CONTROL_X ((tp_mPad.mHoldButton & GZPad::C) == 0 ? -tp_mPad.stick.x * 0x48 : 0)
+#define CONTROL_Y ((tp_mPad.mHoldButton & CButton::C) == 0 ? tp_mPad.stick.y * 0x48 : 0)
+#define CONTROL_X ((tp_mPad.mHoldButton & CButton::C) == 0 ? -tp_mPad.stick.x * 0x48 : 0)
#define VERTICAL_DISPLACEMENT \
- ((tp_mPad.mHoldButton & GZPad::DPAD_UP ? 75 : 0) - \
- (tp_mPad.mHoldButton & GZPad::DPAD_DOWN ? 75 : 0))
-#define SPEED_PREDICATE (tp_mPad.mHoldButton & GZPad::Z)
-#define PITCH_CONTROL ((tp_mPad.mHoldButton & GZPad::C) != 0 ? tp_mPad.stick.y * 0x3B : 0)
-#define YAW_CONTROL ((tp_mPad.mHoldButton & GZPad::C) != 0 ? -tp_mPad.stick.x * 0x3B : 0)
+ ((tp_mPad.mHoldButton & CButton::DPAD_UP ? 75 : 0) - \
+ (tp_mPad.mHoldButton & CButton::DPAD_DOWN ? 75 : 0))
+#define SPEED_PREDICATE (tp_mPad.mHoldButton & CButton::Z)
+#define PITCH_CONTROL ((tp_mPad.mHoldButton & CButton::C) != 0 ? tp_mPad.stick.y * 0x3B : 0)
+#define YAW_CONTROL ((tp_mPad.mHoldButton & CButton::C) != 0 ? -tp_mPad.stick.x * 0x3B : 0)
#endif
void FreeCam::execute() {
diff --git a/src/lib.cpp b/src/lib.cpp
index cd23d22..d07f908 100644
--- a/src/lib.cpp
+++ b/src/lib.cpp
@@ -76,8 +76,8 @@ void game_loop() {
#endif
#ifdef WII_PLATFORM
#define BUTTONS (tp_mPad.mHoldButton)
-#define CANCEL_LOAD_BUTTONS (Z | C | B)
-#define SHOW_MENU_BUTTONS (Z | C | MINUS)
+#define CANCEL_LOAD_BUTTONS (CButton::Z | CButton::C | CButton::B)
+#define SHOW_MENU_BUTTONS (CButton::Z | CButton::C | CButton::MINUS)
#endif
// Button combo to bypass the automatic loading of the save file
diff --git a/src/menus/general_flags_menu.cpp b/src/menus/general_flags_menu.cpp
index c48aa1a..9e7a0e7 100644
--- a/src/menus/general_flags_menu.cpp
+++ b/src/menus/general_flags_menu.cpp
@@ -31,7 +31,7 @@ Line lines[LINE_NUM] = {
{"midna healed", MIDNA_HEALTHY, "Toggle flag for Midna being healed", true, &l_midnaHealed},
{"midna on back", MIDNA_ON_BACK, "Toggle flag for Midna appearing on Wolf Link's back", true,
&l_midnaRide},
- {"midna on Z", MIDNA_Z_INDEX, "Toggle flag for being able to call Midna", true, &l_midnaZ},
+ {"midna available", MIDNA_Z_INDEX, "Toggle flag for being able to call Midna", true, &l_midnaZ},
{"transform/warp", TRANSFORM_WARP_INDEX, "Toggle flag for transforming/warping", true,
&l_transformWarp},
{"wolf sense", WOLF_SENSE_INDEX, "Toggle flag for wolf sense", true, &l_wolfSense},
diff --git a/src/menus/item_wheel_menu.cpp b/src/menus/item_wheel_menu.cpp
index 7148d76..db95ca2 100644
--- a/src/menus/item_wheel_menu.cpp
+++ b/src/menus/item_wheel_menu.cpp
@@ -9,6 +9,16 @@
#define LINE_NUM ITEM_WHEEL_SLOTS
#define MAX_ITEMS 58
+#ifdef GCN_PLATFORM
+#define DEFAULT_BTN_TXT "Z"
+#define DEFAULT_BTN GZPad::Z
+#endif
+
+#ifdef WII_PLATFORM
+#define DEFAULT_BTN_TXT "+"
+#define DEFAULT_BTN GZPad::PLUS
+#endif
+
Cursor ItemWheelMenu::cursor;
const uint8_t l_validItems[] = {
@@ -188,7 +198,7 @@ void ItemWheelMenu::draw() {
if (l_lookupTbl[j].item_id == l_defaultItems[slot_no]) {
tp_sprintf(lines[slot_no].description,
- "Slot %d default: %s. Press Z to set to default", slot_no,
+ "Slot %d default: %s. Press " DEFAULT_BTN_TXT " to set to default", slot_no,
l_lookupTbl[j].name);
} else {
continue;
@@ -218,7 +228,7 @@ void ItemWheelMenu::draw() {
dComIfGs_setItem(cursor.y, l_validItems[l_listIdx]);
}
- if (GZ_getButtonTrig(GZPad::Z)) {
+ if (GZ_getButtonTrig(DEFAULT_BTN)) {
dComIfGs_setItem(cursor.y, l_defaultItems[cursor.y]);
}
diff --git a/src/movelink.cpp b/src/movelink.cpp
index ad3ebf0..53faca3 100644
--- a/src/movelink.cpp
+++ b/src/movelink.cpp
@@ -20,11 +20,11 @@
#endif
#ifdef WII_PLATFORM
-#define CONTROL_Y ((tp_mPad.mHoldButton & GZPad::C) == 0 ? tp_mPad.stick.y * 72 : 0)
-#define CONTROL_X ((tp_mPad.mHoldButton & GZPad::C) == 0 ? -tp_mPad.stick.x * 72 : 0)
-#define VERTICAL_DISPLACEMENT ((tp_mPad.mHoldButton & GZPad::C) != 0 ? tp_mPad.stick.y * 59 : 0)
-#define HORIZONTAL_DISPLACEMENT ((tp_mPad.mHoldButton & GZPad::C) != 0 ? -tp_mPad.stick.x * 59 : 0)
-#define SPEED_PREDICATE (tp_mPad.mHoldButton & GZPad::Z)
+#define CONTROL_Y ((tp_mPad.mHoldButton & CButton::C) == 0 ? tp_mPad.stick.y * 72 : 0)
+#define CONTROL_X ((tp_mPad.mHoldButton & CButton::C) == 0 ? -tp_mPad.stick.x * 72 : 0)
+#define VERTICAL_DISPLACEMENT ((tp_mPad.mHoldButton & CButton::C) != 0 ? tp_mPad.stick.y * 59 : 0)
+#define HORIZONTAL_DISPLACEMENT ((tp_mPad.mHoldButton & CButton::C) != 0 ? -tp_mPad.stick.x * 59 : 0)
+#define SPEED_PREDICATE (tp_mPad.mHoldButton & CButton::Z)
#endif
#define WHITE_RGBA 0xFFFFFFFF
diff --git a/src/utils/audio.cpp b/src/utils/audio.cpp
index 4fe3d93..ca79bd1 100644
--- a/src/utils/audio.cpp
+++ b/src/utils/audio.cpp
@@ -24,6 +24,7 @@ void GZ_disableSFX() {
g_mDoAud_zelAudio.mAudioMgr.mSoundMgr.mSeMgr.mParams.mParams.mVolume = 0.0f;
}
+
void GZ_enableSFX() {
for (int i = 0; i < 16; i++) {
g_mDoAud_zelAudio.mAudioMgr.mSoundMgr.mSeMgr.mCategoryMgrs[i].mParams.mParams.mVolume =