Skip to content

Commit

Permalink
Random cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jan 10, 2024
1 parent 573d3c2 commit f72ae18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 37 deletions.
2 changes: 0 additions & 2 deletions src/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ void FCEUI_NSFSetVis(int mode);
int FCEUI_NSFChange(int amount);
int FCEUI_NSFGetInfo(uint8 *name, uint8 *artist, uint8 *copyright, int maxlen);

void FCEUI_VSUniToggleDIPView(void);
void FCEUI_VSUniToggleDIP(int w);
uint8 FCEUI_VSUniGetDIPs(void);
void FCEUI_VSUniSetDIP(int w, int state);

Expand Down
17 changes: 4 additions & 13 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ static void UpdateGP(int w, void *data, int arg) {
}
}

static void StrobeGP(int w) {
joy_readbit[w] = 0;
}
static void StrobeGP(int w) { joy_readbit[w] = 0; }

static INPUTC GPC = { ReadGP, 0, StrobeGP, UpdateGP, 0, 0 };
static INPUTC GPCVS = { ReadGPVS, 0, StrobeGP, UpdateGP, 0, 0 };
Expand All @@ -215,10 +213,10 @@ void FCEU_UpdateInput(void)
FCExp->Update(InputDataPtrFC, JPAttribFC);

if (GameInfo && GameInfo->type == GIT_VSUNI)
{
if (coinon) coinon--;

if (GameInfo->type == GIT_VSUNI)
FCEU_VSUniSwap(&joy[0], &joy[1]);
}
}

static uint8 VSUNIRead0(uint32 A)
Expand Down Expand Up @@ -390,9 +388,7 @@ void FCEUI_SetInputFC(int type, void *ptr, int attrib)
SetInputStuffFC();
}

void FCEUI_DisableFourScore(int s) {
FSDisable = s;
}
void FCEUI_DisableFourScore(int s) { FSDisable = s; }

SFORMAT FCEUCTRL_STATEINFO[] = {
{ joy_readbit, 2, "JYRB" },
Expand Down Expand Up @@ -435,8 +431,3 @@ void FCEU_DoSimpleCommand(int cmd)
break;
}
}

void FCEUI_VSUniToggleDIP(int w)
{
FCEU_DoSimpleCommand(FCEUNPCMD_VSUNIDIP0 + w);
}
29 changes: 7 additions & 22 deletions src/vsuni.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,13 @@ static writefunc OldWritePPU[2];
uint8 vsdip = 0;
uint8 coinon = 0;

void FCEUI_VSUniToggleDIPView(void) {
DIPS = !DIPS;
}

void FCEU_VSUniToggleDIP(int w) {
vsdip ^= 1 << w;
}
void FCEU_VSUniToggleDIP(int w) { vsdip ^= 1 << w; }
uint8 FCEUI_VSUniGetDIPs(void) {return(vsdip);}
void FCEU_VSUniCoin(void) { coinon = 6; }

void FCEUI_VSUniSetDIP(int w, int state) {
if (((vsdip >> w) & 1) != state)
FCEUI_VSUniToggleDIP(w);
}

uint8 FCEUI_VSUniGetDIPs(void) {
return(vsdip);
FCEU_DoSimpleCommand(FCEUNPCMD_VSUNIDIP0 + w);
}

static uint8 secdata[2][32] = {
Expand All @@ -101,10 +93,6 @@ static uint8 VSSecRead(uint32 A) {
return(0x00);
}

void FCEU_VSUniCoin(void) {
coinon = 6;
}

static uint8 A2002_Gumshoe(uint32 A) {
return((OldReadPPU(A) & ~0x3F) | 0x1C);
}
Expand Down Expand Up @@ -166,9 +154,8 @@ void FCEU_VSUniPower(void) {
OldWritePPU[1] = GetWriteHandler(0x2001);
SetWriteHandler(0x2000, 0x2001, B2000_2001_2C05);
}
if (curmd5 == 0x2d396247cf58f9faLL) { /* Super Xevious */
if (curmd5 == 0x2d396247cf58f9faLL) /* Super Xevious */
SetReadHandler(0x5400, 0x57FF, XevRead);
}
}

/* Games that will probably not be supported ever(or for a long time), since they require
Expand Down Expand Up @@ -312,15 +299,13 @@ void FCEU_VSUniCheck(uint64 md5partial, int *MapperNo, int *Mirroring) {
secptr = secdata[1];

vsdip = 0x0;
if (vs->ioption & IOPTION_PREDIP) {
if (vs->ioption & IOPTION_PREDIP)
vsdip = vs->predip;
}
if (vs->ioption & IOPTION_GUN) {
GameInfo->input[0] = SI_ZAPPER;
GameInfo->input[1] = SI_NONE;
} else {
} else
GameInfo->input[0] = GameInfo->input[1] = SI_GAMEPAD;
}
curvs = vs;
return;
}
Expand Down

0 comments on commit f72ae18

Please sign in to comment.