How to recover hw sprites data on SCREEN5

Page 2/2
1 |

By Metalion

Paragon (1616)

Metalion's picture

04-12-2022, 12:06

Grauw wrote:

It's not possible to use BASE to change the sprite table addresses?

I thought also of that as soon as I read this topic, so I checked but unfortunately, it seems that BASE is read-only for SCREEN 5 and above. See wiki : https://www.msx.org/wiki/BASE

By Sandy Brand

Champion (295)

Sandy Brand's picture

04-12-2022, 12:14

Yes, I always wondered why MSX BASIC never supported this for the higher screen modes, as there is no real technical reason as far as I can see?

By Grauw

Ascended (10681)

Grauw's picture

05-12-2022, 16:04

Oh that’s lame. It looks like there are no entries above base 19 in the system area either.

By OrazioLC

Rookie (19)

OrazioLC's picture

05-12-2022, 19:14

Hi @Sandy Brand, I tried with the trick you explained to me, but there is a problem, when I load the background image with BLOAD"..", S is not read, or better to say only incomprehensible signs are seen . This will surely be due to the fact that register R#23 (VDP24) is moved. What could be done about it? Maybe copy it to another page, but then if I transfer it to the active page what happens?
thank you very much

By Sandy Brand

Champion (295)

Sandy Brand's picture

05-12-2022, 22:46

The contents of VDP(24) should not influence the result of the BLOAD command Smile

Have you tried something like SET PAGE ,1:BLOAD"...",S ?
The second parameter of the SET PAGE command sets the destination working page that will be used by the BLOAD command.

Or, perhaps what you are seeing if you modify VDP(24) is 'uninitialized' parts of the VRAM? The screen is actually 256 lines high, and maybe the BLOAD command only loads data into, for example, VRAM lines 0 through 211?

By OrazioLC

Rookie (19)

OrazioLC's picture

06-12-2022, 12:08

Yes, I put it on the second page (SET PAGE 0,2) and then copied the top of the screen to the bottom not visible (0,212). I tested with your program before entering my data. The image was saved with BSAVE"namefile",0,27135,S
For you to understand better I am attaching your program with modifications.

10 SCREEN 5,2:COLOR 15,1,1:SETPAGE0,2:BLOAD"strada1.pi5",S
20 SET PAGE 1,1:CLS:LINE(0,0)-(255,7),12,BF:LINE(0,100)-(255,107),8,BF:VDP(24)=100
30 SET PAGE 1:V=VDP(2):SET PAGE 0,0:VDP(2)=V
40 P$="":FORA=0TO31Tongue$=P$+CHR$(255):NEXT A:SPRITE$(0)=P$
50 C$="":FORA=0TO15:C$=C$+CHR$(A):NEXT A:COLOR SPRITE$(0)=C$:Y=0:COPY(0,0)-(255,211),2TO(0,0),0:COPY(0,0)-(255,44) TO (0,212)
100 X=X+1:IFX>255THENX=0
105 VDP(24)=I:I=I+1:IFI=256THENI=0
110 PUT SPRITE 0,(X,100),,0
120 IF STRIG(0)=0THEN100

By Sandy Brand

Champion (295)

Sandy Brand's picture

06-12-2022, 12:53

Ah I see. I think the problem is that MSX BASIC internally clamps the values for the COPY command to the resolution what is normally the visible part of the screen (which for SCREEN 5 is (0,0)-(255,211)).

I think the VPOKE and VPOKE command don't have this constraint. So instead of "COPY(0,0)-(255,44) TO (0,212)" you could try to use these to copy the graphics from page 0 into page 1?

An other option could be is to use something like X BASIC?
From what I remember, it doesn't enforce the clamping constraints that normal BASIC does (probably in an attempt to speed up the execution, relying on the programmer to do clamping manually when needed).

By NYYRIKKI

Enlighted (6011)

NYYRIKKI's picture

07-12-2022, 02:55

Sandy Brand wrote:

Ah I see. I think the problem is that MSX BASIC internally clamps the values for the COPY command to the resolution what is normally the visible part of the screen (which for SCREEN 5 is (0,0)-(255,211)).

The border check is not that good, this trick will actually work although 212 will be converted to 211 automatically.

Sandy Brand wrote:

An other option could be is to use something like X BASIC?
From what I remember, it doesn't enforce the clamping constraints that normal BASIC does (probably in an attempt to speed up the execution, relying on the programmer to do clamping manually when needed).

Actually in X-BASIC you manually need to remove the line limit by using '#C- command...

In MSX-BASIC version 3.0 or later you can do the same by typing POKE &HFAFC,PEEK(&HFAFC)OR16

Page 2/2
1 |