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

Author Topic: Code Skipping in Gens Tracer and Gens r57shell Mod Trace Files  (Read 1195 times)

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 360
    • View Profile
    • My Brill Game Site
Code Skipping in Gens Tracer and Gens r57shell Mod Trace Files
« on: January 19, 2016, 07:54:07 am »
Gents,

I'm trying to find out how, and even if, the two tracing versions of Gens decide if they are going to skip logging an instruction to their trace.log file.

According to the Trace readme file that comes with them they will only log an instruction at a given address once per trace run (1 'run' being when you turn tracing on and then off again) but I can see this is not the case, at least not in r57shell, by looking at the log file that is produced.

Now I can see the source to r57shell is available here: https://github.com/lab313ru/Gensida (at least it is the source to a plug in based on it) and looking through the tracer.cpp file there I can see no mention or areas that look like they are filtering data. It is possible that the data isn't filtered in r57shell and the help file has just became outdated since the update was introduced. Equally possible is that this isn't the area of the program dedicated to writing file output which is likely as I see no references to that either, just to the debug window!

Can anyone offer any more information on how the filtering process actually works and if it is possible to turn it off so that every instruction that is executed gets logged (happy to edit the source and rebuild if required)?

January 21, 2016, 08:06:54 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I ran a quick experiment last night and found I got the same instruction logged 64 times in both cases with a gap of about 100 instructions between them. I'm not saying there is a cap at 64 times for logging the instruction, in fact I am not saying anything as it is too early to draw any proper conclusions and I didn't have enough time to do any proper work on it.

My process was:
  • Started up the rom (Toejam and Earl since everything I do is about T&E just now).
  • Started a new game as quickly as possible to get to the point where Toejam is standing on level 1.
  • Put on single frame advance and advanced the frames to frame 1000
  • Enabled tracing.
  • Frame advanced to frame 1100.
  • Disabled tracing.
  • Renamed the trace file.
  • Repeated the process this time advancing for 1000 frames rather than 100.
  • Compared the resultant files.

Obviously they didn't line up perfectly from the very first instruction logged since frames don't work like that (I may have taken a few frames longer on the menu screens for example) but they lined up pretty well when I searched for an arbitrary instruction in both files.

What was interesting is that this instruction was executed in both files exactly 64 times, despite the length of time logging in the second one being 10 times longer. It could just be that this address is part of a loop in the game that happens to execute 64 times (or in these instances happened to) which I think is the likely theory but like I said I need to check it out more.
[/list]
« Last Edit: January 21, 2016, 08:06:54 am by RyanfaeScotland »

Tony H

  • Full Member
  • ***
  • Posts: 107
    • View Profile
    • The Code Hut
Re: Code Skipping in Gens Tracer and Gens r57shell Mod Trace Files
« Reply #1 on: January 21, 2016, 11:08:37 pm »
The Readme file says: "Setting 'hook_pc* 1 <start address> -1' will blindly log all instructions when it first reaches the start address. Turning off memory logging will stop."  I've tried it a few times in the past and it works fine, except the game slows waaaay down when the logger is activated (and I have a fairly fast PC). The file it generates is HUGE.  I've only done this with Gens Tracer, so don't know if applies to r57shell.
The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 360
    • View Profile
    • My Brill Game Site
Re: Code Skipping in Gens Tracer and Gens r57shell Mod Trace Files
« Reply #2 on: January 22, 2016, 03:32:05 am »
Thanks Tony. Yea I've read through that file a few times but there is another file inside the Tracer Help directory that elaborates further saying something along the lines of 'each instruction is only logged once by the tracer to reduce the size of log files' (I'm paraphrasing here since I'm at work and don't have the file to hand).

Was looking for someone to give a definitive answer on it but will continue to investigate it myself in the meantime.

BTW I used one of your GG codes to help someone get Cool Spot up and running on their EverDrive yesterday. As soon as he said he was getting the lockout screen I thought of your site probably having a code to skip it. He was most grateful. :)