├── .gitattributes ├── name.h ├── cmake_user_end.cmake.example ├── res ├── About.bmp ├── Document.ico ├── Inst_FDS.ico ├── Inst_S5B.ico ├── Inst_2A03.ico ├── Inst_2A07.ico ├── Inst_N163.ico ├── Inst_VRC6.ico ├── Inst_VRC7.ico ├── LeftArrow.ico ├── RightArrow.ico ├── Application.ico ├── MainToolbar-16.bmp ├── MainToolbar-256.bmp ├── key_black_pressed.bmp ├── key_white_pressed.bmp ├── InstrumentToolbar-16.bmp ├── key_black_unpressed.bmp ├── key_white_unpressed.bmp ├── InstrumentToolbar-256.bmp ├── export_report.htm └── Dn-FamiTracker.manifest ├── cmake_user_begin.cmake.example ├── Source ├── libsamplerate │ ├── cmake │ │ ├── SampleRateConfig.cmake.in │ │ ├── FindOgg.cmake │ │ ├── FindSndFile.cmake │ │ └── FindOpus.cmake │ ├── docs │ │ ├── SRC.png │ │ ├── paypal.png │ │ ├── foo_dsp_src9.png │ │ ├── _config.yml │ │ ├── CMakeLists.txt │ │ ├── license.md │ │ ├── lists.md │ │ ├── download.md │ │ ├── win32.md │ │ ├── SRC.css │ │ └── _layouts │ │ │ └── default.html │ ├── samplerate.pc.in │ ├── AUTHORS │ ├── Win32 │ │ └── libsamplerate-0.def │ ├── m4 │ │ ├── check_signal.m4 │ │ └── ax_require_defined.m4 │ ├── Octave │ │ ├── generate_filter.m │ │ └── Readme.md │ ├── src │ │ ├── Version_script.in │ │ └── check_asm.sh │ ├── examples │ │ ├── audio_out.h │ │ └── CMakeLists.txt │ ├── COPYING │ ├── tests │ │ ├── util.h │ │ └── downsample_test.c │ └── libsamplerate.spec.in ├── drivers │ ├── asm │ │ ├── .gitignore │ │ ├── nsf_fds.cfg │ │ ├── nes.s │ │ ├── nsf_wrap.s │ │ ├── nsf.cfg │ │ ├── LICENSE.md │ │ └── vibrato.s │ └── build.cmd ├── utils │ ├── ftmath.h │ ├── ftmath.cpp │ ├── handle_ptr.h │ ├── input.h │ └── variadic_minmax.h ├── NoNotifyEdit.h ├── type_safe │ └── detail │ │ ├── force_inline.hpp │ │ ├── all_of.hpp │ │ ├── is_nothrow_swappable.hpp │ │ ├── assign_or_construct.hpp │ │ ├── assert.hpp │ │ ├── map_invoke.hpp │ │ └── aligned_union.hpp ├── APU │ ├── nsfplay │ │ ├── xgm │ │ │ ├── devices │ │ │ │ ├── Sound │ │ │ │ │ ├── nsfplay_math.h │ │ │ │ │ ├── nes_fme7.h │ │ │ │ │ ├── nes_vrc6.h │ │ │ │ │ └── nes_vrc7.h │ │ │ │ └── CPU │ │ │ │ │ └── nes_cpu.h │ │ │ ├── xtypes.h │ │ │ └── debugout.h │ │ └── readme.txt │ ├── ChannelLevelState.h │ ├── mesen │ │ └── LICENSE │ ├── digital-sound-antiques │ │ ├── vrc7tone_mo.h │ │ ├── vrc7tone_kt1.h │ │ ├── vrc7tone_kt2.h │ │ ├── vrc7tone_ft35.h │ │ ├── vrc7tone_rw.h │ │ ├── vrc7tone_nuke.h │ │ ├── vrc7tone_ft36.h │ │ ├── LICENSE │ │ ├── 2413tone.h │ │ └── 281btone.h │ ├── SoundChip2.cpp │ ├── 2A03Chan.h │ ├── MMC5.h │ ├── SoundChip.cpp │ ├── SoundChip.h │ └── Channel.h ├── SeqInstHandler2A03Pulse.cpp ├── SeqInstHandler2A03Pulse.h ├── CustomExporter.h ├── SequenceEditorMessage.h ├── stdafx.cpp ├── ChannelFactory.h ├── Exception.h ├── InstrumentVRC6.h ├── CommandLineExport.h ├── InstrumentS5B.h ├── NoNotifyEdit.cpp ├── InstrumentS5B.cpp ├── InstrumentVRC6.cpp ├── PatternComponent.cpp ├── JsonExporter.h ├── InstHandlerDPCM.h ├── SequenceManager.h ├── gsl │ └── gsl ├── WaveFile.h ├── DPI.h ├── SeqInstHandlerSawtooth.cpp ├── Groove.h ├── InstHandlerVRC7.h ├── ChannelState.cpp ├── Common.h ├── ConfigWindow.h ├── DialogReBar.h ├── DSampleManager.h ├── VisualizerStatic.h ├── OldSequence.h ├── CustomExporters.cpp ├── FTMComponentInterface.h ├── Bookmark.h ├── Clipboard.h ├── VersionCheckerDlg.h ├── InstrumentFactory.h ├── SimpleFile.h ├── ModuleException.cpp ├── SeqInstHandlerS5B.h ├── SeqInstHandlerS5B.cpp ├── ConfigSound.h ├── ChannelState.h ├── ConfigMIDI.h ├── CustomExporters.h ├── VisualizerScope.h ├── SpeedDlg.h ├── HistoryFileDlg.h ├── ModSequenceEditor.h ├── VersionChecker.h ├── ControlPanelDlg.h ├── PerformanceDlg.h ├── InstrumentVRC7.h ├── SequenceSetting.h ├── DPI.cpp ├── ConfigWindow.cpp ├── PatternNote.cpp ├── InstrumentFactory.cpp ├── RecordSettingsDlg.h ├── SequenceManager.cpp ├── SplitKeyboardDlg.h ├── CreateWaveDlg.h ├── WavProgressDlg.h ├── VisualizerSpectrum.h ├── ConfigGUI.h ├── VisualizerBase.cpp ├── StretchDlg.h ├── GotoDlg.h └── TextExporter.h ├── docs ├── resources │ └── Dn-FT app icon.png ├── index.md ├── pull_request_template.md ├── Dn-FT_JSON_block_format_v1.1.md ├── enable_asan.md ├── 0CC-FT_effect_type_order.md ├── 0CC-Dn-FT_NSF_driver_update_sequence.md └── Adding_new_chips.md ├── .gitmodules ├── demo ├── DnC1 - Firespike33 - Hellpath.dnm ├── DnC1 - hEYDON - Hell or High Water.dnm ├── DnC1 - AtomicMelodies - Trapped Within a Memory.dnm ├── DnC1 - RushJet1, Mahbod Karamoozian - GOAted Ambition.dnm └── DnC1 - Kot (Yumetaro) - The Wavetable That Doesn't Wanna Be.dnm ├── Dn-FamiTracker.reg ├── release.bat ├── .github ├── actions │ ├── build_matrix │ │ └── action.yml │ └── cache_cc65 │ │ └── action.yml └── workflows │ └── build-artifact.yml ├── Dn-FT_VS_Dependencies.vsconfig ├── version.h └── cmake └── compile-chm.bat /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.ico binary 3 | -------------------------------------------------------------------------------- /name.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define APP_NAME "Dn-FamiTracker" 3 | -------------------------------------------------------------------------------- /cmake_user_end.cmake.example: -------------------------------------------------------------------------------- 1 | # In cmake_user_end, you can modify individual targets. 2 | -------------------------------------------------------------------------------- /res/About.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/About.bmp -------------------------------------------------------------------------------- /cmake_user_begin.cmake.example: -------------------------------------------------------------------------------- 1 | # cmake_user_begin is called before project(). You can set global options. 2 | -------------------------------------------------------------------------------- /res/Document.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Document.ico -------------------------------------------------------------------------------- /res/Inst_FDS.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_FDS.ico -------------------------------------------------------------------------------- /res/Inst_S5B.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_S5B.ico -------------------------------------------------------------------------------- /Source/libsamplerate/cmake/SampleRateConfig.cmake.in: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/SampleRateTargets.cmake) 2 | -------------------------------------------------------------------------------- /res/Inst_2A03.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_2A03.ico -------------------------------------------------------------------------------- /res/Inst_2A07.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_2A07.ico -------------------------------------------------------------------------------- /res/Inst_N163.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_N163.ico -------------------------------------------------------------------------------- /res/Inst_VRC6.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_VRC6.ico -------------------------------------------------------------------------------- /res/Inst_VRC7.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Inst_VRC7.ico -------------------------------------------------------------------------------- /res/LeftArrow.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/LeftArrow.ico -------------------------------------------------------------------------------- /res/RightArrow.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/RightArrow.ico -------------------------------------------------------------------------------- /res/Application.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/Application.ico -------------------------------------------------------------------------------- /res/MainToolbar-16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/MainToolbar-16.bmp -------------------------------------------------------------------------------- /res/MainToolbar-256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/MainToolbar-256.bmp -------------------------------------------------------------------------------- /res/key_black_pressed.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/key_black_pressed.bmp -------------------------------------------------------------------------------- /res/key_white_pressed.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/key_white_pressed.bmp -------------------------------------------------------------------------------- /res/InstrumentToolbar-16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/InstrumentToolbar-16.bmp -------------------------------------------------------------------------------- /res/key_black_unpressed.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/key_black_unpressed.bmp -------------------------------------------------------------------------------- /res/key_white_unpressed.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/key_white_unpressed.bmp -------------------------------------------------------------------------------- /res/InstrumentToolbar-256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/res/InstrumentToolbar-256.bmp -------------------------------------------------------------------------------- /Source/libsamplerate/docs/SRC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/Source/libsamplerate/docs/SRC.png -------------------------------------------------------------------------------- /docs/resources/Dn-FT app icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/docs/resources/Dn-FT app icon.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Dn-help"] 2 | path = Dn-help 3 | url = https://github.com/Dn-Programming-Core-Management/Dn-help.git 4 | branch = release 5 | -------------------------------------------------------------------------------- /Source/libsamplerate/docs/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/Source/libsamplerate/docs/paypal.png -------------------------------------------------------------------------------- /demo/DnC1 - Firespike33 - Hellpath.dnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/demo/DnC1 - Firespike33 - Hellpath.dnm -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Welcome to the Dn-FamiTracker wiki docs! 2 | 3 | TODO: add code documentation and specific tutorials here to help new and coming contributers -------------------------------------------------------------------------------- /Source/libsamplerate/docs/foo_dsp_src9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/Source/libsamplerate/docs/foo_dsp_src9.png -------------------------------------------------------------------------------- /demo/DnC1 - hEYDON - Hell or High Water.dnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/demo/DnC1 - hEYDON - Hell or High Water.dnm -------------------------------------------------------------------------------- /demo/DnC1 - AtomicMelodies - Trapped Within a Memory.dnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/demo/DnC1 - AtomicMelodies - Trapped Within a Memory.dnm -------------------------------------------------------------------------------- /Source/drivers/asm/.gitignore: -------------------------------------------------------------------------------- 1 | *.nsf 2 | *.deb 3 | *.lst 4 | *.nl 5 | *.o 6 | music.asm 7 | music.bin 8 | samples.bin 9 | music_nsf_map.txt 10 | 11 | build/drivers/* 12 | driver_tests/* 13 | -------------------------------------------------------------------------------- /Source/utils/ftmath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include 4 | 5 | // TODO detect errno overflow? honestly it doesn't matter 6 | std::optional parseLong(CString str); 7 | -------------------------------------------------------------------------------- /demo/DnC1 - RushJet1, Mahbod Karamoozian - GOAted Ambition.dnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/demo/DnC1 - RushJet1, Mahbod Karamoozian - GOAted Ambition.dnm -------------------------------------------------------------------------------- /demo/DnC1 - Kot (Yumetaro) - The Wavetable That Doesn't Wanna Be.dnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-Programming-Core-Management/Dn-FamiTracker/HEAD/demo/DnC1 - Kot (Yumetaro) - The Wavetable That Doesn't Wanna Be.dnm -------------------------------------------------------------------------------- /Source/libsamplerate/docs/_config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | author: Erik de Castro Lopo, erikd@mega-nerd.com 3 | description: An audio Sample Rate Conversion library 4 | keywords: libsamplerate, sound, resample, audio, dsp, Linux 5 | version: 0.2.1 6 | 7 | markdown: kramdown 8 | --- 9 | -------------------------------------------------------------------------------- /Source/utils/ftmath.cpp: -------------------------------------------------------------------------------- 1 | #include "ftmath.h" 2 | 3 | std::optional parseLong(CString str) { 4 | char *endptr; 5 | const int radix = 10; 6 | 7 | long out; 8 | out = _tcstol(str, &endptr, radix); 9 | if (*endptr == '\0') { 10 | return out; 11 | } 12 | return {}; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /docs/pull_request_template.md: -------------------------------------------------------------------------------- 1 | This pull request aims to `(specify reason)`. 2 | 3 | (If applicable) This pull request improves upon and supercedes `#`. 4 | 5 | ### Changes in this PR: 6 | 7 | - (cite all changes made in the PR for change log) 8 | - Fixes/addresses issue `#`. 9 | -------------------------------------------------------------------------------- /Source/libsamplerate/samplerate.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: samplerate 7 | Description: An audio Sample Rate Conversion library 8 | Requires: 9 | Version: @VERSION@ 10 | Libs: -L${libdir} -lsamplerate 11 | Libs.private: @LIBS@ 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /Source/drivers/build.cmd: -------------------------------------------------------------------------------- 1 | setlocal 2 | @echo off 3 | cd %~dp0 4 | set drivers=%cd% 5 | cd asm\build || goto :error 6 | 7 | python build_engine.py %1 %2 || goto :error 8 | copy drivers\* %drivers%\ || goto :error 9 | rmdir /s /q drivers || goto :error 10 | goto :EOF 11 | 12 | :error 13 | echo Failed with error #%errorlevel%. 14 | exit /b %errorlevel% 15 | -------------------------------------------------------------------------------- /res/export_report.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |

Export verification failed

