furnace/src/engine/platform/amiga.h

93 lines
2.4 KiB
C
Raw Normal View History

2022-02-15 03:12:20 +00: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 22:28:33 +00:00
#ifndef _AMIGA_H
#define _AMIGA_H
2022-01-15 20:50:53 +00: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 22:28:33 +00:00
int audSub;
2022-01-15 20:50:53 +00:00
signed char audDat;
2022-01-15 22:28:33 +00:00
int sample, wave;
2022-01-20 21:56:35 +00:00
unsigned char ins;
int busClock;
2022-01-20 21:56:35 +00:00
int note;
2022-01-15 22:28:33 +00:00
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave;
2022-01-15 20:50:53 +00:00
signed char vol, outVol;
DivMacroInt std;
Channel():
freq(0),
baseFreq(0),
pitch(0),
audLoc(0),
audLen(0),
audPos(0),
2022-01-15 22:28:33 +00:00
audSub(0),
2022-01-15 20:50:53 +00:00
audDat(0),
sample(-1),
2022-01-15 22:28:33 +00:00
wave(0),
2022-01-15 20:50:53 +00:00
ins(-1),
busClock(0),
2022-01-15 20:50:53 +00:00
note(0),
active(false),
insChanged(true),
freqChanged(false),
keyOn(false),
keyOff(false),
inPorta(false),
2022-01-15 22:28:33 +00:00
useWave(false),
2022-01-15 20:50:53 +00:00
vol(64),
outVol(64) {}
};
Channel chan[4];
bool isMuted[4];
2022-02-04 22:59:55 +00:00
int sep1, sep2;
2022-01-27 05:29:16 +00:00
friend void putDispatchChan(void*,int,int);
2022-01-15 20:50:53 +00:00
public:
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
2022-01-27 05:29:16 +00:00
void* getChanState(int chan);
2022-01-15 20:50:53 +00:00
void reset();
void forceIns();
void tick();
void muteChannel(int ch, bool mute);
bool isStereo();
bool keyOffAffectsArp(int ch);
2022-01-28 17:59:53 +00:00
void setFlags(unsigned int flags);
2022-01-18 04:59:52 +00:00
void notifyInsChange(int ins);
2022-01-18 05:25:10 +00:00
void notifyWaveChange(int wave);
2022-01-15 20:50:53 +00:00
void notifyInsDeletion(void* ins);
2022-02-03 23:38:57 +00:00
const char** getRegisterSheet();
2022-01-28 17:59:53 +00:00
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
2022-01-15 20:50:53 +00:00
void quit();
};
#endif