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

Function LoadFrameBuffer

Source/HLEGraphics/uCodesold/Ucode_FB.h:24–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23#ifndef DAEDALUS_PSP
24static inline CRefPtr<CNativeTexture> LoadFrameBuffer(u32 origin)
25{
26 u32 width = Memory_VI_GetRegister( VI_WIDTH_REG );
27 if( width == 0 )
28 {
29 //DAEDALUS_ERROR("Loading 0 size frame buffer?");
30 return NULL;
31 }
32
33 if( origin <= width*2 )
34 {
35 //DAEDALUS_ERROR("Loading small frame buffer not supported");
36 return NULL;
37 }
38 //ToDO: We should use uViWidth+1 and uViHeight+1
39#define FB_WIDTH 320
40#define FB_HEIGHT 240
41
42 DAEDALUS_ASSERT(g_CI.Size == G_IM_SIZ_16b,"32b frame buffer is not supported");
43 //DAEDALUS_ASSERT((uViWidth+1) == FB_WIDTH,"Variable width is not handled");
44 //DAEDALUS_ASSERT((uViHeight+1) == FB_HEIGHT,"Variable height is not handled");
45
46 TextureInfo ti;
47
48 ti.SetSwapped (0);
49 ti.SetPalette (0);
50 ti.SetTlutAddress (TLUT_BASE);
51 ti.SetTLutFormat (kTT_RGBA16);
52 ti.SetFormat (0);
53 ti.SetSize (2);
54
55 ti.SetLoadAddress (origin - width*2);
56 ti.SetWidth (FB_WIDTH);
57 ti.SetHeight (FB_HEIGHT);
58 ti.SetPitch (width << 2 >> 1);
59
60 return gRenderer->LoadTextureDirectly(ti);
61}
62
63//Borrowed from StrmnNrmn's N64js
64static inline void DrawFrameBuffer(u32 origin, const CNativeTexture * texture)

Callers 1

RenderFrameBufferFunction · 0.70

Calls 11

SetSwappedMethod · 0.80
SetPaletteMethod · 0.80
SetTlutAddressMethod · 0.80
SetTLutFormatMethod · 0.80
SetFormatMethod · 0.80
SetSizeMethod · 0.80
SetLoadAddressMethod · 0.80
SetWidthMethod · 0.80
SetHeightMethod · 0.80
SetPitchMethod · 0.80
LoadTextureDirectlyMethod · 0.80

Tested by

no test coverage detected