Welcome to the PokéCommunity!

Hi there! Thanks for visiting PokéCommunity. We’re a group of Pokémon fans dedicated to providing the best place on the Internet for discussing ideas and sharing fan-made content. Welcome! We’re glad you’re here.

In order to join our community we need you to create an account with us. Doing so will allow you to make posts, submit and view fan art and fan fiction, download fan-made games, and much more. It’s quick and easy; just click here and follow the instructions.

Pokémon Sun and Moon are now available! Read our extensive Sun and Moon review at Daily!

The finale of the fourth annual Favorite Pokémon Tournament is underway in Pokémon General!View the poll and vote for as many Pokémon as you'd like. Voting is only open until the 5th of December though, so don't wait to make your picks!

Research & DevelopmentGot a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Research & Development programs in this forum are subject to moderator approval before they are displayed.

Here's a simple thing I did for Prism. It lets you run when you hold B.

First thing's first. When the bike shop owner calls you it's pretty buggy without the correct flags. So lets just disable that.

97BFA:
ld hl,$7BE4 (21 E4 7B) - This will prevent the "bike step count" from working. It will always write 00 to the RAM where it's supposed to add up, so the bike shop owner will never call you.

10000: call $7E66 (CD 66 7E) - This will call the ASM from 13E66 needed to make this work.

13E66:
call $4017 (CD 17 40) - This is what was originally at 10000, to make sure nothing "screws up" we'll just move it here.
ld de,$D682 (11 82 D6) - Loads D682 from the ram into de (which is what determines if Hiro is on the bike or not)
ld c,$04 (0E 04) - Since the RAM uses the same location to check if you are surfing (identified with 04), let's make sure this function does nothing if you are surfing.
ld a,[de] (1A) - Puts the contents of de (D682 in RAM) into a.
sbc a,c (99) - Subtracts c from a
jr z,$7E8B (28 18) - Checks if a is equal to 0. If so, jump ahead 18 bytes which is ret (C9), ending the function. Since a can only equal 0 if it was previous 4, this will only happen if you are surfing.
ld de,$CF29 (11 29 CF) - loads CF29 (indicates what keys are down) into de.
ld a,[de] (1A) - loads the contents of de into a.

Since bit 1 is on if B is down, let's make it so it ignores the other bits. Let me know if there's an eaiser way of doing this, for some reason the other bit commands weren't working for me.

res 0,a (CB 87) - turns bit 0 in a to off (A)
res 2,a (CB 97) - turns bit 2 in a to off (Select)
res 3,a (CB 9F) - turns bit 3 in a to off (Start)
res 4,a (CB A7) - turns bit 4 in a to off (Right)
res 5,a (CB AF) - turns bit 5 in a to off (Left)
res 6,a (CB B7) - turns bit 6 in a to off (Up)
res 7,a (CB BF) - turns bit 7 in a to off (Down)
rcc, a (CB 0F) - shifts the bits in A down 1, changing 2 into 1.
ld de,$D682 (11 82 D6) - loads D682 into de again
ld [de],a (12) - Puts the contents of a into de.
ret (C9)

This will make the game write 01 into D682 if B is held down. If D682 is 01, that will make your characters speed increase. If you use this, just please give me credit. Enjoy.

Since bit 1 is on if B is down, let's make it so it ignores the other bits. Let me know if there's an eaiser way of doing this, for some reason the other bit commands weren't working for me.

res 0,a (CB 87) - turns bit 0 in a to off (A)
res 2,a (CB 97) - turns bit 2 in a to off (Select)
res 3,a (CB 9F) - turns bit 3 in a to off (Start)
res 4,a (CB A7) - turns bit 4 in a to off (Right)
res 5,a (CB AF) - turns bit 5 in a to off (Left)
res 6,a (CB B7) - turns bit 6 in a to off (Up)
res 7,a (CB BF) - turns bit 7 in a to off (Down)
rcc, a (CB 0F) - shifts the bits in A down 1, changing 2 into 1.
ld de,$D682 (11 82 D6) - loads D682 into de again
ld [de],a (12) - Puts the contents of a into de.
ret (C9)

This will make the game write 01 into D682 if B is held down. If D682 is 01, that will make your characters speed increase. If you use this, just please give me credit. Enjoy.

Maybe it's a stupid suggestion but, instead of resetting one bit at a time, why don't you use:and 02 (E6 02) - so it reset all bits but the "B"-bit
rcc, a (CB 0F) - shifts the bits in A down 1, changing 2 into 1.
ld de,$D682 (11 82 D6) - loads D682 into de again
ld [de],a (12) - Puts the contents of a into de.
ret (C9)

call $4017 (CD 17 40) - This is what was originally at 10000, to make sure nothing "screws up" we'll just move it here.
ld de,$D682 (11 82 D6) - Loads D682 from the ram into de (which is what determines if Hiro is on the bike or not)
ld c,$04 (0E 04) - Since the RAM uses the same location to check if you are surfing (identified with 04), let's make sure this function does nothing if you are surfing.
ld a,[de] (1A) - Puts the contents of de (D682 in RAM) into a.
sbc a,c (99) - Subtracts c from a
jr z,$7E8B (28 18) - Checks if a is equal to 0. If so, jump ahead 18 bytes which is ret (C9), ending the function. Since a can only equal 0 if it was previous 4, this will only happen if you are surfing.
and 02 (E6 02) - so it reset all bits but the "B"-bit
rcc, a (CB 0F) - shifts the bits in A down 1, changing 2 into 1.
ld de,$D682 (11 82 D6) - loads D682 into de again
ld [de],a (12) - Puts the contents of a into de.
ret (C9)

could also be repointed, correct?
I'm thinking I might use this as a test for my new package system I'm making.
If it's alright with you, could I post the finished package on this thread for the metal gen. hackers to test?

Hold on, are you talking about just regularly using the running shoes? During normal use of holding down the "B" button, everything functions just fine. However, if you hold down B when exiting a textbox, it will sometimes cause the player to mount the bike and cause the music to start playing.

The exact same code isn't going to function differently for the same game.

You're right about the fact it plays the bike-music (for example sometimes after losing a battle).
It depends on the Map Loading Process -data (see the Scripting Compendium).

I tested it with Blackthorn City by changing 07 to 08 at 154c2, and bike music didn't start playing anymore after I failed in a trainer battle.
However, there are other locations too where you have to do the same thing.

You're right about the fact it plays the bike-music (for example sometimes after losing a battle).
It depends on the Map Loading Process -data (see the Scripting Compendium).

I tested it with Blackthorn City by changing 07 to 08 at 154c2, and bike music didn't start playing anymore after I failed in a trainer battle.
However, there are other locations too where you have to do the same thing.

Changing the map loading process for every map that needs it is a little impractical, and could potentially cause glitches. Try disabling the bike music instead, just search for it in the VBA debugger.

Help

The PokéCommunity

Meta

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, or The Pokémon Company International. We just love Pokémon.