The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Quick Research & Development Thread (https://www.pokecommunity.com/showthread.php?t=205158)

Deokishisu December 24th, 2013 8:04 PM

Quote:

Originally Posted by itari (Post 7993745)
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:

Code:

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 December 31st, 2013 8:13 PM

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

Tlachtli January 1st, 2014 10:48 AM

1 Attachment(s)
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.

DoesntKnowHowToPlay January 5th, 2014 4:31 PM

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 January 6th, 2014 1:59 PM

Quote:

Originally Posted by Le pug (Post 8015414)
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.

karatekid552 January 6th, 2014 2:12 PM

Quote:

Originally Posted by gogojjtech (Post 8026495)
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.

GoGoJJTech January 8th, 2014 12:41 PM

Quote:

Originally Posted by karatekid552 (Post 8026507)
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*

Le pug January 11th, 2014 6:34 PM

Quote:

Originally Posted by gogojjtech (Post 8029620)
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

Quote:

Originally Posted by Le pug (Post 8015414)
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




Deokishisu January 12th, 2014 1:22 PM

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 January 14th, 2014 2:26 PM

Quote:

Originally Posted by Le pug (Post 8034863)
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.

Chaos Rush January 19th, 2014 7:46 PM

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.
http://i1151.photobucket.com/albums/o625/ChaosRush/6_zps88cde5c2.png

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:
http://i1151.photobucket.com/albums/o625/ChaosRush/2_zpsc296bd07.png

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.
http://i1151.photobucket.com/albums/o625/ChaosRush/1_zpsfd3cb2eb.png

So we changed Pallet Town's Town Map width to 03, let's check the Town Map:
http://i1151.photobucket.com/albums/o625/ChaosRush/3_zps7363859b.png
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:
http://i1151.photobucket.com/albums/o625/ChaosRush/4_zps3b1a276c.png http://i1151.photobucket.com/albums/o625/ChaosRush/5_zps77f52a74.png

And all the way to the left:
http://i1151.photobucket.com/albums/o625/ChaosRush/6_zps88cde5c2.png http://i1151.photobucket.com/albums/o625/ChaosRush/2_zpsc296bd07.png

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.

interdpth January 19th, 2014 11:46 PM

Quote:

Originally Posted by Chaos Rush (Post 8048560)
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

DoesntKnowHowToPlay January 20th, 2014 9:16 AM

http://i.imgur.com/FVF4tzR.png

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 January 26th, 2014 8:20 PM

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:
Code:

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"
================================================================================



Spherical Ice February 1st, 2014 8:24 AM

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)

darkprince909 February 3rd, 2014 8:09 PM

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:
http://i794.photobucket.com/albums/yy221/darkprince909/grassroutine.png
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)

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.

darkprince909 February 6th, 2014 1:10 PM

Quote:

Originally Posted by Chaos Rush (Post 8048560)
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.
http://i1151.photobucket.com/albums/o625/ChaosRush/6_zps88cde5c2.png

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:
http://i1151.photobucket.com/albums/o625/ChaosRush/2_zpsc296bd07.png

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.
http://i1151.photobucket.com/albums/o625/ChaosRush/1_zpsfd3cb2eb.png

So we changed Pallet Town's Town Map width to 03, let's check the Town Map:
http://i1151.photobucket.com/albums/o625/ChaosRush/3_zps7363859b.png
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:
http://i1151.photobucket.com/albums/o625/ChaosRush/4_zps3b1a276c.png http://i1151.photobucket.com/albums/o625/ChaosRush/5_zps77f52a74.png

And all the way to the left:
http://i1151.photobucket.com/albums/o625/ChaosRush/6_zps88cde5c2.png http://i1151.photobucket.com/albums/o625/ChaosRush/2_zpsc296bd07.png

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 February 6th, 2014 1:12 PM

Quote:

Originally Posted by darkprince909 (Post 8080627)
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

Chaos Rush February 6th, 2014 8:07 PM

Quote:

Originally Posted by darkprince909 (Post 8080627)
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.

kearnseyboy6 February 7th, 2014 5:39 AM

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!

xGal February 7th, 2014 7:06 AM

The songtable format goes like this:
Code:

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 February 7th, 2014 12:22 PM

Quote:

Originally Posted by xGal (Post 8081693)
The songtable format goes like this:
Code:

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

Deokishisu February 18th, 2014 6:06 AM

Quote:

Originally Posted by DavidJCobb (Post 6862459)
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 February 18th, 2014 4:23 PM

Quote:

Originally Posted by Deokishisu (Post 8101423)
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 February 19th, 2014 10:52 AM

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:

Code:

#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)

Kawaii Shoujo Duskull February 19th, 2014 6:43 PM

Info on the scripting command "cry" here, about the effect.

Cry
0x0: normal.
0x1: normal but cut short.
0x2: higher pitch than normal.
0x3: higher pitch than normal, with a bit of echo, like pokemon on the overworld is roaring.
0x4: short reversed cry.
0x5: low cry
0x6: hard normal pitch cry, sort of like a roar.
0x7: short lower cry.
0x8: normal pitch but just a tiny bit short I think?
0x9: slightly lower than normal but not by much.
0xA: lower than the last one.
0xB: short lower.
0xC: short lower.
0xD:normal?
0xE:normal?
0xF: normal?


I just remembered I had this saved in a text file on my laptop. I'll have to re-test this though, I might have had a few of those wrong(the ones marked with ? at the end). Also gonna have to test and see if it could go past 0xF. I have a feeling that this may have something to do with certain bits being set, though I'm not too sure since I don't know about any routine behind this.
If anybody else has any info to add to this, then please do. Or if this has been covered already, let me know. ^^

Kawaii Shoujo Duskull February 20th, 2014 3:55 PM

Quote:

Originally Posted by Merak (Post 8102253)




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

Just had another thought. Using the same command and using ASM and all that, I think it could be possible to make it so that when the player walks, it plays a sound dependant on the type of tile they step onto, like in HG/SS. I don't know if its been done yet or if its been done another way or not, but I just thought it could be possible to do it using this info.

GoGoJJTech February 20th, 2014 4:26 PM

Quote:

Originally Posted by Merak (Post 8105744)


Just had another thought. Using the same command and using ASM and all that, I think it could be possible to make it so that when the player walks, it plays a sound dependant on the type of tile they step onto, like in HG/SS. I don't know if its been done yet or if its been done another way or not, but I just thought it could be possible to do it using this info.

It has been done by tile behaviors and asm, (a mix of both) but I think it'd be easy

Spherical Ice February 21st, 2014 4:56 AM

Quote:

Originally Posted by tajaros (Post 7422715)
Ok, I found this over at the pokahacking forum and it seems to be useful for legendary events! So I did not discovered this credits to Steven and Casta for some Info about this.

So ever wanted to make your game like a movie or something like that. xD Well you can you can now make something look like this.

