Schrijver
| Page flipping + sprites in BASIC
|
Imanok msx addict Berichten: 283 | Geplaatst: 20 Mei 2005, 17:13   |
I'm doing some tests with page flipping and sprites in Basic.
I know you have to define the sprites at the two pages you use for the flipping, but... can I define them on only one page and to copy that definition to the other one?... I tried to do it like this:
COPY (0,212)-(255,255),0 TO (0,212),1
but it doesn't work... |
|
ARTRAG msx master Berichten: 1686 | Geplaatst: 20 Mei 2005, 17:53   |
The basic clips the copy command in the visibile area. You cannot
copy under the border using the copy command.
If you want to do that in basic, a way is using vpeek and vpoke and
a for loop.
In any case you do not need to copy sprites if you do page flipping
try this:
during inzialization store the vdp registers for sprites of page 0, like this
set page 0:a = vdp(5):b = vdp (6) : c = VDP(12)
in the loop, when you do the flip try
setpage 1: vdp(5)=a: vdp(6)=b: VDP(12) = c
this will restore the display of the sprites in page 0
Take care that you could have problems in the use of the command
put sprite
as it is conected to the active (non visibile) page.
My suggestion is to use vpoke in the sprite attribute table instead.
It is faster and you know in wich page your sprites are
|
|
BiFi msx guru Berichten: 3142 | Geplaatst: 20 Mei 2005, 19:21   |
VDP(2)=32*displaypage+31 and about COPY in the non-visible area using BASIC... as long as you keep the coordinates within the unclipped area it will work fine... for example: COPY (0,0)-(255,47),1 TO (0,211),0 will work fine... or you can of course use the COPY -STEP feature... |
|
[D-Tail]
 msx guru Berichten: 3018 | Geplaatst: 21 Mei 2005, 00:31   |
Imanok, you use NBASIC, right? Then you could also do this: 10 _turbo on
20 '#C-
30 copy (0,0) - (255,255),0 to (0,0),1
40 setpage 1,1
50 '#C+
60 _turbo off
70 goto 70
Line 20 sets clipping off, so you can access the lines below 232 (orso) anyway. #C+ sets clipping on again. |
|
Imanok msx addict Berichten: 283 | Geplaatst: 23 Mei 2005, 09:33   |
Yes, I'm using Nbasic.
I'll give a try to the different solutions you told me.
Thank you all!  |
|
[D-Tail]
 msx guru Berichten: 3018 | Geplaatst: 23 Mei 2005, 09:56   |
Note that the clipping functions were already added in XBASIC (around which NBASIC was wrapped). There are several other functions, like #N(+|-) to enable XBASIC to handle large numbers (like 'for I=0 to &h7FFF') and #I for inline ASM (using opcodes). Also check this manual for BASIC 3.0 (the first pages, Dutch) and XBASIC (the last pages, English). Good luck! |
|
|
|
|