Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Documenting Item Underflow Item slots.  (Read 12282 times)

0 Members and 1 Guest are viewing this topic.

luckytyphlosion

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • JACK-flys are OP
    • View Profile
Documenting Item Underflow Item slots.
« on: May 04, 2014, 01:37:48 pm »
Now that I know much more about Item Underflow (and have the wram map disassembly), I have a more clear understanding of each item:

items 1-20 + quantity = normal stuff
item 21 = end of list
quantity = first money byte
item 22 = second money byte
quantity = third money byte
item 23-27 + quanity = rival name
item 28 = rival name
item 28 quantity = options
item 29 = badges (written in binary)
item 29 quantity = ???
item 30 = ???
item 30 quantity = First part of tid
item 31 = second part of tid
item 31 quantity = ???
item 32 = ??? (usually ultra ball/brightness)
item 32 quantity = brightness/palletes
item 33 = map id
item 33 quantity = first part of top left block pointer
item 34 = second part of top left block pointer
item 34 quantity = y coord
item 35 = x coord
item 36 quantity = block y coord
item 37 = block x coord
item 37 quantity = last outside map visited (warping)
item 38 = ??? (appears to be based on last map)
item 38 quantity = map tileset, controls fly/dig/teleport (Executed upon entry)
item 39 = map height
item 39 quantity = map width
item 40 = first part of map pointer (executed upon entry)
item 40 quantity = second part of map pointer
item 41 = first part of text pointer (executed upon talking to someone)
item 41 quantity = second part of text pointer
item 42 = first part of map script pointer (executed upon closing menu)
item 42 quantity = second part of map script pointer
item 43 = map connections
item 43 quantity = north connection data ("walking" warp for north)
item 44-48 + quantity = ??? (based off of north connection data)
item 49 = south connection data
item 49 quantity to item 54= ??? (based off south connection data)
item 54 quantity = west connection data
item 55 to item 59 quantity = ??? (etc)
item 60 = east connection data
item 60 quantity to item 64 = ??? (etc)
item 64 quantity to item 69 quantity = sprites on the map
item 70 = sprite set id
item 70 quantity = ???
item 71 = ???
item 71 quantity = ???
item 72 = ???
item 72 quantity = ???
item 73 = number of warps
item 73 quantity =

Then the items get really weird from here, so I'm not sure exactly to put. In an outside map the item 73 and below represent all the outside to inside warps, and it looks like warps are displayed in this format:

Item 1 quantity = Y coord
Item 2 = X Coord
Item 2 quantity = Map Index
Item 3 = Map to Warp to.

Most warps are accessible, but then the game warps but the inventory loops back to the top after 128 items, while the warps keep going. This format also works for inside maps, except there's much less warps, and item 3 is map 255, which corresponds to the last outside map.

Will add more discoveries later.
« Last Edit: October 26, 2014, 09:28:59 pm by luckytyphlosion »

pokechu22

  • Member+
  • *
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #1 on: May 04, 2014, 02:11:40 pm »
You probably could use a ram map.  The first item is D31E, so that can help. 
When I underline text, that usualy means I am using the [‍acroynm] tag to provide aditional information.  Hover over it to view.
My youtube channel

luckytyphlosion

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • JACK-flys are OP
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #2 on: May 04, 2014, 02:43:58 pm »
The only problem with that RAM Map is that it doesn't have anything past address D39C, which is most of the unknown item slots.

bbbbbbbbba

  • Staff
  • *****
  • Offline Offline
  • ... but things won’t change if you don’t speak!
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #3 on: May 05, 2014, 12:01:56 am »
As a first step, maybe you should see wram.asm in iimarkus's disassembly, https://bitbucket.org/iimarckus/pokered/src. It is slightly more complete.

Edit: well, there is still a laaaarge gap in the area you care about the most. I do have one thing to add: $d3ae is the number of warps in the current map, and the actual warp data begins from $d3af. There are 4 bytes for a warp: the Y coordinate, the X coordinate, target warp ID and target warp.

Edit: seems that I have one more thing.

Item 30: ??? (always Master Ball)

