1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Fix misc 14 (#1279)

* Remove fake temp in `BossDodongo_DrawEffects`

* `OS_WRITE` for `__osSpRawStartDma` `direction`

* remove outdated comment

* fixup osRecvMesg

* make sShopkeeperStores static

* `PHYSICAL_TO_VIRTUAL(gSegments[0])` -> `SEGMENTED_TO_VIRTUAL(NULL)` (mimics `CollisionHeader_SegmentedToVirtual`)

* Run formatter

* Remove assets from include path in suggested vscode properties

* Fix `osCreateMesgQueue` getting `OS_MESG_BLOCK` as `count` instead of `1`
This commit is contained in:
Dragorn421 2022-06-13 08:38:20 -07:00 committed by GitHub
parent 93a6a1eb9a
commit 0832b5af68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 29 additions and 32 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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 {

View file

@ -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);

View file

@ -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;