TFH's new project - Shooting Stars 2022 - Help Wanted

Page 2/4
1 | | 3 | 4

By tfh

Prophet (3318)

tfh's picture

03-02-2022, 14:45

turbor wrote:

It has been a long time since I did BASIC, but some things that I should do

  • screen 5,0 : explicitely state the size of the sprites 8x8,no magnification
  • DEFUSR=&H41:Z=USR(0) => disable screen display can be done faster and simpler with vdp(1)=vdp(1)and191
  • DEFUSR=&H44:Z=USR(0) => enable screen display can be done simpler with vdp(1)=vdp(1)or64
  • FORM=LTO0STEP1:NEXTM=>drop step1 and the M after next or did you mean step -1? because counting from any pos interger to 0 will immediately finish after one loop with step 1. I can't fathom what purpose that loop serves... Big smile

Added the screen 5,0 and indeed fixed the step 1 -> -1.. That was indeed a bug. Thanks!

Quote:

Also slightly faster version of IFA=3THEND=D+VELSEIFA=7THEND=D-V is to write it as
D=D+V*(-(A=3)+(A=7))

Are you sure?


Quote:

Now for the sprite issues.
You are using screen 5 so it is sprite mode2 and you need to set a sprite color table and all.
Now the good news is that BASIC is hiding this for you in the putsprite command but IIRC sprites and different pages can cause BASIC to screw up with the vram addresses.

I would (not tested and as as quick fix) try to recreate the sprite$(0) ans sprite$(1) each time you you switch pages. This way BASIC needs to rewrite the vram for the current page setting.

The thing is that I actually do set the sprites after each page swap. I do a GOSUB560 after eacht set page:

560 GOSUB530:GOSUB580:GOSUB590:GOSUB600:RETURN

And with GOSUB530 you get:

530 SPRITE$(0)=CHR$(16)+CHR$(56)+CHR$(124)+CHR$(254)+CHR$(124)+CHR$(56)+CHR$(16)
540 SPRITE$(1)=CHR$(129)+CHR$(129)+CHR$(129)+CHR$(195)+CHR$(165)+CHR$(153)+CHR$(255)+CHR$(255)
550 RETURN

By tfh

Prophet (3318)

tfh's picture

03-02-2022, 14:46

Samor wrote:

I tested in a few emulators and in both openmsx and bluemsx there is sprite corruption in msx2+ mode that is not there in msx2 mode (makes sense as the same thing happens on the sx-2, which is a 2+). Webmsx seems to be the only emulator that also shows the corruption in msx2 mode which might indicate that the msx2 machine configuration in webmsx is different.

On my NMS-8280 I get a copy of the star-sprite next to my ship.

By tfh

Prophet (3318)

tfh's picture

03-02-2022, 14:48

Jipe wrote:

the sprite defect appears with the instruction SET PAGE 1,1
if we replace the SET PAGE 1,1 by COPY(0,0)-(255,211),1 to (0,0),0 the sprite is preserved
the set page must destroy something in the pattern of the sprites

But if I do that, I will lose one of my playfields from VRAM. I am re-using those at a later stage and I would like to keep loading down to a minimum. I was hoping to solve this without loosing one of my playfields from VRAM.

By gdx

Enlighted (6117)

gdx's picture

03-02-2022, 15:02

Try by setting same sprites in each page you display.

By tfh

Prophet (3318)

tfh's picture

03-02-2022, 15:10

gdx wrote:

Try by setting same sprites in each page you display.

I already do that.
After each set page, I read the sprites again. I know it's messy coding with all those gosubs, but these 2 lines are called after each set page command:

530 SPRITE$(0)=CHR$(16)+CHR$(56)+CHR$(124)+CHR$(254)+CHR$(124)+CHR$(56)+CHR$(16)
540 SPRITE$(1)=CHR$(129)+CHR$(129)+CHR$(129)+CHR$(195)+CHR$(165)+CHR$(153)+CHR$(255)+CHR$(255)

By gdx

Enlighted (6117)

gdx's picture

03-02-2022, 15:25

And change page with the VDP instruction instead of SET PAGE?

By tfh

Prophet (3318)

tfh's picture

03-02-2022, 15:28

gdx wrote:

And change page with the VDP instruction instead of SET PAGE?

Sure, I can try that. I didn't know you can also do it with a VDP command. Which would that be?

By Samor

Prophet (2171)

Samor's picture

03-02-2022, 17:26

tfh wrote:

On my NMS-8280 I get a copy of the star-sprite next to my ship.

This happens every time?

By tfh

Prophet (3318)

tfh's picture

03-02-2022, 17:33

Samor wrote:
tfh wrote:

On my NMS-8280 I get a copy of the star-sprite next to my ship.

This happens every time?

Only on set page 1,1 ;-)
I'll have another look this evening.

By Jipe

Paragon (1605)

Jipe's picture

03-02-2022, 18:14

in Basic the set page corrupted the sprites
i have make a test, saving the sprite in SCREEN5
BSAVE"SP.BIN",&H74000,&H7FFF,S
after SET PAGE x,0 -> BLOAD"SP.BIN",S
after SET PAGE x,1 -> BLOAD"SP.BIN",S,&H8000
after SET PAGE x,2 -> BLOAD"SP.BIN",S
after SET PAGE x,3 -> BLOAD"SP.BIN",S,&H8000

and i test alls stages, work fine
hard parkison stages Wink

the VRAM mapping for SCREEN 5 is
page 0 0000h to 7FFFh
page 1 8000h to FFFFh
page 2 10000h to 17FFFh
page 3 18000h to 1FFFFh

Page 2/4
1 | | 3 | 4