Jump to content
Sign in to follow this  
InsaneMultitasker

TIFILES DV80 to ".txt" and back again

Recommended Posts

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. 

 

 

Share this post


Link to post
Share on other sites

I use desktop .txt files for RXB source and Assembly source and TIDIR to make them DV80 for Classic99

  • Like 1

Share this post


Link to post
Share on other sites

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.

  • Thanks 1

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

With TIImageTool:

 

java -classpath tiimagetool.jar de.mizapf.timt.CommandShell type mydisk.dsk FILEONDISK

  • Like 3

Share this post


Link to post
Share on other sites

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
 

  • Like 2

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

 
 

 

 

Share this post


Link to post
Share on other sites
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. 

  • Like 2

Share this post


Link to post
Share on other sites

@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. 

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites
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.  

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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 by atrax27407

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...