prog8: const uword SPRITE_DATA_ADDR = $2000 ?

All aspects of programming on the Commander X16.
Post Reply
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

prog8: const uword SPRITE_DATA_ADDR = $2000 ?

Post by funkheld »

Hi good afternoon.
why does the data in the sprite demo start here in prog8:
const uword SPRITE_DATA_ADDR = $2000 ?

in the x16 kernal : $1:3000 - $1:afff
-------------------------------
main {
; we choose arbitrary unused vram location for sprite data: $12000
const ubyte SPRITE_DATA_BANK = 1
const uword SPRITE_DATA_ADDR = $2000
const ubyte SPRITE_PALETTE_OFFSET_IDX = 16
.......
.......

Thanks.
greeting
Attachments
sprite-data.jpg
sprite-data.jpg (36.11 KiB) Viewed 533 times
User avatar
desertfish
Posts: 1098
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: prog8: const uword SPRITE_DATA_ADDR = $2000 ?

Post by desertfish »

you can put the sprite data everywhere you like, as long as you also set the sprite data pointer to the correct values, and handle all sprite register manipulation yourself.

I don't know why that $13000 region is even mentioned tbh. Maybe for the two kernal routines that handle sprites? I've never used those.
DragWx
Posts: 345
Joined: Tue Mar 07, 2023 9:07 pm

Re: prog8: const uword SPRITE_DATA_ADDR = $2000 ?

Post by DragWx »

That table explains how the Kernal configures the VERA's memory layout when you're using the Kernal's text mode and graphics/sprite routines.

If you're not using these Kernal functions, then you can manually configure the VERA's memory layout however you like, but it will be your program's responsibility to operate the VERA, instead of relying on Kernal functions.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: prog8: const uword SPRITE_DATA_ADDR = $2000 ?

Post by funkheld »

danke für die info.

gruss
Post Reply