6 |
Result string
7 |
8 |
Result string
9 |
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Source/NoNotifyEdit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class NoNotifyEdit : public CEdit { 4 | DECLARE_DYNAMIC(NoNotifyEdit) 5 | 6 | public: 7 | NoNotifyEdit(); 8 | virtual ~NoNotifyEdit() = default; 9 | 10 | protected: 11 | DECLARE_MESSAGE_MAP() 12 | public: 13 | void SetWindowTextNoNotify(LPCTSTR s); 14 | protected: 15 | bool notify; 16 | afx_msg BOOL OnEnChange(); 17 | }; -------------------------------------------------------------------------------- /Source/libsamplerate/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install( 2 | FILES 3 | api.md 4 | api_callback.md 5 | api_full.md 6 | api_misc.md 7 | api_simple.md 8 | bugs.md 9 | download.md 10 | faq.md 11 | history.md 12 | index.md 13 | license.md 14 | lists.md 15 | quality.md 16 | win32.md 17 | SRC.png 18 | DESTINATION 19 | ${CMAKE_INSTALL_DOCDIR}) 20 | -------------------------------------------------------------------------------- /Source/libsamplerate/AUTHORS: -------------------------------------------------------------------------------- 1 | Original author: 2 | 3 | Erik de Castro Lopo 4 | 5 | Current maintainers: 6 | 7 | After the release of version 0.1.9, @erikd transferred the project to 8 | [the libsndfile team](https://github.com/libsndfile) consisting of: 9 | 10 | * Erik de Castro Lopo aka @erikd 11 | * David Seifert aka @SoapGentoo 12 | * Arthur Taylor aka @arthurt 13 | * @evpobr 14 | -------------------------------------------------------------------------------- /Source/libsamplerate/docs/license.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # License 6 | 7 | From its first release in 2002, Secret Rabbit Code was under a dual licensing 8 | scheme where people could chose to use it under the terms of the GNU General 9 | Public License or pay for a commercial use license. 10 | 11 | In 2016, thanks to a generous offer from Epic Games International, Secret Rabbit 12 | Code was relicensed under the 2-clause BSD license. 13 | -------------------------------------------------------------------------------- /Source/type_safe/detail/force_inline.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_FORCE_INLINE_HPP_INCLUDED 6 | #define TYPE_SAFE_DETAIL_FORCE_INLINE_HPP_INCLUDED 7 | 8 | #include 9 | 10 | #define TYPE_SAFE_FORCE_INLINE DEBUG_ASSERT_FORCE_INLINE 11 | 12 | #endif // TYPE_SAFE_DETAIL_FORCE_INLINE_HPP_INCLUDED 13 | -------------------------------------------------------------------------------- /Source/utils/handle_ptr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct CloseHandleT { 7 | void operator()(HANDLE handle) { 8 | if (handle) { 9 | CloseHandle(handle); 10 | } 11 | } 12 | }; 13 | 14 | /// HANDLE is void*, so unique_ptr is a RAII HANDLE. 15 | using HandlePtr = std::unique_ptr; 16 | // https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventa 17 | // >If the function fails, the return value is NULL. 18 | -------------------------------------------------------------------------------- /Source/utils/input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "type_safe/strong_typedef.hpp" 4 | #include 5 | #include 6 | #include 7 | 8 | // Keycode vs character 9 | 10 | namespace ts = type_safe; 11 | 12 | using Keycode = int; 13 | 14 | struct Character : ts::strong_typedef, 15 | ts::strong_typedef_op::equality_comparison, 16 | ts::strong_typedef_op::relational_comparison 17 | { 18 | using strong_typedef::strong_typedef; 19 | }; 20 | 21 | 22 | using Input = std::variant; 23 | -------------------------------------------------------------------------------- /Source/libsamplerate/docs/lists.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Mailing Lists 6 | 7 | There are currently two mailings lists for Secret Rabbit Code: 8 | 9 | - **src-announce\@mega-nerd.com**   10 | [Subscribe](mailto:src-announce-request@mega-nerd.com?subject=subscribe) 11 | 12 | A read only announcement list. 13 | - **src\@mega-nerd.com**   14 | [Subscribe](mailto:src-request@mega-nerd.com?subject=subscribe) 15 | 16 | A general list which will also carry all the email from the announce 17 | list. Posting to this list is restricted to subscribers. 18 | -------------------------------------------------------------------------------- /Source/libsamplerate/docs/download.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Download 6 | 7 | The latest version of Secret Rabbit Code is {{ site.version }}. 8 | 9 | Download it on [GitHub releases page](https://github.com/libsndfile/libsamplerate/releases/latest). 10 | 11 | Compiling libsamplerate is relatively easy. The INSTALL file in the top level 12 | directory gives instructions on compiling and installing libsamplerate on 13 | Unix-like systems (including MacOSX). For Win32 there are instructions in the 14 | docs/ directory of the tarball. These instructions are mirrored 15 | [here](win32.md). 16 | -------------------------------------------------------------------------------- /Source/APU/nsfplay/xgm/devices/Sound/nsfplay_math.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../../xtypes.h" // UINT32 4 | #include // std::max 5 | #include 6 | 7 | namespace xgm { 8 | inline UINT32 value_or(UINT32 x, UINT32 period) { 9 | // See https://docs.google.com/document/d/1BnXwR3Avol7S5YNa3d4duGdbI6GNMwuYWLHuYiMZh5Y/edit#heading=h.lnh9d8j1x3uc 10 | // for discussion on why this was designed to special-case 0. 11 | if (x == 0) { 12 | assert(period > 0); 13 | return std::max(period, (UINT32)1); 14 | } 15 | return x; 16 | } 17 | } -------------------------------------------------------------------------------- /Source/libsamplerate/Win32/libsamplerate-0.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | 3 | src_new @1 4 | src_delete @2 5 | 6 | src_get_name @10 7 | src_get_description @11 8 | src_get_version @12 9 | 10 | src_process @20 11 | src_reset @21 12 | src_set_ratio @22 13 | src_clone @23 14 | 15 | src_error @30 16 | src_strerror @31 17 | 18 | src_simple @40 19 | 20 | src_is_valid_ratio @50 21 | 22 | src_callback_new @60 23 | src_callback_read @61 24 | 25 | src_short_to_float_array @70 26 | src_float_to_short_array @71 27 | src_int_to_float_array @80 28 | src_float_to_int_array @81 29 | 30 | src_get_channels @90 31 | -------------------------------------------------------------------------------- /Source/libsamplerate/m4/check_signal.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_CHECK_SIGNAL(SIGNAME) 2 | dnl 3 | dnl 4 | dnl @category C 5 | dnl @author Erik de Castro Lopo 6 | dnl @version 1.0 Jul 07 2007 7 | 8 | AC_DEFUN([AC_CHECK_SIGNAL], 9 | [AC_CACHE_CHECK(for $1, 10 | ac_cv_signal_$1, 11 | [ 12 | AC_TRY_LINK([ 13 | #include 14 | 15 | ], signal($1, SIG_DFL) ;, ac_cv_signal_$1=yes, ac_cv_signal_$1=no) 16 | 17 | ]) 18 | 19 | if test "$ac_cv_signal_$1" = yes; then 20 | AC_DEFINE(HAVE_$1, 1, 21 | [Define if you have signal $1.]) 22 | fi 23 | ])# AC_CHECK_SIGNAL 24 | 25 | 26 | ## AC_CHECK_SIGNALS 27 | -------------------------------------------------------------------------------- /Source/utils/variadic_minmax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /// Variadic min(). 4 | template 5 | T&& vmin(T&& val) 6 | { 7 | return std::forward(val); 8 | } 9 | 10 | template 11 | auto vmin(T0&& val1, T1&& val2, Ts&&... vs) 12 | { 13 | return (val1 < val2) ? 14 | vmin(val1, std::forward(vs)...) : 15 | vmin(val2, std::forward(vs)...); 16 | } 17 | 18 | template 19 | const T& min(const T& a, const T& b) 20 | { 21 | return (b < a) ? b : a; 22 | } 23 | 24 | template 25 | const T& max(const T& a, const T& b) 26 | { 27 | return (a < b) ? b : a; 28 | } 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Source/APU/mesen/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014-2024 Sour 2 | 3 | This program is free software: you can redistribute it and/or modify it under 4 | the terms of the GNU General Public License as published by the Free Software 5 | Foundation, either version 3 of the License, or (at your option) any later 6 | version. 7 | 8 | This program is distributed in the hope that it will be useful, but WITHOUT ANY 9 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 10 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with 13 | this program. If not, see http://www.gnu.org/licenses/. 14 | -------------------------------------------------------------------------------- /Source/libsamplerate/docs/win32.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Compiling on Win32 6 | 7 | You can use [CMake](https://cmake.org/) to generate Visual Studio project. The 8 | configuration process is described [here](https://cmake.org/runningcmake/). 9 | 10 | The libsamplerate library itself does not require any dependencies, but if you 11 | want to build examples and tests, you will need the [libsndfile](https://github.com/libsndfile/libsndfile) 12 | and [FFTW](http://www.fftw.org/) libraries. The easiest way to install them is 13 | to use a package manager, such as [Vcpkg](https://github.com/microsoft/vcpkg). Their README.md contains detailed 14 | installation instructions for supported platforms. Libsamplerate requires the 15 | `libsndfile` and `fftw3` packages. 16 | -------------------------------------------------------------------------------- /Source/APU/nsfplay/xgm/xtypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _XTYPES_H_ 2 | #define _XTYPES_H_ 3 | 4 | #if defined(_MSC_VER) 5 | #define INLINE __forceinline 6 | #elif defined(__GNUC__) 7 | #define INLINE __inline__ 8 | #elif defined(_MWERKS_) 9 | #define INLINE inline 10 | #else 11 | #define INLINE 12 | #endif 13 | 14 | namespace xgm 15 | { 16 | /** 8bit符号なしの整数型 */ 17 | typedef unsigned char UINT8; 18 | /** 16bit符号なしの整数型 */ 19 | typedef unsigned short UINT16; 20 | /** 32bit符号なしの整数型 */ 21 | typedef unsigned int UINT32; 22 | /** 64bit unsigned */ 23 | typedef unsigned long long UINT64; 24 | /** 8bit符号付き整数型 */ 25 | typedef signed char INT8; 26 | /** 16bit符号付き整数型 */ 27 | typedef signed short INT16; 28 | /** 32bit符号付き整数型 */ 29 | typedef signed int INT32; 30 | /** 64bit signed */ 31 | typedef signed long long INT64; 32 | } 33 | 34 | #endif -------------------------------------------------------------------------------- /Source/drivers/asm/nsf_fds.cfg: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | ZP: start = $00, size = $100, type = rw, file = ""; 3 | RAM: start = $200, size = $600, type = rw, file = ""; 4 | HDR: start = $00, size = $80, type = ro, file = %O; 5 | PRG: start = $8000, size = $40000, type = rw, file = %O; 6 | } 7 | 8 | SEGMENTS { 9 | ZEROPAGE: load = ZP, type = zp; 10 | BSS: load = RAM, type = bss, define = yes; 11 | HEADER1: load = HDR, type = ro; 12 | HEADER2: load = HDR, type = ro, start = $0E, fillval = $0; 13 | HEADER3: load = HDR, type = ro, start = $2E, fillval = $0; 14 | HEADER4: load = HDR, type = ro, start = $4E, fillval = $0; 15 | HEADER5: load = HDR, type = ro, start = $6E; 16 | CODE: load = PRG, type = rw, start = $8000; 17 | DPCM: load = PRG, type = rw, start = $10000; 18 | } 19 | -------------------------------------------------------------------------------- /docs/Dn-FT_JSON_block_format_v1.1.md: -------------------------------------------------------------------------------- 1 | # Dn-FT JSON block format version 1.1 2 | Must always be backwards compatible using a never remove, only add strategy. 3 | 4 | Listed below are all the recognized keywords, with their default values. 5 | 6 | **JSON data is only for optional settings, do not add any tracker or emulator crucial data here!** 7 | 8 | ```JSON 9 | { 10 | // Device mixing offsets, described in centibels. too late to change to millibels. 11 | // range is +- 12 db. 12 | "apu1-offset": 0, 13 | "apu2-offset": 0, 14 | "fds-offset": 0, 15 | "mmc5-offset": 0, 16 | "n163-offset": 0, 17 | "s5b-offset": 0, 18 | "vrc6-offset": 0, 19 | "vrc7-offset": 0, 20 | 21 | // Use better mixing values derived from survey: https://forums.nesdev.org/viewtopic.php?f=2&t=17741 22 | "use-survey-mix": false 23 | } 24 | ``` -------------------------------------------------------------------------------- /Source/drivers/asm/nes.s: -------------------------------------------------------------------------------- 1 | ; decompilation of NSF_CALLER_BIN and NSF_CALLER_BIN_VRC6 in Driver.h 2 | ; decompilation by Persune 2024 3 | 4 | .ifdef ::USE_VRC6 5 | INIT = $8000 6 | PLAY = $8003 7 | .else 8 | INIT = $8008 9 | PLAY = $800B 10 | .endif 11 | 12 | .org $FF80 13 | reset: sei 14 | cld 15 | : lda $2002 16 | bpl :- 17 | : lda $2002 18 | bpl :- 19 | ldx #0 20 | txa 21 | : sta $0200,x 22 | inx 23 | bne :- 24 | .ifdef ::USE_VRC6 25 | ; init banks 26 | lda #$00 27 | sta $8000 28 | lda #$02 29 | sta $C000 30 | .endif 31 | lda #$0F 32 | sta $4015 33 | lda #$0A 34 | sta $4010 35 | lda #$00 36 | ldx #$00 37 | ldy #$00 38 | jsr INIT 39 | lda #$80 40 | sta $2000 41 | lda #$00 42 | sta $2001 43 | 44 | : jmp :- 45 | 46 | nmi: jsr PLAY 47 | irq: rti 48 | 49 | 50 | .org $FFFA 51 | vec: .addr nmi, reset, irq 52 | -------------------------------------------------------------------------------- /Source/drivers/asm/nsf_wrap.s: -------------------------------------------------------------------------------- 1 | ; 2 | ; NSF Header 3 | ; 4 | 5 | .segment "HEADER1" 6 | .byte 'N', 'E', 'S', 'M', $1A ; ID 7 | .byte $01 ; Version 8 | .byte 1 ; Number of songs 9 | .byte 1 ; Start song 10 | .word $8000 ;;; ;; ; LOAD, patched in tracker 11 | .word INIT 12 | .word PLAY 13 | 14 | .segment "HEADER2" 15 | .asciiz "ft driver" ; Name, 32 bytes 16 | 17 | .segment "HEADER3" 18 | .asciiz "" ; Artist, 32 bytes 19 | 20 | .segment "HEADER4" 21 | .asciiz "" ; Copyright, 32 bytes 22 | 23 | .segment "HEADER5" 24 | .word $411A ; NTSC speed 25 | .byte 0, 0, 0, 0, 0, 0, 0, 0 ; Bank values 26 | .word $4E20 ; PAL speed 27 | .byte 0 ; Flags, NTSC 28 | .byte EXPANSION_FLAG ; Expansion audio flags 29 | .byte $00 ; NSF2 flags 30 | .byte $00, $00, $00 ; NSF data length 31 | 32 | ;.include "driver.s" 33 | -------------------------------------------------------------------------------- /Source/APU/nsfplay/xgm/debugout.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEBUGOUT_H_ 2 | #define _DEBUGOUT_H_ 3 | 4 | #ifdef _MSC_VER 5 | 6 | // Prevent windows.h from redefining min and max. 7 | #ifndef WIN32_LEAN_AND_MEAN 8 | #define WIN32_LEAN_AND_MEAN 9 | #endif // WIN32_LEAN_AND_MEAN 10 | #ifndef NOMINMAX 11 | #define NOMINMAX 12 | #endif // NOMINMAX 13 | 14 | #include 15 | #define _CRTDBG_MAP_ALLOC 16 | #include 17 | #include 18 | #include 19 | 20 | namespace xgm 21 | { 22 | #define DEBUG_OUT TRACE 23 | 24 | // overrides the next output sample (nsfplay.cpp) 25 | // use to mark events in WAV output, turn quality high 26 | // only works in _DEBUG build 27 | extern int debug_mark; 28 | } 29 | 30 | #else 31 | #ifdef NDEBUG 32 | #define DEBUG_OUT(...) 33 | #else 34 | #define DEBUG_OUT printf 35 | #endif 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Source/libsamplerate/Octave/generate_filter.m: -------------------------------------------------------------------------------- 1 | function f = generate_filter (cycles, fudge_factor, increment, atten) 2 | 3 | if nargin != 4, 4 | error ("Need four args.") ; 5 | endif 6 | 7 | # Calclate N and make sure it is even. 8 | N = fix (4 * cycles * fudge_factor * increment) ; 9 | 10 | if rem (N, 2) != 0, 11 | N = N - 1 ; 12 | endif 13 | 14 | # Generate the Sinc function. 15 | 16 | m = -((N-1)/2):((N-1)/2) ; 17 | f = sinc (m / fudge_factor / increment) ; 18 | 19 | # Genertate the window function and apply it. 20 | 21 | w = kaiser (N, (atten + 0.5) / 10) ; 22 | w = w' ; 23 | 24 | f = f .* w ; 25 | 26 | f = f / sum (f) ; 27 | 28 | endfunction 29 | 30 | # Do not edit or modify anything in this comment block. 31 | # The arch-tag line is a file identity tag for the GNU Arch 32 | # revision control system. 33 | # 34 | # arch-tag: 7e57a3cb-3f5c-4346-bfcd-4da1e758e2a7 35 | 36 | -------------------------------------------------------------------------------- /Source/libsamplerate/src/Version_script.in: -------------------------------------------------------------------------------- 1 | # 2 | # Export file for libsamplerate 3 | # 4 | # Only the symbols listed in the global section will be callable from 5 | # applications linking to libsamplerate. 6 | # 7 | 8 | @PACKAGE@.so.0.0 9 | { 10 | global: 11 | src_new ; 12 | src_delete ; 13 | src_get_name ; 14 | src_get_description ; 15 | src_get_version ; 16 | src_process ; 17 | src_reset ; 18 | src_error ; 19 | src_strerror ; 20 | src_simple ; 21 | src_is_valid_ratio ; 22 | src_set_ratio ; 23 | 24 | local: 25 | *; 26 | }; 27 | 28 | @PACKAGE@.so.0.1 29 | { 30 | global: 31 | src_callback_new ; 32 | src_callback_read ; 33 | 34 | src_short_to_float_array ; 35 | src_float_to_short_array ; 36 | src_int_to_float_array ; 37 | src_float_to_int_array ; 38 | src_get_channels ; 39 | } @PACKAGE@.so.0.0; 40 | 41 | @PACKAGE@.so.0.2 42 | { 43 | global: 44 | src_clone ; 45 | } @PACKAGE@.so.0.1; 46 | -------------------------------------------------------------------------------- /Source/libsamplerate/docs/SRC.css: -------------------------------------------------------------------------------- 1 | a:link { 2 | color: #FB1465; 3 | } 4 | 5 | a:active, a:visited { 6 | color: #FB1465; 7 | } 8 | 9 | body { 10 | background: black; 11 | color: white; 12 | font-family: arial, helvetica, sans-serif; 13 | } 14 | 15 | h1, h2, h3, h4, h5, h6 { 16 | color: #FB1465; 17 | } 18 | 19 | code, kbd, samp, var { 20 | font-family: courier, monospace; 21 | font-size: 1em; 22 | } 23 | 24 | main { 25 | padding-left: 3%; 26 | padding-right: 3%; 27 | } 28 | 29 | pre { 30 | font-family: courier, monospace; 31 | font-size: 1em; 32 | } 33 | 34 | .image-logo { 35 | display: block; 36 | margin-left: auto; 37 | margin-right: auto; 38 | margin-bottom: 1em; 39 | } 40 | 41 | .indent_block { 42 | margin-left: 10%; 43 | margin-right: 10%; 44 | } 45 | 46 | .nf { 47 | font-weight: bold; 48 | } 49 | 50 | .container { 51 | display: flex; 52 | } 53 | 54 | .content { 55 | flex: 1; 56 | } 57 | -------------------------------------------------------------------------------- /Source/APU/digital-sound-antiques/vrc7tone_mo.h: -------------------------------------------------------------------------------- 1 | /* VRC7 TONES by okazaki@angel.ne.jp (4/10/2004) */ 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 | 0x07,0x21,0x14,0x00,0xee,0xf8,0xff,0xf8, 19 | 0x01,0x31,0x00,0x00,0xf8,0xf7,0xf8,0xf7, 20 | 0x25,0x11,0x00,0x00,0xf8,0xfa,0xf8,0x55, 21 | -------------------------------------------------------------------------------- /Source/SeqInstHandler2A03Pulse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "stdafx.h" 22 | -------------------------------------------------------------------------------- /Source/SeqInstHandler2A03Pulse.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | -------------------------------------------------------------------------------- /Source/CustomExporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "FamiTrackerDoc.h" 5 | #include "FamiTracker.h" 6 | 7 | class CCustomExporter 8 | { 9 | public: 10 | CCustomExporter( void ); 11 | CCustomExporter( const CCustomExporter& other ); 12 | CCustomExporter& operator=( const CCustomExporter& other ); 13 | ~CCustomExporter( void ); 14 | bool load( CString FileName ); 15 | CString const& getName( void ) const; 16 | CString const& getExt( void ) const; 17 | bool Export( CFamiTrackerDocInterface const* doc, const char* fileName ) const; 18 | 19 | private: 20 | CString m_name; 21 | CString m_ext; 22 | CString m_dllFilePath; 23 | HINSTANCE m_dllHandle; 24 | int *m_referenceCount; 25 | const char* (__cdecl *m_GetExt)( void ); 26 | const char* (__cdecl *m_GetName)( void ); 27 | bool (__cdecl *m_Export)( FamitrackerDocInterface const* iface, const char* fileName ); 28 | void incReferenceCount( void ); 29 | void decReferenceCount( void ); 30 | }; 31 | -------------------------------------------------------------------------------- /Source/libsamplerate/examples/audio_out.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 1999-2016, Erik de Castro Lopo 3 | ** All rights reserved. 4 | ** 5 | ** This code is released under 2-clause BSD license. Please see the 6 | ** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING 7 | */ 8 | 9 | typedef struct AUDIO_OUT AUDIO_OUT ; 10 | 11 | typedef int (*get_audio_callback_t) (void *callback_data, float *samples, int frames) ; 12 | 13 | /* A general audio output function (Linux/ALSA, Linux/OSS, Win32, MacOSX, 14 | ** Solaris) which retrieves data using the callback function in the above 15 | ** struct. 16 | ** 17 | ** audio_open - opens the device and returns an anonymous pointer to its 18 | ** own private data. 19 | */ 20 | 21 | AUDIO_OUT *audio_open (int channels, int samplerate) ; 22 | 23 | void audio_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ; 24 | 25 | void audio_close (AUDIO_OUT *audio_data) ; 26 | -------------------------------------------------------------------------------- /Source/drivers/asm/nsf.cfg: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | ZP: start = $00, size = $100, type = rw, file = ""; 3 | RAM: start = $200, size = $600, type = rw, file = ""; 4 | HDR: start = $00, size = $80, type = ro, file = "%O_header"; 5 | PRG: start = $8000, size = $8000, type = ro, file = %O, bank = $00; 6 | } 7 | 8 | SEGMENTS { 9 | ZEROPAGE: load = ZP, type = zp; 10 | BSS: load = RAM, type = bss, define = yes; 11 | HEADER1: load = HDR, type = ro; 12 | HEADER2: load = HDR, type = ro, start = $0E, fillval = $0; 13 | HEADER3: load = HDR, type = ro, start = $2E, fillval = $0; 14 | HEADER4: load = HDR, type = ro, start = $4E, fillval = $0; 15 | HEADER5: load = HDR, type = ro, start = $6E; 16 | NSFDRV: load = PRG, type = ro; 17 | CODE: load = PRG, type = ro; 18 | DPCM: load = PRG, type = ro, start = $C000; 19 | } 20 | 21 | FILES { 22 | # hack to get .dbg symbols to align with code 23 | %O: format = bin; 24 | "%O_header": format = bin; 25 | } -------------------------------------------------------------------------------- /res/Dn-FamiTracker.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | Extension of FamiTracker 9 | 10 | 11 | 19 | 20 | 21 | 22 | 23 | true 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Source/drivers/asm/LICENSE.md: -------------------------------------------------------------------------------- 1 | The original FT NSF driver's source code is explicitly *not* under the 2 | GPL.[^1][^2][^3] 3 | 4 | It is instead source-available, under no explicit license. Based on its usecase, 5 | and jsr's comments [^4], I presume that distribution and modification is 6 | permitted, and attribution is recommended. 7 | 8 | [^1]: 9 | [^2]: 10 | [^3]: 11 | [^4]: 12 | 13 | 0CC-FamiTracker's NSF driver code modifications is licensed under GPL v2, 14 | which may restrict anyone sharing compiled NSFs and binaries without sharing the 15 | assembly source, as they contain machine code that directly correlates to the 16 | NSF driver source. 17 | 18 | 0CC-FT NSF driver modifications are under GPL v2. 19 | 20 | Dn-FT NSF driver modifications are under the same license as 0CC-FT NSF driver 21 | modifications. 22 | -------------------------------------------------------------------------------- /Source/type_safe/detail/all_of.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_ALL_OF_HPP_INCLUDED 6 | #define TYPE_SAFE_DETAIL_ALL_OF_HPP_INCLUDED 7 | 8 | #include 9 | 10 | namespace type_safe 11 | { 12 | namespace detail 13 | { 14 | template 15 | struct bool_sequence 16 | { 17 | }; 18 | 19 | template 20 | using all_of = std::is_same, bool_sequence<(true || Bs)...>>; 21 | 22 | template 23 | using none_of = std::is_same, bool_sequence<(false && Bs)...>>; 24 | 25 | template 26 | using any_of = std::integral_constant::value>; 27 | } 28 | } // namespace type_safe::detail 29 | 30 | #endif // TYPE_SAFE_DETAIL_ALL_OF_HPP_INCLUDED 31 | -------------------------------------------------------------------------------- /Source/APU/nsfplay/readme.txt: -------------------------------------------------------------------------------- 1 | NSFPlay/NSFPlug source code 2 | 3 | This code is maintained by Brad Smith. It is a fork of NSFPlay/NSFPlug by Brezza. The latest version should be available at: 4 | - https://bbbradsmith.github.io/nsfplay/ 5 | 6 | Unstable preview builds will be automatically generated by Appveyor: 7 | - https://ci.appveyor.com/project/bbbradsmith/nsfplay/branch/master/artifacts 8 | 9 | This code contains several modifications to original, see nsfplay.txt for a list of changes. 10 | 11 | I have presumed based on text comments and readme files in the original code that it is distributed freely, and modification and redistribution is permitted. The same permissive license applies to this version of the code I maintain. You may reuse this code without restriction, and no warranty or liability is implied on my part. 12 | 13 | Feel free to contact me with questions or comments. 14 | 15 | Brad Smith 16 | nsfplay AT rainwarrior.ca 17 | http://rainwarrior.ca 18 | 19 | Original NSFPlay/NFSPlug project available at: http://www.pokipoki.org/dsa/ 20 | -------------------------------------------------------------------------------- /Source/libsamplerate/Octave/Readme.md: -------------------------------------------------------------------------------- 1 | # Generating Filter Coefficients 2 | 3 | The scripts below are used in [GNU Octave][GNU Octave] which should be available 4 | on most platforms including Linux, Mac and Windows. 5 | 6 | On Debian and other Debian derived Linux distributions, Octave can be installed 7 | using: `sudo apt install octave octave-signal`. 8 | 9 | Filter coefficients can be generated as follows by running the `octave` command 10 | in the same directory as the scripts and this Readme file: 11 | 12 | ``` 13 | octave:1> pkg load signal 14 | octave:2> f = make_filter (8, 128, 100.3) ; 15 | # f = make_fip_filter (8, 128, 100.3) ; 16 | # Coeff. count : 4922 17 | # Fudge factor : 1.2018769 18 | # Pass band width : 0.0039062499 (should be 0.0039062500) 19 | # Stop band atten. : 100.71 dB 20 | # -3dB band Width : 0.490 21 | # half length : 2464 22 | # increment : 128 23 | ``` 24 | 25 | The parameters above generate the coefficient set used in `src/fastest_coeffs.h`. 26 | 27 | [GNU Octave]: https://www.gnu.org/software/octave/ 28 | -------------------------------------------------------------------------------- /Dn-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\.dnm = "DnFamiTracker.Document" 8 | HKEY_CLASSES_ROOT\.dni = "DnFamiTracker.Instrument" 9 | HKEY_CLASSES_ROOT\DnFamiTracker.Document\shell\open\command = Dn-FamiTracker.EXE %1 10 | HKEY_CLASSES_ROOT\DnFamiTracker.Document\shell\open\ddeexec = [open("%1")] 11 | HKEY_CLASSES_ROOT\DnFamiTracker.Document\shell\open\ddeexec\application = Dn-FamiTracker 12 | ; note: the application is optional 13 | ; (it defaults to the app name in "command") 14 | 15 | HKEY_CLASSES_ROOT\DnFamiTracker.Document = Dn-FamiTracker Module 16 | HKEY_CLASSES_ROOT\DnFamiTracker.Instrument = Dn-FamiTracker Instrument 17 | HKEY_CLASSES_ROOT\DnFamiTracker.Instrument\DefaultIcon = Dn-FamiTracker.EXE,1 18 | HKEY_CLASSES_ROOT\0CCFamiTracker.Document\DefaultIcon = Dn-FamiTracker.EXE,1 19 | -------------------------------------------------------------------------------- /Source/APU/digital-sound-antiques/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/digital-sound-antiques/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/digital-sound-antiques/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/digital-sound-antiques/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/SequenceEditorMessage.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | #include "WinUser.h" 24 | 25 | enum { 26 | WM_SIZE_CHANGE = WM_USER, 27 | WM_CURSOR_CHANGE, 28 | WM_SEQUENCE_CHANGED, 29 | WM_SETTING_CHANGED, // // // 30 | }; 31 | -------------------------------------------------------------------------------- /Source/libsamplerate/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(ALSA) 2 | set(HAVE_ALSA ${ALSA_FOUND} PARENT_SCOPE) 3 | # ALSA::ALSA target is exported since CMake >= 3.12, create it for 4 | # old CMake versions 5 | if(ALSA_FOUND) 6 | if(NOT TARGET ALSA::ALSA) 7 | add_library(ALSA::ALSA UNKNOWN IMPORTED) 8 | set_target_properties(ALSA::ALSA PROPERTIES 9 | INTERFACE_INCLUDE_DIRECTORIES "${ALSA_INCLUDE_DIRS}" 10 | IMPORTED_LOCATION "${ALSA_LIBRARIES}") 11 | endif() 12 | endif() 13 | 14 | add_executable(timewarp-file timewarp-file.c) 15 | target_link_libraries(timewarp-file 16 | PRIVATE 17 | samplerate 18 | $<$:${SNDFILE_TARGET}>) 19 | 20 | add_executable(varispeed-play varispeed-play.c audio_out.c audio_out.h) 21 | target_link_libraries(varispeed-play 22 | PRIVATE 23 | samplerate 24 | $<$:${SNDFILE_TARGET}>) 25 | if(WIN32) 26 | target_link_libraries(varispeed-play PRIVATE winmm) 27 | elseif(APPLE) 28 | target_link_libraries(varispeed-play PRIVATE "-framework CoreAudio") 29 | elseif(ALSA_FOUND) 30 | target_link_libraries(varispeed-play PRIVATE ALSA::ALSA) 31 | endif() 32 | -------------------------------------------------------------------------------- /Source/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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/digital-sound-antiques/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 | -------------------------------------------------------------------------------- /docs/enable_asan.md: -------------------------------------------------------------------------------- 1 | # How to manually enable ASAN builds in Dn-FT: 2 | 3 | As of commit `f5d17004ec4c87912e3f5f16bac5c53bbc2b65ea`, ASAN builds are integrated within the solution. However, for earlier commits, this may be used as a guide. 4 | 5 | 1. Open in Visual Studio 2022. 6 | 7 | 2. Configure project properties as shown: 8 | 9 | Project -> Dn-FamiTracker Properties 10 | - Configuration Properties 11 | - Advanced 12 | - Use of MFC: Use MFC in a Shared DLL 13 | - C/C++ 14 | - General 15 | - Debug Information Format: Program Database (/Zi) 16 | - Enable Address Sanitizer: Yes (/fsanitize=address) 17 | - Code Generation 18 | - Runtime Library: set to DLL multi-threaded 19 | - on Debug builds, Multi-threaded Debug DLL (/MDd) 20 | - on Release builds, Multi-threaded DLL (/MD) 21 | - Linker 22 | - General 23 | - Enable Incremental Linking: No (/INCREMENTAL:NO) 24 | - Input 25 | - Additional Dependencies 26 | - Use DLL MFC libraries instead of static MFC libraries 27 | - on Debug builds, replace `libcmtd.lib` and `nafxcwd.lib` with `MSVCRTD.lib` 28 | - on Release builds, replace `libcmt.lib` and `nafxcw.lib` with `MSVCRT.lib` 29 | -------------------------------------------------------------------------------- /Source/APU/digital-sound-antiques/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/ChannelFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "Factory.h" 25 | #include "APU/Types.h" 26 | 27 | class CChannelHandler; 28 | 29 | class CChannelFactory : public CFactory 30 | { 31 | public: 32 | CChannelFactory(); 33 | }; 34 | -------------------------------------------------------------------------------- /Source/APU/digital-sound-antiques/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2001-2019 Mitsutaka Okazaki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Source/Exception.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | -------------------------------------------------------------------------------- /release.bat: -------------------------------------------------------------------------------- 1 | rem usage: release.bat configuration platform [commithash] 2 | 3 | rem delete existing distribution files, if it exists 4 | del distribute /q /f 5 | mkdir distribute 6 | 7 | if "%2"=="Win32" ( 8 | goto continue 9 | ) 10 | if "%2"=="x64" ( 11 | goto continue 12 | ) 13 | goto endfile 14 | 15 | :continue 16 | if "%~3"=="" goto compileversion 17 | 18 | cd %2/%1/ 19 | call 7z a -t7z -mx=9 -mmt=3 -m0=LZMA2:d=26:fb=128 -ms=on ..\..\distribute\Dn-FamiTracker_"%~3"_"%~2"_"%~1".7z Dn-FamiTracker.exe Dn-FamiTracker.chm Dn-FamiTracker.pdb vc143.pdb ..\..\docs\CHANGELOG.md ..\..\demo ..\..\Readme.txt ..\..\LICENSE.md ..\..\LICENSE-GPLv2.txt ..\..\LICENSE-GPLv3.txt 20 | cd ..\.. 21 | goto endfile 22 | 23 | :compileversion 24 | for /F "tokens=1,2,3,4,5 delims=, " %%A in (Dn-FamiTracker.rc) do ( 25 | if "%%~A" == "FILEVERSION" ( 26 | set version=v%%B%%C%%D%%E 27 | ) 28 | ) 29 | cd %2/%1/ 30 | call 7z a -t7z -mx=9 -mmt=3 -m0=LZMA2:d=26:fb=128 -ms=on ..\..\distribute\Dn-FamiTracker_%version%_"%~2"_"%~1".7z Dn-FamiTracker.exe Dn-FamiTracker.chm Dn-FamiTracker.pdb vc143.pdb ..\..\docs\CHANGELOG.md ..\..\demo ..\..\Readme.txt ..\..\LICENSE.md ..\..\LICENSE-GPLv2.txt ..\..\LICENSE-GPLv3.txt 31 | cd ..\.. 32 | :endfile 33 | -------------------------------------------------------------------------------- /Source/InstrumentVRC6.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | class CInstrumentVRC6 : public CSeqInstrument { 25 | public: 26 | CInstrumentVRC6() : CSeqInstrument(INST_VRC6) {}; 27 | 28 | public: 29 | static LPCTSTR SEQUENCE_NAME[]; 30 | LPCTSTR GetSequenceName(int Index) const { return SEQUENCE_NAME[Index]; } // // // 31 | }; 32 | -------------------------------------------------------------------------------- /Source/CommandLineExport.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | private: 28 | void PrintCommandlineMessage(CStdioFile &LogFile, std::string &text, bool writelog); 29 | }; -------------------------------------------------------------------------------- /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/InstrumentS5B.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | class CInstrumentS5B : public CSeqInstrument { 25 | public: 26 | CInstrumentS5B() : CSeqInstrument(INST_S5B) {}; // // // 27 | 28 | public: 29 | static LPCTSTR SEQUENCE_NAME[]; 30 | LPCTSTR GetSequenceName(int Index) const { return SEQUENCE_NAME[Index]; } // // // 31 | }; 32 | -------------------------------------------------------------------------------- /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/InstrumentS5B.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | // // // CInstrumentS5B is a subtype of CSeqInstrument. 22 | #include "stdafx.h" // CFile 23 | #include "Instrument.h" 24 | #include "SeqInstrument.h" 25 | #include "InstrumentS5B.h" 26 | 27 | LPCTSTR CInstrumentS5B::SEQUENCE_NAME[] = {_T("Volume"), _T("Arpeggio"), _T("Pitch"), _T("Hi-pitch"), _T("Noise / Mode")}; 28 | -------------------------------------------------------------------------------- /Source/InstrumentVRC6.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | // // // CInstrumentVRC6 is a subtype of CSeqInstrument. 22 | #include "stdafx.h" // CFile 23 | #include "Instrument.h" 24 | #include "SeqInstrument.h" 25 | #include "InstrumentVRC6.h" 26 | 27 | LPCTSTR CInstrumentVRC6::SEQUENCE_NAME[] = {_T("Volume"), _T("Arpeggio"), _T("Pitch"), _T("Hi-pitch"), _T("Pulse Width")}; 28 | -------------------------------------------------------------------------------- /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/PatternComponent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "PatternComponent.h" 22 | 23 | // // // 050B 24 | 25 | CPatternComponent::CPatternComponent(int Arg1) : 26 | m_i002C(Arg1) 27 | { 28 | } 29 | 30 | CPatternComponent::~CPatternComponent() 31 | { 32 | } 33 | 34 | bool CPatternComponent::ContainsPoint(const CPoint &point) const 35 | { 36 | return false; 37 | } 38 | -------------------------------------------------------------------------------- /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/JsonExporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | class CFamiTrackerDoc; // forward declaration 24 | class Tokenizer; 25 | 26 | class CJsonExport : public CObject 27 | { 28 | public: 29 | CJsonExport() {}; 30 | virtual ~CJsonExport() {}; 31 | 32 | // returns an empty string on success, otherwise returns a descriptive error 33 | const CString& ExportFile(LPCTSTR FileName, CFamiTrackerDoc* pDoc); 34 | }; 35 | -------------------------------------------------------------------------------- /Source/InstHandlerDPCM.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "InstHandler.h" 25 | 26 | class CInstHandlerDPCM : public CInstHandler 27 | { 28 | public: 29 | CInstHandlerDPCM(CChannelHandlerInterface *pInterface); 30 | void LoadInstrument(std::shared_ptr pInst) override; 31 | void TriggerInstrument() override; 32 | void ReleaseInstrument() override; 33 | void UpdateInstrument() override; 34 | }; 35 | -------------------------------------------------------------------------------- /Source/SequenceManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | class CSequenceCollection; 24 | 25 | class CSequenceManager 26 | { 27 | public: 28 | CSequenceManager(int Count); 29 | int GetCount() const; 30 | CSequenceCollection *GetCollection(unsigned int Type); 31 | const CSequenceCollection *GetCollection(unsigned int Type) const; 32 | private: 33 | std::vector> m_pCollection; 34 | }; 35 | -------------------------------------------------------------------------------- /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/WaveFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | -------------------------------------------------------------------------------- /Source/libsamplerate/m4/ax_require_defined.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_REQUIRE_DEFINED(MACRO) 8 | # 9 | # DESCRIPTION 10 | # 11 | # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have 12 | # been defined and thus are available for use. This avoids random issues 13 | # where a macro isn't expanded. Instead the configure script emits a 14 | # non-fatal: 15 | # 16 | # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found 17 | # 18 | # It's like AC_REQUIRE except it doesn't expand the required macro. 19 | # 20 | # Here's an example: 21 | # 22 | # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) 23 | # 24 | # LICENSE 25 | # 26 | # Copyright (c) 2014 Mike Frysinger 27 | # 28 | # Copying and distribution of this file, with or without modification, are 29 | # permitted in any medium without royalty provided the copyright notice 30 | # and this notice are preserved. This file is offered as-is, without any 31 | # warranty. 32 | 33 | #serial 2 34 | 35 | AC_DEFUN([AX_REQUIRE_DEFINED], [dnl 36 | m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) 37 | ])dnl AX_REQUIRE_DEFINED 38 | -------------------------------------------------------------------------------- /Source/DPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | class CPoint; 25 | 26 | struct DPI // // // 27 | { 28 | // DPI scaling functions 29 | static int SX(int pt); 30 | static int SY(int pt); 31 | static void ScaleMouse(CPoint &pt); 32 | static void ScaleRect(CRect &r); // // // 33 | 34 | static CRect Rect(int x, int y, int w, int h); // // // 35 | 36 | static void SetScale(int X, int Y); // // // 37 | private: 38 | // DPI variables 39 | static const int DEFAULT_DPI; 40 | static int _dpiX, _dpiY; 41 | }; 42 | -------------------------------------------------------------------------------- /Source/SeqInstHandlerSawtooth.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "stdafx.h" 22 | #include "Sequence.h" 23 | #include "ChannelHandlerInterface.h" 24 | #include "SeqInstHandlerSawtooth.h" 25 | 26 | void CSeqInstHandlerSawtooth::TriggerInstrument() 27 | { 28 | CSeqInstHandler::TriggerInstrument(); 29 | m_bIgnoreDuty = m_pSequence[SEQ_VOLUME] != nullptr && 30 | m_pSequence[SEQ_VOLUME]->GetSetting() == SETTING_VOL_64_STEPS; 31 | } 32 | 33 | bool CSeqInstHandlerSawtooth::IsDutyIgnored() const 34 | { 35 | return m_bIgnoreDuty; 36 | } 37 | -------------------------------------------------------------------------------- /Source/Groove.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | #define MAX_GROOVE_SIZE 128 24 | 25 | class CGroove 26 | { 27 | public: 28 | CGroove(int Speed = 0); 29 | 30 | void Copy(const CGroove *Source); 31 | void Clear(unsigned char Speed); 32 | unsigned char GetEntry(int Index) const; 33 | void SetEntry(unsigned char Index, unsigned char Value); 34 | unsigned char GetSize() const; 35 | void SetSize(unsigned char Size); 36 | float GetAverage() const; 37 | private: 38 | unsigned char m_iLength; 39 | unsigned char m_iEntry[MAX_GROOVE_SIZE]; 40 | }; -------------------------------------------------------------------------------- /Source/InstHandlerVRC7.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "InstHandler.h" 25 | 26 | class CInstHandlerVRC7 : public CInstHandler 27 | { 28 | public: 29 | CInstHandlerVRC7(CChannelHandlerInterface *pInterface, int Vol) : 30 | CInstHandler(pInterface, Vol) { } 31 | void LoadInstrument(std::shared_ptr pInst) override; 32 | void TriggerInstrument() override; 33 | void ReleaseInstrument() override; 34 | void UpdateInstrument() override; 35 | private: 36 | void UpdateRegs(); 37 | bool m_bUpdate = false; 38 | }; 39 | -------------------------------------------------------------------------------- /Source/libsamplerate/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2016, Erik de Castro Lopo 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /Source/libsamplerate/tests/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2002-2016, Erik de Castro Lopo 3 | ** All rights reserved. 4 | ** 5 | ** This code is released under 2-clause BSD license. Please see the 6 | ** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING 7 | */ 8 | 9 | #define ABS(a) (((a) < 0) ? - (a) : (a)) 10 | 11 | #ifndef MAX 12 | #define MAX(a,b) (((a) > (b)) ? (a) : (b)) 13 | #endif 14 | 15 | #ifndef MIN 16 | #define MIN(a,b) (((a) < (b)) ? (a) : (b)) 17 | #endif 18 | 19 | #define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0]))) 20 | 21 | void gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len) ; 22 | 23 | void save_oct_float (char *filename, float *input, int in_len, float *output, int out_len) ; 24 | void save_oct_double (char *filename, double *input, int in_len, double *output, int out_len) ; 25 | 26 | void interleave_data (const float *in, float *out, int frames, int channels) ; 27 | 28 | void deinterleave_data (const float *in, float *out, int frames, int channels) ; 29 | 30 | void reverse_data (float *data, int datalen) ; 31 | 32 | double calculate_snr (float *data, int len, int expected_peaks) ; 33 | 34 | const char * get_cpu_name (void) ; 35 | 36 | #define ASSERT(condition) \ 37 | if (!(condition)) \ 38 | { printf ("Condition failed on Line %d : %s\n\n", __LINE__, #condition) ; \ 39 | exit (1) ; \ 40 | } ; 41 | 42 | -------------------------------------------------------------------------------- /docs/0CC-FT_effect_type_order.md: -------------------------------------------------------------------------------- 1 | # 0CC vs FT effect type order 2 | 3 | 0CC for some reason uses a slightly different effects type order within the tracker, but converts to FT 050B+ effects type order when saved to a file. 4 | 5 | In Dn-FT v.0.5.0.0, this conversion logic was disturbed, resulting in 0CC effects type order not being properly converted back to FT 050B+ when saving. This issue has been fixed in [commit df78460](https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker/commit/df78460aae403daf2bb68891c788248bbc8a8a02). 6 | 7 | For devs: please increment PATTERNS block version immediately. 8 | 9 | ``` 10 | After EF_SUNSOFT_ENV_LO (Jxx S5B), 11 | FT order: 12 | EF_NOTE_RELEASE (Lxx) 13 | EF_GROOVE (Oxx) 14 | EF_TRANSPOSE (Txy) 15 | EF_N163_WAVE_BUFFER (Zxx N163) 16 | EF_FDS_VOLUME (Exx FDS) 17 | EF_FDS_MOD_BIAS (Zxx FDS) 18 | EF_SUNSOFT_NOISE (Wxx S5B) 19 | EF_VRC7_PORT (Hxx VRC7) 20 | EF_VRC7_WRITE (Ixx VRC7) 21 | 22 | 0CC order: 23 | EF_SUNSOFT_NOISE (Wxx S5B) 24 | EF_VRC7_PORT (Hxx VRC7) 25 | EF_VRC7_WRITE (Ixx VRC7) 26 | EF_NOTE_RELEASE (Lxx) 27 | EF_GROOVE (Oxx) 28 | EF_TRANSPOSE (Txy) 29 | EF_N163_WAVE_BUFFER (Zxx N163) 30 | EF_FDS_VOLUME (Exx FDS) 31 | EF_FDS_MOD_BIAS (Zxx FDS) 32 | ``` 33 | -------------------------------------------------------------------------------- /Source/ChannelState.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include 22 | #include "ChannelState.h" 23 | 24 | stChannelState::stChannelState() : 25 | ChannelIndex(-1), 26 | Instrument(MAX_INSTRUMENTS), 27 | Volume(MAX_VOLUME), 28 | Effect_LengthCounter(-1), 29 | Effect_AutoFMMult(-1) 30 | { 31 | memset(Effect, -1, EF_COUNT * sizeof(int)); 32 | std::fill(std::begin(Echo), std::end(Echo), -1); 33 | } 34 | 35 | stFullState::stFullState(int Count) : 36 | State(new stChannelState[Count]()), 37 | Tempo(-1), 38 | Speed(-1), 39 | GroovePos(-1) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /Source/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | -------------------------------------------------------------------------------- /.github/actions/build_matrix/action.yml: -------------------------------------------------------------------------------- 1 | name: Dn-FamiTracker build matrix 2 | description: Builds all given configurations and platforms/ 3 | inputs: 4 | configuration: 5 | description: "Configuration" 6 | required: true 7 | platform: 8 | description: "Platform" 9 | required: true 10 | commithash: 11 | description: "Commit SHA hash" 12 | required: false 13 | default: dev 14 | runs: 15 | using: "composite" 16 | steps: 17 | - uses: actions/checkout@v4 18 | with: 19 | submodules: "recursive" 20 | fetch-depth: 0 21 | - uses: r-lib/actions/setup-pandoc@v2 22 | with: 23 | pandoc-version: '3.1.8' 24 | - uses: actions/setup-python@v5 25 | with: 26 | python-version: '3.12' 27 | - uses: actions/cache/restore@v4 28 | id: cache_cc65 29 | with: 30 | path: ${{ env.cc65_path }} 31 | key: ${{ runner.os }}-cc65-${{ env.cc65_ref }}-${{ hashFiles('.github/actions/cache_cc65/*') }} 32 | - name: Set CC65 PATH 33 | run: echo "${{ env.cc65_path }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 34 | shell: powershell 35 | - name: Build program 36 | shell: cmd 37 | run: | 38 | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat" 39 | call msbuild -m:5 -nologo -p:Configuration="${{ inputs.configuration }}" -p:Platform="${{ inputs.platform }}" 40 | if %ERRORLEVEL%==1 exit %ERRORLEVEL% -------------------------------------------------------------------------------- /Source/ConfigWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | -------------------------------------------------------------------------------- /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.Roslyn.LanguageServices", 9 | "Microsoft.VisualStudio.Component.TextTemplating", 10 | "Microsoft.VisualStudio.Component.IntelliCode", 11 | "Microsoft.VisualStudio.Component.VC.CoreIde", 12 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", 13 | "Microsoft.VisualStudio.Component.Graphics.Tools", 14 | "Microsoft.VisualStudio.Component.VC.DiagnosticTools", 15 | "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", 16 | "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", 17 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake", 18 | "Microsoft.VisualStudio.Component.VC.CMake.Project", 19 | "Microsoft.VisualStudio.Component.VC.ATL", 20 | "Microsoft.VisualStudio.Component.VC.ATLMFC", 21 | "Microsoft.VisualStudio.Component.VC.ATL.Spectre", 22 | "Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre", 23 | "Microsoft.VisualStudio.Component.VC.ASAN", 24 | "Microsoft.VisualStudio.Component.Windows10SDK.20348", 25 | "Microsoft.Component.VC.Runtime.UCRTSDK", 26 | "Microsoft.VisualStudio.Workload.NativeDesktop", 27 | "Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre" 28 | ] 29 | } -------------------------------------------------------------------------------- /Source/DSampleManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "DSample.h" 25 | 26 | class CDSampleManager 27 | { 28 | public: 29 | CDSampleManager(); 30 | const CDSample *GetDSample(unsigned Index) const; 31 | bool SetDSample(unsigned Index, CDSample *pSamp); 32 | bool IsSampleUsed(unsigned Index) const; 33 | unsigned int GetSampleCount() const; 34 | unsigned int GetFirstFree() const; 35 | unsigned int GetTotalSize() const; 36 | static const unsigned MAX_DSAMPLES; 37 | private: 38 | std::vector> m_pDSample; 39 | unsigned int m_iTotalSize; 40 | }; 41 | -------------------------------------------------------------------------------- /Source/VisualizerStatic.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 letter, int xPos, int yPos, const COLORREF &Color); // // // 39 | 40 | CBitmap m_bmpImage; 41 | CBitmap *m_pOldBmp = nullptr; 42 | CDC m_dcImage; 43 | }; 44 | -------------------------------------------------------------------------------- /Source/OldSequence.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | // moved from stSequence 25 | 26 | class CSequence; 27 | 28 | class COldSequence 29 | { 30 | public: 31 | COldSequence(); 32 | void AddItem(char len, char val); 33 | unsigned int GetLength() const; 34 | CSequence *Convert(int Type) const; 35 | std::vector Length; 36 | std::vector Value; 37 | }; 38 | 39 | /* 40 | // Old sequence list, kept for compability 41 | struct stSequence { 42 | unsigned int Count; 43 | signed char Length[CSequence::MAX_SEQUENCE_ITEMS]; 44 | signed char Value[MAX_SEQUENCE_ITEMS]; 45 | }; 46 | */ 47 | -------------------------------------------------------------------------------- /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/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/FTMComponentInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | class CSequenceManager; 24 | class CInstrumentManager; 25 | class CDSampleManager; 26 | class CBookmarkManager; 27 | 28 | class CFTMComponentInterface 29 | { 30 | public: 31 | virtual CSequenceManager *const GetSequenceManager(int InstType) const = 0; 32 | virtual CInstrumentManager *const GetInstrumentManager() const = 0; 33 | virtual CDSampleManager *const GetDSampleManager() const = 0; 34 | virtual CBookmarkManager *const GetBookmarkManager() const = 0; 35 | 36 | virtual void Modify(bool Change) = 0; 37 | virtual void ModifyIrreversible() = 0; 38 | }; 39 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | #include "name.h" 23 | 24 | 25 | #define STR_HELPER(x) #x 26 | #define STR(x) STR_HELPER(x) 27 | 28 | 29 | // Define this for beta builds 30 | // #define WIP 31 | 32 | 33 | #define VERSION_API 0 34 | #define VERSION_MAJ 5 35 | #define VERSION_MIN 2 36 | 37 | #if defined(WIP) 38 | #define VERSION_BLD 9 39 | #else 40 | #define VERSION_BLD 0 41 | #endif 42 | 43 | #define VERSION VERSION_API,VERSION_MAJ,VERSION_MIN 44 | 45 | #define VERSION_STR \ 46 | STR(VERSION_API) "." \ 47 | STR(VERSION_MAJ) "." \ 48 | STR(VERSION_MIN) 49 | 50 | #define APP_NAME_VERSION APP_NAME " " VERSION_STR 51 | -------------------------------------------------------------------------------- /Source/Bookmark.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | #include "FamiTrackerTypes.h" // PatternData 25 | #include "PatternData.h" // stHighlight 26 | 27 | #include 28 | 29 | class CBookmark 30 | { 31 | public: 32 | CBookmark(unsigned Frame = 0, unsigned Row = 0); 33 | unsigned Distance(const CBookmark &other) const; 34 | bool IsEqual(const CBookmark &other) const; // == overridden 35 | bool operator==(const CBookmark &other) const; 36 | bool operator<(const CBookmark &other) const; 37 | 38 | unsigned m_iFrame; 39 | unsigned m_iRow; 40 | stHighlight m_Highlight; 41 | bool m_bPersist; 42 | std::string m_sName; 43 | }; 44 | -------------------------------------------------------------------------------- /Source/APU/digital-sound-antiques/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: User 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 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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/VersionCheckerDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | // CVersionCheckerDlg dialog 24 | 25 | class CVersionCheckerDlg : public CDialog 26 | { 27 | DECLARE_DYNAMIC(CVersionCheckerDlg) 28 | 29 | public: 30 | CVersionCheckerDlg(CWnd* pParent = NULL); // standard constructor 31 | virtual ~CVersionCheckerDlg(); 32 | 33 | 34 | enum { IDD = IDD_VERSION_CHECKER }; 35 | 36 | protected: 37 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 38 | 39 | CString UpdateURL; 40 | 41 | DECLARE_MESSAGE_MAP() 42 | public: 43 | virtual BOOL OnInitDialog(); 44 | afx_msg void OnBnClickedOk(); 45 | afx_msg void OnBnClickedCancel(); 46 | }; -------------------------------------------------------------------------------- /Source/APU/SoundChip2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "../stdafx.h" 22 | #include "SoundChip2.h" 23 | #include "../RegisterState.h" 24 | 25 | CSoundChip2::CSoundChip2() : 26 | m_pRegisterLogger(std::make_unique()) 27 | { 28 | } 29 | 30 | double CSoundChip2::GetFreq(int Channel) const // // // 31 | { 32 | return 0.0; 33 | } 34 | 35 | void CSoundChip2::Log(uint16_t Address, uint8_t Value) // // // 36 | { 37 | // default logger operation 38 | if (m_pRegisterLogger->SetPort(Address)) 39 | m_pRegisterLogger->Write(Value); 40 | } 41 | 42 | CRegisterLogger* CSoundChip2::GetRegisterLogger() const // // // 43 | { 44 | return m_pRegisterLogger.get(); 45 | } 46 | -------------------------------------------------------------------------------- /Source/libsamplerate/tests/downsample_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2008-2016, Erik de Castro Lopo 3 | ** All rights reserved. 4 | ** 5 | ** This code is released under 2-clause BSD license. Please see the 6 | ** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING 7 | */ 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include "config.h" 11 | #endif 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "util.h" 18 | 19 | static void 20 | downsample_test (int converter) 21 | { static float in [1000], out [10] ; 22 | SRC_DATA data ; 23 | 24 | printf (" downsample_test (%-28s) ....... ", src_get_name (converter)) ; 25 | fflush (stdout) ; 26 | 27 | data.src_ratio = 1.0 / 255.0 ; 28 | data.input_frames = ARRAY_LEN (in) ; 29 | data.output_frames = ARRAY_LEN (out) ; 30 | data.data_in = in ; 31 | data.data_out = out ; 32 | 33 | if (src_simple (&data, converter, 1)) 34 | { puts ("src_simple failed.") ; 35 | exit (1) ; 36 | } ; 37 | 38 | puts ("ok") ; 39 | } /* downsample_test */ 40 | 41 | int 42 | main (void) 43 | { 44 | puts ("") ; 45 | 46 | downsample_test (SRC_ZERO_ORDER_HOLD) ; 47 | downsample_test (SRC_LINEAR) ; 48 | #ifdef ENABLE_SINC_FAST_CONVERTER 49 | downsample_test (SRC_SINC_FASTEST) ; 50 | #endif 51 | #ifdef ENABLE_SINC_MEDIUM_CONVERTER 52 | downsample_test (SRC_SINC_MEDIUM_QUALITY) ; 53 | #endif 54 | #ifdef ENABLE_SINC_BEST_CONVERTER 55 | downsample_test (SRC_SINC_BEST_QUALITY) ; 56 | #endif 57 | 58 | puts ("") ; 59 | 60 | return 0 ; 61 | } /* main */ 62 | -------------------------------------------------------------------------------- /Source/InstrumentFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "Instrument.h" 25 | #include "Factory.h" 26 | 27 | /*! 28 | \brief The instrument factory namespace. 29 | \details Including this class will automatically include all other instrument header files. 30 | */ 31 | class CInstrumentFactory : CFactory 32 | { 33 | private: 34 | CInstrumentFactory(); 35 | public: 36 | /*! \brief Creates a new instrument. 37 | \param Type The instrument type, which should be a member of inst_type_t. 38 | \return Pointer to the created instrument, or nullptr if the type is invalid. 39 | */ 40 | static CInstrument *CreateNew(inst_type_t Type); 41 | }; 42 | -------------------------------------------------------------------------------- /Source/type_safe/detail/map_invoke.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_MAP_INVOKE_HPP_INCLUDED 6 | #define TYPE_SAFE_DETAIL_MAP_INVOKE_HPP_INCLUDED 7 | 8 | #include 9 | 10 | namespace type_safe 11 | { 12 | namespace detail 13 | { 14 | template 15 | auto map_invoke(Func&& f, Value&& v, Args&&... args) 16 | -> decltype(std::forward(f)(std::forward(v), std::forward(args)...)) 17 | { 18 | return std::forward(f)(std::forward(v), std::forward(args)...); 19 | } 20 | 21 | template 22 | auto map_invoke(Func&& f, Value&& v) 23 | -> decltype(std::forward(v).*std::forward(f)) 24 | { 25 | return std::forward(v).*std::forward(f); 26 | } 27 | 28 | template 29 | auto map_invoke(Func&& f, Value&& v, Args&&... args) 30 | -> decltype((std::forward(v) 31 | .*std::forward(f))(std::forward(args)...)) 32 | { 33 | return (std::forward(v).*std::forward(f))(std::forward(args)...); 34 | } 35 | } 36 | } // namespace type_safe::detail 37 | 38 | #endif // TYPE_SAFE_MAP_INVOKE_HPP_INCLUDED 39 | -------------------------------------------------------------------------------- /Source/APU/nsfplay/xgm/devices/Sound/nes_vrc6.h: -------------------------------------------------------------------------------- 1 | #ifndef _NES_VRC6_H_ 2 | #define _NES_VRC6_H_ 3 | #include "../device.h" 4 | 5 | namespace xgm 6 | { 7 | 8 | class NES_VRC6:public ISoundChip 9 | { 10 | public: 11 | enum 12 | { 13 | OPT_END 14 | }; 15 | protected: 16 | UINT32 counter[3]; // frequency divider 17 | UINT32 phase[3]; // phase counter 18 | UINT32 freq2[3]; // adjusted frequency 19 | int count14; // saw 14-stage counter 20 | 21 | //int option[OPT_END]; 22 | int mask; 23 | INT32 sm[2][3]; // stereo mix 24 | int duty[2]; 25 | int volume[3]; 26 | int enable[3]; 27 | int gate[3]; 28 | UINT32 freq[3]; 29 | INT16 calc_sqr (int i, UINT32 clocks); 30 | INT16 calc_saw (UINT32 clocks); 31 | bool halt; 32 | int freq_shift; 33 | double clock, rate; 34 | INT32 out[3]; 35 | TrackInfoBasic trkinfo[3]; 36 | 37 | public: 38 | NES_VRC6 (); 39 | ~NES_VRC6 (); 40 | 41 | virtual void Reset (); 42 | virtual void Tick (UINT32 clocks); 43 | virtual UINT32 Render (INT32 b[2]); 44 | virtual bool Read (UINT32 adr, UINT32 & val, UINT32 id=0); 45 | virtual bool Write (UINT32 adr, UINT32 val, UINT32 id=0); 46 | virtual void SetClock (double); 47 | virtual void SetRate (double); 48 | virtual void SetOption (int, int); 49 | virtual void SetMask (int m){ mask = m; } 50 | virtual void SetStereoMix (int trk, xgm::INT16 mixl, xgm::INT16 mixr); 51 | virtual ITrackInfo *GetTrackInfo(int trk); 52 | }; 53 | 54 | } // namespace 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Source/SimpleFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | #include "stdafx.h" 25 | 26 | /*! 27 | \brief An extension of the MFC file class with methods for writing and reading in different 28 | data types. 29 | \details This class replaces CInstrumentFile. 30 | */ 31 | class CSimpleFile : public CFile 32 | { 33 | public: 34 | CSimpleFile(LPCTSTR lpszFileName, UINT nOpenFlags); 35 | 36 | void WriteChar(char Value); 37 | void WriteShort(short Value); 38 | void WriteInt(int Value); 39 | void WriteString(CString Str); 40 | void WriteStringNull(CString Buf); 41 | 42 | char ReadChar(); 43 | short ReadShort(); 44 | int ReadInt(); 45 | CString ReadString(); 46 | CString ReadStringNull(); 47 | }; 48 | -------------------------------------------------------------------------------- /Source/APU/nsfplay/xgm/devices/CPU/nes_cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef _NES_CPU_H_ 2 | #define _NES_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 NES_CPU has been stubbed out in exotracker (compared to nsfplay). 17 | /// This is because exotracker does not emulate the NES 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 NES CPU reduces exotracker's dependencies on nsfplay, 24 | /// simplifies exotracker code, and makes compiliation faster. 25 | /// 26 | /// But it's difficult to delete NES_CPU 27 | /// because NES_DMC and NES_MMC5 each hold a pointer to it. 28 | /// 29 | /// - NES_DMC tells NES_CPU to delay reads, which is inconsequential. 30 | /// - NES_MMC5 depends on NES_CPU::Read() for PCM playback 31 | /// which FamiTracker does not support, and I may not either. 32 | /// I may eventually edit NES_MMC5 to remove PCM playback 33 | /// and not call NES_CPU::Read(). 34 | class NES_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/ModuleException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include 22 | #include "ModuleException.h" 23 | 24 | CModuleException::CModuleException() : 25 | std::exception(), 26 | m_strError(), 27 | m_strFooter() 28 | { 29 | } 30 | 31 | const std::string CModuleException::GetErrorString() const 32 | { 33 | std::string out; 34 | const std::size_t COUNT = m_strError.size(); 35 | for (std::size_t i = 0; i < COUNT; ) { 36 | out += *m_strError[i]; 37 | if (++i == COUNT) break; 38 | out += '\n'; 39 | } 40 | if (m_strFooter) { 41 | out += '\n'; 42 | out += *m_strFooter; 43 | } 44 | return out; 45 | } 46 | 47 | void CModuleException::SetFooter(std::string footer) 48 | { 49 | m_strFooter.reset(new std::string(footer)); 50 | } 51 | -------------------------------------------------------------------------------- /Source/APU/2A03Chan.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "Channel.h" 25 | 26 | class C2A03Chan : public CChannel { // // // 27 | public: 28 | C2A03Chan(CMixer *pMixer, uint8_t Chip, uint8_t ID) : CChannel(pMixer, Chip, ID) { } 29 | 30 | inline uint16_t GetPeriod() const { 31 | return m_iPeriod; 32 | } 33 | 34 | protected: 35 | inline void Mix(int32_t Value) { 36 | if (m_iLastValue != Value) { 37 | m_pMixer->AddValue(m_iChanId, m_iChip, Value, Value, m_iTime); 38 | m_iLastValue = Value; 39 | } 40 | }; 41 | 42 | protected: 43 | // Variables used by channels 44 | uint8_t m_iControlReg; 45 | uint8_t m_iEnabled; 46 | uint16_t m_iPeriod; 47 | uint16_t m_iLengthCounter; 48 | uint32_t m_iCounter; 49 | }; 50 | -------------------------------------------------------------------------------- /Source/SeqInstHandlerS5B.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "SeqInstHandler.h" 25 | 26 | /*! 27 | \brief Class for Sunsoft 5B sequence instrument handlers. 28 | \details The 5B instruments process noise frequency in the duty sequence. 29 | */ 30 | class CSeqInstHandlerS5B : public CSeqInstHandler 31 | { 32 | public: 33 | using CSeqInstHandler::CSeqInstHandler; 34 | 35 | private: 36 | /*! \brief Processes the value retrieved from a sequence. 37 | \return True if the sequence has finished processing. 38 | \param Index The sequence type. 39 | \param Setting The sequence setting. 40 | \param Value The sequence value to be processed. */ 41 | virtual bool ProcessSequence(int Index, unsigned Setting, int Value); 42 | }; 43 | -------------------------------------------------------------------------------- /Source/APU/MMC5.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 override; // // // 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/libsamplerate/docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ page.title }} 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |
18 | 36 |
37 |
38 |
39 | 40 | {{ content }} 41 | 42 |
43 |
44 |
45 |
46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Source/SeqInstHandlerS5B.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "stdafx.h" 22 | #include "Sequence.h" 23 | #include "ChannelHandlerInterface.h" 24 | #include "SeqInstHandlerS5B.h" 25 | 26 | bool CSeqInstHandlerS5B::ProcessSequence(int Index, unsigned Setting, int Value) 27 | { 28 | switch (Index) { 29 | case SEQ_DUTYCYCLE: 30 | if (auto pChan = dynamic_cast(m_pInterface)) { 31 | m_pInterface->SetDutyPeriod(Value & 0xE0); 32 | 33 | if (Value & S5B_MODE_NOISE) { 34 | pChan->SetNoiseFreq(Value & 0x1F); 35 | } 36 | 37 | return true; 38 | 39 | // In chips other than 5B: case SEQ_DUTYCYCLE: 40 | // m_pInterface->SetDutyPeriod(Value); 41 | } 42 | } 43 | return CSeqInstHandler::ProcessSequence(Index, Setting, Value); 44 | } -------------------------------------------------------------------------------- /Source/ConfigSound.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | -------------------------------------------------------------------------------- /docs/0CC-Dn-FT_NSF_driver_update_sequence.md: -------------------------------------------------------------------------------- 1 | # 0CC-Dn-FT NSF driver update sequence 2 | 3 | This doc aims to detail the update order as observed in the NSF driver. 4 | 5 | Ideally, the NSF driver should be the de-facto standard in how FT modules should 6 | behave, but since the tracker has desynced in feature parity, this may not be 7 | the case. 8 | 9 | Regardless, this should serve as a reference as to how the driver updates in 10 | sequence. 11 | 12 | ``` 13 | ft_music_play 14 | (delay handling) 15 | (tempo handling) 16 | ft_do_row_update 17 | (frame handling) 18 | ft_read_channels (foreach channels do:) 19 | ft_read_pattern 20 | ft_read_note 21 | (switch case pattern command) 22 | (handle volume commands) 23 | (handle instrument commands) 24 | (handle effect commands) 25 | ft_push_echo_buffer 26 | (handle note off) 27 | (handle note release) 28 | (load echo buffer) 29 | ft_push_echo_buffer 30 | (handle note) 31 | ft_read_is_done 32 | ft_skip_row_update (when no updates are available) 33 | (tempo handling) 34 | ft_loop_fx_state 35 | (Sxx handling) 36 | (delayed transpose/release handling) 37 | ft_loop_channels (foreach channels do:) 38 | ft_run_effects (handles the rest of the other effects) 39 | ft_run_instrument 40 | ft_calc_period 41 | (Nxy handling) 42 | ft_update_ (foreach chip do:) 43 | (register writes) 44 | ``` -------------------------------------------------------------------------------- /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/ChannelState.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "FamiTrackerTypes.h" // constants 25 | #include 26 | 27 | // // // Channel state information 28 | class stChannelState { 29 | public: 30 | stChannelState(); 31 | 32 | int ChannelIndex; 33 | int Instrument; 34 | int Volume; 35 | int Effect[EF_COUNT]; 36 | int Effect_LengthCounter; 37 | int Effect_AutoFMMult; 38 | int Echo[ECHO_BUFFER_LENGTH + 1]; 39 | }; 40 | 41 | class stFullState { 42 | public: 43 | stFullState(int Count = MAX_CHANNELS); 44 | stFullState(const stFullState &other) = delete; 45 | stFullState& operator=(const stFullState &other) = delete; 46 | 47 | std::unique_ptr State; 48 | int Tempo; 49 | int Speed; 50 | int GroovePos; // -1: disable groove 51 | }; 52 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Source/APU/SoundChip.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "../stdafx.h" 22 | #include "SoundChip.h" 23 | #include "../RegisterState.h" 24 | 25 | CSoundChip::CSoundChip(CMixer *pMixer) : 26 | m_pMixer(pMixer), 27 | m_pRegisterLogger(new CRegisterLogger { }) 28 | { 29 | } 30 | 31 | CSoundChip::~CSoundChip() 32 | { 33 | if (m_pRegisterLogger) 34 | delete m_pRegisterLogger; 35 | } 36 | 37 | double CSoundChip::GetFreq(int Channel) const // // // 38 | { 39 | return 0.0; 40 | } 41 | 42 | void CSoundChip::Log(uint16_t Address, uint8_t Value) // // // 43 | { 44 | // default logger operation 45 | if (m_pRegisterLogger->SetPort(Address)) 46 | m_pRegisterLogger->Write(Value); 47 | } 48 | 49 | CRegisterLogger *CSoundChip::GetRegisterLogger() const // // // 50 | { 51 | return m_pRegisterLogger; 52 | } 53 | -------------------------------------------------------------------------------- /Source/libsamplerate/cmake/FindOgg.cmake: -------------------------------------------------------------------------------- 1 | # - Find ogg 2 | # Find the native ogg includes and libraries 3 | # 4 | # Ogg_INCLUDE_DIRS - where to find ogg.h, etc. 5 | # Ogg_LIBRARIES - List of libraries when using ogg. 6 | # Ogg_FOUND - True if ogg found. 7 | 8 | if(Ogg_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(Ogg_FIND_QUIETLY TRUE) 11 | endif() 12 | 13 | find_package(PkgConfig QUIET) 14 | pkg_check_modules(PC_Ogg QUIET ogg) 15 | 16 | set(Ogg_VERSION ${PC_Ogg_VERSION}) 17 | 18 | find_path(Ogg_INCLUDE_DIR ogg/ogg.h 19 | HINTS 20 | ${PC_Ogg_INCLUDEDIR} 21 | ${PC_Ogg_INCLUDE_DIRS} 22 | ${Ogg_ROOT}) 23 | # MSVC built ogg may be named ogg_static. 24 | # The provided project files name the library with the lib prefix. 25 | find_library(Ogg_LIBRARY 26 | NAMES 27 | ogg 28 | ogg_static 29 | libogg 30 | libogg_static 31 | HINTS 32 | ${PC_Ogg_LIBDIR} 33 | ${PC_Ogg_LIBRARY_DIRS} 34 | ${Ogg_ROOT}) 35 | # Handle the QUIETLY and REQUIRED arguments and set Ogg_FOUND 36 | # to TRUE if all listed variables are TRUE. 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(Ogg 39 | REQUIRED_VARS 40 | Ogg_LIBRARY 41 | Ogg_INCLUDE_DIR 42 | VERSION_VAR 43 | Ogg_VERSION) 44 | 45 | if(Ogg_FOUND) 46 | set(Ogg_LIBRARIES ${Ogg_LIBRARY}) 47 | set(Ogg_INCLUDE_DIRS ${Ogg_INCLUDE_DIR}) 48 | 49 | if(NOT TARGET Ogg::ogg) 50 | add_library(Ogg::ogg UNKNOWN IMPORTED) 51 | set_target_properties(Ogg::ogg PROPERTIES 52 | INTERFACE_INCLUDE_DIRECTORIES "${Ogg_INCLUDE_DIR}" 53 | IMPORTED_LOCATION "${Ogg_LIBRARY}") 54 | endif() 55 | endif() 56 | 57 | mark_as_advanced(Ogg_INCLUDE_DIR Ogg_LIBRARY) 58 | -------------------------------------------------------------------------------- /Source/libsamplerate/src/check_asm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (C) 2004-2011 Erik de Castro Lopo 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 | # This short test script compiles the file src_sinc.c into assembler 21 | # output and the greps the assembler output for the fldcw (FPU Load 22 | # Control Word) instruction which is very detrimental to the perfromance 23 | # of floating point code. 24 | 25 | echo -n " Checking assembler output for bad code : " 26 | 27 | if [ $# -ne 1 ]; then 28 | echo "Error : Need the name of the input file." 29 | exit 1 30 | fi 31 | 32 | filename=$1 33 | 34 | if [ ! -f $filename ];then 35 | echo "Error : Can't find file $filename." 36 | exit 1 37 | fi 38 | 39 | count=`grep fldcw $filename | wc -l` 40 | 41 | if [ $count -gt 0 ]; then 42 | echo -e "\n\nError : found $count bad instructions.\n\n" 43 | exit 1 44 | fi 45 | 46 | echo "ok" 47 | 48 | -------------------------------------------------------------------------------- /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 | powershell -Command "(Get-Content Dn-help\hlp\changelog_shell.htm).Replace('', (pandoc docs/CHANGELOG.md -f gfm -t html5)) | Set-Content -encoding UTF8 Dn-help\hlp\changelog.htm" 4 | echo // Generated Help Map file. Used by Dn-FamiTracker.hhp. > "Dn-help\hlp\HTMLDefines.h" 5 | echo. > "Dn-help\hlp\HTMLDefines.h" 6 | echo // Commands (ID_* and IDM_*) >> "Dn-help\hlp\HTMLDefines.h" 7 | makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 "resource.h" >> "Dn-help\hlp\HTMLDefines.h" 8 | echo. >> "Dn-help\hlp\HTMLDefines.h" 9 | echo // Prompts (IDP_*) >> "Dn-help\hlp\HTMLDefines.h" 10 | makehm /h IDP_,HIDP_,0x30000 "resource.h" >> "Dn-help\hlp\HTMLDefines.h" 11 | echo. >> "Dn-help\hlp\HTMLDefines.h" 12 | echo // Resources (IDR_*) >> "Dn-help\hlp\HTMLDefines.h" 13 | makehm /h IDR_,HIDR_,0x20000 "resource.h" >> "Dn-help\hlp\HTMLDefines.h" 14 | echo. >> "Dn-help\hlp\HTMLDefines.h" 15 | echo // Dialogs (IDD_*) >> "Dn-help\hlp\HTMLDefines.h" 16 | makehm /h IDD_,HIDD_,0x20000 "resource.h" >> "Dn-help\hlp\HTMLDefines.h" 17 | echo. >> "Dn-help\hlp\HTMLDefines.h" 18 | echo // Frame Controls (IDW_*) >> "Dn-help\hlp\HTMLDefines.h" 19 | makehm /h /a "afxhh.h" IDW_,HIDW_,0x50000 "resource.h" >> "Dn-help\hlp\HTMLDefines.h" 20 | start /wait hhc "Dn-help\hlp\Dn-FamiTracker.hhp" 21 | if not exist "Dn-help\hlp\Dn-FamiTracker.chm" goto :HelpError 22 | move "Dn-help\hlp\Dn-FamiTracker.chm" "Dn-FamiTracker.chm" 23 | goto :HelpDone 24 | :HelpError 25 | echo Dn-help\hlp\Dn-FamiTracker.hhp(1) : error:Problem encountered creating help file 26 | echo. 27 | :HelpDone 28 | echo. -------------------------------------------------------------------------------- /Source/ConfigMIDI.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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/VisualizerScope.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "VisualizerBase.h" // // // 25 | #include 26 | 27 | // CVisualizerScope, scope style visualizer 28 | 29 | class CVisualizerScope : public CVisualizerBase 30 | { 31 | public: 32 | CVisualizerScope(bool bBlur); 33 | virtual ~CVisualizerScope(); 34 | 35 | void Create(int Width, int Height) override; 36 | void SetSampleRate(int SampleRate) override; 37 | bool SetScopeData(short const* iSamples, unsigned int iCount) override; 38 | void Draw() override; 39 | void Display(CDC *pDC, bool bPaintMsg) override; 40 | size_t NeededSamples() const; 41 | 42 | private: 43 | void RenderBuffer(); 44 | void ClearBackground(); 45 | 46 | private: 47 | short *m_pWindowBuf; 48 | bool m_bBlur; 49 | 50 | #ifdef _DEBUG 51 | int m_iPeak; 52 | #endif 53 | }; 54 | -------------------------------------------------------------------------------- /docs/Adding_new_chips.md: -------------------------------------------------------------------------------- 1 | # How to add a Chip 2 | 3 | This doc aims to detail how to add a custom chip to Dn-FT, should the 4 | NSF/NSFe/NSF2/INES/INES2.0 update to add new expansion audio. 5 | 6 | Update 2025-01-13: TODO rewrite this in a less passive aggressive tone 7 | 8 | ## Disclaimer 9 | 10 | Dn-FamiTracker's aim is to fill in the gaps of NSF, NSFe and NSF2 features and/or emerging NESDev homebrew standards that 0CC or Vanilla fails to meet due to a lack of maintenance. 11 | 12 | As such, Dn-FT will only implement features present in current NSF/NSFe/NSF2/INES/INES2.0 standards and definitions, keeping in mind the original goal of producing music for the NES/Famicom systems. 13 | 14 | If you want to add different chips from different systems/formats, please direct your requests/efforts to [Furnace](https://github.com/tildearrow/furnace). 15 | 16 | 17 | ## 1. All of these **must be implemented in one go** before you can have a chance to prototype and debug: 18 | 1. Emulation core and emu core class handler. eg. `EPSM.cpp`; `emu_YMF288.cpp` 19 | 1. sound handling and mixing (eg. `APU.cpp`, `Mixer.cpp`, `SoundGen.cpp` implementations) 20 | 1. Channel handler (eg. `ChannelsEPSM.cpp`, `ChannelHandler.cpp`) 21 | 1. Instrument handling (eg. `InstrumentEPSM.cpp`, `InstrumentHandlerEPSM.cpp`, `InstrumentEditorEPSM.cpp`, `SeqInstHandlerEPSM.cpp`) 22 | 1. Document bindings and types (eg. `APU\Types.h`, `ChannelFactory.cpp`, `ChannelMap.cpp`, `ChannelsDlg.cpp`, `DetuneDlg.cpp`, `FamiTrackerDoc.cpp`, `FamiTrackerTypes.cpp`, `FamiTrackerView.cpp`, `TrackerChannel.cpp`) 23 | 24 | ## 2. After prototyping and debugging and making sure everything works okay, be sure to implement the NSF driver 25 | 1. (see [bhop](https://github.com/zeta0134/bhop)) -------------------------------------------------------------------------------- /Source/libsamplerate/libsamplerate.spec.in: -------------------------------------------------------------------------------- 1 | 2 | %define name @PACKAGE@ 3 | %define version @VERSION@ 4 | %define release 1 5 | %define prefix /usr 6 | 7 | Summary: A library to do sample rate conversion for audio. 8 | Name: %{name} 9 | Version: %{version} 10 | Release: %{release} 11 | Prefix: %{prefix} 12 | Copyright: BSD 13 | Group: Libraries/Sound 14 | Source: http://www.mega-nerd.com/SRC/libsamplerate-%{version}.tar.gz 15 | URL: https://github.com/libsndfile/libsamplerate/ 16 | BuildRoot: /var/tmp/%{name}-%{version} 17 | 18 | %description 19 | libsamplerate is a C library capable of arbitrary and time varying 20 | conversions; from downsampling by a factor of 12 to upsampling by the 21 | same factor. The conversion ratio can also vary with time for speeding 22 | up and slowing down effects. 23 | 24 | %package devel 25 | Summary: Libraries, includes, etc to develop libsamplerate applications 26 | Group: Libraries 27 | 28 | %description devel 29 | Libraries, include files, etc you can use to develop libsamplerate applications. 30 | 31 | %prep 32 | %setup 33 | 34 | %build 35 | ./configure --prefix=%{prefix} 36 | make 37 | 38 | %install 39 | if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi 40 | mkdir -p $RPM_BUILD_ROOT 41 | make prefix=$RPM_BUILD_ROOT%{prefix} install 42 | 43 | %clean 44 | if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi 45 | 46 | %files 47 | %defattr(-,root,root) 48 | %doc AUTHORS COPYING ChangeLog INSTALL NEWS README doc 49 | %prefix/lib/libsamplerate.so.* 50 | 51 | %files devel 52 | %defattr(-,root,root) 53 | %{prefix}/lib/libsamplerate.a 54 | %{prefix}/lib/libsamplerate.la 55 | %{prefix}/lib/libsamplerate.so 56 | %{prefix}/include/samplerate.h 57 | %{prefix}/lib/pkgconfig/samplerate.pc 58 | 59 | -------------------------------------------------------------------------------- /Source/SpeedDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | #include "../resource.h" 23 | 24 | extern const int RATE_MIN; 25 | 26 | // CSpeedDlg dialog 27 | 28 | class CSpeedDlg : public CDialog 29 | { 30 | DECLARE_DYNAMIC(CSpeedDlg) 31 | 32 | public: 33 | CSpeedDlg(CWnd* pParent = NULL); // standard constructor 34 | virtual ~CSpeedDlg(); 35 | 36 | // Dialog Data 37 | enum { IDD = IDD_SPEED }; 38 | 39 | protected: 40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 41 | 42 | int m_iSpeed; 43 | 44 | DECLARE_MESSAGE_MAP() 45 | public: 46 | int GetSpeedFromDlg(int InitialSpeed); 47 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 48 | // virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL); 49 | virtual BOOL OnInitDialog(); 50 | afx_msg void OnBnClickedCancel(); 51 | }; 52 | -------------------------------------------------------------------------------- /Source/HistoryFileDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | #include "stdafx.h" 24 | 25 | #include "FamiTracker.h" 26 | //#include "FamiTrackerDoc.h" 27 | #include "Settings.h" 28 | 29 | class HistoryFileDlg : public CFileDialog { 30 | private: 31 | PATHS historyType; 32 | 33 | public: 34 | HistoryFileDlg(PATHS historyType, 35 | BOOL openNotSave, // TRUE for FileOpen, FALSE for FileSaveAs 36 | LPCTSTR defaultExt = NULL, 37 | LPCTSTR defaultName = NULL, 38 | DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, 39 | LPCTSTR lpszFilter = NULL, 40 | CWnd* pParentWnd = NULL, 41 | DWORD dwSize = 0, 42 | BOOL bVistaStyle = TRUE); 43 | virtual INT_PTR DoModal() override; 44 | }; 45 | 46 | 47 | 48 | 49 | // void fileDialog(CFamiTrackerApp theApp, CString & fileName, UINT idTitle, DWORD flags, BOOL openNotSave, PATHS pathType); 50 | -------------------------------------------------------------------------------- /Source/ModSequenceEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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/VersionChecker.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | struct stVersionCheckResult { 30 | int StartUp; 31 | std::string VerInfo; 32 | std::string VerDesc; 33 | std::string URL; 34 | }; 35 | 36 | class CVersionChecker { 37 | public: 38 | explicit CVersionChecker(bool StartUp); 39 | ~CVersionChecker() noexcept; 40 | 41 | bool IsReady() const; 42 | std::optional GetVersionCheckResult(); 43 | 44 | private: 45 | static void ThreadFn(bool startup, std::promise> p) noexcept; 46 | 47 | private: 48 | std::promise> promise_; 49 | std::future> future_ = promise_.get_future(); 50 | std::thread th_; 51 | }; 52 | -------------------------------------------------------------------------------- /Source/ControlPanelDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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/APU/SoundChip.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include // // // 25 | 26 | class CMixer; 27 | class CRegisterLogger; // // // 28 | 29 | class CSoundChip { 30 | public: 31 | CSoundChip(CMixer *pMixer = nullptr); // // // 32 | virtual ~CSoundChip(); 33 | 34 | virtual void Reset() = 0; 35 | virtual void Process(uint32_t Time) = 0; 36 | virtual void EndFrame() = 0; 37 | 38 | virtual void Write(uint16_t Address, uint8_t Value) = 0; 39 | virtual uint8_t Read(uint16_t Address, bool &Mapped) = 0; 40 | 41 | // TODO: unify with definitions in DetuneTable.cpp? 42 | virtual double GetFreq(int Channel) const; // // // 43 | 44 | virtual void Log(uint16_t Address, uint8_t Value); // // // 45 | CRegisterLogger *GetRegisterLogger() const; // // // 46 | 47 | protected: 48 | CMixer *m_pMixer; 49 | CRegisterLogger *m_pRegisterLogger; // // // 50 | }; 51 | -------------------------------------------------------------------------------- /Source/InstrumentVRC7.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | class CInstrumentVRC7 : public CInstrument { 25 | public: 26 | CInstrumentVRC7(); 27 | CInstrument* Clone() const; 28 | void Setup(); 29 | void Store(CDocumentFile *pDocFile); 30 | bool Load(CDocumentFile *pDocFile); 31 | void SaveFile(CInstrumentFile *pFile); 32 | bool LoadFile(CInstrumentFile *pFile, int iVersion); 33 | int Compile(CChunk *pChunk, int Index); 34 | bool CanRelease() const; 35 | 36 | public: 37 | void SetPatch(unsigned int Patch); 38 | unsigned int GetPatch() const; 39 | void SetCustomReg(int Reg, unsigned char Value); // // // 40 | unsigned char GetCustomReg(int Reg) const; // // // 41 | 42 | protected: 43 | virtual void CloneFrom(const CInstrument *pInst); // // // 44 | 45 | private: 46 | unsigned int m_iPatch; 47 | unsigned char m_iRegs[8]; // // // Custom patch settings 48 | }; 49 | -------------------------------------------------------------------------------- /.github/actions/cache_cc65/action.yml: -------------------------------------------------------------------------------- 1 | name: Cache CC65 2 | description: Caches CC65 and builds it from source if missing. (C) jroweboy (MIT). Modified to use MSYS2 for Windows binaries. (C) Persune 2025 3 | inputs: 4 | cc65Ref: 5 | description: "CC65 Git Ref (used to checkout a fixed version)" 6 | required: false 7 | default: "b8211a2921b11b045db0dd0d9ead6972c9b7bbf1" 8 | cc65Path: 9 | description: "CC65 path to cache" 10 | required: false 11 | default: ${{ github.workspace }}\opt\cc65 12 | runs: 13 | using: "composite" 14 | steps: 15 | # Cache CC65 16 | - uses: actions/cache@master 17 | id: cache_cc65 18 | with: 19 | path: ${{ inputs.cc65Path }} 20 | key: ${{ runner.os }}-cc65-${{ inputs.cc65Ref }}-${{ hashFiles('.github/actions/cache_cc65/*') }} 21 | # setup msys2 22 | - uses: msys2/setup-msys2@v2 23 | if: steps.cache_cc65.outputs.cache-hit != 'true' 24 | with: 25 | msystem: UCRT64 26 | install: | 27 | make 28 | mingw-w64-ucrt-x86_64-gcc 29 | cache: true 30 | # Checkout CC65 31 | - uses: actions/checkout@master 32 | if: steps.cache_cc65.outputs.cache-hit != 'true' 33 | with: 34 | repository: cc65/cc65 35 | ref: ${{ inputs.cc65Ref }} 36 | path: './cc65' 37 | # Build CC65 38 | - if: steps.cache_cc65.outputs.cache-hit != 'true' 39 | run: | 40 | cd cc65 41 | PREFIX=$(cygpath -u "${{ inputs.cc65Path }}") make 42 | PREFIX=$(cygpath -u "${{ inputs.cc65Path }}") make install 43 | shell: msys2 {0} 44 | # Add CC65 binaries to path 45 | - run: | 46 | echo "${{ inputs.cc65Path }}\bin" >> $GITHUB_PATH 47 | shell: cmd -------------------------------------------------------------------------------- /Source/SequenceSetting.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | class CSequenceSetting : public CWnd 24 | { 25 | DECLARE_DYNAMIC(CSequenceSetting) 26 | CSequenceSetting(CWnd *pParent); 27 | virtual ~CSequenceSetting(); 28 | public: 29 | void Setup(CFont *pFont); 30 | void SelectSequence(CSequence *pSequence, int Type, int InstrumentType); 31 | 32 | private: 33 | CWnd *m_pParent; 34 | CMenu m_menuPopup; 35 | CFont *m_pFont; 36 | CSequence *m_pSequence; 37 | 38 | static const UINT MENU_ID_BASE, MENU_ID_MAX; // // // 39 | 40 | int m_iInstType; 41 | int m_iType; 42 | bool m_bMouseOver; 43 | 44 | protected: 45 | DECLARE_MESSAGE_MAP() 46 | public: 47 | afx_msg void OnPaint(); 48 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 49 | afx_msg void OnMenuSettingChanged(UINT ID); // // // 50 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 51 | afx_msg void OnMouseLeave(); 52 | }; 53 | -------------------------------------------------------------------------------- /Source/DPI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | #include "stdafx.h" 25 | #include "DPI.h" 26 | 27 | const int DPI::DEFAULT_DPI = 96; 28 | int DPI::_dpiX = DPI::DEFAULT_DPI; 29 | int DPI::_dpiY = DPI::DEFAULT_DPI; 30 | 31 | int DPI::SX(int pt) 32 | { 33 | return ::MulDiv(pt, _dpiX, DPI::DEFAULT_DPI); 34 | } 35 | 36 | int DPI::SY(int pt) 37 | { 38 | return ::MulDiv(pt, _dpiY, DPI::DEFAULT_DPI); 39 | } 40 | 41 | void DPI::ScaleMouse(CPoint &pt) 42 | { 43 | pt.x = SX(pt.x); 44 | pt.y = SY(pt.y); 45 | } 46 | 47 | void DPI::ScaleRect(CRect &r) // // // 48 | { 49 | r.left = SX(r.left); 50 | r.right = SX(r.right); 51 | r.top = SY(r.top); 52 | r.bottom = SY(r.bottom); 53 | } 54 | 55 | CRect DPI::Rect(int x, int y, int w, int h) 56 | { 57 | return CRect {SX(x), SY(y), SX(x + w), SY(y + h)}; 58 | } 59 | 60 | void DPI::SetScale(int X, int Y) // // // 61 | { 62 | _dpiX = X; 63 | _dpiY = Y; 64 | } 65 | -------------------------------------------------------------------------------- /Source/libsamplerate/cmake/FindSndFile.cmake: -------------------------------------------------------------------------------- 1 | # Variables defined: 2 | # SNDFILE_FOUND 3 | # SNDFILE_INCLUDE_DIR 4 | # SNDFILE_LIBRARY 5 | # 6 | # Environment variables used: 7 | # SNDFILE_ROOT 8 | 9 | if(SndFile_INCLUDE_DIR) 10 | # Already in cache, be silent 11 | set(SndFile_FIND_QUIETLY TRUE) 12 | endif(SndFile_INCLUDE_DIR) 13 | 14 | find_package(PkgConfig QUIET) 15 | pkg_check_modules(PC_SndFile QUIET sndfile) 16 | 17 | set(SndFile_VERSION ${PC_SndFile_VERSION}) 18 | 19 | find_package(Vorbis COMPONENTS Enc QUIET) 20 | find_package(FLAC QUIET) 21 | find_package(Opus QUIET) 22 | 23 | find_path(SndFile_INCLUDE_DIR sndfile.h 24 | HINTS 25 | ${PC_SndFile_INCLUDEDIR} 26 | ${PC_SndFile_INCLUDE_DIRS} 27 | ${SndFile_ROOT}) 28 | 29 | find_library(SndFile_LIBRARY NAMES sndfile 30 | HINTS 31 | ${PC_SndFile_LIBDIR} 32 | ${PC_SndFile_LIBRARY_DIRS} 33 | ${SndFile_ROOT}) 34 | 35 | include(FindPackageHandleStandardArgs) 36 | find_package_handle_standard_args(SndFile 37 | REQUIRED_VARS 38 | SndFile_LIBRARY 39 | SndFile_INCLUDE_DIR 40 | VERSION_VAR 41 | SndFile_VERSION) 42 | 43 | if(SndFile_FOUND) 44 | 45 | set(SndFile_LIBRARIES ${SndFile_LIBRARY} ${Vorbis_Enc_LIBRARIES} ${FLAC_LIBRARIES} ${OPUS_LIBRARIES}) 46 | set(SndFile_INCLUDE_DIRS ${SndFile_INCLUDE_DIR} ${Vorbis_Enc_INCLUDE_DIRS} ${FLAC_INCLUDE_DIRS} ${OPUS_INCLUDE_DIRS}) 47 | 48 | if(NOT TARGET SndFile::sndfile) 49 | add_library(SndFile::sndfile UNKNOWN IMPORTED) 50 | set_target_properties(SndFile::sndfile PROPERTIES 51 | INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIR}" 52 | IMPORTED_LOCATION "${SndFile_LIBRARY}" 53 | INTERFACE_LINK_LIBRARIES "Vorbis::vorbisenc;Opus::opus;FLAC::FLAC") 54 | endif() 55 | endif() 56 | 57 | mark_as_advanced(SndFile_LIBRARY SndFile_INCLUDE_DIR) 58 | -------------------------------------------------------------------------------- /Source/ConfigWindow.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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/PatternNote.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "stdafx.h" 22 | #include "PatternNote.h" 23 | 24 | const CString stChanNote::NOTE_NAME[NOTE_RANGE] = { 25 | _T("C-"), _T("C#"), _T("D-"), _T("D#"), 26 | _T("E-"), _T("F-"), _T("F#"), _T("G-"), 27 | _T("G#"), _T("A-"), _T("A#"), _T("B-"), 28 | }; 29 | 30 | const CString stChanNote::NOTE_NAME_FLAT[NOTE_RANGE] = { 31 | _T("C-"), _T("Db"), _T("D-"), _T("Eb"), 32 | _T("E-"), _T("F-"), _T("Gb"), _T("G-"), 33 | _T("Ab"), _T("A-"), _T("Bb"), _T("B-"), 34 | }; 35 | 36 | CString stChanNote::ToString() const 37 | { 38 | switch (Note) { 39 | case NONE: return _T("..."); 40 | case HALT: return _T("---"); 41 | case RELEASE: return _T("==="); 42 | case ECHO: 43 | { 44 | CString str; 45 | str.Format(_T("^-%d"), Octave); 46 | return str; 47 | } 48 | default: 49 | { 50 | CString str; 51 | str.Format(_T("%s%d"), NOTE_NAME[Note - 1], Octave); 52 | return str; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /.github/workflows/build-artifact.yml: -------------------------------------------------------------------------------- 1 | name: build-artifact 2 | on: push 3 | env: 4 | commithash: "" 5 | cc65_path: ${{ github.workspace }}\opt\cc65 6 | # Fix cc65 segfault on 64-bit LLP64 Windows builds #1694 7 | cc65_ref: 2f4e2a34c32c679e4325652e461acce7f615a22e 8 | jobs: 9 | build-cc65: 10 | runs-on: windows-2022 11 | steps: 12 | # pull repo just to get the .yml files 13 | - uses: actions/checkout@v4 14 | with: 15 | submodules: "recursive" 16 | fetch-depth: 0 17 | - uses: ./.github/actions/cache_cc65 18 | with: 19 | cc65Path: ${{ env.cc65_path }} 20 | cc65Ref: ${{ env.cc65_ref }} 21 | build-matrix-artifacts: 22 | needs: build-cc65 23 | runs-on: windows-2022 24 | strategy: 25 | matrix: 26 | platform: [x64, Win32] 27 | configuration: [Release, Debug, ASAN-Release, ASAN-Debug] 28 | steps: 29 | # pull repo just to get the .yml files 30 | - uses: actions/checkout@v4 31 | with: 32 | submodules: "recursive" 33 | fetch-depth: 0 34 | - run: powershell -Command "echo "commithash=$(git describe --tags)" >> $env:GITHUB_ENV" 35 | - name: Build program 36 | uses: ./.github/actions/build_matrix 37 | with: 38 | platform: "${{ matrix.platform }}" 39 | configuration: "${{ matrix.configuration }}" 40 | commithash: "${{ env.commithash }}" 41 | - run: call release.bat ${{ matrix.configuration }} ${{ matrix.platform }} ${{ env.commithash }}_${{ github.run_id }} 42 | shell: cmd 43 | - name: Upload binaries 44 | uses: actions/upload-artifact@v4 45 | with: 46 | name: Dn-FamiTracker_${{ env.commithash }}_${{ github.run_id }}_${{ matrix.platform }}_${{ matrix.configuration }} 47 | path: distribute/*_${{ matrix.platform }}_${{ matrix.configuration }}.7z 48 | -------------------------------------------------------------------------------- /Source/APU/digital-sound-antiques/281btone.h: -------------------------------------------------------------------------------- 1 | /* YMF281B presets by Chabin*/ 2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0: User 3 | 0x62, 0x21, 0x1a, 0x07, 0xf0, 0x6f, 0x00, 0x16, // 1: Electric Strings (form Chabin's patch) 4 | 0x40, 0x10, 0x45, 0x00, 0xf6, 0x83, 0x73, 0x63, // 2: Bow Wow (based on plgDavid's patch, KSL fixed) 5 | 0x13, 0x01, 0x99, 0x00, 0xf2, 0xc3, 0x21, 0x23, // 3: Electric Guitar (similar to YM2413 but different DR(C)) 6 | 0x01, 0x61, 0x0b, 0x0f, 0xf9, 0x64, 0x70, 0x17, // 4: Organ (based on Chabin, TL/DR fixed) 7 | 0x32, 0x21, 0x1e, 0x06, 0xe1, 0x76, 0x01, 0x28, // 5: Clarinet (identical to YM2413) 8 | 0x60, 0x01, 0x82, 0x0e, 0xf9, 0x61, 0x20, 0x27, // 6: Saxophone (based on plgDavid, PM/EG fixed) 9 | 0x21, 0x61, 0x1c, 0x07, 0x84, 0x81, 0x11, 0x07, // 7: Trumpet (similar to YM2413 but different TL/DR(M)) 10 | 0x37, 0x32, 0xc9, 0x01, 0x66, 0x64, 0x40, 0x28, // 8: Street Organ (from Chabin) 11 | 0x01, 0x21, 0x07, 0x03, 0xa5, 0x71, 0x51, 0x07, // 9: Synth Brass (based on Chabin, TL fixed) 12 | 0x06, 0x01, 0x5e, 0x07, 0xf3, 0xf3, 0xf6, 0x13, // A: Electric Piano (based on Chabin, DR/RR/KR fixed) 13 | 0x00, 0x00, 0x18, 0x06, 0xf5, 0xf3, 0x20, 0x23, // B: Bass (based on Chabin, EG fixed) 14 | 0x17, 0xc1, 0x24, 0x07, 0xf8, 0xf8, 0x22, 0x12, // C: Vibraphone (identical to YM2413) 15 | 0x35, 0x64, 0x00, 0x00, 0xff, 0xf3, 0x77, 0xf5, // D: Chimes (from plgDavid) 16 | 0x11, 0x31, 0x00, 0x07, 0xdd, 0xf3, 0xff, 0xfb, // E: Tom Tom II (from plgDavid) 17 | 0x3a, 0x21, 0x00, 0x07, 0x80, 0x84, 0x0f, 0xf5, // F: Noise (based on plgDavid, AR fixed) 18 | 0x01, 0x01, 0x18, 0x0f, 0xdf, 0xf8, 0x6a, 0x6d, // R: Bass Drum (identical to YM2413) 19 | 0x01, 0x01, 0x00, 0x00, 0xc8, 0xd8, 0xa7, 0x68, // R: High-Hat(M) / Snare Drum(C) (identical to YM2413) 20 | 0x05, 0x01, 0x00, 0x00, 0xf8, 0xaa, 0x59, 0x55, // R: Tom-tom(M) / Top Cymbal(C) (identical to YM2413) -------------------------------------------------------------------------------- /Source/InstrumentFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #include "stdafx.h" 23 | #include "InstrumentFactory.h" 24 | 25 | #include "Sequence.h" 26 | #include "DSample.h" 27 | 28 | #include "SeqInstrument.h" 29 | #include "Instrument2A03.h" 30 | #include "InstrumentVRC6.h" 31 | #include "InstrumentFDS.h" 32 | #include "InstrumentVRC7.h" 33 | #include "InstrumentN163.h" 34 | #include "InstrumentS5B.h" 35 | 36 | CInstrumentFactory::CInstrumentFactory() : CFactory() 37 | { 38 | AddProduct(INST_2A03); 39 | AddProduct(INST_VRC6, INST_VRC6); 40 | AddProduct(INST_VRC7); 41 | AddProduct(INST_N163); 42 | AddProduct(INST_FDS); 43 | AddProduct(INST_S5B, INST_S5B); 44 | } 45 | 46 | CInstrument *CInstrumentFactory::CreateNew(inst_type_t Type) // // // TODO: make this non-static 47 | { 48 | static CInstrumentFactory a {}; 49 | return a.Produce(Type); 50 | } 51 | -------------------------------------------------------------------------------- /Source/APU/Channel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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, uint8_t 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/libsamplerate/cmake/FindOpus.cmake: -------------------------------------------------------------------------------- 1 | # - Find opus 2 | # Find the native opus includes and libraries 3 | # 4 | # OPUS_INCLUDE_DIRS - where to find opus.h, etc. 5 | # OPUS_LIBRARIES - List of libraries when using opus. 6 | # OPUS_FOUND - True if Opus found. 7 | 8 | if(OPUS_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(OPUS_FIND_QUIETLY TRUE) 11 | endif() 12 | 13 | find_package(Ogg QUIET) 14 | 15 | find_package(PkgConfig QUIET) 16 | pkg_check_modules(PC_OPUS QUIET opus) 17 | 18 | set(OPUS_VERSION ${PC_OPUS_VERSION}) 19 | 20 | find_path(OPUS_INCLUDE_DIR opus/opus.h 21 | HINTS 22 | ${PC_OPUS_INCLUDEDIR} 23 | ${PC_OPUS_INCLUDE_DIRS} 24 | ${OPUS_ROOT}) 25 | 26 | # MSVC built opus may be named opus_static. 27 | # The provided project files name the library with the lib prefix. 28 | 29 | find_library(OPUS_LIBRARY 30 | NAMES 31 | opus 32 | opus_static 33 | libopus 34 | libopus_static 35 | HINTS 36 | ${PC_OPUS_LIBDIR} 37 | ${PC_OPUS_LIBRARY_DIRS} 38 | ${OPUS_ROOT}) 39 | 40 | # Handle the QUIETLY and REQUIRED arguments and set OPUS_FOUND 41 | # to TRUE if all listed variables are TRUE. 42 | include(FindPackageHandleStandardArgs) 43 | find_package_handle_standard_args(Opus 44 | REQUIRED_VARS 45 | OPUS_LIBRARY 46 | OPUS_INCLUDE_DIR 47 | Ogg_FOUND 48 | VERSION_VAR 49 | OPUS_VERSION) 50 | 51 | if(OPUS_FOUND) 52 | set(OPUS_LIBRARIES ${OPUS_LIBRARY}) 53 | set(OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR} ${Ogg_INCLUDE_DIRS}) 54 | 55 | if(NOT TARGET Opus::opus) 56 | add_library(Opus::opus UNKNOWN IMPORTED) 57 | set_target_properties(Opus::opus PROPERTIES 58 | INTERFACE_INCLUDE_DIRECTORIES "${OPUS_INCLUDE_DIR}" 59 | IMPORTED_LOCATION "${OPUS_LIBRARY}" 60 | INTERFACE_LINK_LIBRARIES Ogg::ogg) 61 | endif() 62 | endif() 63 | 64 | mark_as_advanced(OPUS_INCLUDE_DIR OPUS_LIBRARY) 65 | -------------------------------------------------------------------------------- /Source/RecordSettingsDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | // CRecordSettingsDlg dialog 25 | 26 | struct stRecordSetting; 27 | 28 | class CRecordSettingsDlg : public CDialog 29 | { 30 | DECLARE_DYNAMIC(CRecordSettingsDlg) 31 | 32 | public: 33 | CRecordSettingsDlg(CWnd* pParent = NULL); // standard constructor 34 | virtual ~CRecordSettingsDlg(); 35 | 36 | stRecordSetting *GetRecordSetting(); 37 | 38 | // Dialog Data 39 | enum { IDD = IDD_RECORD_SETTINGS }; 40 | 41 | protected: 42 | int m_iInterval; 43 | int m_iCount; 44 | bool m_bReset; 45 | 46 | protected: 47 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 48 | 49 | DECLARE_MESSAGE_MAP() 50 | public: 51 | virtual BOOL OnInitDialog(); 52 | afx_msg void OnEnChangeEditRecorderInterval(); 53 | afx_msg void OnEnChangeEditRecorderCount(); 54 | afx_msg void OnBnClickedCheckRecorderReset(); 55 | afx_msg void OnEnKillfocusEditRecorderInterval(); 56 | afx_msg void OnEnKillfocusEditRecorderCount(); 57 | }; 58 | -------------------------------------------------------------------------------- /Source/SequenceManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "stdafx.h" 22 | #include 23 | #include 24 | #include "Sequence.h" 25 | #include "SequenceCollection.h" 26 | #include "SequenceManager.h" 27 | 28 | CSequenceManager::CSequenceManager(int Count) 29 | { 30 | m_pCollection.resize(Count); 31 | for (int i = 0; i < Count; ++i) 32 | m_pCollection[i].reset(new CSequenceCollection()); 33 | } 34 | 35 | int CSequenceManager::GetCount() const 36 | { 37 | return static_cast(m_pCollection.size()); 38 | } 39 | 40 | CSequenceCollection *CSequenceManager::GetCollection(unsigned int Index) 41 | { 42 | if (Index >= m_pCollection.size()) return nullptr; 43 | if (!m_pCollection[Index]) 44 | m_pCollection[Index].reset(new CSequenceCollection()); 45 | return m_pCollection[Index].get(); 46 | } 47 | 48 | const CSequenceCollection *CSequenceManager::GetCollection(unsigned int Index) const 49 | { 50 | if (Index >= m_pCollection.size()) return nullptr; 51 | return m_pCollection[Index].get(); 52 | } 53 | -------------------------------------------------------------------------------- /Source/SplitKeyboardDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | // CSplitKeyboardDlg dialog 25 | 26 | class CSplitKeyboardDlg : public CDialog 27 | { 28 | DECLARE_DYNAMIC(CSplitKeyboardDlg) 29 | 30 | public: 31 | CSplitKeyboardDlg(CWnd* pParent = NULL); // standard constructor 32 | virtual ~CSplitKeyboardDlg(); 33 | 34 | bool m_bSplitEnable; 35 | int m_iSplitChannel; 36 | int m_iSplitNote; 37 | int m_iSplitInstrument; 38 | int m_iSplitTranspose; 39 | 40 | static const int MAX_TRANSPOSE; 41 | 42 | // Dialog Data 43 | enum { IDD = IDD_SPLIT_KEYBOARD }; 44 | 45 | protected: 46 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 47 | 48 | DECLARE_MESSAGE_MAP() 49 | public: 50 | virtual BOOL OnInitDialog(); 51 | afx_msg void OnBnClickedCheckSplitEnable(); 52 | afx_msg void OnCbnSelchangeComboSplitNote(); 53 | afx_msg void OnCbnSelchangeComboSplitChan(); 54 | afx_msg void OnCbnSelchangeComboSplitInst(); 55 | afx_msg void OnCbnSelchangeComboSplitTrsp(); 56 | }; 57 | -------------------------------------------------------------------------------- /Source/CreateWaveDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | bool m_isSetup = false; 48 | 49 | DECLARE_MESSAGE_MAP() 50 | public: 51 | afx_msg void OnBnClickedBegin(); 52 | virtual BOOL OnInitDialog(); 53 | afx_msg void OnDeltaposSpinLoop(NMHDR *pNMHDR, LRESULT *pResult); 54 | afx_msg void OnDeltaposSpinTime(NMHDR *pNMHDR, LRESULT *pResult); 55 | afx_msg void OnEnChangeLoop(); 56 | afx_msg void OnEnChangeSeconds(); 57 | }; 58 | -------------------------------------------------------------------------------- /Source/WavProgressDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | int m_iTimerPeriod; // Refresh rate depending on playback 46 | 47 | CString m_sFile; 48 | 49 | public: 50 | bool CancelRender = false; 51 | 52 | protected: 53 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 54 | 55 | DECLARE_MESSAGE_MAP() 56 | public: 57 | virtual BOOL OnInitDialog(); 58 | afx_msg void OnTimer(UINT_PTR nIDEvent); 59 | void OnCancel() override; 60 | }; 61 | -------------------------------------------------------------------------------- /Source/VisualizerSpectrum.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 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 | bool SetSpectrumData(short const* pSamples, unsigned int iCount) override; 41 | void Draw() override; 42 | 43 | protected: 44 | void Transform(short const* 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/ConfigGUI.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | 22 | #pragma once 23 | 24 | // CConfigGUI dialog 25 | 26 | class CConfigGUI : public CPropertyPage 27 | { 28 | DECLARE_DYNAMIC(CConfigGUI) 29 | 30 | public: 31 | CConfigGUI(); // standard constructor 32 | virtual ~CConfigGUI(); 33 | 34 | // Dialog Data 35 | enum { IDD = IDD_CONFIG_GUI }; 36 | 37 | private: 38 | 39 | protected: 40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 41 | 42 | int m_iLowRefreshRate; 43 | int m_iMaxChannelView; 44 | bool m_bPreciseRegPitch; 45 | 46 | void UpdateSliderTexts(); 47 | 48 | DECLARE_MESSAGE_MAP() 49 | public: 50 | virtual BOOL OnInitDialog(); 51 | virtual BOOL OnApply(); 52 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 53 | afx_msg void OnBnClickedSmoothregfreqCheck(); 54 | afx_msg void OnEnKillfocusMaxchanviewEdit(); 55 | afx_msg void OnEnKillfocusIdleRefreshEdit(); 56 | afx_msg void OnEnChangeMaxchanviewEdit(); 57 | afx_msg void OnEnChangeIdleRefreshEdit(); 58 | }; 59 | -------------------------------------------------------------------------------- /Source/VisualizerBase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #include "VisualizerBase.h" 22 | 23 | void CVisualizerBase::Create(int Width, int Height) 24 | { 25 | memset(&m_bmi, 0, sizeof(BITMAPINFO)); 26 | m_bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); 27 | m_bmi.bmiHeader.biBitCount = 32; 28 | m_bmi.bmiHeader.biHeight = -Height; 29 | m_bmi.bmiHeader.biWidth = Width; 30 | m_bmi.bmiHeader.biPlanes = 1; 31 | 32 | m_iWidth = Width; 33 | m_iHeight = Height; 34 | m_pBlitBuffer = std::make_unique(Width * Height); // // // 35 | } 36 | 37 | bool CVisualizerBase::SetScopeData(short const* iSamples, unsigned int iCount) { 38 | return false; 39 | } 40 | 41 | bool CVisualizerBase::SetSpectrumData(short const* iSamples, unsigned int iCount) { 42 | return false; 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/StretchDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | #define STRETCH_MAP_TEST_LEN 16 24 | 25 | 26 | // CStretchDlg dialog 27 | 28 | class CStretchDlg : public CDialog 29 | { 30 | DECLARE_DYNAMIC(CStretchDlg) 31 | 32 | public: 33 | CStretchDlg(CWnd* pParent = NULL); // standard constructor 34 | virtual ~CStretchDlg(); 35 | 36 | // Dialog Data 37 | enum { IDD = IDD_STRETCH }; 38 | 39 | protected: 40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 41 | 42 | void UpdateStretch(); 43 | void UpdateTest(); 44 | 45 | std::vector m_iStretchMap; 46 | bool m_bValid; 47 | 48 | DECLARE_MESSAGE_MAP() 49 | public: 50 | std::vector GetStretchMap(); 51 | virtual BOOL OnInitDialog(); 52 | afx_msg void OnEnChangeEditStretchMap(); 53 | afx_msg void OnBnClickedCancel(); 54 | afx_msg void OnBnClickedButtonStretchExpand(); 55 | afx_msg void OnBnClickedButtonStretchShrink(); 56 | afx_msg void OnBnClickedButtonStretchReset(); 57 | afx_msg void OnBnClickedButtonStretchInvert(); 58 | }; 59 | -------------------------------------------------------------------------------- /Source/GotoDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | 24 | // CGotoDlg dialog 25 | 26 | class CGotoDlg : public CDialog 27 | { 28 | DECLARE_DYNAMIC(CGotoDlg) 29 | 30 | public: 31 | CGotoDlg(CWnd* pParent = NULL); // standard constructor 32 | virtual ~CGotoDlg(); 33 | 34 | // Dialog Data 35 | enum { IDD = IDD_GOTO }; 36 | 37 | protected: 38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 39 | 40 | void CheckDestination() const; 41 | static int GetChipFromString(const CString str); 42 | int GetFinalChannel() const; 43 | 44 | unsigned int m_iDestFrame; 45 | unsigned int m_iDestRow; 46 | unsigned int m_iDestChip; 47 | unsigned int m_iDestChannel; 48 | 49 | CComboBox *m_cChipEdit; 50 | 51 | DECLARE_MESSAGE_MAP() 52 | public: 53 | virtual BOOL OnInitDialog(); 54 | afx_msg void OnEnChangeEditGotoFrame(); 55 | afx_msg void OnEnChangeEditGotoRow(); 56 | afx_msg void OnEnChangeEditGotoChannel(); 57 | afx_msg void OnCbnSelchangeComboGotoChip(); 58 | afx_msg void OnBnClickedOk(); 59 | }; 60 | -------------------------------------------------------------------------------- /Source/TextExporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Dn-FamiTracker - NES/Famicom sound tracker 3 | ** Copyright (C) 2020-2025 D.P.C.M. 4 | ** FamiTracker Copyright (C) 2005-2020 Jonathan Liss 5 | ** 0CC-FamiTracker Copyright (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 3 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, see https://www.gnu.org/licenses/. 19 | */ 20 | 21 | #pragma once 22 | 23 | class CFamiTrackerDoc; // forward declaration 24 | class Tokenizer; 25 | 26 | class CTextExport : public CObject 27 | { 28 | public: 29 | CTextExport(); 30 | virtual ~CTextExport(); 31 | 32 | static const CString& ExportCellText(const stChanNote& stCell, unsigned int nEffects, bool bNoise); // // // 33 | 34 | // returns an empty string on success, otherwise returns a descriptive error 35 | const CString& ImportFile(LPCTSTR FileName, CFamiTrackerDoc *pDoc); 36 | const CString& ExportFile(LPCTSTR FileName, CFamiTrackerDoc *pDoc); 37 | const CString& ExportRows(LPCTSTR FileName, CFamiTrackerDoc *pDoc); // // // 38 | private: // // // 39 | bool ImportHex(CString& sToken, int& i, int line, int column, CString& sResult); 40 | CString ExportString(const CString& s); 41 | bool ImportCellText(CFamiTrackerDoc* pDoc, Tokenizer &t, unsigned int track, unsigned int pattern, unsigned int channel, unsigned int row, CString& sResult); 42 | const char* Charify(CString& s); 43 | }; 44 | --------------------------------------------------------------------------------