summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'src/code')
-rw-r--r--src/code/audio_heap.c7
-rw-r--r--src/code/sleep.c2
-rw-r--r--src/code/z_bgcheck.c26
-rw-r--r--src/code/z_en_item00.c3
-rw-r--r--src/code/z_parameter.c8
-rw-r--r--src/code/z_sram.c1
6 files changed, 23 insertions, 24 deletions
diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c
index 905e69649..892ec3755 100644
--- a/src/code/audio_heap.c
+++ b/src/code/audio_heap.c
@@ -283,10 +283,9 @@ void AudioHeap_InitMainPools(s32 initPoolSize) {
void AudioHeap_SessionPoolsInit(AudioSessionPoolSplit* split) {
gAudioContext.sessionPool.curRamAddr = gAudioContext.sessionPool.startRamAddr;
- AudioHeap_AllocPoolInit(&gAudioContext.miscPool,
- AudioHeap_Alloc(&gAudioContext.sessionPool, split->miscPoolSize), split->miscPoolSize);
- AudioHeap_AllocPoolInit(&gAudioContext.cachePool,
- AudioHeap_Alloc(&gAudioContext.sessionPool, split->cachePoolSize),
+ AudioHeap_AllocPoolInit(&gAudioContext.miscPool, AudioHeap_Alloc(&gAudioContext.sessionPool, split->miscPoolSize),
+ split->miscPoolSize);
+ AudioHeap_AllocPoolInit(&gAudioContext.cachePool, AudioHeap_Alloc(&gAudioContext.sessionPool, split->cachePoolSize),
split->cachePoolSize);
}
diff --git a/src/code/sleep.c b/src/code/sleep.c
index f08129701..2b67088a1 100644
--- a/src/code/sleep.c
+++ b/src/code/sleep.c
@@ -5,7 +5,7 @@ void Sleep_Cycles(OSTime cycles) {
OSMesg msg;
OSTimer timer;
- osCreateMesgQueue(&mq, &msg, OS_MESG_BLOCK);
+ osCreateMesgQueue(&mq, &msg, 1);
osSetTimer(&timer, cycles, 0, &mq, NULL);
osRecvMesg(&mq, NULL, OS_MESG_BLOCK);
}
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index 4d871982f..c2d73cb47 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -3822,7 +3822,7 @@ u32 SurfaceType_GetData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId,
return 0;
}
surfaceTypes = colHeader->surfaceTypeList;
- if (surfaceTypes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (surfaceTypes == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
return surfaceTypes[poly->type].data[dataIdx];
@@ -3865,11 +3865,11 @@ u16 SurfaceType_GetCameraSType(CollisionContext* colCtx, CollisionPoly* poly, s3
return 0;
}
camData = colHeader->cameraDataList;
- if (camData == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (camData == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
surfaceTypes = colHeader->surfaceTypeList;
- if (surfaceTypes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (surfaceTypes == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
return func_80041A4C(colCtx, SurfaceType_GetCamDataIndex(colCtx, poly, bgId), bgId);
@@ -3887,7 +3887,7 @@ u16 func_80041B24(CollisionContext* colCtx, u32 camId, s32 bgId) {
}
camData = colHeader->cameraDataList;
- if (camData == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (camData == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
return camData[camId].numCameras;
@@ -3905,11 +3905,11 @@ u16 SurfaceType_GetNumCameras(CollisionContext* colCtx, CollisionPoly* poly, s32
return 0;
}
camData = colHeader->cameraDataList;
- if (camData == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (camData == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
surfaceTypes = colHeader->surfaceTypeList;
- if (surfaceTypes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (surfaceTypes == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
return func_80041B24(colCtx, SurfaceType_GetCamDataIndex(colCtx, poly, bgId), bgId);
@@ -3926,7 +3926,7 @@ Vec3s* func_80041C10(CollisionContext* colCtx, s32 camId, s32 bgId) {
return NULL;
}
cameraDataList = colHeader->cameraDataList;
- if (cameraDataList == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (cameraDataList == SEGMENTED_TO_VIRTUAL(NULL)) {
return NULL;
}
return (Vec3s*)SEGMENTED_TO_VIRTUAL(cameraDataList[camId].camPosData);
@@ -3944,11 +3944,11 @@ Vec3s* SurfaceType_GetCamPosData(CollisionContext* colCtx, CollisionPoly* poly,
return NULL;
}
camData = colHeader->cameraDataList;
- if (camData == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (camData == SEGMENTED_TO_VIRTUAL(NULL)) {
return NULL;
}
surfaceTypes = colHeader->surfaceTypeList;
- if (surfaceTypes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (surfaceTypes == SEGMENTED_TO_VIRTUAL(NULL)) {
return NULL;
}
return func_80041C10(colCtx, SurfaceType_GetCamDataIndex(colCtx, poly, bgId), bgId);
@@ -4195,7 +4195,7 @@ s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f3
u32 room;
WaterBox* curWaterBox;
- if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) {
return false;
}
@@ -4231,7 +4231,7 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos,
WaterBox* waterBox;
WaterBox* waterBoxList = colHeader->waterBoxes; // unused, needed for matching
- if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) {
*outWaterBox = NULL;
return -1;
}
@@ -4278,7 +4278,7 @@ u16 WaterBox_GetCameraSType(CollisionContext* colCtx, WaterBox* waterBox) {
s32 camId = WaterBox_GetCamDataIndex(colCtx, waterBox);
CamData* camData = colCtx->colHeader->cameraDataList;
- if (camData == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (camData == SEGMENTED_TO_VIRTUAL(NULL)) {
return 0;
}
@@ -4305,7 +4305,7 @@ s32 func_800425B0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32*
u32 room;
WaterBox* curWaterBox;
- if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == PHYSICAL_TO_VIRTUAL(gSegments[0])) {
+ if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) {
return false;
}
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index c481c12f7..b5ef85d81 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -365,7 +365,8 @@ void EnItem00_Destroy(Actor* thisx, PlayState* play) {
}
void func_8001DFC8(EnItem00* this, PlayState* play) {
- if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->despawnTimer < 0)) ||
+ if ((this->actor.params <= ITEM00_RUPEE_RED) ||
+ ((this->actor.params == ITEM00_HEART) && (this->despawnTimer < 0)) ||
(this->actor.params == ITEM00_HEART_PIECE)) {
this->actor.shape.rot.y += 960;
} else {
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index 4ec18010d..995500e54 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -1275,7 +1275,7 @@ void func_800849EC(PlayState* play) {
void Interface_LoadItemIcon1(PlayState* play, u16 button) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
- osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
+ osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + button * 0x1000,
(u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000),
0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
@@ -1285,7 +1285,7 @@ void Interface_LoadItemIcon1(PlayState* play, u16 button) {
void Interface_LoadItemIcon2(PlayState* play, u16 button) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
- osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
+ osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + button * 0x1000,
(u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000),
0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
@@ -2082,7 +2082,7 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
if ((action != DO_ACTION_NONE) && (action != DO_ACTION_MAX + DO_ACTION_NONE) &&
(action != 2 * DO_ACTION_MAX + DO_ACTION_NONE)) {
- osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
+ osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160,
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
(u32)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
@@ -2146,7 +2146,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
interfaceCtx->unk_1FC = action;
- osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
+ osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
(u32)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE, 0,
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
diff --git a/src/code/z_sram.c b/src/code/z_sram.c
index a0d58fbff..6041503d6 100644
--- a/src/code/z_sram.c
+++ b/src/code/z_sram.c
@@ -448,7 +448,6 @@ void Sram_OpenSave(SramContext* sramCtx) {
}
}
- // check for owning master sword.. to restore master sword? bug or debug feature?
if (LINK_AGE_IN_YEARS == YEARS_ADULT && !CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER)) {
gSaveContext.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER);
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER;