Jump to content

X16 Edit - a text editor 0.4.0

   (2 reviews)

1 Screenshot

About This File

X16 Edit is a text editor for the Commander X16 platform.

Design goals:

  • Use plain text files
  • Store text buffer in banked RAM (512KB to 2 MB) 
  • Handle large texts efficiently
  • Simple modeless user interface inspired by GNU Nano
  • Implement basic editing functions well - refrain from making the program too feature-rich
  • Support both ISO and PETSCII modes

Tested with emulator version r38. Run with the following command:

  • x16emu -sdcard sdcard.img -prg X16EDIT-x.x.x.PRG -run

where x.x.x is the program version.

You can also run the program with the "Try it now" button. There is, however, no attached disk in the online emulator, and consequently you cannot save or open files. Also, some of the Ctrl+key sequences are not working in the online emulator. To fully test the program you still need to download and run it locally.

Please read the attached file romnotes.pdf if you want to try the ROM version.

Source files available at https://github.com/stefan-b-jakobsson/x16-edit

Released under GNU General Public License v 3 or later.








What's New in Version 0.4.0   See changelog


This release is made for the current Github master branch of the X16 Kernal and emulator, what is expected to become version R39. It will not work on Kernal/emulator R38 or earlier.

The keyboard routines have been redesigned in many ways using a custom PS/2 scan code handler, a new feature of the upcoming R39 Kernal. The custom handler keeps track of modifier key status finally solving the problem of overlapping values returned from the Kernal GETIN function (for instance, GETIN returns the same value for ESC and Ctrl+C). The custom handler also enables some keys not supported by the Kernal such as PgUp, PgDn, End, Delete (not to be confused with Backspace), and the numerical keypad keys.

In this version the cursor is changed from a blinking underscore to a blinkning block, much like in the BASIC editor. In previous versions, a sprite was used as cursor. The blinking underscore worked, but when the cursor moved for longer distances, for example when searching, it was a bit hard to find the cursor again. The sprite option was originally used as I hadn't come up with a good solution for a block cursor that worked in ISO mode where all characters do not have a reversed version of themselves. At last I came up with the idea to show the cursor by reversing the background and foreground colors. And this works nicely both in PETSCII and ISO mode.

The cut, copy and paste functions was fixed to work more like GNU Nano. In earlier versions the cut/copy buffer was cleared when pasted into the current file. In this version the cut/copy buffer is not cleared which makes it possible to paste the content several times. The cut/copy buffer is cleared the first time you cut or copy a line after pasting.

A minor change was made to the search function. In earlier versions it would start searching from the position of the cursor. This meant that you could not make repeated searches for the same keyword without manually moving the cursor forward at least one step between each search. From this version, the search starts from the character after the current cursor position making repeated searches easier.

Apart from that, some code and UI cleanup to make the user experience better (I hope).

The differences to the X16EDIT-PRE-39.PRG file previously uploaded to this site (not a proper release) are quite small, but this version should be more stable and have fewer glitches.






GNU General Public License v 3 or later
  • Like 8
  • Thanks 1

User Feedback

Join the conversation

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



   2 of 2 members found this review helpful 2 / 2 members

This could be the beginning of a REAL built in BASIC  programming editor. Very nice work.

Response from the author:


A text editor is a programmer's tool. If the X16 is to become something more than a games console, you must be able to use it for native program development.

The editor could be used for any programming language. A version of Forth (Volksforth) is already published on the site, and it reads source code from text files. The same person is also working on a C compiler that runs natively on the X16, which sounds promising. An assembler that takes text files as input is at the top of my own wish list, much like the Commodore macro assembler I once purchased and used as a teen in the 80s. Editing Basic files is of coarse also very interesting.

Maybe someone out there is interested in writing any of these. If you have a solution, I'm very interested in integrating it with the editor, so that the programs play nicely together.

The new version published today is mostly focused on that kind of integration. The zero page and lower RAM usage has been minimized. The ROM version lets the user set what banks of the banked RAM is used by the editor. And the editor now takes a snapshot on startup of the zero page and lower RAM it uses, so that those memory locations can be restored on program exit.

  • Like 2
Link to review

   1 of 1 member found this review helpful 1 / 1 member

Outstanding editor!  I have been using nano on the command line for years when developing, and this like solution is so intuitive and natural to use.  I will be working on the ROM integration next so

it can be coupled with the cc64 compiler being developed.  Thanks so much for porting to the x16.

  • Like 2
Link to review
  • Create New...

Important Information

Please review our Terms of Use