furnace/src/engine/platform/amiga.h

94 lines
2.4 KiB
C
Raw Normal View History

2022-02-14 22:12:20 -05:00
/**
* Furnace Tracker - multi-system chiptune tracker
* Copyright (C) 2021-2022 tildearrow and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
2022-01-15 17:28:33 -05:00
#ifndef _AMIGA_H
#define _AMIGA_H
2022-01-15 15:50:53 -05:00
#include "../dispatch.h"
#include <queue>
#include "../macroInt.h"
class DivPlatformAmiga: public DivDispatch {
struct Channel {
int freq, baseFreq, pitch;
unsigned int audLoc;
unsigned short audLen;
unsigned int audPos;
2022-01-15 17:28:33 -05:00
int audSub;
2022-01-15 15:50:53 -05:00
signed char audDat;
2022-01-15 17:28:33 -05:00
int sample, wave;
2022-01-20 16:56:35 -05:00
unsigned char ins;
int busClock;
2022-01-20 16:56:35 -05:00
int note;
2022-03-14 10:50:52 -04:00
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave, setPos;
2022-01-15 15:50:53 -05:00
signed char vol, outVol;
DivMacroInt std;
Channel():
freq(0),
baseFreq(0),
pitch(0),
audLoc(0),
audLen(0),
audPos(0),
2022-01-15 17:28:33 -05:00
audSub(0),
2022-01-15 15:50:53 -05:00
audDat(0),
sample(-1),
2022-01-15 17:28:33 -05:00
wave(0),
2022-01-15 15:50:53 -05:00
ins(-1),
busClock(0),
2022-01-15 15:50:53 -05:00
note(0),
active(false),
insChanged(true),
freqChanged(false),
keyOn(false),
keyOff(false),
inPorta(false),
2022-01-15 17:28:33 -05:00
useWave(false),
2022-03-14 10:50:52 -04:00
setPos(false),
2022-01-15 15:50:53 -05:00
vol(64),
outVol(64) {}
};
Channel chan[4];
bool isMuted[4];
2022-02-04 17:59:55 -05:00
int sep1, sep2;
2022-01-27 00:29:16 -05:00
friend void putDispatchChan(void*,int,int);
2022-01-15 15:50:53 -05:00
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
2022-01-27 00:29:16 -05:00
void* getChanState(int chan);
2022-01-15 15:50:53 -05:00
void reset();
void forceIns();
void tick();
void muteChannel(int ch, bool mute);
bool isStereo();
bool keyOffAffectsArp(int ch);
2022-01-28 12:59:53 -05:00
void setFlags(unsigned int flags);
2022-01-17 23:59:52 -05:00
void notifyInsChange(int ins);
2022-01-18 00:25:10 -05:00
void notifyWaveChange(int wave);
2022-01-15 15:50:53 -05:00
void notifyInsDeletion(void* ins);
2022-02-03 18:38:57 -05:00
const char** getRegisterSheet();
2022-01-28 12:59:53 -05:00
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
2022-01-15 15:50:53 -05:00
void quit();
};
#endif