mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2024-11-23 22:19:53 +00:00
Use libc functions for bcmp, bcpy, bzero, LibMemset, LibMemCmp.
This commit is contained in:
parent
1ad3317705
commit
ff8ba2cc10
@ -5,9 +5,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
void bcopy(void* __src, void* __dest, int __n);
|
||||
int bcmp(void* __s1, void* __s2, int __n);
|
||||
void bzero(void* begin, int length);
|
||||
//void bcopy(void* __src, void* __dest, int __n);
|
||||
//int bcmp(void* __s1, void* __s2, int __n);
|
||||
//void bzero(void* begin, int length);
|
||||
|
||||
// s32 vsprintf(char* dst, char* fmt, va_list args);
|
||||
int sprintf(char* dst, const char* fmt, ...);
|
||||
|
@ -526,8 +526,6 @@ void Font_LoadCharNES(PlayState* play, u8 codePointIndex, s32 offset);
|
||||
void Font_LoadMessageBoxEndIcon(Font* font, u16 icon);
|
||||
void Font_LoadOrderedFont(Font* font);
|
||||
|
||||
void* Lib_MemCpy(void* dest, void* src, size_t size);
|
||||
void* Lib_MemSet(void* buffer, s32 value, size_t size);
|
||||
void Lib_GetControlStickData(f32* outMagnitude, s16* outAngle, Input* input);
|
||||
void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain);
|
||||
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src);
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "buffers.h"
|
||||
|
||||
#include <string.h>
|
||||
/**
|
||||
* SoundFont Notes:
|
||||
*
|
||||
@ -788,7 +788,7 @@ void* AudioLoad_SyncLoad(s32 tableType, u32 id, s32* didAllocate) {
|
||||
size -= 0x10;
|
||||
}
|
||||
|
||||
bcopy(romAddr, ramAddr, size);
|
||||
memcpy(ramAddr, romAddr, size);
|
||||
} else if (medium2 == mediumUnk) {
|
||||
AudioLoad_SyncDmaUnkMedium(romAddr, ramAddr, size, (s16)table->unkMediumParam);
|
||||
} else {
|
||||
@ -1746,7 +1746,7 @@ void AudioLoad_AsyncDmaRamUnloaded(AudioAsyncLoad* asyncLoad, size_t size) {
|
||||
size = ALIGN16(size);
|
||||
Audio_InvalDCache(asyncLoad->curRamAddr, size);
|
||||
osCreateMesgQueue(&asyncLoad->msgQueue, &asyncLoad->msg, 1);
|
||||
bcopy(asyncLoad->curDevAddr, asyncLoad->curRamAddr, size);
|
||||
memcpy(asyncLoad->curRamAddr, asyncLoad->curDevAddr, size);
|
||||
osSendMesg(&asyncLoad->msgQueue, OS_MESG_PTR(NULL), OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "libc/stdint.h"
|
||||
#include "macros.h"
|
||||
#include "functions.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FILL_ALLOCBLOCK (1 << 0)
|
||||
#define FILL_FREEBLOCK (1 << 1)
|
||||
@ -57,7 +58,7 @@ ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) {
|
||||
* @param size The size of the heap.
|
||||
*/
|
||||
void __osMallocInit(Arena* arena, void* heap, size_t size) {
|
||||
bzero(arena, sizeof(Arena));
|
||||
memset(arena, 0, sizeof(Arena));
|
||||
|
||||
ArenaImpl_LockInit(arena);
|
||||
|
||||
@ -112,7 +113,7 @@ void __osMallocAddHeap(Arena* arena, void* heap, size_t size) {
|
||||
* @param arena The Arena to clear.
|
||||
*/
|
||||
void __osMallocCleanup(Arena* arena) {
|
||||
bzero(arena, sizeof(Arena));
|
||||
memset(arena, 0, sizeof(Arena));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -377,7 +378,7 @@ void* __osRealloc(Arena* arena, void* ptr, size_t newSize) {
|
||||
// Create a new pointer and manually copy the data from the old pointer to the new one
|
||||
newPtr = __osMalloc(arena, newSize);
|
||||
if (newPtr != NULL) {
|
||||
bcopy(newPtr, ptr, node->size);
|
||||
memcpy(ptr, newPtr, node->size);
|
||||
__osFree(arena, ptr);
|
||||
}
|
||||
ptr = newPtr;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "global.h"
|
||||
#include "system_malloc.h"
|
||||
#include "loadfragment.h"
|
||||
#include <string.h>
|
||||
|
||||
s32 gLoadLogSeverity = 2;
|
||||
|
||||
@ -165,7 +166,7 @@ size_t Fragment_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, vo
|
||||
|
||||
if (ovlRelocs->bssSize != 0) {
|
||||
if (gLoadLogSeverity >= 3) {}
|
||||
bzero((void*)end, ovlRelocs->bssSize);
|
||||
memset((void*)end, 0, ovlRelocs->bssSize);
|
||||
}
|
||||
|
||||
osWritebackDCache(allocatedRamAddr, allocatedBytes);
|
||||
@ -220,7 +221,7 @@ void* Fragment_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vra
|
||||
|
||||
if (ovlRelocs->bssSize != 0) {
|
||||
if (gLoadLogSeverity >= 3) {}
|
||||
bzero((void*)end, ovlRelocs->bssSize);
|
||||
memset((void*)end, 0, ovlRelocs->bssSize);
|
||||
}
|
||||
|
||||
osInvalICache(allocatedRamAddr, allocatedBytes);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "os_malloc.h"
|
||||
#include <string.h>
|
||||
|
||||
Arena gSystemArena;
|
||||
|
||||
@ -25,7 +26,7 @@ void* SystemArena_Calloc(u32 elements, size_t size) {
|
||||
|
||||
ptr = __osMalloc(&gSystemArena, totalSize);
|
||||
if (ptr != NULL) {
|
||||
bzero(ptr, totalSize);
|
||||
memset(ptr, 0, totalSize);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
u8 sYaz0DataBuffer[0x400] ALIGNED(16);
|
||||
u8* sYaz0CurDataEnd;
|
||||
@ -35,7 +36,7 @@ void* Yaz0_NextDMA(void* curSrcPos) {
|
||||
|
||||
dst = (restSize & 7) ? (sYaz0DataBuffer - (restSize & 7)) + 8 : sYaz0DataBuffer;
|
||||
|
||||
bcopy(curSrcPos, dst, restSize);
|
||||
memcpy(dst, curSrcPos, restSize);
|
||||
dmaSize = ((u32)sYaz0CurDataEnd - (u32)dst) - restSize;
|
||||
if (sYaz0CurSize < dmaSize) {
|
||||
dmaSize = sYaz0CurSize;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/**
|
||||
* Assigns the "save" values in PreRender
|
||||
@ -34,7 +35,7 @@ void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf,
|
||||
}
|
||||
|
||||
void PreRender_Init(PreRender* this) {
|
||||
bzero(this, sizeof(PreRender));
|
||||
memset(this, 0, sizeof(PreRender));
|
||||
ListAlloc_Init(&this->alloc);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "tha.h"
|
||||
#include "alignment.h"
|
||||
#include "functions.h"
|
||||
#include <string.h>
|
||||
|
||||
void* THA_GetHead(TwoHeadArena* tha) {
|
||||
return tha->head;
|
||||
@ -122,7 +123,7 @@ void THA_Reset(TwoHeadArena* tha) {
|
||||
* Creates a new Two Head Arena at `start` with available size `size`
|
||||
*/
|
||||
void THA_Init(TwoHeadArena* tha, void* start, size_t size) {
|
||||
bzero(tha, sizeof(TwoHeadArena));
|
||||
memset(tha, 0, sizeof(TwoHeadArena));
|
||||
tha->start = start;
|
||||
tha->size = size;
|
||||
THA_Reset(tha);
|
||||
@ -132,5 +133,5 @@ void THA_Init(TwoHeadArena* tha, void* start, size_t size) {
|
||||
* Destroys the Two Head Arena, no further allocations are possible
|
||||
*/
|
||||
void THA_Destroy(TwoHeadArena* tha) {
|
||||
bzero(tha, sizeof(TwoHeadArena));
|
||||
memset(tha, 0, sizeof(TwoHeadArena));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "audiomgr.h"
|
||||
#include <string.h>
|
||||
|
||||
void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) {
|
||||
AudioTask* task = audioMgr->rspTask;
|
||||
@ -128,7 +129,7 @@ void AudioMgr_Unlock(AudioMgr* audioMgr) {
|
||||
}
|
||||
|
||||
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr) {
|
||||
bzero(audioMgr, sizeof(AudioMgr));
|
||||
memset(audioMgr, 0, sizeof(AudioMgr));
|
||||
|
||||
audioMgr->sched = sched;
|
||||
audioMgr->irqMgr = irqMgr;
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "fault.h"
|
||||
#include "gfxdebuggerbridge.h"
|
||||
#include "libultraship/libultraship.h"
|
||||
#include <string.h>
|
||||
|
||||
// Variables are put before most headers as a hacky way to bypass bss reordering
|
||||
FaultAddrConvClient sGraphFaultAddrConvClient;
|
||||
@ -121,7 +122,7 @@ uintptr_t Graph_FaultAddrConv(uintptr_t address, void* param) {
|
||||
}
|
||||
|
||||
void Graph_Init(GraphicsContext* gfxCtx) {
|
||||
bzero(gfxCtx, sizeof(GraphicsContext));
|
||||
memset(gfxCtx, 0, sizeof(GraphicsContext));
|
||||
gfxCtx->gfxPoolIdx = 0;
|
||||
gfxCtx->framebufferIndex = 0;
|
||||
gfxCtx->viMode = NULL;
|
||||
@ -400,7 +401,7 @@ void RunFrame() {
|
||||
|
||||
runFrameContext.gameState = SystemArena_Malloc(size);
|
||||
|
||||
bzero(runFrameContext.gameState, size); // fix
|
||||
memset(runFrameContext.gameState, 0, size); // fix
|
||||
GameState_Init(runFrameContext.gameState, runFrameContext.ovl->init, &runFrameContext.gfxCtx);
|
||||
|
||||
uint64_t freq = GetFrequency();
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "PR/os_motor.h"
|
||||
#include "fault.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
//extern FaultMgr gFaultMgr;
|
||||
|
||||
#define PADMGR_RETRACE_MSG (1 << 0)
|
||||
@ -614,11 +614,11 @@ void PadMgr_HandleRetrace(void) {
|
||||
osContGetReadData(sPadMgrInstance->pads);
|
||||
|
||||
// Clear all but controller 1
|
||||
bzero(&sPadMgrInstance->pads[1], sizeof(*sPadMgrInstance->pads) * (MAXCONTROLLERS - 1));
|
||||
memset(&sPadMgrInstance->pads[1], 0, sizeof(*sPadMgrInstance->pads) * (MAXCONTROLLERS - 1));
|
||||
|
||||
// If in PreNMI, clear all controllers
|
||||
if (sPadMgrInstance->isResetting) {
|
||||
bzero(sPadMgrInstance->pads, sizeof(sPadMgrInstance->pads));
|
||||
memset(sPadMgrInstance->pads, 0, sizeof(sPadMgrInstance->pads));
|
||||
}
|
||||
|
||||
// Query controller statuses
|
||||
@ -796,7 +796,7 @@ void PadMgr_ThreadEntry() {
|
||||
}
|
||||
|
||||
void PadMgr_Init(OSMesgQueue* siEvtQ, IrqMgr* irqMgr, OSId threadId, OSPri pri, void* stack) {
|
||||
bzero(sPadMgrInstance, sizeof(PadMgr));
|
||||
memset(sPadMgrInstance, 0, sizeof(PadMgr));
|
||||
sPadMgrInstance->irqMgr = irqMgr;
|
||||
|
||||
// These are unique access tokens, there should only ever be room for one OSMesg in these queues
|
||||
|
@ -18,6 +18,7 @@ u32 gAudioSPDataSize;
|
||||
#include "stackcheck.h"
|
||||
#include "z64speed_meter.h"
|
||||
#include "z64thread.h"
|
||||
#include <string.h>
|
||||
|
||||
#define RSP_DONE_MSG 667
|
||||
#define RDP_DONE_MSG 668
|
||||
@ -611,7 +612,7 @@ void Sched_ThreadEntry(void* arg) {
|
||||
* Directs the OS to send SP and DP OS messages to interruptQ when the RSP or RDP signal task completion.
|
||||
*/
|
||||
void Sched_Init(SchedContext* sched, void* stack, OSPri pri, u8 viModeType, UNK_TYPE arg4, IrqMgr* irqMgr) {
|
||||
bzero(sched, sizeof(SchedContext));
|
||||
memset(sched, 0, sizeof(SchedContext));
|
||||
|
||||
sched->shouldUpdateVi = true;
|
||||
|
||||
|
@ -164,18 +164,6 @@ void osUnmapTLBAll(void) {
|
||||
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
void bzero(void* src, int length) {
|
||||
memset(src, 0, length);
|
||||
}
|
||||
|
||||
void bcopy(void* __src, void* __dest, int __n) {
|
||||
memcpy(__dest, __src, __n);
|
||||
}
|
||||
int bcmp(void* __s1, void* __s2, int __n) {
|
||||
return memcmp(__s1, __s2, __n);
|
||||
}
|
||||
#endif
|
||||
int ResourceMgr_OTRSigCheck(char* imgData);
|
||||
char* ResourceMgr_LoadTexOrDListByName(const char* data);
|
||||
|
||||
|
@ -177,7 +177,7 @@ s32 SysFlashrom_WriteData(void* addr, u32 pageNum, u32 pageCount) {
|
||||
ret = SysFlashrom_AttemptWrite(addr, pageNum, pageCount);
|
||||
} else {
|
||||
SysFlashrom_ReadData(data, pageNum, pageCount);
|
||||
if (bcmp(data, addr, size) == 0) {
|
||||
if (memcmp(data, addr, size) == 0) {
|
||||
ret = 0;
|
||||
} else {
|
||||
// Will always erase the sector even if it wouldn't normally need to.
|
||||
@ -188,7 +188,7 @@ s32 SysFlashrom_WriteData(void* addr, u32 pageNum, u32 pageCount) {
|
||||
}
|
||||
if (ret == 0) {
|
||||
SysFlashrom_ReadData(data, pageNum, pageCount);
|
||||
if (bcmp(data, addr, size) == 0) {
|
||||
if (memcmp(data, addr, size) == 0) {
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = -1;
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include <string.h>
|
||||
|
||||
// sRumbleWasEnabledOnLastTick/sWillDisableRumble? Probably name it after updateEnabled
|
||||
u8 D_801D1E70 = true;
|
||||
@ -151,7 +152,7 @@ void RumbleManager_Update(RumbleManager* rumbleMgr) {
|
||||
}
|
||||
|
||||
void RumbleManager_Init(RumbleManager* rumbleMgr) {
|
||||
bzero(rumbleMgr, sizeof(RumbleManager));
|
||||
memset(rumbleMgr, 0, sizeof(RumbleManager));
|
||||
rumbleMgr->state = RUMBLEMANAGER_STATE_INITIAL;
|
||||
rumbleMgr->updateEnabled = true;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "global.h"
|
||||
#include "stackcheck.h"
|
||||
#include "z64thread.h"
|
||||
#include <string.h>
|
||||
|
||||
void Slowly_Main(SlowlyMgr* slowly) {
|
||||
slowly->status |= SLOWLY_STATUS_STARTED;
|
||||
@ -44,7 +45,7 @@ void Slowly_ThreadEntry(void* arg) {
|
||||
}
|
||||
|
||||
void Slowly_Init(SlowlyMgr* slowly, void* stack, SlowlyCallbackTwo callback, void* arg0, void* arg1) {
|
||||
bzero(slowly, sizeof(SlowlyMgr));
|
||||
memset(slowly, 0, sizeof(SlowlyMgr));
|
||||
|
||||
slowly->argCount = 2;
|
||||
slowly->status = 0;
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
||||
#include "objects/object_bdoor/object_bdoor.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// bss
|
||||
// FaultClient sActorFaultClient; // 2 funcs
|
||||
|
||||
@ -2412,7 +2414,7 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* acto
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_92_80);
|
||||
cycleFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneId(play->sceneId)];
|
||||
|
||||
bzero(actorCtx, sizeof(ActorContext));
|
||||
memset(actorCtx, 0, sizeof(ActorContext));
|
||||
ActorOverlayTable_Init();
|
||||
Matrix_MtxFCopy(&play->billboardMtxF, &gIdentityMtxF);
|
||||
Matrix_MtxFCopy(&play->viewProjectionMtxF, &gIdentityMtxF);
|
||||
@ -3339,7 +3341,7 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
|
||||
overlayEntry->numLoaded++;
|
||||
}
|
||||
|
||||
bzero(actor, actorInit->instanceSize);
|
||||
memset(actor, 0, actorInit->instanceSize);
|
||||
actor->overlayEntry = overlayEntry;
|
||||
actor->id = actorInit->id;
|
||||
actor->flags = actorInit->flags;
|
||||
|
@ -5,11 +5,12 @@
|
||||
#include "libc/stdbool.h"
|
||||
#include "z64environment.h"
|
||||
#include "z64transition.h"
|
||||
#include <string.h>
|
||||
|
||||
SaveContext gSaveContext ALIGNED(16);
|
||||
|
||||
void SaveContext_Init(void) {
|
||||
bzero(&gSaveContext, sizeof(SaveContext));
|
||||
memset(&gSaveContext, 0, sizeof(SaveContext));
|
||||
|
||||
gSaveContext.save.playerForm = 0;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
|
||||
#include <string.h>
|
||||
|
||||
s16 sCutsceneQuakeIndex;
|
||||
struct CutsceneCamera sCutsceneCameraInfo;
|
||||
@ -915,7 +916,7 @@ void CutsceneCmd_Transition(PlayState* play, CutsceneContext* csCtx, CsCmdTransi
|
||||
s32 CutsceneCmd_UpdateCamSpline(PlayState* play, u8* script) {
|
||||
s32 cmdBytes = 0;
|
||||
|
||||
bcopy(script, &cmdBytes, sizeof(cmdBytes));
|
||||
memcpy(&cmdBytes, script, sizeof(cmdBytes));
|
||||
script += sizeof(cmdBytes);
|
||||
|
||||
if (!Play_IsDebugCamEnabled()) {
|
||||
@ -1119,7 +1120,7 @@ void Cutscene_SetActorCue(CutsceneContext* csCtx, u8** script, s16 cueChannel) {
|
||||
s32 i;
|
||||
s32 numCues;
|
||||
|
||||
bcopy(*script, &numCues, sizeof(numCues));
|
||||
memcpy(&numCues, *script, sizeof(numCues));
|
||||
*script += sizeof(numCues);
|
||||
|
||||
for (i = 0; i < numCues; i++) {
|
||||
@ -1171,10 +1172,10 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
void* cmd;
|
||||
|
||||
// Read the command list count and the ending frame for this cutscene
|
||||
bcopy(script, &totalEntries, sizeof(totalEntries));
|
||||
memcpy(&totalEntries, script, sizeof(totalEntries));
|
||||
script += sizeof(totalEntries);
|
||||
|
||||
bcopy(script, &csFrameCount, sizeof(csFrameCount));
|
||||
memcpy(&csFrameCount, script, sizeof(csFrameCount));
|
||||
script += sizeof(csFrameCount);
|
||||
|
||||
if ((csCtx->curFrame > (u16)csFrameCount) && (play->transitionTrigger != TRANS_TRIGGER_START) &&
|
||||
@ -1186,7 +1187,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
// Loop over every command list
|
||||
for (i = 0; i < totalEntries; i++) {
|
||||
// Read the command type of the current command list.
|
||||
bcopy(script, &cmdType, sizeof(cmdType));
|
||||
memcpy(&cmdType, script, sizeof(cmdType));
|
||||
script += sizeof(cmdType);
|
||||
|
||||
if (cmdType == CS_CAM_STOP) {
|
||||
@ -1214,7 +1215,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
|
||||
switch (cmdType) {
|
||||
case CS_CMD_MISC:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1224,7 +1225,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_LIGHT_SETTING:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1234,7 +1235,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_START_SEQ:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1244,7 +1245,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_STOP_SEQ:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1254,7 +1255,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_FADE_OUT_SEQ:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1264,7 +1265,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_START_AMBIENCE:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1274,7 +1275,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_FADE_OUT_AMBIENCE:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1284,7 +1285,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_SFX_REVERB_INDEX_2:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1294,7 +1295,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_SFX_REVERB_INDEX_1:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1304,7 +1305,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_MODIFY_SEQ:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1314,7 +1315,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_RUMBLE:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1324,7 +1325,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_TRANSITION_GENERAL:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1334,7 +1335,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_TIME:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1344,7 +1345,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_PLAYER_CUE:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1363,7 +1364,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_DESTINATION:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1373,7 +1374,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_CHOOSE_CREDITS_SCENES:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1383,7 +1384,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_TEXT:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1397,7 +1398,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_TRANSITION:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1407,7 +1408,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_MOTION_BLUR:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1417,7 +1418,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
case CS_CMD_GIVE_TATL:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
@ -1430,7 +1431,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
|
||||
break;
|
||||
|
||||
default:
|
||||
bcopy(script, &cmdEntries, sizeof(cmdEntries));
|
||||
memcpy(&cmdEntries, script, sizeof(cmdEntries));
|
||||
script += sizeof(cmdEntries);
|
||||
|
||||
for (j = 0; j < cmdEntries; j++) {
|
||||
|
@ -11,6 +11,7 @@
|
||||
*/
|
||||
#include "global.h"
|
||||
#include "system_malloc.h"
|
||||
#include <string.h>
|
||||
|
||||
Gfx sTransTileSetupDL[] = {
|
||||
gsDPPipeSync(),
|
||||
@ -123,7 +124,7 @@ void TransitionTile_Destroy(TransitionTile* this) {
|
||||
TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows) {
|
||||
s32 gridSize;
|
||||
|
||||
bzero(this, sizeof(TransitionTile));
|
||||
memset(this, 0, sizeof(TransitionTile));
|
||||
this->frame = 0;
|
||||
this->cols = cols;
|
||||
this->rows = rows;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "sys_cfb.h"
|
||||
#include "code/fbdemo_circle/fbdemo_circle.h"
|
||||
#include <string.h>
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ TRANS_CIRCLE_DIR_IN,
|
||||
@ -43,7 +44,7 @@ void TransitionCircle_Start(void* thisx) {
|
||||
void* TransitionCircle_Init(void* thisx) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
bzero(this, sizeof(TransitionCircle));
|
||||
memset(this, 0, sizeof(TransitionCircle));
|
||||
this->maskType = 1;
|
||||
this->texture = gCircleTex;
|
||||
this->masks = 6;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include <string.h>
|
||||
|
||||
#define THIS ((TransitionFade*)thisx)
|
||||
|
||||
@ -55,7 +56,7 @@ void TransitionFade_Start(void* thisx) {
|
||||
void* TransitionFade_Init(void* thisx) {
|
||||
TransitionFade* this = THIS;
|
||||
|
||||
bzero(this, sizeof(TransitionFade));
|
||||
memset(this, 0, sizeof(TransitionFade));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "loadfragment.h"
|
||||
#include <string.h>
|
||||
|
||||
//#define KALEIDO_OVERLAY(name) \
|
||||
// { \
|
||||
@ -51,7 +52,7 @@ void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) {
|
||||
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl) {
|
||||
if (ovl->loadedRamAddr != NULL) {
|
||||
ovl->offset = 0;
|
||||
bzero(ovl->loadedRamAddr, (uintptr_t)ovl->vramEnd - (uintptr_t)ovl->vramStart);
|
||||
memset(ovl->loadedRamAddr, 0, (uintptr_t)ovl->vramEnd - (uintptr_t)ovl->vramStart);
|
||||
ovl->loadedRamAddr = NULL;
|
||||
gKaleidoMgrCurOvl = NULL;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
#include <string.h>
|
||||
|
||||
s16 sKaleidoSetupRightPageIndex[] = {
|
||||
PAUSE_MAP, // PAUSE_ITEM
|
||||
@ -129,7 +130,7 @@ void KaleidoSetup_Init(PlayState* play) {
|
||||
PauseContext* pauseCtx = &play->pauseCtx;
|
||||
s32 pad[2];
|
||||
|
||||
bzero(pauseCtx, sizeof(PauseContext));
|
||||
memset(pauseCtx, 0, sizeof(PauseContext));
|
||||
|
||||
pauseCtx->pageIndex = PAUSE_ITEM;
|
||||
|
||||
|
@ -1,29 +1,6 @@
|
||||
#include "global.h"
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
void* Lib_MemCpy(void* dest, void* src, size_t size) {
|
||||
bcopy(src, dest, size);
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
void* Lib_MemSet(void* buffer, s32 value, size_t size) {
|
||||
u8* v0;
|
||||
s32 i;
|
||||
|
||||
if (value == 0) {
|
||||
bzero(buffer, (u32)size);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
for (v0 = (u8*)buffer, i = size; i > 0; i--) {
|
||||
*v0++ = value;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
f32 Math_CosS(s16 angle) {
|
||||
return coss(angle) * SHT_MINV;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "sys_cfb.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
#include <string.h>
|
||||
|
||||
LightsBuffer sLightsBuffer;
|
||||
|
||||
@ -253,7 +254,7 @@ void LightContext_Init(PlayState* play, LightContext* lightCtx) {
|
||||
LightContext_InitList(play, lightCtx);
|
||||
LightContext_SetAmbientColor(lightCtx, 80, 80, 80);
|
||||
LightContext_SetFog(lightCtx, 0, 0, 0, 996, 12800);
|
||||
bzero(&sLightsBuffer, sizeof(LightsBuffer));
|
||||
memset(&sLightsBuffer, 0, sizeof(LightsBuffer));
|
||||
}
|
||||
|
||||
void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "os_malloc.h"
|
||||
#include <string.h>
|
||||
|
||||
Arena sZeldaArena;
|
||||
|
||||
@ -30,7 +31,7 @@ void* ZeldaArena_Calloc(u32 num, size_t size) {
|
||||
|
||||
ret = __osMalloc(&sZeldaArena, n);
|
||||
if (ret != NULL) {
|
||||
bzero(ret, n);
|
||||
memset(ret, 0, n);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -154,7 +154,7 @@ static const char* sMapGrandTextures[] = {
|
||||
};
|
||||
|
||||
void MapDisp_GetMapITexture(void* dst, s32 mapCompactId) {
|
||||
size_t mapSize = MapDisp_GetSizeOfMapITex(mapCompactId) != 0;
|
||||
s32 mapSize = MapDisp_GetSizeOfMapITex(mapCompactId);
|
||||
|
||||
if (mapSize != 0) {
|
||||
dst = ResourceMgr_LoadTexOrDListByName(sMapTextures[mapCompactId]);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "assets/archives/icon_item_24_static/icon_item_24_static_yar.h"
|
||||
#include "assets/interface/message_static/message_static.h"
|
||||
#include "assets/interface/message_texture_static/message_texture_static.h"
|
||||
#include <string.h>
|
||||
|
||||
// #region 2S2H [Port] Asset tables we can pull from instead of from ROM
|
||||
#define dgEmptyTexture "__OTR__textures/virtual/gEmptyTexture"
|
||||
@ -4935,7 +4936,7 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
|
||||
gSaveContext.save.saveInfo.scarecrowSpawnSongSet = true;
|
||||
msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_DONE;
|
||||
Audio_PlaySfx(NA_SE_SY_TRE_BOX_APPEAR);
|
||||
Lib_MemCpy(gSaveContext.save.saveInfo.scarecrowSpawnSong, gScarecrowSpawnSongPtr,
|
||||
memcpy(gSaveContext.save.saveInfo.scarecrowSpawnSong, gScarecrowSpawnSongPtr,
|
||||
sizeof(gSaveContext.save.saveInfo.scarecrowSpawnSong));
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.saveInfo.scarecrowSpawnSong); i++) {
|
||||
// osSyncPrintf("%d, ", gSaveContext.scarecrowSpawnSong[i]);
|
||||
|
@ -7290,7 +7290,7 @@ void Interface_Init(PlayState* play) {
|
||||
size_t parameterStaticSize;
|
||||
s32 i;
|
||||
|
||||
bzero(interfaceCtx, sizeof(InterfaceContext));
|
||||
memset(interfaceCtx, 0, sizeof(InterfaceContext));
|
||||
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gSaveContext.nextHudVisibility = HUD_VISIBILITY_IDLE;
|
||||
|
@ -34,6 +34,7 @@ u8 sMotionBlurStatus;
|
||||
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
#include "debug.h"
|
||||
#include <string.h>
|
||||
|
||||
s32 gDbgCamEnabled = false;
|
||||
u8 D_801D0D54 = false;
|
||||
@ -275,7 +276,7 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
|
||||
TransitionContext* transitionCtx = &this->transitionCtx;
|
||||
s32 fbdemoType;
|
||||
|
||||
bzero(transitionCtx, sizeof(TransitionContext));
|
||||
memset(transitionCtx, 0, sizeof(TransitionContext));
|
||||
|
||||
fbdemoType = -1;
|
||||
if (transitionType & TRANS_TYPE_WIPE3) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "z64bombers_notebook.h"
|
||||
#include "interface/schedule_static/schedule_static.h"
|
||||
#include "archives/schedule_dma_static/schedule_dma_static_yar.h"
|
||||
#include <string.h>
|
||||
|
||||
#define BOMBERS_NOTEBOOK_ENTRY_SIZE 3
|
||||
#define BOMBERS_NOTEBOOK_ENTRY_MAX 10
|
||||
@ -1327,7 +1328,7 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input
|
||||
}
|
||||
|
||||
void BombersNotebook_Init(BombersNotebook* this) {
|
||||
bzero(this, sizeof(BombersNotebook));
|
||||
memset(this, 0, sizeof(BombersNotebook));
|
||||
}
|
||||
|
||||
void BombersNotebook_Destroy(BombersNotebook* this) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "BenPort.h"
|
||||
#include <string.h>
|
||||
|
||||
s32 sMatAnimStep;
|
||||
u32 sMatAnimFlags;
|
||||
@ -732,7 +733,7 @@ void Scene_DrawConfigGreatBayTemple(PlayState* play) {
|
||||
for (gfx = gfxHead, i = 0; i < 9; i++, gfx += 2) {
|
||||
lodFrac = 0;
|
||||
|
||||
bcopy(greatBayTempleColorSetDL, gfx, sizeof(greatBayTempleColorSetDL));
|
||||
memcpy(gfx, greatBayTempleColorSetDL, sizeof(greatBayTempleColorSetDL));
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include <string.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s8 letterboxTarget;
|
||||
@ -51,7 +52,7 @@ s32 ShrinkWindow_Pillarbox_GetSize(void) {
|
||||
|
||||
void ShrinkWindow_Init(void) {
|
||||
sShrinkWindowPtr = &sShrinkWindow;
|
||||
bzero(sShrinkWindowPtr, sizeof(sShrinkWindow));
|
||||
memset(sShrinkWindowPtr, 0, sizeof(sShrinkWindow));
|
||||
}
|
||||
|
||||
void ShrinkWindow_Destroy(void) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "BenPort.h"
|
||||
#include "string.h"
|
||||
#include "stdio.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define ANIM_INTERP 1
|
||||
|
||||
@ -2031,5 +2031,5 @@ void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) {
|
||||
* Copies the src frame table to the dst frame table.
|
||||
*/
|
||||
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src) {
|
||||
bcopy(src, dst, sizeof(Vec3s) * skelAnime->limbCount);
|
||||
memcpy(dst, src, sizeof(Vec3s) * skelAnime->limbCount);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "z64horse.h"
|
||||
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
#include <string.h>
|
||||
|
||||
void Sram_SyncWriteToFlash(SramContext* sramCtx, s32 curPage, s32 numPages);
|
||||
void func_80147314(SramContext* sramCtx, s32 fileNum);
|
||||
@ -689,7 +690,7 @@ void Sram_ResetSave(void) {
|
||||
gSaveContext.save.hasTatl = false;
|
||||
gSaveContext.save.isOwlSave = false;
|
||||
|
||||
bzero(&gSaveContext.save.saveInfo, sizeof(SaveInfo));
|
||||
memset(&gSaveContext.save.saveInfo, 0, sizeof(SaveInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -924,10 +925,10 @@ void Sram_InitNewSave(void) {
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
|
||||
Sram_ResetSave();
|
||||
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.playerData, &sSaveDefaultPlayerData, sizeof(SavePlayerData));
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.equips, &sSaveDefaultItemEquips, sizeof(ItemEquips));
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.inventory, &sSaveDefaultInventory, sizeof(Inventory));
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.checksum, &sSaveDefaultChecksum,
|
||||
memcpy(&gSaveContext.save.saveInfo.playerData, &sSaveDefaultPlayerData, sizeof(SavePlayerData));
|
||||
memcpy(&gSaveContext.save.saveInfo.equips, &sSaveDefaultItemEquips, sizeof(ItemEquips));
|
||||
memcpy(&gSaveContext.save.saveInfo.inventory, &sSaveDefaultInventory, sizeof(Inventory));
|
||||
memcpy(&gSaveContext.save.saveInfo.checksum, &sSaveDefaultChecksum,
|
||||
sizeof(gSaveContext.save.saveInfo.checksum));
|
||||
|
||||
gSaveContext.save.saveInfo.horseData.sceneId = SCENE_F01;
|
||||
@ -1129,10 +1130,10 @@ u8 D_801C6A50[PLAYER_FORM_MAX] = {
|
||||
void Sram_InitDebugSave(void) {
|
||||
Sram_ResetSave();
|
||||
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.playerData, &sSaveDebugPlayerData, sizeof(SavePlayerData));
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.equips, &sSaveDebugItemEquips, sizeof(ItemEquips));
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.inventory, &sSaveDebugInventory, sizeof(Inventory));
|
||||
Lib_MemCpy(&gSaveContext.save.saveInfo.checksum, &sSaveDebugChecksum, sizeof(gSaveContext.save.saveInfo.checksum));
|
||||
memcpy(&gSaveContext.save.saveInfo.playerData, &sSaveDebugPlayerData, sizeof(SavePlayerData));
|
||||
memcpy(&gSaveContext.save.saveInfo.equips, &sSaveDebugItemEquips, sizeof(ItemEquips));
|
||||
memcpy(&gSaveContext.save.saveInfo.inventory, &sSaveDebugInventory, sizeof(Inventory));
|
||||
memcpy(&gSaveContext.save.saveInfo.checksum, &sSaveDebugChecksum, sizeof(gSaveContext.save.saveInfo.checksum));
|
||||
|
||||
if (GET_PLAYER_FORM != PLAYER_FORM_HUMAN) {
|
||||
BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) = D_801C6A48[GET_PLAYER_FORM];
|
||||
@ -1165,18 +1166,18 @@ void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
|
||||
s32 i;
|
||||
s32 cutsceneIndex = gSaveContext.save.cutsceneIndex;
|
||||
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
|
||||
if (SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[gSaveContext.fileNum * 2],
|
||||
gFlashSaveNumPages[gSaveContext.fileNum * 2]) != 0) {
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[gSaveContext.fileNum * 2 + 1],
|
||||
gFlashSaveNumPages[gSaveContext.fileNum * 2 + 1]);
|
||||
}
|
||||
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
memcpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
if (CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf)) {
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[gSaveContext.fileNum * 2 + 1],
|
||||
gFlashSaveNumPages[gSaveContext.fileNum * 2 + 1]);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
|
||||
}
|
||||
gSaveContext.save.cutsceneIndex = cutsceneIndex;
|
||||
|
||||
@ -1224,7 +1225,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
|
||||
s32 fileNum;
|
||||
|
||||
if (gSaveContext.flashSaveAvailable) {
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
|
||||
if (gSaveContext.fileNum == 0xFF) {
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[0], gFlashSaveNumPages[0]);
|
||||
@ -1246,11 +1247,11 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[phi_t1]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[phi_t1]);
|
||||
|
||||
if (CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf)) {
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[phi_t1 + 1], gFlashSaveNumPages[phi_t1 + 1]);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[phi_t1]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[phi_t1]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1306,7 +1307,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
|
||||
}
|
||||
|
||||
if (gSaveContext.save.saveInfo.scarecrowSpawnSongSet) {
|
||||
Lib_MemCpy(gScarecrowSpawnSongPtr, gSaveContext.save.saveInfo.scarecrowSpawnSong,
|
||||
memcpy(gScarecrowSpawnSongPtr, gSaveContext.save.saveInfo.scarecrowSpawnSong,
|
||||
sizeof(gSaveContext.save.saveInfo.scarecrowSpawnSong));
|
||||
|
||||
for (i = 0; i != ARRAY_COUNT(gSaveContext.save.saveInfo.scarecrowSpawnSong); i++) {}
|
||||
@ -1333,7 +1334,7 @@ void func_8014546C(SramContext* sramCtx) {
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, offsetof(SaveContext, fileNum));
|
||||
|
||||
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||
memcpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||
} else {
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[i].chest = gSaveContext.cycleSceneFlags[i].chest;
|
||||
@ -1347,8 +1348,8 @@ void func_8014546C(SramContext* sramCtx) {
|
||||
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext.save, sizeof(Save));
|
||||
|
||||
if (gSaveContext.flashSaveAvailable) {
|
||||
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, sizeof(Save));
|
||||
Lib_MemCpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
memcpy(sramCtx->saveBuf, &gSaveContext, sizeof(Save));
|
||||
memcpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1370,8 +1371,8 @@ void func_80145698(SramContext* sramCtx) {
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext.save, sizeof(Save));
|
||||
if (gSaveContext.flashSaveAvailable) {
|
||||
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, sizeof(Save));
|
||||
Lib_MemCpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
memcpy(sramCtx->saveBuf, &gSaveContext, sizeof(Save));
|
||||
memcpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1394,7 +1395,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
sp64 = 0;
|
||||
|
||||
for (sp76 = 0; sp76 < 5; sp76++, sp64 += 2) {
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
|
||||
phi_s2 = false;
|
||||
sp6E = 0;
|
||||
@ -1418,10 +1419,10 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
fileSelect->isOwlSave[sp76] = 0;
|
||||
if (phi_s2) {
|
||||
// both main save and backup save failed
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
} else {
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
|
||||
// test checksum of main save
|
||||
phi_s2 = gSaveContext.save.saveInfo.checksum;
|
||||
@ -1447,7 +1448,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
phi_s2 = true;
|
||||
}
|
||||
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
|
||||
// test checksum of backup save
|
||||
oldCheckSum = gSaveContext.save.saveInfo.checksum;
|
||||
@ -1456,8 +1457,8 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
if (phi_s2 || CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf) ||
|
||||
(oldCheckSum != Sram_CalcChecksum(&gSaveContext, gFlashSaveSizes[sp64]))) {
|
||||
// backup save didn't work
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
memcpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
sp6E = 999;
|
||||
}
|
||||
}
|
||||
@ -1500,7 +1501,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
|
||||
if (sp6E == 1) {
|
||||
// backup save
|
||||
Lib_MemCpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
memcpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashSaveStartPages[sp64], gFlashSpecialSaveNumPages[sp64]);
|
||||
} else if (!sp6E) {
|
||||
// main save
|
||||
@ -1510,7 +1511,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
gFlashSaveNumPages[sp64 + 1]) != 0) {
|
||||
phi_s2 = 1;
|
||||
} else {
|
||||
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
memcpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
phi_s2 = gSaveContext.save.saveInfo.checksum;
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
sp7A = Sram_CalcChecksum(&gSaveContext.save, sizeof(Save));
|
||||
@ -1519,8 +1520,8 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
if (CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf) || (sp7A != phi_s2) ||
|
||||
(oldCheckSum != phi_s2)) {
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[sp64], gFlashSaveNumPages[sp64]);
|
||||
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
Lib_MemCpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
memcpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
memcpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashSaveStartPages[sp64], gFlashSpecialSaveNumPages[sp64]);
|
||||
}
|
||||
}
|
||||
@ -1533,10 +1534,10 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
if (!CHECK_NEWF(fileSelect->newf[sp76 - 2])) {
|
||||
if (phi_s2) {
|
||||
// both main save and backup save failed
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
} else {
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
phi_s2 = gSaveContext.save.saveInfo.checksum;
|
||||
|
||||
// test checksum of main save
|
||||
@ -1561,7 +1562,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
phi_s2 = true;
|
||||
}
|
||||
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
|
||||
// test checksum of backup save
|
||||
oldCheckSum = gSaveContext.save.saveInfo.checksum;
|
||||
@ -1569,8 +1570,8 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
|
||||
if (phi_s2 || CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf) ||
|
||||
(oldCheckSum != Sram_CalcChecksum(&gSaveContext, gFlashSaveSizes[sp64]))) {
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
sp6E = 999;
|
||||
}
|
||||
}
|
||||
@ -1624,7 +1625,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
gFlashSaveNumPages[sp64 + 1]) != 0) {
|
||||
phi_s2 = 1;
|
||||
} else {
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
phi_s2 = gSaveContext.save.saveInfo.checksum;
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
sp7A = Sram_CalcChecksum(&gSaveContext, gFlashSaveSizes[sp64]);
|
||||
@ -1634,15 +1635,15 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
(oldCheckSum != phi_s2)) {
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[sp64],
|
||||
gFlashSaveNumPages[sp64]);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashSaveStartPages[sp64], gFlashSaveNumPages[sp64]);
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashSaveStartPages[sp64 + 1],
|
||||
gFlashSaveNumPages[sp64 + 1]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[sp64]);
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashSaveStartPages[sp64], gFlashSaveNumPages[sp64]);
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashSaveStartPages[sp64 + 1], gFlashSaveNumPages[sp64 + 1]);
|
||||
}
|
||||
@ -1654,7 +1655,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
gSaveContext.options.languageSetting = 0;
|
||||
gSaveContext.options.zTargetSetting = 0;
|
||||
} else {
|
||||
Lib_MemCpy(&gSaveContext.options, sramCtx->saveBuf, sizeof(SaveOptions));
|
||||
memcpy(&gSaveContext.options, sramCtx->saveBuf, sizeof(SaveOptions));
|
||||
if (gSaveContext.options.optionId != 0xA51D) {
|
||||
gSaveContext.options.optionId = 0xA51D;
|
||||
gSaveContext.options.language = LANGUAGE_ENG;
|
||||
@ -1683,8 +1684,8 @@ void Sram_EraseSave(FileSelectState* fileSelect2, SramContext* sramCtx, s32 file
|
||||
func_80147314(sramCtx, fileNum);
|
||||
fileSelect->isOwlSave[fileNum + 2] = false;
|
||||
}
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
|
||||
}
|
||||
|
||||
gSaveContext.save.time = D_801F6AF0;
|
||||
@ -1730,7 +1731,7 @@ void Sram_CopySave(FileSelectState* fileSelect2, SramContext* sramCtx) {
|
||||
}
|
||||
|
||||
// clear buffer
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
// read to buffer
|
||||
if (SysFlashrom_ReadData(&sramCtx->saveBuf[0], gFlashSaveStartPages[fileSelect->selectedFileIndex * 2],
|
||||
gFlashSaveNumPages[fileSelect->selectedFileIndex * 2])) {}
|
||||
@ -1739,7 +1740,7 @@ void Sram_CopySave(FileSelectState* fileSelect2, SramContext* sramCtx) {
|
||||
gFlashSaveNumPages[fileSelect->selectedFileIndex * 2 + 1])) {}
|
||||
|
||||
// copy buffer to save context
|
||||
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
memcpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||
|
||||
fileSelect->threeDayResetCount[fileSelect->copyDestFileIndex] =
|
||||
gSaveContext.save.saveInfo.playerData.threeDayResetCount;
|
||||
@ -1800,8 +1801,8 @@ void Sram_InitSave(FileSelectState* fileSelect2, SramContext* sramCtx) {
|
||||
|
||||
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext.save, sizeof(Save));
|
||||
|
||||
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext.save, sizeof(Save));
|
||||
Lib_MemCpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
memcpy(sramCtx->saveBuf, &gSaveContext.save, sizeof(Save));
|
||||
memcpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.saveInfo.playerData.newf); i++) {
|
||||
fileSelect->newf[fileSelect->buttonIndex][i] = gSaveContext.save.saveInfo.playerData.newf[i];
|
||||
@ -1844,7 +1845,7 @@ void Sram_InitSave(FileSelectState* fileSelect2, SramContext* sramCtx) {
|
||||
void Sram_WriteSaveOptionsToBuffer(SramContext* sramCtx) {
|
||||
if (gSaveContext.flashSaveAvailable) {
|
||||
gSaveContext.options.language = LANGUAGE_ENG;
|
||||
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext.options, sizeof(SaveOptions));
|
||||
memcpy(sramCtx->saveBuf, &gSaveContext.options, sizeof(SaveOptions));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1972,12 +1973,12 @@ void Sram_UpdateWriteToFlashOwlSave(SramContext* sramCtx) {
|
||||
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(2)) {
|
||||
// Finished status is hardcoded to 2 seconds instead of when the task finishes
|
||||
sramCtx->status = 0;
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
gSaveContext.save.isOwlSave = false;
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
// flash read to buffer then copy to save context
|
||||
SysFlashrom_ReadData(sramCtx->saveBuf, sramCtx->curPage, sramCtx->numPages);
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, offsetof(SaveContext, fileNum));
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, offsetof(SaveContext, fileNum));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1996,7 +1997,7 @@ void func_80147314(SramContext* sramCtx, s32 fileNum) {
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, offsetof(SaveContext, fileNum));
|
||||
|
||||
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||
memcpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2], gFlashOwlSaveNumPages[fileNum * 2]);
|
||||
//! Note: should be `gFlashOwlSaveNumPages[fileNum * 2 + 1]`?
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2 + 1], gFlashOwlSaveNumPages[fileNum * 2]);
|
||||
@ -2016,7 +2017,7 @@ void func_80147414(SramContext* sramCtx, s32 fileNum, s32 arg2) {
|
||||
s32 pad;
|
||||
|
||||
// Clear save buffer
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);
|
||||
|
||||
// Read save file
|
||||
if (SysFlashrom_ReadData(sramCtx->saveBuf, gFlashOwlSaveStartPages[fileNum * 2],
|
||||
@ -2027,7 +2028,7 @@ void func_80147414(SramContext* sramCtx, s32 fileNum, s32 arg2) {
|
||||
}
|
||||
|
||||
// Copy buffer to save context
|
||||
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, offsetof(SaveContext, fileNum));
|
||||
memcpy(&gSaveContext, sramCtx->saveBuf, offsetof(SaveContext, fileNum));
|
||||
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[arg2 * 2], gFlashOwlSaveNumPages[arg2 * 2]);
|
||||
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[arg2 * 2 + 1], gFlashOwlSaveNumPages[arg2 * 2]);
|
||||
|
@ -13,12 +13,13 @@
|
||||
#include "global.h"
|
||||
#include "z64visfbuf.h"
|
||||
#include "sys_cfb.h"
|
||||
#include <string.h>
|
||||
|
||||
#define SCALE_MIN 0.032f
|
||||
#define SCALE_MAX 1.0f //!< also unchanged scale
|
||||
|
||||
void VisFbuf_Init(VisFbuf* this) {
|
||||
bzero(this, sizeof(VisFbuf));
|
||||
memset(this, 0, sizeof(VisFbuf));
|
||||
}
|
||||
|
||||
void VisFbuf_Destroy(VisFbuf* this) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "global.h"
|
||||
#include "z64vismono.h"
|
||||
#include "system_malloc.h"
|
||||
#include <string.h>
|
||||
|
||||
// Height of the fragments the color frame buffer (CFB) is split into.
|
||||
// It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into
|
||||
@ -25,7 +26,7 @@
|
||||
#define VISMONO_FAC_NORM (0x1F * VISMONO_FAC_RED + 0x1F * VISMONO_FAC_GREEN + 0x1F * VISMONO_FAC_BLUE)
|
||||
|
||||
void VisMono_Init(VisMono* this) {
|
||||
bzero(this, sizeof(VisMono));
|
||||
memset(this, 0, sizeof(VisMono));
|
||||
this->unk_00 = 0;
|
||||
this->setScissor = false;
|
||||
this->primColor.r = 255;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "objects/object_hakugin_obj/object_hakugin_obj.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||
|
||||
@ -90,11 +91,11 @@ static InitChainEntry sInitChain[] = {
|
||||
};
|
||||
|
||||
void func_80A9ACD0(BgHakuginPostUnkStruct* arg0) {
|
||||
bzero(arg0, sizeof(BgHakuginPostUnkStruct));
|
||||
memset(arg0, 0, sizeof(BgHakuginPostUnkStruct));
|
||||
}
|
||||
|
||||
void func_80A9ACF0(void) {
|
||||
bzero(&D_80A9DDC0, sizeof(BgHakuginPostColliders));
|
||||
memset(&D_80A9DDC0, 0, sizeof(BgHakuginPostColliders));
|
||||
}
|
||||
|
||||
void func_80A9AD18(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* unkStruct) {
|
||||
@ -146,7 +147,7 @@ void func_80A9AFB4(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
|
||||
if ((unkStruct->unk_0000[i].unk_34 == 0) ||
|
||||
(this->dyna.actor.world.pos.y < unkStruct->unk_0000[i].unk_08.y)) {
|
||||
for (j = 10; j >= i; j--) {
|
||||
bcopy(&unkStruct->unk_0000[j], &unkStruct->unk_0000[j + 1], 0x38);
|
||||
memcpy(&unkStruct->unk_0000[j + 1], &unkStruct->unk_0000[j], 0x38);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "z_en_kusa2.h"
|
||||
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
|
||||
|
||||
@ -672,7 +673,7 @@ void func_80A5C918(EnKusa2UnkBssStruct* arg0, EnKusa2UnkBssSubStruct2* arg1) {
|
||||
}
|
||||
|
||||
void func_80A5CAD4(EnKusa2UnkBssStruct* arg0) {
|
||||
bzero(arg0, sizeof(EnKusa2UnkBssStruct));
|
||||
memset(arg0, 0, sizeof(EnKusa2UnkBssStruct));
|
||||
}
|
||||
|
||||
void func_80A5CAF4(EnKusa2UnkBssStruct* arg0) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "z_obj_entotu.h"
|
||||
#include "objects/object_f53_obj/object_f53_obj.h"
|
||||
#include "BenPort.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||
|
||||
@ -156,7 +157,7 @@ void ObjEntotu_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
ovl_Obj_Entotu_Vtx_000D10Data = ResourceMgr_LoadVtxArrayByName(ovl_Obj_Entotu_Vtx_000D10);
|
||||
|
||||
Lib_MemCpy(this->unk_148, ovl_Obj_Entotu_Vtx_000D10Data,
|
||||
memcpy(this->unk_148, ovl_Obj_Entotu_Vtx_000D10Data,
|
||||
ResourceMgr_GetArraySizeByName(ovl_Obj_Entotu_Vtx_000D10) * sizeof(Vtx));
|
||||
this->unk_1C6 = Rand_S16Offset(0, 59);
|
||||
this->unk_1C4 = 0;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "z_obj_smork.h"
|
||||
#include "objects/object_f53_obj/object_f53_obj.h"
|
||||
#include "BenPort.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||
|
||||
@ -134,7 +135,7 @@ void ObjSmork_Init(Actor* thisx, PlayState* play) {
|
||||
ObjSmork* this = THIS;
|
||||
ovl_Obj_Smork_Vtx_000C10Data = ResourceMgr_LoadVtxArrayByName(ovl_Obj_Smork_Vtx_000C10);
|
||||
|
||||
Lib_MemCpy(this->unk_148, ovl_Obj_Smork_Vtx_000C10,
|
||||
memcpy(this->unk_148, ovl_Obj_Smork_Vtx_000C10,
|
||||
sizeof(Vtx) * ResourceMgr_GetArraySizeByName(ovl_Obj_Smork_Vtx_000C10));
|
||||
this->unk_1C6 = Rand_S16Offset(0, 59);
|
||||
this->unk_1C4 = 0;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_obj_toudai.h"
|
||||
#include "objects/object_f53_obj/object_f53_obj.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||
|
||||
@ -106,7 +107,7 @@ void ObjToudai_Init(Actor* thisx, PlayState* play) {
|
||||
ObjToudai* this = THIS;
|
||||
ovl_Obj_Toudai_Vtx_D_80A34590data = ResourceMgr_LoadVtxByName(ovl_Obj_Toudai_Vtx_D_80A34590data);
|
||||
|
||||
Lib_MemCpy(this->unk_148, &ovl_Obj_Toudai_Vtx_D_80A34590, sizeof(ovl_Obj_Toudai_Vtx_D_80A34590));
|
||||
memcpy(this->unk_148, &ovl_Obj_Toudai_Vtx_D_80A34590, sizeof(ovl_Obj_Toudai_Vtx_D_80A34590));
|
||||
}
|
||||
|
||||
void ObjToudai_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
|
||||
#include "overlays/actors/ovl_Door_Spiral/z_door_spiral.h"
|
||||
@ -12423,7 +12424,7 @@ void Player_Update(Actor* thisx, PlayState* play) {
|
||||
} else if ((this->csAction == PLAYER_CSACTION_5) ||
|
||||
(this->stateFlags1 & (PLAYER_STATE1_20 | PLAYER_STATE1_20000000)) || (this != GET_PLAYER(play)) ||
|
||||
func_8082DA90(play) || (gSaveContext.save.saveInfo.playerData.health == 0)) {
|
||||
bzero(&input, sizeof(Input));
|
||||
memset(&input, 0, sizeof(Input));
|
||||
this->fallStartHeight = this->actor.world.pos.y;
|
||||
} else {
|
||||
input = *CONTROLLER1(&play->state);
|
||||
@ -12435,7 +12436,7 @@ void Player_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
Player_UpdateCommon(this, play, &input);
|
||||
play->actorCtx.unk268 = 0;
|
||||
bzero(&play->actorCtx.unk_26C, sizeof(Input));
|
||||
memset(&play->actorCtx.unk_26C, 0, sizeof(Input));
|
||||
|
||||
MREG(52) = this->actor.world.pos.x;
|
||||
MREG(53) = this->actor.world.pos.y;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "global.h"
|
||||
#include "z_fbdemo_triforce.h"
|
||||
#include "assets/overlays/ovl_fbdemo_triforce/ovl_fbdemo_triforce.h"
|
||||
#include <string.h>
|
||||
|
||||
void* TransitionTriforce_Init(void* thisx);
|
||||
void TransitionTriforce_Destroy(void* thisx);
|
||||
@ -41,7 +42,7 @@ void TransitionTriforce_Start(void* thisx) {
|
||||
void* TransitionTriforce_Init(void* thisx) {
|
||||
TransitionTriforce* this = (TransitionTriforce*)thisx;
|
||||
|
||||
bzero(this, sizeof(TransitionTriforce));
|
||||
memset(this, 0, sizeof(TransitionTriforce));
|
||||
guOrtho(&this->projection, -SCREEN_WIDTH / 2, SCREEN_WIDTH / 2, -SCREEN_HEIGHT / 2, SCREEN_HEIGHT / 2, -1000.0f,
|
||||
1000.0f, 1.0f);
|
||||
this->transPos = 1.0f;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "z_fbdemo_wipe1.h"
|
||||
#include <string.h>
|
||||
|
||||
#define THIS ((TransitionWipe1*)thisx)
|
||||
|
||||
@ -50,7 +51,7 @@ void TransitionWipe1_Start(void* thisx) {
|
||||
void* TransitionWipe1_Init(void* thisx) {
|
||||
TransitionWipe1* this = THIS;
|
||||
|
||||
bzero(this, sizeof(TransitionWipe1));
|
||||
memset(this, 0, sizeof(TransitionWipe1));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "z_fbdemo_wipe3.h"
|
||||
#include <string.h>
|
||||
|
||||
#define THIS ((TransitionWipe3*)thisx)
|
||||
|
||||
@ -84,7 +85,7 @@ void TransitionWipe3_Start(void* thisx) {
|
||||
void* TransitionWipe3_Init(void* thisx) {
|
||||
TransitionWipe3* this = THIS;
|
||||
|
||||
bzero(this, sizeof(TransitionWipe3));
|
||||
memset(this, 0, sizeof(TransitionWipe3));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "global.h"
|
||||
#include "z_fbdemo_wipe4.h"
|
||||
#include "sys_cfb.h"
|
||||
#include <string.h>
|
||||
|
||||
#define THIS ((TransitionWipe4*)thisx)
|
||||
|
||||
@ -74,7 +75,7 @@ void TransitionWipe4_Start(void* thisx) {
|
||||
void* TransitionWipe4_Init(void* thisx) {
|
||||
TransitionWipe4* this = (TransitionWipe4*)thisx;
|
||||
|
||||
bzero(this, sizeof(TransitionWipe4));
|
||||
memset(this, 0, sizeof(TransitionWipe4));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "PR/gs2dex.h"
|
||||
#include "sys_cfb.h"
|
||||
#include "z_fbdemo_wipe5.h"
|
||||
#include <string.h>
|
||||
|
||||
#define THIS ((TransitionWipe5*)thisx)
|
||||
|
||||
@ -58,7 +59,7 @@ void TransitionWipe5_Start(void* thisx) {
|
||||
void* TransitionWipe5_Init(void* thisx) {
|
||||
TransitionWipe5* this = THIS;
|
||||
|
||||
bzero(this, sizeof(TransitionWipe5));
|
||||
memset(this, 0, sizeof(TransitionWipe5));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "z64view.h"
|
||||
#include "interface/parameter_static/parameter_static.h"
|
||||
#include "misc/title_static/title_static.h"
|
||||
#include <string.h>
|
||||
|
||||
s32 D_808144F10 = 100;
|
||||
f32 D_808144F14 = 8.0f;
|
||||
@ -256,7 +257,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) {
|
||||
this->newFileNameCharCount = 0;
|
||||
this->nameEntryBoxPosX = 120;
|
||||
this->nameEntryBoxAlpha = 0;
|
||||
Lib_MemCpy(&this->fileNames[this->buttonIndex], &sEmptyName, ARRAY_COUNT(sEmptyName));
|
||||
memcpy(&this->fileNames[this->buttonIndex], &sEmptyName, ARRAY_COUNT(sEmptyName));
|
||||
} else {
|
||||
Audio_PlaySfx(NA_SE_SY_FSEL_DECIDE_L);
|
||||
this->actionTimer = 4;
|
||||
@ -280,7 +281,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) {
|
||||
this->newFileNameCharCount = 0;
|
||||
this->nameEntryBoxPosX = 120;
|
||||
this->nameEntryBoxAlpha = 0;
|
||||
Lib_MemCpy(&this->fileNames[this->buttonIndex], &sEmptyName, ARRAY_COUNT(sEmptyName));
|
||||
memcpy(&this->fileNames[this->buttonIndex], &sEmptyName, ARRAY_COUNT(sEmptyName));
|
||||
} else {
|
||||
Audio_PlaySfx(NA_SE_SY_FSEL_DECIDE_L);
|
||||
this->actionTimer = 4;
|
||||
|
Loading…
Reference in New Issue
Block a user