DAT magic cleanup

This commit is contained in:
mahoneyt944 2024-09-26 12:08:30 -04:00 committed by GitHub
parent 3aa773e2a4
commit 9221b2f66d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
/*
Beta version 5 - Jan. 17th 2021
Beta version 6 - Jan. 17th 2021
by: mahoneyt944 - MAME 2003-Plus Team.
*/
@ -58,8 +58,8 @@ int main()
char graphic[] = "graphic=\"";
char protection[] = "protection=\"";
/***************** Flags and counters *****************/
int found=0, parentsample=0, clonesample=0;
/***************** Counter *****************/
int found=0;
/***************** Allocate memory to use *****************/
char *romname = malloc(sizeof(char) * 30);
@ -165,7 +165,6 @@ int main()
target = ( char * )malloc( end - start + 1 );
memcpy( target, start, end - start );
target[end - start] = '\0';
clonesample = 1;
strcpy( sampleused, target );
}
@ -189,14 +188,14 @@ int main()
}
/***************** Read sample tag *****************/
else if ( (start = strstr( readline, sample_id )) && !(parentsample) )
else if ( (start = strstr( readline, sample_id )) && (sampleused[0] == '\0') )
{
if (( start = strstr( readline, name ) ))
{
start += strlen( name );
if (( end = strstr( start, "\"" ) ))
{
parentsample = 1;
strcpy( sampleused, romname );
}
}
}
@ -307,11 +306,6 @@ int main()
{
if ( romname[0] != '\0' )
{
/***************** Configure parent sample *****************/
if ( parentsample && !clonesample ) strcpy( sampleused, romname );
else if ( !parentsample && !clonesample ) sampleused[0] = '\0';
/***************** Write out html table data *****************/
fputs( "\t\t<tr>\n\t\t\t<td>", write );
fputs( romname, write );
@ -372,10 +366,6 @@ int main()
fputs( biosused, write );
fputs( "</td>\n\t\t</tr>\n", write );
}
/***************** Reset flags *****************/
parentsample = 0;
clonesample = 0;
}
free( target );