Debian Codegraph @

src/engine/platform/bubsyswsg.h

raw
1 /**
2 * Furnace Tracker - multi-system chiptune tracker
3 * Copyright (C) 2021-2025 tildearrow and contributors
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef _K005289_H
21 #define _K005289_H
22
23 #include "../dispatch.h"
24 #include "../waveSynth.h"
25 #include "vgsound_emu/src/k005289/k005289.hpp"
26
27 class DivPlatformBubSysWSG: public DivDispatch {
28 struct Channel: public SharedChannel<signed char> {
29 signed short wave;
30 signed char waveROM[32] = {0}; // 4 bit PROM per channel on bubble system
31 DivWaveSynth ws;
32 Channel():
33 SharedChannel<signed char>(15),
34 wave(-1) {}
35 };
36 Channel chan[2];
37 DivDispatchOscBuffer* oscBuf[2];
38 bool isMuted[2];
39 unsigned char writeOscBuf;
40
41 int lastOut;
42 k005289_core k005289;
43 unsigned short regPool[4];
44 void updateWave(int ch);
45 friend void putDispatchChip(void*,int);
46 friend void putDispatchChan(void*,int,int);
47 public:
48 void acquireDirect(blip_buffer_t** bb, size_t len);
49 int dispatch(DivCommand c);
50 void* getChanState(int chan);
51 DivDispatchOscBuffer* getOscBuffer(int chan);
52 unsigned char* getRegisterPool();
53 int getRegisterPoolSize();
54 int getRegisterPoolDepth();
55 void reset();
56 void forceIns();
57 void tick(bool sysTick=true);
58 void muteChannel(int ch, bool mute);
59 int getOutputCount();
60 bool keyOffAffectsArp(int ch);
61 bool hasAcquireDirect();
62 DivMacroInt* getChanMacroInt(int ch);
63 void setFlags(const DivConfig& flags);
64 void notifyWaveChange(int wave);
65 void notifyInsDeletion(void* ins);
66 void poke(unsigned int addr, unsigned short val);
67 void poke(std::vector<DivRegWrite>& wlist);
68 const char** getRegisterSheet();
69 int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
70 void quit();
71 ~DivPlatformBubSysWSG();
72 };
73
74 #endif