Skip to content

Commit

Permalink
Some general cleanups/removal of unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jan 10, 2024
1 parent 39aff74 commit 5ebfb1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
5 changes: 2 additions & 3 deletions src/pputile.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ uint32 vadr;
#ifndef PPUT_MMC5SP
uint8 zz;
#else
uint8 xs, ys;
xs = X1;
ys = ((scanline >> 3) + MMC5HackSPScroll) & 0x1F;
uint8 xs = X1;
uint8 ys = ((scanline >> 3) + MMC5HackSPScroll) & 0x1F;
if (ys >= 0x1E) ys -= 0x1E;
#endif

Expand Down
45 changes: 10 additions & 35 deletions src/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static uint8 IRQFrameMode = 0; /* $4017 / xx000000 */
static uint8 PSG[0x10];
static uint8 RawDALatch = 0; /* $4011 0xxxxxxx */

uint8 EnabledChannels = 0; /* Byte written to $4015 */
static uint8 EnabledChannels = 0; /* Byte written to $4015 */

typedef struct {
uint8 Speed;
Expand Down Expand Up @@ -512,17 +512,13 @@ void RDoPCM(void) {

/* This has the correct phase. Don't mess with it. */
static INLINE void RDoSQ(int x) {
int32 V;
int32 amp;
int32 rthresh;
int32 *D;
int32 currdc;
int32 cf;
int32 rc;

V = SOUNDTS - ChannelBC[x];
cf = (curfreq[x] + 1) * 2;
rc = wlcount[x];
int32 V = SOUNDTS - ChannelBC[x];
int32 cf = (curfreq[x] + 1) * 2;
int32 rc = wlcount[x];

/* added 2018/12/08 */
/* when pulse channel is silenced, resets length counters but not
Expand Down Expand Up @@ -575,16 +571,10 @@ static INLINE void RDoSQ(int x) {
ChannelBC[x] = SOUNDTS;
}

static void RDoSQ1(void) {
RDoSQ(0);
}

static void RDoSQ2(void) {
RDoSQ(1);
}
static void RDoSQ1(void) { RDoSQ(0); }
static void RDoSQ2(void) { RDoSQ(1); }

static void RDoSQLQ(void) {
int32 start, end;
int32 V;
int32 amp[2];
int32 rthresh[2];
Expand All @@ -594,9 +584,8 @@ static void RDoSQLQ(void) {

int32 ttable[2][8];
int32 totalout;

start = ChannelBC[0];
end = (SOUNDTS << 16) / soundtsinc;
int32 start = ChannelBC[0];
int32 end = (SOUNDTS << 16) / soundtsinc;
if (end <= start) return;
ChannelBC[0] = end;

Expand Down Expand Up @@ -648,15 +637,6 @@ static void RDoSQLQ(void) {
Wave[V >> 4] += totalout;
} else {
for (V = start; V < end; V++) {
/* int tmpamp=0;
if(RectDutyCount[0]<rthresh[0])
tmpamp=amp[0];
if(RectDutyCount[1]<rthresh[1])
tmpamp+=amp[1];
tmpamp=wlookup1[tmpamp];
tmpamp = wlookup1[ ttable[0][RectDutyCount[0]] + ttable[1][RectDutyCount[1]] ];
*/

Wave[V >> 4] += totalout; /* tmpamp; */

sqacc[0] -= inie[0];
Expand Down Expand Up @@ -713,17 +693,14 @@ static void RDoTriangle(void) {

static void RDoTriangleNoisePCMLQ(void) {
int32 V;
int32 start, end;
int32 freq[2];
int32 inie[2];
uint32 amptab[2];
uint32 noiseout;
int nshift;

int32 totalout;

start = ChannelBC[2];
end = (SOUNDTS << 16) / soundtsinc;
int32 start = ChannelBC[2];
int32 end = (SOUNDTS << 16) / soundtsinc;
if (end <= start) return;
ChannelBC[2] = end;

Expand Down Expand Up @@ -1214,8 +1191,6 @@ SFORMAT FCEUSND_STATEINFO[] = {
{ 0 }
};

void FCEUSND_SaveState(void) { }

void FCEUSND_LoadState(int version) {
int i;
LoadDMCPeriod(DMCFormat & 0xF);
Expand Down
1 change: 0 additions & 1 deletion src/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ void SetNESSoundMap(void);

void FCEUSND_Power(void);
void FCEUSND_Reset(void);
void FCEUSND_SaveState(void);
void FCEUSND_LoadState(int version);

void FCEU_SoundCPUHook(int);
Expand Down

0 comments on commit 5ebfb1e

Please sign in to comment.