News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_zhulien

Sprites

Started by zhulien, 14:45, 02 July 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zhulien

I had an idea for sprites, I am unsure if it is common or not.  Most often people think of sprites as data.  Basically you have a routine that reads the data and transfers it to graphics memory.


Is it common to make sprites 'instructions'?  From a sprite generator, it produces a series of instructions.  I imagine it would take twice as many instructions to draw a sprite than it would the data, such as ld hl,#c000; ld a,255; ld (hl),a; inc hl; ld (hl),a; etc...


of course it isn't only setting hl, setting a, storing the values, but also at the end of the sprite line adding the screen offset needed to start the next line...


I suspect this would gain performance however increase storage requirements... by what factor if it is common practice? 


Is it what the sprite compiler in this thread is doing?  http://www.cpcwiki.eu/forum/programming/amstrad-plus-sprite-compiler-v1-0/

roudoudou

Sprite compiler is dedicated to hardware Sprites so it's easier


For software Sprites there is another thread which i let you find since i'm with a phone now
My pronouns are RASM and ACE

roudoudou

got this on the wiki but i'm pretty sure there were a topic about it
http://www.cpcwiki.eu/index.php/Programming:Fast_Sprites
My pronouns are RASM and ACE

norecess464

To reply to original question, yes it's quite common to "compile" sprites. Of course it takes more RAM, but less CPU-time. There are so many different ways to compile a sprite that it's almost impossible to describe all of them here.  :D
My personal website: https://norecess.cpcscene.net
My current project is Sonic GX, a remake of Sonic the Hedgehog for the awesome Amstrad GX-4000 game console!

Powered by SMFPacks Menu Editor Mod