SPRSAV

From C64-Wiki
Jump to navigationJump to search
Under Construction Site / Sign
Language German TO Language:english
This article has recently been imported from the German C64-Wiki and not been translated yet. Please come back at a later time to read the English version of this article or help us.
BASIC keyword
Keyword: SPRSAV
Abbreviation: S, P, R SHIFT+A
Type: Function
Token code: $fe $16 (254 22)
Handling routine
in BASIC ROM:
List of all BASIC keywords


Remark: This article describes the BASIC function SPRSAV in Commodore BASIC V7.0 or higher.

Type: Function
General Programming-Syntax: SPRSAV <target>,<destination>

With the instruction SPRSAV, raster data of a sprite can either be stored in a variable of the type of a string or restored from such or copied directly between sprites but also between strings.

The 2 possible parameters <from> and <to> have multiple meanings here, either.

  1. as a numeric expression the number of the sprite (values from 1 to 8 are allowed, otherwise the error message will occur) ?ILLEGAL QUANTITY ERROR) or
  2. for <of> as a stringn expression and for <to> only as the name of a string variable.

Less or more than 2 parameters lead to an abort with ?SYNTAX ERROR.

The data stored in the character string variable corresponds to the SSHAPE data format, but for a fixed extension of 24×21 pixels. This results in a character string length of 67 bytes.
SPRSAV always expects, when a variable is specified for the parameter <of>, that the content actually has the required format. If this is not the case, the command does not complain, but undesired and unexpected results occur (the appearance of the sprite is corrupted).

The sprite raster data can also be taken from a Hires or Multicolour graphic with the help of the SSHAPE command, whereby here the dimension of 24×21 or 12×21 must be kept exactly.

Another sprite commands in BASIC 7.0 are MOVSPR, RSPCOLOR, RSPPOS, RSPRITE, SPRCOLOR, SPRITE, and SPRDEF, also BUMP, COLLISION, GSHAPE and SSHAPE.


Examples[edit | edit source]

SPRSAV 3,4

Copies the sprite grid data from sprite 3 to sprite 4.

SPRSAV 4,S$

Puts the sprite 4 data into string variable S$.

SPRSAV S$,5

Transfers the data from string variable S$ into sprite 5.

BASIC V7.0 Commands

ABS | AND | APPEND | ASC | ATN | AUTO | BACKUP | BANK | BEGIN | BEND | BLOAD | BOOT | BOX | BSAVE | BUMP | CATALOG | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLLISION | COLOR | CONCAT | CONT | COPY | COS | DATA | DCLEAR | DCLOSE | DEC | DEF FN | DELETE | DIM | DIRECTORY | DLOAD | DO | DOPEN | DRAW | DS | DS$ | DSAVE | DVERIFY | EL | ELSE | END | ENVELOPE | ER | ERR$ | EXIT | EXP | FAST | FETCH | FILTER | FN | FOR | FRE | GET | GET# | GETKEY | GO64 | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | MOVSPR | NEW | NEXT | NOT | (OFF) | ON | OPEN | OR | PAINT | PEEK | PEN | (PI) | PLAY | POINTER | POKE | POS | POT | PRINT | PRINT USING | PRINT# | PUDEF | (QUIT) | RCLR | RDOT | READ | RECORD | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RND | RREG | RSPCOLOR | RSPPOS | RSPRITE | RUN | RWINDOW | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SLEEP | SLOW | SOUND | SPC( | SPRCOLOR | SPRDEF | SPRITE | SPRSAV | SQR | SSHAPE | ST | STASH | STEP | STOP | STR$ | SWAP | SYS | TAB( | TAN | TEMPO | THEN | TI | TI$ | TO | TRAP | TROFF | TRON | USR | VAL | VERIFY | VOL | WAIT | WHILE | WINDOW | WIDTH | XOR