Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: ANSI editor  (Read 2729 times)

0 Members and 1 Guest are viewing this topic.

HonestFlames

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
ANSI editor
« on: September 09, 2010, 06:17:03 AM »

As part of my re-introduction to the Amiga 1200, I started a project mid-August. It's an ANSI editor. An app which is already obsolete, but it's something I was going to write many years ago (when it would have been relevant).

I reached something of a milestone with it, this week. It can now save a coloured ANSI file. It's not yet perfectly optimised, but it's reached a stage where I now just need to polish up some form of user interface and file requester. Version 1 might still be a week or two away, but I'll see about some screenshots and a page on my blog, after I've got a toolbar done. No point releasing any early beta version, as it doesn't need a lot of testing.

I'll be making the source available and will include it in the release. I'll maybe post my changelog here, depending on how geeky I'm feeling later today  ::)
Logged

HonestFlames

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: ANSI editor
« Reply #1 on: September 09, 2010, 07:00:23 PM »

Well, here's progress so far...

.--------------------------.
| V0.15 8th September 2010 |
`=========================='

The save routine appears to be now well optimised (in terms of minimising
the number of CSI escape codes for any given coloured output). There's still
one case where it fails to do the best job, but I'll nail that tomorrow.

I'm not so happy with the speed the save routine runs at, but the Amiga is
not a quick machine and AMOS is not a quick language. Upwards of 5 seconds
to save a screen full of ANSI with a few colour changes in it (on an
unexpanded A1200 before compiling the program). There's little I can do to
make it run any faster.


.--------------------------.
| V0.14 7th September 2010 |
`=========================='

Added logic to determine correct and efficient colour change CSI escape codes
to output an efficient ANSI text file.

This is a tricky manipulation of logic. It's really easy to write an
inefficient routine which saves ANSI text files. They render fine, but they
are full of redundant CSI escape codes.


.--------------------------.
| V0.13 6th September 2010 |
`=========================='

Not much. Only spent 5 minutes on it. The save routine now actually saves a
file. It only saves the text, it doesn't do anything with the colours. It
also doesn't bring up a file requester, it just opens and writes a file called
'test' in the current directory.

Baby steps.

But... developed on a real A1200 with Blizzard 1230 IV + 64MB + FPU.

That has to count for something.


.--------------------------.
| V0.12 2nd September 2010 |
`=========================='

I'd been putting off looking at the save routine. It really is going to be a
nasty mess.

So, now I've given it some attention. The more attention I give it, the more I
realise I need to do! Today's addition is that it works out where the last
character on each line is and where the last line is.


.--------------------------.
| V0.11 1st September 2010 |
`=========================='

Cursor shows the current fore/back colour selection, with a little flashing
bar at the bottom for when the colours are invisible to the background.

I'd written a redraw-the-whole-screen routine which just iterated through
the character and colour arrays, printing text to the screen. It was really
slow. It was used when switching back to the editor after displaying the help
screen.

I optimised it by unrolling the inner loop (by a factor of 8) and
precalculating some coordinates. It shaved only a few milliseconds off the
whole thing. Useless. Replaced it with a more RAM-hungry routine which just
saves/restores the visible screen to/from a buffer. Should work fine on an
unexpanded A500 still. It will use fast RAM instead of chip, where available.


.------------------------.
| V0.10 31st August 2010 |
`========================'

I have started to write the save routine. The trickiest part of the whole
program will be ensuring the saved ANSI is optimised, or even correct. The
rules for optimising ANSI CSI coding are fairly complex.

I also started building the release archive and ADF. Testing the bootable ADF
in WinUAE emulating an A500 resulted in a Guru. Looks like a bug in the AMOS
Pro compiler in handling icon banks. Affects 68000 based Amigas (the Guru is
along the lines of 'attempt to access a word at a non-even address').

I'll either find out how to safely handle icon banks, or change the code to
use a bob. Irritating, because the object editor in AMOS messes up when there
are objects using different pallet depths, which is why I switched one image
to an icon in the first place.


.-----------------------.
| V0.9 30th August 2010 |
`======================='

Cursor keys actually move the cursor around. Implemented a visible cursor as
well. Using a sprite for the cursor. This is probably cheating.


.-----------------------.
| V0.8 29th August 2010 |
`======================='

Full text entry enabled. All printable characters supported. i.e. every
character you can normally type into a shell you can now type into WireANSI.


.-----------------------.
| V0.7 27th August 2010 |
`======================='

Slight re-work of input method to make things tidier. It's actually now
starting to come together as a proper editor :)

Cheating again with WinUAE because I'm away from home for a week.


.-----------------------.
| V0.4 22nd August 2010 |
`======================='

Added ability to change current foreground and background colour. Lamented the
lack of modern programming language features. Procedural programming and weak
typing do not lend themselves to tidy programming.

Written on a real A1200 with 25MHz 68020+FPU+4MB RAM.


.-----------------------.
| V0.3 20th August 2010 |
`======================='

Nothing much. Made a little toolbar which will show currently selected
colours.


.-----------------------.
| V0.2 19th August 2010 |
`======================='

Basic finite-state machine implemented to handle reaction to input.

This version still doesn't do very much, but it has a foundation ready to
build upon.

Written on a real, unexpanded A1200.


.-----------------------.
| V0.1 17th August 2010 |
`======================='

The very beginning. Remembered how to get around in AMOS Pro just enough to
get started on setting up screens and handling input.

This version does little apart from display the name of the program and then
quit.

Written under WinUAE.
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022