Quick Research & Development Thread Page 17

Started by Spherical Ice January 9th, 2010 2:23 AM
  • 509712 views
  • 1157 replies

Deokishisu

Mr. Magius

Male
If I'm online, it's a safe bet I'm at a computer.
Seen 5 Days Ago
Posted March 4th, 2018
859 posts
14.6 Years
Reusable TMs in Emerald

So I was taking a peek through good old reseach and development today when I saw a cute little post about resuable TMs. You know, making TMs act like HMs. After seeing that it had been found on Ruby and FireRed, I thought, why not find it one Emerald? So I did.

To do this little bad boy, go to 0x1B6EE0 in your Emerald ROM and change the A9 there to 90.
Simple as that!

Here's a tiny little explanation for those wondering.

First, 0x1B6EE0 is this little section of code called when a TM or HM is being used. For simplicity's sake, I'll show what is relevant:

081B6EE0: 20A9 mov r0, #0xA9
081B6EE2: 0040 lsl r0, r0, #0x1
081B6EE4: 4284 cmp r4, r0
081B6EE6: bhi $081B6EF0
What it does, is first take the number A9, and put it in r0. Then, it takes r0 and left shifts it 1. This is the same as multiplying by 2 (A9 << 1 = A9 * 2 = 152). If one was to look at any item editor, they would see that this is the index of TM50 in Emerald. Then, this new value is compared to r4, which has the index of the TM/HM being used. If this number higher, the game knows that an HM was used, so it goes to the relevant area to keep it.

This is where we come in. What we want the game to think is that all TMs are the same as HMs. So, what we need to do is change the index it looks for into the index for the first TM, rather than the first HM. So looking at the items, TM01's index is 121. Dividing this by 2 gives 90, so that is why we put 90. The only downside to doing this really is that item 120 is included in this check, which doesn't matter because it's not a TM anyway (it's the Devon Goods). So there ya have it!
This may make the TMs reusable, but what about the PP issue? If you can repeatedly use a TM, you can refresh the PP of the move. Like, if I'm mid-Elite Four and have zero PP on Flamethrower, I can use the Flamethrower TM, overwrite the existing Flamethrower move on my Pokemon, and its PP is restored. The true B/W and up functionality will require more code to fix this.

EDIT: I missed a step in restoring PP. Inserting it in the example above, I'd replace the used up PP Flamethrower with another TM move, then I would relearn Flamethrower from the TM again, thus restoring the PP. There has to be another TM move as a middleman.

Le pug

Creator of Pokémon: Discovery / Fat Kid

Age 27
Male
Le bed
Seen June 9th, 2020
Posted June 8th, 2020
873 posts
7.1 Years
Here is some more research on the emerald specials. Might update in the future. This is an extension to the research provided by droomph at THIS LINK

Emerald specials:
Spoiler:
0xD0 - safari special, adds # of balls and Retire to menu
0xD3 - opens pokeblock case
0xDE - brings up TM page (able or not able)
0xDF - brings up summary page for Buffer1
0xF2 - puts last pokemon in party to sleep
0xF8 - brings up some beauty contest entry in pkmn menu
0xFB - clears all pokemon from party FOR GOOD

**Ace_Master_of_Turtles aka acertony also helped in the above research**

0x101 - "Kobe sends over Dots" you trade buffer1 for a poochyena
0x106 - brings up Berry Blender Max speed record.. doesnt go away until warp
0x111 - fades screen to black except for the SS Anne sprite which is dead center
0x112 - resets the game
0x113 - hall of fame
0x114 - elevator animation and sound effects
0x11C - GOURDON red orb effect
Retired. Thank you guys for a wonderful five years.

Tlachtli

Crit happens.

Age 29
Male
Faraway place
Seen May 14th, 2019
Posted June 15th, 2017
267 posts
8.6 Years
Not exactly R&D, but a useful image I found:
In Emerald BPEE, the uncompressed type images used for TMs/HMs (different from the ones used on the Poke info page) are found at 0xDC4378 and use the palette at 0xDC4338.

Potentially useful if you're adding new types to a hack and want to make TMs with moves of those types. The Power/Type/PP images are on there too, if you want to change how those look.
Pokemon Sigma Σmerald:
(now under management by DraconianWing)

