X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Finclude%2Ffbmpop16.h;h=4b205937ac01b4e96ac09ff56945e9b9193418cc;hb=4fc7c64eac42b571ee64ec693e6da1d5a458344f;hp=2564ccbb5a0279559046e3ee76e6b5691c14f653;hpb=aaa37222bec76a065e74830b363e8c9dfa4709ae;p=virtualjaguar diff --git a/src/include/fbmpop16.h b/src/include/fbmpop16.h index 2564ccb..4b20593 100644 --- a/src/include/fbmpop16.h +++ b/src/include/fbmpop16.h @@ -1,112 +1,144 @@ - if (flags&FLAGS_READMODIFY) + if (flags & FLAGS_READMODIFY) { - if (flags&FLAGS_HFLIP) + if (flags & FLAGS_HFLIP) { while (iwidth) { - if (flags&FLAGS_TRANSPARENT) + uint8 dataHi = jaguar_byte_read(ptr++), dataLo = jaguar_byte_read(ptr++); + + if (flags & FLAGS_TRANSPARENT) { - uint16 data=jaguar_byte_read(ptr++); - data<<=8; - data|=jaguar_byte_read(ptr++); - if (data) +// uint16 data = jaguar_byte_read(ptr++); +// data <<= 8; +// data |= jaguar_byte_read(ptr++); +/* if (data) + { + *current_line_buffer-- = BLEND_Y(*current_line_buffer, data >> 8); + *current_line_buffer-- = BLEND_CC(*current_line_buffer, data & 0xFF); + }*/ + if (dataHi | dataLo) { - *current_line_buffer--=BLEND_Y(*current_line_buffer,(data>>8)); - *current_line_buffer--=BLEND_CC(*current_line_buffer,(data&0xff)); + *current_line_buffer-- = BLEND_Y(*current_line_buffer, dataHi); + *current_line_buffer-- = BLEND_CC(*current_line_buffer, dataLo); } else - current_line_buffer-=2; + current_line_buffer -= 2; } - else + else // !FLAGS_TRANSPARENT { - *current_line_buffer--=BLEND_Y(*current_line_buffer,jaguar_byte_read(ptr++)); - *current_line_buffer--=BLEND_CC(*current_line_buffer,jaguar_byte_read(ptr++)); +// *current_line_buffer-- = BLEND_Y(*current_line_buffer, jaguar_byte_read(ptr++)); +// *current_line_buffer-- = BLEND_CC(*current_line_buffer, jaguar_byte_read(ptr++)); + *current_line_buffer-- = BLEND_Y(*current_line_buffer, dataHi); + *current_line_buffer-- = BLEND_CC(*current_line_buffer, dataLo); } iwidth--; } } - else + else // !FLAGS_HFLIP { while (iwidth) { - if (flags&FLAGS_TRANSPARENT) + uint8 dataHi = jaguar_byte_read(ptr++), dataLo = jaguar_byte_read(ptr++); + + if (flags & FLAGS_TRANSPARENT) { - uint16 data=jaguar_byte_read(ptr++); - data<<=8; - data|=jaguar_byte_read(ptr++); +/* uint16 data = jaguar_byte_read(ptr++); + data <<= 8; + data |= jaguar_byte_read(ptr++); if (data) { - *current_line_buffer++=BLEND_Y(*current_line_buffer,(data>>8)); - *current_line_buffer++=BLEND_CC(*current_line_buffer,(data&0xff)); + *current_line_buffer++ = BLEND_Y(*current_line_buffer, data >> 8); + *current_line_buffer++ = BLEND_CC(*current_line_buffer, data & 0xFF); + }*/ + if (dataHi | dataLo) + { + *current_line_buffer++ = BLEND_Y(*current_line_buffer, dataHi); + *current_line_buffer++ = BLEND_CC(*current_line_buffer, dataLo); } else - current_line_buffer+=2; + current_line_buffer += 2; } else { - *current_line_buffer++=BLEND_Y(*current_line_buffer,jaguar_byte_read(ptr++)); - *current_line_buffer++=BLEND_CC(*current_line_buffer,jaguar_byte_read(ptr++)); +// *current_line_buffer++ = BLEND_Y(*current_line_buffer, jaguar_byte_read(ptr++)); +// *current_line_buffer++ = BLEND_CC(*current_line_buffer, jaguar_byte_read(ptr++)); + *current_line_buffer++ = BLEND_Y(*current_line_buffer, dataHi); + *current_line_buffer++ = BLEND_CC(*current_line_buffer, dataLo); } iwidth--; } } } - else + else // !FLAGS_READMODIFY { - if (flags&FLAGS_HFLIP) + if (flags & FLAGS_HFLIP) { while (iwidth) { - if (flags&FLAGS_TRANSPARENT) + uint8 dataHi = jaguar_byte_read(ptr++), dataLo = jaguar_byte_read(ptr++); + + if (flags & FLAGS_TRANSPARENT) { - uint16 data=jaguar_byte_read(ptr++); - data<<=8; - data|=jaguar_byte_read(ptr++); +/* uint16 data = jaguar_byte_read(ptr++); + data <<= 8; + data |= jaguar_byte_read(ptr++); if (data) { - *current_line_buffer--=(data>>8); - *current_line_buffer--=(data&0xff); - } + *current_line_buffer-- = data >> 8; + *current_line_buffer-- = data & 0xFF; + }*/ + if (dataHi | dataLo) + *current_line_buffer-- = dataHi, + *current_line_buffer-- = dataLo; else - current_line_buffer-=2; + current_line_buffer -= 2; } else { - *current_line_buffer--=jaguar_byte_read(ptr++); - *current_line_buffer--=jaguar_byte_read(ptr++); +// *current_line_buffer-- = jaguar_byte_read(ptr++); +// *current_line_buffer-- = jaguar_byte_read(ptr++); + *current_line_buffer-- = dataHi; + *current_line_buffer-- = dataLo; } iwidth--; } } - else + else // !FLAGS_HFLIP { - int count=0; + int count = 0; while (iwidth) { - if (flags&FLAGS_TRANSPARENT) - { - uint16 data=jaguar_byte_read(ptr++); - data<<=8; - data|=jaguar_byte_read(ptr++); + uint8 dataHi = jaguar_byte_read(ptr++), dataLo = jaguar_byte_read(ptr++); + + if (flags & FLAGS_TRANSPARENT) + { +/* uint16 data = jaguar_byte_read(ptr++); + data <<= 8; + data |= jaguar_byte_read(ptr++); if (data) { - *current_line_buffer++=(data>>8); - *current_line_buffer++=(data&0xff); - } + *current_line_buffer++ = data >> 8; + *current_line_buffer++ = data & 0xFF; + }*/ + if (dataHi | dataLo) + *current_line_buffer++ = dataHi, + *current_line_buffer++ = dataLo; else - current_line_buffer+=2; + current_line_buffer += 2; } else { - *current_line_buffer++=jaguar_byte_read(ptr++); - *current_line_buffer++=jaguar_byte_read(ptr++); +// *current_line_buffer++ = jaguar_byte_read(ptr++); +// *current_line_buffer++ = jaguar_byte_read(ptr++); + *current_line_buffer++ = dataHi; + *current_line_buffer++ = dataLo; } - count+=2; - if (count==8) // 8 bytes = a phrase (64 bits) + count += 2; + if (count == 8) // 8 bytes = a phrase (64 bits) { - ptr+=8*(pitch-1); - count=0; + ptr += 8 * (pitch - 1); + count = 0; } iwidth--; }