Implement & link m_rcp.c

This commit is contained in:
Cuyler36
2023-06-30 06:43:36 -04:00
parent 70bc96c102
commit c2aba16979
5 changed files with 504 additions and 7 deletions
+13
View File
@@ -476,6 +476,19 @@ do { \
/*_gfx->words.w1 = 0;*/ /* bug? they don't set the second word */ \
}}
#define gDPSetTileSize_Dolphin(pkt, tile, s, t, width, height) \
do { \
Gfx* _gfx = (Gfx*)(pkt); \
_gfx->words.w0 = _SHIFTL(G_SETTILESIZE, 24, 8) | _SHIFTL(s, 10, 14) | _SHIFTL(width - 1, 0, 10); \
_gfx->words.w1 = _SHIFTL(1, 31, 1) | _SHIFTL(tile, 24, 3) | _SHIFTL(t, 10, 14) | _SHIFTL(height - 1, 0, 10); \
} while (0)
#define gsDPSetTileSize_Dolphin(tile, s, t, width, height) \
{{ \
_SHIFTL(G_SETTILESIZE, 24, 8) | _SHIFTL(s, 10, 14) | _SHIFTL(width - 1, 0, 10), \
_SHIFTL(1, 31, 1) | _SHIFTL(tile, 24, 3) | _SHIFTL(t, 10, 14) | _SHIFTL(height - 1, 0, 10)\
}}
#define G_DOLPHIN_TLUT_DEFAULT_MODE 15 // used almost always? CI palettes are forced to GX_TF_RGB5A3
#define gsDPLoadTextureBlock_4b_Dolphin(timg, fmt, w, h, pal, ws, wt, ss, st) \
gsDPSetTextureImage_Dolphin(fmt, G_IM_SIZ_4b, h, w, timg), \
+31 -6
View File
@@ -3,20 +3,45 @@
#include "types.h"
#include "PR/mbi.h"
#include "libforest/gbi_extensions.h"
#include "game.h"
#ifdef __cplusplus
extern "C" {
#endif
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry, int tile, int s, int t, int dsdx, int dtdy);
extern void gfx_set_fog_position(Gfx** gfxp, int near, int far);
extern Gfx* gfx_set_fog_nosync(Gfx* gfx, int r, int g, int b, int a, int near, int far);
extern void texture_z_light_prim_xlu_disp(GRAPH* graph);
extern void _texture_z_light_fog_prim_bg(GRAPH* graph);
extern void _texture_z_light_fog_prim(GRAPH* graph);
extern void _texture_z_light_fog_prim_shadow(GRAPH* graph);
extern void _texture_z_light_fog_prim_xlu(GRAPH* graph);
extern void _texture_z_light_fog_prim_light(GRAPH* graph);
extern void _texture_z_light_fog_prim_npc(GRAPH* graph);
extern Gfx* texture_z_light_fog_prim_bb_pal_opa(Gfx* gfx);
extern Gfx* texture_z_light_fog_prim_bb_pal_xlu(Gfx* gfx);
extern Gfx* texture_z_fog_lod_alpha_shadow(Gfx* gfx);
extern Gfx* gfx_rect_moji(Gfx* gfx);
extern void rect_moji(GRAPH* graph);
extern void polygon_z_light_prim(GRAPH* graph);
extern void softsprite_prim(GRAPH* graph);
extern Gfx* gfx_softsprite_prim_xlu(Gfx* gfx);
extern Gfx* gfx_tex_scroll2(Gfx** gfxpp, int x, int y, int width, int height);
extern Gfx* tex_scroll2(GRAPH* graph, u32 x, u32 y, int width, int height);
extern Gfx* tex_scroll2_dolphin(GRAPH* graph, int x, int y, int width, int height);
extern Gfx* two_tex_scroll(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2, int y2, int width2, int height2);
extern Gfx* two_tex_scroll_dolphin(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2, int y2, int width2, int height2);
extern void DisplayList_initialize(GRAPH* graph, u32 clear_r, u32 clear_g, u32 clear_b, GAME* game);
extern void fade_rgba8888_draw(Gfx** gfxp, u32 color);
extern void fade_black_draw(Gfx** gfx, u32 color);
extern Gfx* gfx_gDPFillRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
extern Gfx* gfx_gDPFillRectangleF(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
extern Gfx* gfx_tex_scroll2(Gfx** gfxpp, u32 x, u32 y, int width, int height);
extern void DisplayList_initialize(GRAPH* graph, u32 clear_r, u32 clear_g, u32 clear_b, GAME* game);
extern void fade_black_draw(Gfx** gfxpp, u32 alpha);
extern void rect_moji(GRAPH* graph);
extern void _texture_z_light_fog_prim(GRAPH* graph);
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx, int dtdy);
extern Gfx* gfx_gSPScisTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx, int dtdy);
extern Gfx RSP_RDP_clear_data[];
extern int fbdemo_mode;
#ifdef __cplusplus
}