Schrijver
| Screen 5 tutorials
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 2003, 15:55   |
Are there anywhere screen 5 tutorials (MSX basic) available on the web ?
I've been searching funet and the web, but can't find much 
Guess my timing is pretty bad, now that MSXHans's site is down
Thanks.
K. |
|
ro msx guru Berichten: 2315 | Geplaatst: 20 Augustus 2003, 15:57   |
have you checked the genic/sunrise magazines, especially the 'specials' ? you'll find some very interesting stuff there (hell, even some articles from me  )
good luck
(you'll find the magz. on funet. see the linx->FTP section here) |
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 2003, 16:27   |
Ok, I'll look there
Another question:
Is there any MSX-Basic editor available that can handle multiple bas files in different windows, so I could copy-paste stuff ?
Thanks.
K. |
|
GuyveR800 msx guru Berichten: 3048 | Geplaatst: 20 Augustus 2003, 17:07   |
Quote:
| Is there any MSX-Basic editor available that can handle multiple bas files in different windows, so I could copy-paste stuff ?
|
No, but you could save as ASCII (SAVE "file",A) and load it up in a text editor.
Alternatively, if you're gonna use text editors anyway, you could use use Nestorpreter. (www.konamiman.com)
It allows you to use long variable names, no more linenumbers but actual labels (like MS Q-BASIC) etc.. It makes BASIC programming a lot easier/nicer! |
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 2003, 17:10   |
Ok, I've been meaning to check out the Nestor tools, just hadn't had the time 
Still coding on my 3D OpenGL game based on MoG  Still lots and lots of work to do there
Maybe later today I'll check it all out 
Thanks for your replies.
Kris |
|
GuyveR800 msx guru Berichten: 3048 | Geplaatst: 20 Augustus 2003, 17:10   |
Quote:
| Are there anywhere screen 5 tutorials (MSX basic) available on the web ?
|
Exactly what do you want to know? SCREEN 5 is about the simplest screen available in MSX, it can be explained with just a few sentences. |
|
ro msx guru Berichten: 2315 | Geplaatst: 20 Augustus 2003, 17:13   |
euh... no you can't.
unless you just wanna throw specs...
I think he want's to know more about coding the VDP in general, not?
|
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 2003, 17:23   |
I want to learn how to store graphics tiles, and then loading them to the screen to build up a game level.
|
|
ro msx guru Berichten: 2315 | Geplaatst: 20 Augustus 2003, 17:31   |
have you checked the other topic 'backgrounds' already?
(didn't you start that one?!)
|
|
Maggoo msx professional Berichten: 576 | Geplaatst: 20 Augustus 2003, 17:53   |
Quote:
| I want to learn how to store graphics tiles, and then loading them to the screen to build up a game level.
|
For 8x8 tiles, it would be something like this:
10 screen 5
20 set page 0,1
30 rem Load tiles in page 1
40 bload"Titles",s
50 rem Load level data, say at &hC000
50 bload"level.dat"
60 a=&hc000
70 for y=0 to 184 step 8
80 for x=0 to 248 step 8
90 rem get tile number
100 t=peek(a):a=a+1
110 rem evaluate position X/Y of tile according to its number (max 256 tiles)
120 ty=t32:tx=t and 31
130 rem Copy the correct tile from page 1 to page 0
140 copy(tx,ty)-(tx+7,ty+7),1 to (x,y),0
150 next x
160 next y
170 goto 170
It 's gonna take you 768 (32x24) bytes to store the level data.
Quiet simplified but you got the idea. |
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 2003, 18:14   |
Quote:
| have you checked the other topic 'backgrounds' already?
(didn't you start that one?!)
|
Euh yes 
Anything added there ? I'll check
@Magoo: Thanks, looks like a good start for my MSX education  |
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 2003, 18:45   |
Extra question
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
Kris |
|
GuyveR800 msx guru Berichten: 3048 | Geplaatst: 20 Augustus 2003, 19:49   |
Quote:
| 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.
Quote:
| 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
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.
Quote:
| Thank you for your patience with me 
|
No prob  We're here to help! |
|
Argon msx professional Berichten: 842 | Geplaatst: 20 Augustus 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 ?
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
Heeelp
Thanks |
|
GuyveR800 msx guru Berichten: 3048 | Geplaatst: 20 Augustus 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.
|
|
|
|
|