nikola-wan
Veteran Member
I really wanted some nice demo pictures on my 4051 so I looked at the .BAS files in the pictures folder and quickly found out that the CRLF has to be replaced with CR. Then I got into trouble since all DATA lines were too long. 4051 is not coping with long lines. I made a small C program that splits up the lines and renumbers the program. I ran a few programs through this utility tool and ran them on my 4051. But it takes forever to download. I am not successful when setting 10 ms character delay. It seems like 100 ms is required!
I found one oddity in the .BAS files in the pictures folder in that the lines 3350 and 3360 appear twice. 4051 will overwrite the first occurrence with the second of course. But I don't really know which is right. However the 4051 produces a correct paint as it seems.
The stargate uni was able to run without any modifications so it appears that .UNI is fine.
MattisLind, I didn't realize you made a pull request on my github repository for the .UNI files you created until today when I was uploading some files.
Nice work on your conversion program.
It pushed me to create a script to convert more of my older uploads which are in two different formats:
1 - my 2000 serial program to transfer 4051 files from tape to the PC used ~<control character letter>~ for each control character
2 - newer uploads and the 405x emulator use the LIST format to serial port <control character letter><backspace><underscore> for each control character
I did some internet searches and decided to try linux sed. I was able to get all the control character edits above, delete NULL characters, and delete the LF from all the CRLFs except the very last one in the file with this one line command:
Code:
for i in ./Originals/*; do sed -e 's/x0//g' -e ':a;N;$!ba;s/\n//g' -e 's/G^H_/^G/g' -e 's/H^H_/^H/g' -e 's/I^H_/ /g' -e 's/J^H_/\n/g' -e 's/K^H_/^K/g' -e 's/L^H_/^L/g' -e 's/_^H_/\x1f/g' -e 's/~G~/^G/g' -e 's/~H~/^H/g' -e 's/~I~/ /g' -e 's/~J~/\n/g' -e 's/~K~/^K/g' -e 's/~L~/^L/g' -e 's/~_~/\x1f/g' $i > uni/`basename "${i%.txt}.uni"` ; done
Using your technique in your shell script to fetch a file from the Originals folder and write the output file to the uni folder.
I also tried to make a script file - but couldn't get the scripts to work in the file.
Using Cygwin terminal, I would just use up arrow to get the command and press return to run it after I had the files to be converted copied into the Originals folder.
Then I checked each of the output files in the uni folder, removing .txt or .BAS from their file name, leaving only .uni as the extension.
I also used Notepad++ on each file to remove the last linefeed at the end of most but not all the files. I did try one experiment with leaving the last linefeed and trying to load the program into the 405x Emulator - but you get a Ctrl-J error, so they must be deleted.
The script is a bit hard to read with a lot of the control characters in Ctrl-V-Character linux regular expression format except for the Ctrl-J linefeed which is \n and the Ctrl-Underscore character which is \x1f.
The script didn't work with the \x hex format for the other control characters. The Ctrl-V-I horizontal tab looks like spaces in the script but it isn't.
Thank you for your help, I have converted and uploaded a couple of the folders on my repository - starting with the "Games in uni format" folder.
I do have to be careful before running the script - any program that is already in uni format will lose all the LFs in PRINT statements, so I have to take those out of the Original folder before running the script.
Last edited: