Interactive Configuration ... lost in bytespace ? Helpertool

Tutorials, How-tos and FAQs for the Titan Two device.

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

Postby DontAtMe » Tue Oct 22, 2019 2:40 am

I'm getting a bunch of false errors with this script.
Code: Select all
/* <cfgdesc>>
[Bitsize 1]
shortdesc = <b>Min = 0 | Max = 1
control = slider
default = 0
minimum = 0
maximum = 1
step = 1
border = 0
 
[Bitsize 2]
shortdesc = <b>Min = 0 | Max = 3
control = slider
default = 0
minimum = 0
maximum = 3
step = 1
border = 0
 
[Bitsize 3]
shortdesc = <b>Min = 0 | Max = 7
control = slider
default = 0
minimum = 0
maximum = 7
step = 1
border = 0
 
[Bitsize 4]
shortdesc = <b>Min = 0 | Max = 15
control = slider
default = 0
minimum = 0
maximum = 15
step = 1
border = 0
 
[Bitsize 5]
shortdesc = <b>Min = 0 | Max = 31
control = slider
default = 0
minimum = 0
maximum = 31
step = 1
border = 0
 
[Bitsize 6]
shortdesc = <b>Min = 0 | Max = 63
control = slider
default = 0
minimum = 0
maximum = 63
step = 1
border = 0
 
[Bitsize 7]
shortdesc = <b>Min = 0 | Max = 127
control = slider
default = 0
minimum = 0
maximum = 127
step = 1
border = 0
 
[Bitsize 8]
shortdesc = <b>Min = 0 | Max = 255
control = slider
default = 0
minimum = 0
maximum = 255
step = 1
border = 0*/

 
uint8 b1, b2, b3, b4, b5, b6, b7, b8;
init {
  pmem_load();   /*
 
[Bitsize 1]
bitsize        = 1
byteoffset     = 0
bitoffset      = 0
*/
  pmem_read(0, &b1); /*
 
[Bitsize 2]
bitsize        = 2
byteoffset     = 0
bitoffset      = 1
*/
  b2 = (pmem_read(0) >> 1) & 1; /*
 
[Bitsize 3]
bitsize        = 3
byteoffset     = 0
bitoffset      = 3
*/
  b3 = (pmem_read(0) >> 3) & 1; /*
 
[Bitsize 4]
bitsize        = 4
byteoffset     = 1
bitoffset      = 0
*/
  pmem_read(1, &b4); /*
 
[Bitsize 5]
bitsize        = 5
byteoffset     = 2
bitoffset      = 0
*/
  pmem_read(2, &b5); /*
 
[Bitsize 6]
bitsize        = 6
byteoffset     = 3
bitoffset      = 0
*/
  pmem_read(3, &b6); /*
 
[Bitsize 7]
bitsize        = 7
byteoffset     = 4
bitoffset      = 0
*/
  pmem_read(4, &b7); /*
 
[Bitsize 8]
bitsize        = 8
byteoffset     = 5
bitoffset      = 0
*/
  pmem_read(5, &b8); /*
 
</cfgdesc>*/

 
}
Image
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

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

Postby Scachi » Tue Oct 22, 2019 7:02 am

Thank you for the information.
I never thought that a IC like this will work at all.
I didn't know that you can split one definition over several locations in the code.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

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

Postby J2Kbr » Tue Oct 22, 2019 9:08 am

Scachi wrote:I didn't know that you can split one definition over several locations in the code.

I also didn't know about that. I am actually surprised. The ini file parsing library we are using is robust enough to handle/ignore the GPC code in the configuration descriptor file. :smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

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

Postby Scachi » Tue Oct 22, 2019 11:36 am

I have uploaded version 1.6.22. It isn't reporting bitsize < 8 as error anymore.
https://github.com/J2Kbr/GtunerIV/issues/171
It still reports error for this kind of split definition IC. The program isn't able to handle that without a lot of work.

I am in the process of rewriting this program using QT and will support that there.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

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

Postby Buffy » Tue Oct 22, 2019 5:10 pm

One possible suggestion, get all comments and merge them into one (and remove them from the raw code), then lex through the remaining code.
ConsoleTuner Support Team || Discord || Custom Scripts
User avatar
Buffy
Lieutenant
Lieutenant
 
Posts: 422
Joined: Wed Jul 20, 2016 5:23 am

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

Postby Scachi » Tue Oct 22, 2019 5:18 pm

Buffy wrote:One possible suggestion, get all comments and merge them into one (and remove them from the raw code), then lex through the remaining code.

I will still reading them by each [name] found with all following fields individually.
But before adding them to the list I will check if the name already exists in this list.
If it is new then add it.
If it exists I will check if they merge without any problems (no important keywords defined twice) and merge them
or keep them separate when they can't be merged and add a note to both. This will keep the IC definitions untouched in case the user used copy&paste and forgot to change its name.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

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

Postby Scachi » Sat Oct 26, 2019 7:10 pm

DontAtMe wrote:I'm getting a bunch of false errors with this script.

You can try the QT version of my tool:
https://github.com/Scachi/IC-Bytetable/ ... /Test_0002
It has some improvements on bit handling. It also support creation of AND / OR configstrings for use as presets to toggle specific bits of a byte only.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

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

Postby Prototype » Sun Oct 27, 2019 7:28 am

Awesome, thank you :joia:
Console tuner since my 1st controller.
Scripting, a game in the game.
Believe or dare, It's Titanic! :smile0517:
User avatar
Prototype
Major General
Major General
 
Posts: 3251
Joined: Sun Dec 16, 2012 1:43 pm

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

Postby DontAtMe » Sun Oct 27, 2019 9:07 pm

Scachi wrote:
DontAtMe wrote:I'm getting a bunch of false errors with this script.

You can try the QT version of my tool:
https://github.com/Scachi/IC-Bytetable/ ... /Test_0002
It has some improvements on bit handling. It also support creation of AND / OR configstrings for use as presets to toggle specific bits of a byte only.


I cannot get it to open.
Image
Image

These files are in the lib's folder tho, and they are not blocked.
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

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

Postby Scachi » Sun Oct 27, 2019 9:28 pm

Which windows version and 32bit o r 64bit are you running ? I am on windows 10 pro x64
This is my first windows app with qt using qtcreator.
It is probably me missing some linking or whatever else of all the stuff I don't understand.


@prototype : is this program working for you ?
Last edited by Scachi on Sun Oct 27, 2019 9:52 pm, edited 1 time in total.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

PreviousNext

Return to Tutorials and FAQs

Who is online

Users browsing this forum: No registered users and 48 guests