Files
V2TMUMemTester/Draw.c
chacha deb19eb710 .
2026-02-24 00:17:22 +00:00

55 lines
1.5 KiB
C

/* V2MemTest - A CLI Tool to test & fix Voodoo² TMU System
* Copyright (C) 2026 ChaCha
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
//#include "3dfx.h"
//#include "cvgregs.h"
//#include "cvgdefs.h"
#include "cvg.h"
#include "glide.h"
#include "sst1init.h"
#include "Draw.h"
#define XY_ONE (1<<SST_XY_FRACBITS)
void
drawTriangle( const SstRegs *sst,
const int x,
const int y,
const int tSize)
{
ISET(sst->vA.x,x);
ISET(sst->vA.y,y);
ISET(sst->vB.x,x+XY_ONE*tSize);
ISET(sst->vB.y,y);
ISET(sst->vC.x,x);
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->dtdx,0);
ISET(sst->dwdx,0);
ISET(sst->dsdy,0);
ISET(sst->dtdy,1<<SST_ST_FRACBITS);
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->triangleCMD, 0xFFFFFFFF);
}