Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions soh/soh/Enhancements/Restorations/GraveHoleJumps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,24 @@ CollisionHeader* getGraveyardCollisionHeader() {
*/
SOH::Scene* scene =
(SOH::Scene*)Ship::Context::GetInstance()->GetResourceManager()->LoadResource(GRAVEYARD_SCENE_FILEPATH).get();
SOH::ISceneCommand* sceneCmd = nullptr;
for (int i = 0; i < scene->commands.size(); i++) {
SOH::SetCollisionHeader* sceneCmd = nullptr;
for (size_t i = 0; i < scene->commands.size(); i++) {
auto cmd = scene->commands[i];
if (cmd->cmdId == SOH::SceneCommandID::SetCollisionHeader) {
sceneCmd = cmd.get();
sceneCmd = static_cast<SOH::SetCollisionHeader*>(cmd.get());
break;
}
}
CollisionHeader* graveyardColHeader = (CollisionHeader*)((SOH::SetCollisionHeader*)sceneCmd)->GetRawPointer();
CollisionHeader* graveyardColHeader = (CollisionHeader*)sceneCmd->GetRawPointer();
uint32_t surfaceTypesCount = sceneCmd->collisionHeader->surfaceTypesCount;

/*
* Copy the surface type list and give ourselves some extra space to create another surface type for Link to fall
* into graves. NTSC 1.0's graveyard has 31 surface types, while later versions have 32. The contents of the lists
* are shifted somewhat between versions, so to be safe we just create an extra slot that is not in any version.
*/
static SurfaceType newSurfaceTypes[33];
memcpy(newSurfaceTypes, graveyardColHeader->surfaceTypeList, sizeof(SurfaceType) * 33);
static SurfaceType newSurfaceTypes[33] = {};
memcpy(newSurfaceTypes, graveyardColHeader->surfaceTypeList, sizeof(SurfaceType) * surfaceTypesCount);
newSurfaceTypes[CUSTOM_SURFACE_TYPE].data[0] = 0x24000004;
newSurfaceTypes[CUSTOM_SURFACE_TYPE].data[1] = 0xFC8;
graveyardColHeader->surfaceTypeList = newSurfaceTypes;
Expand Down
2 changes: 1 addition & 1 deletion soh/soh/Enhancements/randomizer/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class OptionValue {
explicit operator bool() const;

private:
uint8_t mVal;
uint8_t mVal = 0;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion soh/soh/SohGui/UIWidgets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ bool Combobox(const char* label, T* value, const std::vector<std::string>& combo
ImGui::BeginDisabled(options.disabled);
PushStyleCombobox(options.color);

const char* longest;
const char* longest = "";
size_t length = 0;
for (auto& string : comboVector) {
size_t len = string.length();
Expand Down
2 changes: 1 addition & 1 deletion soh/src/code/audio_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
char** fntList = ResourceMgr_ListFiles("audio/fonts*", &fntListSize);
char** customFntList = ResourceMgr_ListFiles("custom/fonts/*", &customFntListSize);

gAudioContext.fontLoadStatus = malloc(customFntListSize + fntListSize);
gAudioContext.fontLoadStatus = calloc(customFntListSize + fntListSize, sizeof(u8));
fontMap = calloc(customFntListSize + fntListSize, sizeof(char*));
fontMapSize = customFntListSize + fntListSize;
for (int i = 0; i < fntListSize; i++) {
Expand Down
4 changes: 2 additions & 2 deletions soh/src/code/sys_cfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ void SysCfb_Init(s32 n64dd) {
osSyncPrintf("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd);
// sSysCfbFbPtr[0] = sSysCfbEnd - (screenSize * 4);
// sSysCfbFbPtr[1] = sSysCfbEnd - (screenSize * 2);
sSysCfbFbPtr[0] = malloc(screenSize * 4);
sSysCfbFbPtr[1] = malloc(screenSize * 4);
sSysCfbFbPtr[0] = (uintptr_t)calloc(screenSize, 4);
sSysCfbFbPtr[1] = (uintptr_t)calloc(screenSize, 4);

// "Frame buffer addresses are %08x and %08x"
// osSyncPrintf("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
Expand Down
Loading