A Gen 3 remake de-make, featuring many new encounters and Gen VI mechanics

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good

Seen November 25th, 2019
Posted June 15th, 2017
258 posts
8.7 Years
Ditto's unique ability to breed with everything despite being genderless is a property of its egg group, but it won't actually produce the right eggs if you give something outside of slot x84 the Ditto egg group- you'll just get a bunch of Bulbasaur if there's no female involved. To fix this, change the byte at x4602A from x84 to the slot you want to behave like Ditto.

While I'm pointing out breeding quirks that are of no use to anyone:

An egg that would hatch as the byte at x46068 (normally x1D, female nidoran) has a 50% chance to instead hatch as the byte at x4607E (normally x20, male nidoran).

Furthermore, an egg that would normally hatch as the word at x460d0 (normally x183, Illumise) has a 50% chance of hatching as twice the byte at x46096 (normally xC1, half of Volbeat's index number).

Volbeat and male Nidoran family members do not produce their female counterparts when breeding with Ditto in Gen 3.

There's a second Ditto check at x460A2- this one doesn't affect the child's species but it probably is important for inheritance.

If an egg would hatch to be double the byte at x45fa8 (xB4, half of Wynaut's index number) and a parent is not holding the item at x45fd8 and x45fdc (xDD, Lax Incense), the baby will become the byte at x45fe0 (xCA, Wobbuffet).

If an egg would hatch to be double the byte at x45fb0 (xAF, half of Azurill's index number) and a parent is not holding the item at x45fee and x45ff2 (xDC, Sea Incense), the baby will become the byte at x45ff6 (xB7, Marill).

Azurill's index number is constructed a second time at x45fe6- I'm not exactly sure *why* it's needed but if the baby's index number doesn't match it the game won't consider changing it to a Marill.

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 21
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
7.9 Years
Here is some more research on the emerald specials. Might update in the future. This is an extension to the research provided by droomph at THIS LINK

Emerald specials:
Spoiler:
0xD0 - safari special, adds # of balls and Retire to menu
0xD3 - opens pokeblock case
0xDE - brings up TM page (able or not able)
0xDF - brings up summary page for Buffer1
0xF2 - puts last pokemon in party to sleep
0xF8 - brings up some beauty contest entry in pkmn menu
0xFB - clears all pokemon from party FOR GOOD

0x101 - "Kobe sends over Dots" you trade buffer1 for a poochyena
0x106 - brings up Berry Blender Max speed record.. doesnt go away until warp
0x111 - fades screen to black except for the SS Anne sprite which is dead center
0x112 - resets the game
0x113 - hall of fame
0x114 - elevator animation and sound effects
0x11C - gourdon red orb effect



**Ace_Master_of_Turtles aka acertony also helped in this research
1: You misspelled Groudon :D
2: I don't think special 0xFB clears all pokemon for good. FR has a similar one, but it updates your party then clears it, so it IS retrievable. You just need to find another special that can restore it. This is probably used in the battle factory, so you may need to go through that script and see when your party comes back. Just a suggestion as it may not be a complete delete.
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,766 posts
7.9 Years
1: You misspelled Groudon :D
2: I don't think special 0xFB clears all pokemon for good. FR has a similar one, but it updates your party then clears it, so it IS retrievable. You just need to find another special that can restore it. This is probably used in the battle factory, so you may need to go through that script and see when your party comes back. Just a suggestion as it may not be a complete delete.
There is a litteral special in all games that does clear the party. All it does is overwrite the party's ram offset with 00s. The specials you are talking about are actually used to save and load the game.

Paired with Simba

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 21
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
7.9 Years
There is a litteral special in all games that does clear the party. All it does is overwrite the party's ram offset with 00s. The specials you are talking about are actually used to save and load the game.
Hmm
This can be used for the battle factory too
*ponders*
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue

Le pug

Creator of Pokémon: Discovery / Fat Kid

Age 27
Male
Le bed
Seen June 9th, 2020
Posted June 8th, 2020
873 posts
7.1 Years
Hmm
This can be used for the battle factory too
*ponders*
well if there is a special for it to return, then yes i am wrong and that'd be good to mention however i use that special in my hack of emerald and since i've used it my old party is gone and i have a new one and it works fine as a complete erase of the party

and yes lol i did spell Gourdon wrong

Here is some more research on the emerald specials. Might update in the future. This is an extension to the research provided by droomph at THIS LINK

Emerald specials:
Spoiler:
0xD0 - safari special, adds # of balls and Retire to menu
0xD3 - opens pokeblock case
0xDE - brings up TM page (able or not able)
0xDF - brings up summary page for Buffer1
0xF2 - puts last pokemon in party to sleep
0xF8 - brings up some beauty contest entry in pkmn menu
0xFB - clears all pokemon from party FOR GOOD

**Ace_Master_of_Turtles aka acertony also helped in the above research**

0x101 - "Kobe sends over Dots" you trade buffer1 for a poochyena
0x106 - brings up Berry Blender Max speed record.. doesnt go away until warp
0x111 - fades screen to black except for the SS Anne sprite which is dead center
0x112 - resets the game
0x113 - hall of fame
0x114 - elevator animation and sound effects
0x11C - GOURDON red orb effect

Some more special research for emerald:

Spoiler:
0x12E - not sure, but clicking once will do a sound warp to blackness but if you continuously click on the script it'll warp you to map 0.0 in the center location (X,Y)
0x8 - takes you to a secret base with a guy in it. Can warp back to original position.
0x9 - warps you to warp 0 on map 0.0
0xA - same as 0x9
0xD - deletes everything on your computer. Nah, jk. Idk what it does
0xE - brings up menu "Decorate, Put Away, Toss, Cancel"
0xF - message "There is no registry" then brings up menu "Decorate, Pack Up, Cancel"
0x18 - teleports you to X1, Y3 of the current map
0x1A - PC shut off sound and tile is set to something else
0x1B - "Please Wait ... ... B Button: Cancel Mixing Records..." followed by twinkling sound and the Mixing Records textbox doesn't go away. Kind of cool though cus you walk around with the message box up and if you go to a new location, it moves up and down with the sign in the top left corner telling you where you are.
0x1D - locks player in place (aka lock command)
0x1E - unlocks player in place (aka release command)
0x21 - "Please Wait ... ... B Button: Cancel" then battle with a level 4 Poochyena ... maybe saving the professor? Anyways, it'll save your progress then give you a communication error. epic troll special.
0x22 - "Please Wait ... ... B Button: Cancel" then message pops up after fade out saying "Communication standby ... please wait" then communication error
0x24 - brings up player info and Would you like to save? message. without a lock in your script, you can walk around with the message up.
0x27 - voodoo ritual where clones of you appear in a circle staring at each other.. usually one of them has a palette error
0x29 - deletes all pokemon in party unless its storing it to be retrieved by some variable or special
0x30 - turns all hidden sprites into soil sprite (sprite #60)
0x3A - same as #raw 0x56 aka it pops up a ! emote box above the player's head



Retired. Thank you guys for a wonderful five years.

Deokishisu

Mr. Magius

Male
If I'm online, it's a safe bet I'm at a computer.
Seen 5 Days Ago
Posted March 4th, 2018
859 posts
14.6 Years
I have two more specials to add to the Emerald list.

Spoiler:
0x7 - Checks if you have a secret base. Puts 0x0 into LASTRESULT if no, and 0x1 if yes.
0x119 - Buffers the location of your secret base to [buffer1]


These are found in the script that handles the secret bases. You know, checking if you have Secret Power and actually making the base and such. In Emerald, the script is located at 2759F1. There's also a special 0x15 in there, but I'm not sure what that does. My best guess is that it reads the tile in front of you and stores a value in 0x8007. If so, that's how the script tells whether you're in front of an indent, a tree, or a bush that you can make a secret base in; it checks 0x8007 (nothing in the script seems to put any values there before they're checked, so I figured it must be the special) for a few values and then branches off into the different types of secret bases. Because I don't need to mess with that special, I'm not really doing any sort of experimentation with it. Maybe with some ingenuity, someone could hack it to read more values and give us more types of secret bases?

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 21
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
7.9 Years
Spoiler:
0x12E - not sure, but clicking once will do a sound warp to blackness but if you continuously click on the script it'll warp you to map 0.0 in the center location (X,Y)
0x8 - takes you to a secret base with a guy in it. Can warp back to original position.
0x9 - warps you to warp 0 on map 0.0
0xA - same as 0x9
0xD - deletes everything on your computer. Nah, jk. Idk what it does
0xE - brings up menu "Decorate, Put Away, Toss, Cancel"
0xF - message "There is no registry" then brings up menu "Decorate, Pack Up, Cancel"
0x18 - teleports you to X1, Y3 of the current map
0x1A - PC shut off sound and tile is set to something else
0x1B - "Please Wait ... ... B Button: Cancel Mixing Records..." followed by twinkling sound and the Mixing Records textbox doesn't go away. Kind of cool though cus you walk around with the message box up and if you go to a new location, it moves up and down with the sign in the top left corner telling you where you are.
0x1D - locks player in place (aka lock command)
0x1E - unlocks player in place (aka release command)
0x21 - "Please Wait ... ... B Button: Cancel" then battle with a level 4 Poochyena ... maybe saving the professor? Anyways, it'll save your progress then give you a communication error. epic troll special.
0x22 - "Please Wait ... ... B Button: Cancel" then message pops up after fade out saying "Communication standby ... please wait" then communication error
0x24 - brings up player info and Would you like to save? message. without a lock in your script, you can walk around with the message up.
0x27 - voodoo ritual where clones of you appear in a circle staring at each other.. usually one of them has a palette error
0x29 - deletes all pokemon in party unless its storing it to be retrieved by some variable or special
0x30 - turns all hidden sprites into soil sprite (sprite #60)
0x3A - same as #raw 0x56 aka it pops up a ! emote box above the player's head



0x1A Shuts down the PC and changes the tile from the lit up screen to the black screen. If you have a tileset that's not the PC tileset, it'll LOOK wrong, but it will be the correct tile. Do it in a PC.

0x21 This is a LINK BATTLE command. If there's nobody to link to (AKA using walk through walls to go to link maps) it'll do the last battle you've done since battle data isn't cleared. So I'm saying the last battle you did was the Poochyena battle. Most of the "communication failed" specials you listed are linking specials that DO work, but in specific conditions.
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
Seen 1 Week Ago
Posted August 13th, 2020
1,318 posts
13.4 Years
A common problem with many hacks that have edited the Town Map is that when checking the Town Map, you don't always appear at the right position. This is because the game looks at a table that determines the width and height of each map name when checking the Town Map.

The table is located at 0x3F2178. The format is very simple:
[WW] 00 [HH] 00

WW = Width
HH = Height

I've wrote out the offsets that will take you to the dimensions of the Kanto map locations:
3F2178 = PALLET TOWN
3F217C = VIRIDIAN CITY
3F2180 = PEWTER CITY
3F2184 = CERULEAN CITY
3F2188 = LAVENDER TOWN
3F218C = VERMILION CITY
3F2190 = CELADON CITY
3F2194 = FUCHSIA CITY
3F2198 = CINNABAR ISLAND
3F219C = INDIGO PLATEAU
3F21A0 = SAFFRON CITY
3F21A4 = ROUTE 4
3F21A8 = ROUTE 10
3F21AC = ROUTE 1
3F21B0 = ROUTE 2
3F21B4 = ROUTE 3
3F21B8 = ROUTE 4
3F21BC = ROUTE 5
3F21C0 = ROUTE 6
3F21C4 = ROUTE 7
3F21C8 = ROUTE 8
3F21CC = ROUTE 9
3F21D0 = ROUTE 10
3F21D4 = ROUTE 11
3F21D8 = ROUTE 12
3F21DC = ROUTE 13
3F21E0 = ROUTE 14
3F21E4 = ROUTE 15
3F21E8 = ROUTE 16
3F21EC = ROUTE 17
3F21F0 = ROUTE 18
3F21F4 = ROUTE 19
3F21F8 = ROUTE 20
3F21FC = ROUTE 21
3F2200 = ROUTE 22
3F2204 = ROUTE 23
3F2208 = ROUTE 24
3F220C = ROUTE 25
3F2210 = VIRIDIAN FOREST
3F2214 = MT. MOON
3F2218 = S.S. ANNE
3F221C = UNDERGROUND PATH
3F2220 = UNDERGROUND PATH
3F2224 = DIGLETT'S CAVE
3F2228 = VICTORY ROAD
3F222C = ROCKET HIDEOUT
3F2230 = SILPH CO.
3F2234 = POKéMON MANSION
3F2238 = SAFARI ZONE
3F223C = POKéMON LEAGUE
3F2240 = ROCK TUNNEL
3F2244 = SEAFOAM ISLANDS
3F2248 = POKéMON TOWER
3F224C = CERULEAN CAVE
3F2250 = POWER PLANT
(Sevii Islands continue on right after, I only wrote Kanto offsets because I'm lazy)

Now to demonstrate what I mean, let's say you're in Pallet Town.


At 0x3F2178, the offset for Pallet Town's dimensions (as well as the start of the whole table), we see the bytes 01 00 01 00. The first 01 simply means that on the Town Map, Pallet Town is only 01 tile high, and the second 01 simply means that on the Town Map, Pallet Town is only 01 tile wide.

Because of that, no matter where you are in Pallet Town, on the Town Map, you'll be limited to those dimensions:


Now lets change Pallet Town's Town Map width to 03. Simply change the byte at 0x3F2178 to 03. Now let's walk all the way to the right side of Pallet Town.


So we changed Pallet Town's Town Map width to 03, let's check the Town Map:

As you can see, it affects our visual position on the Town Map. This is because we altered Pallet Town's Town Map width to 03.

If we go to the middle of Pallet Town, then we get this:


And all the way to the left:


The same applies to height. This is how your position is controlled on the Town Map, as each Map name as a width and height associated with it.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

interdpth

I've seen things, man.

Seen August 5th, 2020
Posted January 19th, 2014
275 posts
16.2 Years
A common problem with many hacks that have edited the Town Map is that when checking the Town Map, you don't always appear at the right position. This is because the game looks at a table that determines the width and height of each map name when checking the Town Map.

This is awesome, I'm going to use this for the world map editor. Any chance you can do it for Ruby? ;0

also, t-swizzle for dream girl
yes, this is doge.

potato is not here.

bye

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good

Seen November 25th, 2019
Posted June 15th, 2017
258 posts
8.7 Years


There's a table at x45FD54 that controls the position of various elements during the item animation on a per-mon basis. Each entry is 5 bytes, and the first entry maps to Bulbasaur rather than 0x0. It looks like Unown does some funny business with this table as well.

0x0 = X position of TM right-ward from left edge of sprite
0x1 = Y position of TM downward from top edge of sprite
0x2 = How much Y position is modified when sprite is stretched (eg. start of TM animation, using a potion on a happy mon)
0x3 = X position of non-TM item
0x4 = Y position of non-TM item

Full Metal

C(++) Developer.

Age 25
Male
In my mind.
Seen August 19th, 2018
Posted May 27th, 2017
806 posts
12.7 Years
Quick python script that's useful for debugging a map if you know it's header offset and don't feel like loading up advance map.

Sample output:
D:\User\Desktop>pkmap.py D:\User\Desktop\frcpy.gba 350618
[email protected] 0x350618
flash_thing 0x0
type 0x1
music 0x12c
connection_header 0x835276c
2 connections @ 137701204
{'bank': 3, 'filler': 0, 'number': 19, 'offset': 0, 'type': 2}
{'bank': 3, 'filler': 0, 'number': 39, 'offset': 0, 'type': 1}
weather 0x2
event_data 0x83b4e50
show_label 0x0
index 0x4e
battle_type 0x0
map_scripts 0x816545a
map_data 0x82dd4c0
unknown 0x601
label 0x58

Recompiling:
b"\xc0\xd4-\x08PN;\x08ZT\x16\x08l'5\x08,\x01N\x00X\x00\x02\x01\x01\x06\x00\x00"
================================================================================

★ full metal.

I like to push it,
and push it,
until my luck is over.

Spherical Ice

Age 22
Leicester, UK
Seen 3 Hours Ago
Posted August 15th, 2020
5,261 posts
12.8 Years
This is probably something you could find by yourself but it's nice to have it in one place I guess.

0xE991F8 - Trainer Card Tileset
0x3CC6F0 - Trainer Card Front Tilemap
0x3CC984 - Trainer Card Back Tilemap
0x3CCEC8 - Trainer Card Background Tilemap
0x3CD5E8 - Badges
0x3CC368 - Trainer Card Stickers
0xE99198 - Palettes (first is the Trainer Card itself (and the stickers? I think), then the background for males, then the background for females)
Seen April 13th, 2014
Posted March 1st, 2014
79 posts
12.4 Years
Well I'm not sure how much of what I'm about to post isn't already known, but I couldn't find it, so here goes.

Spoiler:

The window on the far left is the VBA Disassembler in Ruby. Next to it is Fire Red. Top right is Fire Red in a Hex editor, below that is Ruby. All are pointed to the same snippet of code.


I think I isolated the routine for the tall grass in Pokemon Ruby by working backwards from the shared information in Fire Red (there was a post about making the tall grass work, and I started from those offsets). What I'm trying to do is change how the tall grass animation handles sprite priority (basically, make it behave just like the normal grass as far as layers are concerned by making both the player and the grass priority 2 instead of the player's body changing to 3)
Spoiler:

I got this far, but I'm stuck. I have no idea what to change, or how much to change, or what to change it to. I have limited experience working with HEX, and I never really looked at ASM until a few days ago.

I would imagine that I would need to change one value or so to make it behave like the normal grass (I still want the player to be forced to walk through it, and I can manage with the animation frames given, but I dont want the player disappearing behind the grass's roots). If anyone is interested in this problem, for purposes of eking out a bit more customization from the behaviors already found in the game, or just to help out a newbie who tried his best, I would greatly appreciate it.
Seen April 13th, 2014
Posted March 1st, 2014
79 posts
12.4 Years
A common problem with many hacks that have edited the Town Map is that when checking the Town Map, you don't always appear at the right position. This is because the game looks at a table that determines the width and height of each map name when checking the Town Map.

The table is located at 0x3F2178. The format is very simple:
[WW] 00 [HH] 00

WW = Width
HH = Height

Spoiler:
I've wrote out the offsets that will take you to the dimensions of the Kanto map locations:
3F2178 = PALLET TOWN
3F217C = VIRIDIAN CITY
3F2180 = PEWTER CITY
3F2184 = CERULEAN CITY
3F2188 = LAVENDER TOWN
3F218C = VERMILION CITY
3F2190 = CELADON CITY
3F2194 = FUCHSIA CITY
3F2198 = CINNABAR ISLAND
3F219C = INDIGO PLATEAU
3F21A0 = SAFFRON CITY
3F21A4 = ROUTE 4
3F21A8 = ROUTE 10
3F21AC = ROUTE 1
3F21B0 = ROUTE 2
3F21B4 = ROUTE 3
3F21B8 = ROUTE 4
3F21BC = ROUTE 5
3F21C0 = ROUTE 6
3F21C4 = ROUTE 7
3F21C8 = ROUTE 8
3F21CC = ROUTE 9
3F21D0 = ROUTE 10
3F21D4 = ROUTE 11
3F21D8 = ROUTE 12
3F21DC = ROUTE 13
3F21E0 = ROUTE 14
3F21E4 = ROUTE 15
3F21E8 = ROUTE 16
3F21EC = ROUTE 17
3F21F0 = ROUTE 18
3F21F4 = ROUTE 19
3F21F8 = ROUTE 20
3F21FC = ROUTE 21
3F2200 = ROUTE 22
3F2204 = ROUTE 23
3F2208 = ROUTE 24
3F220C = ROUTE 25
3F2210 = VIRIDIAN FOREST
3F2214 = MT. MOON
3F2218 = S.S. ANNE
3F221C = UNDERGROUND PATH
3F2220 = UNDERGROUND PATH
3F2224 = DIGLETT'S CAVE
3F2228 = VICTORY ROAD
3F222C = ROCKET HIDEOUT
3F2230 = SILPH CO.
3F2234 = POKéMON MANSION
3F2238 = SAFARI ZONE
3F223C = POKéMON LEAGUE
3F2240 = ROCK TUNNEL
3F2244 = SEAFOAM ISLANDS
3F2248 = POKéMON TOWER
3F224C = CERULEAN CAVE
3F2250 = POWER PLANT
(Sevii Islands continue on right after, I only wrote Kanto offsets because I'm lazy)

Now to demonstrate what I mean, let's say you're in Pallet Town.


At 0x3F2178, the offset for Pallet Town's dimensions (as well as the start of the whole table), we see the bytes 01 00 01 00. The first 01 simply means that on the Town Map, Pallet Town is only 01 tile high, and the second 01 simply means that on the Town Map, Pallet Town is only 01 tile wide.

Because of that, no matter where you are in Pallet Town, on the Town Map, you'll be limited to those dimensions:


Now lets change Pallet Town's Town Map width to 03. Simply change the byte at 0x3F2178 to 03. Now let's walk all the way to the right side of Pallet Town.


So we changed Pallet Town's Town Map width to 03, let's check the Town Map:

As you can see, it affects our visual position on the Town Map. This is because we altered Pallet Town's Town Map width to 03.

If we go to the middle of Pallet Town, then we get this:


And all the way to the left:


The same applies to height. This is how your position is controlled on the Town Map, as each Map name as a width and height associated with it.
I'm pretty sure that functionality is built into AdvanceMap 1.92. I did that a couple weeks ago on my Ruby hack. Maybe it's different between RSE and FRLG, though. I'm not sure, and I'm at school so I can't check right now.

In AM, though, you pull up the world map editor, and on the right there's boxes for the width and height, close to where the position boxes are.

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 21
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
7.9 Years
I'm pretty sure that functionality is built into AdvanceMap 1.92. I did that a couple weeks ago on my Ruby hack. Maybe it's different between RSE and FRLG, though. I'm not sure, and I'm at school so I can't check right now.

In AM, though, you pull up the world map editor, and on the right there's boxes for the width and height, close to where the position boxes are.
FRLG is more strongly built, so AMAP isn't supporting that. You usually had to make a map that fit kanto before
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
Seen 1 Week Ago
Posted August 13th, 2020
1,318 posts
13.4 Years
I'm pretty sure that functionality is built into AdvanceMap 1.92. I did that a couple weeks ago on my Ruby hack. Maybe it's different between RSE and FRLG, though. I'm not sure, and I'm at school so I can't check right now.

In AM, though, you pull up the world map editor, and on the right there's boxes for the width and height, close to where the position boxes are.
The boxes for width and height is only there if you're hacking Ruby/Sapphire/Emerald. It's not there for FR/LG, so to edit the width/height you would have to refer to the offsets I posted earlier.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
11.7 Years
Finally no more trouble with OAK, GARY, HERO introduction sprite palettes!

They are 256 colours so when you look them up on a palette viewer you might find that OAKs palettes are stored in slots 7 and 8. This means you can have 32 colours for these sprites too!!

So all you have to go is into Infranview --> decrease colour depth to 32 --> Increase colour depth to 256. Next just move all colours into rows 7 and 8 and save and insert in NLZ-Advance as 256 colours (also make sure your transparent is at the first tile.. I forgot). Then simply hex edit find the palette in the ROM or APE and insert it! Wahla! No more glitchy greenish and red intro sprites!
HOLIDAYING CURRENTLY!!

xGal

Mhm

Non-binary
A tree
Seen February 16th, 2018
Posted May 20th, 2017
243 posts
8.9 Years
The songtable format goes like this:
XX XX XX 08 YY 00 YY 00
XX XX XX = Pointer to the song
YY = 01 or 02. 01 results regular songs, but if you put 02, the song ingame will stop play if there is another sound (like PC sound, menu open sound, etc.).

Gamefreak used 01 for regular songs (like city/battle themes) and 02 for fanfares.

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 21
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
7.9 Years
The songtable format goes like this:
XX XX XX 08 YY 00 YY 00
XX XX XX = Pointer to the song
YY = 01 or 02. 01 results regular songs, but if you put 02, the song ingame will stop play if there is another sound (like PC sound, menu open sound, etc.).

Gamefreak used 01 for regular songs (like city/battle themes) and 02 for fanfares.
This has been known since 2007 :D
03 is for other things too you know
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue

Deokishisu

Mr. Magius

Male
If I'm online, it's a safe bet I'm at a computer.
Seen 5 Days Ago
Posted March 4th, 2018
859 posts
14.6 Years
During my analysis of cmda6, I discovered that Game Freak implemented their own script-controlled walking ASM into the Advance-generation games. There can be up to eight subroutines to run on every frame of animation, only one of which may be active at any given time. You can select a subroutine to activate using cmda6.

At 0x03005090, there is a list of ASM functions to be executed on every frame of animation. Each entry in the list is a pointer to the routine, some metadata about the list item itself, and thirty-or-so bytes for the routine to work with (so that it may maintain its state).

When on the overworld, one of the items on this list is 0x0806E811, a walking routine manager. This routine manager will check one of the bytes in its execution-list-item (set by cmda6) and based on that byte, it will call one of eight walking subroutines.

Those subroutines in turn check the player's coordinates against stored values to see if the player has moved. If so, the subroutine processes player movement accordingly (check the tile they're standing on, change it if necessary, what have you).

There are eight slots for walking subroutines, and the defined subroutines (pointed to by pointers at 0x083A7310) are:
#0 at 0x0806E955: Nop
#1 at 0x0806EB55: Broken (R/S/E leftover: Route 113 ash-covered grass)
#2 at 0x0806E955: Nop
#3 at 0x0806E955: Nop
#4 at 0x0806E9E1: Icefall Cave ice tiles
#5 at 0x0806E955: Nop
#6 at 0x0806E955: Nop
#7 at 0x0806EC41: Broken (R/S/E leftover: Granite Cave/Sky Pillar broken floor tiles)

(The three defined subroutines basically change certain tiles out from under the player's feet. Theoretically, though, a subroutine can do anything it wants on every frame of animation that the overworld is being processed.)

What this means is that we now have an official way -- something that was designed for this use -- to set up our own custom-made ASM functions to run the very instant the player takes a step. If we keep the broken functions in the table, we can define up to four custom ASM subroutines; if we ditch those, we can define six.

(We could also repoint and extend the subroutine pointer table, and modify the related ASM code, thereby allowing up to 255 custom subroutines to be predefined and activated with cmda6.)

One possible use case for all of this would be an alternate (and more script-friendly) implementation of JPAN-style walking scripts, which would work without breaking other game functions (i.e. wild encounters in tall grass).

For more information, see the description for cmda6 in my FireRed script command reference.

Oh, something else: the R/S/E leftovers prove that this discovery applies to all Advance-generation games. The offsets will differ, and the walking subroutines will have some differences in R/S/E, but the system itself exists in all Pokemon GBA games.
I just had a thought while skimming through the older posts in this topic. Could this information be used to create phenomena? You know, the shaking grass and sky shadows and dark blue water featured in B2/W2?

Kawaii Shoujo Duskull

The Cutest Duskull

Seen 2 Weeks Ago
Posted May 30th, 2017
277 posts
7.2 Years
I just had a thought while skimming through the older posts in this topic. Could this information be used to create phenomena? You know, the shaking grass and sky shadows and dark blue water featured in B2/W2?


Hmm...
I think if enough was put into it, it could be possible. If I understand correctly, a routine could be created to use the RNG each step to give a chance of shaking grass, dark water, or the clouds. The routine would need to check if one such event is already active though. It would also need to reset after the player enters a battle or leaves the map, or other similar instances. Finally, it would need to check if the player is on the set tile and--if yes--generate a wild encounter or give an item.
Resetting after leaving a map wouldn't be a problem since I think it would most likely do that on its own. I don't know how a routine would check if an event is already going though, and I really don't have a clue how the RNG or whatnot work in the GBA pokemon games.


I know my input isn't much of a help, sorry. :P

Spherical Ice

Age 22
Leicester, UK
Seen 3 Hours Ago
Posted August 15th, 2020
5,261 posts
12.8 Years
playsong2 is supposed to be used in 0x3-type level scripts to automatically play the song specified instead of the song that map usually plays.

For example:

#dynamic 0x800000

'---------------
#org @start
compare 0x40C6 0x0
if 0x1 call @snippet1
end

'---------------
#org @snippet1
playsong2 0x15A
return
Would play the song 0x15A as soon as the map is loaded so long as 0x40C6 is set to 0x0, and, if it isn't, the song that is set to be the map's music on AMap will play as usual. playsong, on the other hand, would not work in this situation as there would be a couple of seconds of delay.

I dunno if I'm just really slow, but if others didn't know this then there's no harm in posting it. (Now that I think about it, this is probably obvious as movesprite2 is another command that's specifically for level scripts)