-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrender.h
61 lines (48 loc) · 1.35 KB
/
render.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _RENDER_H
#define _RENDER_H
#include <ultra64.h>
#include "boot.h"
/*
* Message queues
*/
extern OSMesgQueue
rdpMessageQ,
retraceMessageQ;
/*
* global variables
*/
extern int rdp_flag;
/*
* frame buffer symbols
*/
extern u16* cfb; /* RAM address */
/*
* buffers for RSP tasks:
* buffers used by fifo microcode only
*/
extern u64 dram_stack[SP_DRAM_STACK_SIZE64]; /* used for matrix stack */
extern u64 rdp_output[RDP_OUTPUT_LEN]; /* buffer for RDP DL */
extern int fontcol[4]; /* color for shadowed fonts */
#define PACK16BIT(r, g, b) ((u16)(r) << 8 & 0xF800 | (u16)(g) << 3 & 0x07C0 | (u16)(b) >> 2 & 0x003E | 0x01)
#define COL24TO16(rgb24) ((rgb24) >> 8 & 0xF800 | (rgb24) >> 5 & 0x07C0 | (rgb24) >> 2 & 0x003E | 0x01)
#define GET_R(rgb16) ((rgb16) >> 8 & 0xF8)
#define GET_G(rgb16) ((rgb16) >> 3 & 0xF8)
#define GET_B(rgb16) ((rgb16) << 2 & 0xF8)
#define GLIST_LEN 64
#define BUFFER_COUNT 2
/*
* Layout of dynamic data.
*
* This structure holds the things which change per frame. It is advantageous
* to keep dynamic data together so that we may selectively write back dirty
* data cache lines to DRAM prior to processing by the RCP.
*
*/
typedef struct {
Gfx glist[GLIST_LEN];
} Dynamic;
extern Dynamic dynamic;
void renderFrame(int clear);
u16* getColorBuffer();
void* initColorBuffers(void* memoryEnd);
#endif