Make C example more C, less asm

This commit is contained in:
alpine9000
2016-03-16 20:57:12 +11:00
parent 9e2888bc84
commit a56195292b
+9 -2
View File
@@ -1,3 +1,8 @@
typedef union {
unsigned char* ptr;
unsigned short word[2];
} word_extract_t;
void
PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes)
{
@@ -5,8 +10,10 @@ PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned
copper += offset;
for (i = 0; i < numBitplanes; i++) {
*(copper+1) = (unsigned)bitplanes;
*(copper+3) = ((unsigned)bitplanes >> 16);
word_extract_t extract;
extract.ptr = bitplanes;
*(copper+1) = extract.word[1];
*(copper+3) = extract.word[0];
bitplanes += screenWidthBytes;
copper += 4;
}