+InsaneMultitasker Posted November 8, 2020 Share Posted November 8, 2020 I have a lot of source code on my real hardware that I'd like to migrate to ".txt" format, so that I can upload it to a repository, e.g., github. I'd also like the have ability to then copy the files back to the real hardware. Are there utilities or programs to mass-convert files between the two formats? For example, if I copy the source code for the Geneve OS (comprised of ten subdirectories worth of files) from my MFM drive to a network share drive via my TIPI, how can I easily and quickly convert the TIFILES DV80 files into equivalent text files? TI99Dir has an option to convert files between the two formats though my experience has been that I need to select the name and type for each file. Quote Link to comment Share on other sites More sharing options...
RXB Posted November 8, 2020 Share Posted November 8, 2020 I use desktop .txt files for RXB source and Assembly source and TIDIR to make them DV80 for Classic99 1 Quote Link to comment Share on other sites More sharing options...
pixelpedant Posted November 8, 2020 Share Posted November 8, 2020 Indeed, wasn't batch conversion introduced to TI99Dir in 7.2a? Anyway, it is available in the current version. That is to say, conversion of all selected files to or form PC or TI formats. 1 Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted November 8, 2020 Share Posted November 8, 2020 yep.. tidir tiimagetool and ralph's tools 2 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 8, 2020 Author Share Posted November 8, 2020 35 minutes ago, pixelpedant said: Indeed, wasn't batch conversion introduced to TI99Dir in 7.2a? Anyway, it is available in the current version. That is to say, conversion of all selected files to or form PC or TI formats. Sure enough! My taskbar shortcut to Ti99Dir was pointing to a previous version of TI99Dir that required input for each file. I fired up 7.2a and the conversion process is much more streamlined! I will try this out with a few large batches of files this afternoon. 16 minutes ago, arcadeshopper said: and ralph's tools Is this part of the xdt99 package e.g. xdm? I've tried to use that in the past to convert files but I always get tripped up with the syntax. I'll take another look as I think a few people recommended that earlier this year when I was trying to get the Horizon files up to Git. Quote Link to comment Share on other sites More sharing options...
+mizapf Posted November 8, 2020 Share Posted November 8, 2020 With TIImageTool: java -classpath tiimagetool.jar de.mizapf.timt.CommandShell type mydisk.dsk FILEONDISK 3 Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted November 8, 2020 Share Posted November 8, 2020 from the readme: Convert TIFILES files or v9t9 files to plain files: $ xdm99.py -F <TIFiles file> [...] $ xdm99.py -F <TIFiles file> [...] -9 from the manual To convert in the other direction, we use the "from TIFILES" option `-F`: $ xdm99.py -F ASHELLO -o ashello.obj The conversion becomes even simpler if we use our disk image instead of plain files. The _extract_ option `-e` will create a local copy of a file stored on the disk image. If we combine `-e` with the TIFILES option `-t`, the local file will be in TIFILES format. $ xdm99.py work.dsk -t -e ASHELLO -o ASHELLO $ xdm99.py work.dsk -t -e ASHELLO5 -o ASHELLO5 2 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 14, 2020 Author Share Posted November 14, 2020 Appreciate all the hints and tricks. How are folks dealing with the 'tab' character? For example, I converted one of my simpler source files from .txt to a DV80 file, loaded it into an editor on real hardware, and was inundated with TAB characters. I had to replace them all with spaces before I could assemble code, and then had to reformat my source. Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted November 15, 2020 Share Posted November 15, 2020 17 hours ago, InsaneMultitasker said: Appreciate all the hints and tricks. How are folks dealing with the 'tab' character? For example, I converted one of my simpler source files from .txt to a DV80 file, loaded it into an editor on real hardware, and was inundated with TAB characters. I had to replace them all with spaces before I could assemble code, and then had to reformat my source. I’m considering supporting tab characters in my Stevie editor. Not sure yet what the “proper” way would be, e.g. automatic tab to spaces conversion. Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 16, 2020 Author Share Posted November 16, 2020 15 hours ago, retroclouds said: I’m considering supporting tab characters in my Stevie editor. Not sure yet what the “proper” way would be, e.g. automatic tab to spaces conversion. I think that some support could be a valuable feature. I intend to modify a Geneve editor (P. Muys EDIT) to support the TAB character, though I haven't settled on the approach. For now, I wrote a quick and dirty XB program to convert the tabs into spaces so that they align with Notepad spacing. Seemed to work just fine. Are tab stops consistent for most/all "text" files? Other caveats? I haven't really done much research in this area. 1 !save DSK2.TABIT 100 OPEN #1:"DSK2.INFILE",INPUT 105 OPEN #2:"DSK5.OUTFILE",OUTPUT 110 IF EOF(1)THEN PRINT:"Done!" :: CLOSE #1 :: CLOSE #2 :: END 112 LINPUT #1:A$ :: Q=Q+1 115 DISPLAY AT(24,1):"Line ";Q 120 GOSUB 600 166 PRINT #2:B$ 170 GOTO 110 599 !----------------------- !Tab Routine / Notepad 600 B$="" 610 IF LEN(A$)=0 THEN 690 620 P=POS(A$,CHR$(9),1) :: IF P=0 THEN B$=B$&A$ :: GOTO 690 630 R=INT(P/8)*8+9 :: R=R-P 640 B$=B$&SEG$(A$,1,P-1)&RPT$(" ",R) :: A$=SEG$(A$,P+1,200) 650 GOTO 610 690 RETURN Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted November 16, 2020 Share Posted November 16, 2020 3 hours ago, InsaneMultitasker said: I think that some support could be a valuable feature. I intend to modify a Geneve editor (P. Muys EDIT) to support the TAB character, though I haven't settled on the approach. For now, I wrote a quick and dirty XB program to convert the tabs into spaces so that they align with Notepad spacing. Seemed to work just fine. I knew P. Muys back in the 80’s. We were in the same TI Club in Waregem (Belgium). He lived around 30 kilometers away from where I used to live. Peter got himself a Geneve and I got myself a “PC”. Back in the days he was already programming assembly language, while I went the Pascal and Extended Basic road. Kinda regret that decision though. Looking back I should have bought a Geneve. The funny thing is that I’m now also working on a 80 columns editor for a TMS cpu, albeit 35 years later. 2 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 19, 2020 Author Share Posted November 19, 2020 @FarmerPotato - I saw your post in the Playground topic re: converting files and transferring between TI/PC. Does your described process account for the tab character in the .txt files? I wrote a small XB program (post #10) to properly inject spaces into my files but if another tool does this between PC<>TI that would be of benefit. Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted November 19, 2020 Share Posted November 19, 2020 6 minutes ago, InsaneMultitasker said: @FarmerPotato - I saw your post in the Playground topic re: converting files and transferring between TI/PC. Does your described process account for the tab character in the .txt files? I wrote a small XB program (post #10) to properly inject spaces into my files but if another tool does this between PC<>TI that would be of benefit. No, unless xdm99 did something with tabs, which I doubt. do you mean just changing tabs to spaces when the file is checked out? (not putting them back in?) git has a setting to do this every time. do you mean the tab settings in the last line of the TI file? I forgot about those Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 19, 2020 Author Share Posted November 19, 2020 9 minutes ago, FarmerPotato said: No, unless xdm99 did something with tabs, which I doubt. do you mean just changing tabs to spaces when the file is checked out? (not putting them back in?) git has a setting to do this every time. do you mean the tab settings in the last line of the TI file? I forgot about those When I edit files on the PC and press TAB, the editor advances to the next tab stop. This is represented in the .txt file as 0x09. When the text file is converted from .txt to DV80, these tab characters are not recognized by the TI as a 'tab'. My XB program re-creates the necessary number of spaces to format the file on the TI side. For those of us who use the real hardware to edit and assemble, the formatting can be a real challenge. I thought people would have run into this tab situation by now? I can't imagine that everyone is pressing the spacebar to create the necessary indents per line. Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 19, 2020 Author Share Posted November 19, 2020 28 minutes ago, FarmerPotato said: do you mean just changing tabs to spaces when the file is checked out? (not putting them back in?) git has a setting to do this every time. This sounds like a cool option to try! I don't have anything special set up for git at the moment so I've added this to my list to dig into. Thx Quote Link to comment Share on other sites More sharing options...
atrax27407 Posted November 20, 2020 Share Posted November 20, 2020 I have found it easy to import a file from the PC to the TI with PC-TRANSFER. I then use the F'WEB program editor and us (R)eplace (S)tring to replace the offending tab codes with a space. It is quick and easy. Rather than "reinventing the wheel", I just use existing, simple tools. Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted November 20, 2020 Author Share Posted November 20, 2020 I tried F'web and it does clear up the tabs, but the trouble with replacing the tab one-for-one with a space is that it doesn't preserve the formatting. And not all editors can replace the control codes like tab, including the two main program editors in use with the Geneve. Good option to keep in the arsenal. Quote Link to comment Share on other sites More sharing options...
atrax27407 Posted November 20, 2020 Share Posted November 20, 2020 (edited) If you use the F'WEB program editor, I have found that it produces a file that can be assembled and appears to preserve the formatting. That is especially true on one uses the available A/L source defaults. It automatically sets the tabs (without introducing control characters) and disables word wrap. You can enter the A/L "fixed" mode by pressing CTRL-0 and you will get a diamond shaped cursor. Edited November 20, 2020 by atrax27407 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted March 30, 2023 Author Share Posted March 30, 2023 I finally got around to installing the Git desktop app on my main pc. As a next step, I've managed to use XDT to convert single files from TIFILES to a PC 'plain' file with a few caveats. 1. The file conversion happened in-place, meaning my original file was converted! How can I convert to a target file instead? 2. Is there a way to convert multiple files from source to target? Can it include subfolders? Git doesn't seem to need a file extension as it recognized my test files just fine. For some one-time conversions I can use TI99Dir but I want to be able to kick off something that can automatically convert from TIFILES to plain files, to a target directory, so that I can use Git desktop to sync. Quote Link to comment Share on other sites More sharing options...
apersson850 Posted March 30, 2023 Share Posted March 30, 2023 On 11/20/2020 at 12:08 AM, InsaneMultitasker said: I can't imagine that everyone is pressing the spacebar to create the necessary indents per line. I rely on automatic indentation. Next line same as this, so space or backspace only to increase/decrease. Quote Link to comment Share on other sites More sharing options...
SteveB Posted March 30, 2023 Share Posted March 30, 2023 4 hours ago, InsaneMultitasker said: I finally got around to installing the Git desktop app on my main pc. As a next step, I've managed to use XDT to convert single files from TIFILES to a PC 'plain' file with a few caveats. 1. The file conversion happened in-place, meaning my original file was converted! How can I convert to a target file instead? 2. Is there a way to convert multiple files from source to target? Can it include subfolders? Git doesn't seem to need a file extension as it recognized my test files just fine. For some one-time conversions I can use TI99Dir but I want to be able to kick off something that can automatically convert from TIFILES to plain files, to a target directory, so that I can use Git desktop to sync. DV and DF files are quite simple, I just wrote routines to load and save them for editing in the upcomming TiCodEd version 2.5 ... but this was for in-place editing of DV, DF, IV and IF TIFILES/V9T9 files, not for converting, not for batch processing. If you do Pascal (FPC, Lazarus, Delphi) you may re-use my code for a conversion program or as a blueprint for any other language. Steve Quote Link to comment Share on other sites More sharing options...
+9640News Posted March 30, 2023 Share Posted March 30, 2023 4 hours ago, InsaneMultitasker said: I finally got around to installing the Git desktop app on my main pc. As a next step, I've managed to use XDT to convert single files from TIFILES to a PC 'plain' file with a few caveats. 1. The file conversion happened in-place, meaning my original file was converted! How can I convert to a target file instead? 2. Is there a way to convert multiple files from source to target? Can it include subfolders? Git doesn't seem to need a file extension as it recognized my test files just fine. For some one-time conversions I can use TI99Dir but I want to be able to kick off something that can automatically convert from TIFILES to plain files, to a target directory, so that I can use Git desktop to sync. Something like this would work from the MDOS prompt: TYPE !MAKEFILE > TIP1.?W.!MAKEFILE If you were wanting to transfer MDOS, then you could have a batch file that copies all the files over....... or, rename !MAKEFILE inside $MAKE to a new name. Then, that new filename would reference each individual file against the object file, and rather than have ASM statements, replace with the TYPE filename > TIPI.?W.subdir.filename I did a proof of concept and it works. Beery 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.