[jugglemaster] Jugglemaster for Pocket PC (JMPocket)

Per Johan Groland per at jugglemaster.net
Fri Jun 25 13:02:09 EDT 2004


I just checked out the archive for the mailing list, and it seems that
some of the posts have not arrived in my inbox, specifically I've
only received the posts from Gary... Don't know if this is a problem with
the mailer or with my filters but anyway... I saw this:

>> I also thought I'd make a few comments on the changes done to jmlib:
>>
>> #define BMAX 630		     // max number of balls
>>
>> This was originally 35. Since the arrays in jmlib are all declared
>> statically, this adds something in the area of 32 kB to the static
>> memory requirement of jmlib. This doesn't matter on a PC of course,
>> but it does matter on some of the platforms I've been trying jmlib
>> on. Is it possible to add a typedef (e.g. JMLIB_BMAX_630) to make
>> jmlib chose 35 balls as default rather than 630?
>
>Excellent point. I'm not quite sure that I understand exactly how using a
>typedef would solve the problem [don't get me wrong, this is my lack of
>understanding, not your lack of insight ;-)]. I understand using something
>like
>
>#define JMLIB_BMAX_630 /* this would not be defined for PalmOS */
>
>#ifdef JMLIB_BMAX_630
> 	#define BMAX 630
>#else
> 	#define BMAX 35
>#endif
>
>This seems like a kluge to me. I don't like having that much stuff
>hardcoded. I think that the cleanest solution would be to have various
>arrays be dynamicly allocated, but maybe that's overkill. I dunno. I
>haven't actually compiled any of the code yet, so please take any thing I
>say with a grain of salt.

The main reason all the arrays are static is because that's the way
the code in the original jugglemaster was. I think it's a good idea to
keep it that way though.

I haven't done any extensive research, but I do believe keeping things
statically allocated is better for platforms with little memory, such as
Game Boy Advance or other more "obscure" platforms. Using dynamic
allocation for the arrays would also mean reallocation, which would cause
memory fragmentation, something I also think the GBA wouldn't like.

My original intention with jmlib was actually to get JuggleMaster to run on
Game Boy Color, but I eventually had to give that up... I gave up when I
realized that the main juggling routine was to big to fit into one code
segment...

-Per





More information about the Jugglemaster mailing list