Usually, when I load a level/room, I either...
1.load the room # to x or y, and index to an array of that item...1 byte per room, per array.
Or,
2.load the address of the start the room's data to a pointer, and indirect index (y) to the data.
But, I was going to...let's say, double the maximum possible enemies per room, but only use the extra enemies rarely... Like 10% or less. I feel like this is a huge waste of ROM space, to have an array of 90% zeroes.
What would be a better approach?
If each enemy uses 16 bytes of data (ROM), per 100 rooms, that could be 1500 wasted bytes of ROM space.
1.load the room # to x or y, and index to an array of that item...1 byte per room, per array.
Or,
2.load the address of the start the room's data to a pointer, and indirect index (y) to the data.
But, I was going to...let's say, double the maximum possible enemies per room, but only use the extra enemies rarely... Like 10% or less. I feel like this is a huge waste of ROM space, to have an array of 90% zeroes.
What would be a better approach?
If each enemy uses 16 bytes of data (ROM), per 100 rooms, that could be 1500 wasted bytes of ROM space.