GP2X Sdl Bitmap Scaler


Unfathomable Depths said:
Yea.. Im kind of new to C and havent even looked at arm assembler yet.

I know its not as optimized as it could be - just thought it would be useful to someone.

BTW I did see the edit - it just never registered - sry.
Well what you did indicates a pretty low level understanding of things for someone who's new to it, I guess that's why I figured you knew ARM ASM. If you want I can rewrite it in ASM just to see how it performs, if someone's willing to benchmark it >_>

(only real deterrent to this is that I don't like inline ASM, and writing the entire function in ASM would be kinda annoying since it uses SDL structs)
 
Last edited by a moderator:
I used to write games professionally for the Spectrum and Amstrad CPC back in the day :D z80 assembler. Dabbled in 68k asm too before getting a 'real' job. So working with blocks of memory and pointers (and pointers to pointers) is nothing new. I really should get a good C++ book because Im just stumbling through right now.

Id be more than happy to benchmark any code you write. And Id love to see the finished code just for the insight into arm asm. Ditch the structs and write direct to the SDL bitmap.

[edit] Also the version of bmscaler I used in my GBAX entry has another argument - colour mask. Id love to try and modify your asm code to include that. Kind of like a little exercise in asm for me. Learning by doing and all that :)
 
Unfathomable Depths quick question for you. Is there a reason in you code that you used dest_pixels++;dest_pixels++; twice instead of just dest_pixels+=2; I was just wondering if it served some point I missed?
 
GP2X_Coder said:
Unfathomable Depths quick question for you. Is there a reason in you code that you used dest_pixels++;dest_pixels++; twice instead of just dest_pixels+=2; I was just wondering if it served some point I missed?
Hoping for two INCs instead of an ADD?
 
Last edited by a moderator:
Poobah said:
GP2X_Coder said:
Unfathomable Depths quick question for you. Is there a reason in you code that you used dest_pixels++;dest_pixels++; twice instead of just dest_pixels+=2; I was just wondering if it served some point I missed?
Hoping for two INCs instead of an ADD?


The one add is better.

Oh crap I forgot about this thread. Should I still try something? >_<
 
Last edited by a moderator:
Exophase said:
Poobah said:
GP2X_Coder said:
Unfathomable Depths quick question for you. Is there a reason in you code that you used dest_pixels++;dest_pixels++; twice instead of just dest_pixels+=2; I was just wondering if it served some point I missed?
Hoping for two INCs instead of an ADD?


The one add is better.

Oh crap I forgot about this thread. Should I still try something? >_<


Go for it see how much ARM ASM will increase the speed my ASM sucks. :( I would like to see how you go about coding this funcion.
 
Last edited by a moderator:
GP2X_Coder said:
Exophase said:
Poobah said:
GP2X_Coder said:
Unfathomable Depths quick question for you. Is there a reason in you code that you used dest_pixels++;dest_pixels++; twice instead of just dest_pixels+=2; I was just wondering if it served some point I missed?
Hoping for two INCs instead of an ADD?


The one add is better.

Oh crap I forgot about this thread. Should I still try something? >_<


Go for it see how much ARM ASM will increase the speed my ASM sucks. :( I would like to see how you go about coding this funcion.


Ive never actually looked at the output from the DevC compiler but its written in Zilog stone that two INCs are quicker than one ADD.

Z80 was pish at adding anything bigger than 8bits together (you had to add the carry flag).
 
Last edited by a moderator:
Back
Top