MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / ConvertI8

Function ConvertI8

Source/HLEGraphics/ConvertTile.cpp:473–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473static 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
510static void ConvertI4(const TileDestInfo & dsti, const TextureInfo & ti)
511{

Callers

nothing calls this directly

Calls 2

GetLineMethod · 0.80
GetTmemAddressMethod · 0.80

Tested by

no test coverage detected