Error on TinySprite export code

Por mcavalcanti

Rookie (20)

imagem de mcavalcanti

22-02-2013, 12:42

Hi, guys.

I generated four sprites using TinySprite and exported the BASIC code. But when I run it on BlueMSX, it occurs the RETURN WITHOUT GOSUB error. Please, anyone can help me? Code below:

10 ' --- Slot 0
20 ' color 1
30 DATA &H00,&H00,&H03,&H0F,&H1F,&H1F,&H3F,&H3F
40 DATA &H3F,&H3F,&H1F,&H1F,&H0F,&H03,&H00,&H00
50 DATA &H00,&H00,&HC0,&HF0,&HF8,&HF8,&HFC,&HFC
60 DATA &HFC,&HFC,&HF8,&HF8,&HF0,&HC0,&H00,&H00
70 ' 
80 ' --- Slot 1
90 ' color 1
100 DATA &H00,&H03,&H07,&H0F,&H0F,&H1F,&H1F,&H1F
110 DATA &H1F,&H1F,&H1F,&H0F,&H0F,&H07,&H03,&H00
120 DATA &H00,&HC0,&HE0,&HF0,&HF0,&HF8,&HF8,&HF8
130 DATA &HF8,&HF8,&HF8,&HF0,&HF0,&HE0,&HC0,&H00
140 ' 
150 ' --- Slot 2
160 ' color 1
170 DATA &H00,&H00,&H03,&H0F,&H1F,&H1F,&H3F,&H3F
180 DATA &H3F,&H3F,&H1F,&H1F,&H0F,&H03,&H00,&H00
190 DATA &H00,&H00,&HC0,&HF0,&HF8,&HF8,&HFC,&HFC
200 DATA &HFC,&HFC,&HF8,&HF8,&HF0,&HC0,&H00,&H00
210 ' 
220 ' --- Slot 3
230 ' color 1
240 DATA &H00,&H03,&H07,&H0F,&H0F,&H1F,&H1F,&H1F
250 DATA &H1F,&H1F,&H1F,&H0F,&H0F,&H07,&H03,&H00
260 DATA &H00,&HC0,&HE0,&HF0,&HF0,&HF8,&HF8,&HF8
270 DATA &HF8,&HF8,&HF8,&HF0,&HF0,&HE0,&HC0,&H00
280 DATA *
10000 REM -- LOAD SPRITES
10010 S=BASE(9)
10020 READ R$: IF R$="*" THEN RETURN ELSE VPOKE S,VAL(R$):S=S+1:GOTO 10020

By the way, what is the correct PUT SPRITE syntax to show these sprites?

Best.

Entrar ou registrar-se para comentar

Por Creepy

Champion (335)

imagem de Creepy

22-02-2013, 12:52

You HAVE to call the sprite loading with a GOSUB. So somewhere in your own code you do "GOSUB 10000" and it will all work. The code is fine. Get a BASIC book or something and try to read and learn that. It will explain how to use PUT SPRITE. It will alsho help you understand why the basic code you are using now has an error.

Por mcavalcanti

Rookie (20)

imagem de mcavalcanti

22-02-2013, 13:44

Hi. I just read. Can't understand where exactly to use put sprite and sprite$ on this code. Can you help me?

Por Jipe

Paragon (1528)

imagem de Jipe

22-02-2013, 17:15

added this program

10 SCREEN2,2
20 GOSUB 10000
30 FOR I=20TO230
40 PUT SPRITE (I,100),10,1
50 NEXT I
60 GOTO 30

you can change parameter
10=color of sprite
1=number of sprite

Por mcavalcanti

Rookie (20)

imagem de mcavalcanti

23-02-2013, 18:11

Thanks a lot for the help! I got it Smile