New demo uploaded: 64x64 Ship Sprites

All aspects of programming on the Commander X16.
Post Reply
rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

New demo uploaded: 64x64 Ship Sprites

Post by rje »




64x64 Ship Sprites




View File






This simple demo loads five 64x64 8-bit sprite images into VRAM, each an ancient sailing ship.  Sprite 0 is turned on to point at them; press spacebar to cycle through the images.

Use the cursor keys to move the sprite around the screen.  The spacebar will also stop the movement.

 






  • Submitter




    rje




  • Submitted


    01/29/21




  • Category







 
rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

New demo uploaded: 64x64 Ship Sprites

Post by rje »


There is one thing that bothered me just a bit about sprites in this demo: selecting the RAM window for the image sort-of requires a VPOKE to *TWO* addresses.  Here's why.

A 256 color 64x64 sprite takes up 2K RAM.  So a list of them starting at $04000 would be at these nice even addresses:

$4000

$5000

$6000

$7000

... and so on.

But, the way the sprite window is split between two memory registers, you'd have to VPOKE to two addresses to do this.

So for the demo, I aligned these images on $2000 byte boundaries:

$4000

$6000

$8000

$A000

$C000

Leaving 2K gaps between each.

It's not a major big deal, but every little odd corner adds up.

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

New demo uploaded: 64x64 Ship Sprites

Post by rje »


As for the sprites themselves, I think they look just a little too jaggy.  I have a set of greyscale images that I'll try next.

...yes, greyscale looks a bit better, but perhaps the jaggies are mainly from the "flashier" ships like the Genoese Galley and the Xebec.

 

Now the greyscale looks like it's constrainable into a 4 bit scheme, which means these sprite images could shrink from 4K down to 2K, which would be nice.

 

SHIPS-BW.PRG

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

New demo uploaded: 64x64 Ship Sprites

Post by rje »


Updated the demo.

* removed user control; ship wanders aimlessly

* added 7 more ships

* added some mild flocking behavior in the additional ships

Fenner Machine
Posts: 68
Joined: Tue Jul 28, 2020 8:30 pm

New demo uploaded: 64x64 Ship Sprites

Post by Fenner Machine »



On 1/29/2021 at 3:43 PM, rje said:




A 256 color 64x64 sprite takes up 2K RAM.





Is this correct?


A 64x64 sprite at 8 bits per pixel (256 colour) would take 4K RAM?


Or am I missing something?

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

New demo uploaded: 64x64 Ship Sprites

Post by rje »



1 hour ago, Fenner Machine said:




Is this correct?



A 64x64 sprite at 8 bits per pixel (256 colour) would take 4K RAM?



Or am I missing something?



You're right.  It's my brain.

Post Reply