News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ervin

SDCC question - how to deal with program being too large?

Started by ervin, 15:58, 19 July 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ronaldo

For instance, on Platform Climber I get some of these sources of entropy over an easy getRandomUniform function. When I ask for a new random number, I pass an increment as parameter, which comes from an entropy source, and that guarantees an entropy based walk over the randomly scattered sequence.

It's very easy and works nicely :)

ervin

Quote from: ronaldo on 17:49, 21 July 15
Count the number of iterations (call this NI) of your main loop during menu screen until the user starts the game.

That's brilliant - thank you so much!
I've implemented that idea, and removed the time_small files.
My compiled binary is now down to 4797 bytes!!!

I'm (happily) shocked at the size difference.  ;D ;D ;D
I have no more problems with where to put my sprites!

pacomix

Quote from: ronaldo on 13:19, 21 July 15

The good news is that you actually don't have to deal with crt0.s to get the same result.
With the latest version of CPCtelera you can do the same, as we suggested, changing the stack and loading your code even as low as 0x0040 :) . Propperly distributing code functions is something we always have to keep in mind, and it's always nice to have an easy interface like cpct_setStackLocation and the prefix declarator __at(XXXX) from SDCC.

Yep. Different ways of doing the similar things. I personally prefer dealing directly with the startup code directly instead of depending on a third party lib unless it provides a way to import only those routines that you use and not the entire lib. I don't remember now if SDCC provides a way to exclude the non-referenced symbols or not.
To start programming is very useful but later on one usually wants to have full control.

Quote from: ronaldo on 13:19, 21 July 15
How's your CPC Bros going? I'm quite anxious to have it in my hands and invest hours playing with it :D . It's a really nice job you are doing there! Please, keep it up! :D

So... LOL I think you will continue waiting. It's PAUSED since almost a year 'cos I have a quite busy life. It's a pity.

ronaldo

Quote from: pacomix on 14:15, 22 July 15
Yep. Different ways of doing the similar things. I personally prefer dealing directly with the startup code directly instead of depending on a third party lib unless it provides a way to import only those routines that you use and not the entire lib. I don't remember now if SDCC provides a way to exclude the non-referenced symbols or not.
To start programming is very useful but later on one usually wants to have full control.
I completely agree with you. That's why CPCtelera was conceived to give full control to its developers ;) . CPCtelera is designed so that only used functions are imported, and that's completely transparent to the programmer. In fact, it's easy to see: full .lib is now 76 KB, which won't fit in 64K by itself :D .

Moreover, you can use CPCtelera only as framework for easy developing and compiling, without making any use of its low-level library. You can develop in C or ASM (or even combinations of both!) and only have to worry about writing your code, and not about setting your environment :) .

In fact, I'd love to have a deep critical opinion from developers like you. If you ever have oportunity to test it throughly, please let me know your complete opinion and ideas about what you consider good and bad ;) .

pacomix

Quote from: ronaldo on 16:50, 22 July 15
I completely agree with you. That's why CPCtelera was conceived to give full control to its developers ;) . CPCtelera is designed so that only used functions are imported, and that's completely transparent to the programmer. In fact, it's easy to see: full .lib is now 76 KB, which won't fit in 64K by itself :D .

Moreover, you can use CPCtelera only as framework for easy developing and compiling, without making any use of its low-level library. You can develop in C or ASM (or even combinations of both!) and only have to worry about writing your code, and not about setting your environment :) .

In fact, I'd love to have a deep critical opinion from developers like you. If you ever have oportunity to test it throughly, please let me know your complete opinion and ideas about what you consider good and bad ;) .

I didn't have time to take a look at it but it sounds nice. Having a framework/toolchain/ide to start programming is quite useful even if you don't make use of the lib functions.

Powered by SMFPacks Menu Editor Mod