Nice text

Basic and Machine Language

Moderator: Moderators

Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

FD22 wrote:You should definitely do some background reading on this topic - others here have done or are doing similar things.

Keep plugging away - maybe you'll surprise everyone with something that hasn't been seen before.
I promise I will read everything! But not until I finish an alpha or beta... trying to stay focused so I finish something. And maybe I find some new ways in the process... well, different at least.

At this point I have screen scrolling (up/down) working. It works for any part of the screen, so multiple screens (aka. windows) is possible. Putting two screens/windows on top of each other is memory intensive once you start saving the part that is hidden. For text-only it is not so bad.
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

Well, silence does sometimes mean inactivity, but now that I have realized the driver for the NEOS mouse I will continue this project.

I have done some things, but mainly what remains is alot of debugging (sooo timeconsuming). Some things are working:

1) You start the program and it gives you a 200x176 bitmap for BASIC. The CPU load is 15-20% to display the oversized bitmap.

2) Characters are shifted and compressed into 6-bit (e.g. 5 bits+1spacebit). The character ROM is used as source, so no memory is needed for the new characterset.

3) PRINT, keyboard input ++ works normally onto the bitmapped screen. Due to the 6-bit characters you have 33 characters/line and 22 lines (they are still 8 bits high). You can enter your basic program with the new interface as you normally would.

There are a number of bugs that remain. Scrolling works but is a little slow. The Kernel works on a screenmap "shadow" so that the bitmap should be a copy of this. Its still not accurate so fast scrolling can't keep up. I will revise this later to scroll 2,4 or more lines at once if the scrolling lags too much behind.

I was planning to include "windows" on the bitmap so that one could have a smaller BASIC work area. Since there is a shadow BASIC screen (on which the Kernal works), this may still be realized, but overlapping windows will not have memory to store overlapped area (except for text). This will be a future expansion.

I will integrated the NEOS mouse driver and pointer. It is a simple thing and one will then be able to mark text with the mouse and copy/paste it around. Cursor can also be moved around with the mouse.

All-in-all the code is now 13 kilobytes (of whick 9 kilobytes are screenbuffercode). The bitmap takes 4400 bytes, so to do anything useful you will need 24 kilobytes or 32 kilobytes of extra RAM. If someone makes a paged memory expansion that is easy to get hold of, I will support this to give you more basic memory (future).

All-in-all this is a text expansion and I targeted it for making a system for a RS-232 temperature controller (Eurotherm). The normal 8-bit text on the VIC has limited space and often one needs more columns. If compressed to 5 bits this expansion can also give 40 columns, but for now I compromized with 6 bits to make it more readable.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Nice text

Post by Mike »

Is there still any development happening here? I'd like to see how it works.
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

Not much, but its still active. I have an alpha version that is working, but too many bugs to use for anything other than testing. Scrolling is not very fast, so the idea was to increase scrolling to 2 or 4 lines if one needs faster scrolling. I also started rethinking the double char gfx mode as it slows down copying somewhat. Going single character lines and moving the character bytes for scrolling instead would speed it up tremendously. It would make the IRQ a little more intricate but not much. Copying is already synchronised with screen updates to work without corrupting the screen so quite complicated..

Maybe I put out the alpha here for testing. Interesting enough even if lines > 33 chars crashes most of the time :lol:
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Nice text

Post by Forbidden64 »

I think this is great! I am a relative newcomer to the vic-20 scene. I have seen a LOT of "I saw something similar so don't bother." on this forum. Case and point would be this thread http://sleepingelephant.com/ipw-web/bul ... ?f=2&t=104 . I'm sure if people listened to that, there would not be even 1/10th the number of cool developements/software/harware/games that have come out. People would have said, "Well, there once was a game in the 80's, so I won't bother to make one." I myself am way behind in my skills in comparison to most on this site including you, however I view this as a positive. Not only are new people getting into this, but the hurdles I run into along the way may result in threads that help other newcomers. Keep being awesome kakemoms! I can't wait to try it out when its done. A high column, but readable screen with up and down scrolling and even possibly multi-windows that is basic compatible?!!?! I definitely want that! I love it when this community doesn't listen, and does fun stuff anyway. Like Jeff-20. He's making tons of fun games in pure basic even though he often gets crap for it. The rest of us are here, and really loving it! So don't quit on us and keep going sir :D
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Nice text

