Debian Codegraph @

src/engine/platform/ym2610.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 _YM2610_H
21 #define _YM2610_H
22
23 #include "ym2610shared.h"
24
25 class DivPlatformYM2610: public DivPlatformYM2610Base {
26 protected:
27 const unsigned short chanOffs[4]={
28 0x01, 0x02, 0x101, 0x102
29 };
30
31 const unsigned char konOffs[4]={
32 1, 2, 5, 6
33 };
34
35 const unsigned char bchOffs[4]={
36 1, 2, 4, 5
37 };
38
39 friend void putDispatchChip(void*,int);
40
41 void commitState(int ch, DivInstrument* ins);
42
43 void acquire_combo(short** buf, size_t len);
44 void acquire_ymfm(short** buf, size_t len);
45 void acquire_lle(short** buf, size_t len);
46
47 public:
48 unsigned char isCSM;
49 void acquire(short** buf, size_t len);
50 int dispatch(DivCommand c);
51 void* getChanState(int chan);
52 DivMacroInt* getChanMacroInt(int ch);
53 virtual unsigned short getPan(int chan);
54 DivDispatchOscBuffer* getOscBuffer(int chan);
55 unsigned char* getRegisterPool();
56 int getRegisterPoolSize();
57 void reset();
58 void forceIns();
59 void tick(bool sysTick=true);
60 void muteChannel(int ch, bool mute);
61 int getOutputCount();
62 bool keyOffAffectsArp(int ch);
63 void notifyInsChange(int ins);
64 virtual void notifyInsDeletion(void* ins);
65 void setSkipRegisterWrites(bool val);
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 setCSM(bool isCSM);
71 void quit();
72 DivPlatformYM2610():
73 DivPlatformYM2610Base(1,4,7,13,14),
74 isCSM(0) {}
75 ~DivPlatformYM2610();
76 };
77 #endif