GoodNES, sort by mapper

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
GoodNES, sort by mapper
by on (#60089)
I'm a newbie with GoodNES, but I've learned it can sort ROMs into folders by mappernumber. However I've no clue how to do that. The including documentation mentions "dirs[m][dh]" but I don't get how it should be used since it refuses everything I try.
Hints anyone?

Thanks in advance.

by on (#60097)
I remember using a program called nestoy to do that, I haven't needed to use either program in years, but it would be interesting to know if that can be done in GoodNES as well.

by on (#60103)
This is really easy to do in about 20 lines of C#.

by on (#60106)
Enter "dirsmd" or "dirsmh" and that will do it, dirsmd will sort by the GoodNES mapper database and dirsmh with sort by iNES header's mapper number. Use in place of the regular dirs command

by on (#60112)
As an exercise I wrote ze Python (stupid unformatted input took some research...)
Code:
import os
romz = []
for root, dirs, files in os.walk('.'):
    for fn in files:
        if fn.lower().endswith('.nes'):
            romz.append(os.path.join(root,fn))
for path in romz:
    fh = open(path, 'rb')
    header = fh.read(16).encode('hex') # nibbles
    fh.close()
    mapper = (int(header[14]) * 2) | int(header[12])
    mapdir = os.path.join('.',str(mapper))
    if not os.path.exists(mapdir):
        os.mkdir(mapdir)
    os.rename(path, os.path.join(mapdir,os.path.split(path)[1]))

by on (#60122)
peppers wrote:
Enter "dirsmd" or "dirsmh" and that will do it, dirsmd will sort by the GoodNES mapper database and dirsmh with sort by iNES header's mapper number. Use in place of the regular dirs command


Tried that, but it refused to work. It just gave me a list of the options again.
Someone should rewrite those old tools with GUI's instead and make them *alot* more userfriendly. :)

by on (#60123)
oRBIT2002 wrote:
Someone should rewrite those old tools with GUI's instead and make them *alot* more userfriendly. :)

It doesn't take a rewrite to add a GUI, just a front-end. If you start with a command-line program, someone can always write a GUI wrapper that scripts it. The other way around is harder. (ObNES: That's why I prefer command-line image data converters, because GNU Make can see what files are changed and automatically run the converter again.)

by on (#60124)
oRBIT2002 wrote:
Tried that, but it refused to work. It just gave me a list of the options again.
Someone should rewrite those old tools with GUI's instead and make them *alot* more userfriendly. :)

Here I'll make is easy for you. "move" can be swapped out with any of the commands listed first.
Code:
goodnes move dirsmd