| 167 | } |
| 168 | |
| 169 | static void ConvertRGBA16(const TileDestInfo & dsti, const TextureInfo & ti) |
| 170 | { |
| 171 | u32 width {dsti.Width}; |
| 172 | u32 height {dsti.Height}; |
| 173 | |
| 174 | u32 * dst {static_cast<u32*>(dsti.Data)}; |
| 175 | u32 dst_row_stride {dsti.Pitch / sizeof(u32)}; |
| 176 | u32 dst_row_offset {}; |
| 177 | |
| 178 | const u16 * src {(u16*)gTMEM}; |
| 179 | u32 src_row_stride {ti.GetLine()<<2}; |
| 180 | u32 src_row_offset {ti.GetTmemAddress()<<2}; |
| 181 | |
| 182 | u32 row_swizzle {}; |
| 183 | for (u32 y {}; y < height; ++y) |
| 184 | { |
| 185 | u32 src_offset {src_row_offset}; |
| 186 | u32 dst_offset {dst_row_offset}; |
| 187 | for (u32 x {}; x < width; ++x) |
| 188 | { |
| 189 | u16 src_pixel {BSWAP16( src[src_offset^row_swizzle] )}; |
| 190 | |
| 191 | dst[dst_offset+0] = RGBA16(src_pixel); |
| 192 | |
| 193 | src_offset += 1; |
| 194 | dst_offset += 1; |
| 195 | } |
| 196 | src_row_offset += src_row_stride; |
| 197 | dst_row_offset += dst_row_stride; |
| 198 | |
| 199 | row_swizzle ^= 0x2; // Alternate lines are word-swapped |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | template <u32 (*PalConvertFn)(u16)> |
| 204 | static void ConvertCI8T(const TileDestInfo & dsti, const TextureInfo & ti) |
nothing calls this directly
no test coverage detected