u8 | (u8 << 8) will work better, assuming C operator precedence.
-----Original Message-----
From: Dale Freya [mailto:dfreya@...]
Sent: Sunday, September 30, 2001 9:27 PM
To: gbadev@yahoogroups.com
Subject: RE: [gbadev] Stupid Mode 4
U16 = u8 | u8 << 8
Component 2 is shifted left 8 bits into the high part of the word.
- Dale
-----Original Message-----
From: Mr SDFG ASDG [mailto:cupcakus2000@...]
Sent: Sunday, 30 September 2001 12:50 AM
To: gbadev@yahoogroups.com
Subject: Re: [gbadev] Stupid Mode 4
I figured it out with:
u16=u8*256+u8
There is probably a better way, like an operator that can do it, but for
the mean time the formula above works great.
Mr SDFG ASDG <cupcakus2000@...> wrote: I have a 256 color bitmap
which I have processed into a u16 pallet array, and a u8 data array with
indexes to the pallet information.
The problem of course is that video memory only accepts writes in
16bits, so one would simply say:
"Write two pixels at once..." I would love to! How do I combine the two
8 bit blocks of data into one 16bit block?