EGFX · FUNCTION 35ALPHA · USE AT YOUR OWN RISK
SPRITE_ROM_ONCE
Draw one sprite from a companion ROM.
Draws one 16×16 frame from a page-aligned EGSP v3 pack in a read-only companion ROM, without replacing an active world, resource or tile backend. Use it for an occasional sprite from a second pack while another pack is registered. Returns status 1 for an invalid pack or frame. There is no BASIC helper; set the block directly as shown.
Parameters
| Name | Bytes | Description |
|---|---|---|
PX/PY | 8–11 | signed 16-bit position |
IMAGE | 12 | frame number |
COLOUR | 13 | unused for 2bpp packs; send 0 |
FLAGS | 14 | &10 mirror X, &20 mirror Y, &40 rotate 90° clockwise |
BANK | 16 | source ROM slot |
PAGE | 17 | header page, &80–&BF |
BASIC example
Tested listing: ex35.bas, run in B-em on a Master 128. Append the EGFX helpers from gfx-basic.bas (the build does this for you), and put the Breakout EGASSETS.rom (with the beta release) in slot 7 where the example draws from &81/&87.
10 MODE 1:HIMEM=&2400:PROCeginit
20 PROCegbegin
30 PROCegxy(120,100):egb%?12=2:egb%?13=0:egb%?14=&10:egb%?16=7:egb%?17=&81:PROCegcall(35)
40 PROCegtext("FN35 OK",8,8):PROCegpresent
50 END
Assembly
LDA #35 : STA block+5 ; function
LDA #0 : STA block+7 ; clear ACK
LDA #&C0 : LDX #block MOD 256 : LDY #block DIV 256
JSR &FFF1 ; OSWORD &C0; block+7 = &A5 on success