One remaining problem in cb2util v1.3
After cleaning out the original Pelican errors from my cheats file, working on a decrypted text file produced by cb2util, I decided to repeat the same kind of test I made before to verify the validity of the recompile process.
So I started with a "cheats_fixed.txt" mentioned above, which is a first level decryption by cb2util v1.3, which I have then cleansed of the errors discussed earlier.
I then recompiled this to a file I named "cheats_fixed.cht", and then did the two types of extraction same as before, so as to get both a "cheats_fixed.asis.txt" and a "cheats_fixed.decr.txt". And then I used WinHEX to compare these two files with each other, byte for byte, which proved that they were fully identical, just like they should be when starting with fully decrypted and valid cheats as in "cheats_fixed.txt".
But for such a case of perfect recompilation and extraction, the resulting new txt files should also be identical to the original "cheats_fixed.txt" file, so I repeated a similar WinHEX file comparison again, this time comparing the 1st-generation "cheats_fixed.txt" with the 2nd-generation "cheats_fixed.asis.txt". And they did not match at all... !!! :(
It turns out to be your 'comment' convention that messed things up again, and this time in such a way that I think you will have to modify your implementation of comments for recompilation.
The original cheat collections from Pelican contain tons of cheat descriptions where the character '#' is used as an abbreviation for the word "number" which means that something important nearly always follows after that character. So some part of the cheat name/description that may be necessary for the user to understand what the code is for, or how to use it, is therefore destroyed when your recompiling code removes all text starting with the # and on to the end of that line.
Here are some examples of vital information destroyed by this comment implementation when recompiling cheats.
"Max Remove (# Of Turns Available In Battle)" => "Max Remove ("
Dragonball Z Budokai:
"#16 Codes" => line removed
"#17 Codes" => line removed
Dragonball Z-Budokai 3:
"Android #16 Codes" => "Android"
"Android #17 Codes" => "Android"
"Selected Panels From 'Ultimate Fantastic Four' #1" => "Selected Panels From 'Ultimate Fantastic Four'"
"Selected Panels From 'Ultimate Fantastic Four' #2" => "Selected Panels From 'Ultimate Fantastic Four'"
"Artwork #1" => "Artwork"
"Artwork #2" => "Artwork"
These are just some very few of the occurrencies of '#' in cheat descriptions of the original cheats collection of CodeBreaker. There are tons and tons more of this stuff, and this makes it unacceptable for cb2util to treat '#' as a comment header in the way that it currently does, so that it and all text following it on a line is removed from a recompiled cheats file.
This is very different from the use of "//" that we discussed earlier, in two significant ways:
1: "//" is not used at all in the original cheat collections.
2: "//" is not commonly used as a standard abbreviation in the english language, whereas the '#' character has traditionally been used as an abbreviation for "number" since a very long time back. (Long before the first computers were invented.)
I hope you will see this as I do, and fix the problem with a new v1.4 release where the recompiler treats '#' as a normal text character. Surely it must be enough to have the "//" sequence for inserting pure source comments that will not be included in the compiled result.
Best regards: dlanor