dumb optimization trick
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
-
- Posts: 3182
- Joined: Wed May 19, 2010 6:12 pm
dumb optimization trick
I was looking at ways to save memory for object slots and I got it down to 84 bytes. What I found special about this number is that it's slightly less than 256/3. If I page align every 3rd object slot, direct page instruction will be 1 cycle faster for every 3rd object.
Last edited by psycopathicteen on Sat May 12, 2018 9:08 am, edited 2 times in total.
- Drew Sebastino
- Formerly Espozo
- Posts: 3496
- Joined: Mon Sep 15, 2014 4:35 pm
- Location: Richmond, Virginia
Re: dumb optimization trick
I was thinking of the same thing, actually...
Another little trick is that I like to have it to where the end of a loop is when an index register is 0, so I don't need a cmp instruction.

-
- Posts: 3182
- Joined: Wed May 19, 2010 6:12 pm
Re: dumb optimization trick
Now I need to find a way to always have objects spawn into the page-aligned slots first so they have a higher chance of being in a page-aligned slot. Using a linked-list object slot system makes this more difficult.
I could probably take this one step further and have slow slot objects move into fast slots when a free fast slot becomes available.
I could probably take this one step further and have slow slot objects move into fast slots when a free fast slot becomes available.