Skip to content

Commit a8d6a6e

Browse files
committed
Add GX_Fast{Begin,CallDispList}
1 parent d1d799d commit a8d6a6e

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

include/ogc/gx.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,7 @@ u32 GX_EndDispList(void);
20892089
*
20902090
* \param[in] primitve \ref primtype to draw
20912091
* \param[in] vtxfmt \ref vtxfmt to use
2092-
* \param[in] vtxcnt number of vertices being drawn; maximum is 65536
2092+
* \param[in] vtxcnt number of vertices being drawn; maximum is 65535
20932093
*/
20942094
void GX_Begin(u8 primitve,u8 vtxfmt,u16 vtxcnt);
20952095

@@ -2148,6 +2148,13 @@ void GX_BeginDispList(void *list,u32 size);
21482148
*/
21492149
void GX_CallDispList(const void *list,u32 nbytes);
21502150

2151+
static inline void GX_FastCallDispList(const void *list,u32 nbytes)
2152+
{
2153+
wgPipe->U8 = 0x40;
2154+
wgPipe->U32 = (u32)list;
2155+
wgPipe->U32 = nbytes;
2156+
}
2157+
21512158
/*!
21522159
* \fn static inline void GX_End(void)
21532160
* \brief Used to end the drawing of a graphics primitive. This does nothing in libogc.
@@ -2158,6 +2165,12 @@ static inline void GX_End(void)
21582165
{
21592166
}
21602167

2168+
static inline void GX_FastBegin(u8 primitve,u8 vtxfmt,u16 vtxcnt)
2169+
{
2170+
wgPipe->U8 = (primitve&~7)|(vtxfmt&7);
2171+
wgPipe->U16 = vtxcnt;
2172+
}
2173+
21612174
static inline void GX_Position3f32(f32 x,f32 y,f32 z)
21622175
{
21632176
wgPipe->F32 = x;

libogc/gx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2593,7 +2593,7 @@ void GX_SetVtxAttrFmtv(u8 vtxfmt,const GXVtxAttrFmt *attr_list)
25932593

25942594
void GX_Begin(u8 primitve,u8 vtxfmt,u16 vtxcnt)
25952595
{
2596-
u8 reg = primitve|(vtxfmt&7);
2596+
u8 reg = (primitve&~7)|(vtxfmt&7);
25972597

25982598
if(__gx->dirtyState)
25992599
__GX_SetDirtyState();

0 commit comments

Comments
 (0)