WIP: Jeff's character editor

Basic and Machine Language

Moderator: Moderators

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

Post by Mike »

Jeff-20 wrote:I think I'm done now. I can't think of a single thing to add. And I never worked on so many revisions of a program. The uIEC has changed how I approach everything. Now, I am not at all concerned about disk space or drive wear.
These two lines allow you to save the whole program including the character set to the last used drive, without destroying the last two characters, and restart the editor automatically:

Code: Select all

90 POKES-7,240:POKES+3,27:POKE198,.:CLR:D=PEEK(186):INPUT"{CLR,BLU}NAME";N$
91 SYS57809N$,D:POKE193,.:POKE194,16:POKE780,193:POKE781,.:POKE782,30:SYS65496:RUN
Only ML routines used, which would be executed anyway during a normal SAVE command. ;)

You should add 'DIMA(7)' to line 1.
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Aren't arrays automatically DIMed to 8?
High Scores, Links, and Jeff's Basic Games page.
User avatar
Mike
Herr VC
Posts: 4845
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

They are automatically dimensioned to the index 10, allocating 11 elements.
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

So it seemed more space efficient for me to just avoid DIM for such a small array.
High Scores, Links, and Jeff's Basic Games page.
User avatar
Mike
Herr VC
Posts: 4845
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Without the DIM, the space for the elements A(8), A(9), and A(10) is permanently allocated, but unused by your program, so in the end there is even less space available for your program without DIM:

'DIMA(7):' + 5*8 bytes for A(7) = 46 bytes used
implicit DIM + 5*11 bytes for A(10) = 55 bytes used

i.e. using DIM(7) frees up 9 bytes, and they might be necessary if you want to add the new save routine.
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

The lesson I have learned from this project: programs can be optimized forever! If I stay disciplined, this 3.5k program will achieve self-awareness by next year, but it will still have room for improvement.
High Scores, Links, and Jeff's Basic Games page.
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Also, because this program is only for me (there are so many character editors already out there), I am tailoring it for my specific habits. I don't want the program to save automatically nor restart. It is rare I would actually save at all.
High Scores, Links, and Jeff's Basic Games page.
User avatar
Mike
Herr VC
Posts: 4845
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

What? Such a small program which is readily comprehensible, and you're already complaining about feature creep? :lol:

Imagine what happens, when a program grows so big that one cannot sensibly hold all details of the whole project/concept in memory. Then you have to develop methods how to work out the grand design, break down the program in modules, code and test them separately, put them together - and if you're lucky and/or experienced enough - together they work right on the first try.

As a hint: GR essentially consists of roughly 50 one-line routines. MINIPAINT, for example, has a similar number of sub-routines, but some of them span the same length than GR alone, in ML source code. From the first line written for MINIPAINT to its current 1.2 version I roughly put 100 hours into it.

Just to put things more into perspective. I suppose, similar figures pop up for Omega Fury, Realms of Quest III, PRGStarter or BasEdit.net.

I'd really be interested what programs would result if you'd jump over your own shadow, and write for expanded VIC-20, in machine language. ;)
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Ok. I revisited. The MX program is mostly new. DOWNLOAD
High Scores, Links, and Jeff's Basic Games page.
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

I would love to test drive your new utility, Jeff... but I cannot open up this ZIP file -- it complains there is an error. Could it be corrupted? :?

Code: Select all

$ unzip -l gr.zip 
Archive:  gr.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
Have you tried my QUIKVIC GRAPHIC EDITOR? It's all ML, runs unexpanded (so you HAVE to like that), and has the option of leaving character RAM alone on startup, or preload it with VIC ROM characters to start with. It's pretty feature complete, it's got a nifty "custom" flashing cursor, and there is an associated PDF instruction sheet (although there is an undocumented SHIFT U,D,L,R keystroke to shift the image up,down,left,right respectively).

The only complaint / feature creep I received was that it could use an option to save the character data to a floppy disk instead of only cassette tape -- but it was written and copyrighted back in 1984, when I did not own a VIC 1541 floppy drive, so I am not going to bother with that :P
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Sorry about that. I don't know what went wrong. Here's a new DOWNLOAD.

QUIKVIC looks very good. Machine language is not entirely a crime (yet). But I think I may have squeezed in a few more features in mine, which is really just tailored for my specific purposes. See what you think.

GR is for editing graphics, and needs a joystick. It assumes you want to keep the memory unaltered. You can load any bank of graphics by pressing R (rom) for one, shift A for all. Pressing B controls which character set you want to start with. Keep in mind holding Shift or Commodore or Control will alter the effects of each command (for example, you can move the character HORizontally in either direction).

MX allows you to mix any character sets. Some "clip art" is stored in reserve. Press B to see it. And RND is just a fun variation that gives you different methods of generating ideas/random graphics.
High Scores, Links, and Jeff's Basic Games page.
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

The zip works for me now, thanks.

So I take it that these are three char editors? Is that to appease your multiple personalities or is it moon-phase driven? :P

The GR seems to work the best, although I am not a big fan of using a joystick as its input. Not a complaint, mind you, just my palette. A plethora of functions! The 3-character menu list is also very retro looking -- it reminds me of IMSAI a little, like what does this switch do? Doh, there goes Seattle!! :evil:

MX didn't like it when I pressed Shift "F", it cleared the screen BUILDING FONT ... and after about 30-seconds, it seemed to drop to a READY prompt, I could not read the text but there was a somewhat flashing character for the cursor.

I ran into some issues with MD pressing "6" a couple of times -- it went into a FORMULA TOO COMPLEX loop. And the repeating cursor keys move a bit too quickly for my reflexes.

I like the RND functions, it does generate some interesting patterns from time to time. It feels like an ink blot test -- what do you see in this 8x8 image? I have this overwhelming feeling to GO LEFT suddenly . . .
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Shift F turns your character set to a typeable font. Try these examples I made for you: DOWNLOAD. Now press shift F with each.

I also know that the RND program can crash if you do a few of the commands too many times. But the memory is unaffected, so you can just RESTORE and RUN again.

GR is for Graphic Editor. MX is for Mixing Sets. RND is randomizing. I use the joystick so I can "paint" or draw my ideas.
High Scores, Links, and Jeff's Basic Games page.
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

Try these examples I made for you ...
Very nice.

Yes, that was it, I invoked RND a few times. Stack issue?
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
Mike
Herr VC
Posts: 4845
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

rhurst wrote:Yes, that was it, I invoked RND a few times. Stack issue?
No, it is the still the same error of which I thought it had been corrected:

Code: Select all

11 IFJ=3THENGOSUB2:FORT=0TO7:F=RND(1)*16:POKEL+T,3*(FAND8)+9*(FAND4)+33*(FAND2)+129*(FAND1):NEXT:GOTO3
It is a 1:1 copy of the random alien generator I posted around mid-June, however - as I already pointed out then - F is also used as base address in several POKE's, which now make wild shots into the zeropage, of which the '?FORMULA TOO COMPLEX' errors are just the final symptoms.

I suggested Jeff to change all occurences of 'F' in that line to 'I', but as it seems, those changes didn't make it into RND. :roll:
Post Reply