Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/goddard/renderer.h
7858 views
1
#ifndef GD_RENDERER_H
2
#define GD_RENDERER_H
3
4
#include <PR/ultratypes.h>
5
#include <PR/os_cont.h>
6
7
#include "gd_types.h"
8
#include "macros.h"
9
10
// types
11
/// Properties types used in [gd_setproperty](@ref gd_setproperty); most are stubbed out.
12
enum GdProperty {
13
GD_PROP_OVERLAY = 4,
14
GD_PROP_LIGHTING = 11,
15
GD_PROP_AMB_COLOUR = 12,
16
GD_PROP_DIFUSE_COLOUR = 13,
17
GD_PROP_LIGHT_DIR = 15,
18
GD_PROP_CULLING = 16,
19
GD_PROP_STUB17 = 17,
20
GD_PROP_STUB18 = 18,
21
GD_PROP_STUB19 = 19,
22
GD_PROP_STUB20 = 20,
23
GD_PROP_STUB21 = 21,
24
GD_PROP_ZBUF_FN = 22
25
};
26
27
enum GdSceneId {
28
GD_SCENE_YOSHI, // create yoshi?
29
GD_SCENE_YOSHI1, // destroy yoshi?
30
GD_SCENE_REGULAR_MARIO,
31
GD_SCENE_DIZZY_MARIO,
32
GD_SCENE_CAR, // create car?
33
GD_SCENE_CAR5 // destroy car?
34
};
35
36
// data
37
extern s32 gGdFrameBufNum;
38
39
// functions
40
u32 get_alloc_mem_amt(void);
41
s32 gd_get_ostime(void);
42
f32 get_time_scale(void);
43
f64 gd_sin_d(f64 x);
44
f64 gd_cos_d(f64 x);
45
f64 gd_sqrt_d(f64 x);
46
void gd_printf(const char *format, ...);
47
void gd_exit(UNUSED s32 code) NORETURN;
48
void gd_free(void *ptr);
49
void *gd_allocblock(u32 size);
50
void *gd_malloc(u32 size, u8 perm);
51
void *gd_malloc_perm(u32 size);
52
void *gd_malloc_temp(u32 size);
53
void draw_indexed_dl(s32 dlNum, s32 gfxIdx);
54
#ifdef USE_SYSTEM_MALLOC
55
void gdm_init(void *(*allocFn)(u32 size), void (*freeFn)(void *ptr));
56
#else
57
void gd_add_to_heap(void *addr, u32 size);
58
void gdm_init(void *blockpool, u32 size);
59
#endif
60
void gdm_setup(void);
61
void gdm_maketestdl(s32 id);
62
void gd_vblank(void);
63
void gd_copy_p1_contpad(OSContPad *p1cont);
64
s32 gd_sfx_to_play(void);
65
Gfx *gdm_gettestdl(s32 id);
66
void gd_draw_rect(f32 ulx, f32 uly, f32 lrx, f32 lry);
67
void gd_draw_border_rect(f32 ulx, f32 uly, f32 lrx, f32 lry);
68
void gd_dl_set_fill(struct GdColour *colour);
69
void stash_current_gddl(void);
70
void pop_gddl_stash(void);
71
s32 gd_startdisplist(s32 memarea);
72
s32 gd_enddlsplist_parent(void);
73
void gd_dl_load_matrix(Mat4f *mtx);
74
void gd_dl_push_matrix(void);
75
void gd_dl_pop_matrix(void);
76
void gd_dl_mul_trans_matrix(f32 x, f32 y, f32 z);
77
void gd_dl_load_trans_matrix(f32 x, f32 y, f32 z);
78
void gd_dl_scale(f32 x, f32 y, f32 z);
79
void func_8019F2C4(f32 arg0, s8 arg1);
80
void gd_dl_lookat(struct ObjCamera *cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7);
81
void check_tri_display(s32 vtxcount);
82
Vtx *gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha);
83
void func_8019FEF0(void);
84
void gd_dl_make_triangle(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 x3, f32 y3, f32 z3);
85
void func_801A0038(void);
86
void gd_dl_flush_vertices(void);
87
void set_render_alpha(f32 arg0);
88
void set_light_id(s32 index);
89
void set_light_num(s32 n);
90
s32 create_mtl_gddl(s32 mtlType);
91
void branch_to_gddl(s32 dlNum);
92
void gd_dl_hilite(s32, struct ObjCamera *, struct GdVec3f *, struct GdVec3f *, struct GdVec3f *, struct GdColour *);
93
void gd_dl_hilite(s32 idx, struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3,
94
struct GdVec3f *arg4, struct GdColour *colour);
95
s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material);
96
void set_Vtx_norm_buf_1(struct GdVec3f *norm);
97
void set_Vtx_norm_buf_2(struct GdVec3f *norm);
98
void set_gd_mtx_parameters(s32 params);
99
void gd_set_one_cycle(void);
100
void gddl_is_loading_stub_dl(UNUSED s32 dlLoad);
101
void start_view_dl(struct ObjView *view);
102
void border_active_view(void);
103
void gd_shading(s32 model);
104
s32 gd_getproperty(s32 prop, UNUSED void *arg1);
105
void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3);
106
void gd_create_ortho_matrix(f32 l, f32 r, f32 b, f32 t, f32 n, f32 f);
107
void gd_create_perspective_matrix(f32 fovy, f32 aspect, f32 near, f32 far);
108
s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly,
109
UNUSED s32 lrx, UNUSED s32 lry);
110
void gd_init_controllers(void);
111
void stub_renderer_6(struct GdObj *obj); //apply to OBJ_TYPE_VIEWS
112
long defpup(UNUSED const char *menufmt, ...);
113
void menu_cb_control_type(u32);
114
void menu_cb_recalibrate_controller(u32);
115
void func_801A4438(f32 x, f32 y, f32 z);
116
void stub_renderer_10(u32 arg0);
117
void stub_draw_label_text(UNUSED char *s);
118
void set_active_view(struct ObjView *v);
119
void func_801A520C(void);
120
void gd_init(void);
121
void stub_renderer_12(s8 *arg0); /* convert LE bytes to BE word? */
122
void stub_renderer_13(UNUSED void *arg0);
123
void stub_renderer_14(UNUSED s8 *arg0); /* convert LE bytes to BE f32? */
124
void init_pick_buf(s16 *buf, s32 len);
125
void store_in_pickbuf(s16 data);
126
s32 get_cur_pickbuf_offset(UNUSED s16 *arg0);
127
void set_vtx_tc_buf(f32 tcS, f32 tcT);
128
struct GdObj *load_dynlist(struct DynList *dynlist);
129
130
#endif // GD_RENDERER_H
131
132