3 ms·
I'll give you more detail of one way to use that trick then. The single-bit missile and ball objects are turned on or off by writing to their activation regist
by T-hawk 6y ago
I'll give you more detail of one way to use that trick then. The single-bit missile and ball objects are turned on or off by writing to their activation register, controlled by bit 1 of that register. Why bit 1, why not 0 or 7? Because that lines up with the zero flag in the 6502's flags register.
What you do is set the stack pointer to that video register, compare on the object's Y-coordinate, then push the flags register to turn the object on or off! So the code needs no shifts or conditions or branches. It's even cycle invariant which is a great property on this machine.
The video hardware was deliberately designed to do this (by chip legend Jay Miner), and Combat's code does. Also, the registers for the two missiles and the ball are adjacent, so you can do this trick to all of them in succession without resetting the stack pointer.
- EvanAnderson 6y agoThanks for sharing that. That's a neat piece of trivia. I'm already very impressed by Jay Miner's work, and this just adds to that. It makes sense that the TIA would be designed hand-in-glove for the 6507. BTW - I saw in your other comments that you wrote INV+. This counts as my little brush with "celebrity" for the day. >smile<