Search the Community
Showing results for tags 'Decode'.
Found 2 results
Hi! I managed to decode Personal Record Keeping to its original Basic Source Code Program. It was done using Web99. I cheated a little to find the startaddress and the endaddress of the LineTable and the startaddress and endaddress of the Basic Program Lines but it's impressive that the binary can be actually decoded. Also the line length doesn't seem to be there at the beginning of each line when compared to a standard binary for a basic program. But i simply read each line til the next 0x00. Once I get Web99 to find the 4 addresses by itsself, the tool will be able to show you the Basic Code of all Command Modules that have been programmed in Basic Language. I worked with the phm3013g.bin file (unzip the .rpk or use the attached file) where I discovered some "HCHAR" in its hexcode with the right tokens infront and afterwards, so I thought, hey this has to be decodable in some way to Basic. After accomplishing it I figured I made it more complicated then necessary since I worked with a GROM dump that had random data in the last 2K of each 8K GROM. Further the 8K blocks on the phm3013g.bin file have a different sort order than the PC99 dumps. I should have started with the PC99 files from the start, as they give you a much cleaner picture. phm3013.grm = phm3013g.bin 0x6000 - 0x77ff = LineNumber Table phm30131.grm= phm3013g.bin 0x4000 - 0x57ff = BASIC Program Lines phm30132.grm= phm3013g.bin 0x2000 - 0x37ff = BASIC Program Lines phm30133.grm= phm3013g.bin 0x0000 - 0x17ff = some other data, probaby the GPL subprograms that RPK provides to TI Basic. It could be that it's incomplete or I got something wrong. Also interesting is the use of special chars for some variables or even Subprogram Names. I had to manually replace a "LineBreak" character as Subprogram name to fix the formatting of the Source Code. Maybe the preferred to have single line characters for variables/subprograms and to save memory and they run out of standard chars. Each TI Basic program files defines the beginning of the Line Number Table in Bytes 2/3 of its binary. The End of the Table in Bytes 4/5. Both Addresses actually point you to a VDP memory. Since we are running the program from cartridge ROM, not VDP, these pointers must be different here. I still need to find those two pointers in such a Grom dump. Any help would be appreciated. In the end I would love to be able to visualize any Basic Source Code, a cartridge contains, and even decode the GPL to GPL Source. Would love to tweak around with Car Wars for example. phm3013g.bin personal_record_keeping_pc99dump.zip personalrecordkeeping-decoded2basic.txt
Here is something I have worked on the weeking. It's some testfiles for un-crunching BASIC programs. The txt files are the LIST output of those programs, so they are matching exactly the way the BASIC INTERPRETER does the uncrunching of each basic line of the program. (Classic99 was used with LIST "CLIP" to generate those txt files) If you compare that to the available tools (TI99DIR, imagetool,...) you will see that all have some issues in recreating that same syntax. Example: Output from TI99dir of Line 4 of XBCMD1 4 ACCEPTVALIDATE("YN"):R$ Output from TiImageTool of Line 4 of XBCMD1 4 ACCEPT VALIDATE ("YN"):R$ while if you LIST the program in the TI99 you will see: 4 ACCEPT VALIDATE("YN"):R$ XBCMD1 contains examples for XB commands from A-P XBCDM2 contains examples for XB commands from P-Z XBCMD3 contains quote examples XBCMD4 contains all characters within strings from 0 to 255. Here the txt File fails for line 100 because it interprets some control character. The examples for XB commands are mostly taken from the XB Manual and are only extended by me if insufficient. I will create some more testfiles and add them as Unit Tests to Web99, so in case i touch the code, I immediately see if I broke some behavior. Feel free to do the same for your projects or use the files to manually test your tool during development. Btw: The programs can be loaded, but running them makes no sense, their purpose is to find out if your Tool decodes a TiFile into the Basic Source Code the same way the Basic Interpreter does. Please provide feedback if you want to use it, so I can provide you with updates. unittest.dsk XBCMD1.txt XBCMD2.txt XBCMD3.txt XBCMD4.txt