Ledger Nano X - The secure hardware wallet
SHARE
TWEET

OoT Title File

fig02 May 21st, 2020 (edited) 1,076 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SaveContext* Sram_SetupTitleFile() {
  2.  
  3.     //zero out save starting from ZELDAZ
  4.     bzero(&gSaveContext.newf, 0x1338);
  5.  
  6.     // set total day variables to 0
  7.     gSaveContext.totalDays = 0;
  8.     gSaveContext.totalDaysBgs = 0;
  9.  
  10.     // loop over array D_8012A5B4 to copy 0x4C bytes of data to ZELDAZ through adultEquips
  11.     // didnt decomp cause im bad at loops
  12.  
  13.     // copy equips from data (D_8012A600)
  14.     gSaveContext.equips = sTitleFileEquips;
  15.  
  16.     // loop over array D_8012A60C to copy items
  17.     // didnt decomp cause im bad at loops
  18.  
  19.     // copy hardcoded checksum from data (D_8012A66C)
  20.     gSaveContext.checksum = sTitleFileChecksum;
  21.  
  22.     // set eponas position/angle and her scene to hyrule field
  23.     gSaveContext.horseData.pos.x = 1840;
  24.     gSaveContext.horseData.pos.y = 72;
  25.     gSaveContext.horseData.pos.z = 5497;
  26.     gSaveContext.horseData.scene = SCENE_SPOT00; // hyrule field
  27.     gSaveContext.horseData.angle = 0x9527;
  28.  
  29.     // unknown
  30.     // unknown
  31.     // unknown
  32.     // unknown
  33.     gSaveContext.infTable[0] |= 0x5009;
  34.  
  35.     // first spoke to mido
  36.     // complaned about mido to saria
  37.     // showed mido sword/shield
  38.     // deku mouth opened
  39.     // used blue warp in gohma
  40.     // met deku tree
  41.     // unknown
  42.     // unknown
  43.     gSaveContext.eventChkInf[0] |= 0x123F;
  44.  
  45.     // zelda fled castle
  46.     gSaveContext.eventChkInf[8] |= 0x0001;
  47.  
  48.     // light arrow cutscene watched
  49.     gSaveContext.eventChkInf[11] |= 0x0010;
  50.  
  51.     if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
  52.         gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; // set b item to kokiri sword
  53.         Inventory_ChangeEquipment(0, 1); // set sword equip to kokiri sword
  54.         if (gSaveContext.fileNum == 0xFF) {
  55.             gSaveContext.equips.buttonItems[1] = ITEM_SLINGSHOT; // set c left item to slingshot
  56.             gSaveContext.equips.cButtonSlots[0] = ITEM_SLINGSHOT; // set c left slot to slingshot
  57.             Inventory_ChangeEquipment(1, 1); // set shield equip to deku shield
  58.         }
  59.     }
  60.  
  61.     gSaveContext.entranceIndex = 0xCD; // set entrance to hyrule field
  62.     gSaveContext.magicLevel = 0; // set single magic
  63.     gSaveContext.sceneFlags[5].swch = 0x40000000; // set water level in water temple to highest level
  64.  
  65.     return &gSaveContext;
  66. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top