12 | This dialog is used to store a message in the module file.
13 |
14 | Options:
15 |
16 |
Show when loading file: Show this dialog when opening file.
17 |
18 |
19 |
20 | Back to main index
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/APU/ChannelLevelState.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // DIY min/max compiles faster than including all of for std::min/max
4 | #include "utils/variadic_minmax.h"
5 |
6 | /// Used for CSoundChip2::GetChannelLevel().
7 | template
8 | class ChannelLevelState {
9 | T m_CurrLevel = 0;
10 | T m_MinLevel = 0;
11 | T m_MaxLevel = 0;
12 |
13 | public:
14 | void update(T level)
15 | {
16 | m_CurrLevel = level;
17 | m_MinLevel = min(m_MinLevel, m_CurrLevel);
18 | m_MaxLevel = max(m_MaxLevel, m_CurrLevel);
19 | }
20 |
21 | T getLevel()
22 | {
23 | T out = m_MaxLevel - m_MinLevel;
24 | m_MinLevel = m_MaxLevel = m_CurrLevel;
25 | return out;
26 | }
27 | };
28 |
--------------------------------------------------------------------------------
/hlp/performance.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Performance
10 |
11 |
12 | This dialog is used to display tracker performance, as CPU usage and audio streaming status.
13 | What's important here is to check that the buffer underrun counter isn't increasing.
14 | If it does then you need to increase the audio buffer size (in audio settings).
15 |
12 | This section allows you to customize the key shortcuts in the program.
13 | Select the command you want to modify and the press the key combination you wish
14 | to use in the keys-field.
23 |
24 |
25 | Back to interface · main index
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Source/SeqInstHandler2A03Pulse.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "stdafx.h"
24 |
--------------------------------------------------------------------------------
/hlp/speed.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Engine speed
10 |
11 |
12 | This dialog allows a custom song refresh rate to be used, instead of the default rate (60 Hz for NTSC or 50 Hz for PAL).
13 |
14 |
15 |
16 |
17 |
18 |
19 | Note:
20 | Playback is only guaranteed to work at 60 Hz when exported to NSF,
21 | it's up to the user to make sure exported songs actually works when using speeds above 60 Hz.
22 |
24 |
25 |
26 | Back to interface · main index
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Source/APU/residfp/Integrator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of libsidplayfp, a SID player engine.
3 | *
4 | * Copyright 2014 Leandro Nini
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 | */
20 | #pragma once
21 |
22 | #define INTEGRATOR_CPP
23 |
24 | #include "Integrator.h"
25 |
26 | // This is needed when compiling with --disable-inline
27 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/vrc7tone_kt1.h:
--------------------------------------------------------------------------------
1 | // patch set 1 by kevtris (11/14/1999)
2 | // http://kevtris.org/nes/vrcvii.txt
3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4 | 0x05, 0x03, 0x10, 0x06, 0x74, 0xA1, 0x13, 0xF4,
5 | 0x05, 0x01, 0x16, 0x00, 0xF9, 0xA2, 0x15, 0xF5,
6 | 0x01, 0x41, 0x11, 0x00, 0xA0, 0xA0, 0x83, 0x95,
7 | 0x01, 0x41, 0x17, 0x00, 0x60, 0xF0, 0x83, 0x95,
8 | 0x24, 0x41, 0x1F, 0x00, 0x50, 0xB0, 0x94, 0x94,
9 | 0x05, 0x01, 0x0B, 0x04, 0x65, 0xA0, 0x54, 0x95,
10 | 0x11, 0x41, 0x0E, 0x04, 0x70, 0xC7, 0x13, 0x10,
11 | 0x02, 0x44, 0x16, 0x06, 0xE0, 0xE0, 0x31, 0x35,
12 | 0x48, 0x22, 0x22, 0x07, 0x50, 0xA1, 0xA5, 0xF4,
13 | 0x05, 0xA1, 0x18, 0x00, 0xA2, 0xA2, 0xF5, 0xF5,
14 | 0x07, 0x81, 0x2B, 0x05, 0xA5, 0xA5, 0x03, 0x03,
15 | 0x01, 0x41, 0x08, 0x08, 0xA0, 0xA0, 0x83, 0x95,
16 | 0x21, 0x61, 0x12, 0x00, 0x93, 0x92, 0x74, 0x75,
17 | 0x21, 0x62, 0x21, 0x00, 0x84, 0x85, 0x34, 0x15,
18 | 0x21, 0x62, 0x0E, 0x00, 0xA1, 0xA0, 0x34, 0x15,
19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/vrc7tone_kt2.h:
--------------------------------------------------------------------------------
1 | // patch set 2 by kevtris (11/15/1999)
2 | // http://kevtris.org/nes/vrcvii.txt
3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4 | 0x31, 0x22, 0x23, 0x07, 0xF0, 0xF0, 0xE8, 0xF7,
5 | 0x03, 0x31, 0x68, 0x05, 0xF2, 0x74, 0x79, 0x9C,
6 | 0x01, 0x51, 0x72, 0x04, 0xF1, 0xD3, 0x9D, 0x8B,
7 | 0x22, 0x61, 0x1B, 0x05, 0xC0, 0xA1, 0xF8, 0xE8,
8 | 0x22, 0x61, 0x2C, 0x03, 0xD2, 0xA1, 0xA7, 0xE8,
9 | 0x31, 0x22, 0xFA, 0x01, 0xF1, 0xF1, 0xF4, 0xEE,
10 | 0x21, 0x61, 0x28, 0x06, 0xF1, 0xF1, 0xCE, 0x9B,
11 | 0x27, 0x61, 0x60, 0x00, 0xF0, 0xF0, 0xFF, 0xFD,
12 | 0x60, 0x21, 0x2B, 0x06, 0x85, 0xF1, 0x79, 0x9D,
13 | 0x31, 0xA1, 0xFF, 0x0A, 0x53, 0x62, 0x5E, 0xAF,
14 | 0x03, 0xA1, 0x70, 0x0F, 0xD4, 0xA3, 0x94, 0xBE,
15 | 0x2B, 0x61, 0xE4, 0x07, 0xF6, 0x93, 0xBD, 0xAC,
16 | 0x21, 0x63, 0xED, 0x07, 0x77, 0xF1, 0xC7, 0xE8,
17 | 0x21, 0x61, 0x2A, 0x03, 0xF3, 0xE2, 0xB6, 0xD9,
18 | 0x21, 0x63, 0x37, 0x03, 0xF3, 0xE2, 0xB6, 0xD9,
19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22 |
--------------------------------------------------------------------------------
/Source/APU/residfp/README:
--------------------------------------------------------------------------------
1 | reSIDfp is a fork of Dag Lem's reSID 0.16, a reverse engineered software emulation
2 | of the MOS6581/8580 SID (Sound Interface Device).
3 |
4 | The project was started by Antti S. Lankila in order to improve SID emulation
5 | with special focus on the 6581 filter.
6 | The codebase has been later on ported to java by Ken Händel within the jsidplay2 project
7 | and has seen further work by Antti Lankila.
8 | It was then ported back to c++ and integrated with improvements from reSID 1.0 by Leandro Nini.
9 |
10 |
11 | Main differences from reSID:
12 |
13 | * combined waveforms are emulated by a parametrized model based on samplings from Kevtris;
14 | * envelope generator is implemented like in the real machine with a shift register;
15 | * high quality resampling is done in two steps to allow computational savings using lower order filters;
16 | * part of the calculations are done with floats instead of fixed point;
17 | * interpolation is accomplished with Fritsch-Carlson method to preserve monotonicity.
18 |
19 |
20 | reSIDfp is free software. See the file COPYING for copying permission.
21 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/vrc7tone_ft35.h:
--------------------------------------------------------------------------------
1 | // patch set by Mitsutaka Okazaki used in FamiTracker 0.3.5 and prior (6/24/2001)
2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3 | 0x33, 0x01, 0x09, 0x0e, 0x94, 0x90, 0x40, 0x01,
4 | 0x13, 0x41, 0x0f, 0x0d, 0xce, 0xd3, 0x43, 0x13,
5 | 0x01, 0x12, 0x1b, 0x06, 0xff, 0xd2, 0x00, 0x32,
6 | 0x61, 0x61, 0x1b, 0x07, 0xaf, 0x63, 0x20, 0x28,
7 | 0x22, 0x21, 0x1e, 0x06, 0xf0, 0x76, 0x08, 0x28,
8 | 0x66, 0x21, 0x15, 0x00, 0x93, 0x94, 0x20, 0xf8,
9 | 0x21, 0x61, 0x1c, 0x07, 0x82, 0x81, 0x10, 0x17,
10 | 0x23, 0x21, 0x20, 0x1f, 0xc0, 0x71, 0x07, 0x47,
11 | 0x25, 0x31, 0x26, 0x05, 0x64, 0x41, 0x18, 0xf8,
12 | 0x17, 0x21, 0x28, 0x07, 0xff, 0x83, 0x02, 0xf8,
13 | 0x97, 0x81, 0x25, 0x07, 0xcf, 0xc8, 0x02, 0x14,
14 | 0x21, 0x21, 0x54, 0x0f, 0x80, 0x7f, 0x07, 0x07,
15 | 0x01, 0x01, 0x56, 0x03, 0xd3, 0xb2, 0x43, 0x58,
16 | 0x31, 0x21, 0x0c, 0x03, 0x82, 0xc0, 0x40, 0x07,
17 | 0x21, 0x01, 0x0c, 0x03, 0xd4, 0xd3, 0x40, 0x84,
18 | 0x04, 0x21, 0x28, 0x00, 0xdf, 0xf8, 0xff, 0xf8,
19 | 0x23, 0x22, 0x00, 0x00, 0xa8, 0xf8, 0xf8, 0xf8,
20 | 0x25, 0x18, 0x00, 0x00, 0xf8, 0xa9, 0xf8, 0x55,
21 |
--------------------------------------------------------------------------------
/Source/APU/residfp/Integrator8580.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of libsidplayfp, a SID player engine.
3 | *
4 | * Copyright 2014-2016 Leandro Nini
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 | */
20 | #pragma once
21 |
22 | #define INTEGRATOR8580_CPP
23 |
24 | #include "Integrator8580.h"
25 |
26 | // This is needed when compiling with --disable-inline
27 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/vrc7tone_rw.h:
--------------------------------------------------------------------------------
1 | // patch set by rainwarrior (8/01/2012)
2 | // http://forums.nesdev.com/viewtopic.php?f=6&t=9141
3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4 | 0x03, 0x21, 0x05, 0x06, 0xB8, 0x82, 0x42, 0x27,
5 | 0x13, 0x41, 0x13, 0x0D, 0xD8, 0xD6, 0x23, 0x12,
6 | 0x31, 0x11, 0x08, 0x08, 0xFA, 0x9A, 0x22, 0x02,
7 | 0x31, 0x61, 0x18, 0x07, 0x78, 0x64, 0x30, 0x27,
8 | 0x22, 0x21, 0x1E, 0x06, 0xF0, 0x76, 0x08, 0x28,
9 | 0x02, 0x01, 0x06, 0x00, 0xF0, 0xF2, 0x03, 0xF5,
10 | 0x21, 0x61, 0x1D, 0x07, 0x82, 0x81, 0x16, 0x07,
11 | 0x23, 0x21, 0x1A, 0x17, 0xCF, 0x72, 0x25, 0x17,
12 | 0x15, 0x11, 0x25, 0x00, 0x4F, 0x71, 0x00, 0x11,
13 | 0x85, 0x01, 0x12, 0x0F, 0x99, 0xA2, 0x40, 0x02,
14 | 0x07, 0xC1, 0x69, 0x07, 0xF3, 0xF5, 0xA7, 0x12,
15 | 0x71, 0x23, 0x0D, 0x06, 0x66, 0x75, 0x23, 0x16,
16 | 0x01, 0x02, 0xD3, 0x05, 0xA3, 0x92, 0xF7, 0x52,
17 | 0x61, 0x63, 0x0C, 0x00, 0x94, 0xAF, 0x34, 0x06,
18 | 0x21, 0x62, 0x0D, 0x00, 0xB1, 0xA0, 0x54, 0x17,
19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22 |
--------------------------------------------------------------------------------
/Source/APU/resid/version.cc:
--------------------------------------------------------------------------------
1 | // ---------------------------------------------------------------------------
2 | // This file is part of reSID, a MOS6581 SID emulator engine.
3 | // Copyright (C) 2004 Dag Lem
4 | //
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 | // ---------------------------------------------------------------------------
19 |
20 | #define __VERSION_CC__
21 | #include "siddefs.h"
22 |
--------------------------------------------------------------------------------
/hlp/menu_view.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | View menu
10 |
11 |
12 | Toolbar
13 | Displays or hides the toolbar.
14 |
15 | Status Bar
16 | Displays or hides the status bar.
17 |
18 | Control panel
19 | Displays or hides the control panel.
20 |
21 | Frame editor position
22 | Moves the frame editor to the top
23 | (default) or to the left of the pattern editor.
24 |
25 |
26 | Back to menus · interface · main index
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/vrc7tone_nuke.h:
--------------------------------------------------------------------------------
1 | // patch set by Nuke.YKT (3/15/2019)
2 | // https://siliconpr0n.org/archive/doku.php?id=vendor:yamaha:opl2#ym2413_instruments
3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4 | 0x03, 0x21, 0x05, 0x06, 0xE8, 0x81, 0x42, 0x27,
5 | 0x13, 0x41, 0x14, 0x0D, 0xD8, 0xF6, 0x23, 0x12,
6 | 0x11, 0x11, 0x08, 0x08, 0xFA, 0xB2, 0x20, 0x12,
7 | 0x31, 0x61, 0x0C, 0x07, 0xA8, 0x64, 0x61, 0x27,
8 | 0x32, 0x21, 0x1E, 0x06, 0xE1, 0x76, 0x01, 0x28,
9 | 0x02, 0x01, 0x06, 0x00, 0xA3, 0xE2, 0xF4, 0xF4,
10 | 0x21, 0x61, 0x1D, 0x07, 0x82, 0x81, 0x11, 0x07,
11 | 0x23, 0x21, 0x22, 0x17, 0xA2, 0x72, 0x01, 0x17,
12 | 0x35, 0x11, 0x25, 0x00, 0x40, 0x73, 0x72, 0x01,
13 | 0xB5, 0x01, 0x0F, 0x0F, 0xA8, 0xA5, 0x51, 0x02,
14 | 0x17, 0xC1, 0x24, 0x07, 0xF8, 0xF8, 0x22, 0x12,
15 | 0x71, 0x23, 0x11, 0x06, 0x65, 0x74, 0x18, 0x16,
16 | 0x01, 0x02, 0xD3, 0x05, 0xC9, 0x95, 0x03, 0x02,
17 | 0x61, 0x63, 0x0C, 0x00, 0x94, 0xC0, 0x33, 0xF6,
18 | 0x21, 0x72, 0x0D, 0x00, 0xC1, 0xD5, 0x56, 0x06,
19 | 0x01, 0x01, 0x18, 0x0F, 0xDF, 0xF8, 0x6A, 0x6D,
20 | 0x01, 0x01, 0x00, 0x00, 0xC8, 0xD8, 0xA7, 0x68,
21 | 0x05, 0x01, 0x00, 0x00, 0xF8, 0xAA, 0x59, 0x55,
22 |
--------------------------------------------------------------------------------
/Dn-FT_VS_Dependencies.vsconfig:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "components": [
4 | "Microsoft.VisualStudio.Component.CoreEditor",
5 | "Microsoft.VisualStudio.Workload.CoreEditor",
6 | "Microsoft.VisualStudio.Component.Roslyn.Compiler",
7 | "Microsoft.Component.MSBuild",
8 | "Microsoft.VisualStudio.Component.TextTemplating",
9 | "Microsoft.VisualStudio.Component.IntelliCode",
10 | "Microsoft.VisualStudio.Component.VC.CoreIde",
11 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
12 | "Microsoft.VisualStudio.Component.Graphics.Tools",
13 | "Microsoft.VisualStudio.Component.VC.DiagnosticTools",
14 | "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
15 | "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
16 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
17 | "Microsoft.VisualStudio.Component.VC.CMake.Project",
18 | "Microsoft.VisualStudio.Component.VC.ATL",
19 | "Microsoft.VisualStudio.Component.VC.ATLMFC",
20 | "Microsoft.Component.VC.Runtime.UCRTSDK",
21 | "Microsoft.VisualStudio.Workload.NativeDesktop",
22 | "Microsoft.VisualStudio.Component.WinXP"
23 | ]
24 | }
--------------------------------------------------------------------------------
/Source/APU/residfp/version.cc:
--------------------------------------------------------------------------------
1 | // ---------------------------------------------------------------------------
2 | // This file is part of reSID, a MOS6581 SID emulator engine.
3 | // Copyright (C) 2004 Dag Lem
4 | //
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | // ---------------------------------------------------------------------------
19 |
20 | #pragma once
21 | #define __VERSION_CC__
22 | #include "siddefs-fp.h"
23 |
--------------------------------------------------------------------------------
/Source/stdafx.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | // stdafx.cpp : source file that includes just the standard includes
22 | // FamiTracker.pch will be the pre-compiled header
23 | // stdafx.obj will contain the pre-compiled type information
24 |
25 | #include "stdafx.h"
26 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/vrc7tone_ft36.h:
--------------------------------------------------------------------------------
1 | // patch set by quietust (1/18/2004), used in FamiTracker 0.3.6
2 | // Source: http://nesdev.com/cgi-bin/wwwthreads/showpost.pl?Board=NESemdev&Number=1440
3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4 | 0x03, 0x21, 0x04, 0x06, 0x8D, 0xF2, 0x42, 0x17,
5 | 0x13, 0x41, 0x05, 0x0E, 0x99, 0x96, 0x63, 0x12,
6 | 0x31, 0x11, 0x10, 0x0A, 0xF0, 0x9C, 0x32, 0x02,
7 | 0x21, 0x61, 0x1D, 0x07, 0x9F, 0x64, 0x20, 0x27,
8 | 0x22, 0x21, 0x1E, 0x06, 0xF0, 0x76, 0x08, 0x28,
9 | 0x02, 0x01, 0x06, 0x00, 0xF0, 0xF2, 0x03, 0x95,
10 | 0x21, 0x61, 0x1C, 0x07, 0x82, 0x81, 0x16, 0x07,
11 | 0x23, 0x21, 0x1A, 0x17, 0xEF, 0x82, 0x25, 0x15,
12 | 0x25, 0x11, 0x1F, 0x00, 0x86, 0x41, 0x20, 0x11,
13 | 0x85, 0x01, 0x1F, 0x0F, 0xE4, 0xA2, 0x11, 0x12,
14 | 0x07, 0xC1, 0x2B, 0x45, 0xB4, 0xF1, 0x24, 0xF4,
15 | 0x61, 0x23, 0x11, 0x06, 0x96, 0x96, 0x13, 0x16,
16 | 0x01, 0x02, 0xD3, 0x05, 0x82, 0xA2, 0x31, 0x51,
17 | 0x61, 0x22, 0x0D, 0x02, 0xC3, 0x7F, 0x24, 0x05,
18 | 0x21, 0x62, 0x0E, 0x00, 0xA1, 0xA0, 0x44, 0x17,
19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22 |
--------------------------------------------------------------------------------
/Source/APU/resid/pot.cc:
--------------------------------------------------------------------------------
1 | // ---------------------------------------------------------------------------
2 | // This file is part of reSID, a MOS6581 SID emulator engine.
3 | // Copyright (C) 2004 Dag Lem
4 | //
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 | // ---------------------------------------------------------------------------
19 |
20 | #include "pot.h"
21 |
22 | reg8 Potentiometer::readPOT()
23 | {
24 | // NB! Not modeled.
25 | return 0xff;
26 | }
27 |
--------------------------------------------------------------------------------
/Source/SequenceEditorMessage.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 | #include "WinUser.h"
26 |
27 | enum {
28 | WM_SIZE_CHANGE = WM_USER,
29 | WM_CURSOR_CHANGE,
30 | WM_SEQUENCE_CHANGED,
31 | WM_SETTING_CHANGED, // // //
32 | };
33 |
--------------------------------------------------------------------------------
/Source/CommandLineExport.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 | class CCommandLineExport
24 | {
25 | public:
26 | void CommandLineExport(const CString& fileIn, const CString& fileOut, const CString& fileLog, const CString& fileDPCM);
27 | void CommandLineMessage(std::string message); // // !!
28 | };
--------------------------------------------------------------------------------
/hlp/menu_help.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Help menu
10 |
11 |
12 | Help Topics
13 | Open the help window.
14 |
15 | Effect table
16 | Open the help window with the effect list.
17 |
18 | FAQ
19 | Open the help window with the FAQ.
20 |
21 | Performance
22 | Opens the performance dialog.
23 |
24 | About FamiTracker
25 | Open the about famitracker dialog.
26 |
27 |
28 | Back to menus · interface · main index
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Source/Exception.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | #ifndef _DEBUG
25 | // Enable crash handler
26 | #define ENABLE_CRASH_HANDLER
27 | #endif /* _DEBUG */
28 |
29 | #ifdef ENABLE_CRASH_HANDLER
30 | void InstallExceptionHandler();
31 | void UninstallExceptionHandler();
32 | #endif /* ENABLE_CRASH_HANDLER */
33 |
--------------------------------------------------------------------------------
/hlp/config_appearance.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Appearance configuration
10 |
11 |
12 | These settings are used to configure the visual appearance of the pattern editor.
13 |
14 |
15 | Two toggle options are available:
16 |
17 |
18 |
Pattern colors
19 | Check this to enable individual colors for each column. When unchecked
20 | the note/octave color will be used for all columns.
21 |
Display flats:
22 | Display notes as flats (♭) instead of sharps (♯) in the pattern editor.
23 |
24 |
25 |
26 |
27 |
28 |
29 | Back to configuration · interface · main index
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/nes_fme7.h:
--------------------------------------------------------------------------------
1 | #ifndef _NES_FME7_H_
2 | #define _NES_FME7_H_
3 | #include "../device.h"
4 | #include "legacy/emu2149.h"
5 |
6 | namespace xgm
7 | {
8 |
9 | class NES_FME7:public ISoundChip
10 | {
11 | public:
12 | enum
13 | {
14 | OPT_END
15 | };
16 | protected:
17 | //int option[OPT_END];
18 | INT32 sm[2][3]; // stereo mix
19 | INT16 buf[2];
20 | PSG *psg;
21 | int divider; // clock divider
22 | double clock, rate;
23 | TrackInfoBasic trkinfo[5];
24 | public:
25 | NES_FME7 ();
26 | ~NES_FME7 ();
27 | virtual void Reset ();
28 | virtual void Tick (UINT32 clocks);
29 | virtual UINT32 Render (INT32 b[2]);
30 | virtual bool Read (UINT32 adr, UINT32 & val, UINT32 id=0);
31 | virtual bool Write (UINT32 adr, UINT32 val, UINT32 id=0);
32 | virtual void SetClock (double);
33 | virtual void SetRate (double);
34 | virtual void SetOption (int, int);
35 | virtual void SetMask (int m){ if(psg) PSG_setMask(psg,m); }
36 | virtual void SetStereoMix (int trk, xgm::INT16 mixl, xgm::INT16 mixr);
37 | virtual ITrackInfo *GetTrackInfo(int trk);
38 | };
39 |
40 | } // namespace
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/Source/NoNotifyEdit.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "NoNotifyEdit.h"
3 | // Credit: http://www.flounder.com/avoid_en_change.htm
4 | // and http://read.pudn.com/downloads190/sourcecode/windows/other/893682/mvp_tips/fp/NoNotifyEdit.cpp__.htm
5 | // and http://read.pudn.com/downloads190/sourcecode/windows/other/893682/mvp_tips/fp/NoNotifyEdit.h__.htm
6 | // https://www.codeproject.com/Articles/480/Create-your-own-controls-the-art-of-subclassing
7 | // http://forums.codeguru.com/showthread.php?234616-Subclassing-vs-Inheriting-in-MFC&p=692308#post692308
8 |
9 | // https://stackoverflow.com/questions/8428288/using-derived-class-from-cedit-in-my-dialog
10 |
11 | IMPLEMENT_DYNAMIC(NoNotifyEdit, CEdit)
12 |
13 | NoNotifyEdit::NoNotifyEdit() {
14 | notify = true;
15 | }
16 |
17 | BEGIN_MESSAGE_MAP(NoNotifyEdit, CEdit)
18 | ON_CONTROL_REFLECT_EX(EN_CHANGE, OnEnChange)
19 | END_MESSAGE_MAP()
20 |
21 | void NoNotifyEdit::SetWindowTextNoNotify(LPCTSTR s) {
22 | CString old;
23 | CEdit::GetWindowText(old);
24 | if (old == s)
25 | return; // do nothing, already set
26 | bool previous = notify;
27 | notify = false;
28 | CEdit::SetWindowText(s);
29 | notify = previous;
30 | }
31 |
32 | afx_msg BOOL NoNotifyEdit::OnEnChange() {
33 | return !notify;
34 | }
--------------------------------------------------------------------------------
/Source/ChannelFactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "Factory.h"
27 | #include "APU/Types.h"
28 |
29 | class CChannelHandler;
30 |
31 | class CChannelFactory : public CFactory
32 | {
33 | public:
34 | CChannelFactory();
35 | };
36 |
--------------------------------------------------------------------------------
/Source/type_safe/detail/is_nothrow_swappable.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2016-2018 Jonathan Müller
2 | // This file is subject to the license terms in the LICENSE file
3 | // found in the top-level directory of this distribution.
4 |
5 | #ifndef TYPE_SAFE_DETAIL_IS_NOTHROW_SWAPABLE_HPP_INCLUDED
6 | #define TYPE_SAFE_DETAIL_IS_NOTHROW_SWAPABLE_HPP_INCLUDED
7 |
8 | #include
9 |
10 | namespace type_safe
11 | {
12 | namespace detail
13 | {
14 | template
15 | struct is_nothrow_swappable
16 | {
17 | template
18 | static auto adl_swap(int, U& a, U& b) noexcept(noexcept(swap(a, b)))
19 | -> decltype(swap(a, b));
20 |
21 | template
22 | static auto adl_swap(short, U& a, U& b) noexcept(noexcept(std::swap(a, b)))
23 | -> decltype(std::swap(a, b));
24 |
25 | static void adl_swap(...) noexcept(false);
26 |
27 | static constexpr bool value =
28 | noexcept(adl_swap(0, std::declval(), std::declval()));
29 | };
30 | }
31 | } // namespace type_safe::detail
32 |
33 | #endif // TYPE_SAFE_DETAIL_IS_NOTHROW_SWAPABLE_HPP_INCLUDED
34 |
--------------------------------------------------------------------------------
/Source/APU/resid/pot.h:
--------------------------------------------------------------------------------
1 | // ---------------------------------------------------------------------------
2 | // This file is part of reSID, a MOS6581 SID emulator engine.
3 | // Copyright (C) 2004 Dag Lem
4 | //
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 | // ---------------------------------------------------------------------------
19 |
20 | #ifndef __POT_H__
21 | #define __POT_H__
22 |
23 | #include "siddefs.h"
24 |
25 | class RESID_API Potentiometer
26 | {
27 | public:
28 | reg8 readPOT();
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Source/type_safe/detail/assign_or_construct.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2016-2018 Jonathan Müller
2 | // This file is subject to the license terms in the LICENSE file
3 | // found in the top-level directory of this distribution.
4 |
5 | #ifndef TYPE_SAFE_DETAIL_ASSIGN_OR_CONSTRUCT_HPP_INCLUDED
6 | #define TYPE_SAFE_DETAIL_ASSIGN_OR_CONSTRUCT_HPP_INCLUDED
7 |
8 | #include
9 |
10 | namespace type_safe
11 | {
12 | namespace detail
13 | {
14 | // std::is_assignable but without user-defined conversions
15 | template
16 | struct is_direct_assignable
17 | {
18 | template
19 | struct consume_udc
20 | {
21 | operator U() const;
22 | };
23 |
24 | template
25 | static std::true_type check(
26 | decltype(std::declval() = std::declval>(), 0) *);
27 |
28 | template
29 | static std::false_type check(...);
30 |
31 | static constexpr bool value = decltype(check(0))::value;
32 | };
33 | }
34 | } // namespace type_safe::detail
35 |
36 | #endif // TYPE_SAFE_DETAIL_ASSIGN_OR_CONSTRUCT_HPP_INCLUDED
37 |
--------------------------------------------------------------------------------
/Source/InstrumentVRC6.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 |
26 | class CInstrumentVRC6 : public CSeqInstrument {
27 | public:
28 | CInstrumentVRC6() : CSeqInstrument(INST_VRC6) {};
29 |
30 | public:
31 | static LPCTSTR SEQUENCE_NAME[];
32 | LPCTSTR GetSequenceName(int Index) const { return SEQUENCE_NAME[Index]; } // // //
33 | };
34 |
--------------------------------------------------------------------------------
/Source/InstrumentS5B.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 |
26 | class CInstrumentS5B : public CSeqInstrument {
27 | public:
28 | CInstrumentS5B() : CSeqInstrument(INST_S5B) {}; // // //
29 |
30 | public:
31 | static LPCTSTR SEQUENCE_NAME[];
32 | LPCTSTR GetSequenceName(int Index) const { return SEQUENCE_NAME[Index]; } // // //
33 | };
34 |
--------------------------------------------------------------------------------
/Source/InstrumentS5B.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | // // // CInstrumentS5B is a subtype of CSeqInstrument.
24 | #include "stdafx.h" // CFile
25 | #include "Instrument.h"
26 | #include "SeqInstrument.h"
27 | #include "InstrumentS5B.h"
28 |
29 | LPCTSTR CInstrumentS5B::SEQUENCE_NAME[] = {_T("Volume"), _T("Arpeggio"), _T("Pitch"), _T("Hi-pitch"), _T("Noise / Mode")};
30 |
--------------------------------------------------------------------------------
/Source/InstrumentVRC6.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | // // // CInstrumentVRC6 is a subtype of CSeqInstrument.
24 | #include "stdafx.h" // CFile
25 | #include "Instrument.h"
26 | #include "SeqInstrument.h"
27 | #include "InstrumentVRC6.h"
28 |
29 | LPCTSTR CInstrumentVRC6::SEQUENCE_NAME[] = {_T("Volume"), _T("Arpeggio"), _T("Pitch"), _T("Hi-pitch"), _T("Pulse Width")};
30 |
--------------------------------------------------------------------------------
/Source/PatternComponent.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2015 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "PatternComponent.h"
24 |
25 | // // // 050B
26 |
27 | CPatternComponent::CPatternComponent(int Arg1) :
28 | m_i002C(Arg1)
29 | {
30 | }
31 |
32 | CPatternComponent::~CPatternComponent()
33 | {
34 | }
35 |
36 | bool CPatternComponent::ContainsPoint(const CPoint &point) const
37 | {
38 | return false;
39 | }
40 |
--------------------------------------------------------------------------------
/cmake/compile-chm.bat:
--------------------------------------------------------------------------------
1 | rem call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
2 | @echo off
3 | echo // Generated Help Map file. Used by Dn-FamiTracker.HHP. > "hlp\HTMLDefines.h"
4 | echo. > "hlp\HTMLDefines.h"
5 | echo // Commands (ID_* and IDM_*) >> "hlp\HTMLDefines.h"
6 | makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 "resource.h" >> "hlp\HTMLDefines.h"
7 | echo. >> "hlp\HTMLDefines.h"
8 | echo // Prompts (IDP_*) >> "hlp\HTMLDefines.h"
9 | makehm /h IDP_,HIDP_,0x30000 "resource.h" >> "hlp\HTMLDefines.h"
10 | echo. >> "hlp\HTMLDefines.h"
11 | echo // Resources (IDR_*) >> "hlp\HTMLDefines.h"
12 | makehm /h IDR_,HIDR_,0x20000 "resource.h" >> "hlp\HTMLDefines.h"
13 | echo. >> "hlp\HTMLDefines.h"
14 | echo // Dialogs (IDD_*) >> "hlp\HTMLDefines.h"
15 | makehm /h IDD_,HIDD_,0x20000 "resource.h" >> "hlp\HTMLDefines.h"
16 | echo. >> "hlp\HTMLDefines.h"
17 | echo // Frame Controls (IDW_*) >> "hlp\HTMLDefines.h"
18 | makehm /h /a "afxhh.h" IDW_,HIDW_,0x50000 "resource.h" >> "hlp\HTMLDefines.h"
19 | start /wait hhc "hlp\Dn-FamiTracker.hhp"
20 | if not exist "hlp\Dn-FamiTracker.chm" goto :HelpError
21 | move "hlp\Dn-FamiTracker.chm" "Dn-FamiTracker.chm"
22 | goto :HelpDone
23 | :HelpError
24 | echo hlp\Dn-FamiTracker.hhp(1) : error:Problem encountered creating help file
25 | echo.
26 | :HelpDone
27 | echo.
--------------------------------------------------------------------------------
/Source/type_safe/detail/assert.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2016-2018 Jonathan Müller
2 | // This file is subject to the license terms in the LICENSE file
3 | // found in the top-level directory of this distribution.
4 |
5 | #ifndef TYPE_SAFE_DETAIL_ASSERT_HPP_INCLUDED
6 | #define TYPE_SAFE_DETAIL_ASSERT_HPP_INCLUDED
7 |
8 | #include
9 |
10 | #include
11 |
12 | namespace type_safe
13 | {
14 | namespace detail
15 | {
16 | struct assert_handler : debug_assert::set_level,
17 | debug_assert::default_handler
18 | {
19 | };
20 |
21 | struct precondition_error_handler
22 | : debug_assert::set_level,
23 | debug_assert::default_handler
24 | {
25 | };
26 |
27 | inline void on_disabled_exception() noexcept
28 | {
29 | struct handler : debug_assert::set_level<1>, debug_assert::default_handler
30 | {
31 | };
32 | DEBUG_UNREACHABLE(handler{},
33 | "attempt to throw an exception but exceptions are disabled");
34 | }
35 | } // namespace detail
36 | } // namespace type_safe
37 |
38 | #endif // TYPE_SAFE_DETAIL_ASSERT_HPP_INCLUDED`
39 |
--------------------------------------------------------------------------------
/Source/gsl/gsl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (c) 2015 Microsoft Corporation. All rights reserved.
4 | //
5 | // This code is licensed under the MIT License (MIT).
6 | //
7 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
10 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
13 | // THE SOFTWARE.
14 | //
15 | ///////////////////////////////////////////////////////////////////////////////
16 |
17 | #ifndef GSL_GSL_H
18 | #define GSL_GSL_H
19 |
20 | #include // copy
21 | #include // Ensures/Expects
22 | #include // byte
23 | #include // finally()/narrow()/narrow_cast()...
24 | #include // multi_span, strided_span...
25 | #include // owner, not_null
26 | #include // span
27 | #include // zstring, string_span, zstring_builder...
28 |
29 | #endif // GSL_GSL_H
30 |
--------------------------------------------------------------------------------
/Source/APU/residfp/Voice.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of libsidplayfp, a SID player engine.
3 | *
4 | * Copyright 2011-2015 Leandro Nini
5 | * Copyright 2007-2010 Antti Lankila
6 | *
7 | * This program is free software; you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation; either version 2 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 | */
21 | #pragma once
22 |
23 | #include "Voice.h"
24 |
25 | #include
26 | #include
27 |
28 | namespace reSIDfp
29 | {
30 |
31 |
32 | int Voice::output(const WaveformGenerator* ringModulator) const
33 | {
34 | return static_cast(waveformGenerator->output(ringModulator) * envelopeGenerator->output());
35 | }
36 |
37 | } // namespace reSIDfp
38 |
--------------------------------------------------------------------------------
/Source/WaveFile.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | #include "stdafx.h" // // //
25 | #include
26 |
27 | class CWaveFile
28 | {
29 | public:
30 | bool OpenFile(LPTSTR Filename, int SampleRate, int SampleSize, int Channels);
31 | void CloseFile();
32 | void WriteWave(char *Data, int Size);
33 |
34 | private:
35 | PCMWAVEFORMAT WaveFormat;
36 | MMCKINFO ckOutRIFF, ckOut;
37 | MMIOINFO mmioinfoOut;
38 | HMMIO hmmioOut;
39 |
40 | };
41 |
42 |
--------------------------------------------------------------------------------
/hlp/config_mixer.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Mixer configuration
10 |
11 |
This allows you to confgure the mixing levels of the emulated audio hardware. This option is provided because
12 | the mixing levels could vary on different types of hardware (such as different models of the Famicom or different versions
13 | of game carts), it allows you to fine tune the audio emulation against a specific
14 | set of hardware.
15 |
Before changing these settings, please be aware that mixing levels are not stored in the NSF format and
16 | that your song could be played back with any configuration of mixing levels!
17 |
APU1 is the first audio out pin (pulse 1 & 2) and APU2 is the second audio out pin (triangle, noise & DPCM),
18 | the rest are the expansion chips. The sliders ranges from -12 dB to +12 dB, the default
19 | value is 0 dB for all sliders.
20 |
21 |
22 | Back to configuration · interface · main index
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Source/InstHandlerDPCM.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "InstHandler.h"
27 |
28 | class CInstHandlerDPCM : public CInstHandler
29 | {
30 | public:
31 | CInstHandlerDPCM(CChannelHandlerInterface *pInterface);
32 | void LoadInstrument(std::shared_ptr pInst) override;
33 | void TriggerInstrument() override;
34 | void ReleaseInstrument() override;
35 | void UpdateInstrument() override;
36 | };
37 |
--------------------------------------------------------------------------------
/Source/SequenceManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 | class CSequenceCollection;
26 |
27 | class CSequenceManager
28 | {
29 | public:
30 | CSequenceManager(int Count);
31 | int GetCount() const;
32 | CSequenceCollection *GetCollection(unsigned int Type);
33 | const CSequenceCollection *GetCollection(unsigned int Type) const;
34 | private:
35 | std::vector> m_pCollection;
36 | };
37 |
--------------------------------------------------------------------------------
/Source/FamiTrackerViewMessage.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "WinUser.h"
27 |
28 | // Custom window messages for CFamiTrackerView
29 | enum {
30 | WM_USER_PLAYER = WM_USER, // Pattern play row has changed
31 | WM_USER_MIDI_EVENT, // There is a new MIDI command
32 | WM_USER_NOTE_EVENT, // There is a new note command (by player)
33 | WM_USER_DUMP_INST, // // // End of track, add instrument
34 | };
35 |
--------------------------------------------------------------------------------
/Source/Common.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 | #include
24 |
25 | #define _MAIN_H_
26 |
27 | #define SAMPLES_IN_BYTES(x) (x << SampleSizeShift)
28 |
29 |
30 | enum decay_rate_t { // // // 050B
31 | DECAY_SLOW,
32 | DECAY_FAST
33 | };
34 |
35 | // Used to get the DPCM state
36 | struct stDPCMState {
37 | int SamplePos;
38 | int DeltaCntr;
39 | };
40 |
41 | // Used to play the audio when the buffer is full
42 | class IAudioCallback {
43 | public:
44 | virtual void FlushBuffer(int16_t const * Buffer, uint32_t Size) = 0;
45 | };
46 |
--------------------------------------------------------------------------------
/hlp/interface.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Interface
10 |
11 |
12 | This chapter describes the different parts of the program interface.
29 |
30 |
31 | Back to main index
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Source/ConfigWindow.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2012 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 | #include "ConfigGeneral.h"
24 | #include "ConfigAppearance.h"
25 |
26 | // CConfigWindow
27 |
28 | class CConfigWindow : public CPropertySheet
29 | {
30 | DECLARE_DYNAMIC(CConfigWindow)
31 |
32 | public:
33 | CConfigWindow(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
34 | CConfigWindow(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
35 | virtual ~CConfigWindow();
36 |
37 | protected:
38 | DECLARE_MESSAGE_MAP()
39 | public:
40 | void SetupPages(void);
41 | };
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Source/DialogReBar.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // COctaveDlgBar dialog
25 |
26 | class CDialogReBar : public CDialogBar
27 | {
28 | DECLARE_DYNAMIC(CDialogReBar)
29 |
30 | public:
31 | CDialogReBar(CWnd* pParent = NULL); // standard constructor
32 | virtual ~CDialogReBar();
33 |
34 | // Dialog Data
35 | enum { IDD = IDD_OCTAVE };
36 |
37 | protected:
38 | DECLARE_MESSAGE_MAP()
39 | public:
40 | afx_msg BOOL OnEraseBkgnd(CDC* pDC);
41 | afx_msg void OnMove(int x, int y);
42 | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
43 | };
44 |
--------------------------------------------------------------------------------
/Source/DPI.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | class CPoint;
27 |
28 | struct DPI // // //
29 | {
30 | // DPI scaling functions
31 | static int SX(int pt);
32 | static int SY(int pt);
33 | static void ScaleMouse(CPoint &pt);
34 | static void ScaleRect(CRect &r); // // //
35 |
36 | static CRect Rect(int x, int y, int w, int h); // // //
37 |
38 | static void SetScale(int X, int Y); // // //
39 | private:
40 | // DPI variables
41 | static const int DEFAULT_DPI;
42 | static int _dpiX, _dpiY;
43 | };
44 |
--------------------------------------------------------------------------------
/Source/SeqInstHandlerSawtooth.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "stdafx.h"
24 | #include "Sequence.h"
25 | #include "ChannelHandlerInterface.h"
26 | #include "SeqInstHandlerSawtooth.h"
27 |
28 | void CSeqInstHandlerSawtooth::TriggerInstrument()
29 | {
30 | CSeqInstHandler::TriggerInstrument();
31 | m_bIgnoreDuty = m_pSequence[SEQ_VOLUME] != nullptr &&
32 | m_pSequence[SEQ_VOLUME]->GetSetting() == SETTING_VOL_64_STEPS;
33 | }
34 |
35 | bool CSeqInstHandlerSawtooth::IsDutyIgnored() const
36 | {
37 | return m_bIgnoreDuty;
38 | }
39 |
--------------------------------------------------------------------------------
/Source/VisualizerStatic.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 |
22 | #pragma once
23 |
24 | #include "VisualizerBase.h" // // //
25 |
26 | // CVisualizerStatic, static picture visualizer
27 |
28 | class CVisualizerStatic : public CVisualizerBase
29 | {
30 | public:
31 | CVisualizerStatic() = default;
32 | ~CVisualizerStatic();
33 |
34 | void SetSampleRate(int SampleRate) override;
35 | void Draw() override;
36 |
37 | private:
38 | void DrawChar(char n, int xPos, int yPos, const COLORREF &Color); // // //
39 |
40 | CBitmap m_bmpImage;
41 | CBitmap *m_pOldBmp = nullptr;
42 | CDC m_dcImage;
43 | };
44 |
--------------------------------------------------------------------------------
/Source/drivers/asm/vibrato.s:
--------------------------------------------------------------------------------
1 | ; Vibrato table (256 bytes)
2 | ft_vibrato_table: ;; Patch
3 | .byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
4 | .byte $00, $00, $00, $00, $00, $00, $00, $00, $01, $01, $01, $01, $01, $01, $01, $01
5 | .byte $00, $00, $00, $00, $00, $01, $01, $01, $01, $01, $02, $02, $02, $02, $02, $02
6 | .byte $00, $00, $00, $01, $01, $01, $02, $02, $02, $03, $03, $03, $03, $03, $03, $03
7 | .byte $00, $00, $00, $01, $01, $02, $02, $03, $03, $03, $04, $04, $04, $04, $04, $04
8 | .byte $00, $00, $01, $02, $02, $03, $03, $04, $04, $05, $05, $06, $06, $06, $06, $06
9 | .byte $00, $00, $01, $02, $03, $04, $05, $06, $07, $07, $08, $08, $09, $09, $09, $09
10 | .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $09, $0A, $0B, $0B, $0B, $0B
11 | .byte $00, $01, $02, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0C, $0D, $0D, $0D
12 | .byte $00, $01, $03, $04, $06, $08, $09, $0A, $0C, $0D, $0E, $0E, $0F, $10, $10, $10
13 | .byte $00, $02, $04, $06, $08, $0A, $0C, $0D, $0F, $11, $12, $13, $14, $15, $15, $15
14 | .byte $00, $02, $05, $08, $0B, $0E, $10, $13, $15, $17, $18, $1A, $1B, $1C, $1D, $1D
15 | .byte $00, $04, $08, $0C, $10, $14, $18, $1B, $1F, $22, $24, $26, $28, $2A, $2B, $2B
16 | .byte $00, $06, $0C, $12, $18, $1E, $23, $28, $2D, $31, $35, $38, $3B, $3D, $3E, $3F
17 | .byte $00, $09, $12, $1B, $24, $2D, $35, $3C, $43, $4A, $4F, $54, $58, $5B, $5E, $5F
18 | .byte $00, $0C, $18, $25, $30, $3C, $47, $51, $5A, $62, $6A, $70, $76, $7A, $7D, $7F
19 |
--------------------------------------------------------------------------------
/Source/Groove.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2015 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routin, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 | #define MAX_GROOVE_SIZE 128
26 |
27 | class CGroove
28 | {
29 | public:
30 | CGroove(int Speed = 0);
31 |
32 | void Copy(const CGroove *Source);
33 | void Clear(unsigned char Speed);
34 | unsigned char GetEntry(int Index) const;
35 | void SetEntry(unsigned char Index, unsigned char Value);
36 | unsigned char GetSize() const;
37 | void SetSize(unsigned char Size);
38 | float GetAverage() const;
39 | private:
40 | unsigned char m_iLength;
41 | unsigned char m_iEntry[MAX_GROOVE_SIZE];
42 | };
--------------------------------------------------------------------------------
/Source/APU/resid/README:
--------------------------------------------------------------------------------
1 | This is reSID, a reverse engineered software emulation of the MOS6581 SID
2 | (Sound Interface Device). This chip was used in the Commodore 64 computer.
3 |
4 | reSID is free software. See the file COPYING for copying permission.
5 |
6 | reSID is a C++ library containing a complete emulation of the SID chip.
7 | This library can be linked into programs emulating the MOS6510 MPU to
8 | play music made for the Commodore 64 computer. reSID has been successfully
9 | linked into VICE, a full-fledged Commodore 64 emulator, and SIDPLAY, a
10 | popular SID tune player. The VICE home page is:
11 | http://www.viceteam.org/
12 | A patch for SIDPLAY can be found on the SIDPLAY home page:
13 | http://www.geocities.com/SiliconValley/Lakes/5147/
14 |
15 | Various SID emulators exist, however reSID should still be of great
16 | interest to Commodore 64 nostalgics. The emulator engine is cycle-based,
17 | emulating the internal operations of the SID chip. SID's audio filter is
18 | modeled as an actual two-integrator-loop biquadratic filter circuit.
19 | The engine has been developed based on available information on SID, sampling
20 | of the OSC3 and ENV3 registers, filter theory, and meticulous testing.
21 | In short, a scientific approach has been taken to model the SID chip as
22 | accurately as possible.
23 |
24 | To our knowledge reSID is by far the most accurate SID emulator ever created.
25 | This comes at a price; what is considered a fairly fast CPU at the time of
26 | this writing is needed to run the emulator.
27 |
--------------------------------------------------------------------------------
/Source/ChannelState.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include
24 | #include "ChannelState.h"
25 |
26 | stChannelState::stChannelState() :
27 | ChannelIndex(-1),
28 | Instrument(MAX_INSTRUMENTS),
29 | Volume(MAX_VOLUME),
30 | Effect_LengthCounter(-1),
31 | Effect_AutoFMMult(-1)
32 | {
33 | memset(Effect, -1, EF_COUNT * sizeof(int));
34 | memset(Echo, -1, ECHO_BUFFER_LENGTH * sizeof(int));
35 | }
36 |
37 | stFullState::stFullState(int Count) :
38 | State(new stChannelState[Count]()),
39 | Tempo(-1),
40 | Speed(-1),
41 | GroovePos(-1)
42 | {
43 | }
44 |
--------------------------------------------------------------------------------
/Source/CustomExporters.cpp:
--------------------------------------------------------------------------------
1 | #include "CustomExporters.h"
2 |
3 | CCustomExporters::CCustomExporters( CString PluginPath )
4 | : m_currentExporter( NULL )
5 | {
6 | FindCustomExporters( PluginPath );
7 | }
8 |
9 | CCustomExporters::~CCustomExporters( void )
10 | {
11 |
12 | }
13 |
14 | void CCustomExporters::GetNames( CStringArray& names ) const
15 | {
16 | names.RemoveAll();
17 | for( int i = 0; i < m_customExporters.GetCount(); ++i )
18 | {
19 | names.Add( m_customExporters[ i ].getName() );
20 | }
21 | }
22 |
23 | void CCustomExporters::SetCurrentExporter( CString name )
24 | {
25 | for( int i = 0; i < m_customExporters.GetCount(); ++i )
26 | {
27 | if( m_customExporters[ i ].getName() == name )
28 | {
29 | m_currentExporter = &m_customExporters[ i ];
30 | break;
31 | }
32 | }
33 | }
34 |
35 | CCustomExporter& CCustomExporters::GetCurrentExporter( void ) const
36 | {
37 | return *m_currentExporter;
38 | }
39 |
40 | void CCustomExporters::FindCustomExporters( CString PluginPath )
41 | {
42 | CFileFind finder;
43 |
44 | CString path = PluginPath + _T("\\*.dll");
45 | BOOL bWorking = finder.FindFile( path );
46 | while (bWorking)
47 | {
48 | bWorking = finder.FindNextFile();
49 | CString fileName = finder.GetFileName();
50 | CString filePath = finder.GetFilePath();
51 |
52 | CCustomExporter customExporter;
53 |
54 | if( customExporter.load( filePath ) )
55 | {
56 | m_customExporters.Add( customExporter );
57 | }
58 |
59 | //AfxMessageBox(finder.GetFileName());
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Source/InstHandlerVRC7.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "InstHandler.h"
27 |
28 | class CInstHandlerVRC7 : public CInstHandler
29 | {
30 | public:
31 | CInstHandlerVRC7(CChannelHandlerInterface *pInterface, int Vol) :
32 | CInstHandler(pInterface, Vol, Vol) { }
33 | void LoadInstrument(std::shared_ptr pInst) override;
34 | void TriggerInstrument() override;
35 | void ReleaseInstrument() override;
36 | void UpdateInstrument() override;
37 | private:
38 | void UpdateRegs();
39 | bool m_bUpdate = false;
40 | };
41 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/legacy/2413tone.h:
--------------------------------------------------------------------------------
1 | /* YM2413 tone by Mitsutaka Okazaki, 2020 */
2 | /* https://github.com/digital-sound-antiques/emu2413/blob/d2b9c8dfc5e84b7f8a535fdfee0149ac7bd84ca2/emu2413.c#L34
3 | */
4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0: Original
5 | 0x71, 0x61, 0x1e, 0x17, 0xd0, 0x78, 0x00, 0x17, // 1: Violin
6 | 0x13, 0x41, 0x1a, 0x0d, 0xd8, 0xf7, 0x23, 0x13, // 2: Guitar
7 | 0x13, 0x01, 0x99, 0x00, 0xf2, 0xc4, 0x21, 0x23, // 3: Piano
8 | 0x11, 0x61, 0x0e, 0x07, 0x8d, 0x64, 0x70, 0x27, // 4: Flute
9 | 0x32, 0x21, 0x1e, 0x06, 0xe1, 0x76, 0x01, 0x28, // 5: Clarinet
10 | 0x31, 0x22, 0x16, 0x05, 0xe0, 0x71, 0x00, 0x18, // 6: Oboe
11 | 0x21, 0x61, 0x1d, 0x07, 0x82, 0x81, 0x11, 0x07, // 7: Trumpet
12 | 0x33, 0x21, 0x2d, 0x13, 0xb0, 0x70, 0x00, 0x07, // 8: Organ
13 | 0x61, 0x61, 0x1b, 0x06, 0x64, 0x65, 0x10, 0x17, // 9: Horn
14 | 0x41, 0x61, 0x0b, 0x18, 0x85, 0xf0, 0x81, 0x07, // A: Synthesizer
15 | 0x33, 0x01, 0x83, 0x11, 0xea, 0xef, 0x10, 0x04, // B: Harpsichord
16 | 0x17, 0xc1, 0x24, 0x07, 0xf8, 0xf8, 0x22, 0x12, // C: Vibraphone
17 | 0x61, 0x50, 0x0c, 0x05, 0xd2, 0xf5, 0x40, 0x42, // D: Synthsizer Bass
18 | 0x01, 0x01, 0x55, 0x03, 0xe9, 0x90, 0x03, 0x02, // E: Acoustic Bass
19 | 0x41, 0x41, 0x89, 0x03, 0xf1, 0xe4, 0xc0, 0x13, // F: Electric Guitar
20 | 0x01, 0x01, 0x18, 0x0f, 0xdf, 0xf8, 0x6a, 0x6d, // R: Bass Drum (from VRC7)
21 | 0x01, 0x01, 0x00, 0x00, 0xc8, 0xd8, 0xa7, 0x68, // R: High-Hat(M) / Snare Drum(C) (from VRC7)
22 | 0x05, 0x01, 0x00, 0x00, 0xf8, 0xaa, 0x59, 0x55, // R: Tom-tom(M) / Top Cymbal(C) (from VRC7)
23 |
--------------------------------------------------------------------------------
/Source/Clipboard.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // Clipboard wrapper class, using this ensures that clipboard is closed when finished
25 | class CClipboard
26 | {
27 | public:
28 | CClipboard(CWnd *pWnd, UINT clipboardFormat);
29 | ~CClipboard();
30 |
31 | bool IsOpened() const;
32 | HGLOBAL AllocMem(UINT Size) const;
33 | void SetData(HGLOBAL hMemory) const;
34 | bool SetDataPointer(LPVOID pData, UINT Size) const;
35 | bool GetData(HGLOBAL &hMemory) const; // // //
36 | LPVOID GetDataPointer();
37 | bool IsDataAvailable()const;
38 |
39 | private:
40 | bool m_bOpened;
41 | UINT mClipboardFormat;
42 | HGLOBAL m_hMemory;
43 | };
44 |
--------------------------------------------------------------------------------
/Source/DSampleManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "DSample.h"
27 |
28 | class CDSampleManager
29 | {
30 | public:
31 | CDSampleManager();
32 | const CDSample *GetDSample(unsigned Index) const;
33 | bool SetDSample(unsigned Index, CDSample *pSamp);
34 | bool IsSampleUsed(unsigned Index) const;
35 | unsigned int GetSampleCount() const;
36 | unsigned int GetFirstFree() const;
37 | unsigned int GetTotalSize() const;
38 | static const unsigned MAX_DSAMPLES;
39 | private:
40 | std::vector> m_pDSample;
41 | unsigned int m_iTotalSize;
42 | };
43 |
--------------------------------------------------------------------------------
/Source/OldSequence.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | // moved from stSequence
27 |
28 | class CSequence;
29 |
30 | class COldSequence
31 | {
32 | public:
33 | COldSequence();
34 | void AddItem(char len, char val);
35 | unsigned int GetLength() const;
36 | CSequence *Convert(int Type) const;
37 | std::vector Length;
38 | std::vector Value;
39 | };
40 |
41 | /*
42 | // Old sequence list, kept for compability
43 | struct stSequence {
44 | unsigned int Count;
45 | signed char Length[CSequence::MAX_SEQUENCE_ITEMS];
46 | signed char Value[MAX_SEQUENCE_ITEMS];
47 | };
48 | */
49 |
--------------------------------------------------------------------------------
/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 | #include "name.h"
25 |
26 |
27 | #define STR_HELPER(x) #x
28 | #define STR(x) STR_HELPER(x)
29 |
30 |
31 | // Define this for beta builds
32 | // #define WIP
33 |
34 |
35 | #define VERSION_API 0
36 | #define VERSION_MAJ 0
37 | #define VERSION_MIN 1
38 | #define VERSION_REV 4
39 |
40 | #define VERSION VERSION_API,VERSION_MAJ,VERSION_MIN,VERSION_REV
41 |
42 | #define VERSION_STR \
43 | STR(VERSION_API) "." \
44 | STR(VERSION_MAJ) "." \
45 | STR(VERSION_MIN) "." \
46 | STR(VERSION_REV)
47 |
48 |
49 | #define APP_NAME_VERSION APP_NAME " " VERSION_STR ".11a"
50 |
--------------------------------------------------------------------------------
/hlp/mmc5.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Nintendo MMC5
10 |
11 |
12 |
About
13 |
14 |
15 | The MMC5 contains two pulse wave channels that are identical to the
16 | internal pulse channels, except that the two hardware sweep units are missing. It also has an 8-bit DAC, for PCM playback, which is not supported in Famitracker. Playing samples through the MMC5 DAC or the 7-bit mode of the DPCM DAC requires constant attention from the emulated CPU core. This isn't practical with the FamiTracker driver or most drivers used in games.
17 |
18 |
19 |
20 |
A notable game using the MMC5 is Shin 4 -Jin Uchi Mahjong, which also utilized the PCM channel.
21 | Duplicate Patterns
22 | Inserts a new frame with copies of all patterns.
23 |
24 | Move Frame Up
25 | Moves selected frame up one step.
26 |
27 | Move Frame Down
28 | Moves selected frame down one step.
29 |
30 | Comments
31 | Open the module comments dialog.
32 |
33 | Module Properties
34 | Open the module properties dialog.
35 |
36 |
37 | Back to interface · main index
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Source/APU/SoundChip2.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "../stdafx.h"
24 | #include "SoundChip2.h"
25 | #include "../RegisterState.h"
26 |
27 | CSoundChip2::CSoundChip2() :
28 | m_pRegisterLogger(std::make_unique())
29 | {
30 | }
31 |
32 | double CSoundChip2::GetFreq(int Channel) const // // //
33 | {
34 | return 0.0;
35 | }
36 |
37 | void CSoundChip2::Log(uint16_t Address, uint8_t Value) // // //
38 | {
39 | // default logger operation
40 | if (m_pRegisterLogger->SetPort(Address))
41 | m_pRegisterLogger->Write(Value);
42 | }
43 |
44 | CRegisterLogger* CSoundChip2::GetRegisterLogger() const // // //
45 | {
46 | return m_pRegisterLogger.get();
47 | }
48 |
--------------------------------------------------------------------------------
/Source/VisualizerScope.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 |
22 | #pragma once
23 |
24 | #include "VisualizerBase.h" // // //
25 |
26 | // CVisualizerScope, scope style visualizer
27 |
28 | class CVisualizerScope : public CVisualizerBase
29 | {
30 | public:
31 | CVisualizerScope(bool bBlur);
32 | virtual ~CVisualizerScope();
33 |
34 | void Create(int Width, int Height) override;
35 | void SetSampleRate(int SampleRate) override;
36 | void Draw() override;
37 | void Display(CDC *pDC, bool bPaintMsg) override;
38 |
39 | private:
40 | void RenderBuffer();
41 | void ClearBackground();
42 |
43 | private:
44 | int m_iWindowBufPtr;
45 | short *m_pWindowBuf;
46 | bool m_bBlur;
47 |
48 | #ifdef _DEBUG
49 | int m_iPeak;
50 | #endif
51 | };
52 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/CPU/5e01_cpu.h:
--------------------------------------------------------------------------------
1 | #ifndef _I5E01_CPU_H_
2 | #define _I5E01_CPU_H_
3 | #include "../device.h"
4 |
5 | #define ILLEGAL_OPCODES 1
6 | #define DISABLE_DECIMAL 1
7 | #define USE_DIRECT_ZEROPAGE 0
8 | #define USE_CALLBACK 1
9 | #define USE_INLINEMMC 0
10 | #define USE_USERPOINTER 1
11 | #define External __inline
12 |
13 | namespace xgm
14 | {
15 |
16 | /// Class I5E01_CPU has been stubbed out in exotracker (compared to nsfplay).
17 | /// This is because exotracker does not emulate the I5E01 6502 CPU,
18 | /// but (like Famitracker) implements sound driver logic (generates register writes)
19 | /// using C++ host code.
20 | ///
21 | /// Not emulating a 6502 may reduce host CPU usage compared to nsfplay.
22 | ///
23 | /// Stubbing out the I5E01 CPU reduces exotracker's dependencies on nsfplay,
24 | /// simplifies exotracker code, and makes compiliation faster.
25 | ///
26 | /// But it's difficult to delete I5E01_CPU
27 | /// because I5E01_DMC and I5E01_MMC5 each hold a pointer to it.
28 | ///
29 | /// - I5E01_DMC tells I5E01_CPU to delay reads, which is inconsequential.
30 | /// - I5E01_MMC5 depends on I5E01_CPU::Read() for PCM playback
31 | /// which FamiTracker does not support, and I may not either.
32 | /// I may eventually edit I5E01_MMC5 to remove PCM playback
33 | /// and not call I5E01_CPU::Read().
34 | class I5E01_CPU
35 | {
36 | public:
37 | void StealCycles(unsigned int cycles) {}
38 |
39 | // IRQ devices
40 | enum {
41 | IRQD_FRAME = 0,
42 | IRQD_DMC = 1,
43 | IRQD_NSF2 = 2,
44 | IRQD_COUNT
45 | };
46 | void UpdateIRQ(int device, bool on) {}
47 | };
48 |
49 | } // namespace xgm
50 | #endif
51 |
--------------------------------------------------------------------------------
/Source/APU/residfp/Potentiometer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of libsidplayfp, a SID player engine.
3 | *
4 | * Copyright 2011-2013 Leandro Nini
5 | * Copyright 2007-2010 Antti Lankila
6 | * Copyright (C) 2004 Dag Lem
7 | *
8 | * This program is free software; you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation; either version 2 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 | */
22 | #pragma once
23 |
24 | #ifndef POTENTIOMETER_H
25 | #define POTENTIOMETER_H
26 |
27 | namespace reSIDfp
28 | {
29 |
30 | /**
31 | * Potentiometer representation.
32 | *
33 | * This class will probably never be implemented in any real way.
34 | *
35 | * @author Ken Händel
36 | * @author Dag Lem
37 | */
38 | class Potentiometer
39 | {
40 | public:
41 | /**
42 | * Read paddle value. Not modeled.
43 | *
44 | * @return paddle value (always 0xff)
45 | */
46 | unsigned char readPOT() const { return 0xff; }
47 | };
48 |
49 | } // namespace reSIDfp
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/Source/APU/MMC5.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 |
22 | #pragma once
23 |
24 | #include "SoundChip.h"
25 | #include "Channel.h"
26 |
27 | class CSquare; // // //
28 |
29 | class CMMC5 : public CSoundChip {
30 | public:
31 | CMMC5(CMixer *pMixer);
32 | virtual ~CMMC5();
33 |
34 | void Reset();
35 | void Write(uint16_t Address, uint8_t Value);
36 | uint8_t Read(uint16_t Address, bool &Mapped);
37 | void EndFrame();
38 | void Process(uint32_t Time);
39 | double GetFreq(int Channel) const; // // //
40 |
41 | void LengthCounterUpdate();
42 | void EnvelopeUpdate();
43 | void ClockSequence(); // // //
44 |
45 | private:
46 | CSquare *m_pSquare1;
47 | CSquare *m_pSquare2;
48 | uint8_t *m_pEXRAM;
49 | uint8_t m_iMulLow;
50 | uint8_t m_iMulHigh;
51 | };
52 |
--------------------------------------------------------------------------------
/Source/InstrumentFactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "Instrument.h"
27 | #include "Factory.h"
28 |
29 | /*!
30 | \brief The instrument factory namespace.
31 | \details Including this class will automatically include all other instrument header files.
32 | */
33 | class CInstrumentFactory : CFactory
34 | {
35 | private:
36 | CInstrumentFactory();
37 | public:
38 | /*! \brief Creates a new instrument.
39 | \param Type The instrument type, which should be a member of inst_type_t.
40 | \return Pointer to the created instrument, or nullptr if the type is invalid.
41 | */
42 | static CInstrument *CreateNew(inst_type_t Type);
43 | };
44 |
--------------------------------------------------------------------------------
/hlp/menu_instrument.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Instrument menu
10 |
11 |
12 | New instrument
13 | Add a new instrument. The instrument type depends on the selected channel
14 | in the pattern editor.
22 | Deep Clone Instrument
23 | Clone selected instrument and associated sequences.
24 |
25 | Load from file...
26 | Load an instrument from a file (.fti).
27 |
28 | Save to file...
29 | Save selected instrument to a file (.fti).
30 |
31 | Edit
32 | Open the instrument editor for the selected instrument.
33 |
34 |
35 | Back to menus · interface · main index
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Source/PatternNote.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "FamiTrackerTypes.h"
27 |
28 | // Channel note struct, holds the data for each row in patterns
29 | class stChanNote {
30 | public:
31 | CString ToString() const;
32 |
33 | public:
34 | unsigned char Note = NONE;
35 | unsigned char Octave = 0U;
36 | unsigned char Vol = MAX_VOLUME;
37 | unsigned char Instrument = MAX_INSTRUMENTS;
38 | effect_t EffNumber[MAX_EFFECT_COLUMNS] = {EF_NONE, EF_NONE, EF_NONE, EF_NONE}; // // //
39 | unsigned char EffParam[MAX_EFFECT_COLUMNS] = {0U, 0U, 0U, 0U};
40 |
41 | public:
42 | static const CString NOTE_NAME[NOTE_RANGE];
43 | static const CString NOTE_NAME_FLAT[NOTE_RANGE];
44 | };
45 |
--------------------------------------------------------------------------------
/Source/APU/nsfplay/xgm/devices/Sound/nes_vrc7.h:
--------------------------------------------------------------------------------
1 | #ifndef _NES_VRC7_H_
2 | #define _NES_VRC7_H_
3 | #include "../device.h"
4 | #include "legacy/emu2413.h"
5 |
6 | namespace xgm
7 | {
8 |
9 | class NES_VRC7 : public ISoundChip
10 | {
11 | public:
12 | enum
13 | {
14 | OPT_OPLL=0,
15 | OPT_END
16 | };
17 | protected:
18 | int option[OPT_END];
19 | int mask;
20 | int patch_set;
21 | const UINT8* patch_custom;
22 | //INT32 sm[2][6]; // stereo mix
23 | INT32 sm[2][9]; // stereo mix temporary HACK to support YM2413
24 | INT16 buf[2];
25 | OPLL *opll;
26 | UINT32 divider; // clock divider
27 | double clock, rate;
28 | //TrackInfoBasic trkinfo[6];
29 | TrackInfoBasic trkinfo[9]; // HACK to support YM2413
30 | bool use_all_channels;
31 | public:
32 | NES_VRC7 ();
33 | ~NES_VRC7 ();
34 |
35 | virtual void Reset ();
36 | virtual void Tick (UINT32 clocks);
37 | virtual UINT32 Render (INT32 b[2]);
38 | virtual bool Read (UINT32 adr, UINT32 & val, UINT32 id=0);
39 | virtual bool Write (UINT32 adr, UINT32 val, UINT32 id=0);
40 | virtual void UseAllChannels (bool b);
41 | virtual void SetPatchSet (int p);
42 | virtual void SetPatchSetCustom (const UINT8* pset);
43 | virtual void SetClock (double);
44 | virtual void SetRate (double);
45 | virtual void SetOption (int, int);
46 | virtual void SetMask (int m){ mask = m; if(opll) OPLL_setMask(opll, m); }
47 | virtual void SetStereoMix (int trk, xgm::INT16 mixl, xgm::INT16 mixr);
48 | virtual ITrackInfo *GetTrackInfo(int trk);
49 | };
50 |
51 | } // namespace
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/Source/SimpleFile.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 |
26 | #include "stdafx.h"
27 |
28 | /*!
29 | \brief An extension of the MFC file class with methods for writing and reading in different
30 | data types.
31 | \details This class replaces CInstrumentFile.
32 | */
33 | class CSimpleFile : public CFile
34 | {
35 | public:
36 | CSimpleFile(LPCTSTR lpszFileName, UINT nOpenFlags);
37 |
38 | void WriteChar(char Value);
39 | void WriteShort(short Value);
40 | void WriteInt(int Value);
41 | void WriteString(CString Str);
42 | void WriteStringNull(CString Buf);
43 |
44 | char ReadChar();
45 | short ReadShort();
46 | int ReadInt();
47 | CString ReadString();
48 | CString ReadStringNull();
49 | };
50 |
--------------------------------------------------------------------------------
/Source/type_safe/detail/aligned_union.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2016-2018 Jonathan Müller
2 | // This file is subject to the license terms in the LICENSE file
3 | // found in the top-level directory of this distribution.
4 |
5 | #ifndef TYPE_SAFE_DETAIL_ALIGNED_UNION_HPP_INCLUDED
6 | #define TYPE_SAFE_DETAIL_ALIGNED_UNION_HPP_INCLUDED
7 |
8 | #include
9 |
10 | namespace type_safe
11 | {
12 | namespace detail
13 | {
14 | // max for variadic number of types.
15 | template
16 | constexpr const T& max(const T& a)
17 | {
18 | return a;
19 | }
20 |
21 | template
22 | constexpr const T& max(const T& a, const T& b)
23 | {
24 | return a < b ? b : a;
25 | }
26 |
27 | template
28 | constexpr const T& max(const T& t, const Ts&... ts)
29 | {
30 | return max(t, max(ts...));
31 | }
32 |
33 | // std::aligned_union not available on all compilers
34 | template
35 | struct aligned_union
36 | {
37 | static constexpr auto size_value = detail::max(sizeof(Types)...);
38 | static constexpr auto alignment_value = detail::max(alignof(Types)...);
39 |
40 | using type = typename std::aligned_storage::type;
41 | };
42 |
43 | template
44 | using aligned_union_t = typename aligned_union::type;
45 | }
46 | } // namespace type_safe::detail
47 |
48 | #endif // TYPE_SAFE_DETAIL_ALIGNED_UNION_HPP_INCLUDED
49 |
--------------------------------------------------------------------------------
/E-FamiTracker.reg:
--------------------------------------------------------------------------------
1 | REGEDIT
2 | ; This .REG file may be used by your SETUP program.
3 | ; If a SETUP program is not available, the entries below will be
4 | ; registered in your InitInstance automatically with a call to
5 | ; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
6 |
7 | ;HKEY_CLASSES_ROOT\.0cc = "0CCFamiTracker.Document"
8 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Document\shell\open\command = 0CC-FamiTracker.EXE %1
9 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Document\shell\open\ddeexec = [open("%1")]
10 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Document\shell\open\ddeexec\application = 0CC-FamiTracker
11 | ; note: the application is optional
12 | ; (it defaults to the app name in "command")
13 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Document = 0CC-FamiTracker Module
14 |
15 | ;HKEY_CLASSES_ROOT\.0ci = "0CCFamiTracker.Instrument"
16 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Instrument = 0CC-FamiTracker Instrument
17 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Instrument\DefaultIcon = 0CC-FamiTracker.EXE,1
18 | ;HKEY_CLASSES_ROOT\.fti = "0CCFamiTracker.Instrument"
19 | ;HKEY_CLASSES_ROOT\.ftm = "0CCFamiTracker.Document"
20 | ;HKEY_CLASSES_ROOT\0CCFamiTracker.Document\DefaultIcon = 0CC-FamiTracker.EXE,1
21 |
22 |
23 | HKEY_CLASSES_ROOT\.eft = "EFamiTracker.Document"
24 |
25 | HKEY_CLASSES_ROOT\EFamiTracker.Document\shell\open\command = E-FamiTracker.EXE %1
26 | HKEY_CLASSES_ROOT\EFamiTracker.Document\shell\open\ddeexec = [open("%1")]
27 | HKEY_CLASSES_ROOT\EFamiTracker.Document\shell\open\ddeexec\application = E-FamiTracker
28 |
29 | HKEY_CLASSES_ROOT\EFamiTracker.Document\DefaultIcon = E-FamiTracker.EXE,1
30 | HKEY_CLASSES_ROOT\EFamiTracker.Document = E-FamiTracker Module
31 |
32 |
--------------------------------------------------------------------------------
/Source/ConfigSound.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CConfigSound dialog
25 |
26 | class CConfigSound : public CPropertyPage
27 | {
28 | DECLARE_DYNAMIC(CConfigSound)
29 |
30 | public:
31 | CConfigSound();
32 | virtual ~CConfigSound();
33 |
34 | // Dialog Data
35 | enum { IDD = IDD_CONFIG_SOUND };
36 |
37 | protected:
38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
39 |
40 | void UpdateTexts();
41 |
42 | DECLARE_MESSAGE_MAP()
43 | public:
44 | virtual BOOL OnInitDialog();
45 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
46 | virtual BOOL OnApply();
47 | afx_msg void OnCbnSelchangeSampleRate();
48 | afx_msg void OnCbnSelchangeSampleSize();
49 | afx_msg void OnCbnSelchangeDevices();
50 | };
51 |
--------------------------------------------------------------------------------
/hlp/style.css:
--------------------------------------------------------------------------------
1 | .topic
2 | {
3 | font-family: verdana;
4 | font-size: 22pt;
5 | /*font-weight: bold;*/
6 | /*color: #606060;*/
7 | color: #884848;
8 | }
9 | .text
10 | {
11 | font-family: verdana;
12 | font-size: 9pt;
13 | font-weight: normal;
14 | color: black;
15 | }
16 | .boldText
17 | {
18 | font-family: verdana;
19 | font-size: 9pt;
20 | font-weight: bold;
21 | color: black;
22 | }
23 | .listText
24 | {
25 | font-family: verdana;
26 | font-size: 9pt;
27 | font-weight: normal;
28 | color: black;
29 | line-height: 150%;
30 | margin-top: 10px;
31 | }
32 | .heading
33 | {
34 | font-family: verdana;
35 | font-size: 12pt;
36 | font-weight: bold;
37 | color: black;
38 | }
39 | .bold
40 | {
41 | font-family: verdana;
42 | font-size: 9pt;
43 | font-weight: bold;
44 | color: black;
45 | }
46 | .gray
47 | {
48 | font-family: verdana;
49 | font-size: 9pt;
50 | font-weight: bold;
51 | font-style: normal;
52 | color: #606060;
53 | }
54 | .footer
55 | {
56 | font-family: Verdana;
57 | font-size: 8pt;
58 | font-style: italic;
59 | font-weight: normal;
60 | }
61 | .effect
62 | {
63 | font-family: Verdana;
64 | font-size: 8pt;
65 | font-weight: bold;
66 | }
67 | table.noteFrame
68 | {
69 | background-color: #F6F6FF;
70 | border: 2px;
71 | border-style: groove;
72 | }
73 | table.default
74 | {
75 | font-size: 9pt;
76 | border-collapse:collapse;
77 | font-family: Arial;
78 | table-layout: fixed;
79 | border-style: solid;
80 | padding: 6px;
81 | border:1px solid #C0C0C0;
82 | width: 100%;
83 | background-color: #FCFCFC;
84 | }
85 | td.highlight
86 | {
87 | background-color: #E0E0E0;
88 | height: 22px;
89 | font-weight: bold;
90 | }
--------------------------------------------------------------------------------
/Source/ModuleException.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include
24 | #include "ModuleException.h"
25 |
26 | CModuleException::CModuleException() :
27 | std::exception(),
28 | m_strError(),
29 | m_strFooter()
30 | {
31 | }
32 |
33 | const std::string CModuleException::GetErrorString() const
34 | {
35 | std::string out;
36 | const std::size_t COUNT = m_strError.size();
37 | for (std::size_t i = 0; i < COUNT; ) {
38 | out += *m_strError[i];
39 | if (++i == COUNT) break;
40 | out += '\n';
41 | }
42 | if (m_strFooter) {
43 | out += '\n';
44 | out += *m_strFooter;
45 | }
46 | return out;
47 | }
48 |
49 | void CModuleException::SetFooter(std::string footer)
50 | {
51 | m_strFooter.reset(new std::string(footer));
52 | }
53 |
--------------------------------------------------------------------------------
/Source/APU/2A03Chan.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "Channel.h"
27 |
28 | class C2A03Chan : public CChannel { // // //
29 | public:
30 | C2A03Chan(CMixer *pMixer, int Chip, uint8_t ID) : CChannel(pMixer, Chip, ID) { }
31 |
32 | inline uint16_t GetPeriod() const {
33 | return m_iPeriod;
34 | }
35 |
36 | protected:
37 | inline void Mix(int32_t Value) {
38 | if (m_iLastValue != Value) {
39 | m_pMixer->AddValue(m_iChanId, m_iChip, Value, Value, m_iTime);
40 | m_iLastValue = Value;
41 | }
42 | };
43 |
44 | protected:
45 | // Variables used by channels
46 | uint8_t m_iControlReg;
47 | uint8_t m_iEnabled;
48 | uint16_t m_iPeriod;
49 | uint16_t m_iLengthCounter;
50 | uint32_t m_iCounter;
51 | };
52 |
--------------------------------------------------------------------------------
/Source/SeqInstHandlerS5B.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "SeqInstHandler.h"
27 |
28 | /*!
29 | \brief Class for Sunsoft 5B sequence instrument handlers.
30 | \details The 5B instruments process noise frequency in the duty sequence.
31 | */
32 | class CSeqInstHandlerS5B : public CSeqInstHandler
33 | {
34 | public:
35 | using CSeqInstHandler::CSeqInstHandler;
36 |
37 | private:
38 | /*! \brief Processes the value retrieved from a sequence.
39 | \return True if the sequence has finished processing.
40 | \param Index The sequence type.
41 | \param Setting The sequence setting.
42 | \param Value The sequence value to be processed. */
43 | virtual bool ProcessSequence(int Index, unsigned Setting, int Value);
44 | };
45 |
--------------------------------------------------------------------------------
/Source/ConfigMIDI.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CConfigMIDI dialog
25 |
26 | class CConfigMIDI : public CPropertyPage
27 | {
28 | DECLARE_DYNAMIC(CConfigMIDI)
29 |
30 | public:
31 | CConfigMIDI();
32 | virtual ~CConfigMIDI();
33 |
34 | // Dialog Data
35 | enum { IDD = IDD_CONFIG_MIDI };
36 |
37 | protected:
38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
39 |
40 | DECLARE_MESSAGE_MAP()
41 | public:
42 | virtual BOOL OnInitDialog();
43 | virtual BOOL OnApply();
44 | afx_msg void OnCbnSelchangeDevices();
45 | afx_msg void OnBnClickedMasterSync();
46 | afx_msg void OnBnClickedKeyRelease();
47 | afx_msg void OnBnClickedChanmap();
48 | afx_msg void OnBnClickedVelocity();
49 | afx_msg void OnBnClickedArpeggiate();
50 | afx_msg void OnCbnSelchangeOutdevices();
51 | };
52 |
--------------------------------------------------------------------------------
/Source/CustomExporters.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | //header file for CustomExporters plugin container.
22 | //who: Derek Andrews
23 | //why: This class loads custom exporter plugins and allows the
24 | //user to select an active plugin to use.
25 |
26 | #pragma once
27 | #include "stdafx.h"
28 | #include "CustomExporter.h"
29 |
30 | class CCustomExporters
31 | {
32 | public:
33 | CCustomExporters( CString PluginPath );
34 | ~CCustomExporters( void );
35 |
36 | void GetNames( CStringArray& names ) const;
37 | void SetCurrentExporter( CString name );
38 | CCustomExporter& GetCurrentExporter( void ) const;
39 |
40 | private:
41 | void FindCustomExporters( CString PluginPath );
42 |
43 | CArray< CCustomExporter, CCustomExporter& > m_customExporters;
44 | CCustomExporter* m_currentExporter;
45 |
46 | };
47 |
--------------------------------------------------------------------------------
/Source/ChannelState.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "FamiTrackerTypes.h" // constants
27 | #include
28 |
29 | // // // Channel state information
30 | class stChannelState {
31 | public:
32 | stChannelState();
33 |
34 | int ChannelIndex;
35 | int Instrument;
36 | int Volume;
37 | int Effect[EF_COUNT];
38 | int Effect_LengthCounter;
39 | int Effect_AutoFMMult;
40 | int Echo[ECHO_BUFFER_LENGTH + 1];
41 | };
42 |
43 | class stFullState {
44 | public:
45 | stFullState(int Count = MAX_CHANNELS);
46 | stFullState(const stFullState &other) = delete;
47 | stFullState& operator=(const stFullState &other) = delete;
48 |
49 | std::unique_ptr State;
50 | int Tempo;
51 | int Speed;
52 | int GroovePos; // -1: disable groove
53 | };
54 |
--------------------------------------------------------------------------------
/Source/ModSequenceEditor.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 | class CInstrumentFDS; // // //
24 |
25 | class CModSequenceEditor : public CWnd
26 | {
27 | public:
28 | CModSequenceEditor();
29 | virtual ~CModSequenceEditor();
30 | DECLARE_DYNAMIC(CModSequenceEditor)
31 |
32 | public:
33 | void SetInstrument(std::shared_ptr pInst);
34 |
35 | private:
36 | void EditSequence(CPoint point);
37 |
38 | private:
39 | std::shared_ptr m_pInstrument;
40 |
41 | protected:
42 | DECLARE_MESSAGE_MAP()
43 |
44 | public:
45 | BOOL CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd);
46 | virtual afx_msg void OnPaint();
47 | afx_msg void OnMouseMove(UINT nFlags, CPoint point);
48 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
49 | };
50 |
--------------------------------------------------------------------------------
/Source/APU/SoundChip.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "../stdafx.h"
24 | #include "SoundChip.h"
25 | #include "../RegisterState.h"
26 |
27 | CSoundChip::CSoundChip(CMixer *pMixer) :
28 | m_pMixer(pMixer),
29 | m_pRegisterLogger(new CRegisterLogger { })
30 | {
31 | }
32 |
33 | CSoundChip::~CSoundChip()
34 | {
35 | if (m_pRegisterLogger)
36 | delete m_pRegisterLogger;
37 | }
38 |
39 | double CSoundChip::GetFreq(int Channel) const // // //
40 | {
41 | return 0.0;
42 | }
43 |
44 | void CSoundChip::Log(uint16_t Address, uint8_t Value) // // //
45 | {
46 | // default logger operation
47 | if (m_pRegisterLogger->SetPort(Address))
48 | m_pRegisterLogger->Write(Value);
49 | }
50 |
51 | CRegisterLogger *CSoundChip::GetRegisterLogger() const // // //
52 | {
53 | return m_pRegisterLogger;
54 | }
55 |
--------------------------------------------------------------------------------
/Source/ControlPanelDlg.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routin, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CControlPanelDlg dialog
25 |
26 | class CControlPanelDlg : public CDialog
27 | {
28 | DECLARE_DYNAMIC(CControlPanelDlg)
29 |
30 | public:
31 | CControlPanelDlg(CWnd* pParent = NULL); // standard constructor
32 | virtual ~CControlPanelDlg();
33 |
34 | void SetFrameParent(CWnd *pMainFrm = NULL);
35 |
36 | // Dialog Data
37 | enum { IDD = IDD_MAINFRAME };
38 |
39 | protected:
40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
41 |
42 | CWnd *m_pMainFrame;
43 |
44 | DECLARE_MESSAGE_MAP()
45 | public:
46 | virtual BOOL PreTranslateMessage(MSG* pMsg);
47 | virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
48 | protected:
49 | virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
50 | };
51 |
--------------------------------------------------------------------------------
/Source/PerformanceDlg.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CPerformanceDlg dialog
25 |
26 | class CPerformanceDlg : public CDialog
27 | {
28 | DECLARE_DYNAMIC(CPerformanceDlg)
29 |
30 | public:
31 | CPerformanceDlg(CWnd* pParent = NULL); // standard constructor
32 | virtual ~CPerformanceDlg();
33 |
34 | // Dialog Data
35 | enum { IDD = IDD_PERFORMANCE };
36 |
37 | private:
38 | void UpdateBar();
39 | void UpdateInfo();
40 | protected:
41 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
42 |
43 | unsigned int PerRefreshRate; // Refresh rate for performance meter updates
44 |
45 | DECLARE_MESSAGE_MAP()
46 | public:
47 | virtual BOOL OnInitDialog();
48 | afx_msg void OnTimer(UINT_PTR nIDEvent);
49 | afx_msg void OnBnClickedOk();
50 | virtual BOOL DestroyWindow();
51 | afx_msg void OnClose();
52 | };
53 |
--------------------------------------------------------------------------------
/Source/SeqInstHandlerS5B.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "stdafx.h"
24 | #include "Sequence.h"
25 | #include "ChannelHandlerInterface.h"
26 | #include "SeqInstHandlerS5B.h"
27 |
28 | bool CSeqInstHandlerS5B::ProcessSequence(int Index, unsigned Setting, int Value)
29 | {
30 | switch (Index) {
31 | case SEQ_DUTYCYCLE:
32 | if (auto pChan = dynamic_cast(m_pInterface)) {
33 | m_pInterface->SetDutyPeriod(Value & 0xE0);
34 |
35 | if (Value & S5B_MODE_NOISE) {
36 | pChan->SetNoiseFreq(Value & 0x1F);
37 | }
38 |
39 | m_pInterface->SetExtra(Value);
40 |
41 |
42 | return true;
43 |
44 | // In chips other than 5B: case SEQ_DUTYCYCLE:
45 | // m_pInterface->SetDutyPeriod(Value);
46 | }
47 | }
48 | return CSeqInstHandler::ProcessSequence(Index, Setting, Value);
49 | }
--------------------------------------------------------------------------------
/Source/APU/SoundChip.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include // // //
27 |
28 | class CMixer;
29 | class CRegisterLogger; // // //
30 |
31 | class CSoundChip {
32 | public:
33 | CSoundChip(CMixer *pMixer = nullptr); // // //
34 | virtual ~CSoundChip();
35 |
36 | virtual void Reset() = 0;
37 | virtual void Process(uint32_t Time) = 0;
38 | virtual void EndFrame() = 0;
39 |
40 | virtual void Write(uint16_t Address, uint8_t Value) = 0;
41 | virtual uint8_t Read(uint16_t Address, bool &Mapped) = 0;
42 |
43 | virtual double GetFreq(int Channel) const; // // //
44 |
45 | virtual void Log(uint16_t Address, uint8_t Value); // // //
46 | CRegisterLogger *GetRegisterLogger() const; // // //
47 |
48 | protected:
49 | CMixer *m_pMixer;
50 | CRegisterLogger *m_pRegisterLogger; // // //
51 | };
52 |
--------------------------------------------------------------------------------
/Source/SpeedDlg.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 | #include "../resource.h"
25 |
26 | extern const int RATE_MIN;
27 |
28 | // CSpeedDlg dialog
29 |
30 | class CSpeedDlg : public CDialog
31 | {
32 | DECLARE_DYNAMIC(CSpeedDlg)
33 |
34 | public:
35 | CSpeedDlg(CWnd* pParent = NULL); // standard constructor
36 | virtual ~CSpeedDlg();
37 |
38 | // Dialog Data
39 | enum { IDD = IDD_SPEED };
40 |
41 | protected:
42 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
43 |
44 | int m_iSpeed;
45 |
46 | DECLARE_MESSAGE_MAP()
47 | public:
48 | int GetSpeedFromDlg(int InitialSpeed);
49 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
50 | // virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
51 | virtual BOOL OnInitDialog();
52 | afx_msg void OnBnClickedCancel();
53 | };
54 |
--------------------------------------------------------------------------------
/Source/VersionChecker.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2018 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include
27 | #include
28 | #include
29 | #include
30 |
31 | struct stVersionCheckResult {
32 | int StartUp;
33 | std::string VerInfo;
34 | std::string VerDesc;
35 | std::string URL;
36 | };
37 |
38 | class CVersionChecker {
39 | public:
40 | explicit CVersionChecker(bool StartUp);
41 | ~CVersionChecker() noexcept;
42 |
43 | bool IsReady() const;
44 | std::optional GetVersionCheckResult();
45 |
46 | private:
47 | static void ThreadFn(bool startup, std::promise> p) noexcept;
48 |
49 | private:
50 | std::promise> promise_;
51 | std::future> future_ = promise_.get_future();
52 | std::thread th_;
53 | };
54 |
--------------------------------------------------------------------------------
/Source/CreateWaveDlg.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CCreateWaveDlg dialog
25 |
26 | class CCreateWaveDlg : public CDialog
27 | {
28 | DECLARE_DYNAMIC(CCreateWaveDlg)
29 |
30 | public:
31 | CCreateWaveDlg(CWnd* pParent = NULL); // standard constructor
32 | virtual ~CCreateWaveDlg();
33 |
34 | void ShowDialog();
35 |
36 | // Dialog Data
37 | enum { IDD = IDD_CREATEWAV };
38 |
39 | protected:
40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
41 |
42 | int GetFrameLoopCount() const;
43 | int GetTimeLimit() const;
44 |
45 | CCheckListBox m_ctlChannelList;
46 | CComboBox m_ctlTracks;
47 |
48 | DECLARE_MESSAGE_MAP()
49 | public:
50 | afx_msg void OnBnClickedBegin();
51 | virtual BOOL OnInitDialog();
52 | afx_msg void OnDeltaposSpinLoop(NMHDR *pNMHDR, LRESULT *pResult);
53 | afx_msg void OnDeltaposSpinTime(NMHDR *pNMHDR, LRESULT *pResult);
54 | };
55 |
--------------------------------------------------------------------------------
/Source/ConfigWindow.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2012 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #include "stdafx.h"
22 | #include "FamiTracker.h"
23 | #include "ConfigWindow.h"
24 | #include "ConfigGeneral.h"
25 | #include "ConfigAppearance.h"
26 | #include "ConfigSound.h"
27 | #include "Settings.h"
28 |
29 |
30 | // CConfigWindow
31 |
32 | IMPLEMENT_DYNAMIC(CConfigWindow, CPropertySheet)
33 | CConfigWindow::CConfigWindow(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
34 | :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
35 | {
36 | }
37 |
38 | CConfigWindow::CConfigWindow(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
39 | :CPropertySheet(pszCaption, pParentWnd, iSelectPage, NULL, NULL)
40 | {
41 | }
42 |
43 | CConfigWindow::~CConfigWindow()
44 | {
45 | }
46 |
47 |
48 | BEGIN_MESSAGE_MAP(CConfigWindow, CPropertySheet)
49 | END_MESSAGE_MAP()
50 |
51 |
52 | // CConfigWindow message handlers
53 |
54 | void CConfigWindow::SetupPages(void)
55 | {
56 | }
57 |
--------------------------------------------------------------------------------
/Source/WavProgressDlg.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CWavProgressDlg dialog
25 |
26 | class CWavProgressDlg : public CDialog
27 | {
28 | DECLARE_DYNAMIC(CWavProgressDlg)
29 |
30 | public:
31 | CWavProgressDlg(CWnd* pParent = NULL); // standard constructor
32 | virtual ~CWavProgressDlg();
33 |
34 | void BeginRender(CString &File, render_end_t LengthType, int LengthParam, int Track);
35 |
36 | // Dialog Data
37 | enum { IDD = IDD_WAVE_PROGRESS };
38 |
39 | protected:
40 | DWORD m_dwStartTime;
41 | render_end_t m_iSongEndType;
42 | int m_iSongEndParam;
43 | int m_iTrack;
44 |
45 | CString m_sFile;
46 |
47 | public:
48 | bool CancelRender = false;
49 |
50 | protected:
51 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
52 |
53 | DECLARE_MESSAGE_MAP()
54 | public:
55 | virtual BOOL OnInitDialog();
56 | afx_msg void OnTimer(UINT_PTR nIDEvent);
57 | void OnCancel() override;
58 | };
59 |
--------------------------------------------------------------------------------
/Source/InstrumentVRC7.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 |
26 | class CInstrumentVRC7 : public CInstrument {
27 | public:
28 | CInstrumentVRC7();
29 | CInstrument* Clone() const;
30 | void Setup();
31 | void Store(CDocumentFile *pDocFile);
32 | bool Load(CDocumentFile *pDocFile);
33 | void SaveFile(CInstrumentFile *pFile);
34 | bool LoadFile(CInstrumentFile *pFile, int iVersion);
35 | int Compile(CChunk *pChunk, int Index);
36 | bool CanRelease() const;
37 |
38 | public:
39 | void SetPatch(unsigned int Patch);
40 | unsigned int GetPatch() const;
41 | void SetCustomReg(int Reg, unsigned char Value); // // //
42 | unsigned char GetCustomReg(int Reg) const; // // //
43 |
44 | protected:
45 | virtual void CloneFrom(const CInstrument *pInst); // // //
46 |
47 | private:
48 | unsigned int m_iPatch;
49 | unsigned char m_iRegs[8]; // // // Custom patch settings
50 | };
51 |
--------------------------------------------------------------------------------
/Source/VisualizerBase.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2017 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "stdafx.h"
27 | #include // // //
28 |
29 | class CVisualizerBase { // // //
30 | public:
31 | virtual ~CVisualizerBase() = default;
32 |
33 | // Create the visualizer
34 | virtual void Create(int Width, int Height);
35 | // Set rate of samples
36 | virtual void SetSampleRate(int SampleRate) = 0;
37 | // Set new sample data
38 | virtual void SetSampleData(short *iSamples, unsigned int iCount);
39 | // Render an image from the sample data
40 | virtual void Draw() = 0;
41 | // Display the image
42 | virtual void Display(CDC *pDC, bool bPaintMsg); // // //
43 |
44 | protected:
45 | BITMAPINFO m_bmi;
46 | std::unique_ptr m_pBlitBuffer; // // //
47 |
48 | int m_iWidth = 0;
49 | int m_iHeight = 0;
50 |
51 | unsigned int m_iSampleCount = 0;
52 | short *m_pSamples = nullptr;
53 | };
54 |
--------------------------------------------------------------------------------
/Source/SequenceSetting.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #pragma once
24 |
25 | class CSequenceSetting : public CWnd
26 | {
27 | DECLARE_DYNAMIC(CSequenceSetting)
28 | CSequenceSetting(CWnd *pParent);
29 | virtual ~CSequenceSetting();
30 | public:
31 | void Setup(CFont *pFont);
32 | void SelectSequence(CSequence *pSequence, int Type, int InstrumentType);
33 |
34 | private:
35 | CWnd *m_pParent;
36 | CMenu m_menuPopup;
37 | CFont *m_pFont;
38 | CSequence *m_pSequence;
39 |
40 | static const UINT MENU_ID_BASE, MENU_ID_MAX; // // //
41 |
42 | int m_iInstType;
43 | int m_iType;
44 | bool m_bMouseOver;
45 |
46 | protected:
47 | DECLARE_MESSAGE_MAP()
48 | public:
49 | afx_msg void OnPaint();
50 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
51 | afx_msg void OnMenuSettingChanged(UINT ID); // // //
52 | afx_msg void OnMouseMove(UINT nFlags, CPoint point);
53 | afx_msg void OnMouseLeave();
54 | };
55 |
--------------------------------------------------------------------------------
/Source/DPI.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 |
24 | #pragma once
25 |
26 | #include "stdafx.h"
27 | #include "DPI.h"
28 |
29 | const int DPI::DEFAULT_DPI = 96;
30 | int DPI::_dpiX = DPI::DEFAULT_DPI;
31 | int DPI::_dpiY = DPI::DEFAULT_DPI;
32 |
33 | int DPI::SX(int pt)
34 | {
35 | return ::MulDiv(pt, _dpiX, DPI::DEFAULT_DPI);
36 | }
37 |
38 | int DPI::SY(int pt)
39 | {
40 | return ::MulDiv(pt, _dpiY, DPI::DEFAULT_DPI);
41 | }
42 |
43 | void DPI::ScaleMouse(CPoint &pt)
44 | {
45 | pt.x = SX(pt.x);
46 | pt.y = SY(pt.y);
47 | }
48 |
49 | void DPI::ScaleRect(CRect &r) // // //
50 | {
51 | r.left = SX(r.left);
52 | r.right = SX(r.right);
53 | r.top = SY(r.top);
54 | r.bottom = SY(r.bottom);
55 | }
56 |
57 | CRect DPI::Rect(int x, int y, int w, int h)
58 | {
59 | return CRect {SX(x), SY(y), SX(x + w), SY(y + h)};
60 | }
61 |
62 | void DPI::SetScale(int X, int Y) // // //
63 | {
64 | _dpiX = X;
65 | _dpiY = Y;
66 | }
67 |
--------------------------------------------------------------------------------
/Source/APU/Channel.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 |
22 | #pragma once
23 |
24 | class CMixer;
25 |
26 | //
27 | // This class is used to derive the audio channels
28 | //
29 |
30 | class CChannel {
31 | public:
32 | CChannel(CMixer *pMixer, int Chip, uint8_t ID) :
33 | m_pMixer(pMixer), m_iChip(Chip), m_iChanId(ID), m_iTime(0), m_iLastValue(0)
34 | {
35 | }
36 |
37 | virtual void EndFrame() { m_iTime = 0; }
38 |
39 | virtual double GetFrequency() const = 0; // // //
40 |
41 | protected:
42 | virtual void Mix(int32_t Value) {
43 | int32_t Delta = Value - m_iLastValue;
44 | if (Delta)
45 | m_pMixer->AddValue(m_iChanId, m_iChip, Delta, Value, m_iTime);
46 | m_iLastValue = Value;
47 | }
48 |
49 | protected:
50 | CMixer *m_pMixer; // The mixer
51 |
52 | uint32_t m_iTime; // Cycle counter, resets every new frame
53 | uint8_t m_iChanId; // This channels unique ID
54 | uint8_t m_iChip; // Chip
55 | int32_t m_iLastValue; // Last value sent to mixer
56 | };
57 |
--------------------------------------------------------------------------------
/Source/VisualizerBase.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2017 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "VisualizerBase.h"
24 |
25 | void CVisualizerBase::Create(int Width, int Height)
26 | {
27 | memset(&m_bmi, 0, sizeof(BITMAPINFO));
28 | m_bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
29 | m_bmi.bmiHeader.biBitCount = 32;
30 | m_bmi.bmiHeader.biHeight = -Height;
31 | m_bmi.bmiHeader.biWidth = Width;
32 | m_bmi.bmiHeader.biPlanes = 1;
33 |
34 | m_iWidth = Width;
35 | m_iHeight = Height;
36 | m_pBlitBuffer = std::make_unique(Width * Height); // // //
37 | }
38 |
39 | void CVisualizerBase::SetSampleData(short *pSamples, unsigned int iCount)
40 | {
41 | m_pSamples = pSamples;
42 | m_iSampleCount = iCount;
43 | }
44 |
45 | void CVisualizerBase::Display(CDC *pDC, bool bPaintMsg) { // // //
46 | StretchDIBits(pDC->m_hDC,
47 | 0, 0, m_iWidth, m_iHeight,
48 | 0, 0, m_iWidth, m_iHeight,
49 | m_pBlitBuffer.get(), &m_bmi, DIB_RGB_COLORS, SRCCOPY);
50 | }
51 |
--------------------------------------------------------------------------------
/Source/VisualizerSpectrum.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 |
22 | #pragma once
23 |
24 | #include "stdafx.h"
25 | #include "FFT/FftBuffer.h" // // //
26 | #include
27 | #include "VisualizerBase.h" // // //
28 |
29 | // CVisualizerSpectrum, spectrum style visualizer
30 |
31 | const int FFT_POINTS = 1024;
32 |
33 | class CVisualizerSpectrum : public CVisualizerBase
34 | {
35 | public:
36 | CVisualizerSpectrum(int Size); // // //
37 |
38 | void Create(int Width, int Height) override;
39 | void SetSampleRate(int SampleRate) override;
40 | void SetSampleData(short *iSamples, unsigned int iCount) override;
41 | void Draw() override;
42 |
43 | protected:
44 | void Transform(short *pSamples, unsigned int Count);
45 |
46 | private:
47 | static const COLORREF BG_COLOR = 0;
48 | const int m_iBarSize;
49 |
50 | FftBuffer fft_buffer_; // // //
51 |
52 | int m_iFillPos;
53 | std::array m_pSampleBuffer = { };
54 | std::array m_fFftPoint = { };
55 | };
56 |
--------------------------------------------------------------------------------
/Source/APU/old/2413tone.h:
--------------------------------------------------------------------------------
1 | /* YM2413 VOICE */
2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3 | 0x61, 0x61, 0x1e, 0x17, 0xf0, 0x7f, 0x07, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4 | 0x13, 0x41, 0x0f, 0x0d, 0xce, 0xd2, 0x43, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5 | 0x03, 0x01, 0x99, 0x04, 0xff, 0xc3, 0x03, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6 | 0x21, 0x61, 0x1b, 0x07, 0xaf, 0x63, 0x40, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7 | 0x22, 0x21, 0x1e, 0x06, 0xf0, 0x76, 0x08, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8 | 0x31, 0x22, 0x16, 0x05, 0x90, 0x71, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
9 | 0x21, 0x61, 0x1d, 0x07, 0x82, 0x81, 0x10, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
10 | 0x23, 0x21, 0x2d, 0x16, 0xc0, 0x70, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
11 | 0x61, 0x21, 0x1b, 0x06, 0x64, 0x65, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
12 | 0x61, 0x61, 0x0c, 0x18, 0x85, 0xa0, 0x79, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
13 | 0x23, 0x21, 0x87, 0x11, 0xf0, 0xa4, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
14 | 0x97, 0xe1, 0x28, 0x07, 0xff, 0xf3, 0x02, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
15 | 0x61, 0x10, 0x0c, 0x05, 0xf2, 0xc4, 0x40, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
16 | 0x01, 0x01, 0x56, 0x03, 0xb4, 0xb2, 0x23, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
17 | 0x61, 0x41, 0x89, 0x03, 0xf1, 0xf4, 0xf0, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18 | 0x04, 0x21, 0x28, 0x00, 0xdf, 0xf8, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19 | 0x23, 0x22, 0x00, 0x00, 0xd8, 0xf8, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20 | 0x25, 0x18, 0x00, 0x00, 0xf8, 0xda, 0xf8, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 |
--------------------------------------------------------------------------------
/Source/PatternNote.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2016 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "stdafx.h"
24 | #include "PatternNote.h"
25 |
26 | const CString stChanNote::NOTE_NAME[NOTE_RANGE] = {
27 | _T("C-"), _T("C#"), _T("D-"), _T("D#"),
28 | _T("E-"), _T("F-"), _T("F#"), _T("G-"),
29 | _T("G#"), _T("A-"), _T("A#"), _T("B-"),
30 | };
31 |
32 | const CString stChanNote::NOTE_NAME_FLAT[NOTE_RANGE] = {
33 | _T("C-"), _T("Db"), _T("D-"), _T("Eb"),
34 | _T("E-"), _T("F-"), _T("Gb"), _T("G-"),
35 | _T("Ab"), _T("A-"), _T("Bb"), _T("B-"),
36 | };
37 |
38 | CString stChanNote::ToString() const
39 | {
40 | switch (Note) {
41 | case NONE: return _T("...");
42 | case HALT: return _T("---");
43 | case RELEASE: return _T("===");
44 | case ECHO:
45 | {
46 | CString str;
47 | str.Format(_T("^-%d"), Octave);
48 | return str;
49 | }
50 | default:
51 | {
52 | CString str;
53 | str.Format(_T("%s%d"), NOTE_NAME[Note - 1], Octave);
54 | return str;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Source/APU/VRC7.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 |
22 | #pragma once
23 |
24 | #include "SoundChip.h"
25 | #include "nsfplay/xgm/devices/Sound/legacy/emu2413.h"
26 |
27 | class CVRC7 : public CSoundChip {
28 | public:
29 | CVRC7(CMixer *pMixer);
30 | virtual ~CVRC7();
31 |
32 | void Reset();
33 | void SetSampleSpeed(uint32_t SampleRate, double ClockRate, uint32_t FrameRate);
34 | void SetVolume(float Volume);
35 |
36 | void Write(uint16_t Address, uint8_t Value);
37 | void Log(uint16_t Address, uint8_t Value); // // //
38 | uint8_t Read(uint16_t Address, bool &Mapped);
39 | void EndFrame();
40 | void Process(uint32_t Time);
41 |
42 | double GetFreq(int Channel) const; // // //
43 |
44 | protected:
45 | static const float AMPLIFY;
46 | static const uint32_t OPL_CLOCK;
47 |
48 | private:
49 | OPLL *m_pOPLLInt;
50 | uint32_t m_iTime;
51 | uint32_t m_iMaxSamples;
52 |
53 | int16_t *m_pBuffer;
54 | uint32_t m_iBufferPtr;
55 |
56 | uint8_t m_iSoundReg;
57 |
58 | int m_iPatchTone;
59 |
60 | float m_fVolume;
61 | };
62 |
--------------------------------------------------------------------------------
/cmake/mfc.cmake:
--------------------------------------------------------------------------------
1 | # taken from https://github.com/Kitware/CMake/blob/master/Tests/MFC/CMakeLists.txt.in
2 | # The CMake source tree is distributed under terms of the BSD 3-Clause license.
3 |
4 |
5 | macro(replace_flags var these those)
6 | if("${${var}}" MATCHES "${these}")
7 | string(REGEX REPLACE "${these}" "${those}" ${var} "${${var}}")
8 | #message(STATUS "info: ${var} changed to '${${var}}'")
9 | endif()
10 | message(STATUS "info: ${var}='${${var}}'")
11 | endmacro()
12 |
13 | macro(msvc_link_to_static_crt)
14 | if(MSVC)
15 | set(has_correct_flag 0)
16 | foreach(lang C CXX)
17 | foreach(suffix "" _DEBUG _MINSIZEREL _RELEASE _RELWITHDEBINFO)
18 | replace_flags("CMAKE_${lang}_FLAGS${suffix}" "/MD" "/MT")
19 | if(CMAKE_${lang}_FLAGS${suffix} MATCHES "/MT")
20 | set(has_correct_flag 1)
21 | endif()
22 | endforeach()
23 | endforeach()
24 | if(NOT has_correct_flag)
25 | message(FATAL_ERROR "no CMAKE_*_FLAGS var contains /MT")
26 | endif()
27 | endif()
28 | endmacro()
29 |
30 |
31 | if ("${STATIC_MSVCRT}" STREQUAL "")
32 | message(FATAL_ERROR "Did not set STATIC_MSVCRT when including MFC CMake")
33 | endif()
34 |
35 | # First set static/dynamic MSVCRT...
36 | if(STATIC_MSVCRT)
37 | msvc_link_to_static_crt()
38 | else()
39 | # VS generators add this automatically based on the STATIC_MSVCRT value,
40 | # but generators matching "Make" require:
41 | add_definitions(-D_AFXDLL)
42 | endif()
43 |
44 | # Then call FindMFC.cmake (behavior depends on static/dynamic CRT).
45 | FIND_PACKAGE(MFC)
46 | IF (NOT MFC_FOUND)
47 | MESSAGE(FATAL_ERROR "MFC Could not be found during the MFC test")
48 | ENDIF()
49 |
50 | if("${STATIC_MSVCRT}" STREQUAL "2")
51 | set(CMAKE_INSTALL_MFC_LIBRARIES ON)
52 | include(InstallRequiredSystemLibraries)
53 | endif()
54 |
--------------------------------------------------------------------------------
/hlp/sunsoft.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Sunsoft 5B
10 |
11 |
12 |
About
13 |
14 |
15 | This chip was used by Sunsoft, in any FME-7 game, often interchanged with both the Sunsoft FME-7, and 5A. The only time it's audio was used was in Gimmick!. It is actually a YM2149F, a clone of the AY-3-8910. This family of chips are capable of generating noise, envelopes, and tone (square waves), and can even mix these two waves together. However, Gimmick! exclusively used the Tone part of the 5B, rendering the rest of the chip's functions unused. As a result, most emulators don't support the extra modes.
16 |
17 |
This chip, along with the Konami VRC7, was produced by Yamaha, under the product code YM6630.
18 |
19 |
Instruments
20 |
The biggest difference from the usual macros in Famitracker are the Noise/Mode macros. These macros are very powerful, allowing one to tweak the settings of how each channel works on a per-channel basis, at whatever time they want. This includes but is not limited to:
21 |
22 |
Per-tick mixing control between Envelope, Noise, and Tone
23 |
Macros to define the Noise pitch
24 |
Ability to mix all three modes into one channel (e.g. Noise+Tone, Tone+Envelope, etc.)
25 |
26 |
27 |
28 |
29 | Back to sound hardware · main index
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Source/InstrumentFileTree.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | #pragma once
22 |
23 |
24 | // CInstrumentFileTree
25 |
26 | class CInstrumentFileTree
27 | {
28 | public:
29 | CInstrumentFileTree();
30 | ~CInstrumentFileTree();
31 |
32 | bool BuildMenuTree(CString instrumentPath);
33 | CMenu *GetMenu() const;
34 | CString GetFile(int Index) const;
35 | bool ShouldRebuild() const;
36 | void Changed();
37 |
38 | public:
39 | // Limits, to avoid very deep recursions
40 | static const int RECURSION_LIMIT = 6;
41 | static const int MAX_MENUS = 200;
42 |
43 | static const int MENU_BASE = 0x9000; // Choose a range where no strings are located
44 |
45 | static const int CACHE_TIMEOUT = 60000; // 1 minute
46 |
47 | protected:
48 | bool ScanDirectory(CString path, CMenu *pMenu, int level);
49 | void DeleteMenuObjects();
50 |
51 | private:
52 | CMenu *m_pRootMenu;
53 | int m_iFileIndex;
54 | CArray m_fileList;
55 | CArray m_menuArray;
56 | DWORD m_iTimeout;
57 | bool m_bShouldRebuild;
58 | int m_iTotalMenusAdded;
59 | };
60 |
--------------------------------------------------------------------------------
/Source/SequenceManager.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
6 | **
7 | ** This program is free software; you can redistribute it and/or modify
8 | ** it under the terms of the GNU General Public License as published by
9 | ** the Free Software Foundation; either version 2 of the License, or
10 | ** (at your option) any later version.
11 | **
12 | ** This program is distributed in the hope that it will be useful,
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | ** Library General Public License for more details. To obtain a
16 | ** copy of the GNU Library General Public License, write to the Free
17 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 | **
19 | ** Any permitted reproduction of these routines, in whole or in part,
20 | ** must bear this legend.
21 | */
22 |
23 | #include "stdafx.h"
24 | #include
25 | #include
26 | #include "Sequence.h"
27 | #include "SequenceCollection.h"
28 | #include "SequenceManager.h"
29 |
30 | CSequenceManager::CSequenceManager(int Count)
31 | {
32 | m_pCollection.resize(Count);
33 | for (int i = 0; i < Count; ++i)
34 | m_pCollection[i].reset(new CSequenceCollection());
35 | }
36 |
37 | int CSequenceManager::GetCount() const
38 | {
39 | return m_pCollection.size();
40 | }
41 |
42 | CSequenceCollection *CSequenceManager::GetCollection(unsigned int Index)
43 | {
44 | if (Index >= m_pCollection.size()) return nullptr;
45 | if (!m_pCollection[Index])
46 | m_pCollection[Index].reset(new CSequenceCollection());
47 | return m_pCollection[Index].get();
48 | }
49 |
50 | const CSequenceCollection *CSequenceManager::GetCollection(unsigned int Index) const
51 | {
52 | if (Index >= m_pCollection.size()) return nullptr;
53 | return m_pCollection[Index].get();
54 | }
55 |
--------------------------------------------------------------------------------
/Source/APU/Square.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FamiTracker - NES/Famicom sound tracker
3 | ** Copyright (C) 2005-2014 Jonathan Liss
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | ** Library General Public License for more details. To obtain a
14 | ** copy of the GNU Library General Public License, write to the Free
15 | ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 | **
17 | ** Any permitted reproduction of these routines, in whole or in part,
18 | ** must bear this legend.
19 | */
20 |
21 | /*
22 | * Square wave
23 | *
24 | */
25 |
26 |
27 | #pragma once
28 |
29 | #include "2A03Chan.h" // // //
30 |
31 | class CSquare : public C2A03Chan {
32 | public:
33 | CSquare(CMixer *pMixer, int ID, int Chip);
34 | ~CSquare();
35 |
36 | void Reset();
37 | void Write(uint16_t Address, uint8_t Value);
38 | void WriteControl(uint8_t Value);
39 | uint8_t ReadControl();
40 | void Process(uint32_t Time);
41 | double GetFrequency() const; // // //
42 |
43 | void LengthCounterUpdate();
44 | void SweepUpdate(int Diff);
45 | void EnvelopeUpdate();
46 |
47 | public:
48 | static const uint8_t DUTY_TABLE[4][16];
49 | uint32_t CPU_RATE; // // //
50 |
51 | private:
52 | uint8_t m_iDutyLength, m_iDutyCycle;
53 |
54 | uint8_t m_iLooping, m_iEnvelopeFix, m_iEnvelopeSpeed;
55 | uint8_t m_iEnvelopeVolume, m_iFixedVolume;
56 | int8_t m_iEnvelopeCounter;
57 |
58 | uint8_t m_iSweepEnabled, m_iSweepPeriod, m_iSweepMode, m_iSweepShift;
59 | int16_t m_iSweepCounter, m_iSweepResult;
60 | bool m_bSweepWritten;
61 | };
62 |
--------------------------------------------------------------------------------