Views: 6,701,024 Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 03-28-24 10:13 PM
Guest:

0 users reading Reading DS RAM in MelonDS | 1 bot

Main - General - Reading DS RAM in MelonDS Hide post layouts | New reply


grondo4
Posted on 09-07-20 06:07 PM Link | #2290
In the past while using DeSmuME I was able to create an application that read memory directly from the emulator's process.
See here: https://streamable.com/7503lt
In this case I read memory directly from the emulator and parse it in my application so I can display the opposing trainer's Pokemon's types and type effectiveness.
However I recently made the switch to MelonDS and found that this method no longer works. I usually find the memory offset's using Cheat Engine but using it on MelonDS it seems that the memory may be in some way obfuscated.
Are there any setting I can change in order to be able to directly read the state of the emulated DS's RAM?

Thank you in advance I understand that this is an atypical use case for the emulator.


Generic aka RSDuck
Posted on 09-07-20 06:59 PM Link | #2291
we currently don't have an scripting or game debugging support which make things like this possible.

Relevant github issue:
https://github.com/Arisotura/melonDS/issues/561

____________________
Take me to your heart / never let me go!

"clearly you need to mow more lawns and buy a better pc" - Hydr8gon

grondo4
Posted on 09-07-20 08:06 PM Link | #2295
RSDuck thank you for your quick reply, that GitHub issue thread was very enlightening.
However, when developing this app for DeSmuME I wasn't using the LUA / debugging features at all, instead I relied on directly accessing the processes memory.
Do you have any insight towards why that technique doesn't work for MelonDS?
In fact when dumping the RAM using the memory debug feature I was able to find the addresses I was looking for.

Generic aka RSDuck
Posted on 09-08-20 02:11 PM (rev. 2 of 09-08-20 02:11 PM) Link | #2302
I see now, the problem is probably that with builds with JIT recompiler enabled we allocate the memory used for most emulated RAM in quite a funky way for fast memory. So MainRAM, etc. are neither statically allocated nor on the normal heap anymore. You can find them by following a pointer (e.g. main RAM or shared WRAM)

____________________
Take me to your heart / never let me go!

"clearly you need to mow more lawns and buy a better pc" - Hydr8gon


Main - General - Reading DS RAM in MelonDS Hide post layouts | New reply

Page rendered in 0.023 seconds. (2048KB of memory used)
MySQL - queries: 27, rows: 82/82, time: 0.017 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.