NerdTracker II SDL port

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NerdTracker II SDL port
by on (#22783)
I've made an SDL port of Nerd Tracker 2, including Windows binaries (better than the old ones) and source code (+ Visual C++ 2005 project files).

I replaced the crappy file selector with a bit better one (now backspace works! ;-)), it could be improved though. Under Windows it uses the standard Windows file selecting dialogs. Also the APU engine was replaced with blargg's Nes_Snd_Emu, so goodbye audio aliasing!

You should be able to compile it under Linux and other unixes without too much trouble. At least on Mac OS X it worked just fine. Of course you need to have SDL installed.

If you find any bugs related to the port (i.e. something works different from the DOS-version), let me know and I'll try to fix it.

Version 1.1 (Win32, no source, fixes the note frequency bug): http://thefox.aspekt.fi/nt2-sdl-1.1.zip

Version 1.0 (Win32 binary, includes source and should compile on other platforms as well): http://thefox.aspekt.fi/nt2-sdl-1.0.zip

Version 1.0 (OSX binary, IIRC it's universal :)): http://thefox.aspekt.fi/nt2-osx.zip

by on (#22792)
Hooray! Many thanks to you. (Now someone's gotta extend the format to cover sound expansions =D)

by on (#22793)
BUG 1

All notes play at roughly a semitone lower than they do in the old NT2_Win32 or in the NSF. Did you mistakenly set up the PAL 2A03 with the NTSC frequency table?

by on (#22794)
tepples wrote:
BUG 1

All notes play at roughly a semitone lower than they do in the old NT2_Win32 or in the NSF. Did you mistakenly set up the PAL 2A03 with the NTSC frequency table?

The frequency is right though if you set your NSF player to play the NSF as a PAL tune (in NotSoFatso "Prefer PAL mode") but maybe I should fix this so it works like the old one did...

For starters, I silently updated the package so that the Windows style file dialogs actually work now.

by on (#22795)
Here's a short C++ snippet I once wrote to generate correct frequencies for the replay code for both NTSC and PAL:

Code:
#include <iostream.h>
#include <math.h>

#define CLOCK_NTSC  21477277/12
#define CLOCK_PAL   26601712/16

int main(int argc, char *argv[])
{
    const double clock = CLOCK_PAL;

    const double base_freq = 32.70;

    int PeriodTab[96];

    {
    for(int i = 0; i < 96; i++) {
        PeriodTab[i] = double(clock/16) / double(base_freq * pow(2, double(i)/12));
        }
    }

    {
    cout << "\nTone2PeriodLoTab";
    for(int i = 0; i < 8; i++) {
        cout << "\n.DB ";
        for(int j = 0; j < 12; j++) {
            cout << "$" << hex << (PeriodTab[i*12+j] & 0xFF);
            if(j != 11)
            cout << ",";
            }
        }
    cout << "\n";
    }

    {
    cout << "\nTone2PeriodHiTab";
    for(int i = 0; i < 8; i++) {
        cout << "\n.DB ";
        for(int j = 0; j < 12; j++) {
            cout << "$" << hex << ((PeriodTab[i*12+j]>>8) & 0xFF);
            if(j != 11)
            cout << ",";
            }
        }
    cout << "\n";
    }


    return 0;

}

by on (#23182)
Bug 2: When I enter the DMC editor (mini-bug: I have to use Shift-Numpad *, Shift-F3 doesn't work,) and press L to load a sample, the program crashes.

by on (#23185)
This morning, I reproduced the misbehavior that commodorejohn reported. I had to use the old version of to make a mock-up of "Get Ready 4 This" to explore the truth of the assertion in another topic that DMC is useful only for drum and bass samples.

by on (#23188)
commodorejohn wrote:
Bug 2: When I enter the DMC editor (mini-bug: I have to use Shift-Numpad *, Shift-F3 doesn't work,) and press L to load a sample, the program crashes.

The crashing bug fixed, re-download the package. I think it's pure luck that Shift+F3 worked originally, probably the key reading routine had a bug, so I'm probably not going to fix that one.

by on (#68329)
Since this topic came up again in IRC and e-mail, and I also had forgot to move this version to my new server, I decided to finally fix the note frequency bug that tepples mentioned in an earlier post (better late than never, ehhh?).

Download the new version here: http://thefox.aspekt.fi/nt2-sdl-1.1.zip

There's also a OSX port that somebody requested a year or two ago, which I forgot to post here at the time: http://thefox.aspekt.fi/nt2-osx.zip

No sources with these versions though.

by on (#68413)
Holy shit, I didn't know that the file load/saving interface had been changed, that's awesome. I was still using nt2_win32.exe with a date from 08/2005, I haven't done much with it though. NT2 updates are always a nice surprise, heheh.