Jump to content
IGNORED

Char based software sprites


NRV

Recommended Posts

This is an "old" experiment to use char based software sprites, with source included.

Plus a nice intro using pcm 4+4 samples, with the screen on (the only reason for this to use a 1MB cartridge).

 

Many thanks to MrFish for improving the original graphics, adding color to the level, and creating that nice car :)

 

Features:

- 10 cars with logic to check collisions and move through the maze, every car with a different speed and acceleration.

- char based, pre shifted and pre compiled software sprites (with sizes that changes between 2x3, 3x2 and 2x2 chars).

- full copy of the background and proper masking for every sprite.

- NTSC, 60 fps, with free time to do 1 or 2 more cars probably (more in PAL).

- double buffered screen (40x25, antic4 graphic mode) and font.

- some DLI's used through the screen, to add extra color (no interleaved fonts).

 

I did a second version of this, but without using pre compiled sprites.

Reading the data from tables I could display 7 cars in more or less the same time (not bad I suppose).

 

But after my experiments with software sprites years ago, I was a little disappointed with the results that I got.

I mean, using software sprites in a bitmap mode is a lot simpler and probably faster in some cases, than using the same resolution in a char mode.

For example, if you have many small sprites (let's say 4x2 pixels) in char mode, you are going to need to touch (copy) a lot more memory,

than using those same sprites in graphic mode (in average).

And in general you are going to move more memory in a char mode, for sprites of the same (small - medium) size.

 

The good thing with using chars is that you can get an extra color, or do some visual tricks just plotting chars, or maybe

do font animations without touching the screen data.

And restoring the screen ("erasing" the sprites), should be faster than in a graphic mode.

Probably with bigger sprites, using chars is a win-win.

 

Pre shifted and pre compiled sprites use a lot of memory by definition.

In this case the car has 28 frames (4 going right, 4 going left, 4 diagonals, 8 going up, 8 going down), that amounts to something below 12KB.

I probably could reduce that number to something below 9KB, by optimizing the size of the 16 frames for the vertical movement, that also

include the empty space at the start and end of the car (to pad to the height of 3 chars).

I did it like that just because it was faster and easier to implement.

 

The pre-shifted frames are also used to have the tires animation, so they have more reason to exist.

 

 

rdemo_carts.zip

 

rdemo_source.zip

  • Like 16
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...