• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.
Hacking the types with ASM.

Do you actually need ASM for that? The type advantages are handled by a (somewhat strange) table somewhere, so you should just be able to change things to types past the normal ones without any ASM. Might have to break a few limiters and you'd obviously have to edit the type graphic, but IIRC there was space for a few freebie types.

(not to mention that if you retype curse and don't have eggs, ??? is perfectly usable as long as you either use the phys/spec split or break all the related checks)

https://www.pokecommunity.com/threads/266698 relevant
 
Well DJG, there is no list for Ruby, but maybe deleting certain events that use them can ensure they're free. However, a var can hold a value from 0-65535, so you may only need like two. So just to be safe, vars in the 4000 area. I'm pretty sure 8000 and higher are unsafe or temporary

Pokefreake
Use NSE or in un-lz, import an image, write the import offset, import pal, and don't click automatically fix pointers.
 
Well DJG, there is no list for Ruby, but maybe deleting certain events that use them can ensure they're free. However, a var can hold a value from 0-65535, so you may only need like two. So just to be safe, vars in the 4000 area. I'm pretty sure 8000 and higher are unsafe or temporary

Yesh, the very first var I used is 4000, since I based it on Birch's script where he's being chased by a Poochyena.

Thankies for the info, by the way~ ;)
 
Hi all, I am new to ASM and it's going pretty well. Here's my code

.text
.align 2
.thumb
.thumb_func
.global nature

main:
push {r0-r1, lr} \\lets me work with r0 and r1
ldr r0, .POKE_DATA \\ Loads the address of specified below as a 'word'
ldr r1, [r0] \\ Loads the value of the address into r1 as a 'word'
add r1, r1, #0x1 \\ adds 1 to the word in r1
str r0, [r1] \\ stores the 'word' in r1 to the address in r0.
pop {r0-r1, pc} \\ puts the registers back :)


.align 2
.POKE_DATA:
.word 0x02024284 \\address of the the PID

Now is their a reason why this doesn't add 1 to the PID? I know its encrypted but I expected a bad egg instead of nothing. 100% sure the script works.
 
Hi all, I am new to ASM and it's going pretty well. Here's my code



Now is their a reason why this doesn't add 1 to the PID? I know its encrypted but I expected a bad egg instead of nothing. 100% sure the script works.

Just because it doesn't make a bad egg, doesn't mean it doesn't work. Did you open up the memory viewer at that address and check it before and after? (I haven't read your asm yet, I'm going back now..)

Edit: You made a very common mistake. One sec...

Code:
.text
.align 2
.thumb
.thumb_func
.global nature

main:
push {r0-r1, lr} \\lets me work with r0 and r1
ldr r0, .POKE_DATA \\ Loads the address of specified below as a 'word'
ldr r1, [r0] \\ Loads the value of the address into r1 as a 'word'
add r1, r1, #0x1 \\ adds 1 to the word in r1
[B][COLOR="Red"]str r1, [r0][/COLOR][/B] \\ stores the 'word' in r1 to the address in r0.
pop {r0-r1, pc} \\ puts the registers back 


.align 2
.POKE_DATA:
.word 0x02024284 \\address of the the PID

Str and ldr tend to confuse people.

ldr works like this:

ldr rX, [rH]
<-----------

str works like this:

str rX, [rH]
------------>

Understand? They move in different directions. You load right to left, and store left to right. There are very few commands that work left to right, and str is one of them, which trips people up. Remember, [] signify the data at an address. So, str r0, [r1] would read the PID as a memory address and try and store the address in r0 there. Not good..XD
 
Last edited:
(not to mention that if you retype curse and don't have eggs, ??? is perfectly usable as long as you either use the phys/spec split or break all the related checks)

https://www.pokecommunity.com/threads/266698 relevant

The only problem being I'm positive that the escapade move Struggle is the ??? type. I'm not sure about that but I think so. However Curse is a defensive move so yeah, the re-typing wont effect it

A simple question: what are the variables which are safe to use in a Ruby ROM?

I am just recently introduced to vars (don't ask), and I created my very first script using vars, but I am not sure what variables are safe to use. :3

You'd be surprised to know that after a certain point (near Fortree I think) the game stats using vars like 0x1, 0x2, 0x3 etc.
 
Last edited:
Spoiler:


Sorry KK552, your method worked, I must have understood JPAN wrong. It worked like a charm! I got my bad egg :) Now to fix the checksum and I will be rolling. Thanks for the push!

Also has anyone edited the PID? Or is it impossible haha!
 
Last edited:
Yes it does thanks! Thanks for clearing it up the [] as well, I now understand how values are pulled from an address without moving the address too XD. But are you 100% on the str though? In JPANs doc it quotes thumb assembly doesn't swap the convention unlike other languages:



I am happy to change my thinking but when I use this code (modifies HP) it works perfectly. I also have memory viewer on auto update too :)
Spoiler:

