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

Method SwitchToLcdDisplay

Source/SysPSP/Graphics/GraphicsContext.cpp:899–942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

897}
898
899void IGraphicsContext::SwitchToLcdDisplay()
900{
901 if (PSP_TV_CABLE <= 0)
902 return;
903
904 sceGuInit();
905
906 BUF_WIDTH = 512;
907 SCR_WIDTH = 480;
908 SCR_HEIGHT = 272;
909 PSP_TV_LACED = 0;
910
911 if (HAVE_DVE)
912 pspDveMgrSetVideoOut(0, 0, 480, 272, 1, 15, 0); // make sure LCD active
913 sceDisplaySetMode(0, 480, 272);
914
915 sceGuStart(GU_DIRECT,ilist);
916 sceGuDrawBuffer(SCR_MODE,save_draw_rel,BUF_WIDTH);
917 sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,save_disp_rel,BUF_WIDTH);
918 sceGuDepthBuffer(save_depth_rel,BUF_WIDTH);
919 sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
920 sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
921 sceGuDepthRange(65535,0);
922 sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
923 sceGuEnable(GU_SCISSOR_TEST);
924 sceGuDepthFunc(GU_GEQUAL);
925 sceGuEnable(GU_DEPTH_TEST);
926 sceGuFrontFace(GU_CW);
927 sceGuShadeModel(GU_SMOOTH);
928 sceGuEnable(GU_CULL_FACE);
929 sceGuEnable(GU_TEXTURE_2D);
930 sceGuEnable(GU_CLIP_PLANES);
931 sceGuFinish();
932 sceGuSync(0,0);
933
934 sceDisplayWaitVblankStart();
935 sceGuDisplay(GU_TRUE);
936
937 void * frame_buffer = reinterpret_cast< void * >((reinterpret_cast< u32 >(save_disp_rel) + reinterpret_cast< u32 >( sceGeEdramGetAddr() )));
938 frame_buffer = MAKE_UNCACHED_PTR(frame_buffer);
939 sceDisplaySetFrameBuf(frame_buffer, BUF_WIDTH, SCR_MODE, PSP_DISPLAY_SETBUF_NEXTFRAME);
940
941 sceGuStart(GU_CALL,list[listNum]);
942}

Callers 2

HandleEndOfFrameFunction · 0.80
DisplayRomsAndChooseFunction · 0.80

Calls 1

pspDveMgrSetVideoOutFunction · 0.85

Tested by

no test coverage detected