match most of zurumode.

This commit is contained in:
Prakxo
2022-12-19 09:53:02 +01:00
parent ca8a839c96
commit a25019b474
9 changed files with 76 additions and 10 deletions
+8 -6
View File
@@ -1,8 +1,10 @@
# ac_aprilfool_control/aPC_actor_dt.c:
# .text: [0x805153f0, 0x8051542C]
# zurumode/zerucheck_init.c:
# .text: [0x8040eb38, 0x8040EB50] WILL TRY TO FIX these later, one wasn't matching and the other's didn't find the symbol when converting to ELF.
# zurumode/zerucheck_key_check.c:
# .text: [0x8040EB50, 0x8040EDA8]
# zurumode/zurumode_cleanup.c:
# .text: [0x8040efc4, 0x8040f008]
zurumode/zerucheck_init.c:
.text: [0x8040eb38, 0x8040EB50]
zurumode/zerucheck_key_check.c:
.text: [0x8040EB50, 0x8040EDA8]
zurumode/zurumode_cleanup.c:
.text: [0x8040efc4, 0x8040f008]
# zurumode/zurumode_update.c:
# .text: [0x8040EDA8 , 0x8040ee74] Has C++ functions but was matched with C?? Won't really bother at the moment with this one.
+6
View File
@@ -0,0 +1,6 @@
#ifndef _JSYSTEM_JUT_JUTASSERTION_H
#define _JSYSTEM_JUT_JUTASSERTION_H
void JC_JUTAssertion_changeDevice(u32); // I know these are C++ but these were used to match a c function so I'll fix these when I need them or fix zurumode update.
#endif
+9
View File
@@ -0,0 +1,9 @@
#ifndef _JSYSTEM_JUT_JUTDBPRINT_H
#define _JSYSTEM_JUT_JUTDBPRINT_H
void* JC_JUTDbPrint_getManager(void);
void JC_JUTDbPrint_setVisible(void*, int); // I know these are C++ but these were used to match a c function so I'll fix these when I need them or fix zurumode update.
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef _DOLPHIN_OS
#define _DOLPHIN_OS
#include "types.h"
void OSReport(const char*, ...);
#endif
+6
View File
@@ -0,0 +1,6 @@
#ifndef LIBULTRA_H
#define LIBULTRA_H
extern s32 osAppNMIBuffer[16];
#endif
+7 -2
View File
@@ -3,6 +3,11 @@
#include "types.h"
#include "dolphin/os.h"
#include "libultra/libultra.h"
#include "JSystem/JUT/JUTAssertion.h"
#include "JSystem/JUT/JUTDbPrint.h"
typedef struct zuru_keycheck_s {
u8 state;
u8 progressing;
@@ -10,8 +15,8 @@ typedef struct zuru_keycheck_s {
u8 zurumode_enabled;
} zuru_keycheck;
static zuru_keycheck zuruKeyCheck;
extern zuru_keycheck zuruKeyCheck;
extern s32 zurumode_flag;
#define ZURUMODE_RESET 0
#define ZURUMODE_PROGRESSING 1
+1 -1
View File
@@ -1,6 +1,6 @@
#include "zurumode.h"
static int zerucheck_init(zuru_keycheck* key_check) {
int zerucheck_init(zuru_keycheck* key_check) {
key_check->zurumode_enabled = FALSE;
key_check->state = ZURUMODE_STAGE_BEGIN_e;
key_check->progressing = ZURUMODE_RESET;
+1 -1
View File
@@ -21,7 +21,7 @@
* @param controller current controller state
* @return int zurumodeEnabled
*/
static int zerucheck_key_check(zuru_keycheck* key_check, u32 controller) {
int zerucheck_key_check(zuru_keycheck* key_check, u32 controller) {
u32 controller_new; /* Buttons pressed on the current frame only */
int state = key_check->state; /* Keycheck state */
int progressing = key_check->progressing; /* Progressing through keycheck */
+30
View File
@@ -0,0 +1,30 @@
#include "zurumode.h"
s32 zurumode_update() {
s32 flag_now;
s32 zurumode_now;
flag_now = zurumode_flag;
zurumode_now = osAppNMIBuffer[15];
if (zurumode_now & 1) {
zurumode_now = (zurumode_now >> 3) & 1;
zurumode_now = (int)(zurumode_now + 1);
}
else {
zurumode_now = 0;
}
zurumode_flag = zurumode_now;
if (flag_now != zurumode_now) {
OSReport("zurumode_flag が %d から %d に変更されました\n", flag_now, zurumode_now);
if (zurumode_flag != 0) {
if ((osAppNMIBuffer[15] & 0x40) || (osAppNMIBuffer[15] & 1)) {
JC_JUTAssertion_changeDevice(3);
JC_JUTDbPrint_setVisible(JC_JUTDbPrint_getManager(), 1);
}
} else {
JC_JUTAssertion_changeDevice(2);
JC_JUTDbPrint_setVisible(JC_JUTDbPrint_getManager(), 0);
}
}
return zurumode_flag;