I'm now in the process of planning out the Frenzy variation, which has special rooms* every so often. To show the special objects I'm planning to use a 2x or 4x player (I've already reviewed the kernel and while I don't have time to resize of Player 0, I do have time for Player 1).
Due to the flicker routines, I have to use software driven collision detection as 2 colliding objects might never be drawn on the same video frame. As such, I'll need to double up a 2x player's bit pattern so that the bits 76543210 become 7766554433221100. For example, if 1 line of the sprite looks like this:
_X__X_X_
I need to make it look like this:
__XX____XX__XX__
I can do this using a loop and shifting bits, but thought somebody might know a way to do it better.
int DoubleBits(unsigned char bits)
{
int i;
int mask;
int result;
mask = 0x80;
result = 0;
for(i=0;i<8;i++)
{
result = (result << 2) + ((bits & mask) ? 3 : 0);
mask >>= 1;
}
return result;
}
To make that a QuadBits function I'd just change 1 line:
result = (result << 4) + ((bits & mask) ? 15 : 0);
* This video shows 3 of them, though it's stretched widescreen for some reason:3:15 Big Otto
5:17 Power Plant
8:01 Central Computer
It's missing the Robot Factory. This video shows the ColecoVision version of Frenzy:
1:18 Big Otto
2:00 Power Plant
3:18 Central Computer
4:01 Robot Factory













