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

Help Thread: Quick Questions & Answers

Status
Not open for further replies.
  • 1,344
    Posts
    14
    Years
    • Seen Dec 10, 2021
    How do I edit the beginning sequence (sprites, text ect.)?

    Text can be edited with a hex editor, although you'll likely need to repoint it. The sprites are more complicated, as far as I'm aware they all use the same 256 color palette and it can be a bit hard to edit them. Here's a tutorial on it, it doesn't exactly cover everything but it should give you a general idea.
     
  • 12
    Posts
    8
    Years
    • Seen Mar 19, 2017
    How robust are XSE scripts? For example, if I wanted to make a script using the RNG command to produce a value between 1-100, would it be possible to script a unique output for each possible value? Or would this be too much for the ROM?
     

    Squeetz

    ROM Hacker
  • 191
    Posts
    10
    Years
    How robust are XSE scripts? For example, if I wanted to make a script using the RNG command to produce a value between 1-100, would it be possible to script a unique output for each possible value? Or would this be too much for the ROM?
    Yes you can. It would just take a very long time typing in all of that.
     
  • 64
    Posts
    10
    Years
    • Seen Mar 30, 2016
    How robust are XSE scripts? For example, if I wanted to make a script using the RNG command to produce a value between 1-100, would it be possible to script a unique output for each possible value? Or would this be too much for the ROM?

    Are you capable of compiling assembler code?
    Why not implementing a global pointer table, then?

    Code:
    #dynamic 0x800000
    #org @main
    random 0xMaxValue  ' random value in LASTRESULT
    callasm [offset_of_following_code]
    Code:
    .align 2
    .thumb
    
    .equ ptrTable, 0x08[your_offset]
    .equ lastResult, 0x020370d2
    .equ storage, 0x02[ram_offset_to_store_string|number]
    
    entry:
    push {r0-r1, lr}
    ldr r0, lastResult
    ldrb r0, [r0] @ random value in r0
    mov r1, #0x4 @ size of pointer in ROM
    mul r1, r0 @ offset of pointer within table
    ldr r0, ptrTable
    add r0, r1 @ offset of pointer in ROM
    ldr r0, [r0] @ pointer in r0
    ldr r1, storage
    str r0, r1 @ store pointer in custom RAM location
    pop {r0-r1, pc}
    After this operation, the pointer is at a custom RAM location which you can use in the further script. :-)
    This was written fairly spontaneous so I have not tested it yet. This is a better solution than a huge script that eats up much space in your ROM. If you want to have numbers and not strings, you can ask me and I will modify the ASM code for you! :-)
     
  • 325
    Posts
    10
    Years
    Are you capable of compiling assembler code?
    Why not implementing a global pointer table, then?

    Code:
    #dynamic 0x800000
    #org @main
    random 0xMaxValue  ' random value in LASTRESULT
    callasm [offset_of_following_code]
    Code:
    .align 2
    .thumb
    
    .equ ptrTable, 0x08[your_offset]
    .equ lastResult, 0x020370d2
    .equ storage, 0x02[ram_offset_to_store_string|number]
    
    entry:
    push {r0-r1, lr}
    ldr r0, lastResult
    ldrb r0, [r0] @ random value in r0
    mov r1, #0x4 @ size of pointer in ROM
    mul r1, r0 @ offset of pointer within table
    ldr r0, ptrTable
    add r0, r1 @ offset of pointer in ROM
    ldr r0, [r0] @ pointer in r0
    ldr r1, storage
    str r0, r1 @ store pointer in custom RAM location
    pop {r0-r1, pc}
    After this operation, the pointer is at a custom RAM location which you can use in the further script. :-)
    This was written fairly spontaneous so I have not tested it yet. This is a better solution than a huge script that eats up much space in your ROM. If you want to have numbers and not strings, you can ask me and I will modify the ASM code for you! :-)
    Wouldn't this not work without updating the script pointer? Instead of your custom RAM address you'd call storage, you should use the script pointer, otherwise the script won't go where you want it to go. Unfortunately I'm on a mobile as my computer is broken, but when I get back I'll try to find it for you guys. If you know where it is yourself, then even better.
     
  • 64
    Posts
    10
    Years
    • Seen Mar 30, 2016
    Wouldn't this not work without updating the script pointer? Instead of your custom RAM address you'd call storage, you should use the script pointer, otherwise the script won't go where you want it to go. Unfortunately I'm on a mobile as my computer is broken, but when I get back I'll try to find it for you guys. If you know where it is yourself, then even better.

    I thought that he wanted a specific value or string which is stored in a RAM location and can then be used in the same script by using "readfarbyte" and then reading the byte out of the script bank. If he wishes to have actual script pointers stored in the table and wants them executed, replace the pop call with:

    Code:
    pop {r1}
    pop {r0} // script pointer in r0
    ldr r0, storage // access custom RAM location which is needed because of the POP statements
    ldr r0, [r0] // but copies it back to r0 which represents the script pointer
    pop {pc}
    This should work, provided that the script pointer actually IS in r0. :-)
     
  • 325
    Posts
    10
    Years
    I thought that he wanted a specific value or string which is stored in a RAM location and can then be used in the same script by using "readfarbyte" and then reading the byte out of the script bank. If he wishes to have actual script pointers stored in the table and wants them executed, replace the pop call with:

    Code:
    pop {r1}
    pop {r0} // script pointer in r0
    ldr r0, storage // access custom RAM location which is needed because of the POP statements
    ldr r0, [r0] // but copies it back to r0 which represents the script pointer
    pop {pc}
    This should work, provided that the script pointer actually IS in r0. :-)

    I'm still not sure why you'd need that free RAM space. Storing the offset where you want to go in the script pointer would automatically move the script. So all you'd need to define is the table of pointers, the script pointer, and the lastresult variable. Your original code would work fine if you did that.
     
  • 64
    Posts
    10
    Years
    • Seen Mar 30, 2016
    I'm still not sure why you'd need that free RAM space. Storing the offset where you want to go in the script pointer would automatically move the script. So all you'd need to define is the table of pointers, the script pointer, and the lastresult variable. Your original code would work fine if you did that.

    The script pointer is not something you can change whenever you want. The script pointer is stored in either r0 or r1.
    Code:
    push {r0-r1, lr}
    This code pushes r0 and r1 on the stack, so they can be used and modified without altering any script-dependent values.
    If you pop r0 and r1 from the stack, the retrieved pointer value (in r0 before str r0, [r1]) will be overwritten with the script-dependent values which were previously pushed. So we need to temporarily store the retrieved pointer value.

    Code:
    pop {r1}
    pop {r0}
    After this code snippet, the registers with script-dependent values are restored again. Now you just load the pointer from the temporary space and put it into register r0. After pop {pc}, processor returns to the script-handler which now uses the modified r0 register!

    Why not directly modify r0 and then pop?
    That's probably what you intended to do. You should be aware of that you completely corrupt the stack by poping less values than you've pushed!

    Another possibility
    Code:
    push {r1-r2, lr} @ leave the r0 register
    //--- modify the r0 register to your wishes
    pop {r1-r2, pc}
    Now the r0 register is not even pushed and can therefore be directly modified.

    Help from someone experienced

    • It is not assured whether only r0 and r1 are used in the script handler.
      To be on the save way, just push every register => "push {r0-r7, lr}"
    • It is not assured whether r0 contains the current script pointer!
     
  • 12
    Posts
    8
    Years
    • Seen Mar 19, 2017
    I've been looking into ASM all night (literally lol) and it's pretty fascinating stuff. I'm going to be tinkering around with it for a bit, I'll be back if I have any followup questions.

    Thanks for the help fellas :D
     
    Last edited by a moderator:

    Aethestode

    Hacker
  • 1,700
    Posts
    16
    Years
    • Seen Aug 14, 2023
    Sorry, I have two questions for FireRed (Jpan engine and saveblock is inserted).

    1) Is it possible to add more Map Names (like not replacing the pre-existing one, but add more) into the game?

    2) Is it possible to add more in game map? So far, there's only two maps in Firered, Kanto and Sevii Island. Is it possible to add more?
     
  • 417
    Posts
    9
    Years
    • Seen Nov 20, 2016
    Sorry, I have two questions for FireRed (Jpan engine and saveblock is inserted).

    1) Is it possible to add more Map Names (like not replacing the pre-existing one, but add more) into the game?

    2) Is it possible to add more in game map? So far, there's only two maps in Firered, Kanto and Sevii Island. Is it possible to add more?
    Jambo posted a method https://www.pokecommunity.com/showthread.php?t=212492 though I've never done it myself.

    As for the world map, no clue. But aren't there normally four? Sevii Islands has three different world maps.
     
  • 417
    Posts
    9
    Years
    • Seen Nov 20, 2016
    Ty.
    Is there a way to add more than 4 maps? So far the only guides I found only say how to edit pre-existing one.
    Sorry, but I really have no clue. I'm sure it is possible, but I'm not even sure that anyone has attempted it in BPRE because not many people would even need more than four world maps :/ I can tell you that according to knizz, the pointer to worldmap data is at 0x020399E4 (ram), but at a glance, his idb doesn't appear to explicitly write out the structure for that data. A number of worldmap routines start at ROM 0x0C3AC8, so you could start there if some kind soul does not already have an answer for you.
     
  • 55
    Posts
    8
    Years
    I am wondering how i can add the Iv grades that i have seen in some hacks like: 31Iv would be S and 0 Iv would be E-.
    Want to implement it into my own hack.
     
    Last edited by a moderator:
  • 368
    Posts
    9
    Years
    • Age 23
    • Seen Apr 6, 2018
    Anyone know where I can get a virus free download for NTME+ cause the link in the forum isn't working and I really need NTME+ to change the title screen of my fire red rom hack.
     
    Status
    Not open for further replies.
    Back
    Top