| 471 | } |
| 472 | |
| 473 | static void ConvertI8(const TileDestInfo & dsti, const TextureInfo & ti) |
| 474 | { |
| 475 | u32 width {dsti.Width}; |
| 476 | u32 height {dsti.Height}; |
| 477 | |
| 478 | u8 * dst {static_cast<u8*>(dsti.Data)}; |
| 479 | u32 dst_row_stride {dsti.Pitch}; |
| 480 | u32 dst_row_offset {}; |
| 481 | |
| 482 | const u8 * src {gTMEM}; |
| 483 | u32 src_row_stride {ti.GetLine()<<3}; |
| 484 | u32 src_row_offset {ti.GetTmemAddress()<<3}; |
| 485 | |
| 486 | u32 row_swizzle = {}; |
| 487 | for (u32 y {}; y < height; ++y) |
| 488 | { |
| 489 | u32 src_offset {src_row_offset}; |
| 490 | u32 dst_offset {dst_row_offset}; |
| 491 | for (u32 x {}; x < width; ++x) |
| 492 | { |
| 493 | u8 i = src[src_offset^row_swizzle]; |
| 494 | |
| 495 | dst[dst_offset+0] = i; |
| 496 | dst[dst_offset+1] = i; |
| 497 | dst[dst_offset+2] = i; |
| 498 | dst[dst_offset+3] = i; |
| 499 | |
| 500 | src_offset += 1; |
| 501 | dst_offset += 4; |
| 502 | } |
| 503 | src_row_offset += src_row_stride; |
| 504 | dst_row_offset += dst_row_stride; |
| 505 | |
| 506 | row_swizzle ^= 0x4; // Alternate lines are word-swapped |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | static void ConvertI4(const TileDestInfo & dsti, const TextureInfo & ti) |
| 511 | { |
nothing calls this directly
no test coverage detected