MCPcopy Create free account
hub / github.com/Hydr8gon/3Beans / writeColbufFmt

Method writeColbufFmt

src/core/gpu/gpu_cmd.cpp:665–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665void Gpu::writeColbufFmt(uint32_t mask, uint32_t value) {
666 // Write to the color buffer format register
667 mask &= 0x70003;
668 gpuColbufFmt = (gpuColbufFmt & ~mask) | (value & mask);
669
670 // Set the format for the renderer if it's valid
671 switch (gpuColbufFmt) {
672 case 0x00002: return gpuRender->setColbufFmt(COL_RGBA8);
673 case 0x10001: return gpuRender->setColbufFmt(COL_RGB8);
674 case 0x20000: return gpuRender->setColbufFmt(COL_RGB5A1);
675 case 0x30000: return gpuRender->setColbufFmt(COL_RGB565);
676 case 0x40000: return gpuRender->setColbufFmt(COL_RGBA4);
677
678 default:
679 // Catch unknown color buffer formats
680 LOG_CRIT("Setting unknown GPU color buffer format: 0x%X\n", gpuColbufFmt);
681 return gpuRender->setColbufFmt(COL_UNK);
682 }
683}
684
685void Gpu::writeDepbufLoc(uint32_t mask, uint32_t value) {
686 // Write to the depth buffer location and send its address to the renderer

Callers 1

ioWriteMethod · 0.80

Calls 1

setColbufFmtMethod · 0.45

Tested by

no test coverage detected