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

[ASM & Hex✓] (Solved) Is it possible to Store/Write a Value at 08(rom) using ASM?

chestertagat

Dumbest Person in the World.
63
Posts
11
Years
  • Here's another question is it possible to Store or Write a Value to ROM Offset (Free Space) using asm

    Cause i know that through ASM you can Store/Write values to Ram for Example: 0202XXXXX = 0x800D

    But is it Possible to Store/Write i Rom? Using ASM? Cause I'm gonna Implement a ATM Machine in my Hack (I Dont know if someone already implemented something like this one)

    So i hope if its Possible?

    My Script would be something Like This:
    Spoiler:


    I hope somebody Helps :) or maybe check something in my script/routine plan that isnt possible and show a better way to that :)

    Thanks in Advance :)
     
    Last edited:
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    Honestly ASM is far overkill for a ATM.

    You can do this with Scripting,
    I would suggest looking up the XSE scripting tutorial.

    Also no you can't write to the ROM area with Asm as it is Read Only Memory...
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    It's ROM, you can't write to it. If you need a value to change, it has to be in RAM. If you need that value to be saved in your save game you have to do it in a part of the RAM that gets written to the save. The easiest way to do that is to use a variable, so why don't you just do that?
     

    chestertagat

    Dumbest Person in the World.
    63
    Posts
    11
    Years
  • Also no you can't write to the ROM area with Asm as it is Read Only Memory...

    Hahaha that's right I saw it from the Old ASM Thread that you cannot right to rom, a few hours after i post

    this one. Hahahaha Thanks Anyway.

    DarkPsychic said:
    Honestly ASM is far overkill for a ATM.

    You can do this with Scripting,
    I would suggest looking up the XSE scripting tutorial.

    So you are saying that i can Divide in XSE? cause the reason why i wanna do this through assembly is

    because of that and this:

    Everytime you restart the Game The values that you stored in RAM are cleared or moved(not sure though)

    Touched said:
    It's ROM, you can't write to it. If you need a value to change, it has to be in RAM. If you need that value to be saved in your save game you have to do it in a part of the RAM that gets written to the save. The easiest way to do that is to use a variable, so why don't you just do that?

    Haha I don't know how much a Variable can hold that's why , And I havent realized until now that

    variabes are saved in some point in RAM(or save or battery or whatever) .

    And before this is what i think: RAM=Temp Rom = Perm Thanks for the Help ;)

    but can i really do it in XSE? How about Dividing? How about saving it on a Variable ? Can i just Setvar (var) (value) ? Please Explain :D
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    Haha I don't know how much a Variable can hold that's why , And I havent realized until now that

    variabes are saved in some point in RAM(or save or battery or whatever) .

    And before this is what i think: RAM=Temp Rom = Perm Thanks for the Help ;)

    but can i really do it in XSE? How about Dividing? How about saving it on a Variable ? Can i just Setvar (var) (value) ? Please Explain :D

    No you can't divide a number in XSE, you need to do it in ASM.

    A variable is 16 bits, so it can hold a maximum (unsigned) value of 2 ^ 16 - 1 = 65535. While that's not very large, you could use 2 consecutive variables (e.g. 0x4000 and 0x4001) and get 32 bits, which gives you a maximum value of 2 ^ 32 - 1 = 4294967295. I think FBI has a routine that does this in his ASM resource thread that you could adapt.
     

    chestertagat

    Dumbest Person in the World.
    63
    Posts
    11
    Years
  • No you can't divide a number in XSE, you need to do it in ASM.

    A variable is 16 bits, so it can hold a maximum (unsigned) value of 2 ^ 16 - 1 = 65535. While that's not very large, you could use 2 consecutive variables (e.g. 0x4000 and 0x4001) and get 32 bits, which gives you a maximum value of 2 ^ 32 - 1 = 4294967295. I think FBI has a routine that does this in his ASM resource thread that you could adapt.

    This is what im saying to Dark Psychic , Its the main reason why I wanna use ASM .

    Another question how can i customize Multichoices Boxes ? Without applying patches?

    Thanks , And im very Honored because im getting infos personally from ASM Veterans(Good at it)
     
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    Thanks for this sir!
    Sir are you busy right now?
    I have so many questions regarding ASM.


    Ok...
    So I personally don't think you need asm for this.

    I have a Bank System and ATM system in my hack as well and the only things I needed asm for was the fact that my Bank System was Custom. Meaning FBI created a Routine that when flag 0x250 is checked it takes the Money won from after a trainer batter and sends it into a Variable instead of the players Money bag.

    He also created an Interest routine so the Bank could build interest over time. However for some reason I couldn't get that one to work, so I need to test it more....

    Now with my Bank System I have one that can hold a max of $65,535 which is the max a Var can hold like stated above...
    I also have one that uses two vars side by side and can hold up to 4bytes of data 0xFFFFFFFF,
    But the only problem with that one I have is the fact that I can't figure out a way to buffer/print the balance to the player..

    Oh and if you want to be able to divide VARs all you have to do is fire up Fire Red Hacked Engine Tool 1.1 and just add all the math specials.... simple as that

    Also I do advise reading JPANs Thumb tutorial doc as its a really good read.

    And also You are right about RAM but only temp vars are deleted when the game is turned off.
    If you need to understand what flags and vars are check this thread out flags, vars and script tile


     

    chestertagat

    Dumbest Person in the World.
    63
    Posts
    11
    Years
  • Hahaha You almost answer all the questions i wanted to ask With your answer Thanks :)

    DarkPsychic said:
    I have a Bank System and ATM system in my hack as well and the only things I needed asm for was the fact that my Bank System was Custom. Meaning FBI created a Routine that when flag 0x250 is checked it takes the Money won from after a trainer batter and sends it into a Variable instead of the players Money bag.
    Do you still have the routine he gave you? cause i need to know the location of the Pointer to the Dynamic Player Money Offset :( If it is ok to you :)

    DarkPsychic said:
    Now with my Bank System I have one that can hold a max of $65,535 which is the max a Var can hold like stated above...
    I have think of that earlier but i thought the max value a var can hod is only 0xFFFF
    so...
    DarkPsychic said:
    I also have one that uses two vars side by side and can hold up to 4bytes of data 0xFFFFFFFF,
    But the only problem with that one I have is the fact that I can't figure out a way to buffer/print the balance to the player..
    I created a routine like this i dont have any problem displaying the text , my only problem is i dont know how to divide in ASM :(
    Heres mine:
    Spoiler:

    DarkPsychic said:
    Oh and if you want to be able to divide VARs all you have to do is fire up Fire Red Hacked Engine Tool 1.1 and just add all the math specials.... simple as that
    can you explain this to me more ?
    Also I do advise reading JPANs Thumb tutorial doc as its a really good read.
    Unfortunately link is Down :( If someone could re-up it somewhere :(

    Thanks Sir for your answers :) Very Helpful Really :)
     
    Last edited:

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Spoiler:
    Do you still have the routine he gave you? cause i need to know the location of the Pointer to the Dynamic Player Money Offset :( If it is ok to you :)
    Spoiler:
    rather certain it's dma-protected and located at like 0x03005008 + 0x4
    this post contains some useful infos on it, but fbi's bank routines in his asm resource thread loads directly from 0x0300500C so idk
    i feel like i would have been able to say for sure yesterday ahaha
     

    chestertagat

    Dumbest Person in the World.
    63
    Posts
    11
    Years
  • rather certain it's dma-protected and located at like 0x03005008 + 0x4
    this post contains some useful infos on it, but fbi's bank routines in his asm resource thread loads directly from 0x0300500C so idk
    i feel like i would have been able to say for sure yesterday ahaha

    Thanks for that link : D Ive been searching for so long :D
    However I cannot fully understand the Routine he/she wrote For I am a beginner at this ASM Language :)
    Commenting On every line is very very helpful :D

    Here's the Routine:
    Haru~ said:
    .align 2
    .thumb

    /*This routine does all the hard work in retrieving your current
    money and stores it in vars 0x8000 and 0x8001.
    0x8000 - Lower half
    0x8001 - Upper half
    */

    main: push {r4-r6, lr}
    ldr r6, .DMA_MAP
    ldr r0, [r6, #0x0]
    mov r5, #0xA4
    lsl r5, r5, #0x2
    add r0, r0, r5
    ldr r1, .OTHER_RAMLOC
    ldr r1, [r1, #0x8]
    bl get_amount /*Does the actual decrypting*/
    ldr r1, .VAR_8000
    str r0, [r1]
    pop {r4-r6, pc}

    get_amount: ldr r4, .DO_CALC
    bx r4

    .hword 0x0000
    .DMA_MAP: .word 0x03005008
    .OTHER_RAMLOC: .word 0x02039934
    .VAR_8000: .word 0x020370B8 /*Var 0x8000-0x8001*/
    .DO_CALC: .word 0x0809FD59
     
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    Hahaha You almost answer all the questions i wanted to ask With your answer Thanks :)


    Do you still have the routine he gave you? cause i need to know the location of the Pointer to the Dynamic Player Money Offset :( If it is ok to you :)


    I have think of that earlier but i thought the max value a var can hod is only 0xFFFF
    so...

    I created a routine like this i dont have any problem displaying the text , my only problem is i dont know how to divide in ASM :(
    Heres mine:
    Spoiler:

    can you explain this to me more ?

    Unfortunately link is Down :( If someone could re-up it somewhere :(

    Thanks Sir for your answers :) Very Helpful Really :)


    Ok...
    The Routines made by FBI are in the ASM Resource thread here on PC in the Research and Development section.
    One routine is for Battle money straight to Var and the other is the Interest routine (if you use the Interest routine then you will need the Minutes framework routine there as well).

    If you don't look around and keep asking for help people will start ignore you until they see you are doing it on your own and making progress... Not being rude either just some advice I was give as well way back when ^_^

    When you have time look up the Binary and Hexadecimal number systems... As that will help greatly
    But yes Vars are 16-bits wide or 2-bytes which = 0xFFFF (in Hex) or 65,535 (in Decimal) max vaule....

    Again Check the tutorial on Flags, Vars and Script Tiles ^_^

    I can tell you right now that that routine would not display a 32-bit (4byte) number using the buffernumber scripting command...
    Displaying numbers from 0-65,535 are no problem with the buffernumber command in XSE but that is because the buffernumber commands only take 16-bit (2byte) numbers....

    So if your Bank or ATM only needs to hold more than 65,535 then I can't help ya there my friend as I still haven't figure that one out my self... hahaha



    As for the ASM tutorial doc from JPAN... Go back to that tread and until you find my post with the re-upload I posted...

    Fire Red Hacked Engine v1.1
    Search it, download it, open the tool, Check all the math specials then hit install, then save.....
    It quite known...
    If download links are ever broken, try to check in the end of the thread to see if someone has re-uploaded it ^_^

    Anyway Good luck my friend
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Thanks for that link : D Ive been searching for so long :D
    However I cannot fully understand the Routine he/she wrote For I am a beginner at this ASM Language :)
    Commenting On every line is very very helpful :D

    Here's the Routine:
    as darkpsychic is very quick to point out, 0xFFFF allows for a maximum value of 65,535 in a single var. this routine deposits your amount into two vars anyways :P
    warning: a lot of stuff in this spoiler
    Spoiler:
     
    Back
    Top