ROM Kernal routines that control inserting lines of characters?

Basic and Machine Language

Moderator: Moderators

Post Reply
MadCommodore
Vic 20 Drifter
Posts: 22
Joined: Wed May 09, 2012 11:49 pm

ROM Kernal routines that control inserting lines of characters?

Post by MadCommodore »

I presume on the VIC20 going to the top of a screen and pressing the insert key will push down the entire screen by 1 character. The opposite of what happens when you do a print statement when the cursor is on the last row.

On the C64 you can use this as a simple hack to do a reverse scroll, the opposite of all those Ski-ing type in games, by two commands, off the top of my head it's this....

POKE 677,X (x=set cursor at row which you want to insert an entire row underneath to push the screen down)
SYS 59777 to actually make it happen.

Does anybody know if you can do this on the VIC-20 too? Quite a handy function because you can keep a line or two static at the top of the screen for scores and stats etc which you can do if you just keep printing to the screen like all those slalom type games use in BASIC.
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: ROM Kernal routines that control inserting lines of characters?

Post by Mike »

On the VIC-20, the corresponding commands are POKE242,X and SYS59912.
I presume on the VIC20 going to the top of a screen and pressing the insert key will push down the entire screen by 1 character.
No, that is not how it happens. It is output in the rightmost column (also during screen edits) that 'opens' a new row and scrolls everything below that one line down. This action also combines two (or more) physical screen lines into one logical line.

An intricate PRINT sequence also does this from within a program. A POKE into the screen line line table then unlinks the two physical lines. I did this with Meteor Storn, see here.
Post Reply