Double Sprites
So, I wanted to have up to two other things on the screen at once; one on the top floor of the screen, and one on the bottom.
I figured, hey, I’m never displaying these on the same line, so what’s the harm?
Well, because they’ll have their own X position, it turns out that I need to do my H positioning again.1
I anticipated this, which is half of why I put a wide floor between the two halves, so I could re-calculate the positions in between the top and bottom. Because I can’t update and render my Player sprite during this, I’ve put the Playfield in front of the characters, so that it doesn’t look weird when he disappears.
I don’t get to render the ladders all the way up now — the big gap between the rungs is where the H-positioning is happening — though I’m not super fussed about that. I’ll just call it an “artistic choice”.
But, uh oh:
Flashing the HMOVE seems to take a chunk of clock cycles which makes the Horizontal Blanking bleed into the screen. I spent several hours trying to find a solution, till I decided that the solution was that the floor would go black for a bit.
That looks better, and my kernel is stable again. I’ll come back and play around with the graphics a bit later, to make the rest of the screen look consistent. But for now, I’m happy.
I’m sure there are better ways to do this — I know there are strategies to handle multisprites; Bezerk doesn’t seem to have massive black bars between every robot; but this works well enough.
I’m becomming painfully aware of my RAM budget, and this chewed up a bit. I’ve still got plenty, but I may have to refactor some of this later and shuffle things around.
With the Atari 2600, to set the horizontal position, you have to flash the Horizontal Position registers (HMP0, HMP1, etc) while the TV electron beam is in the same position as the object. This means you can’t really do anythingn else while you’re setting H-positions. ↩︎