hudRenderEyespySideRect

This commit is contained in:
Ryan Dwyer
2020-12-15 17:13:09 +10:00
parent 4036f77504
commit 910cadde62
28 changed files with 272 additions and 259 deletions
-9
View File
@@ -3163,15 +3163,6 @@ typedef union {
_SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8)); \
}
#define gDPSetPrimColorViaWord(pkt, m, l, rgba) \
{ \
Gfx *_g = (Gfx *)(pkt); \
\
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \
_SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
_g->words.w1 = (rgba); \
}
#define gsDPSetPrimColor(m, l, r, g, b, a) \
{{ \
(_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | \
+1 -1
View File
@@ -15,7 +15,7 @@ Gfx *func0f14298c(Gfx *gdl, u32 arg1, u32 arg2);
Gfx *func0f142bf0(Gfx *gdl, u32 colour, s32 alpha, f32 arg3, f32 arg4);
u32 func0f142d74(void);
Gfx *hudRenderEyespyView(Gfx *gdl, s32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5);
Gfx *hudRenderEyespySideBar(Gfx *gdl, s32 *points, u8 r, u8 g, u8 b, u8 alpha);
Gfx *hudRenderEyespySideRect(Gfx *gdl, s32 *points, u8 r, u8 g, u8 b, u8 alpha);
Gfx *hudRenderEyespyUi(Gfx *gdl);
Gfx *func0f1472fc(Gfx *gdl);
Gfx *func0f147578(Gfx *gdl);
+2 -2
View File
@@ -20,10 +20,10 @@ void func0f1672f0(u8 arg0);
void func0f167330(void);
void func0f167350(void);
Gfx *func0f16793c(void);
u32 func0f167964(void);
struct gfxvtx *gfxAllocateVertices(s32 count);
u32 func0f167998(void);
u32 func0f1679b0(void);
u32 func0f1679cc(void);
u32 *gfxAllocateColours(s32 count);
struct model0c *func0f1679f4(s32 arg0);
void func0f167a18(void);
+107
View File
@@ -0,0 +1,107 @@
#ifndef _IN_GBIEX_H
#define _IN_GBIEX_H
#include <ultra64.h>
#include "types.h"
/**
* 04 rsp_uc05_vertex
*
* upper word
* 00F00000 number of points
* 000FFFFF number of bytes to grab
*
* lower word
* 0f000000 segment
* 00ffffff offset in point table
*/
#define gDPSetVerticeArray(pkt, ptr, numvertices) \
{ \
Gfx *_g = (Gfx *)(pkt); \
\
_g->words.w0 = (_SHIFTL(0x04, 24, 8) \
| _SHIFTL(numvertices - 1, 20, 4) \
| _SHIFTL(numvertices * sizeof(struct gfxvtx), 0, 20)); \
_g->words.w1 = (unsigned int)(ptr); \
}
/**
* 07 rsp_color
* This PD-specific command declares offset to RGBA data
*
* upper word
* 00FF0000 number of bytes to grab, -4
* 0000FFFF number of bytes to grab
*
* lower word
* 0f000000 segment
* 00ffffff address or offset in file
*/
#define gDPSetColorArray(pkt, ptr, numcolors) \
{ \
Gfx *_g = (Gfx *)(pkt); \
\
_g->words.w0 = (_SHIFTL(0x07, 24, 8) \
| _SHIFTL((numcolors - 1) * 4, 16, 8) \
| _SHIFTL(numcolors * 4, 0, 16)); \
_g->words.w1 = (unsigned int)(ptr); \
}
/**
* B1 rsp_tri4
* Draws up to four triangles at a time.
* Expects values from 0-F, corresponding with # points declared by vertex command.
* Triangles with all points set to 0 are not drawn.
*
* upper word
* 0000F000 z4
* 00000F00 z3
* 000000F0 z2
* 0000000F z1
*
* lower word
* f0000000 y4
* 0f000000 x4
* 00f00000 y3
* 000f0000 x3
* 0000f000 y2
* 00000f00 x2
* 000000f0 y1
* 0000000f x1
*/
#define gDPTri4(pkt, x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) \
{ \
Gfx *_g = (Gfx *)(pkt); \
\
_g->words.w0 = (_SHIFTL(0xb1, 24, 8) \
| _SHIFTL(z4, 12, 4) \
| _SHIFTL(z3, 8, 4) \
| _SHIFTL(z2, 4, 4) \
| _SHIFTL(z1, 0, 4)); \
_g->words.w1 = (_SHIFTL(y4, 28, 4) \
| _SHIFTL(x4, 24, 4) \
| _SHIFTL(y3, 20, 4) \
| _SHIFTL(x3, 16, 4) \
| _SHIFTL(y2, 12, 4) \
| _SHIFTL(x2, 8, 4) \
| _SHIFTL(y1, 4, 4) \
| _SHIFTL(x1, 0, 4)); \
}
#define gDPTri2(pkt, x1, y1, z1, x2, y2, z2) \
gDPTri4(pkt, x1, y1, z1, x2, y2, z2, 0, 0, 0, 0, 0, 0)
/**
* Like gDPSetPrimColor, but is useful when the input colour is already in
* RGBA format. It avoids unnecessary bitshifting and masking.
*/
#define gDPSetPrimColorViaWord(pkt, m, l, rgba) \
{ \
Gfx *_g = (Gfx *)(pkt); \
\
_g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) \
| _SHIFTL(m, 8, 8) \
| _SHIFTL(l, 0, 8)); \
_g->words.w1 = (rgba); \
}
#endif
+11
View File
@@ -2,6 +2,7 @@
#define _IN_TYPES_H
#include <ultra64.h>
#include "constants.h"
#include "gbiex.h"
#define bool s32
#define ubool u32
@@ -6646,4 +6647,14 @@ struct textureconfig {
u8 t;
};
struct gfxvtx {
/*0x00*/ s16 x;
/*0x02*/ s16 y;
/*0x04*/ s16 z;
/*0x06*/ u8 flags;
/*0x07*/ u8 s;
/*0x08*/ u8 t;
/*0x0a*/ u16 unk0a;
};
#endif