<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://c64mags.untergrund.net/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://c64mags.untergrund.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Skyhigh_21_Coding</id>
		<title>Skyhigh 21 Coding - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://c64mags.untergrund.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Skyhigh_21_Coding"/>
		<link rel="alternate" type="text/html" href="http://c64mags.untergrund.net/wiki/index.php?title=Skyhigh_21_Coding&amp;action=history"/>
		<updated>2026-06-10T17:25:11Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://c64mags.untergrund.net/wiki/index.php?title=Skyhigh_21_Coding&amp;diff=3881&amp;oldid=prev</id>
		<title>Ymgve at 17:37, 29 November 2007</title>
		<link rel="alternate" type="text/html" href="http://c64mags.untergrund.net/wiki/index.php?title=Skyhigh_21_Coding&amp;diff=3881&amp;oldid=prev"/>
				<updated>2007-11-29T17:37:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;Coding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And now you return to the corner of Dr Shoe, the&lt;br /&gt;
all helpful coding guru (shit, I wish instead of just&lt;br /&gt;
being a coding guru, I could code like Guru/Reflex!!!)&lt;br /&gt;
&lt;br /&gt;
If you remember last issue, I explained how to code&lt;br /&gt;
your first proportional font displayer. I had quite&lt;br /&gt;
a lot of very positive reactions, some from guys who&lt;br /&gt;
said they had never coded before, and some from&lt;br /&gt;
guys who I consider to be BETTER coders than myself&lt;br /&gt;
so it was very pleasing for me.&lt;br /&gt;
&lt;br /&gt;
Well, as promised, this time I will unveil the secrets&lt;br /&gt;
of that dreaded routine which escaped a lot of&lt;br /&gt;
coders for many years (although I heard that&lt;br /&gt;
Fuben/Oxyron coded one a few years back, but&lt;br /&gt;
never released it until the outfit for The Relax).&lt;br /&gt;
&lt;br /&gt;
Anyway, this subject comes very close to our heart,&lt;br /&gt;
as we in Skyhigh presented the first magazine outfit&lt;br /&gt;
with a proportional upscroller. So who better to&lt;br /&gt;
take you through the basics than the man who&lt;br /&gt;
coded it, Raz/Camelot!&lt;br /&gt;
&lt;br /&gt;
Sadly he isn't here, so yet again, you will have to&lt;br /&gt;
live with my sad little explanations.&lt;br /&gt;
&lt;br /&gt;
OK, lets begin.&lt;br /&gt;
&lt;br /&gt;
Last issue, if you remember, I actually explained the&lt;br /&gt;
secret behind a proportional upscroller. I did that&lt;br /&gt;
when I told you the two ways to display a&lt;br /&gt;
proportional font on the screen. There were two&lt;br /&gt;
methods, one using characters and raster splits,&lt;br /&gt;
and one using a bitmap screen (which was what we&lt;br /&gt;
used last time). Well, for the proportional upscroller&lt;br /&gt;
we need to used the method of chars, and I will&lt;br /&gt;
explain this to you again.&lt;br /&gt;
&lt;br /&gt;
OK, we split the screen into 4 equal sections, and&lt;br /&gt;
these splits do one thing. They change which data&lt;br /&gt;
we are using to define the character set. Not very&lt;br /&gt;
clear? Hopefully this diagram will show it a little&lt;br /&gt;
better:&lt;br /&gt;
&lt;br /&gt;
*************&lt;br /&gt;
* $2000-           *&lt;br /&gt;
*            $2800 *&lt;br /&gt;
*  ------------  *&lt;br /&gt;
* $2800-           *&lt;br /&gt;
*            $3000 *         Key:&lt;br /&gt;
*  ------------  *         *=edge of the screen&lt;br /&gt;
* $3000-           *         - =raster split&lt;br /&gt;
*            $3800 *&lt;br /&gt;
*  ------------  *&lt;br /&gt;
* $3800-           *&lt;br /&gt;
*            $4000 *&lt;br /&gt;
*************&lt;br /&gt;
&lt;br /&gt;
You probably don't appreciate how long it took me to&lt;br /&gt;
draw the fucking diagram...... 8-)&lt;br /&gt;
&lt;br /&gt;
OK, you can see that the screen is split into 4&lt;br /&gt;
sections. The numbers show what area of memory the&lt;br /&gt;
character set is defined by, and that is what I will&lt;br /&gt;
assume from now on.&lt;br /&gt;
&lt;br /&gt;
Anyone with a little bit of a clever mind will have&lt;br /&gt;
figured out how this will have worked by now, but&lt;br /&gt;
the rest of the world will still need some&lt;br /&gt;
explanation.&lt;br /&gt;
&lt;br /&gt;
This example also assumes that you have your&lt;br /&gt;
screen located at $0400-$0800. Remember, you&lt;br /&gt;
don't need a bitmap screen, just one with normal&lt;br /&gt;
chars on.&lt;br /&gt;
&lt;br /&gt;
OK, so here is how it works. You fill the screen with&lt;br /&gt;
the data numbered 0-240 in order. So, you get the&lt;br /&gt;
following:&lt;br /&gt;
&lt;br /&gt;
$0400=00&lt;br /&gt;
$0401  =01&lt;br /&gt;
$0402=02&lt;br /&gt;
&lt;br /&gt;
and so on until you reach $04f0.&lt;br /&gt;
&lt;br /&gt;
That will mean $04F0 holds the value $f0, or 240.&lt;br /&gt;
&lt;br /&gt;
Then, if you think, you have 6 rows of characters,&lt;br /&gt;
each row of which is 40 characters across, so you&lt;br /&gt;
have 240 characters on the top quarter of the&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
Then, repeat the process from $04F0 to $05E0,&lt;br /&gt;
putting $00 at $04F0 up to $F0 at $05E0. Do this&lt;br /&gt;
again for $05E0 to $06D0 and again for $06D0 to&lt;br /&gt;
$07C0.&lt;br /&gt;
&lt;br /&gt;
As you will immediately recognise, that is one row&lt;br /&gt;
short, which is alright. It is alright, because I have&lt;br /&gt;
made a mistake so far. I have said we should start&lt;br /&gt;
from $0400. We shouldn't. We should have actually&lt;br /&gt;
started from $0428. This figures, as when we scroll&lt;br /&gt;
the screen, we will have to move the top borders&lt;br /&gt;
in by 1 character to allow smooth entry to the&lt;br /&gt;
screen. So, we will never actually see the top line&lt;br /&gt;
of the screen, so why put data there if we will&lt;br /&gt;
never see it? So, don't put the data there, and&lt;br /&gt;
instead start from $0428.&lt;br /&gt;
&lt;br /&gt;
Anyone thinking whilst reading this article would&lt;br /&gt;
have noticed that deliberate (ha!) mistake on my&lt;br /&gt;
behalf. Just tying to make sure you are still awake,&lt;br /&gt;
you see!&lt;br /&gt;
&lt;br /&gt;
Anyway, so now you have a screen with all the data&lt;br /&gt;
on it. The next stage is to set up your raster&lt;br /&gt;
lines. You want to place them on the pixel line&lt;br /&gt;
where the two character sets will change, in&lt;br /&gt;
other words, where the data goes back to $00&lt;br /&gt;
again. All you need to do is change $D018 to switch&lt;br /&gt;
to the next charset, so you will have no probs at&lt;br /&gt;
all concerning a messy split, and if you do, a little&lt;br /&gt;
bit of timing here and there will work it all out&lt;br /&gt;
nicely.&lt;br /&gt;
&lt;br /&gt;
So, you should now have a screen set up which has&lt;br /&gt;
absolutely nothing on it, if you run your program.&lt;br /&gt;
That is because you will have remembered in&lt;br /&gt;
advance to write a small routine blanking all the&lt;br /&gt;
data from $2000 to $4000, won't you? There will be&lt;br /&gt;
nothing on the screen even though the data is there&lt;br /&gt;
because the charset data is currently empty.&lt;br /&gt;
&lt;br /&gt;
OK, now this is where I get into the realms of theory,&lt;br /&gt;
as I have never actually done this myself!&lt;br /&gt;
&lt;br /&gt;
The theory behind the upscroller is this.&lt;br /&gt;
&lt;br /&gt;
Display the top pixel line of the WHOLE row of&lt;br /&gt;
characters, then scroll it onto the screen using&lt;br /&gt;
$D011. YOU MUST ALSO MOVE YOUR 4 RASTER LINES UP&lt;br /&gt;
BY 1 PIXEL TO COMPENSATE FOR THIS!!!!!!! That is of&lt;br /&gt;
utmost importance. OK, then draw out the next&lt;br /&gt;
pixel line of your line of data, then scroll the&lt;br /&gt;
line up one pixel using $D011. So, if the whole line&lt;br /&gt;
looks like this:&lt;br /&gt;
&lt;br /&gt;
***** *      * *****&lt;br /&gt;
*         *      *         *&lt;br /&gt;
*         *      *       *&lt;br /&gt;
***** *****     *&lt;br /&gt;
* *      *   *&lt;br /&gt;
* *      * *&lt;br /&gt;
***** *      * *****&lt;br /&gt;
&lt;br /&gt;
then so far you will have:&lt;br /&gt;
&lt;br /&gt;
***** *      * *****&lt;br /&gt;
*         *      *         *&lt;br /&gt;
&lt;br /&gt;
on the screen.&lt;br /&gt;
&lt;br /&gt;
You then repeat this until the entire line of text&lt;br /&gt;
is displayed (all 8 pixel lines of it). So, somewhere on&lt;br /&gt;
the screen you have SHZ written.&lt;br /&gt;
&lt;br /&gt;
I say &amp;quot;somewhere on the screen&amp;quot; as I have not told&lt;br /&gt;
you yet where you want to place that! Aren't I just&lt;br /&gt;
nasty....&lt;br /&gt;
&lt;br /&gt;
OK, you actually want to place that on the BOTTOM&lt;br /&gt;
line of your screen, which is at the beginning, 6&lt;br /&gt;
lines down into the data held from $3800-$4000. So,&lt;br /&gt;
you want to set the position to write this data into&lt;br /&gt;
memory as $3800+(5*40) which is (get out your&lt;br /&gt;
calculators) $38C8. Remeber it is 5*40 as you are&lt;br /&gt;
starting the section at $3800+(0*40), so 5*40 is&lt;br /&gt;
the 6th if you add 1 every time, or something like&lt;br /&gt;
that, anyway.&lt;br /&gt;
&lt;br /&gt;
OK, so your data is now at the bottom left of the&lt;br /&gt;
screen, sitting pretty. But how on earth do you&lt;br /&gt;
scroll this?&lt;br /&gt;
&lt;br /&gt;
Well, actually very easily. It is the same as if you&lt;br /&gt;
were doing a normal upscroller. Simply pick up all&lt;br /&gt;
the from $0428 to $07C0 and place it at $0400 to&lt;br /&gt;
$0798. But, the data from $0428 to $0450 does not&lt;br /&gt;
go at $0400 to $0428, but instead at $0798 to $07C0&lt;br /&gt;
so that is can wrap around.&lt;br /&gt;
&lt;br /&gt;
HOWEVER, when this data is all wrapped around, if&lt;br /&gt;
you remember you will have reset $D011. But that&lt;br /&gt;
leaves your rasters up shit creek, as you have&lt;br /&gt;
the top section $2000 to $2800 with one of its&lt;br /&gt;
lines at the bottom of the screen (row 24). So you&lt;br /&gt;
need to totally alter it, and move the top one&lt;br /&gt;
completely around to the bottom of the screen. The&lt;br /&gt;
others may only need moving by one pixel, as I am&lt;br /&gt;
not too sure.&lt;br /&gt;
&lt;br /&gt;
The next thing to remember is to blank the data from&lt;br /&gt;
$2000 to $2140, as it it now being used for the net&lt;br /&gt;
line to come on the screen.&lt;br /&gt;
&lt;br /&gt;
So, you now repeat this rather nasty process, but&lt;br /&gt;
place new data at $2000 to $2140.&lt;br /&gt;
&lt;br /&gt;
the big problem is keeping the rasters in check.&lt;br /&gt;
&lt;br /&gt;
The other major thing to remember is that you can't&lt;br /&gt;
use the exact routines I gave you last time, as they&lt;br /&gt;
worked by displaying a whole character at once,&lt;br /&gt;
whereas to maintain a fluid movement, the upscroller&lt;br /&gt;
needs the characters to be displayed one pixel&lt;br /&gt;
line at a time!&lt;br /&gt;
&lt;br /&gt;
Anyway, that is that for this month. As I write this,&lt;br /&gt;
the X96 will open its doors in 62 hours, and I am&lt;br /&gt;
still at home in England! Hope to see you there!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Shuze/Afl'70&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ymgve</name></author>	</entry>

	</feed>