add parameter parsing
This commit is contained in:
parent
fa445d8614
commit
f7080bb2c1
7 changed files with 192 additions and 6 deletions
|
|
@ -2,6 +2,9 @@
|
|||
#include "safeReader.h"
|
||||
#include "../ta-log.h"
|
||||
#include "../audio/sdl.h"
|
||||
#ifdef HAVE_JACK
|
||||
#include "../audio/jack.h"
|
||||
#endif
|
||||
#include "platform/genesis.h"
|
||||
#include "platform/genesisext.h"
|
||||
#include "platform/sms.h"
|
||||
|
|
@ -677,15 +680,38 @@ void DivEngine::play() {
|
|||
|
||||
}
|
||||
|
||||
void DivEngine::setAudio(DivAudioEngines which) {
|
||||
audioEngine=which;
|
||||
}
|
||||
|
||||
void DivEngine::setView(DivStatusView which) {
|
||||
view=which;
|
||||
}
|
||||
|
||||
bool DivEngine::init() {
|
||||
output=new TAAudioSDL;
|
||||
switch (audioEngine) {
|
||||
case DIV_AUDIO_JACK:
|
||||
#ifndef HAVE_JACK
|
||||
logE("Furnace was not compiled with JACK support!\n");
|
||||
return false;
|
||||
#else
|
||||
output=new TAAudioJACK;
|
||||
#endif
|
||||
break;
|
||||
case DIV_AUDIO_SDL:
|
||||
output=new TAAudioSDL;
|
||||
break;
|
||||
default:
|
||||
logE("invalid audio engine!\n");
|
||||
return false;
|
||||
}
|
||||
want.bufsize=1024;
|
||||
want.rate=44100;
|
||||
want.fragments=2;
|
||||
want.inChans=0;
|
||||
want.outChans=2;
|
||||
want.outFormat=TA_AUDIO_FORMAT_F32;
|
||||
want.name="DivAudio";
|
||||
want.name="Furnace";
|
||||
|
||||
output->setCallback(process,this);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,11 @@ enum DivStatusView {
|
|||
DIV_STATUS_COMMANDS
|
||||
};
|
||||
|
||||
enum DivAudioEngines {
|
||||
DIV_AUDIO_JACK=0,
|
||||
DIV_AUDIO_SDL
|
||||
};
|
||||
|
||||
struct DivChannelState {
|
||||
std::vector<DivDelayedCommand> delayed;
|
||||
int note, pitch, portaSpeed, portaNote;
|
||||
|
|
@ -54,6 +59,7 @@ class DivEngine {
|
|||
int changeOrd, changePos, totalTicks, totalCmds, lastCmds, cmdsPerSecond;
|
||||
DivStatusView view;
|
||||
DivChannelState chan[17];
|
||||
DivAudioEngines audioEngine;
|
||||
|
||||
short vibTable[64];
|
||||
|
||||
|
|
@ -83,6 +89,12 @@ class DivEngine {
|
|||
// play
|
||||
void play();
|
||||
|
||||
// set the audio system.
|
||||
void setAudio(DivAudioEngines which);
|
||||
|
||||
// set the view mode.
|
||||
void setView(DivStatusView which);
|
||||
|
||||
// initialize the engine.
|
||||
bool init();
|
||||
|
||||
|
|
@ -101,6 +113,7 @@ class DivEngine {
|
|||
lastCmds(0),
|
||||
cmdsPerSecond(0),
|
||||
view(DIV_STATUS_PATTERN),
|
||||
audioEngine(DIV_AUDIO_SDL),
|
||||
temp{0,0},
|
||||
prevSample{0,0} {}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ static const int16_t Phase_Filter[2][7] =
|
|||
|
||||
inline void PCE_PSG::UpdateOutputSub(const int32_t timestamp, psg_channel *ch, const int32_t samp0, const int32_t samp1)
|
||||
{
|
||||
if (samp0!=0)
|
||||
HRBufs[0][0]+=samp0;
|
||||
HRBufs[1][0]+=samp1;
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue