MEMORY CALCULATIONS AND PLANNING

In my quest to squeeze as much of the arcade Double Dragon into the Amiga 500 + 512kb slow ram, I am now carefully planning how much memory each little bit is taking up. To reiterate we have 512kb of chipram to load everythng we need at any one time (Slow ram is only useful for swapping things in and out without having to do any disk loading). So here is some info I have gathered along with help from Earok and EAB members:

Overheads

  • Kickstart 1.3 takes up 40kb

  • The Display (5 bitplanes x2 buffers) = 115,200kb

So before we even start to load any graphics that is 145,200kb of our 512kb chip ram used up.

I have also worked out the following from looking at the buld.log output from Scorpion and then adding a new tile and a new frame:

  • 1 x 16x16 pixel tile is 160 bytes

  • 1 x frame of animation for Player or enemy avg is 2.48kb

    • Bolo’s frames approx 3kb as he is bigger

    • Also 1 frame of Bolo punching is approx 4kb as it is wider

  • 1 x 16x256 pixel panel image is 8kb

So we can start to plan how we use up the memory and also prioritise the things that are most important. For example I now know that the cat on the bin took up nearly 1kb as it was 6 tiles big. But let’s add up what I currently have:

  • Kickstart = 40kb

  • Display = 115.2kb

  • Map tiles x297 = 47kb

  • Top and bottom panels = 16kb

  • Billy frames x25 approx = 62kb

  • Roper frames x13 approx = 32kb

  • Bolo frames x13 approx = 41kb

  • Music 12kb

  • Sfx 30kb

In addition the following is loaded into slow ram:

  • Code 8kb

  • Metadata 40kb

So the current total being loaded into chip ram is 395kb, which you would think leaves enough room for at least another enemy? Not so..

Something I was not considering was that all the animation frames get X flipped and those versions are saved into chip ram separately!

In fact Billy’s frames total 124kb, Roper 64kb and Bolo 82kb. This explains why I’m running out of memory.

The actual total I am unsuccessfully loading in is 530kb - so we will need to do some more thinking about how we display the player and enemies without affecting performance but reducing the memory.