Joined: 10/20/2006
Posts: 1248
My understanding of BA without doing much testing or being a super smart guy. I'm taking a lot of guesses here: There can be something inside bottles. Everytime you catch something, it gets into the bottle on the C-Button. But the game also has to write it into the inventory, so changes are permanent. Since there are four bottles, every bottle has a pointer to the place inside the inventory where stuff gets written to when you catch it. This is why if you equip bottle 4 and catch something, it gets stored inside bottle 4, not bottle 1. Yet there's only one bit code for the item "empty bottle", not one for bottle 1, one for bottle 2, etc. It's possible because of that pointer. There is memory reserved for that pointer on all three C-buttons. But not for B, since it shouldn't be possible to have a bottle there. There happens to be the value of the item on C-right instead on the place where that pointer should be. So when you catch a fish, that fish gets written to that byte address instead. Fish is 25, a bug is 29, empty bottle is 20. The value of the item on C-right acts as a pointer to your inventory. When you have a fish on C-right the pointer points to your Deku Nut amount. So making the bottle empty writes a 20 to that place, giving you 20 Deku Nuts. Catching a bug gives you 29 Deku Nuts. That's it for RBA, easy to understand imo. Now BA is a bit different. I think it works like this.. Whenever you travel through time, the items you had equipped get saved somewhere. So you don't have to reequip the Biggoron's Sword everytime or put the bow to C-left everytime. Bottles get saved as 20, no matter what's inside. They still have the pointer into the inventory which says what's inside. Why is that so? Because you can change what's inside a bottle as a kid, then travel forward in time again. You'd expect it to be changed as Adult Link too. So whenever you travel forwards in time and the game loads that 20 (bottle) from that buffered space into your inventory, it looks for the pointer to see what's inside and puts that to the button. The game changes B first. So there's still the item on C-right, you had as a kid there. It loads the bottle to B, looks for the pointer to see what's inside. The pointer has the value of C-right as a kid. If it's a bottled fish it points to your Deku Nut amount again. If your Deku Nut amount is 29, you get a bug on B of course then. If the amount is 10, you get the Hookshot though. Because the game doesn't check if it's an item in a bottle. You can never catch a Hookshot in a bottle, but if you could it would change into a Hookshot. Sorry if this is too confusing.. Normal game: Again, 20=empty bottle, 25=fish, 29=bug You put bottle 1 to c-right. The game writes 20 to c-right and the pointer to bottle 1 in your inventory right behind that. You catch a fish. The game writes 25 to c-right, it looks for the pointer, the pointer points to bottle 1, it writes 25 to bottle 1 in your inventory. You have a fish on c-right and travel backwards in time. The game puts 20 to c-right instead of your fish and copies your entire equipped stuff to the buffer space. You let the fish go as a kid, catch a bug. You travel forwards in time. The game puts the things from that buffer space back to where your actual equipment gets stored. It sees a 20 (empty bottle) while copying and looks for the pointer. It points to a 29 (bug). The bug gets put to c-right instead. It continues copying the rest. Try reading the first part of this post again now, maybe it's less confusing then. Having other items on B doesn't cause weird stuff to happen because there are other pointers involved. If you have Deku Nuts on B and use them, nothing gets changed inside your inventory. The game only notes that a Deku Nut has been used and lowers the Deku Nut count by 1. There is only one Deku Nut amount, so the game doesn't need to use a similar pointer as with bottles. It could have been that Adult Trade items act the same as bottles, I tested it a few days ago when I tried to get more than 23 hearts. But unfortunately the game doesn't even change the B-button if you have a trade item on B and use it in the right place. It has to work like this: Game puts new trade item into inventory, game changes old trade item on C-button to new one. Also: Try getting a full Lonlon Milk (26) on B and drink it. It gets empty at once. But if you put an empty bottle to C-right (has value 20, points to bottle 3) and have full Lonlon Milk in bottle 3, and then drink it, it works like normal. That means the game has an additional check for Lonlon Milk, to see if it's full before you drink it, strange. If you could pause the game while drinking the Milk, it would be possible to change the item on C-right, and you could also write 31 (Half Lonlon Milk) to random bit addresses. I've not been able to do it. :/ Doing Bottle B as Young Link, travelling forwards in time, then backwards should put random things to Young Link's B button by the way. Just like the BA we know. There'd be no use for it in a TAS though. I have never tested it though, no v1.0... It could be that something different happens. But that would explain why the tries to do BA with only one time travel failed :P Maybe it could be of use in a 100% TAS. Do BA to get Bunny Hood on B, then sell it and all masks are available. That could maybe work, but would that be 100%?
Joined: 4/18/2006
Posts: 179
Location: East Petersburg, PA
I dont know how well people that arent compsci majors understand pointers, but i think you did a decent job of explaining it.
"I think we can put our differences behind us... for science, you monster."
Joined: 5/3/2007
Posts: 12
Location: Finland
I have discovered Bottle Adventure half year before I tell it to jaytheham, the zelda chaos owner. I understand it very well too like Acryte, I can claim that he understand it very well ^_^ I know there is more stuff to do with BA than now we have but if peoples study BA with HEX or codes they will understand it much better and I hope acryte's guide will help peoples out. Oh and I don't must forget Librari how have helped me with BA much when I discovered it. Credits to him too!!! Keep up to good work with BA you guys and Acryte with BA guide ^_^
Joined: 10/20/2006
Posts: 1248
Anyway, I'll post some more stuff. My source for all these values and stuff is Zelda Chaos. http://www.jaytheham.com/zc/oot.php?page=ootba These are the items and their values. Everything >50 is still unconfirmed, I believe. Note that Fire Arrow, Ice Arrow and Light Arrow are the pure arrow icons, Fire Bow, Ice Bow, Light Bow is what you get if you equip them. 00 Deku Sticks 01 Deku Nuts 02 Bombs 03 Fairy Bow 04 Fire Arrow 05 Din's Fire 06 Fairy Slingshot 07 Fairy Ocarina 08 Ocarina of Time 09 Bombchu 10 Hookshot 11 Longshot 12 Ice Arrow 13 Farore's Wind 14 Boomerang 15 Lens of Truth 16 Magic Beans 17 Megaton Hammer 18 Light Arrow 19 Nayru's Love 20 Empty Bottle 21 Red Potion 22 Green Potion 23 Blue Potion 24 Bottled Fairy 25 Fish 26 Milk 27 Letter 28 Blue Fire 29 Bug 30 Big Poe 31 Lon Lon Milk (Half) 32 Poe 33 Weird Egg 34 Cucco 35 Zelda's Letter 36 Keaton Mask 37 Skull Mask 38 Spooky Mask 39 Bunny Hood 40 Goron Mask 41 Zora Mask 42 Gerudo Mask 43 Mask of Truth 44 SOLD OUT 45 Pocket Egg 46 Pocket Cucco 47 Cojiro 48 Odd Mushroom 49 Odd Potion 50 Poacher's Saw 51 Broken Sword 52 Prescription 53 Eyeball Frog 54 Eyedrops 55 Claim Check Ok, now we want to know where all of these things would point to if you had them on C-Right. There's 24 places for items in your inventory. For the items with the values of 0-23, add 1 to them and you know to which slot in your inventory they point. Megaton Hammer on C-Right is 17. It points to the 18th item slot. That's Nayru's Love. So BA with Megaton Hammer on C-Right as a child would give you Nayru's Love on B. Catching a fish with B and the hammer on C-Right will write a fish to where Nayru's Love is. From that alone, it doesn't look at all as if there was a way to turn bottles in your inventory into the actual items again. You would have to catch Nayru's Love in a bottle to get it back again. What's with the values >23? They point to different things. It looks like Nintendo reserved memory for an item count at the address of the item slot in the inventory +24 (in bit values). Ocarina of Time is 8, points to the 9th item slot, normally Bombchus. 8+24 = Bombchu Count = 32 = Poe. So a Poe on C-Right points to your Bombchu count. It looks like an item count is only reserved for the first 16 slots (fortunately for us). Everything from the slot for Deku Stick to the slot for Megaton Hammer. There is a Boomerang count, but it never gets used by the game. So 0-23 points to item slots (slot x+1), 24-39 points to item counts (count for the item at slot x-24+1). What's left are the values 40-56. They point to the interesting stuff, lol. According to that site Goron Mask and Zora Mask point to your equipment. The other masks seem to point to unused bytes again. Just look at the upper link to see where the rest points to. It could be that not all of these things labeled as unused bytes are really unused. Nobody knows what happens if you write higher values to the B button. A 60 could be an undefined item. Maybe the standard item is a Deku Stick. So you get a Deku Stick on B, making it seem like a zero had been written to B, leading us to think that we pointed to an unused byte. EDIT: It looks like there are no undefined items. Instead there's still low possibility that the game changes high values on B to Deku Sticks to prevent the game from crashing. I'd say it's unlikely for Nintendo to have included such a safety check, it looks like those are really unused bytes. Broken Sword points to the Medallions. So having it on C-Right and catching something in a bottle writes that to that place. We can write a 20 (empty bottle), 24 (bottled fairy), 25 (fish), 28 (blue fire) or 29 (bug) to there. 20 is 010100 in binary, 24 is 011000, 25 is 011001, 28 is 011100, 29 is 011101. The first 0/1 says if you have got the light medallion. All zeros there, so you lose it anyway. The second digit from left is for the Shadow Medallion iirc, third for Spirit, fourth for Water, fifth for Fire, last for Forest Medallion. Like Acryte said before, a fish gives you Spirit, Shadow and Forest Medallions, a bug gives you Water Medallion too. 63 would be 111111, but we know no item with this value. Somebody could test something here... Have all Medallions, do Bottle B as a kid, travel forwards in time, equip Broken Sword to C-Right, travel backwards. You should get 63, an unusual item on B. Or just Deku Sticks. If we get Deku Sticks, that's kind of prove that they are the default item. And that some bytes which seem to be unused maybe aren't unused at all. I think I need to get myself v1.0 to test some stuff on my own. x_x Edit: I think, I've found a way to equip Young Link's items to C-Right as and Adult and vice versa. I can test it without v1.0. I hope it works. Nope, didn't work. Would have been too strange if I had been the first to test this after all.
Tub
Joined: 6/25/2005
Posts: 1377
so, the medallions are stored as a bitmask, and not as 8 seperate values? remembering that you need only 2 medallions to get the rainbow-cutscene.. we were thinking that it's just because of a lazy programmer, right? Well.. to check only two medallions:
if (mask & %11000000 == %11000000)
  // do the cutscene
is more complicated than
if (mask == 255)
  // do the cutscene
to check all of them. Interesting.
m00
Joined: 10/20/2006
Posts: 1248
There are only 6 medallions. And according to Zelda Chaos two songs get stored into that same byte as well. So they need to use the more complicated way to check for the medallions anyway. It's still interesting though. xD
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
The items from 56 and onwards are: 56 Bow/Fire arrows 57 Bow/Ice arrows 58 Bow/Light arrows 59 Kokiri Sword 60 Master Sword 61 Biggoron's Sword 62 Deku Shield 63 Hyrule Shield 64 Mirror Shield 65 Kokiri Tunic 66 Goron Tunic 67 Zora Tunic 68 Kokiri Boots 69 Iron Boots 70 Hover Boots 71 Bullet bag (Holds 30) 72 Bullet bag (Holds 40) 73 Bullet bag (Holds 50) 74 Quiver (Holds 30) 75 Quiver (Holds 40) 76 Quiver (Holds 50) 77 Bomb bag (Holds 20) 78 Bomb bag (Holds 30) 79 Bomb bag (Holds 40) 80 Goron's bracelet 81 Silver gauntlet 82 Golden gauntlet 83 Silver scale 84 Golden scale 85 Broken sword 86 Adult wallet 87 Giant wallet 88 Deku seeds 89 Fishing rod
Joined: 1/10/2006
Posts: 144
Location: Oregon
That's not quite how it works. K so... yes you have charts that list the hex values of each item. Now, when you put an item on C-right you take that item + 44(hex) which also happens to be the location in memory for deku sticks and counts as the 1st menu place in the C-button equips menu. Now, lets say you have goron mask on C-right. 28+44 = 6C (which edit's tunics and boots). Now, you have codes... like 8011A6?? ???? this code is used for ADDING items into the inventory, and this is the code that is being run and modified using BA. If the items are high enough, they can sometimes roll over the +44 w/ FF or something and make it a 8011A7 too but that is besides the point. So, basically 6C is also the location in memory where the tunics and boots bits are stored. in a gameshark we have this:8011A66C 00xy the last 4 numbers are actually the hex values of what you are storing into the memory location at 6C. Now, let's say you catch a bug right? The bug's hex is 1D. We take that number and convert it to binary in separate digits because each one is stored to one of those bits in 00xy. y is tunics, x is boots. Now 1 in binary is 1. we mirror that which is just 1 (menu reads right to left) and then we get _ _ _ = 1 0 0 AKA we have kokiri boots. and for D it is 1101 and mirrored we hae _ _ _ = 1 0 1 and a trailing 1. Since there is a 4th spot under swords for broken goron knife, if these were swords it would have broken goron sword there for every value past 7 (even for ones where biggoron sword should be there because the trailing bit). But these are tunics so we don't need to know that. we will have kokiri and zora tunic. also you choosing which items and when you advance the hex +1 value and stuuff doesn't make sense because you are just looking at results and making a formula. That is not the true formula. here is the reason why it is like that... you take deku sticks, etc all the way up to din's fire and slingshot... for each of those items, they have 1 place in the inventory (aka 1 place in memory for the item in that slot). 00 -> 44, 01 -> 45, 02 -> 46. get it? but once it gets to Ocarina of time, there can be 2 values there, so what it does is the 1st one get's that location in memory, and the next one advances to the next slot. Ocarina of time gets bombchu slot. That is fine until it hit's hookshot/longshot, which makes it happen again. Past that point every item has it's own place so it is just +2 at that point, but you need to understand WHY. Ever wonder why we can't get anything than what is inside the bottle on B to refresh into our inventory? Check this out... 14 is hex for empty bottle, 00 = empty deku stick on C-right. 00+44 = 44 aka the place in memory for deku sticks and the deku stick's default location in the menu. Now, the content's of the bottle specify what bits are written to that address. 14. so it writes a bottle to that location in memory. Here is the thing... until we find out EXACTLY WHY only bottles work for BA and the link between them and 00 aka dekunuts, and why it uses the 1st memory place that corresponds to them as the +44, then we have to use bottles. Anything you catch in a bottle can only put a bottled item's hex into that memory location. If we get something else on B instead, it won't update and check C-right and change memory addresses anymore, so at best the most we can get in our inventory is a bottled item. The reason why it works for quest status and works for equipment is because each of those have group values. 1 place in memory stores the value that affects multiple things. Like all medallions have 1 location in memory, etc. It doesn't read the bits stored there as a Hex number for an item ID, it reads them as binary to tell whether they have certain items or not. SO, BA can edit those easily. if you want hex values:http://zso.krahs-emag.com/codes/codeinfo.html#controlact Limitations: because we know that it uses +44 onto the item on C-right's hex, the lowest code that our current BA understanding can produce is: 8011A644 ????. But everything under 44 cannot be reached... AKA putting items on Cleft, C-right, C-down, Directly to B, editing Magic, editing rupees. These all have locations in memory that are BELOW 44. So currently we can not achieve these. Unless we find a way to change how BA reads the + to something lower, or even 0... but to do that we must UNDERSTAND perfectly how it works. Don't generalize, you must take it down to every bit that is passed. notes: Deku sticks are not the only way to get a bottle on B. Don't think that the 00 defaulted value is special and causes it. Any item you try to take out but can't, or any item that cannot be physically taken out into link's hand will do it. Deku nuts, 0 bombs, 0 bombchus, (magic doesn't work at all and has no effect), lens of truth. These all make bottle on B when using Ocarina items. Here is the thing though. If you use a gameshark to edit the code directly and place a bottle on B w/out even using Ocarina items, it works perfectly. SO, we know that the way we got it onto B has no effect over how it performs. What we need to understand: Relation to c-right and the 1st slot for the location in memory for menu... 44 Relation to B and C-right when bottle is on B Why only Bottle on B passes the 44+item Hex to the modifier code and allows us to place bits there. And yes I know what the individual bits before A6 seem to do and edit. And no, they don't have anything to do w/ it.
Wisdom; Power; Courage.
Joined: 10/20/2006
Posts: 1248
To me it looks like you are basically saying the same thing, just explain it differently. And more detailed. To me what you say doesn't seem to contradict my explanation at all. You explain it in hex, I didn't include hex in my "explanation" because it can unnessecarily confuse the reader imo. Hex is nothing we are confronted with on an everyday basic. (The same goes for pointers, but what can I do? XD) For the places in inventory, yes everything up to Ocarina points to the "right" place. I'd say, they use a base pointer to the inventory (=Deku Stick slot because it's first) and the bottle pointer I talked of in my previous posts says how much space relative to that base pointer the bottle lies in your inventory. Deku Stick has the value 0, base pointer + 0 = Deku Stick slot in your inventory. It points to the SLOT in your inventory. It would be possible to have something entirely different in that slot, like a bottle. We know we can turn Deku Sticks into bottles. You could also write Deku Nut to that 1st slot in your inventory, if there was a way. It's essentially just the first slot that we're pointing to, it has nothing to do with the fact that normally Deku Sticks are in the first slot. Fairy Ocarina points to the 8th slot because its value is 7. Base pointer (Deku Stick slot) + 7 = 8th slot. The Ocarina value is 8, points one slot further (9th). It has nothing to do with the fact that the Ocarina gets equipped to the 8th slot. Those slots are designed in a way so you can have anything anywhere. You could theoretically have a Megaton Hammer at the Deku Stick slot, if you could just write its value to that slot. EDIT: Why do they use a base pointer + space to travel relative from that pointer? (for the catch something in a bottle code) Because it saves space to only store that relative pointer everytime instead of the entire address. Also this kind of code is a lot safer, since we can't move outside that address window if a bug occurs (like there has). Game developers don't want their games to crash if a bug occurs, pointers are always dangerous. Really, I'm pretty sure I'm not entirely wrong with my theories. I know pointers, lol. Turn your Megaton Hammer into a bottle. Then do BA with the Lens of Truth on C-right. That would normally give you the Megaton Hammer on B. But since everything works with pointers, it will give you the item which is on that slot. The item on the Megaton Hammer slot is a bottle, you will get a bottle on B again. I have not tested that yet, but I'm pretty sure it will come true. Read my explanation again, it tells you why only bottles work. They are the only item which use pointers to slots. I even explain why only bottles need that pointer. I hope you'll realize that what we say doesn't contradict the other. Yep, getting Bottle B in first place has nothing to do with Deku Sticks. It's an entirely different glitch. You do a backflip and while you do that backflip you press two buttons. The first button determines the action when you land, the second gets stored as last pressed button. You do the bottle action, but the new value of the bottle gets written to the last pressed button, B, instead. That's faulty code. That's why it's possible to turn several items into bottles with that backflip. The game instantly also tries to update that bottle to the slot in the inventory. Of course it does. Read my explanation above, there's no memory for the pointer reserved on B, the value of the item on C-right is on that place instead. Why you start to play Ocarina with certain others is a thing I don't understand. I interpreted it as some strange coding regarding the Ocarina playing. It's entirely besides the point btw. This glitch is a lot harder to understand for me because there are only few hints as to how it works exactly. You need to understand the difference between slots and items and between pointers and values. A pointer points to where a value is. A slot is the equivalent of a pointer (kind of). Change the pointer and it points to a different value, change the value and that changes the value at that address where the pointer is pointing to at that moment. By the way, there's only one way to get to lower addresses than the Deku Stick slot. We would have to change the base pointer to the inventory. If that pointer is stored on a lower address, there's no way to reach it with our current glitch arsenal. The game will never subtract instead of adding. Edit: Wow, that site is pretty good. Thanks a lot! ^^ Now speaking from your perspective... The code for adding items into your inventory gets run because you use a bottle. The game runs the code because it updates (or tries to) what's inside the bottle into your inventory. Unfortunately trade items work differently. They don't have a pointer to their slot. It's probably hard coded where the new item gets stored to into your inventory. It can't be hard coded for bottles because there are four of a kind. Like I said before. I should have already included this in a previous post.. Edit: Nevermind, I already DID include something like this in a previous post. Anyways... Once more: If you equip a bottle to C-Left, this is what happens. The value of C-Left gets changed to 20 (empty bottle), a pointer near the value of C-Left gets changed to point to the slot of the bottle. When you catch something, the value on C-Left gets changed, then the value of where the pointer points to gets changed too. That's why items turned into bottles work. They point to the right slots. The conclusio is, what we can do with BA and RBA is only very limited. If we can't reach other pointers or values to set up other glitches, like a chain reaction, we've very likely already reached its full potential for an any% TAS. We're lucky to get all medallions off it, thanks to Acryte we have everything we need. I admire his work, I only started posting in this thread because I thought I could speed things up a bit. I will stop posting again anyways, once I get my guitar back, haha. This is only a secondary hobby of mine and I'm happy that there are people like Acryte, Kazooie, etc so you can break the game without my help. (like you already did) >_>
Acryte wrote:
until we find out EXACTLY WHY only bottles work for BA and the link between them and 00 aka dekunuts
Why exactly do you think there's a link between bottles and dekunuts? Ah, you probably ment Deku Sticks, I see. The link would be that base pointer to your inventory. It's almost definitely there. Also it's not like I'm making this up only after you've asked that question. I thought it would work like this from the beginning, I didn't mention it because I think it's unchangeable anyways and therefore not interesting.
Joined: 1/10/2006
Posts: 144
Location: Oregon
No, I wasn't critiquing your post, I was just saying some important things that explain it in full because the goal is to be able to test it out w/out using the game to do so even. W/out knowing something like items hex + 44 you won't even know which location in memory is being changed. And that the reason why the shift starts happening in the c0right to B stuff is simply because of having each item's hex allocated and when it doubles up, 2 are on the same place but the hex increases 1 and +44 is gonna give something different but as far as doing something like just looking at menu places, the menu place didn't change, so that is why it get's staggered. I was simply clarifying why things happen. Cool, I din't understand what you meant by "pointers". That was lingo that I didn't know. But I still don't know why you think only bottles use pointers to slots or whatever. Could you explain that better? Also this: "the value of the item on C-right is on that place instead." Especially when cleft and cdown have closer memory allocations then c-right. Oh and I was thinking that one of the things that is also important is that when you update a bottle you don't have the game GIVES you one. Which may be the reason why it runs the code 8011A6xx xxxx, idk it was one theory. I was thinking that since it doesn't do anything special to have a bottle on B, but only when it is updated does it ever do anything special, that updating it when it doesn't have an allocated place for it in the inventory for it to be added, that every time it updates it runs the code to give it to you and that we somehow have a link between C-right that can alter the code. idk it was something I was thinking about. But nothing special happens on C buttons w/ the same thing because it is just the C button bottle that is there which is from the menu and the one on B is not linked to the others in that way... But then again if you could clarify pointers on C buttons Vs, B that'd be great. Thanks for that explanation of Ocarina items, that has helped me understand that alot better. Also, why does BA work differently in MM? Bottle on B works but we don't have a link to ANY of the C buttons at all. It can only change the item in slot 1 into a bottle w/ what we have on B, but we can't maniulate the slot it points to. Mainly though, why do you say only bottles use pointers to slots. Why is that? I don't understand what the use of a bottle is that is would have that and not any other items... each bottle has it's own inventory slot it is defaulted to. Each one thusly has it's own location in memory where the bits are stored. What do they need a pointer for when it comes to bottles vs other items? Are you saying because you have the type "bottle" and it is written to 4 different slots (the same item) so when you write it it has a pointer designating where the bottle is to be written? But can't you just have it like any other item since you know only a bottle is in 56, 57, 58, and 59, that those are the places in memory and that the bit address stored there updates the value (which it does). IDK I am confused now over how I am understanding pointers and their purpose vs just looking at a value in a certain address and changing it (which was what I was doing before). I was just under the impression that whatever the hex value of 44 + the item's hex on c-right pointed to a location in memory and that the value in that location was what was put on B... so for the megaton hammer example you brought up... megaton hammer slot (defaulted) is 53 in memory, aka 8011A653 and putting a bottle in that slot makes the value at that address change from 11 to 14. Then when you put lens of truth on C-right it's hex is 0F. 0F+44 = 53. So it reads from the memory address 8011A653 whos stored value there is now 0014. so it writes 14 to B and you now have a bottle on B. I can't seem to comprehend what you mean by pointers because either I am just confusing it w/ something I already understand and just can't see it, or I do understand it, and it seems superfluous. Similarly Kazooie has found that if you have goron mask or zora mask on C-right and you change your equips around, the binary to hex values of the respective equipment from that location (6C or 6D depending on the mask) will change what you have on B to that hex value, aka the same as the previous hammer example.
Wisdom; Power; Courage.
Joined: 7/16/2006
Posts: 635
Acryte wrote:
Mainly though, why do you say only bottles use pointers to slots. Why is that? I don't understand what the use of a bottle is that is would have that and not any other items... each bottle has it's own inventory slot it is defaulted to. Each one thusly has it's own location in memory where the bits are stored. What do they need a pointer for when it comes to bottles vs other items? Are you saying because you have the type "bottle" and it is written to 4 different slots (the same item) so when you write it it has a pointer designating where the bottle is to be written? But can't you just have it like any other item since you know only a bottle is in 56, 57, 58, and 59, that those are the places in memory and that the bit address stored there updates the value (which it does). IDK I am confused now over how I am understanding pointers and their purpose vs just looking at a value in a certain address and changing it (which was what I was doing before). I was just under the impression that whatever the hex value of 44 + the item's hex on c-right pointed to a location in memory and that the value in that location was what was put on B... so for the megaton hammer example you brought up... megaton hammer slot (defaulted) is 53 in memory, aka 8011A653 and putting a bottle in that slot makes the value at that address change from 11 to 14. Then when you put lens of truth on C-right it's hex is 0F. 0F+44 = 53. So it reads from the memory address 8011A653 whos stored value there is now 0014. so it writes 14 to B and you now have a bottle on B. I can't seem to comprehend what you mean by pointers because either I am just confusing it w/ something I already understand and just can't see it, or I do understand it, and it seems superfluous.
From what I can tell, it actually DOES work that you have 4 identical bottles in those 4 slots, and that the bottles have an extra pointer to point to which slot it's in. If you're wondering why they would ever do it that way, I can only think of one reason. Bottles were probably programmed before the Inventory screen was finalized. Thus, they needed to be programmed so that they could go anywhere on the inventory screen if needed, which lead to that odd programming. Why the B bottle looks to C-right for its pointer is beyond me, though.
Joined: 1/10/2006
Posts: 144
Location: Oregon
LOOK, this is what I mean... you can have any item in any slot. It doesn't matter what item it is. If they want to have a bottle in that slot all they have to do is change the code to 0014 at the memory address for that slot. It doesn't matter if you have more than 1 of the same bottle. Every slot has it's own bit addresses for it and that determines what is there. You edit those addresses, and you can edit what is in them... if you want to know what is in Bottle #1 ... you just check 8011A656. If you want to know if you don't have bottle #3 you just check the bits in 8011A58 and see if the value stored there is FF (empty slot). Here you can see that you can have any item in any slot. It doesn't matter if it is a bottle or not. All the game does is looks at that location in memory and checks the value stored there. Every item is individual whether or not it is the same type of item simply because every slot has it's OWN location in memory. Here is a picture from my guide I was constructing: as you can see, each location in memory is written in red. The hex values for the default item there are stored as hex values at that location in memory. If you change the value at a memory address then you change the item there. There is no need for "pointers". THis is where I am confused as to why they are necessary or even observably there in the first place. The only thing this entire menu is, is just a bunch of memory addresses and the bits that are stored in them. When you grab a deku stick in the game for the 1st time, all it does is have it hardcoded into the game to add 00 (hex for deku stick) to 8011A644 (location in memory for it). That is ALL it is. If you pick up bottle #3 and it has a letter in it... all the game does is runs code to change the value stored at the memory address corresponding to the menu where bottle 3 normally is (aka 8011A658) to 001B (hex for letter in bottle). That is all it takes to add a bottle into the inventory. It doesn't matter how many they add or what item you are adding. This is why you can add things like "Kokiri Forest" or "Light medallion" and stuff into the menu even though they were never designed to be put there. All you do is change the bits that are stored at that memory address of where you want it in the menu to ones that give the desired item you want there.
Wisdom; Power; Courage.
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
Only bottles use the indexes when you use them because they are the only ones that can be in 4 different places normally. 8011A638 - B item 8011A639 - C-left item 8011A63A - C-down item 8011A63B - C-right item 8011A63C - C-left index 8011A63D - C-down index 8011A63E - C-right index The game adds 3 to the address of the item to get to the index when you use the bottle. It also uses them when you change C-items, but then it doesn't check the B-button.
Joined: 10/20/2006
Posts: 1248
EDIT:Thanks for the actual addresses. Will make it easier to understand. Pointers are what game developers use to write more flexible code. I tried to look at BA from a deleopers perspective. Because it makes more sense imo than just looking at pure addresses.
Acryte wrote:
No, I wasn't critiquing your post
Yet, you said this:
Acryte wrote:
That's not quite how it works. K so...
Acryte wrote:
Also, why does BA work differently in MM? Bottle on B works but we don't have a link to ANY of the C buttons at all. It can only change the item in slot 1 into a bottle w/ what we have on B, but we can't maniulate the slot it points to.
Hm, I didn't know that. It looks like there is a memory reserved for that pointer on MM. It's always zero though, so you always point to the first slot. Also, what petrie911 says should be true too. The inventory code is very flexible, which is why you can turn items into bottles and then use them like normal bottles.
Acryte wrote:
Also this: "the value of the item on C-right is on that place instead." Especially when cleft and cdown have closer memory allocations then c-right.
It doesn't really matter how close they are. I just used the word close because I thought it would be easier imaginable then. It's just a certain space in memory relative to the address where the value of B (for example) gets stored to, whatever.. I'll try to explain better what I think is going on.. I don't know the actual addresses for the C-Button-items or anything. EDIT: Look at the post above for them. :P So I'll just use made up addresses. The addresses and the order are maybe different in reality, not like it matters much though. I'll try to use easy numbers. You don't have to use hex to understand how it works. Somewhere in memory: (Equipped items on your buttons) x+00: Value of the item on the B button x+01: Value of the item on C-Left x+02: Value of the item on C-Down x+03: Value of the item on C-Right x+04: Space for pointer to your inventory of the item on C-Left x+05: Space for pointer to your inventory of the item on C-Down x+06: Space for pointer to your inventory of the item on C-Right Somwhere else in memory: (Your inventory) y+00: Value of item on slot one y+01: Value of item on slot two y+02: Value of item on slot three .... y+18: Value of item on slot 19 y+19: Value of item on slot 20 y+20: Value of item on slot 21 y+21: Value of item on slot 22 (There's normally bottles at these slots) .... Now, you move to slot 21 and equip that item to C-Left. The game copies the value at y+20 to x+01. You now have the item on C-Left. What it also does is this: You selected the item at y+20, it stores that 20 to x+01+03=x+04. What you equipped to C-Left was in this case an empty bottle. Now you use that bottle and catch a fish. The game writes that new value to x+01, so you have it on C-Left. Then it looks at x+01+03=x+04 There's a 20 there. It also writes that same new value to y+20. y is the base pointer as you can see. Now you do the Ocarina items glitch to get Bottle B. The game glitches up and writes an empty bottle to x+00 instead of x+01. It now looks for the pointer at x+00+03=x+03=value of item on C-Right! Lets say, you got Nayru's Love there. Its value is 19. It writes the empty bottle also to y+19=20th slot. If you could equip a bottle to B from your inventory menu, this would happen: We equip a bottle from slot 20 (y+19) to B: Game writes 20 (empty bottle) to x+00, game writes 19 to x+00+03. This would theoretically give you Nayru's Love on C-Right. For MM: Nintendo has reserved memory for a pointer here, which never gets used. They probably planned to make you able to equip bottles to B in this game at some point. x+00: Value of the item on the B button x+01: Value of the item on C-Left x+02: Value of the item on C-Down x+03: Value of the item on C-Right x+04: Space for pointer to your inventory of the item on B x+05: Space for pointer to your inventory of the item on C-Left x+06: Space for pointer to your inventory of the item on C-Down x+07: Space for pointer to your inventory of the item on C-Right You do Ocarina items glitch. The game writes 20 to x+00. Then it looks for the pointer at x+00+04 (+04 in MM because there's that additional space inbetween). There's a 00 there because it never gets used. It writes the bottle to y+00 (first slot always). I hope that clears things up a bit. The game never does any +44 stuff to get to your inventory. It uses y aka the base pointer to your inventory. EDIT: How did you get Magic Beans to that slot? Does it work without a cheating device? It's also annoying to see that Bottles turned into Adult Link's items aren't equipable as YL. Or do they just look grey, but are equipable? Would make more sense. By the way, the pointers/indexes at x+04 to x+06 get set, no matter if you equip a bottle or a different item to a C-button. They just don't get used again by any other item except bottles. Proof is the old turn items into bottles glitch (without BA). Catch something in a bottle, press start before it's inside, equip a different item to that C-button. The item gets turned into a bottle inside your inventory. Which proves that equipping ANY item to C sets that pointer, like HHS said. EDIT2: Haha, I just thought up something funny while trying to come up with useful ideas. It's not useful at all though, but funny. Get Bottle B as an adult. Catch a fairy and have the Broken Sword on C-Right. You get Spirit and Shadow Medallions and lose all the others. Now finish Fire Temple to get the Medallion without learning the green or red warp songs. Do BA to get a full Lonlon Milk on B. Have the Broken Sword on C-Right. Now drink the Milk. You should now have a half full Lonlon Milk on B and all medallions except the Light Medallion. XD This would have been useful in an all medallions run, if you didn't lose the Light Medallion. lol EDIT3: Wouldn't work. You can't do BA without the Forest Medallion. However, I've found an interesting workaround. Do everything as in EDIT2 until you get the Fire Medallion. Then do Bottle B, it must be empty. Equip Broken Sword to C-Right, fish in bottle to another C-Button. Empty the Bottle, catch the fish again. Now do the Ocarina items glitch. You should drink the empty bottle, and have a half full Lonlon Milk on B and all medallions except the Light Medallion after that.
Joined: 5/17/2007
Posts: 124
Location: Cincinnati, OH
Sorry to get you guys off topic about values and stuff. After Dodongo's cavern gets pwned we are suppose to go to kakariko and get cucco bottle. Could anyone let me know the fastest route for collecting the cuccos when entering from death mountain? Thanks.
Joined: 1/10/2006
Posts: 144
Location: Oregon
You don't have to use hex to understand how it works. I hope that clears things up a bit. The game never does any +44 stuff to get to your inventory. It uses y aka the base pointer to your inventory. EDIT: How did you get Magic Beans to that slot? Does it work without a cheating device? It's also annoying to see that Bottles turned into Adult Link's items aren't equipable as YL. Or do they just look grey, but are equipable? Would make more sense.
It's simple. For each item SLOT they have hardcoded which places in the menu are useable by YL or adult link. That is why when you do 21bottles, etc. you can't use one's on adult link's place and vice-versa. That entire game is working in hex, how can you talk about the specifics of something as complicated as bottle adventure and not use Hex when Bottle adventure USES HEX at it's most base levels. How did I get magic beans to that slot? Just like you can get ANY ITEM onto ANY SLOT in the inventory. You take that slot's location in memory. That slot has bits stored there. You change the bits to whatever the desired item is in the slot. That is why I am saying this stuff about pointers is completely irrelevent. If you use pointers as some way for your mind to understand how it works outside the game then that seems fine but that is not how the game appears to be working at all. For what reason do you think that Zora mask and Goron mask can edit the sword/shields? Why do you think that EVERY SINGLE ITEM ON THAT HEX LIST's values +44 when on C-right change EVERY SINGLE VALUE at a memory address corresponding to that value? Bottles do not require pointers because there are more than 1 of them. You can have any item in any slot in the menu because all you have to do is add the bits into that memory address where you want them and then you have a fully functional bottle. I thought I maybe didn't understand what you meant by pointers but now I realize that I do and I must say that it is not correct. Please take some time on an emu testing these things that I have shown you and you will realize that all these things are directly related. I don't even need to use the game to test C-right item combos w/ anything because I know the hex and I can CALCULATE it exactly like the game does. AND HOW DO THESE POINTERS EXPLAIN EDITING VALUES THAT ARE NEVER LINKED TO THE MENU AT ALL? Like Link's wallet size, smallkeys in temples, or whatever else. Please notice that every code you are using is 8011AC_ _ - 00?? this is how the game is running. BA allows us to change those 2 hex values after the "AC" to whatever we want. the value that is input here is the hex for the item's ID + 44. The ?? is the hex for the item caught in the bottle. This becomes stored at that memory address. We are directly editing memory addresses. THIS IS NO DIFFERENT THAT A GAMESHARK. In fact it operates in the EXACT same way except we have to manipulate our items to manipulate the hex values we want passed into specific locations. I don't see how pointers can be "viewed" or even thought to exist w/out providing anything observable to constitute the idea. It is working in hex. All of the values stored in memory are hexadecimal values that are either read in hex bits or converted to binary to represent a set of group values. ____________________ about how you can get magic beans to a bottle slot W/ BA: You can't get anything besides a bottle w/ the Bottle B's current contents onto any place that is in the equippable C items area because: take any Item on C-right's hex (13 for example which is Nayrus Love), now add +44 to that. this is 57 aka the 2nd bottle slot. NOW, what you catch in a bottle determines the bits that are stored to that memory address. So, if I catch a bug (1D) then it is the equivalent of 8011AC57 001D. You will now have a bottled fish in the 2nd bottle place. Here is the thing... unless you can get some other item on B that isn't a bottle and still have the game update memory addresses like it does w/ a bottle on B, you can't get anything other than a bottle or a bottled item to a place in the inventory. The reason it works for quest status items is because it takes whatever is stored and doesn't use the hex value as an item's hex, so the hex for a bug (1D) becomes 11101 and determines whether we have things using simple 1s and 0s. This means that we can alter things because it doesn't reat the 1D from the bug as being a bug, but uses the memory stored at that address differently.
Wisdom; Power; Courage.
Joined: 10/20/2006
Posts: 1248
You can't really say a game works in hex. Hex is just numbers you look at, you could display all of them in binary or decimal code as well. Hex numbers are used for addresses to avoid having to use long numbers, easier to look at.
Acryte wrote:
How did I get magic beans to that slot? Just like you can get ANY ITEM onto ANY SLOT in the inventory. You take that slot's location in memory. That slot has bits stored there. You change the bits to whatever the desired item is in the slot. That is why I am saying this stuff about pointers is completely irrelevent. If you use pointers as some way for your mind to understand how it works outside the game then that seems fine but that is not how the game appears to be working at all.
Man, I just wanted to know if you are able to do that without using game shark. Of course, I knew that it's possible with a cheating device and it has nothing to do with pointers. A pointer is a memory address stored in memory by the game. Similar to a reading sign. And they are relevant because they're how it works. I don't want to discuss with you about that, it would just waste my energy. I have a feeling you still don't understand what a pointer is. You should maybe read it up somewhere or just stay stubborn. XD Both pointers and values are just a sequence of bits. Whether you call something pointer or value depends on how they get used. BA includes using a value as a pointer and stuff like that, so I can understand that you're confused without having any programming experience.
Acryte wrote:
AND HOW DO THESE POINTERS EXPLAIN EDITING VALUES THAT ARE NEVER LINKED TO THE MENU AT ALL
Normally the highest value getting saved at x+04, x+05, x+06 (see my explanation above) (8011A63C, 8011A63D, 8011A63E for hex freaks) is 23. Any higher number causes the game to look beyond the addresses of your inventory slots. Because that just kind of points to other memory addresses. You can explain BA entirely without using the word "pointer", just by adding values and writing stuff to addresses. But by adding something to an address, everything you do is changing a pointer to point to a different address.
Joined: 1/10/2006
Posts: 144
Location: Oregon
when programming I'm sure they use a specific number system to store values. Hex is useful because it minimizes digits and therefore saves more bytes because it requires less bits to display larger numbers. The game stores hex values. It can read that number however it wants by converting that number to a binary equivalent, etc. But when data is being stored, uniform storage for things like variables is a good idea. do you know how a "cheating device"works? It takes locations in memory where variables are saved, and then it edits the data that is stored at that memory address. Now, this is exactly the same thing that BA is doing but w/ a different scope. all the codes you can use in the gameshark ARE THE EXACT SAME CODES you use w/ BA and that BA produces. You can plug them into a gameshark and they will work 100%. This is part of being able to test code. When the gameshark changes the data stored in a location in memory, it is passing HEXADECIMAL values into that location. Believe it or not. I completely understand what you are saying about pointers and just because it seems like a logical structure for a game programmer to use, doesn't mean it was indeed used. Unless of course you have seen the source code and can vouch for it. But I am wondering why you refuse to believe that it is operating in hex when it is mere mathematics. There is no assuming involved. Since it works w/ complete functionality in hex why would you assume that it is in fact working in another way which is relatively unproveable?
Wisdom; Power; Courage.
Joined: 10/20/2006
Posts: 1248
I know exactly what you're talking about. I know cheating devices. XD I just didn't want to call it game shark or anything at first because that's basically advertisment. The problem is you don't know what I'm talking about. xD
Acryte wrote:
I completely understand what you are saying about pointers and just because it seems like a logical structure for a game programmer to use, doesn't mean it was indeed used.
Everytime a game or a program uses one of those "reading signs" to remember addresses, you can basically call that a pointer. It's just a different way to look at the same thing. It's not, either the game works with pointers or entirely in hex. It doesn't make a difference. After you compile a program everything there's left is what you look at now with memory viewers. But you can never explain WHY things happen just from that alone. You didn't understand why the game does things which seem random to you. I offered explanations, which I can not entirely prove without having the originally source code, but there's lots of evidence that I'm right about a majority of the things I wrote.
Joined: 1/10/2006
Posts: 144
Location: Oregon
You can explain BA entirely without using the word "pointer", just by adding values and writing stuff to addresses. But by adding something to an address, everything you do is changing a pointer to point to a different address.
Okay so then since pointers are the exact same thing as hex but with an unnecessary goaround then what were you saying earlier about bottles needing pointers to slots because there are multiple of them? Because it doesn't even matter if you have 100 million bottles if you have 100 million addresses where the bits are stored then each address has the item stored independantly. AND every other item that is in that main menu has it's data stored in exactly the same way, so I'm wondering what you mean when you are talking about bottles being exclusive when it comes to pointers. And that being the cause for BA. The only reason im arguing this w/ you was because you had said it has nothing to do w/ adding +44 to hex on c-right and that bottles required some exclusive stuff w/ pointers that other stuff didn't when to me in hex, evey item in the exact same thing but w/ a different value in its bit address.
Wisdom; Power; Courage.
Joined: 10/20/2006
Posts: 1248
Acryte wrote:
Okay so then since pointers are the exact same thing as hex but with an unnecessary goaround then what were you saying earlier about bottles needing pointers to slots because there are multiple of them? Because it doesn't even matter if you have 100 million bottles if you have 100 million addresses where the bits are stored then each address has the item stored independantly. AND every other item that is in that main menu has it's data stored in exactly the same way, so I'm wondering what you mean when you are talking about bottles being exclusive when it comes to pointers.
Pointers aren't an unnecessary goaround. Multiple bottles don't NEED pointers to work. You could have also have every bottle have its own VALUE. However, there's proof that this isn't the case. When you equip a bottle to C, everything the game would know is its value without a pointer. It would just change the bottle on C when you catch something, not inside your inventory. By every bottle having a different value, you would be able to make conclusions as to which slot it comes from. Or by using a thing, I and lots of other people call pointer, where they store the address where that bottle comes from. Which is what they did.
Acryte wrote:
The only reason im arguing this w/ you was because you had said it has nothing to do w/ adding +44 to hex on c-right and that bottles required some exclusive stuff w/ pointers that other stuff didn't when to me in hex, evey item in the exact same thing but w/ a different value in its bit address.
It has nothing to do with adding 44 because it works the same for every button. If you use an item on C-Left, the game adds a certain number to get to the inventory, if you use it on B it adds a different number, 44. Is that what you think? It looks at the same base address no matter on which button the bottle gets used, therefore it isn't adding, it's looking at the same base address no matter what, that's not called adding. It then adds a value to that base address, like above in my explanation "y+03" for example. That is called adding. I never said bottles where different in such a way. The only thing bottles do differently is look at pointers (reading signs) when you use them to know where inside your inventory they need to update a slot. The pointer is there when you use other items as well, it just doesn't get used because the game doesn't have to. This post explains it well:
HSS wrote:
Only bottles use the indexes when you use them because they are the only ones that can be in 4 different places normally. 8011A638 - B item 8011A639 - C-left item 8011A63A - C-down item 8011A63B - C-right item 8011A63C - C-left index 8011A63D - C-down index 8011A63E - C-right index The game adds 3 to the address of the item to get to the index when you use the bottle. It also uses them when you change C-items, but then it doesn't check the B-button.
The game wouldn't know where to update bottles in your inventory without remembering the slots. And that is basically what is called "using a pointer" (reading sign).
Joined: 1/10/2006
Posts: 144
Location: Oregon
Pointers aren't an unnecessary goaround. Multiple bottles don't NEED pointers to work. You could have also have every bottle have its own VALUE. However, there's proof that this isn't the case. When you equip a bottle to C, everything the game would know is its value without a pointer. It would just change the bottle on C when you catch something, not inside your inventory. By every bottle having a different value, you would be able to make conclusions as to which slot it comes from. Or by using a thing, I and lots of other people call pointer, where they store the address where that bottle comes from. Which is what they did.
I like that explanation, let me give it some thought.
Wisdom; Power; Courage.
Joined: 10/20/2006
Posts: 1248
You'll see the light soon. ;) Something the game could also do is always store everything in the first empty bottle in your inventory when you catch something. But wouldn't it feel cheep to equip bottle 4, catch something and have bottle 1 updated in your inventory?
Joined: 1/10/2006
Posts: 144
Location: Oregon
thanks, I appreciate the time you've taken explaining this.
Wisdom; Power; Courage.
Joined: 10/20/2006
Posts: 1248
No problem. You should probably reread my older posts tomorrow if you want to understand it better. Btw, what do you say about my cool way of getting all medallions except Light Medallion with only completing Fire Temple? (which doesn't take long) I thought it's really cool. XD