Tuesday, July 10, 2012

How much memory do you need for object slots?

As I've said before using direct page as an object slot pointer is a good idea.  If you want your game to be very flexible, it is best to have as many objects as possible and as much memory devoted to objects as possible.

A small quirk that I only recently discovered with the 65816, is that the direct page is always in the $00 bank.  That means only 8kB of memory devoted to object slots.  A full direct page is 256 bytes.  If we were to use full 256 byte direct pages as slots, we'll only be able to have 32 objects slots.  If we have 128 object slots, then we're limited to 64 byte slots.

To have a trade off, I beleive it is best to have 64 objects slots of 128 bytes.  Well, actually more like 60, so you have room for the stack and universal registers.

1 comment:

  1. I'm curious if you would be intersted in helping me with a project. My name is jon and you can find the info here: http://www.nintendoage.com/forum/messageview.cfm?catid=22&threadid=87180

    Thank you.

    ReplyDelete