123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|425|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> 2x4bit numbers into 1x8bit?

Sun, 16 Dec 2007, 14:35
spinal
This has been bugging me a little, so ill ask here while I'm off searching the Internet.

I have two 4 bit numbers and I would like to turn them into 1 8bit number for the purposes of saving a 16colour bitmap to an array.

but I cant for the life of me remember how to do it.

just came to me, num1*16+num2

I'll leave this here to show how stupid I am.

-=-=-
Check out my excellent homepage!
Sun, 16 Dec 2007, 14:50
Jayenkai
Blitz

c=(a shl 4)+b
a=(c AND $F0) shr 4
b=(c AND $0F)

Alternatively, in C..

c=(a<<4)+b;
a=(c & 0xF0) >> 4;
b=(c & 0x0F);

(I think!)

LOL! I didn't read the solution till after I posted..
I'll leave this here to show how stupid I am!

-=-=-
''Load, Next List!''