void gamescr(void)
{
+ int i;
unsigned char *fb;
+ uint16_t *cmap;
REG_DISPCNT = 4 | DISPCNT_BG2 | DISPCNT_OBJ | DISPCNT_FB1;
memset(&player, 0, sizeof player);
player.phi = 0x100;
+ cmap = (uint16_t*)CRAM_BG_ADDR;
+ *cmap++ = 0;
+ for(i=1; i<255; i++) {
+ *cmap++ = rand();
+ }
+ *cmap = 0xffff;
+
+
select_input(BN_DPAD | BN_A | BN_B);
mask(INTR_VBLANK);
xgl_push_matrix();
xgl_translate(x, 0, y);
+ xgl_index(i + 1);
xgl_draw(XGL_QUADS, tm_floor, sizeof tm_floor / sizeof *tm_floor);
xgl_pop_matrix();
}
static unsigned int opt;
static int32_t ldir[3];
+static int cur_cidx;
+
static void draw_ptlines(int prim, const struct xvertex *varr, int vcount);
xgl_mult_matrix(m);
}
+void xgl_index(int cidx)
+{
+ cur_cidx = cidx;
+}
+
static void xform(struct xvertex *out, const struct xvertex *in, const int32_t *m)
{
out->x = XMUL(m[0], in->x) + XMUL(m[4], in->y) + XMUL(m[8], in->z) + m[12];
}
while(vcount >= prim) {
- cidx = 0xff;//varr->cidx;
+ cidx = cur_cidx;//varr->cidx;
xform(xv, varr, mat[mtop]);
xform_norm(xv, varr, mat[mtop]);
void xgl_draw(int prim, const struct xvertex *varr, int vcount);
void xgl_transform(const struct xvertex *vin, int *x, int *y);
+void xgl_index(int c);
+
void xgl_xyzzy(void);
int xgl_clip_near(struct xvertex *vout, int *voutnum, struct xvertex *vin, int vnum);