Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory readings over network constantly give wrong values #685

Closed
1 task done
Readek opened this issue Mar 16, 2025 · 5 comments
Closed
1 task done

Memory readings over network constantly give wrong values #685

Readek opened this issue Mar 16, 2025 · 5 comments
Assignees
Labels
bug Something isn't working priority - medium

Comments

@Readek
Copy link

Readek commented Mar 16, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Affected Build(s)

2120-RC1

Description of Issue

The emu is able to send memory readings over sockets, something that allows third party apps to communicate with the game's memory both to read and write. In Azahar, however, the values the emulator is giving make no sense and shift constantly. I'm currently developing an app to read from Pokemon games, and I'm unable to support Azahar because of this. I'm unsure where the issue could be or if this behavior is intended and there should be a new way of doing memory reading (documentation for this basically doesn't exist), but its important to note that this started happening first on the last MK7 citra release, but not in the latest Lime3DS release.

I can't really show clear examples of this, but I can show what happens in my app when reading supposedly static data:

simplescreenrecorder-2025-03-16_21.28.18.mp4

Expected Behavior

Here's an example recorded on Lime3DS 2119 where everything works as expected:

simplescreenrecorder-2025-03-16_21.32.12.mp4

Reproduction Steps

Using sockets to ask the emulator for the game's memory.

Log File

azahar_log.txt

System Configuration

CPU: AMD Ryzen 5 7600
GPU/Driver: AMD RX 7600 / Mesa
RAM: 32GB
OS: Arch Linux

@Readek Readek added the bug Something isn't working label Mar 16, 2025
@Readek
Copy link
Author

Readek commented Mar 17, 2025

After more testing, it seems like everything works as expected on Windows, meaning this has probably something to do with the Linux build.

@Readek Readek changed the title Memory readings over network constantly give wrong values Memory readings over network constantly give wrong values on Linux Mar 17, 2025
@PabloMK7
Copy link
Member

Uh, I didn't even know this feature existed. x)
I'm not sure how it could be broken on Linux considering we didn't make any changes.

@Readek
Copy link
Author

Readek commented Mar 17, 2025

Oh. Uh, yeah, as far as I know, documentation for this never existed, but this is what the script at scripting/citra.py does. It requests data to the emulator in very small chunks over the network, allowing for game memory read/write. The script itself actually isnt necessary to the emulator whatsoever (seems to be just an example), and since it uses sockets and the emu is always listening, any kind of 3rd party app can just replicate what that script does to ask to the emu without the user having to do any extra script setups unlike other emus where LUA scripting is the norm for memory read/write.

@OpenSauce04
Copy link
Member

Oh I always wondered what that Python script did. Neat.

@Readek Readek changed the title Memory readings over network constantly give wrong values on Linux Memory readings over network constantly give wrong values Mar 18, 2025
@Readek
Copy link
Author

Readek commented Mar 18, 2025

I did some more testing, deleted all previous configs and didn't import any Citra or Lime configs. Running a clean Azahar version somehow fixed the issue. Worth noting that when I tried this on Windows, it was also a clean install. Maybe it has something to do with an actual NAND import, as my previous Lime config had my actual 3DS on it? Either way, the issue does not happen without it.

@Readek Readek closed this as completed Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority - medium
Projects
None yet
Development

No branches or pull requests

3 participants