Skip to content

Commit 3f69c6e

Browse files
Cleanup mmc5 audio
1 parent 5ae1159 commit 3f69c6e

3 files changed

Lines changed: 151 additions & 148 deletions

File tree

src/apu.h

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ typedef struct SquareUnit {
7676
Envelope envelope; /* Envelope to control volume for square wave */
7777
Sweep sweep; /* Sweep to modify frequency of square wave */
7878
Timer timer; /* Cycle counter and period to reload */
79+
int32 cvbc;
7980
} SquareUnit;
8081

8182
typedef struct TriangleUnit {
@@ -163,41 +164,6 @@ static const uint8 SquareWaveTable[2][4][8] = {
163164
},
164165
};
165166

166-
/* TODO: merge these properly. Check should be expansion audio based, not based on mapper number */
167-
typedef struct __MMC5SQUARE {
168-
/* regs */
169-
uint8 volume;
170-
uint8 duty;
171-
uint8 enabled;
172-
int16 freq;
173-
174-
uint8 env_control;
175-
uint8 lengthcount;
176-
uint8 decvolume;
177-
uint8 deccount;
178-
uint8 reloaddec; /* reload envelope */
179-
180-
/* timers */
181-
uint8 dcount;
182-
int32 vcount;
183-
int32 cvbc;
184-
} MMC5SQUARE;
185-
186-
typedef struct __MMC5PCM {
187-
uint8 rawdata;
188-
uint8 control;
189-
int32 cvbc;
190-
} MMC5PCM;
191-
192-
typedef struct __MMC5SOUND {
193-
MMC5SQUARE square[2];
194-
MMC5PCM pcm;
195-
int32 fcnt;
196-
} MMC5SOUND;
197-
198-
extern MMC5SOUND MMC5Sound;
199-
extern void (*mmc5_sfun)(MMC5SQUARE *channel);
200-
201167
extern uint8 isMMC5Audio;
202168

203169
#endif /* _FCEU_APU_H */

0 commit comments

Comments
 (0)