This is the first version of a Commodore Basic text editor.
It can edit Commodore Basic PRG files, normal text, asm files, d64 files, and data files. It has a few basic tools. Find text: ![]() You can find a text string and choose whether to find forward or backward, case sensitive, and to search only for whole words. After the dialog is closed you can continue to search with the same parameters by pressing the F3 key. Goto line number: ![]() in the center of the screen. In the normal text editor this places the cursor on the exact line number. Line Renumber: ![]() Begin line Is the the first line number of the renumber process. But only when Begin at line number is the same as the first line of the basic program. Otherwise this value is used as the first line that is produced in the renumber process. Begin at line number Is the line where the renumber process begins. If the line number does not exist then renumbering will occur at the next highest line number. All the lines that are below Begin at line number and above End after line number wil not be affected. If the number of lines to renumber and the Line increment produce line numbers above the End after line number value an error will be returned. You can decrease the Line increment value or increase the End after line number value until the renumber process is successful. If there is an error in a basic (GOTO GOSUB THEN) instruction the renumber routine will also give a error. Line increment This value added to the previous line number to produce the next line number. End after line number This normally is the last basic line number. This can be changed to a lower value to limit the number of lines that are renumbered. A higher value than the last basic line number will be ignored and the renumber process will end at the last basic line number. Insert Special Charicters: ![]() This dialog allows you to insert color change, special cursor or screen control characters in the basic text. This saves time looking up the values for PRINTCHR$(147)CHR$(13) and such. Press the button and the character will be inserted at the present cursor position. Configuration Menu: ![]() The default directories for the different sort of files can be set. When you brouwse to find a file the program remembers the last directory which was opened for the sort of file. This is saved. makeing the look up the next file eaiser. The button to the right of the directory name lets you brouwse for a different directory. Assembbler Command Line is the file that is executed to assemble the active window, only when this is a text file. This is normally a script (dos - batch file) that executes the assembler and returns an error value and a text file (err.txt) which is the screen output. The The default fonts and point size for the different sort of files can also be set. The number of spaces for tabs in the normal text edit can also be set. The highlightng of the active line in text files can be turned on or off. D64 File Menu: ![]() The D64 file menu gives the number of free sectors in the d64 file, the file label and format type on the top of the menu. The listing contains the name of the file, the "O" is the open or closed condition of the file. If a "*" is shown then the file is still open. The type of file is next. If "???" is shown then the type is not standard. Deleted files are not shown. The size in blocks of each file is also shown. When you choose a file you must then choose how it is to be opened, as a Basic PRG, a text, or a data file. If a file is chosen to be a PRG file and it cannot be displayed correctly a warning is given. You can change a file name by double clicking on the name and then editing it. If you cancel the operation the name will not be changed. Commodore font change: ![]() These two buttons change the font used by the Basic PRG window. They are now set to --Upper Case-- Pet-SET1.TTF --Lower Case-- PETNEW1.TTF. I will include these fonts with the app. These fonts can easily be installed in Linux or Windows. An idea for the next version would to have a setting in the configuration menu to set these to a user adjustable value. The point size can be changed in the font menu. Decimal to Hex converter: ![]() This is a handy decimal to hex and hex to decimal converter. Type the decimal value in and it will automatically appear in the hex window in hex format. The same for hex to decimal. Results of Assembling: ![]() This dialg shows the result of the assembling of a asm source file. A script (dos - batch file) is usually needed to prouduce an output. It is not necessary but is very handy to see the results. Here are a few examples using the c64 assembler from Ruud Baltissen. This is a 16 bit dos based assembler. ___________________________________________________________________________________ Here is a unix script to procduce the output: #The unix text file format must be changed to dos format for the dos mode assembler unix2dos $1 $1 a=$1 #the first 12 characters of the input file name must be striped to give the path that is used by dosbox #this changes /media/DISK6/Compilers/Ruud/MP-ASM/ to \COMPIL~1\Ruud\MP-ASM\ for dosbox b=${a:12} #If an error occurs in the assembler a .BIN file is not produced. Since dosbox cannot #return an error code the missing .BIN is the signal that an error has occured #Make a string that is the same as the input string but the extension is changed form .ASM to .BIN #The extension of the asm file must be .ASM(.asm). #This assembler always produces file names in upper case. #Get the file extension. d=${a:(-3)} #Now check if it is upper case. if [ $d == "ASM" ] ; then c=${a/.ASM/.BIN} fi #Or lower case and change it to (BIN). if [ $d == "asm" ] ; then c=${a/.asm/.BIN} fi #Delete the *.BIN file. rm -f $c #Use dosbox to execute the assembler program. Make sure for this assembler, that all file names and #directories are in the dos 8.3 naming format. Notice that the screen output of the assembler is #made into the file err.txt dosbox -c c: -c "cd \COMPIL~1\Ruud\MP-ASM" -c "MP-ASM.EXE /F$b > \COMPIL~1\Ruud\MP-ASM\err.txt" -c exit #move the error file to the place that CommodoreEditor knows where it can be found mv -f /media/DISK6/Compilers/Ruud/MP-ASM/err.txt err.txt #If the .BIN file exists then there was no error so exit with a 0 error value if [ -e $c ] ; then exit 0 else #else give a 1 for an error exit value. exit 1 fi For a unix based cross assembler a much simpler script can be made. ___________________________________________________________________________________ Here is a dos (Windows 95 - XP) batch file to procduce the output: E:\Ruud\MP-ASM\MP-ASM.exe /f%1 > err.txt if errorlevel 0 if not errorlevel 1 exit 0 else exit 1 For Windows7 something similar to the unix script must be used for Ruuds assembler. dosbox must be used to start the assembler. Remember Ruuds assembler can only handle the dos 8.3 file and directory names. Here are two scripts that use DosBox on Windows7 64bit. The first one will produce a *.prg file, the second copies the same file to another without the 'PRG' extension. No Rename set "capname=%~nx1" set "onlyname=%~n1" set "bnam=.BIN" set "binname=%onlyname%%bnam%" "C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe" -c "cd mp-asm" -c "del %binname%" -c "mp-asm /f%capname% > err.txt" -c "exit" copy C:\Commodore\dosprogs\MP-ASM\err.txt C:\Commodore\CommodoreBasicEditor\err.txt if exist C:\Commodore\dosprogs\MP-ASM\%binname% ( exit 0 ) else ( exit 1 ) Remove the ".PRG" extension set "capname=%~nx1" set "onlyname=%~n1" set "bnam=.BIN" set "pnam=.PRG" set "binname=%onlyname%%bnam%" set "prgname=%onlyname%%pnam%" "C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe" -c "cd mp-asm" -c "del %binname%" -c "mp-asm /f%capname% > err.txt" -c "exit" copy C:\Commodore\dosprogs\MP-ASM\err.txt C:\Commodore\CommodoreBasicEditor\err.txt if exist %~dp1\%binname% ( copy %~dp1\%prgname% %~dp1\%onlyname% exit 0 ) else ( exit 1 ) Saving Files: Saving a PRG file will write a normal Basic PRG file to the disk or to the D64 image chosen. Saving a text file will save the exact file to disk or D64 image. Saving a data file is different. The data itself is written to disk or the D64 image, not the text seen in the dump. You can copy the text and paste it into another normal text file and save that. This is the first release of this program so there will certanlly be quite a few bugs. But I have done my best in the short time I had to put this program together. Any comments or bug reports can be sent to me at drs@vzg.nl: This software is copyrighted under the GNU GENERAL PUBLIC LICENSE. You should find this in the directory with the source code. Problems with startup If problems occur with starting up the program go to your user directory and delete the (.CommodoreBasicEditor) directory. In Windows7 you have to share the (.CommodoreBasicEditor) directory with all users otherwise the program will not come up the next time you try to start it. |