mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-01 10:32:40 +00:00
prepare for pre-calculated pitch table
This commit is contained in:
parent
f1145a14ad
commit
43468653a0
5 changed files with 41 additions and 1 deletions
7
src/asm/spc700/player.s
Normal file
7
src/asm/spc700/player.s
Normal file
|
@ -0,0 +1,7 @@
|
|||
; command stream player code for SPC700 architecture.
|
||||
|
||||
csTick:
|
||||
ret
|
||||
|
||||
csInit:
|
||||
ret
|
1
src/asm/spc700/snes.s
Normal file
1
src/asm/spc700/snes.s
Normal file
|
@ -0,0 +1 @@
|
|||
; SNES DivDispatch code.
|
|
@ -267,6 +267,29 @@ struct DivCommand {
|
|||
value2(0) {}
|
||||
};
|
||||
|
||||
struct DivPitchTable {
|
||||
int pitch[(12*128)+1];
|
||||
unsigned char linearity, blockBits;
|
||||
bool period;
|
||||
|
||||
// get pitch
|
||||
int get(int base, int pitch, int pitch2);
|
||||
|
||||
// linear: note
|
||||
// non-linear: get(note,0,0)
|
||||
int getBase(int note);
|
||||
|
||||
// calculate pitch table
|
||||
void init(float tuning, double clock, double divider, int octave, unsigned char linear, bool isPeriod, unsigned char block=0);
|
||||
|
||||
DivPitchTable():
|
||||
linearity(2),
|
||||
blockBits(0),
|
||||
period(false) {
|
||||
memset(pitch,0,sizeof(pitch));
|
||||
}
|
||||
};
|
||||
|
||||
struct DivDelayedCommand {
|
||||
int ticks;
|
||||
DivCommand cmd;
|
||||
|
@ -692,6 +715,11 @@ class DivDispatch {
|
|||
*/
|
||||
virtual void renderSamples(int sysID);
|
||||
|
||||
/**
|
||||
* tell this DivDispatch that the tuning and/or pitch linearity has changed, and therefore the pitch table must be regenerated.
|
||||
*/
|
||||
virtual void notifyPitchTable();
|
||||
|
||||
/**
|
||||
* initialize this DivDispatch.
|
||||
* @param parent the parent DivEngine.
|
||||
|
@ -718,6 +746,7 @@ class DivDispatch {
|
|||
if (chipClock<getClockRangeMin()) chipClock=getClockRangeMin(); \
|
||||
}
|
||||
|
||||
// NOTE: these definitions may be deprecated in the future. see DivPitchTable.
|
||||
// pitch calculation:
|
||||
// - a DivDispatch usually contains four variables per channel:
|
||||
// - baseFreq: this changes on new notes, legato, arpeggio and slides.
|
||||
|
|
|
@ -199,6 +199,9 @@ void DivDispatch::renderSamples(int sysID) {
|
|||
|
||||
}
|
||||
|
||||
void DivDispatch::notifyPitchTable() {
|
||||
}
|
||||
|
||||
int DivDispatch::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3364,7 +3364,7 @@ void FurnaceGUI::drawSettings() {
|
|||
// ok, so you decided to read the code.
|
||||
// these are the cheat codes:
|
||||
// "Debug" - toggles mobile UI
|
||||
// "Nice Amiga cover of the song!" - enables hidden systems (YMU759/SoundUnit/Dummy)
|
||||
// "Nice Amiga cover of the song!" - enables hidden systems (YMU759/Dummy)
|
||||
// "42 63" - enables all instrument types
|
||||
// "4-bit FDS" - enables partial pitch linearity option
|
||||
// "Power of the Chip" - enables options for multi-threaded audio
|
||||
|
|
Loading…
Reference in a new issue