It is currently Sat May 27, 2017 7:50 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jun 05, 2016 2:49 am 
Offline
User avatar

Joined: Sun Jun 05, 2016 2:10 am
Posts: 84
Location: Canada
I have started work on a configuration file for sidid, but instead of identifying C64 players, it identifies NSF players. I have also created a small modification of the original program, so it looks for NSFs instead of SIDs.

The signature file is not complete, but I'd like your thoughts on this.


Top
 Profile  
 
PostPosted: Sun Jun 05, 2016 3:14 am 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 243
I was actually thinking of integrating something similar into my NSF player. Consider me interested.


Top
 Profile  
 
PostPosted: Sun Jun 05, 2016 6:42 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 18361
Location: NE Indiana, USA (NTSC)
HertzDevil had a similar idea.


It's not traditional to use .exe with UNIX executables. You can usually detect the difference between UNIX and Windows by the absence or presence of the COMSPEC environment variable.
Code:
# Use .exe only on Windows, which defines COMSPEC
ifdef COMSPEC
DOTEXE:=.exe
else
DOTEXE:=
endif
EXENAME:=nsfid$(DOTEXE)

.PHONY: all
all: $(EXENAME)

$(EXENAME): nsfid.c
   gcc $^ -Wall -O3 -s -o $@


This makefile incorporates COMSPEC as well as three other changes:
  • You can strip debugging symbols from the output while linking by using -s in the command line that produces the executable.
  • Use two automatic variables so that the makefile doesn't repeat itself: $^ means "name of all dependencies", and $@ means "name of the target".
  • Target names that do not refer to an actual file, such as all, clean, and the like, need to be declared .PHONY so that Make doesn't get confused if there's an actual file by that name.

Some error checking is missing. -Wall in GCC 4.8.5 includes -Wunused-result, and you're ignoring return values of several standard library functions declared with attribute warn_unused_result:
  • getcwd at lines 100, 175, 321
  • chdir at lines 174, 177, 333, 335
  • fscanf at line 199
  • fread at line 199, 390

Once I compiled the program and ran it from a terminal, the output was as follows:
Code:
.../nsfid$ ./nsfid
Using configfile
No signatures defined!

It's traditional, if a required argument is missing, to recommend on stderr that the user run programname --help.

Usage is somewhat confusing, as it works only on directories, not individual files.
Code:
.../nsfid$ NSFIDCFG=./nsfid.cfg ./nsfid ~/Music/old_nt2_nsfs
emerald_hill.nsf                                         NerdTracker_II
meatspin.nsf                                             NerdTracker_II
fuga7777.nsf                                             NerdTracker_II
Opentris.nsf                                             NerdTracker_II
bomblodev2.nsf                                           NerdTracker_II
dy-covers.nsf                                            NerdTracker_II
Butterfly.nsf                                            NerdTracker_II

Detected players:
NerdTracker_II           7

Statistics:
Identified               7
Unidentified             0
Total files examined     7
.../nsfid$ NSFIDCFG=./nsfid.cfg ./nsfid ~/Music/old_nt2_nsfs/dy-covers.nsf
Using configfile ./nsfid.cfg

Statistics:
Identified               0
Unidentified             0
Total files examined     0


I ran it against the development folder for my own music engine, whose source code can be browsed:
Code:
.../nsfid$ NSFIDCFG=./nsfid.cfg ./nsfid ~/develop/pently
Using configfile ./nsfid.cfg

Statistics:
Identified               0
Unidentified             1
Total files examined     1


Any tips on making signatures that are distinctive yet resilient to minor changes in new versions of the engine, beyond those listed on the sidid GitHub project?


Top
 Profile  
 
PostPosted: Thu Aug 04, 2016 4:49 pm 
Offline
User avatar

Joined: Sun Jun 05, 2016 2:10 am
Posts: 84
Location: Canada
Updated signatures.


Top
 Profile  
 
PostPosted: Sun Apr 09, 2017 3:37 am 
Offline
User avatar

Joined: Sun Jun 05, 2016 2:10 am
Posts: 84
Location: Canada
Been a while since I posted anything related to this. Here's a new signature file, with a whole lot more added :)

And sorry, but no update to the program. I am not proficient at all in C++ :/


Attachments:
nsfid.zip [4.12 KiB]
Downloaded 21 times
Top
 Profile  
 
PostPosted: Tue Apr 11, 2017 6:55 pm 
Offline
User avatar

Joined: Fri Feb 27, 2009 2:35 pm
Posts: 174
Location: Fort Wayne, Indiana
This update only contains the config file, and the link with the actual program in the first post is dead.


Top
 Profile  
 
PostPosted: Tue Apr 11, 2017 7:09 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 18361
Location: NE Indiana, USA (NTSC)
Here's the program


Attachments:
nsfid-1.09.zip [47.8 KiB]
Downloaded 18 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group