mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
Merge branch 'master' of https://github.com/tildearrow/furnace into x1_010
This commit is contained in:
commit
13e586fab2
4 changed files with 15 additions and 1 deletions
|
@ -29,6 +29,12 @@
|
||||||
|
|
||||||
#define addWrite(a,v) regWrites.push_back(DivRegWrite(a,v));
|
#define addWrite(a,v) regWrites.push_back(DivRegWrite(a,v));
|
||||||
|
|
||||||
|
// HOW TO ADD A NEW COMMAND:
|
||||||
|
// add it to this enum. then see playback.cpp.
|
||||||
|
// there is a const char* cmdName[] array, which contains the command
|
||||||
|
// names as strings for the commands (and other debug stuff).
|
||||||
|
//
|
||||||
|
// if you miss it, the program will crash or misbehave at some point.
|
||||||
enum DivDispatchCmds {
|
enum DivDispatchCmds {
|
||||||
DIV_CMD_NOTE_ON=0,
|
DIV_CMD_NOTE_ON=0,
|
||||||
DIV_CMD_NOTE_OFF,
|
DIV_CMD_NOTE_OFF,
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
#include "dataErrors.h"
|
#include "dataErrors.h"
|
||||||
#include "../ta-utils.h"
|
#include "../ta-utils.h"
|
||||||
|
|
||||||
|
// NOTICE!
|
||||||
|
// before adding new instrument types to this struct, please ask me first.
|
||||||
|
// absolutely zero support granted to conflicting formats.
|
||||||
enum DivInstrumentType {
|
enum DivInstrumentType {
|
||||||
DIV_INS_STD=0,
|
DIV_INS_STD=0,
|
||||||
DIV_INS_FM=1,
|
DIV_INS_FM=1,
|
||||||
|
|
|
@ -122,7 +122,11 @@ void DivPlatformPCSpeaker::beepFreq(int freq) {
|
||||||
gettimeofday(&ie.time,NULL);
|
gettimeofday(&ie.time,NULL);
|
||||||
ie.type=EV_SND;
|
ie.type=EV_SND;
|
||||||
ie.code=SND_TONE;
|
ie.code=SND_TONE;
|
||||||
ie.value=freq;
|
if (freq>0) {
|
||||||
|
ie.value=chipClock/freq;
|
||||||
|
} else {
|
||||||
|
ie.value=0;
|
||||||
|
}
|
||||||
if (write(beepFD,&ie,sizeof(struct input_event))<0) {
|
if (write(beepFD,&ie,sizeof(struct input_event))<0) {
|
||||||
perror("error while writing frequency!");
|
perror("error while writing frequency!");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -42,6 +42,7 @@ const char* notes[12]={
|
||||||
"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"
|
"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// update this when adding new commands.
|
||||||
const char* cmdName[DIV_CMD_MAX]={
|
const char* cmdName[DIV_CMD_MAX]={
|
||||||
"NOTE_ON",
|
"NOTE_ON",
|
||||||
"NOTE_OFF",
|
"NOTE_OFF",
|
||||||
|
|
Loading…
Reference in a new issue