• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ARCHIVE] Simple Questions (SEARCH BEFORE ASKING A QUESTION)

Status
Not open for further replies.
42
Posts
12
Years
  • Seen Aug 23, 2022
Can anyone think of why in my FR/LG hack, events such as Oak stopping you from leaving Pallet w/o a Pokemon or Gary challenging you would make wrong noises? Like the Oak thing, his song wouldnt play (Pallet Town music continued until entering Oak's lab) and, and when Gary challenged me, the poisoned sound effect played.
 
14
Posts
14
Years
  • Seen Feb 16, 2014
Hacking information

Hi!

I'm going to make a pokemon hack of ruby. I have knowledge of ASM and pointers, but there is an important point I never knew... it's how to find a data... for example, if I know where is a pokemon graphics, is there a way to find where is the pointer which points there? can someone tell me how I can find it, or know a tutorial where I can how to do it?

any hints would be appreciated!

thx
 

Lyzo

Back from vacation
261
Posts
17
Years
I have an ASM related question... I just finished this simple asm tutorial: http://www.pokecommunity.com/showthread.php?t=233645

And I have a question after finishing it.... How woulgd I store data from a register back into the RAM. For example, what I'm trying to do is the following:

I want to level up my Pokemon by 2 levels. I do this by taking the pokemon data at the level bit area, and then add that up by 2, and then I want to store that data again... But command prompt won't assemble my asm and gives me an error, stating that I can't store the pokemon data.

Here's the ASM code I'm using:
Spoiler:

Neither work when I try to assemble them.

I guess there is a different method to storing things back to the RAM? Or am I just being stupid? :P

I'd love some help!
 

colcolstyles

Yours truly
1,588
Posts
15
Years
I don't know if increasing the Level byte without changing the experience is such a good idea but regardless, try this:

Code:
.align 2
.thumb

main:
		push {r0-r1,lr}
		ldr r0, pokemon_data
		ldrb r1, [r0]
		add r1, #0x2
		strb r1, [r0]
		pop {r0-r1,pc}

.align 2

pokemon_data:
		.word 0x02024284 + 0x54
var:
		.word 0x020270B6 + (0x800D * 2)
 

Lyzo

Back from vacation
261
Posts
17
Years
Wow thanks, that worked! :D

No it isn't supposed to be functional or useful, I was just trying some things out and trying to learn ASM in the process :P

So, I'm trying to understand what you did there.

First you load the word at pokemon_data in r0.
Then you do the same for r1, using the address used to load r0.
You add 2 to r1.
You store r1 back to the address of r0.
Then you end it.

Am I getting it right like that?

And if so, could you also do it by only using one register? Like so :
Code:
.align 2
.thumb

main:
		push {r0-r1,lr}
		ldr r0, pokemon_data
		ldrb r0, [r0]
		add r0, #0x2
		strb r0, [r0]
		pop {r0-r1,pc}

.align 2

pokemon_data:
		.word 0x02024284 + 0x54
var:
		.word 0x020270B6 + (0x800D * 2)

Thanks for helping me. I'm really interested in learning this! :D
 

colcolstyles

Yours truly
1,588
Posts
15
Years
You can't use one register because if you load the level byte into r0, then it will overwrite the address that r0 previously contained. You'll have to use a minimum of two registers: one for the address, and one for the level.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Waaait, so:
Code:
ldr r0, pokemon_data
loads the address of pokemon_data into r0 and not the actual level bit?

"ldr r0, pokemon_data" loads some address, in this case 0x020242d8, into r0. "ldrb r1, [r0]" loads the byte that is stored at whatever address is in r0 and puts it in r1. Finally, "strb r1, [r0]" takes the contents of r1 and puts it at whatever address is stored in r0 (which is still the address of the level byte). So, that routine loads a byte from the RAM, modifies it a little, and then puts it back where it got it from, overwriting what used to be there.
 

Lyzo

Back from vacation
261
Posts
17
Years
Alright, that's what I did not get from the tutorial. I didn't really understand the difference between ldr str and ldrb and strb. But now I do, thanks so much :D
 
65
Posts
12
Years
  • Seen Jul 8, 2013
I've inserted a bitmap sprite in the place of Torchic on Ruby, and it works fine when you battle against it but when you use it in battle (i.e. see its backsprite) or see it in the pokedex, the game freezes or restarts just before you would see the sprite. I used nameless sprite editor to insert the image. Does anyone know what the problem could be?
 

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
Hey, I have a few questions. How do I edit the main trainers sprite. I've indexed the file, and then I replace it in UnLz, but it looks messed up so I tried to change the palette in APE, but It said not to, the reason is because when I clicked ignore the game now freezes and goes black when I click the trainer card?? I was thinking that I should insert the sprite into a empty slot and then repoint the offset so the game uses that trainer, but i'm a complete newb, so how would you do that?


Also, I've looked over mapping and it's seem very annoying as when I say change one part of grass, loads of it changes all through the world, when I only want that spot. Is there any way to only change the one spot...?
 
31
Posts
12
Years
  • Seen Jun 20, 2012
Pokemon Emerald 1.0
Advance Map
XSE
---

Does anyone know Bagon and Trapinch's hexadecimal number?

Oh, and could I make a title screen in Adobe/Macromedia Fireworks and somehow send it into unLz.gba to use as my titlescreen? I need the titlescreen number too for unLZ.gba unless there's another way I could edit the titlescreen.
 

Sawakita

Not Invented Here
181
Posts
13
Years
  • Age 34
  • Seen Nov 17, 2019
In Pokémon Gold can you use the RAM Map in PKSV-UI
If you can't find a way to word your question in an understandable form you are going to have a hard time in getting any answer.

Does anyone know Bagon and Trapinch's hexadecimal number?
Check this link; these are decimal but you can use windows calculator to convert them in hexadecimal format.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Does anyone know Bagon and Trapinch's hexadecimal number?
Check this link; these are decimal but you can use windows calculator to convert them in hexadecimal format.

And if you don't know how to do that, XSE comes with a file called "stdpoke.rbh" which contains the hexadecimal numbers for every pokémon from the first three generations.
 
Status
Not open for further replies.
Back
Top