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;
- const static u16 maskValues[4] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
- const static u8 shiftValues[4] = { 0x00, 0x04, 0x08, 0x0C };
- 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;
- u16 someItemRelatedValue = (someAddress + 0x70); // resolves to 8011A640. + 8 from actual item id address. (0x1123)
- *(u8 *) (somePointer + 0x13E) = (u8) ((someItemRelatedValue & maskValues[1]) >> shiftValues[1]);
- *(u8 *) (somePointer + 0x13C) = (u8) ((someItemRelatedValue & maskValues[2]) >> shiftValues[2]) - 1;
- *(u8 *) (somePointer + 0x13F) = (u8) ((someItemRelatedValue & maskValues[3]) >> shiftValues[3]) - 1;
- 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)); // this points to 0x801DAA30.
- 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