00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <math.h>
00022 #include <malloc.h>
00023
00024 #include <sps2lib.h>
00025 #include <sps2tags.h>
00026 #include <sps2util.h>
00027 #include <sps2regstructs.h>
00028
00029 #include <geommath/geommath.h>
00030 #include <intmd/intmdloader.h>
00031 #include <samples/common/p2lassert.h>
00032
00033 #include "render_buffer.h"
00034 #include "render_dma.h"
00035 #include "render_load.h"
00036 #include "render_matrix.h"
00037 #include "render_vif.h"
00038 #include "render_util.h"
00039
00040
00041 #define BLOCK_SIZE 4096 // SPS2 provides 4K blocks
00042 #define DATABUFFER_SIZE (8192 * 1024) // global data buffer
00043 #define CHAINBUFFER_SIZE 4096 // 4K global chain buffers
00044
00045 #define VERTS_PER_PACKET 84
00046
00047
00048
00049 typedef struct {
00050 void *baseaddr;
00051 void *nextfreeaddr;
00052 sps2Memory_t *sps2info;
00053
00054 } bufferinfo;
00055
00056
00057 typedef union
00058 {
00059 sps2uint128 i128;
00060 sps2uint64 i64[2];
00061 sps2uint32 i32[4];
00062
00063 } qw_t;
00064
00065
00066 #define Render_SetBGColour(x) DPUT_GS_BGCOLOR(x)
00067
00071
00075
00079
00083
00088
00092
00096
00099