mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-25 19:42:20 +00:00
Merge cbe8c0a838 into 24c5a226ed
This commit is contained in:
commit
88a2c1f782
51 changed files with 158 additions and 327 deletions
|
|
@ -2237,12 +2237,6 @@ ROM_ASSET_LOAD_TEXTURE(texture_waterbox_mist, "textures/segment2/segment2.13458.
|
|||
|
||||
ROM_ASSET_LOAD_TEXTURE(texture_waterbox_lava, "textures/segment2/segment2.13C58.rgba16.inc.c", 0x00108a40, 48390, 0x00016ab8, 2048);
|
||||
|
||||
// Unreferenced light group
|
||||
static const Lights1 segment2_lights_unused = gdSPDefLights1(
|
||||
0x40, 0x40, 0x40,
|
||||
0xff, 0xff, 0xff, 0x28, 0x28, 0x28
|
||||
);
|
||||
|
||||
// 0x02014470 - 0x020144B0
|
||||
static const Mtx matrix_identity = {
|
||||
{{1.0f, 0.0f, 0.0f, 0.0f},
|
||||
|
|
|
|||
|
|
@ -263,9 +263,6 @@ void DynOS_Actor_GeneratePack(const SysPath &aPackFolder) {
|
|||
if (fs_sys_dir_exists(_Folder.c_str())) {
|
||||
_GfxData->mModelIdentifier = 0;
|
||||
|
||||
// Remember the geo layout count
|
||||
s32 prevGeoLayoutCount = _GfxData->mGeoLayouts.Count();
|
||||
|
||||
DynOS_Read_Source(_GfxData, fstring("%s/texture.inc.c", _Folder.c_str()));
|
||||
DynOS_Read_Source(_GfxData, fstring("%s/model.inc.c", _Folder.c_str()));
|
||||
DynOS_Read_Source(_GfxData, fstring("%s/geo.inc.c", _Folder.c_str()));
|
||||
|
|
|
|||
|
|
@ -1928,7 +1928,6 @@ DataNode<T> *FindDataNode(DataNodes<T> &aDataNodes, String &aName, u32 aModelIde
|
|||
|
||||
static BehaviorScript ParseBehaviorScriptSymbolArgInternal(GfxData *aGfxData, DataNode<BehaviorScript> *aNode, u64 &aTokenIndex, bool *found) {
|
||||
String _Arg = aNode->mTokens[aTokenIndex++];
|
||||
u64 _ModelIdentifier = aNode->mModelIdentifier;
|
||||
*found = true;
|
||||
|
||||
// Remove (de-)referencing
|
||||
|
|
@ -2288,7 +2287,7 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNode<BehaviorScript
|
|||
}
|
||||
|
||||
if (_Symbol == "LOAD_ANIMATIONS") {
|
||||
u64 topTokenIndex = aTokenIndex;
|
||||
//u64 topTokenIndex = aTokenIndex;
|
||||
|
||||
bool foundAnimation = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -778,7 +778,7 @@ static void ParseGfxSymbol(GfxData* aGfxData, DataNode<Gfx>* aNode, Gfx*& aHead,
|
|||
#define CALL_SYMB(symb, ...) symb(__VA_ARGS__)
|
||||
#define define_gfx_symbol(symb, params, addPtr, ...) \
|
||||
if (_Symbol == #symb) { \
|
||||
static const GfxParamType paramTypes[] = { __VA_ARGS__ }; \
|
||||
UNUSED static const GfxParamType paramTypes[] = { __VA_ARGS__ };\
|
||||
REPEAT(HANDLE_PARAM, params); \
|
||||
if (addPtr) { aGfxData->mPointerList.Add(aHead); } \
|
||||
Gfx _Gfx[] = { CALL_SYMB(symb, LIST_ARGS(GET_ARG, params)) }; \
|
||||
|
|
|
|||
|
|
@ -390,7 +390,6 @@ DataNode<T>* FindDataNode(DataNodes<T>& aDataNodes, String& aName, u32 aModelIde
|
|||
|
||||
static LevelScript ParseLevelScriptSymbolArgInternal(GfxData* aGfxData, DataNode<LevelScript>* aNode, u64& aTokenIndex, bool* found) {
|
||||
String _Arg = aNode->mTokens[aTokenIndex++];
|
||||
u64 _ModelIdentifier = aNode->mModelIdentifier;
|
||||
*found = true;
|
||||
|
||||
// Integers
|
||||
|
|
@ -744,7 +743,7 @@ static void ParseLevelScriptSymbol(GfxData* aGfxData, DataNode<LevelScript>* aNo
|
|||
// dialog
|
||||
if (_Symbol == "SHOW_DIALOG") {
|
||||
u64 topTokenIndex = aTokenIndex;
|
||||
|
||||
|
||||
u32 luaParams = 0;
|
||||
LevelScript index = ParseLevelScriptObjectSymbolArgInternal(aGfxData, aNode, aTokenIndex, &luaParams, SHOW_DIALOG_EXT_LUA_INDEX);
|
||||
LevelScript dialogId = ParseLevelScriptObjectSymbolArgInternal(aGfxData, aNode, aTokenIndex, &luaParams, SHOW_DIALOG_EXT_LUA_DIALOG);
|
||||
|
|
|
|||
|
|
@ -196,7 +196,6 @@ static PointerData GetDataFromPointer(const void* aPtr, GfxData* aGfxData) {
|
|||
|
||||
// Vertices
|
||||
String _VtxArrayName = "";
|
||||
uintptr_t _VtxArrayStart = 0;
|
||||
for (auto& _Node : aGfxData->mVertices) {
|
||||
if (_Node->mData == aPtr) {
|
||||
return { _Node->mName, _Offset };
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ void DynOS_Read_Source(GfxData *aGfxData, const SysPath &aFilename) {
|
|||
|
||||
// Scanning the loaded data
|
||||
u32 _LineNumber = 1;
|
||||
u32 pDataLineNumber = 1;
|
||||
UNUSED u32 pDataLineNumber = 1;
|
||||
s32 _DataType = DATA_TYPE_NONE;
|
||||
String* pDataName = NULL;
|
||||
Array<String> *pDataTokens = NULL;
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ static void DynOS_Tex_GeneratePack_Recursive(const SysPath &aPackFolder, SysPath
|
|||
}
|
||||
|
||||
DynOS_Tex_WriteBinary(aGfxData, _OutputPath, _BaseName, _TexData, (_OverrideName != NULL));
|
||||
|
||||
|
||||
// Don't forgot to free the texture data we've read.
|
||||
Delete<TexData>(_TexData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
Will probably not work correctly with strict-aliasing optimizations.
|
||||
|
||||
If using a modern Microsoft Compiler, non-safe versions of CRT calls may cause
|
||||
If using a modern Microsoft Compiler, non-safe versions of CRT calls may cause
|
||||
compilation warnings or even errors. To avoid this, also before #including,
|
||||
|
||||
#define STBI_MSC_SECURE_CRT
|
||||
|
|
@ -103,7 +103,7 @@ USAGE:
|
|||
|
||||
TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed
|
||||
data, set the global variable 'stbi_write_tga_with_rle' to 0.
|
||||
|
||||
|
||||
JPEG does ignore alpha channels in input data; quality is between 1 and 100.
|
||||
Higher quality looks better but results in a bigger image.
|
||||
JPEG baseline (no JPEG progressive).
|
||||
|
|
@ -111,7 +111,7 @@ USAGE:
|
|||
CREDITS:
|
||||
|
||||
|
||||
Sean Barrett - PNG/BMP/TGA
|
||||
Sean Barrett - PNG/BMP/TGA
|
||||
Baldur Karlsson - HDR
|
||||
Jean-Sebastien Guay - TGA monochrome
|
||||
Tim Kelsey - misc enhancements
|
||||
|
|
@ -689,7 +689,7 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
|
|||
#ifdef STBI_MSC_SECURE_CRT
|
||||
len = sprintf_s(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
|
||||
#else
|
||||
len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
|
||||
len = snprintf(buffer, 128, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
|
||||
#endif
|
||||
s->func(s->context, buffer, len);
|
||||
|
||||
|
|
@ -1356,7 +1356,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
|
|||
37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99};
|
||||
static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,
|
||||
99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
|
||||
static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
|
||||
static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
|
||||
1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f };
|
||||
|
||||
int row, col, i, k;
|
||||
|
|
@ -1531,38 +1531,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
|
|||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ void discard_sequence(s32 seqId) {
|
|||
void *soundAlloc(struct SoundAllocPool *pool, u32 size) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
u32 alignedSize = ALIGN16(size);
|
||||
|
||||
|
||||
if (pool == NULL || pool->cur == NULL) {
|
||||
LOG_ERROR("Failed to allocate for sound pool! Pool is NULL!");
|
||||
return NULL;
|
||||
|
|
@ -312,7 +312,7 @@ void *sound_alloc_uninitialized(struct SoundAllocPool *pool, u32 size) {
|
|||
|
||||
void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
pool->cur = pool->start = (u8 *) ALIGN16((uintptr_t) memAddr);
|
||||
#ifdef VERSION_SH
|
||||
pool->size = size - ((uintptr_t) memAddr & 0xf);
|
||||
|
|
@ -320,23 +320,23 @@ void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size)
|
|||
pool->size = size;
|
||||
#endif
|
||||
pool->numAllocatedEntries = 0;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void persistent_pool_clear(struct PersistentPool *persistent) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
persistent->pool.numAllocatedEntries = 0;
|
||||
persistent->pool.cur = persistent->pool.start;
|
||||
persistent->numEntries = 0;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void temporary_pool_clear(struct TemporaryPool *temporary) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
temporary->pool.numAllocatedEntries = 0;
|
||||
temporary->pool.cur = temporary->pool.start;
|
||||
temporary->nextSide = 0;
|
||||
|
|
@ -348,7 +348,7 @@ void temporary_pool_clear(struct TemporaryPool *temporary) {
|
|||
#endif
|
||||
temporary->entries[0].id = -1; // should be at 1e not 1c
|
||||
temporary->entries[1].id = -1;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -360,10 +360,10 @@ void unused_803160F8(struct SoundAllocPool *pool) {
|
|||
extern s32 D_SH_80315EE8;
|
||||
void sound_init_main_pools(s32 sizeForAudioInitPool) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
sound_alloc_pool_init(&gAudioInitPool, gAudioHeap, sizeForAudioInitPool);
|
||||
sound_alloc_pool_init(&gAudioSessionPool, gAudioHeap + sizeForAudioInitPool, gAudioHeapSize - sizeForAudioInitPool);
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -375,27 +375,27 @@ void sound_init_main_pools(s32 sizeForAudioInitPool) {
|
|||
|
||||
void session_pools_init(struct PoolSplit *a) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
gAudioSessionPool.cur = gAudioSessionPool.start;
|
||||
sound_alloc_pool_init(&gNotesAndBuffersPool, SOUND_ALLOC_FUNC(&gAudioSessionPool, a->wantSeq), a->wantSeq);
|
||||
sound_alloc_pool_init(&gSeqAndBankPool, SOUND_ALLOC_FUNC(&gAudioSessionPool, a->wantCustom), a->wantCustom);
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void seq_and_bank_pool_init(struct PoolSplit2 *a) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
gSeqAndBankPool.cur = gSeqAndBankPool.start;
|
||||
sound_alloc_pool_init(&gPersistentCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantPersistent), a->wantPersistent);
|
||||
sound_alloc_pool_init(&gTemporaryCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantTemporary), a->wantTemporary);
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void persistent_pools_init(struct PoolSplit *a) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
gPersistentCommonPool.cur = gPersistentCommonPool.start;
|
||||
sound_alloc_pool_init(&gSeqLoadedPool.persistent.pool, SOUND_ALLOC_FUNC(&gPersistentCommonPool, a->wantSeq), a->wantSeq);
|
||||
sound_alloc_pool_init(&gBankLoadedPool.persistent.pool, SOUND_ALLOC_FUNC(&gPersistentCommonPool, a->wantBank), a->wantBank);
|
||||
|
|
@ -403,13 +403,13 @@ void persistent_pools_init(struct PoolSplit *a) {
|
|||
persistent_pool_clear(&gSeqLoadedPool.persistent);
|
||||
persistent_pool_clear(&gBankLoadedPool.persistent);
|
||||
persistent_pool_clear(&gUnusedLoadedPool.persistent);
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void temporary_pools_init(struct PoolSplit *a) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
gTemporaryCommonPool.cur = gTemporaryCommonPool.start;
|
||||
sound_alloc_pool_init(&gSeqLoadedPool.temporary.pool, SOUND_ALLOC_FUNC(&gTemporaryCommonPool, a->wantSeq), a->wantSeq);
|
||||
sound_alloc_pool_init(&gBankLoadedPool.temporary.pool, SOUND_ALLOC_FUNC(&gTemporaryCommonPool, a->wantBank), a->wantBank);
|
||||
|
|
@ -417,16 +417,11 @@ void temporary_pools_init(struct PoolSplit *a) {
|
|||
temporary_pool_clear(&gSeqLoadedPool.temporary);
|
||||
temporary_pool_clear(&gBankLoadedPool.temporary);
|
||||
temporary_pool_clear(&gUnusedLoadedPool.temporary);
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
#undef SOUND_ALLOC_FUNC
|
||||
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
static void unused_803163D4(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
void *alloc_bank_or_seq(s32 poolIdx, s32 size, s32 arg3, s32 id) {
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -579,7 +579,7 @@ void preload_sequence(s32 arg0, s32 arg1) {
|
|||
}
|
||||
}
|
||||
#else
|
||||
void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED u8 *offsetBase) {
|
||||
UNUSED void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED u8 *offsetBase) {
|
||||
struct AudioBankSample *sample;
|
||||
void *patched;
|
||||
UNUSED u8 *mem; // unused on US
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
static u16 gRandomSeed16;
|
||||
|
||||
// Unused function that directly jumps to a behavior command and resets the object's stack index.
|
||||
static void goto_behavior_unused(const BehaviorScript *bhvAddr) {
|
||||
UNUSED static void goto_behavior_unused(const BehaviorScript *bhvAddr) {
|
||||
gCurBhvCommand = segmented_to_virtual(bhvAddr);
|
||||
gCurrentObject->bhvStackIndex = 0;
|
||||
}
|
||||
|
|
@ -147,12 +147,6 @@ static uintptr_t cur_obj_bhv_stack_pop(void) {
|
|||
return bhvAddr;
|
||||
}
|
||||
|
||||
static void stub_behavior_script_1(void) {
|
||||
for (;;) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
// Command 0x22: Hides the current object.
|
||||
// Usage: HIDE()
|
||||
static s32 bhv_cmd_hide(void) {
|
||||
|
|
@ -743,7 +737,7 @@ static s32 bhv_cmd_begin(void) {
|
|||
// It cannot be simply re-added to the table, as unlike all other bhv commands it takes a parameter.
|
||||
// Theoretically this command would have been of variable size.
|
||||
// Included below is a modified/repaired version of this function that would work properly.
|
||||
static void bhv_cmd_set_int_random_from_table(s32 tableSize) {
|
||||
UNUSED static void bhv_cmd_set_int_random_from_table(s32 tableSize) {
|
||||
u8 field = BHV_CMD_GET_2ND_U8(0);
|
||||
s32 table[16];
|
||||
s32 i;
|
||||
|
|
|
|||
|
|
@ -581,8 +581,6 @@ f32 unused_obj_find_floor_height(struct Object *obj) {
|
|||
*/
|
||||
struct FloorGeometry sFloorGeo;
|
||||
|
||||
static u8 unused8038BE50[0x40];
|
||||
|
||||
/**
|
||||
* Return the floor height underneath (xPos, yPos, zPos) and populate `floorGeo`
|
||||
* with data about the floor's normal vector and origin offset. Also update
|
||||
|
|
@ -631,7 +629,7 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32
|
|||
if (surf == NULL) { break; }
|
||||
surfaceNode = surfaceNode->next;
|
||||
interpolate = gInterpolatingSurfaces;
|
||||
|
||||
|
||||
if (surf->flags & SURFACE_FLAG_INTANGIBLE) { continue; }
|
||||
if (gCheckingSurfaceCollisionsForObject != NULL) {
|
||||
if (surf->object != gCheckingSurfaceCollisionsForObject) {
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ void bowser_act_intro_walk(void) {
|
|||
}
|
||||
}
|
||||
|
||||
static void bowser_debug_actions(void) // unused
|
||||
UNUSED static void bowser_debug_actions(void) // unused
|
||||
{
|
||||
if (gDebugInfo[5][1] != 0) {
|
||||
o->oAction = D_8032F4FC[gDebugInfo[5][2] & 0xf];
|
||||
|
|
@ -778,7 +778,7 @@ void bowser_act_thrown_dropped(void)
|
|||
o->oAction = 4;
|
||||
else
|
||||
o->oAction = 12;
|
||||
|
||||
|
||||
if (is_nearest_mario_state_to_object(gMarioState, o)) {
|
||||
network_send_object(o);
|
||||
}
|
||||
|
|
@ -887,9 +887,9 @@ void bowser_spawn_grand_star_key(void) {
|
|||
reward->oHomeX = reward->oPosX;
|
||||
reward->oHomeY = reward->oPosY;
|
||||
reward->oHomeZ = reward->oPosZ;
|
||||
|
||||
|
||||
sync_object_set_id(reward);
|
||||
|
||||
|
||||
struct Object* spawn_objects[] = { reward };
|
||||
u32 models[] = { MODEL_STAR };
|
||||
network_send_spawn_objects(spawn_objects, models, 1);
|
||||
|
|
@ -1015,7 +1015,7 @@ u8 bowser_dead_bits_end_continue_dialog(void) { return o->oAction == 4 && o->oBo
|
|||
|
||||
s32 bowser_dead_bits_end(void) {
|
||||
struct MarioState *marioState = nearest_mario_state_to_object(o);
|
||||
|
||||
|
||||
if (o->oBowserUnkF8 < 2) {
|
||||
s32 dialogID = gBehaviorValues.dialogs.Bowser3Defeated120StarsDialog;
|
||||
if (gHudDisplay.stars < 120) {
|
||||
|
|
@ -1382,7 +1382,7 @@ void bhv_bowser_override_ownership(u8* shouldOverride, u8* shouldOwn) {
|
|||
*shouldOwn = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// tilting platform
|
||||
static u8 tiltingTimer = 0;
|
||||
if (o->oAction == 19) { tiltingTimer = 5; }
|
||||
|
|
@ -1426,7 +1426,7 @@ void bhv_bowser_init(void) {
|
|||
o->oBowserUnk1AE = 0;
|
||||
o->oBowserEyesShut = 0;
|
||||
bowserCutscenePlayed = FALSE;
|
||||
|
||||
|
||||
// Make sure we're the first to trigger Bowser.
|
||||
if (!is_other_player_active()) {
|
||||
bowserIsCutscenePlayer = TRUE;
|
||||
|
|
@ -1437,7 +1437,7 @@ void bhv_bowser_init(void) {
|
|||
bowserCutsceneGlobalIndex = UNKNOWN_GLOBAL_INDEX;
|
||||
o->oAction = 20; // bowser_act_nothing
|
||||
}
|
||||
|
||||
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject* so = sync_object_init(o, 8000.0f);
|
||||
if (so) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static struct Object* eyerok_nearest_targetable_player_to_object(s32 zDist) {
|
|||
nearestDist = dist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return nearest;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ static void eyerok_boss_act_wake_up(void) {
|
|||
}
|
||||
}
|
||||
|
||||
static u8 eyerok_boss_act_show_intro_text_continue_dialog(void) {
|
||||
UNUSED static u8 eyerok_boss_act_show_intro_text_continue_dialog(void) {
|
||||
return o->oAction == EYEROK_BOSS_ACT_SHOW_INTRO_TEXT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ void ukiki_free_loop(void) {
|
|||
*
|
||||
* Possibly unused so AnimState could be used for wearing a cap?
|
||||
*/
|
||||
static void ukiki_blink_timer(void) {
|
||||
UNUSED static void ukiki_blink_timer(void) {
|
||||
if (gGlobalTimer % 50 < 7) {
|
||||
o->oAnimState = UKIKI_ANIM_STATE_EYE_CLOSED;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ void reset_debug_objectinfo(void) {
|
|||
* C Right) and then toggles the debug flags from FF to 2; 2 is unused,
|
||||
* despite so this has no effect, being called. (unused)
|
||||
*/
|
||||
static void check_debug_button_seq(void) {
|
||||
UNUSED static void check_debug_button_seq(void) {
|
||||
s16 *buttonArr;
|
||||
s16 cButtonMask;
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ static void check_debug_button_seq(void) {
|
|||
* Poll the debug info flags and controller for appropriate presses that
|
||||
* control sDebugPage's range. (unused)
|
||||
*/
|
||||
static void try_change_debug_page(void) {
|
||||
UNUSED static void try_change_debug_page(void) {
|
||||
if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT) {
|
||||
if ((gPlayer1Controller->buttonPressed & L_JPAD)
|
||||
&& (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) {
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ void envfx_update_snow_blizzard(s32 snowCylinderX, s32 snowCylinderY, s32 snowCy
|
|||
* find it. The radius of 3000 units is quite large for that though, covering
|
||||
* more than half of the mirror room.
|
||||
*/
|
||||
static s32 is_in_mystery_snow_area(s32 x, UNUSED s32 y, s32 z) {
|
||||
UNUSED static s32 is_in_mystery_snow_area(s32 x, UNUSED s32 y, s32 z) {
|
||||
if (sqr(x - 3380) + sqr(z + 520) < sqr(3000)) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ void display_and_vsync(void) {
|
|||
|
||||
// this function records distinct inputs over a 255-frame interval to RAM locations and was likely
|
||||
// used to record the demo sequences seen in the final game. This function is unused.
|
||||
static void record_demo(void) {
|
||||
UNUSED static void record_demo(void) {
|
||||
// record the player's button mask and current rawStickX and rawStickY.
|
||||
u8 buttonMask =
|
||||
((gPlayer1Controller->buttonDown & (A_BUTTON | B_BUTTON | Z_TRIG | START_BUTTON)) >> 8)
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ u32 attack_object(struct MarioState* m, struct Object *o, s32 interaction) {
|
|||
|
||||
void mario_stop_riding_object(struct MarioState *m) {
|
||||
if (!m || m->riddenObj == NULL || m->playerIndex != 0) { return; }
|
||||
|
||||
|
||||
m->riddenObj->oInteractStatus = INT_STATUS_STOP_RIDING;
|
||||
if (m->riddenObj->oSyncID != 0) {
|
||||
network_send_object_reliability(m->riddenObj, TRUE);
|
||||
|
|
@ -411,7 +411,7 @@ void mario_blow_off_cap(struct MarioState *m, f32 capSpeed) {
|
|||
if (!m) { return; }
|
||||
if (m->playerIndex != 0) { return; }
|
||||
if (!does_mario_have_normal_cap_on_head(m) || does_mario_have_blown_cap(m)) { return; }
|
||||
|
||||
|
||||
m->cap = SAVE_FLAG_CAP_ON_MR_BLIZZARD;
|
||||
|
||||
m->flags &= ~(MARIO_NORMAL_CAP | MARIO_CAP_ON_HEAD);
|
||||
|
|
@ -612,7 +612,7 @@ void hit_object_from_below(struct MarioState *m, UNUSED struct Object *o) {
|
|||
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_HIT_FROM_BELOW); }
|
||||
}
|
||||
|
||||
static u32 unused_determine_knockback_action(struct MarioState *m) {
|
||||
UNUSED static u32 unused_determine_knockback_action(struct MarioState *m) {
|
||||
if (!m) { return 0; }
|
||||
u32 bonkAction;
|
||||
s16 angleToObject = mario_obj_angle_to_object(m, m->interactObj);
|
||||
|
|
@ -1833,7 +1833,7 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
|
||||
UNUSED static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
|
||||
if (!m || !o) { return FALSE; }
|
||||
if (!(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) {
|
||||
sDelayInvincTimer = TRUE;
|
||||
|
|
@ -2164,7 +2164,7 @@ u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o
|
|||
capTime = gLevelValues.wingCapDuration;
|
||||
capMusic = SEQUENCE_ARGS(4, gLevelValues.wingCapSequence);
|
||||
break;
|
||||
|
||||
|
||||
case MARIO_NORMAL_CAP:
|
||||
m->cap = 0;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ static void capitalize_string_ascii(char *strAscii) {
|
|||
}
|
||||
}
|
||||
|
||||
static void capitalize_string_sm64(u8 *str64) {
|
||||
UNUSED static void capitalize_string_sm64(u8 *str64) {
|
||||
for (; *str64 != 0xFF; str64++) {
|
||||
if (*str64 >= 0x24 && *str64 <= 0x3D) {
|
||||
*str64 -= 26;
|
||||
|
|
@ -272,7 +272,7 @@ static void decapitalize_string_ascii(char *strAscii) {
|
|||
}
|
||||
}
|
||||
|
||||
static void decapitalize_string_sm64(u8 *str64) {
|
||||
UNUSED static void decapitalize_string_sm64(u8 *str64) {
|
||||
for (bool decap = false; *str64 != 0xFF; str64++) {
|
||||
if (*str64 >= 0x0A && *str64 <= 0x23) {
|
||||
if (decap) {
|
||||
|
|
@ -351,7 +351,7 @@ const char *get_level_name_ascii(s16 courseNum, s16 levelNum, s16 areaIndex, s16
|
|||
struct CustomLevelInfo* info = smlua_level_util_get_info(levelNum);
|
||||
if (info) {
|
||||
hasCustomName = true;
|
||||
snprintf(output, 256, info->fullName);
|
||||
snprintf(output, 256, "%s", info->fullName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ struct Object* spawn_macro_abs_special(s32 model, const BehaviorScript *behavior
|
|||
return newObj;
|
||||
}
|
||||
|
||||
static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) {
|
||||
UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) {
|
||||
struct Object *sp3C;
|
||||
s16 model;
|
||||
|
||||
|
|
|
|||
|
|
@ -1950,7 +1950,7 @@ void mario_update_hitbox_and_cap_model(struct MarioState *m) {
|
|||
* An unused and possibly a debug function. Z + another button input
|
||||
* sets Mario with a different cap.
|
||||
*/
|
||||
static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capMusic) {
|
||||
UNUSED static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capMusic) {
|
||||
// This checks for Z_TRIG instead of Z_DOWN flag
|
||||
// (which is also what other debug functions do),
|
||||
// so likely debug behavior rather than unused behavior.
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2) {
|
|||
}
|
||||
|
||||
// unused
|
||||
static void stub_is_textbox_active(u16 *a0) {
|
||||
UNUSED static void stub_is_textbox_active(u16 *a0) {
|
||||
if (get_dialog_id() == DIALOG_NONE) {
|
||||
*a0 = 0;
|
||||
}
|
||||
|
|
@ -2191,7 +2191,7 @@ static s32 act_intro_cutscene(struct MarioState *m) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void jumbo_star_offset(struct MarioState* m) {
|
||||
UNUSED static void jumbo_star_offset(struct MarioState* m) {
|
||||
if (!m) { return; }
|
||||
m->pos[0] += 300.0f * sins(m->faceAngle[1] + 0x4000 * m->playerIndex);
|
||||
m->pos[2] += 300.0f * coss(m->faceAngle[1] + 0x4000 * m->playerIndex);
|
||||
|
|
|
|||
|
|
@ -1716,9 +1716,6 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) {
|
|||
}
|
||||
}
|
||||
|
||||
static void stub_obj_helpers_1(void) {
|
||||
}
|
||||
|
||||
void cur_obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius) {
|
||||
if (!o) { return; }
|
||||
if (radius > 0.1L) {
|
||||
|
|
@ -2708,9 +2705,6 @@ void bhv_dust_smoke_loop(void) {
|
|||
o->oSmokeTimer++;
|
||||
}
|
||||
|
||||
static void stub_obj_helpers_2(void) {
|
||||
}
|
||||
|
||||
s32 cur_obj_set_direction_table(s8 *a0) {
|
||||
if (!o) { return 0; }
|
||||
o->oToxBoxMovementPattern = a0;
|
||||
|
|
@ -2895,9 +2889,6 @@ s32 is_item_in_array(s8 item, s8 *array) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void stub_obj_helpers_5(void) {
|
||||
}
|
||||
|
||||
void bhv_init_room(void) {
|
||||
if (!o) { return; }
|
||||
struct Surface *floor;
|
||||
|
|
|
|||
|
|
@ -654,7 +654,7 @@ void unload_deactivated_objects(void) {
|
|||
/**
|
||||
* Unused profiling function.
|
||||
*/
|
||||
static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) {
|
||||
UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) {
|
||||
u16 time;
|
||||
f64 cycles;
|
||||
|
||||
|
|
|
|||
|
|
@ -214,13 +214,13 @@ struct Painting_List_Item paintingZero = {
|
|||
// } Vtx_Interp;
|
||||
|
||||
static Vtx_Interp sVertexBuffers[2][2 * 264 * 3];
|
||||
static u8 sVerticesCurIndex = 0;
|
||||
static u8 sVertexSwaps = 0;
|
||||
static Vtx_Interp* sVerticesCur = sVertexBuffers[0];
|
||||
static Vtx_Interp* sVerticesPrev = NULL;
|
||||
static u32 sVerticesPrevTimestamp;
|
||||
static Vtx *sVerticesPtr[2];
|
||||
static s32 sVerticesCount;
|
||||
UNUSED static u8 sVerticesCurIndex = 0;
|
||||
UNUSED static u8 sVertexSwaps = 0;
|
||||
UNUSED static Vtx_Interp* sVerticesCur = sVertexBuffers[0];
|
||||
UNUSED static Vtx_Interp* sVerticesPrev = NULL;
|
||||
UNUSED static u32 sVerticesPrevTimestamp;
|
||||
UNUSED static Vtx *sVerticesPtr[2];
|
||||
UNUSED static s32 sVerticesCount;
|
||||
|
||||
void patch_paintings_init(struct Painting *painting) {
|
||||
painting->ripples.sVerticesCurIndex = 0;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ static u16 sCurrentMusic = MUSIC_NONE;
|
|||
static u16 sCurrentShellMusic = MUSIC_NONE;
|
||||
static u16 sCurrentCapMusic = MUSIC_NONE;
|
||||
static u8 sPlayingInfiniteStairs = FALSE;
|
||||
static u8 unused8032C6D8[16] = { 0 };
|
||||
static s16 sSoundMenuModeToSoundMode[] = { SOUND_MODE_STEREO, SOUND_MODE_MONO, SOUND_MODE_HEADSET };
|
||||
// Only the 20th array element is used.
|
||||
static u32 sMenuSoundsExtra[] = {
|
||||
|
|
@ -89,7 +88,7 @@ void reset_volume(void) {
|
|||
*/
|
||||
void lower_background_noise(s32 a) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
switch (a) {
|
||||
case 1:
|
||||
set_audio_muted(TRUE);
|
||||
|
|
@ -99,7 +98,7 @@ void lower_background_noise(s32 a) {
|
|||
break;
|
||||
}
|
||||
sVolumeLoweredState |= a;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +107,7 @@ void lower_background_noise(s32 a) {
|
|||
*/
|
||||
void raise_background_noise(s32 a) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
switch (a) {
|
||||
case 1:
|
||||
set_audio_muted(FALSE);
|
||||
|
|
@ -118,7 +117,7 @@ void raise_background_noise(s32 a) {
|
|||
break;
|
||||
}
|
||||
sVolumeLoweredState &= ~a;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -127,12 +126,12 @@ void raise_background_noise(s32 a) {
|
|||
*/
|
||||
void disable_background_sound(void) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
if (!sBackgroundMusicDisabled) {
|
||||
sBackgroundMusicDisabled = TRUE;
|
||||
sound_banks_disable(SEQ_PLAYER_SFX, SOUND_BANKS_BACKGROUND);
|
||||
}
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -141,12 +140,12 @@ void disable_background_sound(void) {
|
|||
*/
|
||||
void enable_background_sound(void) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
if (sBackgroundMusicDisabled) {
|
||||
sBackgroundMusicDisabled = FALSE;
|
||||
sound_banks_enable(SEQ_PLAYER_SFX, SOUND_BANKS_BACKGROUND);
|
||||
}
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -157,11 +156,11 @@ void enable_background_sound(void) {
|
|||
*/
|
||||
void set_sound_mode(u16 soundMode) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
if (soundMode < 3) {
|
||||
audio_set_sound_mode(sSoundMenuModeToSoundMode[soundMode]);
|
||||
}
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -192,7 +191,7 @@ void play_menu_sounds(s16 soundMenuFlags) {
|
|||
if (soundMenuFlags & 0x100) {
|
||||
play_menu_sounds_extra(20, NULL);
|
||||
}
|
||||
|
||||
|
||||
if (soundMenuFlags & SOUND_MENU_FLAG_LETGOMARIOFACE) {
|
||||
queue_rumble_data(10, 60);
|
||||
}
|
||||
|
|
@ -263,12 +262,12 @@ void set_background_music(u16 a, u16 seqArgs, s16 fadeTimer) {
|
|||
*/
|
||||
void fadeout_music(s16 fadeOutTime) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
set_audio_fadeout(fadeOutTime);
|
||||
sCurrentMusic = MUSIC_NONE;
|
||||
sCurrentShellMusic = MUSIC_NONE;
|
||||
sCurrentCapMusic = MUSIC_NONE;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -277,12 +276,12 @@ void fadeout_music(s16 fadeOutTime) {
|
|||
*/
|
||||
void fadeout_level_music(s16 fadeTimer) {
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
seq_player_fade_out(SEQ_PLAYER_LEVEL, fadeTimer);
|
||||
sCurrentMusic = MUSIC_NONE;
|
||||
sCurrentShellMusic = MUSIC_NONE;
|
||||
sCurrentCapMusic = MUSIC_NONE;
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
|
|
@ -379,7 +378,7 @@ void thread4_sound(UNUSED void *arg) {
|
|||
#ifdef VERSION_SH
|
||||
spTask = func_sh_802f5a80(); // The function was probably just moved to a different file. Don't kill me.
|
||||
#else
|
||||
spTask = create_next_audio_frame_task();
|
||||
spTask = create_next_audio_frame_task();
|
||||
#endif
|
||||
if (spTask != NULL) {
|
||||
dispatch_audio_sptask(spTask);
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ void clear_object_lists(struct ObjectNode *objLists) {
|
|||
/**
|
||||
* Delete the leaf graph nodes under obj and obj's siblings.
|
||||
*/
|
||||
static void unused_delete_leaf_nodes(struct Object *obj) {
|
||||
UNUSED static void unused_delete_leaf_nodes(struct Object *obj) {
|
||||
if (!obj) { return; }
|
||||
struct Object *children;
|
||||
struct Object *sibling;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ static struct GdColour sClrYellow = { 1.0, 1.0, 0.0 }; // @ 801A80DC
|
|||
static struct GdColour sLightColours[1] = { { 1.0, 1.0, 0.0 } }; // @ 801A80E8
|
||||
static struct GdColour *sSelectedColour = &sClrRed; // @ 801A80F4
|
||||
struct ObjCamera *gViewUpdateCamera = NULL; // @ 801A80F8
|
||||
static void *sUnref801A80FC = NULL;
|
||||
static s32 sUnreadShapeFlag = 0; // @ 801A8100
|
||||
struct GdColour *sColourPalette[5] = { // @ 801A8104
|
||||
&sClrWhite, &sClrYellow, &sClrRed, &sClrBlack, &sClrBlack
|
||||
|
|
@ -71,20 +70,12 @@ struct GdColour *sWhiteBlack[2] = {
|
|||
&sClrWhite,
|
||||
&sClrBlack,
|
||||
};
|
||||
static Mat4f sUnref801A8120 = {
|
||||
{ 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }
|
||||
};
|
||||
static Mat4f sUnrefIden801A8160 = {
|
||||
{ 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }
|
||||
};
|
||||
static s32 sLightDlCounter = 1; // @ 801A81A0
|
||||
static s32 sUnref801A81A4[4] = { 0 };
|
||||
|
||||
// bss
|
||||
u8 gUnref_801B9B30[0x88];
|
||||
struct ObjGroup *gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group?
|
||||
|
||||
static u8 sUnref_801B9BBC[0x40];
|
||||
static enum SceneType sSceneProcessType; // @ 801B9C00
|
||||
static s32 sUseSelectedColor; // @ 801B9C04
|
||||
static s16 sPickBuffer[100]; ///< buffer of objects near click
|
||||
|
|
@ -712,7 +703,7 @@ void world_pos_to_screen_coords(struct GdVec3f *pos, struct ObjCamera *cam, stru
|
|||
if (pos->z > -256.0f) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
pos->x *= 256.0 / -pos->z;
|
||||
pos->y *= 256.0 / pos->z;
|
||||
pos->x += view->lowerRight.x / 2.0f;
|
||||
|
|
@ -1272,7 +1263,7 @@ static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp
|
|||
struct ListNode *node;
|
||||
|
||||
for (i = 0; i < face->vtxCount; i++) {
|
||||
// find the vertex or particle whose index in vertexGrp equals face->vertices[i]
|
||||
// find the vertex or particle whose index in vertexGrp equals face->vertices[i]
|
||||
node = vertexGrp->firstMember;
|
||||
currIndex = 0;
|
||||
while (node != NULL) {
|
||||
|
|
|
|||
|
|
@ -14,11 +14,8 @@
|
|||
|
||||
// data
|
||||
s32 gGdMoveScene = TRUE; // @ 801A8050
|
||||
static s32 sUnref801A8054 = TRUE;
|
||||
f32 D_801A8058 = -600.0f;
|
||||
s32 gGdUseVtxNormal = TRUE; // @ 801A805C; instead of face normals
|
||||
static s32 sUnrefScnWidth = 320;
|
||||
static s32 sUnrefScnHeight = 240;
|
||||
|
||||
// bss
|
||||
struct GdControl gGdCtrl; // @ 801B9920; processed controller info
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
// bss
|
||||
static char sDefSettingsMenuStr[0x100];
|
||||
static struct GdVec3f sStaticVec;
|
||||
static struct GdVec3f unusedVec;
|
||||
static struct ObjGadget *sCurGadgetPtr;
|
||||
|
||||
// forward declarations
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ struct Connection {
|
|||
};
|
||||
|
||||
// data
|
||||
static void *sUnused801A81D0 = NULL;
|
||||
static s32 D_801A81D4[25] = {
|
||||
/* ID? X Y Z */
|
||||
9, 3, 12, -14, 25, 5, 16, -25, 42, 4, 15, -39, 55,
|
||||
|
|
|
|||
|
|
@ -111,10 +111,8 @@ static u8 D_801BAEA0;
|
|||
static struct ObjGadget *sTimerGadgets[GD_NUM_TIMERS]; // @ 801BAEA8
|
||||
static u32 D_801BAF28; // RAM addr offset?
|
||||
static s16 sTriangleBuf[13][8]; // [[s16; 8]; 13]? vert indices?
|
||||
static u32 unref_801bb000[3];
|
||||
static u8 *sMemBlockPoolBase; // @ 801BB00C
|
||||
static u32 sAllocMemory; // @ 801BB010; malloc-ed bytes
|
||||
static u32 unref_801bb014;
|
||||
static s32 D_801BB018;
|
||||
static s32 D_801BB01C;
|
||||
static void *sLoadedTextures[0x10]; // texture pointers
|
||||
|
|
@ -134,11 +132,8 @@ static s32 sVertexBufStartIndex; // Vtx start in GD Dl
|
|||
static struct ObjView *sCarSceneView; // @ 801BB0D0
|
||||
static s32 sUpdateYoshiScene; // @ 801BB0D4; update dl Vtx from ObjVertex?
|
||||
static s32 sUpdateMarioScene; // @ 801BB0D8; update dl Vtx from ObjVertex?
|
||||
static u32 unref_801bb0dc;
|
||||
static s32 sUpdateCarScene; // @ 801BB0E0; guess, not really used
|
||||
static u32 unref_801bb0e4;
|
||||
static struct GdVec3f sTextDrawPos; // position to draw text? only set in one function, never used
|
||||
static u32 unref_801bb0f8[2];
|
||||
static Mtx sIdnMtx; // @ 801BB100
|
||||
static Mat4f sInitIdnMat4; // @ 801BB140
|
||||
static s8 sVtxCvrtNormBuf[3]; // @ 801BB180
|
||||
|
|
@ -168,21 +163,15 @@ static LookAt D_801BE7D0[3];
|
|||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
static OSMesgQueue D_801BE830; // controller msg queue
|
||||
static OSMesg D_801BE848[10];
|
||||
static u32 unref_801be870[16];
|
||||
static OSMesgQueue D_801BE8B0;
|
||||
static OSMesgQueue sGdDMAQueue; // @ 801BE8C8
|
||||
static u32 unref_801be8e0[25];
|
||||
static OSMesg sGdMesgBuf[1]; // @ 801BE944
|
||||
static u32 unref_801be948[13];
|
||||
static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue
|
||||
static OSIoMesg sGdDMAReqMesg;
|
||||
static struct ObjView *D_801BE994; // store if View flag 0x40 set
|
||||
#endif
|
||||
|
||||
// data
|
||||
static u32 unref_801a8670 = 0;
|
||||
static s32 D_801A8674 = 0;
|
||||
static u32 unref_801a8678 = 0;
|
||||
static s32 D_801A867C = 0;
|
||||
static s32 D_801A8680 = 0;
|
||||
static f32 sTracked1FrameTime = 0.0f; // @ 801A8684
|
||||
|
|
@ -197,11 +186,9 @@ static struct GdTimer *D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp
|
|||
static struct GdTimer *D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp
|
||||
static struct GdTimer *D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp
|
||||
s32 gGdFrameBufNum = 0; // @ 801A86B0
|
||||
static u32 unref_801a86B4 = 0;
|
||||
static struct ObjShape *sHandShape = NULL; // @ 801A86B8
|
||||
static s32 D_801A86BC = 1;
|
||||
static s32 D_801A86C0 = 0; // gd_dl id for something?
|
||||
static u32 unref_801a86C4 = 10;
|
||||
static s32 sMtxParamType = G_MTX_PROJECTION;
|
||||
static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f };
|
||||
static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl
|
||||
|
|
@ -212,10 +199,9 @@ static struct ObjView *sMenuView = NULL; // @ 801A86E8
|
|||
static u32 sItemsInMenu = 0; // @ 801A86EC
|
||||
static s32 sDebugViewsCount = 0; // number of elements in the sDebugViews array
|
||||
static s32 sCurrDebugViewIndex = 0; // @ 801A86F4; timing activate cool down counter?
|
||||
static u32 unref_801a86F8 = 0;
|
||||
static struct GdDisplayList *sCurrentGdDl = NULL; // @ 801A86FC
|
||||
static u32 sGdDlCount = 0; // @ 801A8700
|
||||
static struct DynListBankInfo sDynLists[] = { // @ 801A8704
|
||||
UNUSED static struct DynListBankInfo sDynLists[] = { // @ 801A8704
|
||||
{ STD_LIST_BANK, dynlist_test_cube },
|
||||
{ STD_LIST_BANK, dynlist_spot_shape },
|
||||
{ STD_LIST_BANK, dynlist_mario_master },
|
||||
|
|
@ -223,16 +209,9 @@ static struct DynListBankInfo sDynLists[] = { // @ 801A8704
|
|||
};
|
||||
|
||||
// textures and display list data
|
||||
static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
ROM_ASSET_LOAD_TEXTURE(gd_texture_hand_open, "textures/intro_raw/hand_open.rgba16.inc.c", 0x00258d80, 2048, 0x00000000, 2048);
|
||||
|
||||
static Gfx gd_texture2_dummy_aligner1[] = {
|
||||
gsSPEndDisplayList()
|
||||
};
|
||||
|
||||
ROM_ASSET_LOAD_TEXTURE(gd_texture_hand_closed, "textures/intro_raw/hand_closed.rgba16.inc.c", 0x00259588, 2048, 0x00000000, 2048);
|
||||
|
||||
ROM_ASSET_LOAD_TEXTURE(gd_texture_red_star_0, "textures/intro_raw/red_star_0.rgba16.inc.c", 0x00259d88, 2048, 0x00000000, 2048);
|
||||
|
|
@ -274,14 +253,6 @@ static Vtx_t gd_vertex_star[] = {
|
|||
{{-64, 128, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7F}},
|
||||
};
|
||||
|
||||
//! no references to these vertices
|
||||
UNUSED static Vtx_t gd_unused_vertex[] = {
|
||||
{{16384, 0, 0}, 0, {0, 16384}, {0x00, 0x00, 0x00}},
|
||||
{{ 0, 0, 16384}, 0, {0, 0}, {0x00, 0x00, 0x40}},
|
||||
{{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}},
|
||||
{{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}},
|
||||
};
|
||||
|
||||
static Gfx gd_dl_star_common[] = {
|
||||
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
|
||||
gsSPClearGeometryMode(G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
|
||||
|
|
@ -461,11 +432,11 @@ static Gfx gd_dl_sparkle[] = {
|
|||
gsSPClearGeometryMode(G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
|
||||
gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_NOOP2),
|
||||
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD,
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD,
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsSPVertex(gd_vertex_sparkle, 4, 0),
|
||||
|
|
@ -630,10 +601,6 @@ static Gfx *gd_silver_sparkle_dl_array[] = {
|
|||
#endif
|
||||
};
|
||||
|
||||
static Gfx gd_texture3_dummy_aligner1[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
ROM_ASSET_LOAD_TEXTURE(gd_texture_mario_face_shine, "textures/intro_raw/mario_face_shine.ia8.inc.c", 0x00265350, 1024, 0x00000000, 1024);
|
||||
|
||||
static Gfx gd_dl_mario_face_shine[] = {
|
||||
|
|
@ -642,7 +609,7 @@ static Gfx gd_dl_mario_face_shine[] = {
|
|||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsDPSetCombineMode(G_CC_HILITERGBA, G_CC_HILITERGBA),
|
||||
gsDPLoadTextureBlock(gd_texture_mario_face_shine, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
|
||||
gsDPLoadTextureBlock(gd_texture_mario_face_shine, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
|
||||
G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPPipeSync(),
|
||||
gsSPEndDisplayList(),
|
||||
|
|
@ -673,42 +640,8 @@ static Gfx gd_dl_rdp_init[] = {
|
|||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
static u32 gd_unused_pad1 = 0;
|
||||
|
||||
float sGdPerspTimer = 1.0;
|
||||
|
||||
static u32 gd_unused_pad2 = 0;
|
||||
|
||||
static Gfx gd_texture4_dummy_aligner1[] = {
|
||||
gsDPPipeSync(),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
static Vtx_t gd_unused_mesh_vertex_group1[] = {
|
||||
{{-8, 8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}},
|
||||
{{ 8, -2, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}},
|
||||
{{ 2, -8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}},
|
||||
};
|
||||
|
||||
static Vtx_t gd_unused_mesh_vertex_group2[] = {
|
||||
{{-6, 6, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}},
|
||||
{{ 7, -3, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}},
|
||||
{{ 3, -7, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}},
|
||||
};
|
||||
|
||||
static Gfx gd_dl_unused_mesh[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
|
||||
gsSPClearGeometryMode(0xFFFFFFFF),
|
||||
gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE),
|
||||
gsDPPipeSync(),
|
||||
gsSPVertex(gd_unused_mesh_vertex_group1, 3, 0),
|
||||
gsSP1Triangle(0, 1, 2, 0x0),
|
||||
gsSPVertex(gd_unused_mesh_vertex_group2, 3, 0),
|
||||
gsSP1Triangle(0, 1, 2, 0x0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
static Gfx gd_dl_sprite_start_tex_block[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCycleType(G_CYC_1CYCLE),
|
||||
|
|
@ -1261,7 +1194,7 @@ void gd_vblank(void) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Copies the player1 controller data from p1cont to sGdContPads[0].
|
||||
* Copies the player1 controller data from p1cont to sGdContPads[0].
|
||||
*/
|
||||
void gd_copy_p1_contpad(OSContPad *p1cont) {
|
||||
u32 i; // 24
|
||||
|
|
@ -2361,7 +2294,7 @@ void parse_p1_controller(void) {
|
|||
f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO;
|
||||
aspect *= 0.75;
|
||||
|
||||
// Copy current inputs to previous
|
||||
// Copy current inputs to previous
|
||||
u8 *src = (u8 *) gdctrl;
|
||||
u8 *dest = (u8 *) gdctrl->prevFrame;
|
||||
for (u32 i = 0; i < sizeof(struct GdControl); i++) {
|
||||
|
|
@ -3279,7 +3212,7 @@ void stub_renderer_14(UNUSED s8 *arg0) {
|
|||
* functions from IRIS GL.
|
||||
* @param buf pointer to an array of 16-bit values
|
||||
* @param len maximum number of values to store
|
||||
*/
|
||||
*/
|
||||
void init_pick_buf(s16 *buf, s32 len) {
|
||||
buf[0] = 0;
|
||||
buf[1] = 0;
|
||||
|
|
@ -3498,7 +3431,7 @@ void gd_put_sprite(u16 *sprite, s32 x, s32 y, s32 wx, s32 wy) {
|
|||
// Must be game screen aspect ratio, not GFX window aspect ratio
|
||||
f32 aspect = ((float) SCREEN_WIDTH) / ((float) SCREEN_HEIGHT ) * 0.75;
|
||||
x *= aspect;
|
||||
|
||||
|
||||
gSPDisplayList(next_gfx(), osVirtualToPhysical(gd_dl_sprite_start_tex_block));
|
||||
for (r = 0; r < wy; r += 32) {
|
||||
for (c = 0; c < wx; c += 32) {
|
||||
|
|
|
|||
|
|
@ -28,93 +28,39 @@ struct ObjShape *gShapeRedSpark = NULL; // @ 801A82EC
|
|||
struct ObjShape *gShapeSilverSpark = NULL; // @ 801A82F0
|
||||
struct ObjShape *gShapeRedStar = NULL; // @ 801A82F4
|
||||
struct ObjShape *gShapeSilverStar = NULL; // @ 801A82F8
|
||||
|
||||
// Not sure what this data is, but it looks like stub animation data
|
||||
|
||||
static struct GdAnimTransform unusedAnimData1[] = {
|
||||
{ {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} },
|
||||
};
|
||||
|
||||
static struct AnimDataInfo unusedAnim1 = { ARRAY_COUNT(unusedAnimData1), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData1 };
|
||||
|
||||
static struct GdAnimTransform unusedAnimData2[] = {
|
||||
{ {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} },
|
||||
};
|
||||
|
||||
static struct AnimDataInfo unusedAnim2 = { ARRAY_COUNT(unusedAnimData2), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData2 };
|
||||
|
||||
static struct GdAnimTransform unusedAnimData3[] = {
|
||||
{ {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} },
|
||||
};
|
||||
|
||||
static struct AnimDataInfo unusedAnim3 = { ARRAY_COUNT(unusedAnimData3), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData3 };
|
||||
|
||||
static s32 sUnref801A838C[6] = { 0 };
|
||||
struct ObjShape *sSimpleShape = NULL;
|
||||
static s32 sUnref801A83A8[31] = { 0 };
|
||||
static struct DynList sSimpleDylist[8] = { // unused
|
||||
BeginList(),
|
||||
StartGroup("simpleg"),
|
||||
MakeDynObj(D_NET, "simple"),
|
||||
SetType(3),
|
||||
SetShapePtrPtr(&sSimpleShape),
|
||||
EndGroup("simpleg"),
|
||||
UseObj("simpleg"),
|
||||
EndList(),
|
||||
};
|
||||
static struct DynList sDynlist801A84E4[3] = {
|
||||
BeginList(),
|
||||
SetFlag(0x1800),
|
||||
EndList(),
|
||||
};
|
||||
static struct DynList sDynlist801A85B3[5] = {
|
||||
BeginList(), CallList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01),
|
||||
EndList(),
|
||||
};
|
||||
static struct DynList sDynlist801A85A4[4] = {
|
||||
BeginList(),
|
||||
CallList(sDynlist801A84E4),
|
||||
SetFriction(0.04, 0.01, 0.01),
|
||||
EndList(),
|
||||
};
|
||||
static struct DynList sDynlist801A8604[4] = {
|
||||
BeginList(),
|
||||
CallList(sDynlist801A84E4),
|
||||
SetFriction(0.005, 0.005, 0.005),
|
||||
EndList(),
|
||||
};
|
||||
static f64 D_801A8668 = 0.0;
|
||||
|
||||
// bss
|
||||
static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00
|
||||
UNUSED static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00
|
||||
static struct ObjGroup *sCubeShapeGroup; // @ 801BAB2C
|
||||
static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30
|
||||
UNUSED static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30
|
||||
static struct ObjShape *sCubeShape; // @ 801BAB3C
|
||||
static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40
|
||||
UNUSED static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40
|
||||
static char sGdLineBuf[0x100]; // @ 801BAB48
|
||||
static s32 sGdLineBufCsr; // @ 801BAC48
|
||||
static struct GdFile *sGdShapeFile; // @ 801BAC4C
|
||||
static struct ObjShape *sGdShapeListHead; // @ 801BAC50
|
||||
static u32 sGdShapeCount; // @ 801BAC54
|
||||
static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58
|
||||
UNUSED static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58
|
||||
static struct GdVec3f D_801BAC60;
|
||||
static u32 sUnrefSpaceC6C; // @ 801BAC6C
|
||||
static u32 sUnrefSpaceC70; // @ 801BAC70
|
||||
UNUSED static u32 sUnrefSpaceC6C; // @ 801BAC6C
|
||||
UNUSED static u32 sUnrefSpaceC70; // @ 801BAC70
|
||||
static struct ObjPlane *D_801BAC74;
|
||||
static struct ObjPlane *D_801BAC78; // sShapeNetHead?
|
||||
static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80
|
||||
UNUSED static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80
|
||||
static struct ObjFace *D_801BAC9C;
|
||||
static struct ObjFace *D_801BACA0;
|
||||
static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8
|
||||
UNUSED static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8
|
||||
/// factor for scaling vertices in an `ObjShape` when calling `scale_verts_in_shape()`
|
||||
static struct GdVec3f sVertexScaleFactor;
|
||||
/// factor for translating vertices in an `ObjShape` when calling `translate_verts_in_shape()`
|
||||
static struct GdVec3f sVertexTranslateOffset;
|
||||
static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8
|
||||
UNUSED static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8
|
||||
static struct ObjGroup *D_801BAD08; // group of planes from make_netfromshape
|
||||
static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10
|
||||
UNUSED static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10
|
||||
static struct GdVec3f sShapeCenter; // printed with "c="
|
||||
static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40
|
||||
UNUSED static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40
|
||||
|
||||
// Forward Declarations
|
||||
struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *, s32, f32, f32, f32);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -36,7 +36,7 @@ static void _debuglog_print_short_filename(const char* filename) {
|
|||
}
|
||||
}
|
||||
|
||||
static void _debuglog_print_log(const char* logType, char* filename) {
|
||||
static inline void _debuglog_print_log(const char* logType, char* filename) {
|
||||
_debuglog_print_timestamp();
|
||||
_debuglog_print_network_type();
|
||||
_debuglog_print_log_type(logType);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ void discord_fatal(int rc) {
|
|||
}
|
||||
}
|
||||
|
||||
static void get_oauth2_token_callback(UNUSED void* data, enum EDiscordResult result, struct DiscordOAuth2Token* token) {
|
||||
UNUSED static void get_oauth2_token_callback(UNUSED void* data, enum EDiscordResult result, struct DiscordOAuth2Token* token) {
|
||||
LOG_INFO("> get_oauth2_token_callback returned %d", result);
|
||||
if (result != DiscordResult_Ok) { return; }
|
||||
LOG_INFO("OAuth2 token: %s", token->access_token);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <PR/ultratypes.h>
|
||||
#include "discord_game_sdk.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) || defined(OSX_BUILD)
|
||||
#define DISCORD_ID_FORMAT "%lld"
|
||||
#else
|
||||
#define DISCORD_ID_FORMAT "%ld"
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static void on_activity_join(UNUSED void* data, const char* secret) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static void on_activity_join_request_callback(UNUSED void* data, enum EDiscordResult result) {
|
||||
UNUSED static void on_activity_join_request_callback(UNUSED void* data, enum EDiscordResult result) {
|
||||
LOG_INFO("> on_activity_join_request_callback returned %d", (int)result);
|
||||
DISCORD_REQUIRE(result);
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ static void on_activity_join_request(UNUSED void* data, struct DiscordUser* user
|
|||
LOG_INFO("> on_activity_join_request from " DISCORD_ID_FORMAT, user->id);
|
||||
}
|
||||
|
||||
static void strncat_len(char* destination, char* source, size_t destinationLength, size_t sourceLength) {
|
||||
UNUSED static void strncat_len(char* destination, char* source, size_t destinationLength, size_t sourceLength) {
|
||||
char altered[128] = { 0 };
|
||||
snprintf(altered, (sourceLength < 127) ? sourceLength : 127, "%s", source);
|
||||
strncat(destination, altered, destinationLength);
|
||||
|
|
|
|||
|
|
@ -620,7 +620,7 @@ inline
|
|||
#else
|
||||
static
|
||||
#endif
|
||||
void DiscordCreateParamsSetDefault(struct DiscordCreateParams* params)
|
||||
__attribute__((unused)) void DiscordCreateParamsSetDefault(struct DiscordCreateParams* params)
|
||||
{
|
||||
memset(params, 0, sizeof(struct DiscordCreateParams));
|
||||
params->application_version = DISCORD_APPLICATION_MANAGER_VERSION;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ static void djui_interactable_on_focus_end(struct DjuiBase* base) {
|
|||
CALL_CALLBACK(on_focus_end);
|
||||
}
|
||||
|
||||
static void djui_interactable_on_value_change(struct DjuiBase* base) {
|
||||
UNUSED static void djui_interactable_on_value_change(struct DjuiBase* base) {
|
||||
if (base == NULL) { return; }
|
||||
if (base->interactable == NULL) { return; }
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ static bool djui_panel_join_direct_ip_parse_port(char** msg) {
|
|||
return port <= 65535;
|
||||
}
|
||||
|
||||
static bool djui_panel_join_direct_ip_valid(char* buffer) {
|
||||
UNUSED static bool djui_panel_join_direct_ip_valid(char* buffer) {
|
||||
char** msg = &buffer;
|
||||
|
||||
if (!djui_panel_join_direct_ip_parse_numbers(msg)) { return false; }
|
||||
|
|
@ -107,7 +107,7 @@ static void djui_panel_join_direct_ip_text_set_new(void) {
|
|||
bool is_ipv6 = false;
|
||||
int port = 0;
|
||||
|
||||
// check if address starts with [ (meaning it's a direct IPv6 address.
|
||||
// check if address starts with [ (meaning it's a direct IPv6 address.
|
||||
// This is needed because we need to know when to get the port number. Example: [2001:db8::1000]:7777
|
||||
// If this character is not in the first character in the buffer, it will be treated as an IPv4 address or hostname.
|
||||
if (buffer[0] == '[') {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static void gfx_dummy_wm_set_keyboard_callbacks(UNUSED kb_callback_t on_key_down
|
|||
static void gfx_dummy_wm_set_scroll_callback(UNUSED void (*on_scroll)(float, float)) {
|
||||
}
|
||||
|
||||
static void gfx_dummy_wm_set_fullscreen(UNUSED bool enable) {
|
||||
UNUSED static void gfx_dummy_wm_set_fullscreen(UNUSED bool enable) {
|
||||
}
|
||||
|
||||
static void gfx_dummy_wm_main_loop(void (*run_one_game_iter)(void)) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ static bool sHasInverseCameraMatrix = false;
|
|||
// 4x4 pink-black checkerboard texture to indicate missing textures
|
||||
#define MISSING_W 4
|
||||
#define MISSING_H 4
|
||||
static const uint8_t missing_texture[MISSING_W * MISSING_H * 4] = {
|
||||
UNUSED static const uint8_t missing_texture[MISSING_W * MISSING_H * 4] = {
|
||||
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF,
|
||||
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF,
|
||||
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static struct LoadingScreen* sLoading = NULL;
|
|||
struct ThreadHandle gLoadingThread = { 0 };
|
||||
|
||||
void loading_screen_set_segment_text(const char* text) {
|
||||
snprintf(gCurrLoadingSegment.str, 256, text);
|
||||
snprintf(gCurrLoadingSegment.str, 256, "%s", text);
|
||||
}
|
||||
|
||||
void loading_screen_reset_progress_bar(void) {
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ int smlua_func_gfx_set_command(lua_State* L) {
|
|||
}
|
||||
|
||||
// Parse the command
|
||||
const u32 errorSize = 0x400;
|
||||
u32 errorSize = 0x400;
|
||||
char errorMsg[errorSize];
|
||||
if (!dynos_smlua_parse_gfx_command(L, gfx, command, specifiersCount != 0, errorMsg, errorSize)) {
|
||||
LOG_LUA_LINE("gfx_set_command: Command \"%s\": %s", command, errorMsg);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ static int upval_references_deduplicate(lua_State *L, char* name, int reference,
|
|||
return reference;
|
||||
}
|
||||
|
||||
static void upval_references_mark_active(int reference) {
|
||||
UNUSED static void upval_references_mark_active(int reference) {
|
||||
for (UpvalReference *ref = sUpvalReferences; ref; ref = ref->next) {
|
||||
if (ref->reference == reference) {
|
||||
ref->active = true;
|
||||
|
|
@ -299,7 +299,7 @@ static void upvalues_replace_hooks(lua_State *L) {
|
|||
}
|
||||
}
|
||||
|
||||
static void upvalues_print(UpvalRecord *upvalsHead) {
|
||||
UNUSED static void upvalues_print(UpvalRecord *upvalsHead) {
|
||||
for (const UpvalRecord *cur = upvalsHead; cur; cur = cur->next) {
|
||||
LOG_INFO("upval: %s, %s, %d, %p", cur->funcKeyStr ? cur->funcKeyStr : "(non-string)", cur->name, cur->ref, cur->id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ static int16_t resample_table[64][4] = {
|
|||
{0xffd8, 0x0e5f, 0x6696, 0x0b39}, {0xffdf, 0x0d46, 0x66ad, 0x0c39}
|
||||
};
|
||||
|
||||
#if !HAS_SSE41 && !HAS_NEON
|
||||
static inline int16_t OPTIMIZE_O3 clamp16(int32_t v) {
|
||||
if (v < -0x8000) {
|
||||
return -0x8000;
|
||||
|
|
@ -105,6 +106,7 @@ static inline int32_t clamp32(int64_t v) {
|
|||
}
|
||||
return (int32_t)v;
|
||||
}
|
||||
#endif
|
||||
|
||||
void aClearBufferImpl(uint16_t addr, int nbytes) {
|
||||
nbytes = ROUND_UP_16(nbytes);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ __attribute__((constructor)) static void _name ## _rom_assets_queue () { \
|
|||
}
|
||||
|
||||
#define ROM_ASSET_LOAD_MARIO_ANIM(_name, _ptr, _physicalAddress, _physicalSize, _segmentedAddress, _segmentedSize) \
|
||||
static u16 _name[(_segmentedSize) / 2] = { 0 }; \
|
||||
__attribute__((constructor)) static void _name ## _rom_assets_queue () { \
|
||||
rom_assets_queue(_ptr, ROM_ASSET_ANIM, _physicalAddress, _physicalSize, _segmentedAddress, _segmentedSize); \
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ bool expanded = false;
|
|||
bool writeTiles;
|
||||
bool storeNamesOnly = false;
|
||||
|
||||
static void allocate_tiles() {
|
||||
static void allocate_tiles(void) {
|
||||
const ImageProps props = IMAGE_PROPERTIES[type][true];
|
||||
int tileWidth = props.tileWidth;
|
||||
int tileHeight = props.tileHeight;
|
||||
|
|
@ -97,7 +97,7 @@ static void allocate_tiles() {
|
|||
}
|
||||
}
|
||||
|
||||
static void free_tiles() {
|
||||
static void free_tiles(void) {
|
||||
free(tiles->px);
|
||||
free(tiles);
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ static void init_tiles(rgba *image, bool expanded) {
|
|||
}
|
||||
}
|
||||
|
||||
static void assign_tile_positions() {
|
||||
static void assign_tile_positions(void) {
|
||||
const ImageProps props = IMAGE_PROPERTIES[type][true];
|
||||
const size_t TILE_SIZE = props.tileWidth * props.tileHeight * sizeof(rgba);
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ static void assign_tile_positions() {
|
|||
#endif
|
||||
|
||||
/* write pngs to disc */
|
||||
void write_tiles() {
|
||||
void write_tiles(void) {
|
||||
const ImageProps props = IMAGE_PROPERTIES[type][true];
|
||||
char buffer[PATH_MAX];
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ static void print_raw_data(FILE *cFile, TextureTile *tile) {
|
|||
free(raw);
|
||||
}
|
||||
|
||||
static void write_skybox_c() { /* write c data to disc */
|
||||
static void write_skybox_c(void) { /* write c data to disc */
|
||||
const ImageProps props = IMAGE_PROPERTIES[type][true];
|
||||
|
||||
char fBuffer[PATH_MAX * 2] = "";
|
||||
|
|
@ -324,7 +324,7 @@ static void write_skybox_c() { /* write c data to disc */
|
|||
fclose(cFile);
|
||||
}
|
||||
|
||||
static void write_cake_c() {
|
||||
static void write_cake_c(void) {
|
||||
char buffer[PATH_MAX] = "";
|
||||
if (realpath(output, buffer) == NULL) {
|
||||
fprintf(stderr, "err: Could not find find src dir %s", output);
|
||||
|
|
@ -492,7 +492,7 @@ fail:
|
|||
}
|
||||
|
||||
// Modified from n64split
|
||||
static void usage() {
|
||||
static void usage(void) {
|
||||
fprintf(stderr,
|
||||
"Usage: %s --type sky|cake|cake_eu {--combine INPUT OUTPUT | --split INPUT OUTPUT}\n"
|
||||
"\n"
|
||||
|
|
@ -532,7 +532,7 @@ static int parse_arguments(int argc, char *argv[]) {
|
|||
|
||||
output = argv[i];
|
||||
}
|
||||
|
||||
|
||||
if (strcmp(argv[i], "--type") == 0) {
|
||||
if (++i >= argc || type != InvalidType) {
|
||||
goto invalid;
|
||||
|
|
@ -645,7 +645,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
allocate_tiles();
|
||||
|
||||
|
||||
init_tiles(image, expanded);
|
||||
switch (type) {
|
||||
case Skybox:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue