Debian Codegraph @

src/engine/platform/sound/nes/fds.h

raw
1 /*
2 * Copyright (C) 2010-2019 Fabio Cavallo (aka FHorse)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 #ifndef FDS_H_
20 #define FDS_H_
21
22 #include "common.h"
23
24 enum fds_operations { FDS_OP_NONE, FDS_OP_READ, FDS_OP_WRITE };
25
26 struct _fds {
27 // snd
28 BYTE enabled_snd_reg;
29 struct _fds_snd {
30 struct _fds_snd_wave {
31 BYTE data[64];
32 BYTE writable;
33 BYTE volume;
34
35 BYTE index;
36 int32_t counter;
37
38 /* ------------------------------------------------------- */
39 /* questi valori non e' necessario salvarli nei savestates */
40 /* ------------------------------------------------------- */
41 /* */ BYTE clocked; /* */
42 /* ------------------------------------------------------- */
43 } wave;
44 struct _fds_snd_envelope {
45 BYTE speed;
46 BYTE disabled;
47 } envelope;
48 struct _fds_snd_main {
49 BYTE silence;
50 WORD frequency;
51
52 SWORD output;
53 } main;
54 struct _fds_snd_volume {
55 BYTE speed;
56 BYTE mode;
57 BYTE increase;
58
59 BYTE gain;
60 uint32_t counter;
61 } volume;
62 struct _fds_snd_sweep {
63 SBYTE bias;
64 BYTE mode;
65 BYTE increase;
66 BYTE speed;
67
68 BYTE gain;
69 uint32_t counter;
70 } sweep;
71 struct _fds_snd_modulation {
72 SBYTE data[64];
73 WORD frequency;
74 BYTE disabled;
75
76 BYTE index;
77 int32_t counter;
78 SWORD mod;
79 } modulation;
80 } snd;
81 };
82
83 void extcl_apu_tick_FDS(struct _fds* fds);
84 void fds_reset(struct _fds* fds);
85
86 #undef EXTERNC
87
88 #endif /* FDS_H_ */