What he meant there, was that str and ldr don't look like this:

ldr r1, [r0]
str [r0], r1

see how they are opposites?

~~~~~~~~
Judging from what I know, that code should not work.....
Seeing as how I wrote my own forme change code... I know how str works.....


Edit: what threw me off was the ldrh. That code will work. One sec....


.text
.align 2
.thumb
.thumb_func
.global healthbooster

main:
push {r0-r1, lr}
ldrh r0, .POKE_DATA /*You are loading an address into r0, always load the full thing, not half. Though, it may not make a difference, not a good habit.*/
ldrh r1, [r0] /*load what is at the address .POKE_DATA into r1. Here you are loading a word, shouldn't you be loading a half-word?*/
add r0, r0, #0x64 /*Add 100 to r0, and place on r0. Looks like, we are moving to the next pokemons HP, which is 100 bytes away...*/
strh r0, [r1] /*Store the bottom half of the address of the second pokemon at the random number you loaded from the pokemon data.*/
pop {r0-r1, pc}


.align 2
.POKE_DATA:
.word 0x02024287


Creating a correct version now....

Code:
.align 2
.thumb
.thumb_func
.global healthbooster

main:
    push {r0-r1, lr}
    ldr r0, .POKE_DATA
    ldrh r1, [r0]
    add r1, r1, #0x64
    strh r1, [r0]
    pop {r0-r1, pc}


.align 2
.POKE_DATA:
    .word 0x02024287

That should work. I also seriously confused myself while correcting the first one. Let me fix that... Fixed.
 
Last edited:
What he meant there, was that str and ldr don't look like this:

ldr r1, [r0]
str [r0], r1

see how they are opposites?

~~~~~~~~
Judging from what I know, that code should not work.....
Seeing as how I wrote my own forme change code... I know how str works.....


Edit: what threw me off was the ldrh. That code will work. One sec....


.text
.align 2
.thumb
.thumb_func
.global healthbooster

main:
push {r0-r1, lr}
ldrh r0, .POKE_DATA /*You are loading an address into r0, always load the full thing, not half. Though, it may not make a difference, not a good habit.*/
ldrh r1, [r0] /*load what is at the address .POKE_DATA into r1. Here you are loading a word, shouldn't you be loading a half-word?*/
add r0, r0, #0x64 /*Add 100 to r0, and place on r0. Looks like, we are moving to the next pokemons HP, which is 100 bytes away...*/
strh r0, [r1] /*Store the bottom half of that address as the new HP on the original first pokemon.*/
pop {r0-r1, pc}


.align 2
.POKE_DATA:
.word 0x02024287


So, effectively, you stored the address of the second pokemon as the HP of the first pokemon. Which would have maxed it out.

Creating a correct version now....

Oh god! Sorry this is not my code! I edited it for my new one! This is the original (I know it's not 100% efficient!)

Spoiler:


Thanks for the help!
 
Oh god! Sorry this is not my code! I edited it for my new one! This is the original (I know it's not 100% efficient!)

Spoiler:


Thanks for the help!


No problem.:P

Spoiler:


Edit: Don't worry about being inefficient. Game freak was SUPER inefficient in their code. When you start looking at the in game code, you will see what I mean.
 
How to remove the need of Badge to use HM moves outside of battle for Firered?

e.g. I want to remove the need of Soul Badge to use the move, Hm: Surf.
 
That's the thing. If i remove the checkflag, it'll set the badge on. I don't want that. I want the player to be able to use the HM freely without the need of the badges.

No, not that script. The script that is called when you want to use an HM. It has a check flag, that needs to be removed. If it doesn't check the flag, it will just move through without the need of a badge. You are like the 500th person to ask that on this thread.
 
Status
Not open for further replies.
Back
Top