refactor: use LUS 1.0 RC

Co-authored-by: kenix3 <kenixwhisperwind@gmail.com>
Co-authored-by: David Chavez <david@dcvz.io>
Co-authored-by: KiritoDv <kiritodev01@gmail.com>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
briaguya 2023-01-17 00:17:49 -05:00 committed by briaguya
commit ba13e6b2c4
863 changed files with 9227 additions and 4416 deletions

View file

@ -1,6 +1,6 @@
#ifndef FP_H
#define FP_H
#include "ultra64.h"
#include <libultraship/libultra.h>
extern f32 qNaN0x3FFFFF;
extern f32 qNaN0x10000;

View file

@ -2,6 +2,7 @@
#define FUNCTIONS_H
#include "z64.h"
#include <stdarg.h>
#ifdef __cplusplus
#define this thisx
@ -97,8 +98,6 @@ void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s3
void LogUtils_LogThreadId(const char* name, s32 line);
void LogUtils_HungupThread(const char* name, s32 line);
void LogUtils_ResetHungup(void);
s32 vsprintf(char* dst, const char* fmt, va_list args);
s32 sprintf(char* dst, const char* fmt, ...);
void __osPiCreateAccessQueue(void);
void __osPiGetAccess(void);
void __osPiRelAccess(void);

View file

@ -9,7 +9,7 @@
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/gameconsole.h"
#include "soh/Enhancements/gameplaystats.h"
#include <Cvar.h>
#include <libultraship/bridge.h>
#define _AudioseqSegmentRomStart "Audioseq"
#define _AudiobankSegmentRomStart "Audiobank"
@ -38,4 +38,8 @@
#define _z_select_staticSegmentRomStart 0
#define _z_select_staticSegmentRomEnd 0
// TODO: POSIX/BSD Bug, this is a hack to fix the build compilation on any BSD system (Switch, Wii-U, Vita, etc)
// <sys/types.h> defines quad as a macro, which conflicts with the quad parameter on z_collision_check.c
#undef quad
#endif

View file

@ -1,7 +1,7 @@
#ifndef MATH_H
#define MATH_H
#include "ultra64/types.h"
#include <libultraship/libultra.h>
#define M_PI 3.14159265358979323846f
#define M_SQRT2 1.41421356237309504880f

View file

@ -1,7 +1,7 @@
#ifndef STDLIB_H
#define STDLIB_H
#include "ultra64.h"
#include <libultraship/libultra.h>
#if 0

View file

@ -300,9 +300,9 @@ extern GraphicsContext* __gfxCtx;
// #endregion
// #region SOH [Enhancements]
#define CHECK_EQUIPMENT_AGE(i, j) (CVar_GetS32("gTimelessEquipment", 0) || (gEquipAgeReqs[i][j] == 9) || (gEquipAgeReqs[i][j] == ((void)0, gSaveContext.linkAge)))
#define CHECK_SLOT_AGE(slotIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gSlotAgeReqs[slotIndex] == 9) || gSlotAgeReqs[slotIndex] == ((void)0, gSaveContext.linkAge))
#define CHECK_ITEM_AGE(itemIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gItemAgeReqs[itemIndex] == 9) || (gItemAgeReqs[itemIndex] == gSaveContext.linkAge))
#define CHECK_EQUIPMENT_AGE(i, j) (CVarGetInteger("gTimelessEquipment", 0) || (gEquipAgeReqs[i][j] == 9) || (gEquipAgeReqs[i][j] == ((void)0, gSaveContext.linkAge)))
#define CHECK_SLOT_AGE(slotIndex) (CVarGetInteger("gTimelessEquipment", 0) || (gSlotAgeReqs[slotIndex] == 9) || gSlotAgeReqs[slotIndex] == ((void)0, gSaveContext.linkAge))
#define CHECK_ITEM_AGE(itemIndex) (CVarGetInteger("gTimelessEquipment", 0) || (gItemAgeReqs[itemIndex] == 9) || (gItemAgeReqs[itemIndex] == gSaveContext.linkAge))
#define DPAD_ITEM(button) ((gSaveContext.buttonStatus[(button) + 5] != BTN_DISABLED) \
? gSaveContext.equips.buttonItems[(button) + 4] \

