framebuffer.c
759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
framebuffer.c
Copyright (C) 1999, NINTENDO Co,Ltd., MONEGI CORPORATION.
Jan. 28, 1999.
*/
#include <ultra64.h>
#include "FrameBuffer.h"
extern Gfx clearcfb_dl[];
static OSMesgQueue retraceMessageQ;
static OSMesg retraceMessageBuf;
void init_framebuffer( void )
{
osCreateMesgQueue( &retraceMessageQ, &retraceMessageBuf, 1 );
osViSetEvent( &retraceMessageQ, NULL, 1 );
}
Gfx *clear_cfb( Gfx *glistp )
{
gSPDisplayList(glistp++, clearcfb_dl);
return glistp;
}
void swap_framebuffer( int draw_buffer )
{
osViSwapBuffer( cfb[ draw_buffer ] );
if ( MQ_IS_FULL(&retraceMessageQ) )
(void)osRecvMesg( &retraceMessageQ, NULL, OS_MESG_BLOCK );
(void)osRecvMesg( &retraceMessageQ, NULL, OS_MESG_BLOCK );
}