Post by Mike »

Forbidden64 wrote:I have seen a LOT of "I saw something similar so don't bother." on this forum. Case and point would be this thread http://sleepingelephant.com/ipw-web/bul ... ?f=2&t=104.
This thread is rather age-old, but I can't see how it serves to prove your point: if anything, it shows an early discussion if it was necessary to segregate the results of different programming styles into separate subforums. In the first two(?) years, there indeed were a "BASIC programs" and a "ML and other languages" section, which however have long be united into one "Programming" section.

As can be seen in the subtitles, the Programming section more or less explicitly refers to algorithms, routines, tools, programs and games that are intended to run on the VIC-20 itself, regardless of language (or combination thereof) used.
I love it when this community doesn't listen, and does fun stuff anyway. Like Jeff-20. He's making tons of fun games in pure basic even though he often gets crap for it.
Over the years, the attempts by some Denial fellows (me included) to lure Jeff into machine code programming or using expanded memory on the VIC-20 just have become a running gag. Of course it's his choice, and he has written a lot of of nice games within the restriction of unexpanded+BASIC. :)

That being said, with a hobby as obscure as ours, one needs a good amount of intrinsic motivation anyway. A good idea always deserves to be implemented and does not otherwise depend on the acclaim of other people. If the result does get positive feedback, that's a nice plus.
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

Sorry I haven't posted here in a while, but this is still active. I am going to publish the alpha tonight so you can test it out.

Basically, it requires lots of RAM at the moment and gives you an oversized screen with 6-bit wide characters on a gfx map. Basic 2.0 works as usual, so no extensions there. If you PRINT, it will print out text on screen. No gfx commands.

The project was originally about making text that looked slightly better than the 4-bit characters that had already been done. In that respect it works, but the on-screen editor is quite buggy so that writing lines >33 character crashes and scrolling is slow. Still, you can probably run some old Basic programs with this and they might work.

In time I will probably implement this differently as scrolling is much faster if you scroll the character map than all the bits on a full screen. But for now, I have hands full with my @SuperCPU extension (65C02@14MHz) that is quite complicated (to debug).

But as you have waited for 35 years for this, you can probably wait a little longer.. :lol:
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Nice text

Post by Forbidden64 »

Mike wrote:A good idea always deserves to be implemented and does not otherwise depend on the acclaim of other people. If the result does get positive feedback, that's a nice plus.
I totally understand and strongly agree with your point here. I suppose I just tend to think that because people share the same rather niche interest, that there will automatically be overwhelming support and positive feedback. In other ventures, and indeed in life itself, there is always criticism both constructive and/or otherwise, and perhaps my wording and sentiment here is overly dramatic and I am missing the point in that the criticism is meant to be constructive; does create a sense of drive and improvement; also can be helpful in seeing other ideas that may already be out there that we can learn from. I love what Jeff is doing; I also love what other people are doing. I guess I view this and other forums for such vintage computers as a treasure trove of knowledge and limitless fun activities and global a creative outlet of people who share my interests, which doesn't happen very often.

In a short analogy, I'm like a fat kid in a candy store which a chocolate haze around my mouth and I am pausing briefly to see the other kids in the candy store being selective about what they are eating, before promptly returning to my indiscriminate feast. The difference is purely perspective, in that this forum, and vintage computing itself is new to me, and for others, its been over a decade on this forum, and even several decades of reading/posting on other mediums. Until a few years ago, I hadn't seen a commodore since the very early 90s, when I was about 11 or so. The nostalgia is thick, and crowds my sentiment and objectivity.

