X16 Edit - a text editor

unartic
Posts: 145
Joined: Sat Oct 28, 2023 3:26 pm

Re: X16 Edit - a text editor

Post by unartic »

I do think this needs to be addressed :-)

In my case I'm making Ultimate File Manager being able to run from ROM. MooingLemur requested to not use basic RAM. So all data and variables need to be in $0400-$07ff or in a rambank. This requirement will probably be the same for future programs that will be included in rom aswell.

I would suggest there needs to be some agreements on when and how to use the non-basic ram between different ROM programs.

For example: parameter exchanging is best handeled in the $0400-space. Therefor if an inputparameter is needed for a program in ROM it should first read/use all inputparameters, before overwriting the $0400-space. I recon it is a small adjustment which can eliminate these kind of problems in de future.
unartic
Posts: 145
Joined: Sat Oct 28, 2023 3:26 pm

Re: X16 Edit - a text editor

Post by unartic »

Ofcourse we can also use the last 256 bytes or rambank 0, as it is specificaly documented for parameter exchanging, but then 'we' need to agree upon not change the rambank before all inputparameters are read.
Stefan
Posts: 456
Joined: Thu Aug 20, 2020 8:59 am

Re: X16 Edit - a text editor

Post by Stefan »

unartic wrote: Mon Feb 05, 2024 3:40 pm Hi Stefan!

I have found a sort-of bug.

I'm calling the rom based version from assembly.

If I have the filename to be edited at $0444 and call x16edit, I get an error that the file is not found. Looking at memory it seems x16edit is using the $04xx region aswell and probably first uses it, before reading or copying the filename.

I think this is somehting you might want to address as probably many application wil use de $04xx region in the future and some might store the filename in $04xx before calling x16edit.
It’s a bit tricky, as was already mentioned, the editor needs to use some RAM to get going. But I might have a solution:
- On startup, 0x400-0x7ff is copied to banked RAM
- Maybe I can make the editor look for the file name in the backup, if it was in that range
unartic
Posts: 145
Joined: Sat Oct 28, 2023 3:26 pm

Re: X16 Edit - a text editor

Post by unartic »

Stefan wrote: Tue Feb 06, 2024 9:52 am
unartic wrote: Mon Feb 05, 2024 3:40 pm Hi Stefan!

I have found a sort-of bug.

I'm calling the rom based version from assembly.

If I have the filename to be edited at $0444 and call x16edit, I get an error that the file is not found. Looking at memory it seems x16edit is using the $04xx region aswell and probably first uses it, before reading or copying the filename.

I think this is somehting you might want to address as probably many application wil use de $04xx region in the future and some might store the filename in $04xx before calling x16edit.
It’s a bit tricky, as was already mentioned, the editor needs to use some RAM to get going. But I might have a solution:
- On startup, 0x400-0x7ff is copied to banked RAM
- Maybe I can make the editor look for the file name in the backup, if it was in that range
Seems like a perfect solution, with little impact I recon :-)
Stefan
Posts: 456
Joined: Thu Aug 20, 2020 8:59 am

Re: X16 Edit - a text editor

Post by Stefan »

Version 0.8.2 of the editor has been released.

The most significant change is that it uses Kernal functions MACPTR and MSIOUT for faster file read and write.

The ROM based version of the editor also copies the file read and write functions to RAM in order to further improve read and write performance by avoiding unnecessary bank switching. The content of RAM used for this purpose is backed up just before the read or write, and restored immediately when done. The RAM should only by affected by the editor if it crashes during a file read or write operation.

Reading larger files in the ROM based version was effectively 7.2 kB/s and is now 35.4 kB/s according to my tests, an improvement of almost 400 %. Opening a 260 kB text file went from 35 s to 7 s.

The RAM based version of the editor is still a bit faster, reading files at approx 38 kB/s.

Take care, all of you, and have a nice weekend!
Martin Schmalenbach
Posts: 140
Joined: Tue Jul 21, 2020 10:08 pm

Re: X16 Edit - a text editor

Post by Martin Schmalenbach »

Nice one Stefan!

Much appreciated.
geekpower
Posts: 7
Joined: Fri Jan 29, 2021 3:46 am

Re: X16 Edit - a text editor

Post by geekpower »

Perhaps this has already been suggested, or it exists in another text editor that I've yet to find, but I would love to see word wrap as a feature. One of my main goals with my x16 is to use it as a portable word processor. I've built my Commander into the case of an old non-working Zenith SupersPort286.
IMG_1608.jpg
IMG_1608.jpg (3.35 MiB) Viewed 2362 times
User avatar
ahenry3068
Posts: 1136
Joined: Tue Apr 04, 2023 9:57 pm

Re: X16 Edit - a text editor

Post by ahenry3068 »

geekpower wrote: Sun Apr 14, 2024 3:21 pm Perhaps this has already been suggested, or it exists in another text editor that I've yet to find, but I would love to see word wrap as a feature. One of my main goals with my x16 is to use it as a portable word processor. I've built my Commander into the case of an old non-working Zenith SupersPort286.

IMG_1608.jpg
There aren't really any other full featured editors for X16 yet. X16 Edit is IT for the time being. There is a VI clone being worked on though.
Stefan
Posts: 456
Joined: Thu Aug 20, 2020 8:59 am

Re: X16 Edit - a text editor

Post by Stefan »

geekpower wrote: Sun Apr 14, 2024 3:21 pm Perhaps this has already been suggested, or it exists in another text editor that I've yet to find, but I would love to see word wrap as a feature. One of my main goals with my x16 is to use it as a portable word processor. I've built my Commander into the case of an old non-working Zenith SupersPort286.

IMG_1608.jpg
There’re two word wrap features, but it might not be enough if you’re writing a novel 😀

The first one is Ctrl+Z that enables a simple word wrap mode that works as you type, but it doesn’t recalculate word wraps if you go back and delete/insert text.

The second one is Ctrl+J for ”Justify”. It recalculates word wrap for the whole document.
Stefan
Posts: 456
Joined: Thu Aug 20, 2020 8:59 am

Re: X16 Edit - a text editor

Post by Stefan »

X16 Edit version 0.8.3 published: https://github.com/stefan-b-jakobsson/x ... /tag/0.8.3

Main changes since version 0.8.2:

- Rockwell instructions replaced for 65816 compatibility [mooinglemur]
- Updated tool for custom key bindings [TomXP]
- Support for all built-in charsets including thin variants
- Automatic insert of line break at end of file, if missing (Posix standard)
- Update of the manual
Post Reply