Skip to content

Commit

Permalink
Update datmagic.c
Browse files Browse the repository at this point in the history
  • Loading branch information
mahoneyt944 authored Sep 20, 2024
1 parent 81f6e48 commit 6835f00
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions cores/mame2003/datmagic.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Beta version 5 - Jan. 17th 2021
Beta version 6 - Jan. 17th 2021
by: mahoneyt944 - MAME 2003-Plus Team.
- This version has been modified for use with MAME2003
Expand Down Expand Up @@ -60,8 +60,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);
Expand Down Expand Up @@ -167,7 +167,6 @@ int main()
target = ( char * )malloc( end - start + 1 );
memcpy( target, start, end - start );
target[end - start] = '\0';
clonesample = 1;

strcpy( sampleused, target );
}
Expand All @@ -191,14 +190,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 );
}
}
}
Expand Down Expand Up @@ -309,11 +308,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 );
Expand Down Expand Up @@ -374,10 +368,6 @@ int main()
fputs( biosused, write );
fputs( "</td>\n\t\t</tr>\n", write );
}

/***************** Reset flags *****************/
parentsample = 0;
clonesample = 0;
}

free( target );
Expand Down

0 comments on commit 6835f00

Please sign in to comment.