Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2020-02-18 03:35:46

toxa
Member
Registered: 2020-02-13
Posts: 309

C code optimization

Hi!

In order to make a sprite that is always beneath the other sprite, I wrote some code, that merges sprites with background manually. I tried to follow these guidelines: http://gbdk.sourceforge.net/guidelines.html but unfortuanately my code is not as fast as it should be. I wonder if there is something else can be done with this code, other than rewriting it using asm?

the code: https://www.dropbox.com/s/eiaw6ooc7jinm … 3.zip?dl=0
the original topic: https://gbdev.gg8.se/forums/viewtopic.php?id=686

Maybe someone can share other hints here?

Last edited by toxa (2020-02-18 03:43:15)

Offline

 

#2 2020-02-19 04:40:39

toxa
Member
Registered: 2020-02-13
Posts: 309

Re: C code optimization

you can do some funny things with it: https://www.dropbox.com/s/ksm5m11t0m3du … t.zip?dl=0 but, unfortunately, it's still too slow.

Offline

 

#3 2020-02-19 11:45:55

toxa
Member
Registered: 2020-02-13
Posts: 309

Re: C code optimization

ps: although, precalculations may help

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson