Debian Codegraph @

src/engine/platform/pong.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 _PONG_H
21 #define _PONG_H
22
23 #include "../dispatch.h"
24
25 class DivPlatformPong: public DivDispatch {
26 struct Channel: public SharedChannel<signed char> {
27 Channel():
28 SharedChannel<signed char>(1) {}
29 };
30 Channel chan[1];
31 DivDispatchOscBuffer* oscBuf;
32 bool isMuted[1];
33 bool on, flip, lastOn;
34 int pos;
35 bool freq;
36 unsigned char regPool[2];
37
38 friend void putDispatchChip(void*,int);
39 friend void putDispatchChan(void*,int,int);
40
41 public:
42 void acquire(short** buf, size_t len);
43 int dispatch(DivCommand c);
44 void* getChanState(int chan);
45 DivMacroInt* getChanMacroInt(int ch);
46 DivDispatchOscBuffer* getOscBuffer(int chan);
47 void reset();
48 void forceIns();
49 void tick(bool sysTick=true);
50 void muteChannel(int ch, bool mute);
51 bool keyOffAffectsArp(int ch);
52 void setFlags(const DivConfig& flags);
53 void notifyInsDeletion(void* ins);
54 void poke(unsigned int addr, unsigned short val);
55 void poke(std::vector<DivRegWrite>& wlist);
56 int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
57 void quit();
58 ~DivPlatformPong();
59 };
60
61 #endif