Merge branch 'rando-next' of https://github.com/HarbourMasters/Shipwright into GetItemFromGet-changes

This commit is contained in:
Garrett Cox
2022-09-02 09:15:31 -05:00
23 changed files with 496 additions and 53 deletions
+1 -1
View File
@@ -293,7 +293,7 @@ void Fault_Sleep(u32 duration) {
void Fault_PadCallback(Input* input) {
//! @bug This function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
PadMgr_RequestPadData(input, 0);
PadMgr_RequestPadData(&gPadMgr, input, 0);
}
void Fault_UpdatePadImpl()
+9 -3
View File
@@ -3,6 +3,8 @@
#include <soh/Enhancements/bootcommands.h>
#include "soh/OTRGlobals.h"
#include "../libultraship/CrashHandler.h"
s32 gScreenWidth = SCREEN_WIDTH;
s32 gScreenHeight = SCREEN_HEIGHT;
@@ -38,6 +40,10 @@ void Main_LogSystemHeap(void) {
int main(int argc, char** argv)
{
#ifdef __linux__
SetupHandlerLinux();
#endif
GameConsole_Init();
InitOTR();
BootCommands_Init();
@@ -64,14 +70,14 @@ void Main(void* arg) {
Fault_Init();
SysCfb_Init(0);
Heaps_Alloc();
sysHeap = gSystemHeap;
sysHeap = (uintptr_t)gSystemHeap;
fb = SysCfb_GetFbPtr(0);
gSystemHeapSize = 1024 * 1024 * 4;
// "System heap initalization"
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize);
SystemHeap_Init(sysHeap, gSystemHeapSize); // initializes the system heap
SystemHeap_Init((void*)sysHeap, gSystemHeapSize); // initializes the system heap
if (osMemSize >= 0x800000) {
debugHeap = SysCfb_GetFbEnd();
debugHeap = (void*)SysCfb_GetFbEnd();
debugHeapSize = (0x80600000 - (uintptr_t)debugHeap);
} else {
debugHeapSize = 0x400;
+22
View File
@@ -1690,6 +1690,28 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
}
return ITEM_NONE;
} else if (item == ITEM_KEY_SMALL) {
// Small key exceptions for rando with keysanity off.
if (gSaveContext.n64ddFlag) {
if (globalCtx->sceneNum == 10) { // ganon's tower -> ganon's castle
if (gSaveContext.inventory.dungeonKeys[13] < 0) {
gSaveContext.inventory.dungeonKeys[13] = 1;
return ITEM_NONE;
} else {
gSaveContext.inventory.dungeonKeys[13]++;
return ITEM_NONE;
}
}
if (globalCtx->sceneNum == 92) { // Desert Colossus -> Spirit Temple.
if (gSaveContext.inventory.dungeonKeys[6] < 0) {
gSaveContext.inventory.dungeonKeys[6] = 1;
return ITEM_NONE;
} else {
gSaveContext.inventory.dungeonKeys[6]++;
return ITEM_NONE;
}
}
}
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1;
return ITEM_NONE;
+2
View File
@@ -860,6 +860,8 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
if (getItem.modIndex == MOD_NONE) {
if (getItem.itemId >= ITEM_MEDALLION_FOREST && getItem.itemId <= ITEM_ZORA_SAPPHIRE) {
GiveLinkDungeonReward(getItem.getItemId);
} else if (getItem.itemId >= ITEM_SONG_MINUET && getItem.itemId <= ITEM_SONG_STORMS) {
GiveLinkSong(getItem.getItemId);
} else if (giid == GI_RUPEE_GREEN || giid == GI_RUPEE_BLUE || giid == GI_RUPEE_RED ||
giid == GI_RUPEE_PURPLE || giid == GI_RUPEE_GOLD) {
GiveLinkRupeesByGetItemId(giid);