initial commit

took me a day to make the base...
...and ~12 hours to write a reader that reads 100% of all demo songs in
1.0
This commit is contained in:
tildearrow 2021-05-11 15:08:08 -05:00
commit 783d56c72a
26 changed files with 1660 additions and 0 deletions

35
src/engine/engine.h Normal file
View file

@ -0,0 +1,35 @@
#include "song.h"
#include "dispatch.h"
#include "../audio/taAudio.h"
struct DivChannelState {
std::vector<DivDelayedCommand> delayed;
int rampSpeed, portaSpeed, portaNote;
int volSpeed;
int vibratoDepth, vibratoRate;
int tremoloDepth, tremoloRate;
};
class DivEngine {
DivSong song;
DivDispatch* dispatch;
TAAudio* output;
TAAudioDesc want, got;
int chans;
bool playing;
bool speedAB;
int ticks, curRow, curOrder;
std::vector<DivChannelState> chan;
public:
// load a .dmf.
bool load(void* f, size_t length);
// save as .dmf.
bool save(FILE* f);
// play
void play();
// initialize the engine.
bool init();
};