• 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.

Quick Research & Development Thread

sonic1

ASM is my life now...
77
Posts
15
Years
  • Hi there! I was designing a berry tree system for my game (Firered), and while I figured out a way to make a tree give a berry a day, I realized that there was something else in the game that does pretty much the same thing; the regenerating berries in Berry Forest, and regenerating trinkets on treasure beach. Does anyone have any info on these regenerating items, and how I might be able to expand the list to cover all my berry trees? Additionally, does anyone know where I might find the offsets for the flags/variables for hidden items?


    Well, i only took a quick look into this issue (3 minutes) because i'm very busy now, and i don't want to discourage you, but there's a limit for those items.
    The routine at 080CC44C is the one who gets the flag associated with the hidden item, based on Hidden ID + 0x3e8. This means no repoint+add items without overwriting other game flags.

    Thats the only thing i found out by now.

    Props
     

    redriders180

    Mastermind of Pokemon Glazed
    314
    Posts
    13
    Years



  • Well, i only took a quick look into this issue (3 minutes) because i'm very busy now, and i don't want to discourage you, but there's a limit for those items.
    The routine at 080CC44C is the one who gets the flag associated with the hidden item, based on Hidden ID + 0x3e8. This means no repoint+add items without overwriting other game flags.

    Thats the only thing i found out by now.

    Props

    Well, plan B is to make a script that just clears all the hidden item flags to zero at midnight, which is simple enough. I assume the hidden item flags are stored somewhere in memory, so I'd just have to write 0 to all the bytes I need to clear it out. Does anyone have the offset for this location in the memory?
     

    sonic1

    ASM is my life now...
    77
    Posts
    15
    Years
  • Well, plan B is to make a script that just clears all the hidden item flags to zero at midnight, which is simple enough. I assume the hidden item flags are stored somewhere in memory, so I'd just have to write 0 to all the bytes I need to clear it out. Does anyone have the offset for this location in the memory?

    Well, actually, they are normal flags, like 0x800 etc..., but are Hidden ID + Flag 0x3E8. (E.g: Hidden item 0x10 would be flag 0x3F8. Clear the flag to be able to get the item again)

    The script is somewhat easy. There are 0xBE hidden items. Here's a script made now for the purpose:
    Code:
    #dynamic 0x800000
    '----------------
    #org @start
    setvar 0x8000 0x3E8 'Base flag
    setvar 0x8001 0x0   'Counter
    goto @loop
    
    #org @loop
    compare 0x8001 0xBE
    if B_> goto @end
    addvar 0x8001 0x1
    clearflag 0x8000    ' Clear flag in var 8000
    addvar 0x8000 0x1
    goto @loop
    
    #org @end
    setvar 0x8000 0
    setvar 0x8001 0     'Reset vars
    release
    end

    I made this in 5 minutes and didn't test it. Test it and please warn me if there's an inconvenience with this.

    (to @redriders180: I saw your PM, i just hadn't the time to answer it because its a little complex for my current time available)
     

    redriders180

    Mastermind of Pokemon Glazed
    314
    Posts
    13
    Years


  • Well, actually, they are normal flags, like 0x800 etc..., but are Hidden ID + Flag 0x3E8. (E.g: Hidden item 0x10 would be flag 0x3F8. Clear the flag to be able to get the item again)

    The script is somewhat easy. There are 0xBE hidden items. Here's a script made now for the purpose:
    Code:
    #dynamic 0x800000
    '----------------
    #org @start
    setvar 0x8000 0x3E8 'Base flag
    setvar 0x8001 0x0   'Counter
    goto @loop
    
    #org @loop
    compare 0x8001 0xBE
    if B_> goto @end
    addvar 0x8001 0x1
    clearflag 0x8000    ' Clear flag in var 8000
    addvar 0x8000 0x1
    goto @loop
    
    #org @end
    setvar 0x8000 0
    setvar 0x8001 0     'Reset vars
    release
    end
    I made this in 5 minutes and didn't test it. Test it and please warn me if there's an inconvenience with this.

    (to @redriders180: I saw your PM, i just hadn't the time to answer it because its a little complex for my current time available)

    I just tested this, and for some odd reason, it's not working. I activated a hidden item in the usual way, obtained it, and then ran this script via signpost, but I couldn't get the item again. I even expanded it to clear every flag from 0x1 to 0xFFF, but nothing. Am I doing something wrong?
     

    sonic1

    ASM is my life now...
    77
    Posts
    15
    Years
  • Ok, sorry, my bad, the script doesn't work, and i don't know why. In the past months i only worked with ASM, so i'm a but rusty with scripts. Here's a routine.
    Try callingasm this routine:
    Code:
    .align 2
    .thumb
    
    main:
    	push {r0-r4, lr}
    	ldr r0, =0x3E8 			@flag base
    	ldr r1, =0x0			@counter
    loop:
    	cmp r1, #0xBE
    	bhi end
    	add r1, r1, #0x1
    	bl clearflag
    	add r0, r0, #0x0		@next flag
    	b loop
    end:
    	pop {r0-r4, pc}
    	
    clearflag:
    	ldr r4, =0x0806E6A8+1          @clearflag routine offset
    	bx r4

    Hope this helps.
     
    Last edited:
    6
    Posts
    12
    Years
    • Seen Jul 29, 2022
    I looked at the list of identified flags posted by DavidJCobb and it isn't very clear which ranges of flags can be used safely. It looks like the range between 0AE and 154 doesn't have any flags. Does anyone know if new flags can be created in that range?
     
    1,323
    Posts
    16
    Years
    • Seen Dec 9, 2023
    I figured out how to edit the Hoenn Dex order in Ruby, without editing the National Dex. The offset is at 0x1FC84C. It does not list by Pokemon index number, it lists by dex entry index number. Treecko's index number is 277, but Treecko's dex entry number is 252. Which is why the byte at the offset I listed is FC. Changing the bytes here will change the Hoenn Dex while keeping the National Dex intact.

    I suspect the same table exists in Emerald, and the bytes should be exactly the same.

    EDIT: Hacked the Hoenn Dex to something similar (but not exactly the same) to a listing I'm planning on using in a future hack:
    262l4s9.png
     
    Last edited:

    sonic1

    ASM is my life now...
    77
    Posts
    15
    Years
  • I figured out how to edit the Hoenn Dex order in Ruby, without editing the National Dex. The offset is at 0x1FC84C. It does not list by Pokemon index number, it lists by dex entry index number. Treecko's index number is 277, but Treecko's dex entry number is 252. Which is why the byte at the offset I listed is FC. Changing the bytes here will change the Hoenn Dex while keeping the National Dex intact.

    I suspect the same table exists in Emerald, and the bytes should be exactly the same.

    EDIT: Hacked the Hoenn Dex to something similar (but not exactly the same) to a listing I'm planning on using in a future hack:
    262l4s9.png

    Yup, that table exists in Emerald, it's located at 0x31DFB8
    For any ruby/firered to emerald equivalents, you can ask me, as i'm a emerald hacker.
     
    1,323
    Posts
    16
    Years
    • Seen Dec 9, 2023


    Yup, that table exists in Emerald, it's located at 0x31DFB8
    For any ruby/firered to emerald equivalents, you can ask me, as i'm a emerald hacker.
    Do you know where the limiter that limits the Hoenn Dex to 202 entries is though? It would be nice if we could expand it. It shouldn't require any ram repointing because the maximum amount of entries that the ram allows is 386.
     

    Jambo51

    Glory To Arstotzka
    736
    Posts
    14
    Years
    • Seen Jan 28, 2018
    For anyone interested, in FR US 1.0 (aka BPRE 1.0), to change your Pokédex "mode" to the style which DPPt used (That is, to have the seen amount displayed in the continue screen and the save screen instead of the caught numbers), change:

    0800CF56: 00 20
    0800CF64: 00 20
    080F803C: 00 20
    080F8044: 00 20

    It really is that simple. :)
     
    Last edited:

    Haru~

    Can't resist the chubbiness :3
    16
    Posts
    12
    Years
    • Seen Jul 15, 2012
    Hello guys! :)

    Does anyone know the RAM location for the player's current money, if any?
    I've been messing with the memory viewer but I can't see it unless I access the trainer card, 0x02000490. But I want to know where the data is when you're not viewing the card.

    EDIT: Oh, it's for BPRE. Silly me! ^^
     
    Last edited:
    5,256
    Posts
    16
    Years
  • Well the offset 0x054B80 contains bytes that can be edited to change the amount of money you start off with in FireRed, but I don't know which ROM you're referring to.
     
    37
    Posts
    13
    Years
    • Seen Feb 7, 2014
    For the setmapfooter command/script in XSE, you're required to know the map footer for the map. Some people suggest subtracting the map footer table from the pointer to map footer offset, but there's a much easier way. I also think that method only works with Emerald, because since no one has posted the map footer table for Fire Red on these forums, I had to reverse find the "table," but using that number did not work with other maps than the map that I used to reverse find it. I probably checked my math, offsets, and pointers countless times, and I'm positive that method doesn't work with Fire Red.

    This, however DOES work with Fire Red, along with Leaf Green, Ruby, Sapphire, and Emerald.
    1. Go into Advance Map.
    2. Choose a map you want the setmapfooter command to work with.
    3. Go to header.
    4. CTRL+H for professional settings.
    5. Find the 19th byte in the Map Header (long strand of bytes under Map Settings)
    6. That 19th byte is what you will use.
     

    Haru~

    Can't resist the chubbiness :3
    16
    Posts
    12
    Years
    • Seen Jul 15, 2012
    After a long battle with cancer trying to find the RAM location of the player's money, I had a feeling that it is encrypted somewhere in the RAM and that's why I can't find it. So after going to my local POKeMART, I found a little routine that seems to decrypt something. After doing further testing, I made this routine to get the player's current money using the game's own code.

    The routine:
    Spoiler:


    I slept after that...
     
    37
    Posts
    13
    Years
    • Seen Feb 7, 2014
    What I've noticed is that when you insert a map, you are not able to ride the bicycle on that map even if you edit all of the header settings for the map. The solution to this lies in the string of bytes for the map header.

    1. In Advance Map, go to the map header and enter the professional map header settings with CTRL+H.
    2. In the string of bytes for the map header under "Map options:," find the first of the last four bytes (byte #25 if that confuses you).
    3. Change that byte (byte #25) to 01.
    4. You can now ride the bicycle on that map!
     

    looper

    German Hacker
    53
    Posts
    13
    Years
  • Did someone ever thought about more characters than the two genders in FR? For example 2 boys and 2 girls?
    In my eyes it would need a change of the choice in the intro and a modification of the scripts that renders the trainerbattles (backsprite) and the maps (OW) as like some minor things.
    My Question is: Would it be possible with a small amount of work? I don't know how the routines that differ the gender work, but thinking about the checkgender command gives me the feeling that the game only allows 2 Values.

    Does anyone know sth. about it?
     

    redriders180

    Mastermind of Pokemon Glazed
    314
    Posts
    13
    Years
  • Did someone ever thought about more characters than the two genders in FR? For example 2 boys and 2 girls?
    In my eyes it would need a change of the choice in the intro and a modification of the scripts that renders the trainerbattles (backsprite) and the maps (OW) as like some minor things.
    My Question is: Would it be possible with a small amount of work? I don't know how the routines that differ the gender work, but thinking about the checkgender command gives me the feeling that the game only allows 2 Values.

    Does anyone know sth. about it?

    It definitely would be alot of work. You could use a small shortcut, however, and take a leaf out of JPANs book and make a backsprite-switching and OW switching command. This would get around the OW and backsprite problem, although there are many other things that aren't addressed in JPANs hack engine, such as the small sprite of the player's head that shows up on the World Map, the end credits script, and plenty of other things. You could always modify the ASM behind the main part of the ROM that holds the player's gender, which according to my notes is at 0x0300500C + 0x8, to hold other values. Currently, it only uses 0 for boy and 1 for girl, but I'm sure you could make it accept other values with some ingenuity. But you'd need to go to every single routine in-game that depends on gender, and change the routine to have more branches. Alot of things change color depending on the gender, in addition to other things. If you're experienced enough to take it on, by all means, go for it :D, otherwise, try pursuing a simpler path. For instance, after Oak's intro, ask the player, in a script, if they'd like to be Type A boy or Type B boy, or Type A girl or Type B girl, and adjust the variables accordingly.
     
    Last edited:

    Platinum Lucario

    The Legendary Master of [color=#D8D48C]Light[/colo
    1,607
    Posts
    16
    Years
  • Hm... I've actually found the name input screen graphics in a/1/1/9 on a Pokémon Black 2/White 2 ROM. And then I found the name input screen graphics in a/1/1/8 on the first Pokémon Black/White ROMs. But when I try to insert the name input graphics from Black into Black 2... here's what happens, the graphics may be changed... but the characters and the cursor position haven't changed, so I'm actually wondering where the data for the name input screen and cursor position are... so then I can then replace the data from the first Black Version into Black Version 2.
    inputscreenissue2.png
    inputscreenissue3.png
     
    Back
    Top