| 663 | } |
| 664 | |
| 665 | void 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 | |
| 685 | void Gpu::writeDepbufLoc(uint32_t mask, uint32_t value) { |
| 686 | // Write to the depth buffer location and send its address to the renderer |