mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-10-07 03:57:37 -04:00
1551d59fbc
* GS stubs (ps2_stubs_gs.inl): - Replace direct VRAM writes with GIF packet path - sceGsExecLoadImage: build GIF packet, set MADR/QWC/CHCR - sceGsExecStoreImage: GIF packet, processPendingTransfers, consumeLocalToHostBytes - sceGsPutDispEnv/sceGsPutDrawEnv: program GIF DMA Path3 (5/9 QWs) - sceGsResetGraph: GIF packet + writeIORegister for pmode/smode2/dispfb/display/bgcolor - sceGsSetDefDrawEnv: GIF packet layout, sceGszbufaddr for zbuf - sceGsSyncPath: processPendingTransfers, poll DMA channels - sceGsSyncV/sceGsSyncVCallback: return 0 - sceGszbufaddr: zbuf calculation (width/height blocks, gparam) Helpers (ps2_stubs_helpers.inl): - GsDispEnvMem: 5 fields (pmode, smode2, dispfb, display, bgcolor) for GIF layout - writeGsDispEnv: read-modify-write pattern - toDmaPhys: SPR (scratchpad) handling for DMA MADR bit 31 - submitDmaSend: chain mode (chcr=0x185) for sceDmaSend/sceDmaSendI/sceDmaSendM Misc stubs (ps2_stubs_misc.inl): - Add sceeFontInit, sceeFontLoadFont, sceeFontPrintfAt, sceeFontPrintfAt2 - Add sceeFontClose, sceeFontSetColour, sceeFontSetMode, sceeFontSetFont, sceeFontSetScale - Font stubs use GIF packets for CLUT and texture upload Call list (ps2_call_list.h): - Add sceeFont* entries between sceGszbufaddr and sceIoctl * added: added more scee font stubs in stubs misc fix: fixed flickering error when rendering in memory.cpp * fix: fixed linux build error
25 lines
685 B
C++
25 lines
685 B
C++
#ifndef PS2_GS_RASTERIZER_H
|
|
#define PS2_GS_RASTERIZER_H
|
|
|
|
#include <cstdint>
|
|
|
|
class GS;
|
|
|
|
class GSRasterizer
|
|
{
|
|
public:
|
|
void drawPrimitive(GS *gs);
|
|
void writePixel(GS *gs, int x, int y, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
|
uint32_t sampleTexture(GS *gs, float s, float t, uint16_t u, uint16_t v);
|
|
uint32_t readTexelPSMCT32(GS *gs, uint32_t tbp0, uint32_t tbw, int texU, int texV);
|
|
uint32_t readTexelPSMT4(GS *gs, uint32_t tbp0, uint32_t tbw, int texU, int texV);
|
|
uint32_t lookupCLUT(GS *gs, uint8_t index, uint32_t cbp, uint8_t cpsm, uint8_t csa);
|
|
|
|
private:
|
|
void drawSprite(GS *gs);
|
|
void drawTriangle(GS *gs);
|
|
void drawLine(GS *gs);
|
|
};
|
|
|
|
#endif
|