static int32_t tunrot;
static int32_t tunmat[4], tunx, tuny;
+static int rune_dist = 16;
+
void gamescr(void)
{
int i;
if(bnstate & BN_LEFT) x -= gate_speed;
if(bnstate & BN_RIGHT) x += gate_speed;
- if(bnstate & BN_UP) y -= gate_speed;
- if(bnstate & BN_DOWN) y += gate_speed;
+ if(bnstate & BN_UP) {
+ rune_dist += 2;
+ if(rune_dist > 0xff) rune_dist = 0xff;
+ }
+ if(bnstate & BN_DOWN) {
+ rune_dist -= 2;
+ if(rune_dist < 8) rune_dist = 8;
+ }
if(x < 0) x = 0;
if(x > 239) x = 239;
spr_oam(oam, 0, 512, x - 64, y - 64, SPR_SZ64 | SPR_DBLSZ |
SPR_ROTSCL | SPR_ROTSCL_SEL(0));
- mat[0] = COS(rot);
- mat[1] = -SIN(rot);
- mat[2] = SIN(rot);
- mat[3] = COS(rot);
+ mat[0] = COS(rot) * rune_dist >> 4;
+ mat[1] = -SIN(rot) * rune_dist >> 4;
+ mat[2] = SIN(rot) * rune_dist >> 4;
+ mat[3] = COS(rot) * rune_dist >> 4;
spr_transform(oam, 0, mat);