Chalk it up to a culture shock? Compared with other posting areas on the internet (youtube *cough*) the criticism is overwhelmingly positive and doesn't descend into complete crazy madness, with super space alien lizards(unless its an arcade game), UFOs(same) or politics etc. I guess I am just adjusting to how things are on here and settling down a bit. For instance in one of my first posts you corrected my program listing and offered advice on how to print a program into a text file, zip it, and post it on the forum to where it would actually be usable. If you had just been a bubble bath of smiles unwilling to do so, I would not have learned _anything_.
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

This is work in progress. You can play around with it to humor yourself.

What it does:
* Sets up a continuous bitmap from the 4096 to 8495 memory area.
* Gives you a oversized screen of 200 pixels by 176 pixels with 6x8 bit characters for BASIC.
* Incorporates a command stack for handling the oversized screen without touching the 0-1024 memory area or breaking the display. Clearing the screen takes about 3 frames. Scrolling much more.
* PRINT works as "usual" to output to this new screen.
* LOAD of Basic programs should work as usual.
* Uses <20% CPU for the oversized bitmap.

Known bugs:
* Characters gets messed up at two parts of the screen due to missing character out pipeline (Especially at the top 4 lines). You will see that when it starts.
* Scrolling works, but virtual character map does not scroll. Last line (of virtual map) is filled with gibberish.
* Screen clear is messed up as it does not clear the virtual character map.
* Logical lines does not work as expected. So keep text within the 33 column boundary of the screen.
* Fast scrolling over multiple lines can crash it. Scroll a single line at a time.
* Currently an oversized bloated code for speed. Requires 24KBytes+ expansion. I could easily put it in unused memory areas but until it works I won't bother.

Future plans:
* Fix virtual character map
* A second command stack for handling shorter commands without messing up the continuous bitmap.
* Make it possible to POKE into the continuous bitmap without breaking it

All-in-all it is quite slow, so I would say a faster CPU would be required to make much sense of this. Scrolling by moving characters are much faster and one can use this for scrolling a bitmapped screen 8 bits at a time aswell. It requires some high-level remapping to keep track of the characters, so it would be a complete rewrite of all the code to make this work.

Download link.
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Nice text

Post by Forbidden64 »

I tested it out, and found out its pal :oops: so i put it on my emulator and tested it. idk if this is a possible idea or two, but I noticed if it scrolls, or prints etc that it doesn't update the text unless I scroll the cursor over the text area manually. Perhaps JSRing over to the cursor movement subroutine updating the whole screen that way might be a cheapy shortcut, and then thereafter going line by line up or down using a cursor location to check whether its left the screen? or something like it to update might be doable? It could use the inverse of the scroll down LIST routine for scrolling up perhaps. I don't care if its fast, just that it has all the amazing features you espoused :D. I am sure most users would agree. I'm no whiz at assembler but I'll see if I can make heads or tails of it and see what I can contribute.

Another weird anomaly I noticed was at start up, it says 'error in 10.' over the line that says xxxx bytes free. Says 'ERROR IN 10.REE'
I love the text! Its perfectly readable and not over sized or lacking in detail. It's the momma bear of vic 20 text, just right.

i have all day tomorrow so I will utilize it on this. I'm sure I will learn a ton in the process.
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Nice text

Post by Forbidden64 »

;check ADDR $9114 BY ORDER OF MAGNITUDE OF 2 DESCENDING:

270F JMP 2A8D ; START OF NON-ZERO IN MEMORY
2712 LDA 9114 ; LOAD A REGISTER
2715 CMP #08 ; COMPARE A-8
2717 BCC 271D ; RESULT REG A-8 < 0 BRANCH 271D ELSE
2719 PHA ; PUSH A TO STACK
271A PLA ; PULL A BACK OUT OF STACK
271B AND #$07 ; REMOVE MOST SIGNIFICANT 5 BITS 0000 0XXX
271D CMP #$04 ; COMPARE A-4;
271F BCC 2725 ; RESULT A-4 < 0 BRANCH 2725 ELSE
2721 BIT 24 ; FLAG TRIGGER $24
2723 AND #03 ; REMOVE MOST SIGNIFICANT 6 BITS OF REG A
2725 CMP #02 ; COMPARE IF LEAST SIGNIFICANT BITS ARE BOTH 1
2727 BCS 2729 ; IF A-2 > 0 BRANCH 2729


