MG Text Edit

Basic and Machine Language

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

MG Text Edit

Post by Mike »

Hi, y'all!

Here's a text screen designer for MINIGRAFIK bitmaps (download):

Image

Main purpose of this program is to add (40 column) text to pictures, which have been crafted before in MINIPAINT (of course, MP then also can load the changed pictures back again). When the program is started, you are prompted if this is a new picture or if you want to edit an existing picture. In both cases, you are asked for a file name. For a new picture, you additionally have to specify the background and border colours. While you are editing, the 'f1' key saves and replaces the current picture under the given filename (a short beep is heard for confirmation), 'f7' quits the program.

Things to note:

- Internally the program uses the ASCII encoding, like MG BROWSE and MINIPAINT also do. For this reason, the keyboard was remapped to add the following characters not present in PETSCII:

Code: Select all

          backslash  \   92  Pound
              caret  ^   94  Arrow Up
         underscore  _   95  Shift Minus
       grave accent  `   96  Arrow Left
 curly bracket open  {  123  Shift @
       vertical bar  |  124  Shift Pound
curly bracket close  }  125  Shift *
              tilde  ~  126  Shift Arrow Left
- Foreground (cursor) colour is selected as usual with CTRL-1..8. The graphics mode limits the colour resolution to 2x2 characters, as the glyphs are 4x8 pixels and the attribute cells are 8x16 pixels.

- The cursor keys, HOME, RETURN and RVS ON/OFF work as expected; DEL, INST and CLR currently have no function.

- I have included the help screen shown above on disk, which can be loaded by specifying 'E' for edit and typing HELP at the "FILE?" prompt.

- Note that even though MG Text Edit contents itself with a +8K RAM Expansion, you'll still need +16K for MINIPAINT.

Greetings,

Michael

Edit: changed OP for final release
Last edited by Mike on Thu Feb 20, 2014 5:12 pm, edited 3 times in total.
User avatar
darkatx
Vic 20 Afficionado
Posts: 471
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Post by darkatx »

This is also for all the many text/graphic adventure games that have just been released. Just finally took a look of Island of Secrets and thought this option would have been perfect for that.
Good stuff! :)
Learning all the time... :)
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

... who knows? ;)

Besides, in the last three years there have been at least another three attempts at writing a similar screen editor for the VIC-20, two of these being described here in Denial:

o Some unnamed program by KingTrode and

o VWrite 1.0 by BBQedIguana.

The third case can be linked to FD22's OS replacement project, which just stopped at this stage in July 2012 and there has be no update since.

MG Text Edit had a strong code base to build upon, there was just a small set of new ML subroutines necessary to implement it, which I did in two evenings. I might have done it a lot earlier, but since no-one seemed to complain about a missing text-entry facility in MINIPAINT, I didn't bother about it either. :P

That being said, comments, suggestions for improvements, etc. are welcome. :)
User avatar
darkatx
Vic 20 Afficionado
Posts: 471
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Post by darkatx »

Looks like I'm gonna have to break this puppy in as well ;)
Learning all the time... :)
FD22
Vic 20 Hobbyist
Posts: 148
Joined: Mon Feb 15, 2010 12:31 pm

Post by FD22 »

Mike wrote:The third case can be linked to FD22's OS replacement project, which just stopped at this stage in July 2012 and there has be no update since.
I took six months off, working on other things - work on VIC++ resumed early last month! I've backtracked a little on where I'd got to back then because I wasn't happy with it; since resuming just after Christmas, there's been a fair amount of work to the glyph renderer to speed it up, a bunch of other tweaks and adjustments, and I'm just beginning to inch forward again. :)

http://vicpp.blogspot.co.uk/2013/01/in- ... sumed.html
User avatar
darkatx
Vic 20 Afficionado
Posts: 471
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Post by darkatx »

I'm trying to use it in VICE and when I try the normal black n white lineart is displays OK but my finished coloured art display is corrupted.
I use the boot option and have manually tried loading Maxigrafik first then the the Text Edit and still the same result.
I feel like I might be overlooking something - the are displays OK in Minipaint though.
:?:
Learning all the time... :)
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

It is most probably an attribute cell with multi-colour data that changed into hires when you overtyped it with a character. As I wrote in the OP, the attribute cells are tiles of 8x16 (hires) pixels, i.e. the area of 2x2 (small) characters is always affected when the colour RAM needs to be changed.

In any case, this has nothing to do with VICE; and the supplied boot loader also only does what you tried manually: load MINIGRAFIK and then start the screen editor.
User avatar
darkatx
Vic 20 Afficionado
Posts: 471
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Post by darkatx »

Mike wrote:It is most probably an attribute cell with multi-colour data that changed into hires when you overtyped it with a character.
That's the thing - the entire picture display is completely corrupted I didn't even have a chance to type anything in yet. :(
Learning all the time... :)
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

I just tried the SPLASH file from your Spidey vs. Doc Ock game.

It loads fine without issues. Most of the white colour 'background' is actually drawn from foreground colour, with multi-colour enabled. These cells change to display vertical stripes in hires mode. So far, expected behaviour.

If this isn't the file you meant, could you provide me with the exact file that causes the problems?
User avatar
darkatx
Vic 20 Afficionado
Posts: 471
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Post by darkatx »

I just tried it again myself and it worked. :?: Displayed perfectly...but I guess if you try to immediately go back in - it wouldn't display properly? Just multi-colour in hi-res mode again. Tried it again - booting VICE fresh and it works fine???
Also, I hit F1 to save the change but there was no indication that it saved other than getting out and checking the file. Since I'm in VICE I don't sense any real drive activity. I had to reload Mini-paint to view it again. Just weird sporadic issues - other than that it's a neat tool.
:D
I'll play with it some more... :wink:
Learning all the time... :)
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

After a short exchange with darkatx over PM, I was finally able to find the source of the problem: the @LOAD command continues even when an error occured during load, it then activates the graphics screen automatically, with whatever is present in memory to display.

Now, when one makes a typo and enters a non-existent file name, the result comes out similar to this:

Image

... which is not an exactly user-friendly way to flag a ?FILE NOT FOUND error. :oops:

I've added a check for this and two other possible I/O errors to the load routine of MG TEXT EDIT. Additionally, you now hear a short beep, when the picture has been saved. I updated the download link in the top post, please reload.

Greetings,

Michael
User avatar
orion70
VICtalian
Posts: 4340
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: MG Text Edit

Post by orion70 »

Thank you very much Mike for this updated version. If I only had time, I'd use this editor for a text adventure :(.
Sidenote: if you use different colors in two consecutive lines, they clash.
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MG Text Edit

Post by Mike »

orion70 wrote:If I only had time, I'd use this editor for a text adventure. :(
You'll have to keep in mind though, that MG Text Edit handles everything you type in as pixel data only, you don't get the equivalent of the ASCII data somewhere else in any form. So this is only meant for static text inside a picture, the text is not supposed to be processed further in any way. [1]

If you want to handle dynamic texts in a MINIGRAFIK bitmap on display, the routines of MG Browse are really what you want to use. :)
Sidenote: if you use different colors in two consecutive lines, they clash.
As I wrote in the OP:
Mike wrote:- Foreground (cursor) colour is selected as usual with CTRL-1..8. The graphics mode limits the colour resolution to 2x2 characters, as the glyphs are 4x8 pixels and the attribute cells are 8x16 pixels.
;)

Greetings,

Michael

[1] Though I took care, that all glyphs in my ASCII character set *are* different, so one could - in principle - throw an OCR against the bitmap. ;)
User avatar
orion70
VICtalian
Posts: 4340
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: MG Text Edit

Post by orion70 »

Thanks Mike, didn't see the color clash was already described. As for the use in a (pseudo)text adventure, I thought of a game where I could alternate static graphics with 2/3 of the screen picture and 1/3 (pseudo)text created with this editor, and a regular 22 columns text for the input and "service messages" ("you hit the dragon... The dragon is dead! I see: *treasure").

Heterogeneous output so not so elegant, but imagine something like this on a VIC:
Image

People would surely forget they're only static screens :P
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MG Text Edit

Post by Mike »

orion70 wrote:People would surely forget they're only static screens :P
Really, that's not the point!

It's much more 'cost-effective' to mix in the text into a partially filled screen (as your example shows) with routines that take the text base from 'normal' ASCII data in memory. That also allows to scroll the, say, 5 lines of text below the picture as necessary, should the space for the room description not suffice.

And you're not restricted to output only. With a customized keyboard input routine, you can change the screen as you type in the commands. No need to (re-)enter 22-column mode for this. As an example, take the chapter number prompt in our Bible releases. The routine used for this can easily be expanded to a full 'command line', and the whole program can execute in bitmap/soft-40 mode.
Post Reply