continue cleaning

This commit is contained in:
chacha
2026-02-23 20:01:59 +00:00
parent c1bbb3fcb7
commit 96e4c2d6e4
4 changed files with 102 additions and 25 deletions

View File

@@ -11,7 +11,6 @@ CFLAGS+=-I. -I/home/chacha/glide-test/glide2x/cvg/init \
CFLAGS+=-DCVG
#LFLAGS=-llibglide -L/home/chacha/glide-test/glide2x/cvg/lib
LFLAGS=-lglide -L/home/chacha/glide-test/glide2x/cvg/lib
OBJ=main.o \
@@ -25,7 +24,7 @@ OBJ=main.o \
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
V2MemTest : $(OBJ)
v2memtest : $(OBJ)
$(CC) -o $@ $(LFLAGS) $^
all: V2MemTest
all: v2memtest

88
V2MemTest.h Normal file
View File

@@ -0,0 +1,88 @@
#ifndef _DEF_V2MEMTEST_H_
#define _DEF_V2MEMTEST_H_
#define V2MEMTEST__VERSION__MAJOR 0
#define V2MEMTEST__VERSION__MINOR 1
#define V2MEMTEST__VERSION__PATCH 0
typedef enum _def_eTestType {
E_TESTTYPE__ADDRESS,
E_TESTTYPE__DATA__BITMOVE,
E_TESTTYPE__DATA__RANDOM,
E_TESTTYPE__DATA__HUGE,
E_TESTTYPE__DATA__ALL,
}def_eTestType;
typedef enum _def_eTMUTarget {
E_TMUTARGET__0,
E_TMUTARGET__1,
E_TMUTARGET__BOTH,
}def_eTMUTarget;
typedef enum _def_eTMURamLimit {
E_TMUTARGET__1MB,
E_TMUTARGET__2MB,
E_TMUTARGET__3MB,
E_TMUTARGET__4MB,
}def_eTMURamLimit;
typedef enum _def_eLogLevel {
E_LOGLEVEL__ERROR,
E_LOGLEVEL__WARNING,
E_LOGLEVEL__INFO,
E_LOGLEVEL__DEBUG,
E_LOGLEVEL__TRACE,
}def_eLogLevel;
typedef struct _def_sOptions
{
def_eLogLevel ucLogLevel;
unsigned char bLogStdOut;
char szLogFileName[2048];
char szTSVFile[2048];
unsigned short usNbLoops;
def_eTestType eTestType;
def_eTMUTarget eTMUTarget;
def_eLogLevel eLogLevel;
def_eTMURamLimit eTMURamLimit;
}
const char szTitle[] = \
"V2MemTest-%d.%d.%d - A CLI Tool to test & fix Voodoo² TMU System\n" \
"Copyright (C) 2026 ChaCha\n";
const char szLicence[] = \
"This program is free software : you can redistribute it and/or modify it under\n" \
"the terms of the GNU General Public License as published by the Free Software\n" \
"Foundation either version 3 of the License, or (at your option) any later version.\n" \
"This program is distributed in the hope that it will be useful, but WITHOUT ANY\n" \
"WARRANTY !\n";
const char szHelp[] = \
"Usage ./v2memtest <options>\n" \
"\n"
"options:\n"
"\t-h :\tthis output\n"
"\n"
"\t-v <level> :\tset log level to the specified value.\n"
"\t\t 0: ERR, 1: INFO, 2: WARN, 3: DEBUG, 4: TRACE\n"
"\n"
"\t-fl <file> :\tset a log file path & name.\n"
"\n"
"\t-fd <file> :\tset a failure report path & base name.\n"
"\t\t Note that the test name will be appended to the file name.\n"
"\t\t eg: file name is 'foo' running 'data-bitmove' :\n"
"\t\t foo_data-bitmove.tsv\n"
"\n"
"\t :\t\n"
"\n"
"\t :\t\n"
"\n"
"\n"
"( -h | -v <level> | -fl <file> | -fd <file> |"
extern def_sOptions sOptions;
#endif //_DEF_V2MEMTEST_H_

31
main.c
View File

@@ -28,6 +28,7 @@
#include <3dfx.h>
#include <glide.h>
#include "V2MemTest.h"
#include "FaultSources.h"
#include "Utils.h"
#include "Draw.h"
@@ -36,27 +37,12 @@
#include "Test_Data.h"
#include "Test_Data_Huge.h"
typedef enum _def_eLogLevel {
E_LOGLEVEL_ERROR,
E_LOGLEVEL_WARNING,
E_LOGLEVEL_INFO,
E_LOGLEVEL_DEBUG,
E_LOGLEVEL_TRACE,
}def_eLogLevel;
typedef struct _def_sOptions
{
def_eLogLevel ucLogLevel;
unsigned char bLogStdOut;
char szLogFileName[2048];
char szTSVFile[2048];
}
def_sOptions Options = {
def_sOptions sOptions = {
.ucLogLevel = E_LOGLEVEL_WARNING,
.bLogStdOut = 1,
.szLogFileName = {0},
.szTSVFile = {0}
.szTSVFile = {0},
.usNbLoops = 1,
};
@@ -64,14 +50,17 @@ int main(int argc, char **argv)
{
unsigned long long ullNbErrorAll = 0;
const FxU32 boardNum = 0;
//const int TMU_to_test = 0;
//const unsigned char bRandom = 1;
sst1DeviceInfoStruct devInfo;
FxU32* sst;
SstRegs *sstregs;
printf("3Dfx Voodoo2 TMU memory tester v1.0\n(c) ChaCha, 2026\n\n");
printf(szTitle, V2MEMTEST__VERSION__MAJOR,
V2MEMTEST__VERSION__MINOR,
V2MEMTEST__VERSION__PATCH);
putchar('\n');
puts(szLicence);
putchar('\n');
srandom(time(NULL));
FaultSource_Reset();

3
nppws
View File

@@ -5,7 +5,6 @@
<File name="Draw.h" />
<File name="FaultSources.c" />
<File name="FaultSources.h" />
<File name="LICENSE.txt" />
<File name="main.c" />
<File name="Makefile" />
<File name="Readme.md" />
@@ -17,5 +16,7 @@
<File name="Test_Data_Huge.h" />
<File name="Utils.c" />
<File name="Utils.h" />
<File name="LICENSE.md" />
<File name="V2MemTest.h" />
</Project>
</NotepadPlus>