Is there an easier way to get the disassembly out of the memory aside from manually typing it out of the monitor and then commenting it? I don't mind manually commenting it for ease of understanding/for later reference...but this is excruciating lol. Especially since the program has unrolled loops etc. and is quite large. I'm using 'vic 20 prog gen' but I'm sure there is some method that is WAY easier that I don't know about. Once I can do the disassembly I can better learn/fiddle with it and maybe on the off chance come up with something that helps the project :D
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: Nice text

Post by groepaz »

just try a google search on "6502 disassembler" - there are plenty options, and which one works best for you much depends on what you want to do, and your experience
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Nice text

Post by Forbidden64 »

Um expertise...newb. Needs...something that works. I tried printing to file but that didn't work, so I decided on using a classic! HESMON and just cutting and pasting it out to a notepad from vice. Works well enough for me! I'm busy sorting and commenting it now. Apparently, I have 3 whole days to dive into this which is a great opportunity to learn more about interrupts and PAL screen coding etc.
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

groepaz wrote:just try a google search on "6502 disassembler" - there are plenty options, and which one works best for you much depends on what you want to do, and your experience
I used IDA which gives a good disassembly and supports a hughe list of CPUs. It won't comment your program, but the disassembly is at least good enough to reassemble :roll: The only drawback with IDA is that its very expensive unless you have a job that requires such a beast. :oops:
Kakemoms
Vic 20 Nerd
Posts: 740
Joined: Sun Feb 15, 2015 8:45 am

Re: Nice text

Post by Kakemoms »

Forbidden64 wrote:I tested it out, and found out its pal :oops: so i put it on my emulator and tested it. idk if this is a possible idea or two, but I noticed if it scrolls, or prints etc that it doesn't update the text unless I scroll the cursor over the text area manually. Perhaps JSRing over to the cursor movement subroutine updating the whole screen that way might be a cheapy shortcut, and then thereafter going line by line up or down using a cursor location to check whether its left the screen? or something like it to update might be doable? It could use the inverse of the scroll down LIST routine for scrolling up perhaps. I don't care if its fast, just that it has all the amazing features you espoused :D. I am sure most users would agree. I'm no whiz at assembler but I'll see if I can make heads or tails of it and see what I can contribute.

Another weird anomaly I noticed was at start up, it says 'error in 10.' over the line that says xxxx bytes free. Says 'ERROR IN 10.REE'
I love the text! Its perfectly readable and not over sized or lacking in detail. It's the momma bear of vic 20 text, just right.

i have all day tomorrow so I will utilize it on this. I'm sure I will learn a ton in the process.
Sorry about that. PAL only at the moment. It should be possible to do a NTSC version later, but it requires many changes in timing. E.g. max copy size it restricted so that the program doesn't roll over a certain raster line, and there are three parts per screen update (e.g. three time slots) that allows bitmap manipulation without breaking the raster routines. Once I have a stable PAL version I will do the NTSC.

Yea, the text in the first 4 lines gets corrupted since the characters in that area are re-used at the bottom of the screen and needs to be written at specific timing. For copying large blocks of graphics, this has been solved as there is a command stack that gets the copy command and a separate copy routine that reads the stack and implements it with the above mentioned time constrains. I will make this for smaller gfx commands too, like printing text and drawing lines. But until that is implemented, the text will look strange at times.

"error" is actually the last part of "syntax error" which is written over "**** CBM BASIC V2 ****" which would both appear at the first line if those lines were working (as mentioned above). The syntax error appears as the init routine is improperly terminated when Basic program vectors are changed. I will fix this soon.

It should also be possible to change the line length to different values once everything is working. E.g. to choose 6-bit, 5-bit or 4-bit characters and thus have even longer lines. But I will need to focus on getting things working before I start changing and expanding the features.
Post Reply