[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
DenTut5-Pas
By the way, sorry for the delay in the appearance of this part. Tests, projects and a few wild days of sin at the Wild Coast all conspired against the prompt appearance of this part. Also note I need more input as to what I should do future parts on, so leave me mail.
) across the top of the
screen (ie. 320 pixels) As we know, the VGA screen starts at zero at the
top left hand part of the screen, then counts up to the right to 319, then
goes back to the left hand side one pixel down at 320. (See Tut 1) This means
that a 16*320 scroller takes up the space 0 to 5119 on the screen. In ascii
this looks like this :
For loop1:=0 to 15 do Move (mem[VGA:loop1*320+1],mem[VGA:loop1*320],320);
This scrolls the screen from right to left, which is the easiest to read. To scroll the screen from left to right, swap the +1 onto the other side of the command. Also, to increase the size of the portion scrolled, increase the 15 to however many lines from the top you wish to scroll-1.
After this move, your screen will look like this :
Because of the simplicity of coding in a scrolly, most demos have one. It is usually best to have something extra happening on the screen so that the viewer doesn't get too bored, even, as I say, if it is only a really nice picture.
). I can now use those
previously wasted hours that I spent socialising and making friends
coding instead 
I suggest you get a copy of TEXTER, for coding demos with fonts, or in fact almost any graphics application, it is an amazing help, and we have used it for *ALL* our demos. (P.S. We have written many demos, but many have been written for companies and have not been released for the general public) NOTE : For TEXTER's test program TEST.PAS, add {$X+} {$R-} if you have range checking on (I code with it off.)
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
DenTut5-Pas
ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸
³ W E L C O M E ³
³ To the VGA Trainer Program ³ ³
³ By ³ ³
³ DENTHOR of ASPHYXIA ³ ³ ³
ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; ³ ³
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
--==[ PART 5 ]==--
- Introduction
By the way, sorry for the delay in the appearance of this part. Tests, projects and a few wild days of sin at the Wild Coast all conspired against the prompt appearance of this part. Also note I need more input as to what I should do future parts on, so leave me mail.
- What is scrolling?
H : Step 1
He : Step 2
Hel : Step 3
Hell : Step 4
Hello : Step 5
Hello : Step 6
etc. etc. See the program attatched for an example of scrolling.- What do we scroll?
- How do we scroll from side to side?
(0) . . (319)
(320) . . (639)
" " "
(4800) . . (5119)
Simple enough. Now what we do is we put down the first Y-line of the first
character onto the very right hand side of the screen , like so :
For loop1:=1 to 16 do
Putpixel (319,loop1-1,font['A',1,loop1],vga);
This will draw some stuff on the very right hand side. Your screen should now
look like this :
(0) . X. (319)
(320) . X. (639)
" " "
(4800) . X. (5119)
Next, we move each line one to the left, ie :For loop1:=0 to 15 do Move (mem[VGA:loop1*320+1],mem[VGA:loop1*320],320);
This scrolls the screen from right to left, which is the easiest to read. To scroll the screen from left to right, swap the +1 onto the other side of the command. Also, to increase the size of the portion scrolled, increase the 15 to however many lines from the top you wish to scroll-1.
After this move, your screen will look like this :
(0) . X . (319)
(320) . X . (639)
" " "
(4800) . X . (5119)
^
Note this space
What you then do is draw in the next line on the right hand side, move it,
draw the next line, move it etc. etc. Tah-Dah! You have a scrolly! Fairly
simple, isn't it?- How do we scroll up or down?
Move (mem[vga:0],mem[vga:320],63680);
{ 64000 - 320 = 63680 }
For scrolling down, or :
Move (mem[vga:320],mem[vga:0],63680);
For scrolling up. You then draw the next line and repeat.Because of the simplicity of coding in a scrolly, most demos have one. It is usually best to have something extra happening on the screen so that the viewer doesn't get too bored, even, as I say, if it is only a really nice picture.
- In closing
I suggest you get a copy of TEXTER, for coding demos with fonts, or in fact almost any graphics application, it is an amazing help, and we have used it for *ALL* our demos. (P.S. We have written many demos, but many have been written for companies and have not been released for the general public) NOTE : For TEXTER's test program TEST.PAS, add {$X+} {$R-} if you have range checking on (I code with it off.)
[ "I'm from the Computer Inspection Agency, sir,
I'm here to check your computer. Here is
my identification."
"Certainly. Have a look, I'm clean. I don't have
any pirated software."
The C-man pushes past him and sits in front of the
computer. He notes the fact that the computer
is currently off with a look of disdain. He
makes a note on his clipboard. He boots up.
"What is this?" he asks, pointing at the screen.
"It's MasterMenu" stutters the man. "I wrote it
myself!"
"Do you know what the penalty is for using junk
like this on a private machine?" The C-man smiles.
"This is a two-month sentance in itself!"
"I'm sorry sir! It won't happen again!"
"I know. I'll make sure of that." He smiles again.
The C-man runs through the hard drive, checking for
illeagal software, bad programs and anti-government
propaganda. He notes with satisfaction that he has
enough to put this weenie away for ten years, not that
it mattered. He usually could just make something up.
He comes to the last entry on the aphebetised menu tree.
His hands jerk away from the keyboard. Then, tentatively,
he types in the three letters of doom. He looks at the
man, who is backing away with wide eyes and his hands
outstretched in front of him, as if to ward off a blow.
The C-man smiles, his lips a thin, hard line.
"Windows!"
]
- Grant Smith
1:55pm
16/9/93
Cheers,
- Denthor
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
