really draw a square

This commit is contained in:
chacha
2026-02-25 00:41:53 +00:00
parent f6d19c682d
commit 57fd93f513
2 changed files with 23 additions and 14 deletions

29
Draw.c
View File

@@ -21,13 +21,15 @@
#include "Draw.h"
#define XY_ONE (1<<SST_XY_FRACBITS)
#define XY_ONE (1 << SST_XY_FRACBITS)
#define ST_ONE (1 << SST_ST_FRACBITS)
#define W_ONE (1 << SST_W_FRACBITS)
void
drawTriangle( const SstRegs *sst,
const int x,
const int y,
const int tSize)
drawSquare( const SstRegs *sst,
const int x,
const int y,
const int tSize)
{
ISET(sst->vA.x,x);
ISET(sst->vA.y,y);
@@ -37,15 +39,22 @@ drawTriangle( const SstRegs *sst,
ISET(sst->vC.y,y+XY_ONE*tSize);
ISET(sst->s,0);
ISET(sst->t,0);
ISET(sst->w,0);
ISET(sst->dsdx,1<<SST_ST_FRACBITS);
ISET(sst->w,W_ONE);
ISET(sst->dsdx,ST_ONE);
ISET(sst->dtdx,0);
ISET(sst->dwdx,0);
ISET(sst->dsdy,0);
ISET(sst->dtdy,1<<SST_ST_FRACBITS);
ISET(sst->dtdy,ST_ONE);
ISET(sst->dwdy,0);
ISET(sst->triangleCMD,0);
ISET(sst->vB.x, (x<<SST_XY_FRACBITS));
ISET(sst->vB.y, ((y+tSize)<<SST_XY_FRACBITS));
ISET(sst->vA.x,x);
ISET(sst->vA.y,y+XY_ONE*tSize);
ISET(sst->vB.x,x+XY_ONE*tSize);
ISET(sst->vB.y,y);
ISET(sst->vC.x, x+XY_ONE*tSize);
ISET(sst->vC.y, y+XY_ONE*tSize);
ISET(sst->s,0);
ISET(sst->t,ST_ONE*tSize);
ISET(sst->w,W_ONE);
ISET(sst->triangleCMD, 0xFFFFFFFF);
}