MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / ExpandFontSheet

Function ExpandFontSheet

src/dolphin/src/os/OSFont.c:464–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464static void ExpandFontSheet(u8* source, u8* dest)
465{
466 int i;
467 const u8* tmp = &FontData->c0;
468
469 if (FontData->sheetFormat == GX_TF_I4)
470 {
471 for (i = (s32)FontData->sheetFullSize / 2 - 1; i >= 0; i--)
472 {
473 dest[i * 2 + 0] = tmp[source[i] >> 6 & 3] & 0xF0 | tmp[source[i] >> 4 & 3] & 0x0F;
474 dest[i * 2 + 1] = tmp[source[i] >> 2 & 3] & 0xF0 | tmp[source[i] >> 0 & 3] & 0x0F;
475 }
476 }
477 else if (FontData->sheetFormat == GX_TF_IA4)
478 {
479 for (i = (s32)FontData->sheetFullSize / 4 - 1; i >= 0; i--)
480 {
481 dest[i * 4 + 0] = tmp[source[i] >> 6 & 3];
482 dest[i * 4 + 1] = tmp[source[i] >> 4 & 3];
483 dest[i * 4 + 2] = tmp[source[i] >> 2 & 3];
484 dest[i * 4 + 3] = tmp[source[i] >> 0 & 3];
485 }
486 }
487
488 DCStoreRange(dest, FontData->sheetFullSize);
489}
490
491BOOL OSInitFont(OSFontHeader* font)
492{

Callers 1

OSInitFontFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected