Posts for Wikzo

Joined: 2/15/2015
Posts: 2
Location: Danmark
Thank you very much. I ended up with this code, which works fine for my purpose :)
require("x_functions");

marioXspeed = 0x0057;

marioyspeed			= memory.readbytesigned(0x009F);
marioxpos			= memory.readbyte(0x4AC);
marioypos			= memory.readbyte(0x4AD);

LogFile = io.open('SuperMarioBros_horizontal_log.txt','w');

s = 0;
FCEU.frameadvance();

while (true) do
  joyput = joypad.read(1);
  s = s+1;

  frame = FCEU.framecount();

  isPressingButton = 0;

if (joyput['left'] or joyput['right']) then
	isPressingButton = 1;
end;

  speedX = memory.readbytesigned(marioXspeed);

  outs = string.format('%d, %d, %d\n', isPressingButton, frame, speedX);

  LogFile:write(outs);  

  FCEU.frameadvance();

end;
print('done');
print(s);


LogFile:close();
Post subject: Using FCEUX to log memory variable over time?
Joined: 2/15/2015
Posts: 2
Location: Danmark
Hi, Watching Double Fine's video on how to hack Zelda, I thought it would be interesting to try out. I think I have found Mario's X velocity in Super Mario Bros. I want to log this data over time, so I can see how his speed changes (going from idle to walking to running). However, I am unsure how to do this. I have tried the various debug and tracing options, but I am a bit confused how to specify the program to only look at a single memory address and its value. It would be nice to log this value and see how it changes for each frame. How do I do this? Thanks :)