View file

@ -1,35 +0,0 @@
#ifndef ULTRA64_H
#define ULTRA64_H
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include "ultra64/types.h"
#include "unk.h"
#include "libc/stdarg.h"
#include "libc/stdbool.h"
#include "libc/stddef.h"
#include "libc/stdlib.h"
#include "libc/math.h"
#include "ultra64/exception.h"
#include "ultra64/rcp.h"
#include "ultra64/rdp.h"
#include "ultra64/rsp.h"
#include "ultra64/thread.h"
#include "ultra64/convert.h"
#include "ultra64/time.h"
#include "ultra64/message.h"
#include "ultra64/sptask.h"
#include "ultra64/gu.h"
#include "ultra64/vi.h"
#include "ultra64/pi.h"
#include "ultra64/controller.h"
#include "ultra64/printf.h"
#include "ultra64/mbi.h"
#include "ultra64/pfs.h"
#include "ultra64/motor.h"
#include "ultra64/r4300.h"
#endif

View file

@ -1,8 +1,8 @@
#ifndef Z64_H
#define Z64_H
#include "ultra64.h"
#include "ultra64/gs2dex.h"
#include <libultraship/libultra.h>
#include "unk.h" // this used to get pulled in via ultra64.h
#include "z64save.h"
#include "z64light.h"
#include "z64bgcheck.h"
@ -27,7 +27,7 @@
#include "alignment.h"
#include "sequence.h"
#include "sfx.h"
#include <color.h>
#include <libultraship/color.h>
#include "ichain.h"
#include "regs.h"
@ -45,6 +45,7 @@ namespace Ship
class Scene;
class DisplayList;
};
#include <memory>
#endif
#define SCREEN_WIDTH 320
@ -948,14 +949,6 @@ typedef struct {
typedef struct {
/* 0x00 */ Gfx* opa;
/* 0x04 */ Gfx* xlu;
#ifdef __cplusplus
Ship::DisplayList* opaDL;
Ship::DisplayList* xluDL;
#else
void* opaDL;
void* xluDL;
#endif
} PolygonDlist; // size = 0x8
@ -1016,14 +1009,6 @@ typedef struct {
/* 0x06 */ s16 unk_06;
/* 0x08 */ Gfx* opa;
/* 0x0C */ Gfx* xlu;
#ifdef __cplusplus
Ship::DisplayList* opaDL;
Ship::DisplayList* xluDL;
#else
void* opaDL;
void* xluDL;
#endif
} PolygonDlist2; // size = 0x8
typedef struct {
@ -1087,12 +1072,7 @@ typedef struct {
/* 0x58 */ OSMesgQueue loadQueue;
/* 0x70 */ OSMesg loadMsg;
/* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config
#ifdef __cplusplus
Ship::Scene* roomToLoad;
#else
void* roomToLoad;
#endif
} RoomContext; // size = 0x78
typedef struct {
@ -1310,13 +1290,7 @@ typedef struct PlayState {
/* 0x000A4 */ s16 sceneNum;
/* 0x000A6 */ u8 sceneConfig;
/* 0x000A7 */ char unk_A7[0x9];
#ifdef __cplusplus
Ship::Scene* sceneSegment;
#else
/* 0x000B0 */ void* sceneSegment;
#endif
/* 0x000B8 */ View view;
/* 0x001E0 */ Camera mainCamera;
/* 0x0034C */ Camera subCameras[NUM_CAMS - SUBCAM_FIRST];

View file

@ -1,7 +1,7 @@
#ifndef Z64_ANIMATION_H
#define Z64_ANIMATION_H
#include "ultra64.h"
#include <libultraship/libultra.h>
#include "z64dma.h"
#include "z64math.h"

View file

@ -127,7 +127,7 @@ typedef struct {
typedef struct {
/* 0x00 */ s32 order;
/* 0x04 */ s32 npredictors;
/* 0x08 */ s16 book[]; // size 8 * order * npredictors. 8-byte aligned
/* 0x08 */ s16* book; // size 8 * order * npredictors. 8-byte aligned
} AdpcmBook; // size >= 0x8
typedef struct
@ -137,7 +137,7 @@ typedef struct
/* 0x00 */ u32 codec : 4;
/* 0x00 */ u32 medium : 2;
/* 0x00 */ u32 unk_bit26 : 1;
/* 0x00 */ u32 unk_bit25 : 1;
/* 0x00 */ u32 unk_bit25 : 1; // this has been named isRelocated in zret
/* 0x01 */ u32 size : 24;
};
u32 asU32;
@ -819,7 +819,7 @@ typedef struct {
/* 0x0E */ u8 ttl; // duration after which the DMA can be discarded
} SampleDma; // size = 0x10
#include <ultra64/abi.h>
#include <libultraship/libultra/abi.h>
typedef struct {
/* 0x0000 */ char unk_0000;

View file

@ -1,7 +1,7 @@
#ifndef Z64CAMERA_H
#define Z64CAMERA_H
#include "ultra64.h"
#include <libultraship/libultra.h>
#include "z64cutscene.h"
#define CAM_STAT_CUT 0

View file

@ -1,7 +1,7 @@
#ifndef Z64CUTSCENE_H
#define Z64CUTSCENE_H
#include "ultra64.h"
#include <libultraship/libultra.h>
typedef struct {
/* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger

View file

@ -1,7 +1,7 @@
#ifndef Z64_DMA_H
#define Z64_DMA_H
#include "ultra64.h"
#include <libultraship/libultra.h>
typedef struct {
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)

View file

@ -1,7 +1,7 @@
#ifndef Z64EFFECT_H
#define Z64EFFECT_H
#include <color.h>
#include <libultraship/color.h>
struct GraphicsContext;
struct PlayState;

View file

@ -1,7 +1,7 @@
#ifndef Z64ELF_MESSAGE_H
#define Z64ELF_MESSAGE_H
#include "ultra64.h"
#include <libultraship/libultra.h>
// Checks the condition and exits the script if the check passes
#define ELF_MSG_TYPE_CHECK 0

View file

@ -1,10 +1,10 @@
#ifndef Z64LIGHT_H
#define Z64LIGHT_H
#include "ultra64.h"
#include "ultra64/gbi.h"
#include <libultraship/libultra.h>
#include <libultraship/libultra/gbi.h>
#include "z64math.h"
#include <color.h>
#include <libultraship/color.h>
typedef struct {
/* 0x0 */ s16 x;

View file

@ -1,7 +1,7 @@
#ifndef Z64MAP_MARK_H
#define Z64MAP_MARK_H
#include "ultra64.h"
#include <libultraship/libultra.h>
#define MAP_MARK_NONE -1
#define MAP_MARK_CHEST 0

View file

@ -1,7 +1,8 @@
#ifndef Z64MATH_H
#define Z64MATH_H
#include "ultra64.h"
#include <libultraship/libultra.h>
#include <include/libc/math.h>
#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z)

View file

@ -1,7 +1,7 @@
#ifndef Z64SAVE_H
#define Z64SAVE_H
#include "ultra64.h"
#include <libultraship/libultra.h>
#include "z64math.h"
#include "z64audio.h"
#include "soh/Enhancements/randomizer/randomizerTypes.h"

View file

@ -1,8 +1,8 @@
#ifndef Z64TRANSITION_H
#define Z64TRANSITION_H
#include "ultra64.h"
#include <color.h>
#include <libultraship/libultra.h>
#include <libultraship/color.h>
typedef struct {
f32 unk_0;