Interactive Configuration ... lost in bytespace ? Helpertool

GPC script programming for Titan Two device. Code examples, how to, questions, requests.

Moderators: The_Rabid_Taco, pablosscripts, bonefisher

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby USER101 » Sun Dec 30, 2018 12:13 am

I understand this program just checks the IC but since we just copy our entire code could you not just check every single offset being used? Just wondering. I have all of mine written down but that would certainly help for those people that script in certain on the fly changes.
User avatar
USER101
Command Sergeant Major
Command Sergeant Major
 
Posts: 115
Joined: Mon Dec 03, 2018 5:45 pm

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby Scachi » Sun Dec 30, 2018 6:06 am

It is not that easy to check every single offset being used...
how would you check something like that, real code from one of my the division scripts:
Code: Select all
// load data for a weapon slot
void _pmem_load_Weapon(uint8 profile, uint8 wslot) {
  int8 i8dummy; // time id dummy to read int8 and use as int16
  uint8 po = 40*profile;// offset modification to read from the correct pmem location for all profiles
  uint8 wo = 10*wslot;  // offset modification to read from the correct pmem location for all weapon slots
 
  int8  *Vs = NULL;
  int16 *Ts = NULL;
 
  // anti recoil times and values (byteoffset 11..32)
  if (wslot < 2 ) {
    if (wslot == 0 ) {
      Vs = &ARSlot0V;
      Ts = &ARSlot0T;
    } else {
      Vs = &ARSlot1V;
      Ts = &ARSlot1T;
    }
 
    pmem_read(11+wo+po,&Vs[0]);    // horizontal
    //printf("horizontal: %d",Vs[0]);
 
    pmem_read(12+wo+po,&i8dummy)// vertical timers - index for timers
    Ts[0]=i8dummy;
    //printf("timeid from pmem: %d",Ts[0]);
 
    TimeTranslate(Ts)// for combobox id-> timers selection translations
 
    uint8 i, iV;
    iV=1;
    for (i=13;i<21;i++) {
      pmem_read(i+wo+po,&Vs[iV]);   // vertical anti recoil values
      iV++;
    }
 
    // reload on weapon switch times (byteoffset 8,9) , none for sidearm
    pmem_read(8+wslot+po,&WeaponReloadTimes[wslot]);
    //printf("profile %d, weapon load %d done",profile,wslot);
 
  } else { // sidearm has two value only, no timers
    pmem_read(31+po,&ARSlot2[0])// horizontal
    pmem_read(32+po,&ARSlot2[1]); // vertical
  }
 
  // selected fire mode and timing (byteoffset 5.33.35, 6.37.39, 7.41.43
  pmem_read(5+wslot+po,&FMode[wslot]);
  pmem_read(33+4*wslot+po,&FMTimeH[wslot]);
  pmem_read(35+4*wslot+po,&FMTimeW[wslot]);
 
}
 


That it way too much work..it would be like writing a new compiler as it would have to understand every single line of code to be able to track all possible pmem_read and pmem_write usages.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 2242
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby USER101 » Sun Dec 30, 2018 8:56 am

I see. I assumed that every time pmem_write was called it passed a variable that could be traced back. I didnt realize that the variable was dynamic and could be anything. For instance :

Code: Select all
void set_pvar(uint8 idx, int16 val) {
    pmem_write(idx, val);
    pmem_save();
return;

if everyone used set_pvar you could say when set_pvar is used in the code flag the offset and variable type but I see that is not the case because set_pvar could be set_crazyLegs lol.
User avatar
USER101
Command Sergeant Major
Command Sergeant Major
 
Posts: 115
Joined: Mon Dec 03, 2018 5:45 pm

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby UK_Wildcats_Fans » Thu Feb 21, 2019 9:43 pm

This software has really evolved and is very helpful. Is there a way to get export into Excel/CSV format or print it? I often use it to figure out where I need to change or reorganize. Also it would be great to export your Pmem Usage chart.
User avatar
UK_Wildcats_Fans
Brigadier General
Brigadier General
 
Posts: 2107
Joined: Thu Jan 08, 2015 6:53 pm
Location: San Diego, California USA

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby Scachi » Thu Feb 21, 2019 10:11 pm

Good idea.
I think a csv format is the easiest to add as I never used print or xls output via autoit. I'll add that.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 2242
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby UK_Wildcats_Fans » Fri Feb 22, 2019 12:07 am

Awesome. Thank you
User avatar
UK_Wildcats_Fans
Brigadier General
Brigadier General
 
Posts: 2107
Joined: Thu Jan 08, 2015 6:53 pm
Location: San Diego, California USA

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby Scachi » Sat Feb 23, 2019 7:19 am

UK_Wildcats_Fans wrote:Awesome. Thank you

Uploaded version 1.6.15 : https://github.com/J2Kbr/GtunerIV/issues/171
The right-click context menu in the main list now has a "Export as CSV" entry to export both lists into seperate files at once.
Added "B" to the usage chart to indicate bits used by bitsize=1 entries.
X is used for the first 8 bits of a byte, like bitsize=8 or higher
x is used for all other bits of a byte, like bits 8..16 of bitsize=16

I hope I didn't break the error checking with the required changes..hadn't much time to test it.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 2242
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby UK_Wildcats_Fans » Sat Feb 23, 2019 5:55 pm

That was fast. When I run it, I only get the Pmem Usage data in a CSV. The other list is not there. Am I missing a step before exporting to csv? I already had everything checked.
User avatar
UK_Wildcats_Fans
Brigadier General
Brigadier General
 
Posts: 2107
Joined: Thu Jan 08, 2015 6:53 pm
Location: San Diego, California USA

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby Scachi » Sat Feb 23, 2019 7:03 pm

UK_Wildcats_Fans wrote:That was fast. When I run it, I only get the Pmem Usage data in a CSV. The other list is not there. Am I missing a step before exporting to csv? I already had everything checked.

It should export everything and doesn't care about selection.
When I run it for my the divsion script it creates the files:
the_division_scachi_chart.csv
the_division_scachi_data.csv

Can you pm me your script..might be a bug in my program so I can check/debug it.

// edit:
try without changing the default export filename. There seems to be a problem when I change the filename in the dialog. Going to inverstigate it.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 2242
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Interactive Configuration ... lost in bytespace ? Helper

Postby UK_Wildcats_Fans » Sat Feb 23, 2019 7:17 pm

It works when I open the file from your program and then export it. It creates the two file names with data & chart csv files. When I use clipboard, it only gives the one CSV file without data or chart added to the name.
User avatar
UK_Wildcats_Fans
Brigadier General
Brigadier General
 
Posts: 2107
Joined: Thu Jan 08, 2015 6:53 pm
Location: San Diego, California USA

PreviousNext

Return to GPC Script Programming (Titan Two)

Who is online

Users browsing this forum: Google [Bot] and 51 guests