• 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.
  • There is an important update regarding account security and 2FA. Please click here for more information.
  • Our Witching Week events are now on! If you'd like to participate in some fun activities with the community, check out the list of events!
  • 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.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

[ASM & Hex✓] IWRAM location of the DMA pointers to non-temporary variables?

I have ASM code that needs to access a certain variable in the DMA, namely 0x4011, but as you probably know the actual location of this variable in the RAM changes all the time. I could (probably) get around this by using copyvar to 0x8005 or something before callasm-ing (as XSE script is evidently able to bypass this BS), but as this might not be an option in the future I wanted to know how seasoned ASM coders got around this, and the location of the IWRAM DMA cache (which contains pointers to each variable protected by DMA).

Thanks for any help in this matter.
 
Last edited:
I have ASM code that needs to access a certain variable in the DMA, namely 0x4011, but as you probably know the actual location of this variable in the RAM changes all the time. I could (probably) get around this by using copyvar to 0x8005 or something before callasm-ing (as XSE script is evidently able to bypass this BS), but as this might not be an option in the future I wanted to know how seasoned ASM coders got around this, and the location of the IWRAM DMA cache (which contains pointers to each variable protected by DMA).

Thanks for any help in this matter.

Loads the value of the var into r0.
Code:
ldr r0, .Var
bl Var_Load
...

Var_Load:
ldr r1, =0x806E569
bx r1

.align 2
.Var: .word 0x4011
 
Last edited:
Back
Top