Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef unsigned char u8;
- typedef unsigned short u16;
- typedef unsigned int u32;
- void SetBIcon(int unk, void* somePointer) {
- void* someAddress = (void*) 0x8011A5D0;
- u8 someByte = *(u8 *) (somePointer + 0x434);
- if (someByte != 0x56) { // Not sure what this is checking for.
- void* otherAddress = 0x800F8C70;
- void* address3 = 0x800F8CC0;
- u16 someValue = *(u16 *) (otherAddress + 2); // 800F8C72 (0x00F0 in this case)
- u16 someValue2 = *(u16 *) (someAddress + 0x70); // resolves to 8011A640. + 8 from actual item id address. (0x1123)
- u8 someByte3 = *(u8 *) (address3 + 1); // 800F8CC1 (4 in this case)
- u16 maskedValue = someValue2 & someValue;
- u16 shiftedMaskedValue = maskedValue >> someByte3;
- *(u8 *)(somePointer + 0x13E) = (u8) shiftedMaskedValue; // This is stored at itemIconId + 1.
- u16 maskValue2 = *(u16 *) (otherAddress + 4); // 0x0F00
- u8 shiftValue2 = *(u8 *) (address3 + 2); // 8
- u16 maskedValue2 = someValue2 & maskValue2;
- u8 shiftedMaskedValue2 = maskedValue2 >> shiftValue2;
- shiftedMaskedValue2 -= 1;
- *(u8 *)(somePointer + 0x13C) = shiftedMaskedValue2; // IconId pointer - 1.
- u16 maskValue3 = *(u16 *) (otherAddress + 6); // 0xF000
- u8 shiftValue3 = *(u8 *) (address3 + 3); // 0x0C
- u16 maskedValue3 = someValue2 & maskValue3;
- u8 shiftedMaskedValue3 = maskedValue3 >> shiftValue3;
- shiftedMaskedValue3 -= 1;
- *(u8 *)(somePointer + 0x13F) = shiftedMaskedValue3; // IconId pointer + 2.
- if (*(u8 *)(someAddress + 0x13E2) == 0xFF) { // Check for no item id equipped?
- *(u8 *)(somePointer + 0x13D) = 0xFF; // Set icon id to no item equipped.
- }
- else {
- u8 itemIdEquipped = *(u8 *) (someAddress + 0x68) // Points to 0x011A638. This is the equipped item id.
- if (itemIdEquipped == 0x55) { // 0x55 = Giant's Knife (Broken)
- itemIdEquipped = 0x3D; // 0x3D = Giant's Knife & Biggoron's Sword.
- }
- *(u8 *)(somePointer + 0x13D) = itemIdEquipped; // Set the icon id.
- }
- // Call some subfunctions
- someFunc1(address3, *(char *)(somePointer + 0x141));
- int value = someFunc2(somePointer); // might not be an int. Return value goes unused.
- someFunc3(unk, someAddress);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement