1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-11 01:10:33 +00:00

libultra cleanup (#215)

* cleanup libultra

* fixes

- use quotes instead of <> for includes
- add macros for zelda specific thread priorities
- fix Makefile
- properly format the remaining pfs structs

* fix button macros + add CHECK_BTN_ANY/CHECK_BTN_ALL

* remove ULTRA_ABS

* fix includes

* update z_player.c/z_lib.c + run format.sh

* merge upstream/master

* fix include in En_Goroiwa

* fix includes
This commit is contained in:
Random 2020-10-03 17:22:44 +02:00 committed by GitHub
parent 6136ee6deb
commit 174af7384d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
890 changed files with 2628 additions and 5625 deletions

View file

@ -4,8 +4,7 @@
* Description: Initializes the game into the title screen
*/
#include <ultra64.h>
#include <global.h>
#include "global.h"
void Opening_SetupTitleScreen(OpeningContext* this) {
gSaveContext.gameMode = 1;

View file

@ -4,10 +4,10 @@
* Description: Debug Scene Select Menu
*/
#include <ultra64.h>
#include <global.h>
#include <vt.h>
#include <alloca.h>
#include "ultra64.h"
#include "global.h"
#include "vt.h"
#include "alloca.h"
void Select_LoadTitle(SelectContext* this) {
this->state.running = false;
@ -181,14 +181,14 @@ void Select_UpdateMenu(SelectContext* this) {
if (this->unk_21C == 0) {
if (CHECK_PAD(controller1->press, A_BUTTON) || CHECK_PAD(controller1->press, START_BUTTON)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_A) || CHECK_BTN_ALL(controller1->press.button, BTN_START)) {
selectedScene = &this->scenes[this->currentScene];
if (selectedScene->loadFunc != NULL) {
selectedScene->loadFunc(this, selectedScene->entranceIndex);
}
}
if (CHECK_PAD(controller1->press, B_BUTTON)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_B)) {
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
gSaveContext.linkAge = 1;
} else {
@ -196,7 +196,7 @@ void Select_UpdateMenu(SelectContext* this) {
}
}
if (CHECK_PAD(controller1->press, Z_TRIG)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_Z)) {
if (gSaveContext.cutsceneIndex == 0x8000) {
gSaveContext.cutsceneIndex = 0;
} else if (gSaveContext.cutsceneIndex == 0) {
@ -224,7 +224,7 @@ void Select_UpdateMenu(SelectContext* this) {
} else if (gSaveContext.cutsceneIndex == 0xFFFA) {
gSaveContext.cutsceneIndex = 0x8000;
}
} else if (CHECK_PAD(controller1->press, R_TRIG)) {
} else if (CHECK_BTN_ALL(controller1->press.button, BTN_R)) {
if (gSaveContext.cutsceneIndex == 0x8000) {
gSaveContext.cutsceneIndex = 0xFFFA;
} else if (gSaveContext.cutsceneIndex == 0) {
@ -260,14 +260,14 @@ void Select_UpdateMenu(SelectContext* this) {
}
// user can change "opt", but it doesn't do anything
if (CHECK_PAD(controller1->press, U_CBUTTONS)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_CUP)) {
this->opt--;
}
if (CHECK_PAD(controller1->press, D_CBUTTONS)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_CDOWN)) {
this->opt++;
}
if (CHECK_PAD(controller1->press, U_JPAD)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_DUP)) {
if (this->unk_22C == 1) {
this->unk_224 = 0;
}
@ -279,12 +279,12 @@ void Select_UpdateMenu(SelectContext* this) {
}
}
if (CHECK_PAD(controller1->cur, U_JPAD) && this->unk_224 == 0) {
if (CHECK_BTN_ALL(controller1->cur.button, BTN_DUP) && this->unk_224 == 0) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->unk_220 = SREG(30) * 3;
}
if (CHECK_PAD(controller1->press, D_JPAD)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_DDOWN)) {
if (this->unk_230 == 1) {
this->unk_228 = 0;
}
@ -296,23 +296,24 @@ void Select_UpdateMenu(SelectContext* this) {
}
}
if (CHECK_PAD(controller1->cur, D_JPAD) && (this->unk_228 == 0)) {
if (CHECK_BTN_ALL(controller1->cur.button, BTN_DDOWN) && (this->unk_228 == 0)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->unk_220 = -SREG(30) * 3;
}
if (CHECK_PAD(controller1->press, L_JPAD) || CHECK_PAD(controller1->cur, L_JPAD)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_DLEFT) || CHECK_BTN_ALL(controller1->cur.button, BTN_DLEFT)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->unk_220 = SREG(30);
}
if (CHECK_PAD(controller1->press, R_JPAD) || CHECK_PAD(controller1->cur, R_JPAD)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_DRIGHT) ||
CHECK_BTN_ALL(controller1->cur.button, BTN_DRIGHT)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->unk_220 = -SREG(30);
}
}
if (CHECK_PAD(controller1->press, L_TRIG)) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_L)) {
this->unk_1DC++;
this->unk_1DC = (this->unk_1DC + 7) % 7;
this->currentScene = this->unk_20C = this->unk_1E0[this->unk_1DC];

View file

@ -4,9 +4,8 @@
* Description: Displays the Nintendo Logo
*/
#include <ultra64.h>
#include <global.h>
#include <alloca.h>
#include "global.h"
#include "alloca.h"
extern Gfx D_01002720[];
extern u8 D_01001800[];