http://desmond.imageshack.us/Himg689/scaled.php?server=689&filename=95903110.png&res=landing

So how to do it huh? Pretty easy just put this in your script.

Ruby:


Fire red:


Emerald:


Just include them in every script that you want it only goes away after a warp to another place. That's all. :D

Credits:
Steven
Casta

Warping is not necessary to reset this; for FireRed, just use

Code:

writebytetooffset 0xff 0x4000044
writebytetooffset 0x0 0x4000045


On that note, does anyone know if it is possible to reset the grayscale/sepia filters without warping?

knizz February 21st, 2014 7:04 AM

Quote:

Originally Posted by Spherical Ice (Post 8106702)
On that note, does anyone know if it is possible to reset the grayscale/sepia filters without warping?

for a full reload of palettes and blocksets call 08055148 (mapdata_load_assets_to_gpu_and_full_redraw)

if you only want to reload the palettes you can call 08059AD8 with the pointer to the mapdata-header in r0.
Code:

push {lr}
ldr r0, current_mapheader
ldr r0, [r0, #0]
bl 08059AD8
pop {pc}
.align 4
current_mapheader: .word 0x02036DFC


Code:

02036E28 = 0: normal colors
02036E28 = 1: grayscale
02036E28 = 2: sepia


(none of this was tested, can anyone confirm this?)

Spherical Ice February 21st, 2014 7:34 AM

Quote:

Originally Posted by knizz (Post 8106815)
for a full reload of palettes and blocksets call 08055148 (mapdata_load_assets_to_gpu_and_full_redraw)

if you only want to reload the palettes you can call 08059AD8 with the pointer to the mapdata-header in r0.
Code:

push {lr}
ldr r0, current_mapheader
ldr r0, [r0, #0]
bl 08059AD8
pop {pc}
.align 4
current_mapheader: .word 0x02036DFC


Code:

02036E28 = 0: normal colors
02036E28 = 1: grayscale
02036E28 = 2: sepia


(none of this was tested, can anyone confirm this?)

Hm, this still necessitates warping unless I'm doing something wrong.

knizz February 21st, 2014 7:59 AM

Quote:

Originally Posted by Spherical Ice (Post 8106846)
Hm, this still necessitates warping unless I'm doing something wrong.

Try calling 08070474 afterwards.
EDIT: calling 08055148 alone works for me.

HidoranBlaze March 5th, 2014 4:07 PM

I was able to find the battle animation background table for Emerald.
The table starts at 0x525D54 and ends at 0x525E97. The structure is the same as FireRed's. We can now have custom battle animation backgrounds for Emerald as well by repointing and expanding this table.

kearnseyboy6 March 7th, 2014 2:36 AM

in applymovement #raw 0x69 will play all the rocksmash, tree frames, its in their respective scripts so don't be fooled by the 'mov69' description.

CMooney91 March 7th, 2014 5:36 PM

Hey everybody,

Is it possible to implement a choice in the intro to pick a character? Like, instead of "Are you a boy or girl?" and you pick a gender, could it be "Are you a boy or a girl?" And then it asks you to pick one of three archetypes per say?

HidoranBlaze March 7th, 2014 5:49 PM

Quote:

Originally Posted by CMooney91 (Post 8132507)
Hey everybody,

Is it possible to implement a choice in the intro to pick a character? Like, instead of "Are you a boy or girl?" and you pick a gender, could it be "Are you a boy or a girl?" And then it asks you to pick one of three archetypes per say?

Definitely, it would require some modification to the intro ASM routine though.

CMooney91 March 7th, 2014 5:55 PM

Thanks for the reply!

Sounds like it's above my head. I'm relatively new to rom hacking. thanks though!

GOLDstandard March 8th, 2014 4:58 PM

Can anyone point me in the direction of research about breeding or the game's pokemon generation routine? I searched the forum and couldnt find anything

Kawaii Shoujo Duskull March 9th, 2014 3:55 PM

Update on my small bit of research into the "cry" command.


What is already known:
cry 0xXX 0xYY
XX = pokemon index number.
YY = effect on the cry.


The first parameter didn't need researching(obviously) so I researched the second(the cry effect).
Here's what I've found:
Cry
Code:

0x0: normal.
0x1: normal but cut short.
0x2: Higher pitch, like the pokemon is loud.
0x3: higher pitch than normal, with a bit of echo, like pokemon on the overworld is roaring.
0x4: reversed cry.
0x5: low cry like pokemon faints.
0x6: harsh normal cry, like the pokemon is roaring loudly.
0x7: short lower cry.
0x8: slightly higher than normal.
0x9: short reversed cry.
0xA: pretty much normal I think.
0xB: lower cry.
0xC: short lower cry cut slightly short.
0xD: Normal.
0xE:normal.
0xF: normal.
0x10-0xFF: assumed to all play the cry as a normal cry.


I haven't noticed anything relevant in terms of bits here, so it looks like that's all there is to it.


After doing that bit of research, I decided to take a look at the playsong command's second parameter. So far as I've found there, it does absolutely nothing. I only looked at 0x0-0xF though, so there's a lot of room for me to be proved wrong there.


That's about it for now. Hope this helps somebody. :)

destinedjagold March 19th, 2014 9:03 PM

Quote:

Originally Posted by Merak (Post 8135701)
After doing that bit of research, I decided to take a look at the playsong command's second parameter. So far as I've found there, it does absolutely nothing. I only looked at 0x0-0xF though, so there's a lot of room for me to be proved wrong there.

The playsong's second parameter does have a difference though, as far as I've noticed.
if we use 0x0, the song will no longer play after a battle.
if we use 0x1, the song will still be played after a battle.

Kawaii Shoujo Duskull March 20th, 2014 5:38 PM

Ah I see. Thanks for pointing that out, it could be pretty helpful. ^^

Chaos Rush March 26th, 2014 10:58 PM

So lately I've been studying ASM a bit and gonna try and finally get it down. I've managed to locate parts of the START menu's code simply by finding their text pointer, and then the pointer to that table of pointers, and then looking at the surrounding code in VBA's disassembler. Whenever I saw something such "mov r2, #0x8", I wondered what would happen if I had a different value load into that register. As a result, I've figured this out so far:

0x0806EF94 = X positioning of [name] in the START menu.
Change it and you can reposition [name]:
http://i.imgur.com/HWEpZe8.png

0x0806EFD0 = the font used in the START menu.
00 gives you the smaller font. Any other value doesn't seem to do anything.
http://i.imgur.com/3vhCUhy.png

0x0806EFD4 = X positioning of the text in the START menu (except [name])
The default value is 08. This is what it looks like if you change it to 00:
http://i.imgur.com/VpItE5B.png
(Changing it to FF/giving longer text strings will NOT magically make the menu box's width longer unlike the multichoice boxes that the script engine uses)

0x0806F0DE = relative X positioning of cursor in START menu
0x0806F0E0 = relative Y positioning of cursor in START menu
By positioning, I don't mean the actual selection within the start menu, I mean the actual pixel coordinates of the cursor within the start menu.

None of this info is useful yet, but eventually I would like to port Emerald's START menu look onto FireRed because I find it more aesthetically pleasing.

But that's not all I found!

At 0x083A7344 is a table that basically controls the START menu itself. The format of the table goes like this:
[XX XX XX 08][YY YY YY 08]
XX XX XX 08 = pointer to text string within START menu (such as POKéDEX, POKéMON, BAG, etc.)
YY YY YY 08 = pointer to the routine of aforementioned function. Yes, I'm serious. You can literally switch around your START menu like this:
http://i.imgur.com/1ci5ayY.png
Notice how POKéMON is in the first slot like in B/W/B2/W2/X/Y, not POKéDEX like in Gens I-IV. And no, I did not just switch the text string pointer, I switched around the function pointers too. Don't believe me? Try it yourself! It's fun!

Here's the table at 0x083A7344 in detail:
41627D = POKéDEX text string
06F411 = POKéDEX routine (+1)

415A66 = POKéMON text string
06F44D = POKéMON routine (+1)

416285 = BAG text string
06F481 = BAG routine (+1)

41628E = [name] text string
06F4B5 = Trainer Card routine (+1)

416291 = SAVE text string
06F4E9 = SAVE routine (+1)

416296 = OPTION text string
06F4FD = OPTION routine (+1)

41629D = EXIT text string
06F541 = EXIT routine (+1)

4162A2 = RETIRE text string (Safari Zone)
06F555 = RETIRE routine(+1)

41628E = [name] text string
06F56D = ??? (+1) (fadescreen then freezes the game, I'm assuming its for the alternate Trainer Card shown during Link Battles/Trades)

Unfortunately I haven't been able to find what dictates how many entries the START menu gets, but hopefully with this knowledge, it will be a lot easier to implement something like the a PokéGear onto FireRed. Not to mention that these offsets are the actual routines used for the Pokédex, party screen, bag, Trainer Card, Save menu, and Options. I'm not joking lol, if you literally put this in a script:
Code:

//---------------
#dynamic 0x800000
#org @main
callasm 0x806F411 //this is the Pokédex routine offset from the START menu table
end


It will open up the Pokédex. You can literally use callasm and use any of the offsets from the table and it will load up that function!

So say, you wrote a custom PokéGear code. You can edit one of the function pointers in the table to your new code and voila, you'll have a PokéGear within your START menu. Of course, what would be more ideal is if we could figure out how to expand the number of entries the START menu gets. I'm sure it wouldn't be that hard, the thing is that I have no idea how to find the routine that the game uses when you actually press the START button.

Whatshouldyoucallme March 27th, 2014 12:15 AM

Nice find Chaos Rush!
Really fun to switch it, but note that the flag to active the Menu will be different.
~Original~
setflag 0x828 - Activates Pokemon Menu
setflag 0x829 - Activates Pokedex Menu

~Switched(Pokedex and Pokemon Menu)~
setflag 0x829 - Activates Pokemon Menu
setflag 0x828 - Activates Pokedex Menu
(If we doesn't change that will cause Oak give you pokedex when you choose a pokemon :D)

GoGoJJTech April 4th, 2014 6:48 AM

nop the 8 bytes at 080484 to make trainerbattle 0x9 not have oak's text
found by knizz

Whatshouldyoucallme April 6th, 2014 10:44 PM

I personally thought that block editing with A-map one-by-one was not a clever way.
Esspecially when we trying to redo the whole tileset.

When using block editor in A-map, the [offset:]slot will show the block offset when your mouse move on any block.
Go to hex editor and go to that offset(I use grass as example)and you will see something like this:

6E 02 6F 02 4C 02 4D 02 00 00 00 00 00 00 00 00

Copy and paste this code to the next offset and save.
Go back to A-map, now you will see the next block after the grass will become grass.

The code is actually how tile arranged on the block,

6E02 6F02
4C02 4D02

6E 02-> 02 6E which will be the tile no. 26E
6F 02-> 02 6F which will be the tile no. 26F
4C 02-> 02 4C which will be the tile no. 24C
4D 02-> 02 4D which will be the tile no. 24D

And changing the 0 to something else not higher than 12(C IN HEX) will change the pallete of that tile.

ThomasWinwood April 12th, 2014 2:39 AM

Quote:

Originally Posted by JPAN (Post 6078341)
I found something that bugs a lot of people, the fact HM moves cannot be deleted, can be easily erased on Fire Red.

I found the Emerald equivalents of the routines detailed in this post from earlier in the thread at 0x6E7CC and 0x1B6D14 respectively. It's not too difficult to extrapolate from there to the changes to disable HMs being undeletable.

Shiny Quagsire April 12th, 2014 12:28 PM

You can change the color filter used by flashbacks by changing the byte at 080572B0 to something else. So if sepia flashbacks are your thing then you can change it to 02, or alternatively you can have color flashbacks with 00.

EDIT: Apparently there's another address, 08057274, that needs tweaking as well. Same procedure, just different address.

sp13 April 13th, 2014 6:05 AM

Just a quick little thing I just discovered about music editing with Sappy. Not sure if this has been covered before (probably), but felt like posting it in case anyone else ran into the same problem.

If you have a .s file where one or more of the tracks sounds all "wavy" (not quite sure how to describe it, but where the notes bend all the time instead of just playing normally), here's how to fix it:

- look at the track details of each track of your song in Sappy
- if the last number (should be an indigo color in sappy 2006) is anything other than 0, that is what is causing the bending
- open the .s file in notepad and navigate to the data for that track
- at the beginning of the track's data, you should see things like VOICE, VOL, PAN, etc.
- the one that controls the bending is MOD
- simply remove the line with the MOD byte and save the .s file

That removes the weird bending.

Not sure if this is even news but hope this helps someone. :P

Wobbu April 13th, 2014 6:14 AM

Quote:

Originally Posted by sp13 (Post 8196346)
Just a quick little thing I just discovered about music editing with Sappy. Not sure if this has been covered before (probably), but felt like posting it in case anyone else ran into the same problem.

If you have a .s file where one or more of the tracks sounds all "wavy" (not quite sure how to describe it, but where the notes bend all the time instead of just playing normally), here's how to fix it:

- look at the track details of each track of your song in Sappy
- if the last number (should be an indigo color in sappy 2006) is anything other than 0, that is what is causing the bending
- open the .s file in notepad and navigate to the data for that track
- at the beginning of the track's data, you should see things like VOICE, VOL, PAN, etc.
- the one that controls the bending is MOD
- simply remove the line with the MOD byte and save the .s file

That removes the weird bending.

Not sure if this is even news but hope this helps someone. :P

You can also remove modulations from the actual midi with Anvil Studio's event editor. If you do it that way, the modulations won't appear again in case you have to remake your S file. But S files are useful for finding how many modulations are in each track if you use notepad and the search feature :D

sp13 April 13th, 2014 6:32 AM

Quote:

Originally Posted by Wobbu (Post 8196354)
You can also remove modulations from the actual midi with Anvil Studio's event editor. If you do it that way, the modulations won't appear again in case you have to remake your S file. But S files are useful for finding how many modulations are in each track if you use notepad and the search feature :D

Doing it straight from Anvil sounds really handy! I didn't think to do that because I could never actually hear the modulations when listening through Anvil, only when opening in Sappy.

GoGoJJTech April 13th, 2014 6:59 AM

Quote:

Originally Posted by sp13 (Post 8196370)
Doing it straight from Anvil sounds really handy! I didn't think to do that because I could never actually hear the modulations when listening through Anvil, only when opening in Sappy.

The mod command is quite necessary for most DS songs. Know why? It controls the way the instrument goes from one speaker to the next. To correct it type modt, 12 right under the mod command. Or you can use ipatix' tool MIDFIXforAGB.exe, which does this for you. My mega huge sappy tutorial covers this :D

ThomasWinwood April 17th, 2014 9:20 AM

The Pickup table in Emerald is at 0x31C440. It consists of two lists of values, the first for common items, the second for rare items starting at 0x31C464.

e: The Pickup routine is at 0x55C00, and the move command table is at 0x31BD10. There seem to be quite a few blocks in that region of pointer tables followed by data used by the routines they point to.

dagid44 May 4th, 2014 3:42 AM

Hi I'm beginner,

I'm trying to understand how is all data about mapping stored. I found this article, which explain some structure of data.

Code:

datacrystal.romhacking.net/wiki/Pok%C3%A9mon_3rd_Generation


But it is uncompleted, it is missing information about block structure, animation structure, etc... Is there any better research/document ? I can't found any.

Thank you for your help.

vizor May 4th, 2014 7:50 AM

Hey there, i need the offset of the generateOAM function + its parameter.

Shiny Quagsire May 4th, 2014 2:02 PM

Quote:

Originally Posted by vizor (Post 8230813)
Hey there, i need the offset of the generateOAM function + its parameter.

The function is located at 08006F8C in Fire Red. I have it formatted as such in my personal .h I've used:
Code:

u32 createSprite(int *template, int *XPos, int *YPos, int *i)


Arguments are pretty self explanatory, except template and i. Template is basically the unit as described here under object_template, and all you need is the proper formatting to get it going. i is usually left at 0 and I haven't actually checked to see what it is. I believe it might have to do with it's priority over other sprites.

vizor May 4th, 2014 8:56 PM

Thank you for your help.

I'm a German, and i don't know for sure wether i understood the template. Is this simply a pointer to the oam's animation data? And what if the object has'nt any animation. Will the obj disappear after displaying all frames listed in the template?

And in what registers i have to transfer ( i don't know how to say this, sorry) each param?

- Viz0r

Shiny Quagsire May 4th, 2014 9:25 PM

Quote:

Originally Posted by vizor (Post 8231780)
Thank you for your help.

I'm a German, and i don't know for sure wether i understood the template. Is this simply a pointer to the oam's animation data? And what if the object has'nt any animation. Will the obj disappear after displaying all frames listed in the template?

And in what registers i have to transfer ( i don't know how to say this, sorry) each param?

- Viz0r

It's a tad bit complicated, and I haven't actually done this in ASM before so I could be wrong. Basically though, the first four arguments of the function correspond to r0-r3 respectively. As for the template, if you can understand C I'd suggest taking a look at some example coding here where I created a obj_template as a struct along with all the data needed for it. The first two word values (each are two bytes) are usually 2 and 1 based on existing templates in the ROM. Then you have a pointer to the basic OAM data you'd find in the GBA's OAM memory. The rest of it I usually keep to the values 0, 0x08231CFC, 0x080EE4DD, and 0xFF simply because that's what has always worked for me. The animation table is fairly straightforward. You have two bytes for the tile number and two for the duration. 0xFFFF ends the animation and usually removes the sprite, and 0xFFFE will loop it forever.

Let me know if you have any questions, and feel free to browse around some of my C code where I use these functions quite a bit. If you're good with C it might make a bit more sense for you, but otherwise I'd suggest reading up in knizz's research thread.

vizor May 5th, 2014 3:34 AM

Isnt there any way creating OAM without using a entry in the template table? i mean the Overworlds are sureley not genereted due to this table, arent they?

Shiny Quagsire May 5th, 2014 8:05 PM

Quote:

Originally Posted by vizor (Post 8232086)
Isnt there any way creating OAM without using a entry in the template table? i mean the Overworlds are sureley not genereted due to this table, arent they?

NPCs are actually a lot more complicated due to their dynamic nature and interactability in the game. They have a lot of traits which makes them a tiny bit difficult to add in through ASM (I have yet to do it myself to be honest). And yes, every single OAM in the game is made using this method. While it seems difficult now, once it's created it's all downhill. GameFreak has methods for easily moving, scaling, rotating, and deleting these OAMs, which makes things much easier in the long run as opposed to making a GBA OAM.

Mana May 7th, 2014 7:46 AM

Possibly odd question, has anyone ever looked into/seen any research into removing the pokedex? Mainly, the pop-up when you catch a new pokemon?

I imagine it would take some hardwiring, since it's not something scripting could deal with - unless the sequence can be repointed/reorganised in hex I'm guessing it's an ASM job?

vizor May 8th, 2014 6:03 AM

It defenity is an ASM job, but it shouldn't be too hard, since there is some kind of switch case for the battle, which leads to certain parts that can be displayed during the battle (such as send new poke, attack and so on). There could be one entry that leads to the pokedex_information. You could simply change the pointer to another function, but there definitly is research needed.

Another question. I was reseraching an function, which updates all stats given on a pokemon, like the stat level, which is based on the ep, or the stat attack, wich is based on the baseATk, level, IV and EV.
To reach this aim i did a lot on reasearch at picking a pokemon from your box, because there a lot of data is cacluated, but i found not very much. All i got is (for a german firered)

sub_func at 0x08093078 (r0:int8 a, r1:int8 b) a = box ID, b = box nr. Pokemon is taken, if box ID = 0xe there is an exeption

/* takes pokemon from box, buffers its data into malloced RAM

has anybody ever found a fucntion that updates and recalcutes pokemon stats? because i want to make a species change, but the stats are not updating imideatly.

daniilS May 8th, 2014 7:02 AM

Quote:

Originally Posted by vizor (Post 8237887)
It defenity is an ASM job, but it shouldn't be too hard, since there is some kind of switch case for the battle, which leads to certain parts that can be displayed during the battle (such as send new poke, attack and so on). There could be one entry that leads to the pokedex_information. You could simply change the pointer to another function, but there definitly is research needed.

Another question. I was reseraching an function, which updates all stats given on a pokemon, like the stat level, which is based on the ep, or the stat attack, wich is based on the baseATk, level, IV and EV.
To reach this aim i did a lot on reasearch at picking a pokemon from your box, because there a lot of data is cacluated, but i found not very much. All i got is (for a german firered)

sub_func at 0x08093078 (r0:int8 a, r1:int8 b) a = box ID, b = box nr. Pokemon is taken, if box ID = 0xe there is an exeption

/* takes pokemon from box, buffers its data into malloced RAM

has anybody ever found a fucntion that updates and recalcutes pokemon stats? because i want to make a species change, but the stats are not updating imideatly.

I've got an offset somewhere, will send it later today.

vizor May 8th, 2014 7:28 AM

I already found one. Its located at SUB_0x0803E674 in Fire Red German.

You have to permitt: r0, int32: source of basicData(0x50 bytes) ;; r1, int32: destination of calcuated data (0x64 Bytes)

slawter666 May 8th, 2014 11:11 PM

Is it possible for an overworld to use two palettes? I've been thinking about the idea of hacking the bike routine for ridable pokemon (Page 16 of this thread) and the pokemon and hero would need seperate palettes for the sprite to look good.

Jambo51 May 9th, 2014 8:48 AM

Quote:

Originally Posted by slawter666 (Post 8239853)
Is it possible for an overworld to use two palettes? I've been thinking about the idea of hacking the bike routine for ridable pokemon (Page 16 of this thread) and the pokemon and hero would need seperate palettes for the sprite to look good.

Without significant hacking of the game, no. The GBA is technically able to support such a sprite, but you would need to have intimate knowledge of the OAM system and how the palettes can be used in such a manner.

Basically, no, you can't do it.

vizor May 10th, 2014 10:39 AM

It definitley is possible, since any object of the OAM can use all 16 OAM-Palettes, if it is in 256 Col Mode.
BUT: you have to make the game set the bike Sprite to this mode,
you have to custom the palettes the way, that the sprite can use all 256 by not destroying other sprites

It definitley is possible, but no one would do this kind of job just for an simple object, since it would probably ♥♥♥♥ up with all other objects...
Just use an 16 colors palette, its way easier

Here is a quatation from GBATEK, if you intend to hack the OAM-system

Quote:

OBJ Attribute 0 (R/W)
Bit Expl. 0-7 Y-Coordinate (0-255) 8 Rotation/Scaling Flag (0=Off, 1=On) When Rotation/Scaling used (Attribute 0, bit 8 set): 9 Double-Size Flag (0=Normal, 1=Double) When Rotation/Scaling not used (Attribute 0, bit 8 cleared): 9 OBJ Disable (0=Normal, 1=Not displayed) 10-11 OBJ Mode (0=Normal, 1=Semi-Transparent, 2=OBJ Window, 3=Prohibited) 12 OBJ Mosaic (0=Off, 1=On) 13 Colors/Palettes (0=16/16, 1=256/1) 14-15 OBJ Shape (0=Square,1=Horizontal,2=Vertical,3=Prohibited) Caution: A very large OBJ (of 128 pixels vertically, ie. a 64 pixels OBJ in a Double Size area) located at Y>128 will be treated as at Y>-128, the OBJ is then displayed parts offscreen at the TOP of the display, it is then NOT displayed at the bottom.

slawter666 May 10th, 2014 11:56 AM

Quote:

Originally Posted by vizor (Post 8243045)
It definitley is possible, since any object of the OAM can use all 16 OAM-Palettes, if it is in 256 Col Mode.
BUT: you have to make the game set the bike Sprite to this mode,
you have to custom the palettes the way, that the sprite can use all 256 by not destroying other sprites

It definitley is possible, but no one would do this kind of job just for an simple object, since it would probably ♥♥♥♥ up with all other objects...
Just use an 16 colors palette, its way easier

Here is a quatation from GBATEK, if you intend to hack the OAM-system

What classifies as an OAM-palette? Because if it's just overworlds it would be easy enough to make it so each map only has a maximum of 14 overworlds with different palettes (leaving one for the player and one for the bike-pokemon).

EDIT: A workaround could be when the bike is selected create an overworld of the pokemon on the same spot that mimics the players movements. From the players point of view this would be exactly the same as if it is one object.

Jambo51 May 11th, 2014 5:46 AM

Quote:

Originally Posted by slawter666 (Post 8243207)
What classifies as an OAM-palette? Because if it's just overworlds it would be easy enough to make it so each map only has a maximum of 14 overworlds with different palettes (leaving one for the player and one for the bike-pokemon).

EDIT: A workaround could be when the bike is selected create an overworld of the pokemon on the same spot that mimics the players movements. From the players point of view this would be exactly the same as if it is one object.

You're not getting it, sadly. While it IS possible to do, and in fact should be fairly simple from a coding standpoint, it's not something that can feasibly achieved as a hack to an existing game.

The GBA renders objects on a per object basis. Meaning that data for one object can be interpreted differently to another. You could feasibly store the bike sprite as an 8bpp image and then tell the GBA (using the OAM data) to interpret it as such, while leaving all other images in their native 4bpp format and having no ill effects.

The trick to this is that doing so as a hack is a lot harder than you would initially think, especially as you'd have to do it as a hook into the existing sprite object code for the bike.

I wasn't ever saying it wasn't physically possible, simply trying to get it across to you that it's not really feasible as a hack within the Game Freak developed system, since that system relies on the sprites being in 4bpp format.

Derlo May 11th, 2014 10:09 AM

Anyone know if it is possible to import the system of double battles in Emerald for the FR?
When we are in range of vision of two different NPCs, and get a Double Battle, and when standing in reach of only one, a normal battle.

vizor May 12th, 2014 5:42 AM

I used a german Firered Rom. Maybe my offsets are incorrect, but i dont think so, since reseraching was very easy...

.equ generate, 0x08006F0D
.equ OAM_thingy, 0x08231BCC
.equ callback, 0x08EE9ED
.equ buffer, 0x0202063C

i made the template dynamic, so i could use it for several objects. i placed it at a malloced offset, so its save to use. then i called the generate_sub func (sub_08A5007C does this at my rom), and transfered the right params. however my game freezes, after some time, and its not due to may code, since it is executed completley and corretcley and it also correctly returns to the scripthandler.

here is a screenshot of the point in my code, in which i spawn the OAM.

http://www.directupload.net/file/d/3621/aw7kvpan_png.htm

Deokishisu May 12th, 2014 9:18 PM

Wouldn't it be easier to piggyback on the code that handles the surfing sprite? I mean, the player and the blob Pokemon that is surfed on are two different images. If you want riding Pokemon, I feel like it would be much easier to start there. See if the surfing blob sprite can use a different palette than the player.

Nerketur May 12th, 2014 11:41 PM

A small bit of reasearch into the .bpc files in the PMD era of games leads to an interesting result. This is too small for a thread of its own, and I might not look at it past this, but I figured someone may be able to use it as a starting point or point me towards a tool that can already do this.

first byte is offset to first image data portion
Code:

0x0000:length of header (word)


Header:
Code:

0x0002: offset to next group/image?
0x04: ??


Image data section (relative offsets):
Code:

0x00: length of data-1 (Byte)
0xlength: what to do to the next section (byte)
    CA: (Unsure)
    CB: rows of 8px laid out normally, left to right, top to bottom
    CE: Rows are laid out from the end to beginning, right to left, bottom to top
    CF: (Unsure)


Aaaand that's all I know so far. But it's still a good insight. In case anyone else wants to explore it. I found this almost completely by accident, and I was so very excited to have even gotten that far. Best of luck to the person that finishes the job =D

GoGoJJTech May 13th, 2014 2:25 AM

Quote:

Originally Posted by Deokishisu (Post 8247906)
Wouldn't it be easier to piggyback on the code that handles the surfing sprite? I mean, the player and the blob Pokemon that is surfed on are two different images. If you want riding Pokemon, I feel like it would be much easier to start there. See if the surfing blob sprite can use a different palette than the player.

No, since the surf sprite also uses the player's palette.

SBird May 13th, 2014 1:38 PM

I just came over an somehow interesting problem(at least one I have no solution for by now, I actually thought that was kind of easy)

I am basically looking for a routine that updates the palettes of a map, so the BG palettes and the OAM palettes. It does'nt have to update the tiles, but I don't care if it does (As long as this does not produce lagg, slowdowns or visual shinanigance since I would have to call those routines during the players movement)

What I already found is a routine that is sort of a soft_reset, it does not update the sprites though and it ignores rain, so if its currently raining and the routine is called, the screen is lit up. Basically such a thing has to exist because this is what happens when the player enters a warp or leaves the menu, but I wasn't able to find it.

Maybe someone had already had more luck than me :D

Oh btw. I am working on pokémon emerald (german) but if anyone has a routine offset that works for FRE I'll be happy as well because it's not too complicated to port such an offset since the games basically had the same base code which is firered.

~SBird

Spherical Ice May 17th, 2014 10:40 PM

I'm not sure if I'm allowed to do this, but to prevent this info from getting lost I'm going to quote colcolstyles from here: http://www.pokecommunity.com/showpost.php?p=6360629&postcount=17122

Quote:

Originally Posted by colcolstyles (Post 6360629)
Here are some of my findings:

Code:

0x1A654B : executed after battle fades, before "scurried home/to PC" text

0x16a2cb : viridian city 'sethealingplace' script (type 3)
0x1bc05c : 'special 0x182' script (type 5)

0x1A8DD8 : home script (mother heals your team)
0x1a8d97 : PokeCenter Script (Nurse Joy heals your team)


Basically this is what happens: after the battles fades, the game runs the script at 0x1A654B. Before the "player scurried to such and such place" text is displayed, the level scripts (types 3 & 5) are executed for the target map (there are none for the player's house). After the text is printed and the player presses A, the game fades back in to the player's new location and one of those two scripts is executed. As for which tile the player gets warped to, I'll have to do further research.

Again, I didn't discover this but I think it needs to be reposted because it took me quite some time to find it.

daniilS May 19th, 2014 12:48 PM

Has anybody got any info on link functionality in FireRed? What I'm looking for specifically is how multi/tag battles work and how the other player's data is transfered.

Spherical Ice May 26th, 2014 5:51 AM

textcolor 0xFF reverts the text colour to the default colour for the person event's gender. This is information from DavidJCobb's repository on each of the commands in FireRed. He has since abandoned this, but in an effort to revive it and continue the documentation, I have hosted this repository with some revisions: http://www.sphericalice.co/romhacking/davidjcobb_script/

If you have any contributions you wish to add to this, please do share them either here, by PM/VMing, or by e-mailing me, and I'll add it to that repository. Hopefully we can expand it!

kearnseyboy6 May 27th, 2014 5:14 AM

If you want to change a text box permanently navigate to 0x160450. There are pointer to textbox type 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 etc.

Yes you can use XSE to decompile these scripts and feel free to add in anything you may desire.... permanently!

So you won't have to call the transparency asm in every script you want, it does it automatically.

GoGoJJTech May 27th, 2014 12:52 PM

If you want a-map 1.92 to have support for new pokemon in the wild then follow these directions:
http://pastebin.com/13djBRnT
Originally found by Baitot :D

SBird May 29th, 2014 6:00 AM

Quote:

Originally Posted by GoGoJJTech (Post 8271873)
If you want a-map 1.92 to have support for new pokemon in the wild then follow these directions:
http://pastebin.com/13djBRnT
Originally found by Baitot :D

This is indeed interesting, but it would be even more interesting if you used AM1.95, due to the fact that 1.92 is again unable to cope with 32MB romspace :T

~SBird

GoGoJJTech May 29th, 2014 8:50 AM

Quote:

Originally Posted by SBird (Post 8274396)
This is indeed interesting, but it would be even more interesting if you used AM1.95, due to the fact that 1.92 is again unable to cope with 32MB romspace :T

~SBird

Well although 1.95 does do that, it isn't stable. http://www.pokecommunity.com/showpost.php?p=7781039&postcount=304
The only 100% bug-free function in 1.95 is the block editor. Otherwise it'll corrupt your ROM slowly. This isn't good for Emerald hackers (you) who want extra space :P
Hence why most successful bug-free hacks use 1.92 instead.

Kakarot1212 May 31st, 2014 8:36 AM

Quote:

Originally Posted by GoGoJJTech (Post 8271873)
If you want a-map 1.92 to have support for new pokemon in the wild then follow these directions:
http://pastebin.com/13djBRnT
Originally found by Baitot :D

Excuse me, is the "9C 01" the hex equivalent of numbers of pokemon?
Cause if you convert it, it would be "156 1" in numerical form.
Would you care to explain? :)

GoGoJJTech May 31st, 2014 8:37 AM

Quote:

Originally Posted by Kakarot1212 (Post 8278229)
Excuse me, is the "9C 01" the hex equivalent of numbers of pokemon?
Cause if you convert it, it would be "156 1" in numerical form.
Would you care to explain? :)

9C 01 = 01 9C = 019C = 19C = 412

Mana May 31st, 2014 8:59 AM

Does anyone have any idea where the 'flash' animation/script/asm routine/special/whatever it is can be found, or how to mimic it? I've scoured around everywhere I can think of, the lack of actual messages when executing flash is preventing me hex-searching the normal way. Anyone know anything?

Le pug May 31st, 2014 1:56 PM

Quote:

Originally Posted by Magic (Post 8278282)
Does anyone have any idea where the 'flash' animation/script/asm routine/special/whatever it is can be found, or how to mimic it? I've scoured around everywhere I can think of, the lack of actual messages when executing flash is preventing me hex-searching the normal way. Anyone know anything?

For emerald, you can use the commands lighten and darken and then just set how much you want to be shown. Or if you want a quick flash effect, you can use special 0x13F.

---------------

For anyone who wants to change the preset names that pop up if you leave the naming spots blank and just press enter, I have all the names and their locations in the following spoiler. I also included the intro texts in order by using numbers. Just add it to your A-Text ini if you want to see them in that program but I recommend not using a-text for anything else besides finding texts!

Spoiler:
1=2C897B
2=2C89FB
3=2C8A1F
4=2C8BD0
5=2C8BDD
Boy=30FDF7
Girl=30FF0A
6=2C8BFF
Your Name?=5EEABE
Brett=5E85D8
Collin=5E85FD
Terry=315AFC
Casey=5E85E9
Johnny=5E85D1
Reid=5E85AD
Kenny=5E85A7
Quincy=3132D4
Stu=5E8598
Teru=5E85CC
Tom=5E85A3
Landon=5E85F6
Walker=5E85C5
Tiara=5E8619
Lillie=5E867A
Halie=5E868C
Terra=5E8681
Kimmy=5E8613
Tanja=5E8666
Lucy=5E8687
Hazel=5E8659
Allie=5E862B
Nadine=5E865F
Camila=5E8644
Sara=5E8638
Bella=5E861F
Jayla=5E8625
Nicola=5E8673
Lianna=5E8631
Monica=5E863D
Aubree=5E864B
Ruthie=5E8652
Yasmin=5E866C
Jaxson=5E85B7
Jude=5E85B2
Darren=5E85EF
Seth=5E85DE
Milton=5E859C
Stanley=5E8604
Easton=5E85BE
7=2C8C1C
8=2C8C2A
9=2C8C7A

Danny0317 May 31st, 2014 1:58 PM

Lighten works on fire red, too. Not sure about darken though.

Spherical Ice June 8th, 2014 4:25 AM

http://i.imgur.com/d8osqZx.png

The Unknown value for Person events below the Pos (X/Y) field appears to control the altitude of the Person event.

Here's what happens in-game when the Unknown value is set to 0 or 3 on a bridge:

http://i.imgur.com/yHEiFeK.gif
(Excuse the speed of the .gifs, Photoshop refuses to import anything higher than 500 frames so I had to double the FPS)

This is unideal if you want this NPC to be on top of the bridge, and not below it. However, setting the Unknown byte to 4 results in this:

http://i.imgur.com/jBBxrxL.gif

You cannot interact with Person events which are on a different layer to that of the player; this includes stepping in the view radius of a Trainer on a different altitude (in that, the battle will not activate).

For clarification, this is how the bridge's movement permissions are laid out:

http://i.imgur.com/4MVFGfP.png

The following values for this Unknown byte lowers the Person event to the corresponding layer (where the layer # is the movement permission number).
Code:

0 - Appears to be Layer C.
1 - Layer 4 (Surfing)
2 - Layer 8 (???)
3 - Layer C (Regular ground)
4 - Layer 10 (appears to work for all layers above this, too (Layer 14, Layer 18, etc.))


If the ground is on layer C, for example, and the Person event has the Unknown value set to 1, for example, the Person event will not display. This could make hiding Person events far easier and flag-efficient, as you could just simply set their altitude to be lower than C, and then make them show with the spritelevelup command (I haven't actually tested that, but it should work, in theory).

It would be safe to assume that the other Unknown values for warps and script events are also this, as they are set to 3 in most cases in vanilla FireRed, too.

esperance June 12th, 2014 10:14 AM

Quote:

Originally Posted by GoGoJJTech (Post 8271873)
If you want a-map 1.92 to have support for new pokemon in the wild then follow these directions:
http://pastebin.com/13djBRnT
Originally found by Baitot :D

First, I wanna start by saying this does work.

But, you need to use the Advanced Map provided by this link, which should be 1,231 KB.
Mine was 426 KB, and didn't work for this method.

GoGoJJTech June 12th, 2014 11:31 AM

Quote:

Originally Posted by itari (Post 8297683)
First, I wanna start by saying this does work.

But, you need to use the Advanced Map provided by this link, which should be 1,231 KB.
Mine was 426 KB, and didn't work for this method.

Yes, that is the point of me linking the advanced map and saying to download this advanced map
:D

ShyGuy25 June 18th, 2014 11:37 PM

What part of the script do I need to remove/add to make Fire Red move tutors reusable? I've seen that Pokémon Glazed managed to do it but because of its expanded size I couldn't open it up and see how it was done.

DoesntKnowHowToPlay June 19th, 2014 7:39 PM

http://i.imgur.com/Ns7oosj.pnghttp://i.imgur.com/82vkSCw.png

XY added a feature that gives experience points when you catch pokemon. To duplicate this in FR, do the following:

Repoint the battle script at x1d9a42 to point to this:

2A 00 68 3D 02 02 05 00 50 9A 1D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0F 01 3A 2E 82 3E 02 02 00 F2 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

where XX XX XX XX is a pointer to:

2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

To let the player's mons evolve from this experience, replace the bytes at x15A68 with A1 5A 01 08.

Edit: Changed the scripts, I assumed they cut off earlier than they actually did. Should work with full party+no nickname now.

Logan June 20th, 2014 12:13 AM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8308957)
http://i.imgur.com/Ns7oosj.pnghttp://i.imgur.com/82vkSCw.png

XY added a feature that gives experience points when you catch pokemon. To duplicate this in FR, do the following:

Repoint the battle script at x1d9a42 to point to this:

2A 00 68 3D 02 02 05 00 50 9A 1D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0F 01 3A 2E 82 3E 02 02 00 F2 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08

where XX XX XX XX is a pointer to:

2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08

To let the player's mons evolve from this experience, replace the bytes at x15A68 with A1 5A 01 08.

Ahhhh I've been trying to pinpoint how to do this for a few weeks. I finally thought I was getting somewhere but I've been well and truly beaten here. Great find though and a wonderful advancement for ROM Hacking :).

Chaos Rush June 20th, 2014 12:30 PM

http://i.imgur.com/hgIR3F3.pnghttp://i.imgur.com/SGbwSqm.png

XY added a feature that gives experience points when you catch pokemon. To duplicate this in Emerald, do the following:

Repoint the battle script at x2dbd84 to point to this:

2A 00 08 42 02 02 05 00 92 BD 2D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0F 01 3A 2E 32 43 02 02 00 F2 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

where XX XX XX XX is a pointer to:

2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

To let the player's mons evolve from this experience, replace the bytes at x3DE7C with B5 DE 03 08.

credit obviously goes to DoesntKnowHowToPlay for doing this first on FireRed lol

EDIT: So apparently, as discovered by Tlachtli, if you level up from experience while catching a Pokémon that hasn't yet been recorded to the Pokédex, then the Pokédex screen will have the text displayed in the wrong X-position offset. I'll look into it eventually

lsmash June 20th, 2014 5:29 PM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8308957)
http://i.imgur.com/Ns7oosj.pnghttp://i.imgur.com/82vkSCw.png

XY added a feature that gives experience points when you catch pokemon. To duplicate this in FR, do the following:

Repoint the battle script at x1d9a42 to point to this:

2A 00 68 3D 02 02 05 00 50 9A 1D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0F 01 3A 2E 82 3E 02 02 00 F2 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

where XX XX XX XX is a pointer to:

2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

To let the player's mons evolve from this experience, replace the bytes at x15A68 with A1 5A 01 08.

Edit: Changed the scripts, I assumed they cut off earlier than they actually did. Should work with full party+no nickname now.

Would you mind telling me how you fixed the music that plays after you captured a pokemon?
I made the same feature (though differently: I didn't need to replace the bytes at x15A68), which is almost flawless, if not for the music: it plays the captured pokemon jingle, then the receive exp jingle.
You can check it here: http://pokemonhackersonline.com/showthread.php?t=14839-FR-Pokemons-receive-EXP-after-capturing

DoesntKnowHowToPlay June 20th, 2014 5:58 PM

I did a sneaky little trick- the script zeroes out the HP of the active pokemon's battle struct. The game then assumes that you died from Explosion and doesn't give experience to the active pokemon, which is what starts the music- however, it nonetheless proceeds to hand it out to the rest of the party, which includes the active pokemon as it wasn't flagged as getting its share earlier.

lsmash June 21st, 2014 8:33 AM

I combined my work with the one from Doesnt. As a result, there are less bytes to write into freespace.
So, here's what to do to give exp points when you catch a pokemon:
1-The bytes to put into freespace: 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 F1 63 9A 1D 08 28 58 9A 1D 08

2-The bytes to replace at 1D9A53: 41 XX XX XX 08 (XX = pointer to the code above).

3-Just like Doesnt wrote earlier, replace the bytes at 15A68 with A1 5A 01 08.

It should work without problems, as I tested it before posting.

Thanks to Doesnt for telling me how to fix a music issue.

STikER June 21st, 2014 11:51 AM

I want to create custom regional Pokedex in FireRed (not simplify expanding Kanto Dex, but creating a new one). But what with that Second Dex order? I mean, in PGE's ini, there is Second Dex Table offset for BPRE (and all others). In PGE's Pokedex Order Editor there are two orders: first is National, and second (named ????????? there) is Hoenn, because first Pokemon is Treecko and 202th is Deoxys. Are there any ways to replace Kanto Dex with this order?

RichterSnipes June 21st, 2014 6:41 PM

Quote:

Originally Posted by ShyGuy25 (Post 8307700)
What part of the script do I need to remove/add to make Fire Red move tutors reusable? I've seen that Pokémon Glazed managed to do it but because of its expanded size I couldn't open it up and see how it was done.

Each move tutor will check to see if a specific flag has been set or not before asking the player if he/she wants to teach a Pokémon a certain move. The script for the Mega Punch tutor on Route 4, for instance, will check to see if flag 0x2C4 has been set. That flag will only be set once the move has been taught. Removing those flag checks/sets will allow you to reuse them endlessly.

It's a bit more complicated for the elemental Hyper Beam move tutor, as that involves the use of a special to see if you have the right Pokémon with the right credentials and which of the moves have been already taught. It's a similar concept, though.

Shufflejoy June 26th, 2014 8:07 PM

Quote:

Originally Posted by Chaos Rush (Post 8309821)
http://i.imgur.com/hgIR3F3.pnghttp://i.imgur.com/SGbwSqm.png

XY added a feature that gives experience points when you catch pokemon. To duplicate this in Emerald, do the following:

Repoint the battle script at x2dbd84 to point to this:

2A 00 08 42 02 02 05 00 92 BD 2D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0F 01 3A 2E 32 43 02 02 00 F2 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

where XX XX XX XX is a pointer to:

2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

To let the player's mons evolve from this experience, replace the bytes at x3DE7C with B5 DE 03 08.

credit obviously goes to DoesntKnowHowToPlay for doing this first on FireRed lol

I'm having a problem with this and I'm unsure of how to fix it. Here's the relevant battle script, and the pointer I entered into it.

https://dl.dropbox.com/s/54z7q2zjnc5eqiw/Capture.PNG

I've also tried formatting the pointer as 60C0EC08, 08ECC061, and 08ECC060. No changes, except for more oddities when I had formatted the pointers differently.

1. If the thrown Pokeball fails, my game freezes.
2. When the Pokemon is caught, Torchic does gain experience, but after the Pokedex information screen, I'm taken to a party select window, with the battle victory music still playing in the background. Torchic is the only Pokemon in the party, and I am unable to exit the window.

At xECC060, I've pasted the second string of bytes exactly as you've posted:

https://dl.dropboxusercontent.com/s/5f3bk2ie0uj5ath/Capture2.PNG

I have also tried omitting the bytes at x3DE7C, with no change.

If anyone could help me figure out what I have done wrong, I'd really appreciate it.

jirachiwishmaker June 26th, 2014 8:57 PM

3 Attachment(s)
Quote:

Originally Posted by Shufflejoy (Post 8319450)
I'm having a problem with this and I'm unsure of how to fix it. Here's the relevant battle script, and the pointer I entered into it.

https://dl.dropbox.com/s/54z7q2zjnc5eqiw/Capture.PNG

I've also tried formatting the pointer as 60C0EC08, 08ECC061, and 08ECC060. No changes, except for more oddities when I had formatted the pointers differently.

1. If the thrown Pokeball fails, my game freezes.
2. When the Pokemon is caught, Torchic does gain experience, but after the Pokedex information screen, I'm taken to a party select window, with the battle victory music still playing in the background. Torchic is the only Pokemon in the party, and I am unable to exit the window.

At xECC060, I've pasted the second string of bytes exactly as you've posted:

https://dl.dropboxusercontent.com/s/5f3bk2ie0uj5ath/Capture2.PNG

I have also tried omitting the bytes at x3DE7C, with no change.

If anyone could help me figure out what I have done wrong, I'd really appreciate it.

I was facing the same problem a few days ago. Repoint the battle script at 0x2DBD84 is not means to replace the original one with the new one directly in the address.

Firstly, you can place all the machine code in 0xECC060 like this:
http://www.pokecommunity.com/attachment.php?attachmentid=72469&stc=1&d=1403844557

Then replace the two pointers here from 84 BD 2D 08 to 60 C0 EC 08:
http://www.pokecommunity.com/attachment.php?attachmentid=72470&stc=1&d=1403844557

http://www.pokecommunity.com/attachment.php?attachmentid=72471&stc=1&d=1403844557

Finally, replace the bytes at 0x3DE7C with B5 DE 03 08. It may working properly now.


All times are GMT -8. The time now is 8:53 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.