+9640News Posted February 25, 2023 Share Posted February 25, 2023 5 hours ago, fabrice montupet said: Thank you very much for your Excel workbook and the time you spent for me. I took a look at your work, it's clever and well done. But when I read your first message, I thought that your spreadsheet would help me to easily and quickly make what I would like after (of course) some modification to correspond to my need. But It can't. The Excel process is too heavy time consuming, even more that the one I already do with my HEX editor. No problem. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 26, 2023 Share Posted February 26, 2023 On 2/24/2023 at 3:55 PM, fabrice montupet said: I am seeking the simplest and speediest way to modify the content of TI-99 files (TI or v9t9) in DISPLAY format, in a MacOS or MS-Windows environment. I have to do many of such operations, currently I use HxD and it must be said that it is clearly not practical. If you have some idea, I will be very happy to hear you. Thank you by advance for any program suggestion. Does the DISPLAY format vary from file to file (DV80, DV30, DF80, etc.)? Or, is it always the same format? ...lee 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted February 26, 2023 Author Share Posted February 26, 2023 Al the files have the same DV format, created according the XB code shown in one of my previous messages. The 20 first records have 32 characters length, the 21, 22 and 23th records have 3 characters length, then 24th has 64 characters length, the 25,26 and 27th have 3 characters length and then the last 28th record has 64 characters length. 1 Quote Link to comment Share on other sites More sharing options...
WhataKowinkydink Posted February 26, 2023 Share Posted February 26, 2023 33 minutes ago, Lee Stewart said: Does the DISPLAY format vary from file to file (DV80, DV30, DF80, etc.)? 9 minutes ago, fabrice montupet said: according the XB code shown in one of my previous messages And as the program only specifies DISPLAY then SEQuential and VARiable can be assumed :) Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted February 26, 2023 Author Share Posted February 26, 2023 8 minutes ago, WhataKowinkydink said: And as the program only specifies DISPLAY then SEQuential and VARiable can be assumed And this is why I have precised DV at the begin of my message... that you have truncated ;o) 21 minutes ago, fabrice montupet said: Al the files have the same DV format, created according the XB code shown in one of my previous messages. 1 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted February 26, 2023 Share Posted February 26, 2023 Ok, I think I see what you want... A text editor that does not make any changes to the file, other than the one(s) that you explicitly type in! ...Frustrating, isn't it? 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 26, 2023 Share Posted February 26, 2023 34 minutes ago, fabrice montupet said: All the files have the same DV format, created according the XB code shown in one of my previous messages. Sorry. I should have re-read that message. On 2/24/2023 at 6:37 PM, fabrice montupet said: OPEN #1:"DSK1.MYFILE", DISPLAY This means that the format is DV80, which should be easy enough to manage editing via a number of methods, some of which have already been suggested. I am not sure why you are reluctant to use a conversion from a DV80 file to to a temporary TXT file for Windows/Mac/Linux editing and saved back to the DV80 file. ...lee 2 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted February 26, 2023 Author Share Posted February 26, 2023 8 hours ago, Lee Stewart said: This means that the format is DV80, which should be easy enough to manage editing via a number of methods, some of which have already been suggested. I am not sure why you are reluctant to use a conversion from a DV80 file to to a temporary TXT file for Windows/Mac/Linux editing and saved back to the DV80 file. Thank you for your message. I'm not reluctant to any method that will be quicker than the one I currently use 🙂 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted February 26, 2023 Author Share Posted February 26, 2023 8 hours ago, HOME AUTOMATION said: Ok, I think I see what you want... A text editor that does not make any changes to the file, other than the one(s) that you explicitly type in! ...Frustrating, isn't it? Yes. I often have to edit texts records of these files, but not all of them and not necessary the same ones, among all the files. I am well aware that my ask is very particular. The best solution should be indeed that a program could directly read a DV file and can edit it, a program that seems to not exists today. Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted February 26, 2023 Share Posted February 26, 2023 (edited) I found this... nano-for-windows It almost works, but, inserts a >0A, at the EOF. Don't know why. ...Perhaps can be overcome. It's a COMMAND LINE program ...but, you can drag-n-drop, file names. EDIT: Well, I ran this again. I caught it changing >0D, into >0A. The first run and compare, my hex-editor noticed the difference in length, but than said the files were equal. Edited February 26, 2023 by HOME AUTOMATION Link went awry! 1 Quote Link to comment Share on other sites More sharing options...
SteveB Posted February 26, 2023 Share Posted February 26, 2023 10 hours ago, Lee Stewart said: Does the DISPLAY format vary from file to file (DV80, DV30, DF80, etc.)? Or, is it always the same format? ...lee I haven't found any documentation on the internal structure of the files created by TI in the different modes D/I, V/F, with one ore multiple variables, string or numbers. Is there something available to start with, other than using a Hex-Editor and look up all combinations? I'm quite sure there is something in the various books and online articles, but Google failed me somehow. The TIFILES header is well documented, this won't be a problem. Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted February 26, 2023 Author Share Posted February 26, 2023 (edited) 3 hours ago, HOME AUTOMATION said: I found this... nano-for-windows Thank you for the time you spend to find a solution 🙂 I modified a file using this method, it is less practical as HxD that I currently use because contrary to HxD, nano display files in one line and force to continuously scroll left or right to see/edit the file. However, nano is a really good command line editor, and I keep it in mind for other uses. Edited February 26, 2023 by fabrice montupet 1 Quote Link to comment Share on other sites More sharing options...
+jedimatt42 Posted February 26, 2023 Share Posted February 26, 2023 4 hours ago, SteveB said: I haven't found any documentation on the internal structure of the files created by TI in the different modes D/I, V/F, with one ore multiple variables, string or numbers. Is there something available to start with, other than using a Hex-Editor and look up all combinations? I'm quite sure there is something in the various books and online articles, but Google failed me somehow. The TIFILES header is well documented, this won't be a problem. @SteveB, https://github.com/jedimatt42/tipi/blob/abbefe64b1c4ca224c3d7caf16137ad6dba5339d/services/ti_files/VariableRecordFile.py#L109 Maybe reading my python code will be helpful. A variable record TIFILES format FIAD contains the 128 byte header , and then is followed by the logical sector dump of the file. For a VARIABLE length record file, the records are in the sectors as a linked list. Each record starts with either the offset of the next record (or length of this one, same thing), or 0xff to indicate subsequent records are in the next sector. (Each sector is 256 bytes). There is no end of line in the file format. A record is typically treated as a line. https://github.com/jedimatt42/tipi/blob/abbefe64b1c4ca224c3d7caf16137ad6dba5339d/services/ti_files/FixedRecordFile.py#L130 FIXED length records are easier. Each sector is a 2 dimensional array, There is no offset or length in the individual record, as it is the same across all records. So the FIAD header record length applies. If a record doesn't fit it is implicitly at the beginning of the next sector. So, it is pretty easy for DISPLAY files. INTERNAL is a different story. The values in the record have a leading byte to indicate data type, and then if a String, there is a length followed by the string bytes. Floating point numbers, I believe, have the same format as in memory. Note: the client application (such as TI BASIC itself) is responsible for the representation of multiple values within a record. The disk memory system specs don't care as it sees a record as a single length of bytes and only deals in whole records. (Except the CATALOG file which a disk controller synthesizes to agree with TI BASIC for strings and integers packed as floats.) https://github.com/jedimatt42/tipi/blob/abbefe64b1c4ca224c3d7caf16137ad6dba5339d/services/ti_files/ti_files.py#L205 The above file contains my routines for extracting or creating the TIFILES header... The 'bytes' argument in them is the first 128 bytes of the file, the header bytes. I hope you find that useful. 1 Quote Link to comment Share on other sites More sharing options...
+jedimatt42 Posted February 26, 2023 Share Posted February 26, 2023 (FYI I edited the above message some if you are the type that gets notifications from this site.) Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted February 26, 2023 Share Posted February 26, 2023 On 2/25/2023 at 1:17 AM, jedimatt42 said: Alternatively, command line tools like xdm99.py can convert TIFILES or V9t9 files to plain text, and back pretty easily... xdm99.py -F <FIAD> -o plaintext.txt So if I have a DISPLAY file in TIFILES format named MENU, and I want to convert it to plain text file menu.txt: xdm99.py -F MENU -o menu.txt To convert it back to TIFILES xdm99.py -T menu.txt -o MENU -n MENU You can add a -9 or -t to pick v9t9 FIAD or TIFILES respectively. I second @jedimatt42's idea. This is what I use. xdt99 runs the same on macOS or Windows with Cygwin. I also make use of "od -xa" to view files in hex. 2 Quote Link to comment Share on other sites More sharing options...
SteveB Posted February 26, 2023 Share Posted February 26, 2023 Your text does help ... your code not so much, as I am not a Python programmer and this is just the header-handling, which I know for programs and just need to extend this to data files. I think the focus should be first on DV files first. I don't really understand how lists of variables are handled, i.e. PRINT #1:A$,B$,X,Y . Can they be read with INPUT #1:A$,B$,X,Y with XB? I can't see a delimiter somewhere ... A One-String-Per-Line Editor should be rather easy, but multiple variables are still mysterious to me. I didn't have disks BITD, only stored german/english vocabulary on tape .. this worked and I never asked why. 2 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 26, 2023 Share Posted February 26, 2023 5 hours ago, SteveB said: I haven't found any documentation on the internal structure of the files created by TI in the different modes D/I, V/F, with one ore multiple variables, string or numbers. Is there something available to start with, other than using a Hex-Editor and look up all combinations? I'm quite sure there is something in the various books and online articles, but Google failed me somehow. Here are a couple of TI documents that tell you most of what you need to know: File Management Specification for TI 99_4 Personal Computer V2.5 02-25-1983.pdf Functional Specification for the 99_4 Disk Peripheral V3.0 03-28-1983.pdf Think of DISPLAY file format as exactly what you see on the printed page. If you want to use a DISPLAY file for input, the commas and quotes must be there just as when you compose an INPUT statement. VARIABLE record size format stores as many records as will fit in a sector (256 bytes), with a byte count at the head of each record and >FF immediately following the last record in a sector. For an empty line (no characters), only a null (>00) is stored. Because each record has a count byte and each sector has an end-of-data byte (>FF), the maximum variable record size is 254 bytes. INTERNAL file format (at least in TIB and XB) stores data in machine format, with a length byte preceding each datum: A string is stored as a counted string, i.e., length byte followed by the string. A number is stored with a length byte ( always 8 ) and an 8-byte floating point number. You pretty much have to know the record format for INTERNAL-type files before you read them because there is no clear indicator to distinguish strings from numbers, except that you can be sure that a byte count different from 8 is not a number. The above documents are not crystal clear on some of this information, but most of it is there. ...lee 4 1 Quote Link to comment Share on other sites More sharing options...
SteveB Posted February 26, 2023 Share Posted February 26, 2023 24 minutes ago, Lee Stewart said: INTERNAL file format (at least in TIB and XB) stores data in machine format, with a length byte preceding each datum: A string is stored as a counted string, i.e., length byte followed by the string. A number is stored with a length byte ( always 8 ) and an 8-byte floating point number. The IV files seems to have a Record-Size and an Element-Size from what I've seen in the Hex-Editor. At least easy to keep things apart. DISPLAY is, just like the name suggests, for pretty output, while INTERNAL is clearly meant for further processing. Thank you for the documents, I scanned through them immediately. They are more detailled than the general XB docs, but short on the format of the binary number representation. I will check if this is also RADIX-100, which has also 8 bytes length and is well documented (but not yet fully understood by me... Will work on the page 279 of the EA manual to grasp the concept). It would be nice to have a grid-based editor for INTERNAL files, but on the other hand, I can hardly think if an application today using this, especially the BASIC Compiler only knows DV files. Reading data with random access using REC for game-levels would be great though. I learned now, using DV files would be best to use one variable per record (PRINT, INPUT,LINPUT), with DV not even wasting space. Having one file per "complex record" could make it work when compiling, at least until you reached the 127 files limit, by using dynamic filenames in your program including the "record-number". Not knowing if an eight bit record is a string or a number is irksum, but we know this from Excel... Not always right. If you have a homogenous, repeating structure, you could identify columns as numbers, but XB allows you to PRINT every line differently. I will dive a little deeper and see, if I want to write something for it. 1 Quote Link to comment Share on other sites More sharing options...
SteveB Posted February 26, 2023 Share Posted February 26, 2023 PS: I can confirm, it is RADIX-100 for numbers in INTERNAL ... 2 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 27, 2023 Share Posted February 27, 2023 5 hours ago, SteveB said: They are more detailled than the general XB docs, but short on the format of the binary number representation. I will check if this is also RADIX-100, which has also 8 bytes length and is well documented (but not yet fully understood by me... Will work on the page 279 of the EA manual to grasp the concept). Here is my little dissertation on TI’s radix 100 representation of floating point numbers from my fbForth 2.0: A File-Based Cartridge Implementation of TI Forth: fbForth_2.0_Manual_App_L_p302.pdf ...lee 6 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted February 28, 2023 Share Posted February 28, 2023 To paraphrase a very old song: "It's so nice to have an academic around the house" 2 1 Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted February 28, 2023 Share Posted February 28, 2023 On 2/24/2023 at 2:55 PM, fabrice montupet said: I am seeking the simplest and speediest way to modify the content of TI-99 files (TI or v9t9) in DISPLAY format, in a MacOS or MS-Windows environment. I have written extensions for BBEdit on MacOS. I don't think a plug-in can give the capability to translate file formats during Open and Save. Would you be happy to have a feature like this: 1. Open file, see one big line , like you saw in Nano 2. Select All (⌘ A) 3. Plug-in key (⌘ something) to convert to visible text 4. Edit text 5. ⌘ A ⌘ something : Plug in converts back 6. Save BBEdit, like other text editors, will append a final Newline. That will sometimes be a problem. I think that is an option you can turn off. 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted February 28, 2023 Author Share Posted February 28, 2023 @FarmerPotato : That could be fine! 1 Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted March 2, 2023 Share Posted March 2, 2023 On 2/28/2023 at 1:10 PM, fabrice montupet said: @FarmerPotato : That could be fine! It works. I wrote a C program to pack plain text into DIS/VAR80 sectors. Gotta write the decoder, and TIFILES header. When installed, it appears in the BBEdit menu Text::Text Filters. 1 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted March 30, 2023 Share Posted March 30, 2023 Finally ...My sanity is on-the-mend! ...Above pic. links to page. Use SAVE type, Without extension(*.). Download EditPad Lite 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.