Screen 5 tutorials

Page 2/5
1 | | 3 | 4 | 5

By Argon

Paragon (1119)

Argon's picture

20-08-2003, 18:45

Extra question Smile

How fast is the tile copying from page 1 to page 0 ?
I mean, is it usable realtime ?
How about a horizontal scrolling level ?

Thank you for your patience with me Smile

Kris

By anonymous

incognito ergo sum (116)

anonymous's picture

20-08-2003, 19:49

How fast is the tile copying from page 1 to page 0 ?
I mean, is it usable realtime ?

There is no speed penalty to copy between different pages.
And yes it's possible to do it in real-time. But you won't be able to update entire screens.
A single column of tiles should be no problem.

How about a horizontal scrolling level ?
Without using the MSX2+ horizontal scrolling features, this is pretty hard. You don't see much (smooth) horizontal scrolling games on MSX2 and there's a good reason for it Smile

But, if you use NestorBASIC (based on BASIC-Kun) the possibilities are higher. BASIC-Kun compiles your BASIC program in realtime, so it's almost as fast as machine language. Besides this it also optimizes the COPY command to use a high-speed copy not available in BASIC normally.

Thank you for your patience with me Smile
No prob Smile We're here to help!

By Argon

Paragon (1119)

Argon's picture

20-08-2003, 19:57

Is there any reference available of how those 8x8 graphic tiles are stored to file.
As far as I understand now, there's 1 bit per 'pixel', so 64 bits for an 8x8 tile ? Or maybe I misunderstood this ? Tongue

Then how do you add colors ?
What about tiles with multiple colors ?

I tried saving a screen 5:
<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="mrc-small">Code:</font><HR></TD></TR><TR><TD><FONT class="mrc-small"><PRE>
screen 5
bsave "a:test",&H0,&HFFFF,S
</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>

This was saved and was 7 bytes.
Then I tried the following:
<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="mrc-small">Code:</font><HR></TD></TR><TR><TD><FONT class="mrc-small"><PRE>
10 screen 5:cls
20 set page 0,1
30 bload "a:test",S
40 set page 1,0
50 goto 50
</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>

Of course I just get a screwed up screen Smile

Heeelp Tongue Smile Smile Smile

Thanks

By anonymous

incognito ergo sum (116)

anonymous's picture

20-08-2003, 20:54

Remember that just using SCREEN 5 and then something else doesn't work. The BASIC interpreter only runs in screen0/1. Typing SCREEN 5 switches to screen 5 and then back.

In screen 5 there are 4 VRAM pages. Each page is 32kB. Saving a page is done like this:
BSAVE "file.ge5",0,&H7FFF,S
This also saves information about sprites and the current palette, which after loading can be restored by using COLOR=RESTORE.

Screen 5 is 4 bits per pixel bitmapped, which means 4 bits are used for every pixel and pixels are stored linearly. Since each pixel has 4 bits, 16 colors can be used.
The VRAM is layed out as follows:
Byte 0: bits 7-4 are pixel 0, bits 0-3 are pixel 1
Byte 1: bits 7-4 are pixel 2, bits 0-3 are pixel 3
etc...

Use VPOKE and VPEEK to witness this behaviour, as BASIC hides this. (All graphic commands are pixel-based, which is also why the COPY command is slower than need be.)

10 SCREEN5:CLS
20 VPOKE 0,&H8F
30 GOTO 30

This program shows an empty screen with one red pixel followed by a white pixel in the upper-left corner.

By Argon

Paragon (1119)

Argon's picture

20-08-2003, 21:02

Thank you, that was very helpful Smile

By ro

Scribe (4696)

ro's picture

21-08-2003, 00:31

again, argon. you should really read the tuts on genic/sunrise mags. they will explain all of this. including color bit structure in different screens. Vram addresses, sprite buffers etc. etc. etc.
once you get the hange of it, you'll be able to mix it all together in your programs.
ro

By anonymous

incognito ergo sum (116)

anonymous's picture

21-08-2003, 01:20

still, ro, I managed in just a few sentences Tongue

By Argon

Paragon (1119)

Argon's picture

21-08-2003, 09:15

again, argon. you should really read the tuts on genic/sunrise mags. they will explain all of this. including color bit structure in different screens. Vram addresses, sprite buffers etc. etc. etc.
once you get the hange of it, you'll be able to mix it all together in your programs.
ro

Could you supply and EXACT link to the correct file folder on funet ?
I tried looking for those files yesterday, but all I found were Sunrise Magazine demodisks.
Or is that what I'm supposed to find ? (I was looking for text-manuals)

Kris

By ro

Scribe (4696)

ro's picture

21-08-2003, 11:24

hmm, dunno. Haven't been on funnet for a while. I'll check
Maybe rob hiep could set them online on his site??? after all, most magz are declared P.D. and hell, the last magz should be too!

Well, I've send you some docs I found in my docz directory already.
I'll find some more for ya. be patient

By Latok

msx guru (3867)

Latok's picture

21-08-2003, 12:52

Apart from the first issue, the Sunrise magazines aren't PD. If they would have been pd, we would have put them online in our Downloads already. They indeed contain very important stuff about programming etc.

You should try M.I.L.C. That's also a very interesting database for all your questions....

And the map of course....

Page 2/5
1 | | 3 | 4 | 5