News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Accessing Player Info from LttP - Need pointing in the right direction  (Read 1484 times)

NoobWulf

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hey guys,

I've never worked on any kind of romhack project before, but am a hobbyist game developer and professional software developer.

A friend of mine asked me to write a small program for them that takes a few cues from LttP, the idea is that when the player hits certain
objectives a video will play, or a piece of stage lighting will be triggered. Now, I've got all the rest of the stuff I need working but
I haven't really got the first idea where to start looking for how I get pieces of information from the game.

The stuff I need is quite simple, things like the current map, players current location, currently equipped items, etc. So I wondered if anybody could
point me in the direction of any documentation that might tell me where that information is in memory and how it's represented.

As an example, this is the sort of thing I'm looking to do: Player picks up an item -> the emulator picks up on this and informs my program of the event, my program then triggers as an example a stage light and a piece of music. I've grabbed the Snes9x source code but haven't had much time to look at it yet, I figured it's probably quite easy to access the game memory from inside the emulator, I'm just not sure what I'm looking for once I get there.

Thanks in advance guys, really appreciate any help I can get.

edit: Sincerely apologize if this is in the wrong subforum, wasn't sure if it should be here or in rom hack discussion.

FAST6191

  • Hero Member
  • *****
  • Posts: 3087
    • View Profile
I lack the time right now to cover this and I am not one for SNES hacking usually, http://datacrystal.romhacking.net/wiki/The_Legend_of_Zelda:_A_Link_to_the_Past has a few things that might help (it even links a disassembly which will probably include a few memory locations).
What I am more here to say is look at the tool assisted speedrun crowd -- they often wind in Lua support to the emulators used, said lua also being aware of the internals (and available at least as memory locations as they would appear to the device being emulated). Granted most emulators have not heard of ASLR and dynamically allocated memory (at least not for the core components of it, plugins might vary) but it is surely easier to at least have Lua be an intermediate layer.
http://tasvideos.org/LuaScripting.html for a start, most look more to the Lua abilities of FCEUX (NES emulator, http://www.fceux.com/web/help/LuaFunctionsList.html ) and Desmume (DS emulator) but it is available for most things.

NoobWulf

  • Newbie
  • *
  • Posts: 2
    • View Profile
Oh wow that's brilliant advice, thank you so much for the swift response, too. I'll take a look at the TAS speedrun crowd. Thanks.