This, $d358, is some bit flags used by the text processor. It is normally 1 (hence the master ball), and it becomes 3 whenever the game prints a message "one letter at a time" (like NPC quotes and messages in battles).

I have never seen the LSB zeroed (values 0 or 2) except when resetting the game; the code suggests that this will happen when you successfully enter the cable club, but it is hard to verify on an emulator. Anyway, setting the LSB to 0 seems to cause the game to disregard the text speed in options, and always use "fast".
« Last Edit: May 05, 2014, 12:56:31 am by bbbbbbbbba »

camper

  • aka GlitcherRed, azum4roll
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • 975642dx║'r DExsfoF▓1 error.
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #4 on: May 05, 2014, 04:02:35 am »
Item 34 quantity is the Y-coordinate. (D361)

Item 36 quantity is used for previous speedruns to change the map ID when you walk from an indoor map to an outdoor map. (D365)
Youtube
 

Guess where this is?

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: Documenting Item Underflow Item slots.
« Reply #5 on: May 05, 2014, 04:55:41 am »
As a first step, maybe you should see wram.asm in iimarkus's disassembly,
The current link for that is on Github. I try to keep the BitBucket link updated but it has a tendency to fall behind.

luckytyphlosion

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • JACK-flys are OP
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #6 on: October 26, 2014, 09:30:41 pm »
Bump because majorly fixing/editing first post.

luckytyphlosion

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • JACK-flys are OP
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #7 on: November 11, 2014, 09:13:24 pm »
More discoveries I was too lazy to post!

