mirror of https://github.com/zeldaret/mm.git
Small general cleanup (#1644)
* m2ctx.py * check warnings * vimode includes * bgcheck includes * padmgr includes * sprintf * z_std_dma * sys_ucode * z64voice * z64lib * z64effect_ss * segment_symbols.h * padutils * main * stdarg.h * fault * bzero * undefined_syms * z64rumble
This commit is contained in:
parent
0b375cadb0
commit
3705eaedac
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
#include "stdarg.h"
|
#include "stdarg.h"
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "PR/controller.h"
|
|
||||||
|
|
||||||
#include "padmgr.h"
|
#include "padmgr.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#include "stdarg.h"
|
||||||
|
|
||||||
int vaprintf(PrintCallback* pfn, const char* fmt, va_list args);
|
int vaprintf(PrintCallback* pfn, const char* fmt, va_list args);
|
||||||
int aprintf(PrintCallback* pfn, const char* fmt, ...);
|
int aprintf(PrintCallback* pfn, const char* fmt, ...);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#include "stdarg.h"
|
||||||
|
|
||||||
int vsprintf(char* dst, const char* fmt, va_list args);
|
int vsprintf(char* dst, const char* fmt, va_list args);
|
||||||
int sprintf(char* dst, const char* fmt, ...);
|
int sprintf(char* dst, const char* fmt, ...);
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#define MAIN_H
|
#define MAIN_H
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
#include "scheduler.h"
|
#include "scheduler.h"
|
||||||
#include "padmgr.h"
|
#include "padmgr.h"
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#ifndef PADMGR_H
|
#ifndef PADMGR_H
|
||||||
#define PADMGR_H
|
#define PADMGR_H
|
||||||
|
|
||||||
#include "stdbool.h"
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#include "stdbool.h"
|
||||||
|
|
||||||
#include "irqmgr.h"
|
#include "irqmgr.h"
|
||||||
#include "padutils.h"
|
#include "padutils.h"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef PADUTILS_H
|
#ifndef PADUTILS_H
|
||||||
#define PADUTILS_H
|
#define PADUTILS_H
|
||||||
|
|
||||||
#include "PR/controller.h"
|
#include "PR/os_cont.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct Input {
|
typedef struct Input {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define SEGMENT_SYMBOLS_H
|
#define SEGMENT_SYMBOLS_H
|
||||||
|
|
||||||
#include "stddef.h"
|
#include "stddef.h"
|
||||||
|
#include "stdint.h"
|
||||||
#include "PR/ultratypes.h"
|
#include "PR/ultratypes.h"
|
||||||
|
|
||||||
#include "romfile.h"
|
#include "romfile.h"
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
#define Z64DMA_H
|
#define Z64DMA_H
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
#include "unk.h"
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
#include "romfile.h"
|
#include "romfile.h"
|
||||||
|
#include "unk.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
|
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
#include "color.h"
|
#include "stdint.h"
|
||||||
#include "z64math.h"
|
|
||||||
|
|
||||||
|
#include "color.h"
|
||||||
#include "z64dma.h"
|
#include "z64dma.h"
|
||||||
#include "z64eff_ss_dead.h"
|
#include "z64eff_ss_dead.h"
|
||||||
|
#include "z64math.h"
|
||||||
|
|
||||||
struct Actor;
|
struct Actor;
|
||||||
struct PlayState;
|
struct PlayState;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "z64math.h"
|
#include "z64math.h"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define Z64RUMBLE_H
|
#define Z64RUMBLE_H
|
||||||
|
|
||||||
#include "PR/ultratypes.h"
|
#include "PR/ultratypes.h"
|
||||||
#include "PR/controller.h"
|
|
||||||
|
|
||||||
typedef enum RumbleManagerState {
|
typedef enum RumbleManagerState {
|
||||||
/* 0 */ RUMBLEMANAGER_STATE_WIPE, // Disables the request processing and wipes every request. It can be either set manually or automatically by the system as fail-safe in case the Rumble Pak has been vibrating for 2 minutes
|
/* 0 */ RUMBLEMANAGER_STATE_WIPE, // Disables the request processing and wipes every request. It can be either set manually or automatically by the system as fail-safe in case the Rumble Pak has been vibrating for 2 minutes
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "PR/ultratypes.h"
|
#include "PR/ultratypes.h"
|
||||||
#include "PR/os_time.h"
|
#include "PR/os_time.h"
|
||||||
|
|
||||||
#include "unk.h"
|
#include "unk.h"
|
||||||
|
|
||||||
struct GameState;
|
struct GameState;
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
#define Z64VOICE_H
|
#define Z64VOICE_H
|
||||||
|
|
||||||
#include "PR/ultratypes.h"
|
#include "PR/ultratypes.h"
|
||||||
#include "unk.h"
|
#include "PR/os_message.h"
|
||||||
#include "PR/os_voice.h"
|
#include "PR/os_voice.h"
|
||||||
|
|
||||||
|
#include "unk.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x000 */ u16 words[20][15]; // 20 words, each with up to 15 syllables
|
/* 0x000 */ u16 words[20][15]; // 20 words, each with up to 15 syllables
|
||||||
/* 0x258 */ u8 numWords;
|
/* 0x258 */ u8 numWords;
|
||||||
|
|
|
@ -129,8 +129,7 @@ gFramebufferHiRes0 = gHiBuffer;
|
||||||
|
|
||||||
// Ucode symbols
|
// Ucode symbols
|
||||||
|
|
||||||
rspbootTextSize = 0x160;
|
rspbootTextEnd = rspbootTextStart + 0x160;
|
||||||
rspbootTextEnd = rspbootTextStart + rspbootTextSize;
|
|
||||||
aspMainTextEnd = aspMainTextStart + 0x1000;
|
aspMainTextEnd = aspMainTextStart + 0x1000;
|
||||||
aspMainDataEnd = aspMainDataStart + 0x2E0;
|
aspMainDataEnd = aspMainDataStart + 0x2E0;
|
||||||
|
|
||||||
|
@ -156,7 +155,6 @@ D_04023428 = 0x04023428;
|
||||||
D_04051180 = 0x04051180;
|
D_04051180 = 0x04051180;
|
||||||
D_04051238 = 0x04051238;
|
D_04051238 = 0x04051238;
|
||||||
D_0406AB30 = 0x0406AB30;
|
D_0406AB30 = 0x0406AB30;
|
||||||
D_0407AB70 = 0x0407AB70;
|
|
||||||
D_0407D590 = 0x0407D590;
|
D_0407D590 = 0x0407D590;
|
||||||
|
|
||||||
// segment 0x05
|
// segment 0x05
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "padutils.h"
|
#include "padutils.h"
|
||||||
|
|
||||||
|
#include "PR/os_libc.h"
|
||||||
|
|
||||||
void PadUtils_Init(Input* input) {
|
void PadUtils_Init(Input* input) {
|
||||||
bzero(input, sizeof(Input));
|
bzero(input, sizeof(Input));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "libc64/sprintf.h"
|
#include "libc64/sprintf.h"
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
void* proutPrintf(void* dst, const char* fmt, size_t size) {
|
void* proutPrintf(void* dst, const char* fmt, size_t size) {
|
||||||
|
@ -20,7 +21,7 @@ int sprintf(char* dst, const char* fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
||||||
ans = _Printf(&proutPrintf, dst, fmt, args);
|
ans = _Printf(proutPrintf, dst, fmt, args);
|
||||||
if (ans > -1) {
|
if (ans > -1) {
|
||||||
dst[ans] = 0;
|
dst[ans] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* There are some additional provisions to ensure that audio DMA is particularly high-speed, the audio data is assumed
|
* There are some additional provisions to ensure that audio DMA is particularly high-speed, the audio data is assumed
|
||||||
* to be uncompressed and the request queue and address translation is skipped.
|
* to be uncompressed and the request queue and address translation is skipped.
|
||||||
*/
|
*/
|
||||||
|
#include "prevent_bss_reordering.h"
|
||||||
#include "z64dma.h"
|
#include "z64dma.h"
|
||||||
|
|
||||||
#include "carthandle.h"
|
#include "carthandle.h"
|
||||||
|
|
|
@ -31,11 +31,15 @@
|
||||||
* done while waiting for this operation to complete.
|
* done while waiting for this operation to complete.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "global.h"
|
#include "padmgr.h"
|
||||||
#include "PR/controller.h"
|
|
||||||
#include "PR/os_motor.h"
|
|
||||||
#include "libc64/sprintf.h"
|
#include "libc64/sprintf.h"
|
||||||
|
#include "PR/os_motor.h"
|
||||||
|
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
|
#include "macros.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "z64math.h"
|
||||||
#include "z64voice.h"
|
#include "z64voice.h"
|
||||||
|
|
||||||
extern FaultMgr gFaultMgr;
|
extern FaultMgr gFaultMgr;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#include "sys_ucode.h"
|
#include "sys_ucode.h"
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
u64* initialgspUcodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart;
|
u64* initialgspUcodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart;
|
||||||
u64* initialgspUcodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
|
u64* initialgspUcodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "z64bgcheck.h"
|
#include "z64bgcheck.h"
|
||||||
#include "global.h"
|
|
||||||
|
|
||||||
#include "libc64/fixed_point.h"
|
#include "libc64/fixed_point.h"
|
||||||
#include "libc64/sprintf.h"
|
#include "libc64/sprintf.h"
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "z64actor.h"
|
#include "z64actor.h"
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prevent_bss_reordering.h"
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "z64malloc.h"
|
#include "z64malloc.h"
|
||||||
|
|
|
@ -14,28 +14,6 @@ static s16 sBssPad;
|
||||||
u8 gDisablePlayerCsActionStartPos;
|
u8 gDisablePlayerCsActionStartPos;
|
||||||
s16 gDungeonBossWarpSceneId;
|
s16 gDungeonBossWarpSceneId;
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
// Partial structs taken from "prevent_bss_reordering.h"
|
|
||||||
struct Dummy200 { int x; };
|
|
||||||
struct Dummy201 { int x; };
|
|
||||||
struct Dummy202 { int x; };
|
|
||||||
struct Dummy203 { int x; };
|
|
||||||
struct Dummy204 { int x; };
|
|
||||||
struct Dummy205 { int x; };
|
|
||||||
struct Dummy206 { int x; };
|
|
||||||
struct Dummy207 { int x; };
|
|
||||||
struct Dummy208 { int x; };
|
|
||||||
struct Dummy209 { int x; };
|
|
||||||
struct Dummy210 { int x; };
|
|
||||||
struct Dummy211 { int x; };
|
|
||||||
struct Dummy212 { int x; };
|
|
||||||
struct Dummy213 { int x; };
|
|
||||||
struct Dummy214 { int x; };
|
|
||||||
struct Dummy215 { int x; };
|
|
||||||
struct Dummy216 { int x; };
|
|
||||||
struct Dummy217 { int x; };
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
#include "z64quake.h"
|
#include "z64quake.h"
|
||||||
#include "z64rumble.h"
|
#include "z64rumble.h"
|
||||||
#include "z64shrink_window.h"
|
#include "z64shrink_window.h"
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
#include "global.h"
|
|
||||||
#include "debug.h"
|
|
||||||
#include "z64vimode.h"
|
#include "z64vimode.h"
|
||||||
|
|
||||||
|
#include "stdbool.h"
|
||||||
#include "PR/viint.h"
|
#include "PR/viint.h"
|
||||||
|
|
||||||
|
#include "debug.h"
|
||||||
|
#include "macros.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "padutils.h"
|
||||||
|
#include "regs.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ u32 burst;
|
/* 0x00 */ u32 burst;
|
||||||
/* 0x04 */ u32 vSync;
|
/* 0x04 */ u32 vSync;
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
* to randomly select; these new wait actions are what allow him to summon a ring of fire, drop falling blocks, etc.
|
* to randomly select; these new wait actions are what allow him to summon a ring of fire, drop falling blocks, etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prevent_bss_reordering.h"
|
|
||||||
#include "z_boss_01.h"
|
#include "z_boss_01.h"
|
||||||
#include "z64rumble.h"
|
#include "z64rumble.h"
|
||||||
#include "z64shrink_window.h"
|
#include "z64shrink_window.h"
|
||||||
|
|
|
@ -14,6 +14,7 @@ src_dir = root_dir / "src"
|
||||||
# Project-specific
|
# Project-specific
|
||||||
CPP_FLAGS = [
|
CPP_FLAGS = [
|
||||||
"-Iinclude",
|
"-Iinclude",
|
||||||
|
"-Iinclude/libc",
|
||||||
"-Isrc",
|
"-Isrc",
|
||||||
"-Iassets",
|
"-Iassets",
|
||||||
"-Ibuild",
|
"-Ibuild",
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# Generated warnings counters
|
# Generated warnings counters
|
||||||
warnings_setup_new.txt
|
warnings_setup_new.txt
|
||||||
|
warnings_assets_new.txt
|
||||||
warnings_disasm_new.txt
|
warnings_disasm_new.txt
|
||||||
warnings_build_new.txt
|
warnings_build_new.txt
|
||||||
|
warnings_compress_new.txt
|
||||||
warnings_temp.txt
|
warnings_temp.txt
|
||||||
|
|
|
@ -53,6 +53,7 @@ do
|
||||||
f) full="true"
|
f) full="true"
|
||||||
run="make distclean
|
run="make distclean
|
||||||
make setup
|
make setup
|
||||||
|
make assets
|
||||||
make disasm
|
make disasm
|
||||||
make rom
|
make rom
|
||||||
make compress"
|
make compress"
|
||||||
|
@ -103,6 +104,7 @@ make_warnings () {
|
||||||
if [[ $full ]]; then
|
if [[ $full ]]; then
|
||||||
make distclean
|
make distclean
|
||||||
make_warnings setup setup
|
make_warnings setup setup
|
||||||
|
make_warnings assets assets
|
||||||
make_warnings disasm disasm
|
make_warnings disasm disasm
|
||||||
make_warnings rom build
|
make_warnings rom build
|
||||||
make_warnings compress compress
|
make_warnings compress compress
|
||||||
|
@ -114,7 +116,11 @@ fi
|
||||||
|
|
||||||
if [[ $full ]]; then
|
if [[ $full ]]; then
|
||||||
$COMPARE_WARNINGS setup
|
$COMPARE_WARNINGS setup
|
||||||
|
$COMPARE_WARNINGS assets
|
||||||
$COMPARE_WARNINGS disasm
|
$COMPARE_WARNINGS disasm
|
||||||
|
$COMPARE_WARNINGS build
|
||||||
|
$COMPARE_WARNINGS compress
|
||||||
|
else
|
||||||
|
$COMPARE_WARNINGS build
|
||||||
fi
|
fi
|
||||||
$COMPARE_WARNINGS build
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue