RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    "Win" and "game over" status access via a script!

    Scheduled Pinned Locked Moved Help and Support
    retroarchgame statusmemory address
    5 Posts 2 Posters 529 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mohsen
      last edited by Mohsen

      Hi,
      I wonder if is that possible to access "win" or "game over" status while some game is running in retroarch? I want to write a python script and monitor game status (which game is running? how much time passed? how much credits does the player have? and get an event when he looses or he wins).
      I am familiar with cheats and actually I've found those memory addresses in cheat menu, but I don't know how to monitor that memory address in my python script?
      Thanks.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        As far as I know, there's no method to fire a script/custom action when certain conditions regarding game's memory are met. There is the RetroAchievement code that calls stores/triggers an achievement or there's the ability to make the controller rumble based on a 'cheat code'.

        RetroArch also exposes the emulated game's memory via the network control interface with the READ_CORE_RAM command, but that's a polling approach which may not yield the best results.

        M 1 Reply Last reply Reply Quote 0
        • M
          Mohsen @mitu
          last edited by Mohsen

          @mitu
          Wow, network control interface is a great feature which I didn't know anything about that. But unfortunately "_ READ_CORE_RAM_" command didn't work for me. I monitored verbose log of retroarch and it showed that command is "unrecognized command". I tried "READ_CORE_RAM" but nothing happened.
          Could you please explain how to use that command exactly to receive RAM data?
          Thanks.

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            @Mohsen said in "Win" and "game over" status access via a script!:

            Could you please explain how to use that command exactly to receive RAM data?

            I think you need to add the address and the number of bytes read - see here. It seems like it works only if achievements are supported for that core, since it uses the cheevos functions. See the discussion here for some usage examples.

            What version of RetroArch and what core are you using ?

            M 1 Reply Last reply Reply Quote 1
            • M
              Mohsen @mitu
              last edited by

              @mitu
              It worked! thanks a lot.
              I'm using "Version: 1.4.1" for retroarch.
              I just wrote a script in python to send UDP packets with this command
              "READ_CORE_RAM <address> <len>"
              Then I received related bytes.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

              Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.