CPCWiki forum

General Category => Programming => Topic started by: zhulien on 14:45, 02 July 19

Title: Sprites
Post by: zhulien on 14:45, 02 July 19
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/
Title: Re: Sprites
Post by: roudoudou on 15:56, 02 July 19
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
Title: Re: Sprites
Post by: roudoudou on 17:39, 02 July 19
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
Title: Re: Sprites
Post by: norecess464 on 19:13, 02 July 19
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
Powered by SMFPacks Menu Editor Mod