You-know-who posted the raw connection data from "somewhere", which is this:
struct Connection { u8 mapIndex, u16 connectedMapBlockData, u16 currentMapPositionRAM, u8 connectionWidth, u8 connectedMapWidth, u8 yAlign, u8 xAlign, u16 topLeftPointerAfterEnteringMap

In item underflow, after the map index, South and East Connections are structured like this:

1.  item 1Q = First part of Connected map block data
2.  item 2  = Second Part of connected map block data
3.  item 2Q = 1st part of Current map position in ram (???)
4.  item 3  = 2nd part of Current map position in ram (???)
5.  item 3Q = connection width (doesn't seem to change, most likely loaded upon entering map)
6.  item 4  = connected map width
7.  item 4Q = Y coord align (positive numbers (signed) will add (down) to the player's y coord depending on that number while negative numbers will subtract (up) from the player's y coord depending on that number. Note that this doesn't reflect a change in what the overworld looks like, but reflects a change on the ycoord)
8.  item 5  = X coord align (same case as above except with xcoord. Positive numbers add (right) while negative numbers subtract (left))
9.  item 5Q = 1st part of top left block Pointer
10. item 6  = 2nd part of top left block Pointer

While North and West are structured like this:

1.  item 1  = First part of Connected map block data
2.  item 1Q = Second Part of connected map block data
3.  item 2  = 1st part of Current map position in ram (???)
4.  item 2Q = 2nd part of Current map position in ram (???)
5.  item 3  = connection width (doesn't change from what I'm seeing)
6.  item 3Q = connected map width
7.  item 4  = Y coord align(positive numbers (signed) will add (down) to the player's y coord depending on that number while negative numbers will subtract (up) from the player's y coord depending on that number. Note that this doesn't reflect a change in what the overworld looks like, but reflects a change on the ycoord)
8.  item 4Q = X coord align (same case as above except with xcoord. Positive numbers add (right) while negative numbers subtract (left))
9.  item 5  = 1st part of top left block Pointer
10. item 5Q = 2nd part of top left block Pointer

Something I found out today is that changing tileset data to a positive number results in the blocky, blockx, top left pointer, y coord and x coord to shift somewhere else when loading another map from connection data. The amount changed to doesn't matter, but what does matter is the last map's tileset visited. If the last map's tileset was 0 and the map you're currently on has a tileset of 0, then nothing happens. If the last map's tileset was 2, and the map you're currently on is 0, then you would get shifted, but I don't know the exact number/figure.

If you change the tileset data to a "negative" number, and load another map through connection data, then the map, text and script pointer are not loaded (not sure about top left pointer though). Usually if you swap script pointer, you can either get crazy effects, or the game will crash. There are probably other addresses that aren't updated either, but I haven't looked into it much.
« Last Edit: February 08, 2015, 03:34:07 pm by luckytyphlosion »

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody. 🦋 ✿
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #8 on: January 01, 2015, 12:29:53 pm »
Can somebody give memory addresses for the start of the North and West connection and South and East connection structure please? I want to do a custom "instaCT" and lucky says in this post that you have to change the top left block pointer (I assume as part of that structure), and map width, and align yourself to the correct BlockY/X position.

As map index (item 75?) is D3B2, I tried corrupting the bytes after it and using a north connection, but nothing happened? Am I on the wrong address.

I tried the first instaCT described here, but it seems to be of a different sort. All it did was change one byte of the event displacement data (D360).

If that is a different sort of instaCT, I think that you should give these connection instaCTs a different name to avoid confusion in my opinion, like "connection instaCT" but of course, you don't have to.

Edit: Thanks to Datacrystal, apparently D371-D37B = Map's 1st Connection Data, D37C-D386 = Map's 2nd Connection Data, D387-D391 = Map's 3rd Connection Data, D392-D39C = Map's 4th Connection Data.

I didn't search through it good enough. But that doesn't seem to be the same thing. It has a different structure (starting with the first byte being the destination, as described in item 43 quantity).
« Last Edit: January 01, 2015, 01:04:38 pm by Torchickens »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

Dabomstew

  • Member+
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #9 on: January 01, 2015, 03:22:50 pm »
The topleft block pointer you need to change for instaCTs is this:

Quote from: luckytyphlosion
item 33 quantity = first part of top left block pointer
item 34 = second part of top left block pointer

Edit: For that particular instaCT (the Dratini one), the first part of the instructions uses the "item 35 = x coord" to mutate a Poke Doll into a Nugget in order to allow us to do it in the speedrun with an item from Celadon Mart. The actual instaCT bit is only the bit after the Nugget is created.
« Last Edit: January 01, 2015, 03:25:47 pm by Dabomstew »

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody. 🦋 ✿
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #10 on: January 01, 2015, 03:29:46 pm »
The topleft block pointer you need to change for instaCTs is this:

Quote from: luckytyphlosion
item 33 quantity = first part of top left block pointer
item 34 = second part of top left block pointer

Oh. OK. Thank you. That was simpler than I thought. I did that for the first example listed on the Cooltrainer page in the instaCT section (I got the screen data for Dratini CT originally so I may have been on the right tracks the whole time, I just didn't know the event displacement data was that data) I was under the impression you had to change something else and load a specific (north/east/south/west) connection.
« Last Edit: January 01, 2015, 03:45:05 pm by Torchickens »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

Evie the Mother Hen ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • I love My Melody. 🦋 ✿
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #11 on: August 08, 2018, 09:33:40 am »
*bump*

Lucky, I think there was an error somewhere in making the list as I looked into the "level-script pointer" map script address and it's item 41 and item 41's quantity. Confirmed this both with counting and checking the value of CC35 after pressing Select on the relevant item (which would change after using a code to modify D36E) on my Xploder cheating device.

Is it OK if you could you update the list please?
« Last Edit: August 08, 2018, 09:36:09 am by Evie Torchic the Glitch Scientist »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post :)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Transgender woman but spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman/I'm a 'girly' nerd who discovered herself. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • PSYNCIN' IN THE VaiN
    • View Profile
Re: Documenting Item Underflow Item slots.
« Reply #12 on: August 08, 2018, 02:30:30 pm »
A list of specific correspondences between item slots and memory addresses would be a good addition to this page, as the formula combined with the disassembly could be annoying to work with after a while. If the list here is inaccurate, though, I'll wait before adding it.

I come and go. Apparently still more than most of the other regulars, so hard to say it's a semi-hiatus of some sort. Suggestions for wiki organization are appreciated here if you haven't seen this thread yet.
I don't have a habit of keeping Discord open, so direct inquiries are still preferred through here.