format files

This commit is contained in:
Alex Bates 2020-08-19 01:16:12 +01:00
parent 1012d8de77
commit f19e2edbd3
No known key found for this signature in database
GPG Key ID: 5E11C2DB78877706
8 changed files with 91 additions and 91 deletions

View File

@ -522,7 +522,7 @@ typedef struct BattleStatus {
/* 0x0B1 */ char unk_B1[3];
/* 0x0B4 */ UNK_FUN_PTR(preUpdateCallback);
/* 0x0B8 */ char unk_B8[4];
/* 0x0BC */ struct ScriptInstance* controlScript; /* control handed over to this when changing partners, maybe general? */
/* 0x0BC */ struct ScriptInstance* controlScript; /* control handed over to this when changing partners */
/* 0x0C0 */ s32 controlScriptID;
/* 0x0C4 */ struct ScriptInstance* camMovementScript;
/* 0x0C8 */ s32 camMovementScriptID;

View File

@ -1,40 +1,40 @@
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/**************************************************************************
*
* $Revision: 1.10 $
* $Date: 1997/02/11 08:37:33 $
* $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultra64.h,v $
*
**************************************************************************/
#ifndef _ULTRA64_H_
#define _ULTRA64_H_
#include <PR/ultratypes.h>
#include <PR/rcp.h>
#include <PR/os.h>
#include <PR/region.h>
#include <PR/rmon.h>
#include <PR/sptask.h>
#include <PR/mbi.h>
#include <PR/libaudio.h>
#include <PR/gu.h>
#include <PR/ramrom.h>
#include <PR/sp.h>
#include <PR/ucode.h>
#include <PR/ultraerror.h>
#include <PR/ultralog.h>
#endif
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/**************************************************************************
*
* $Revision: 1.10 $
* $Date: 1997/02/11 08:37:33 $
* $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultra64.h,v $
*
**************************************************************************/
#ifndef _ULTRA64_H_
#define _ULTRA64_H_
#include <PR/ultratypes.h>
#include <PR/rcp.h>
#include <PR/os.h>
#include <PR/region.h>
#include <PR/rmon.h>
#include <PR/sptask.h>
#include <PR/mbi.h>
#include <PR/libaudio.h>
#include <PR/gu.h>
#include <PR/ramrom.h>
#include <PR/sp.h>
#include <PR/ucode.h>
#include <PR/ultraerror.h>
#include <PR/ultralog.h>
#endif

View File

@ -300,7 +300,7 @@ void update_coin_counter(void) {
UiStatus* uiStatus = &gUIStatus;
PlayerData* playerData = &gPlayerData;
do {} while(0); // Needed to match
do {} while (0); // Needed to match
if (uiStatus->unk_6C[1] != 0) {
uiStatus->unk_6C[1] -= 1;
@ -354,7 +354,7 @@ void show_coin_counter(void) {
D_8010CD12 = 0;
}
if (uiStatus->unk_6C[0]== 0) {
if (uiStatus->unk_6C[0] == 0) {
func_80147CC8(0x14, 0x20, 0xa4, 0x40, 0x14, 0x15, &D_800E92D8, 0, -1);
func_80147E7C(0x14, &D_80147474);
index = create_icon(&D_80109270);
@ -380,7 +380,7 @@ void show_coin_counter(void) {
void hide_coin_counter(void) {
UiStatus* uiStatus = &gUIStatus;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) {
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0] == 0)) {
uiStatus->unk_6C[0] = 60;
}
}
@ -388,8 +388,8 @@ void hide_coin_counter(void) {
void func_800E96C8(void) {
UiStatus* uiStatus = &gUIStatus;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) {
uiStatus->unk_6C[0]= 1;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0] == 0)) {
uiStatus->unk_6C[0] = 1;
}
}

View File

@ -31,7 +31,7 @@ void func_80145DF8(void) {
gameStatus->enableBackground &= 0xF0;
}
void read_background_size(BackgroundHeader *bg) {
void read_background_size(BackgroundHeader* bg) {
GameStatus* gameStatus = *gGameStatusPtr;
gameStatus->backgroundMaxW = bg->width;

View File

@ -64,7 +64,7 @@ s32 kill_all_scripts(void) {
s32 i;
ScriptInstance* scriptContextPtr;
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
if (scriptContextPtr != NULL) {
kill_script(scriptContextPtr);
@ -77,7 +77,7 @@ s32 does_script_exist(s32 id) {
s32 i;
ScriptInstance* scriptContextPtr;
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
if (scriptContextPtr != NULL && scriptContextPtr->uniqueID == id) {
return 1;
@ -89,8 +89,8 @@ s32 does_script_exist(s32 id) {
s32 does_script_exist_by_ref(ScriptInstance* script) {
s32 i;
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
if(script == (*gCurrentScriptListPtr)[i]) {
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
if (script == (*gCurrentScriptListPtr)[i]) {
return 1;
}
}
@ -139,7 +139,7 @@ void suspend_group_script(ScriptInstance* script, s32 groupFlags) {
suspend_group_script(childScript, groupFlags);
}
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
suspend_group_script(scriptContextPtr, groupFlags);
@ -160,7 +160,7 @@ void resume_group_script(ScriptInstance* script, s32 groupFlags) {
resume_group_script(childScript, groupFlags);
}
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
suspend_group_script(scriptContextPtr, groupFlags);
@ -298,7 +298,7 @@ void set_script_flags(ScriptInstance* script, s32 flags) {
set_script_flags(childScript, flags);
}
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
set_script_flags(script->parentScript, flags);

View File

@ -56,7 +56,7 @@ INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_greater_equal);
ApiStatus si_handle_if_AND(ScriptInstance* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
s32* ptrReadPos = script->ptrReadPos;
var1 = ptrReadPos[0];
ptrReadPos++;
@ -71,7 +71,7 @@ ApiStatus si_handle_if_AND(ScriptInstance* script) {
//INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_not_AND);
ApiStatus si_handle_if_not_AND(ScriptInstance* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
s32* ptrReadPos = script->ptrReadPos;
var1 = ptrReadPos[0];
ptrReadPos++;

View File

@ -14,12 +14,12 @@ ApiStatus MakeLerp(ScriptInstance* script, s32 isInitialCall) {
ApiStatus UpdateLerp(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0x0] = (s32) update_lerp(
script->varTable[0xB],
script->varTable[0xC],
script->varTable[0xD],
script->varTable[0xE],
script->varTable[0xF]
);
script->varTable[0xB],
script->varTable[0xC],
script->varTable[0xD],
script->varTable[0xE],
script->varTable[0xF]
);
if (script->varTable[0xE] >= script->varTable[0xF]) {
script->varTable[0x1] = 0; // finished
@ -99,9 +99,9 @@ ApiStatus AwaitPlayerApproach(ScriptInstance* script, s32 isInitialCall) {
}
distance = dist2D(
playerStatus->position.x, playerStatus->position.z,
*targetX, *targetZ
);
playerStatus->position.x, playerStatus->position.z,
*targetX, *targetZ
);
if (distance < *distanceRequired) {
return ApiStatus_DONE2;
@ -129,9 +129,9 @@ ApiStatus IsPlayerWithin(ScriptInstance* script, s32 isInitialCall) {
}
distance = dist2D(
playerStatus->position.x, playerStatus->position.z,
*targetX, *targetZ
);
playerStatus->position.x, playerStatus->position.z,
*targetX, *targetZ
);
set_variable(script, outVar, 0);
if (distance < *distanceRequired) {
@ -158,9 +158,9 @@ ApiStatus AwaitPlayerLeave(ScriptInstance* script, s32 isInitialCall) {
}
distance = dist2D(
playerStatus->position.x, playerStatus->position.z,
*targetX, *targetZ
);
playerStatus->position.x, playerStatus->position.z,
*targetX, *targetZ
);
if (distance > *distanceRequired) {
return ApiStatus_DONE2;
@ -264,11 +264,11 @@ ApiStatus GetDist2D(ScriptInstance* script, s32 isInitialCall) {
Bytecode outVar = *ptrReadPos++;
set_float_variable(script, outVar, dist2D(
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++)
));
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++)
));
return ApiStatus_DONE2;
}

View File

@ -91,7 +91,7 @@ INCLUDE_API_ASM("code_fa4c0_len_3bf0", PlaySoundAtF);
ApiStatus RemoveKeyItemAt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 index = get_variable(script, *ptrReadPos++);
s16* ptrKeyItems = (s16 *) &gPlayerData.keyItems;
s16* ptrKeyItems = (s16*) &gPlayerData.keyItems;
ptrKeyItems[index] = 0;
return ApiStatus_DONE2;
@ -100,7 +100,7 @@ ApiStatus RemoveKeyItemAt(ScriptInstance* script, s32 isInitialCall) {
ApiStatus RemoveItemAt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 index = get_variable(script, *ptrReadPos++);
s16* ptrInvItems = (s16 *) &gPlayerData.invItems;
s16* ptrInvItems = (s16*) &gPlayerData.invItems;
ptrInvItems[index] = 0;
sort_items();
@ -146,7 +146,7 @@ ApiStatus HasKeyItem(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
s32 i;
for(i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
if (playerData->keyItems[i] == itemID) {
break;
}
@ -163,7 +163,7 @@ ApiStatus FindKeyItem(ScriptInstance* script, s32 isInitialCall) {
s32 i;
s32 itemIndex;
for(i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
if (playerData->keyItems[i] == itemID) {
break;
}
@ -181,7 +181,7 @@ ApiStatus FindKeyItem(ScriptInstance* script, s32 isInitialCall) {
ApiStatus AddItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = (s32 *) *ptrReadPos++;
s32* ptrNextPos = (s32*) *ptrReadPos++;
set_variable(script, ptrNextPos, add_item(itemID));
return ApiStatus_DONE2;
@ -282,20 +282,20 @@ ApiStatus DropItemEntityB(ScriptInstance* script, s32 isInitialCall) {
*/
ApiStatus RemoveItemEntity(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemEntityIndex = get_variable(script, *ptrReadPos++);
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemEntityIndex = get_variable(script, *ptrReadPos++);
remove_item_entity_by_index(itemEntityIndex);
return ApiStatus_DONE2;
remove_item_entity_by_index(itemEntityIndex);
return ApiStatus_DONE2;
}
ApiStatus AddBadge(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = (s32 *) *ptrReadPos++;
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = (s32*) *ptrReadPos++;
set_variable(script, ptrNextPos, add_badge(itemID));
return ApiStatus_DONE2;
set_variable(script, ptrNextPos, add_badge(itemID));
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_fa4c0_len_3bf0", RemoveBadge);
@ -311,7 +311,7 @@ ApiStatus SetItemPos(ScriptInstance* script, s32 isInitialCall) {
y = get_variable(script, *ptrReadPos++);
z = get_variable(script, *ptrReadPos++);
ptrItemEntity = (ItemEntity *) get_item_entity(itemEntityIndex);
ptrItemEntity = (ItemEntity*) get_item_entity(itemEntityIndex);
ptrItemEntity->position.x = x;
ptrItemEntity->position.y = y;
ptrItemEntity->position.z = z;