コード例 #1
0
ファイル: main.c プロジェクト: LITTOMA/HANS
void gspGpuInit()
{
	gspInit();

	GSPGPU_AcquireRight(NULL, 0x0);

	// //set subscreen to red
	// u32 regData=0x010000FF;
	// GSPGPU_WriteHWRegs(NULL, 0x202A04, &regData, 4);

	//setup our gsp shared mem section
	u8 threadID;
	svc_createEvent(&gspEvent, 0x0);
	GSPGPU_RegisterInterruptRelayQueue(NULL, gspEvent, 0x1, &gspSharedMemHandle, &threadID);
	svc_mapMemoryBlock(gspSharedMemHandle, 0x10002000, 0x3, 0x10000000);

	//wait until we can write stuff to it
	svc_waitSynchronization1(gspEvent, 0x55bcb0);

	gxCmdBuf=(u32*)(0x10002000+0x800+threadID*0x200);

	top_framebuffer = &gspHeap[0];
	low_framebuffer = &gspHeap[0x46500];

	GSP_FramebufferInfo topfb = (GSP_FramebufferInfo){0, (u32*)top_framebuffer, (u32*)top_framebuffer, 240 * 3, (1<<8)|(1<<6)|1, 0, 0};
	GSP_FramebufferInfo lowfb = (GSP_FramebufferInfo){0, (u32*)low_framebuffer, (u32*)low_framebuffer, 240 * 3, 1, 0, 0};
	
	GSPGPU_SetBufferSwap(NULL, 0, &topfb);
	GSPGPU_SetBufferSwap(NULL, 1, &lowfb);
}
コード例 #2
0
ファイル: gfx.c プロジェクト: Slashmolder/ctrulib
void gfxSwapBuffers()
{
	currentBuffer[0]^=doubleBuf[0];
	currentBuffer[1]^=doubleBuf[1];
	gfxSetFramebufferInfo(GFX_TOP, currentBuffer[0]);
	gfxSetFramebufferInfo(GFX_BOTTOM, currentBuffer[1]);
	GSPGPU_SetBufferSwap(NULL, GFX_TOP, &topFramebufferInfo);
	GSPGPU_SetBufferSwap(NULL, GFX_BOTTOM, &bottomFramebufferInfo);
}
コード例 #3
0
ファイル: device.cpp プロジェクト: Findus79/testbed
void 
D3DSDevice::SwapBuffers( bool bImmediate )
{
    m_FrameID ^= 1;

    SetFramebufferInfo( D3DS_SCREEN_TOP, m_FrameID );
    SetFramebufferInfo( D3DS_SCREEN_BOTTOM, m_FrameID );

    if (bImmediate)
    {
        GSPGPU_SetBufferSwap( D3DS_SCREEN_TOP, &m_FBInfoTop );
        GSPGPU_SetBufferSwap( D3DS_SCREEN_BOTTOM, &m_FBInfoBottom );
    }
    else
    {
        WriteFramebufferInfo( D3DS_SCREEN_TOP );
        WriteFramebufferInfo( D3DS_SCREEN_BOTTOM );
    }
}