Anybody want to write a little code for me? It seems like I make this request about once a year.
Need a program that will read a typical graf-???.prf file and re-assign the hex values as specified by the user. Typically this program would be used to create a blank space in the tile sheet where I could then insert new tiles, while keeping them organized, near tiles of the same type. It's easy enough to move the tiles around. It's incredibly hard to make the prf changes necessitated by such a move.
The program will ask for a range of values to be altered, starting hex address : ending hex address, and then request a third hex address specifying where the values will 'end up'. Given the current prf file format, the program can make the assumption that first value on any given line is the vertical axis (y) and the second is the horizontal (x), not that it matters much as long as the values are handled as pairs.
Bare bones, it can assume that there is only one prf file present and therefore should read any prf file in it's own directory and exactly duplicate it line for line, substituting the altered values in place of the originals. It would output the results to a second file appended with -result.prf. Ideally, it will preform this task for each and every prf file present in it's directory.
In the above example, I'm moving everything in row 0x85, beginning at column 0x95, and dropping it down to the first position in the next row. The program should begin by calculating the difference between the 'starting selection' and 'move selection to' values (in this case it's +1:-21 decimal). It should read through and duplicate the prf sequentially, one line at a time, altering in-range value pairs by the difference as it finds them.
Once again, bare bones, the programs doesn't need to check for user input error. If for some reason it can't complete it's task, it can just crash gracefully or output a file full of garbage, so long as it doesn't destroy the original file.
This program needs to run in windows. Something that can run in a DOS box will be sufficient. Written in C or C++ would be even better, and written as obviously/simply as possible so that I might be able to tweak it with my limited C skills (but anything that does the job as specified here would be just great).
Need a program that will read a typical graf-???.prf file and re-assign the hex values as specified by the user. Typically this program would be used to create a blank space in the tile sheet where I could then insert new tiles, while keeping them organized, near tiles of the same type. It's easy enough to move the tiles around. It's incredibly hard to make the prf changes necessitated by such a move.
The program will ask for a range of values to be altered, starting hex address : ending hex address, and then request a third hex address specifying where the values will 'end up'. Given the current prf file format, the program can make the assumption that first value on any given line is the vertical axis (y) and the second is the horizontal (x), not that it matters much as long as the values are handled as pairs.
Bare bones, it can assume that there is only one prf file present and therefore should read any prf file in it's own directory and exactly duplicate it line for line, substituting the altered values in place of the originals. It would output the results to a second file appended with -result.prf. Ideally, it will preform this task for each and every prf file present in it's directory.
Code:
SAMPLE OUTPUT: GRAF-DVG.PRF FILE FOUND! STARTING SELECTION : [B]0x85:0x95[/B] ENDING SELECTION : [B]0x85:0xFF[/B] MOVE SELECTION TO : [B]0x86:0x80[/B] GRAF-DVG-RESULT.PRF CREATED. FINISHED!
Once again, bare bones, the programs doesn't need to check for user input error. If for some reason it can't complete it's task, it can just crash gracefully or output a file full of garbage, so long as it doesn't destroy the original file.
This program needs to run in windows. Something that can run in a DOS box will be sufficient. Written in C or C++ would be even better, and written as obviously/simply as possible so that I might be able to tweak it with my limited C skills (but anything that does the job as specified here would be just great).
Comment