Add support for CPS-2 hardware volume controls in sound test screens, also add support for single boards with no digital volume controls
This commit is contained in:
parent
6f96d77914
commit
5ca5c6c989
|
@ -477,3 +477,9 @@ INT32 Sf2mdtScanSound(INT32 nAction, INT32 *pnMin);
|
|||
#define CPS2_QSND 12
|
||||
#define CPS2_QSND_SIMM 13
|
||||
#define CPS2_QSND_SIMM_BYTESWAP 14
|
||||
|
||||
extern INT32 Cps2Volume;
|
||||
extern UINT16 Cps2VolumeStates[40];
|
||||
extern INT32 Cps2DisableDigitalVolume;
|
||||
extern UINT8 Cps2VolUp;
|
||||
extern UINT8 Cps2VolDwn;
|
||||
|
|
|
@ -389,7 +389,16 @@ INT32 Cps2Frame()
|
|||
SekSetCyclesScanline(nCpsCycles / nCpsNumScanlines);
|
||||
|
||||
CpsRwGetInp(); // Update the input port values
|
||||
|
||||
|
||||
// Check the volumes every 5 frames or so
|
||||
if (GetCurrentFrame() % 5 == 0) {
|
||||
if (Cps2VolUp) Cps2Volume++;
|
||||
if (Cps2VolDwn) Cps2Volume--;
|
||||
|
||||
if (Cps2Volume > 39) Cps2Volume = 39;
|
||||
if (Cps2Volume < 0) Cps2Volume = 0;
|
||||
}
|
||||
|
||||
nDisplayEnd = nCpsCycles * (nFirstLine + 224) / nCpsNumScanlines; // Account for VBlank
|
||||
|
||||
nInterrupt = 0;
|
||||
|
|
|
@ -134,12 +134,13 @@ static UINT8 CpsReadPort(const UINT32 ia)
|
|||
if (Ssf2tb) {
|
||||
d = 0x20;
|
||||
} else {
|
||||
d = 0xe0;
|
||||
d = Cps2VolumeStates[Cps2Volume] >> 8;
|
||||
if (Cps2DisableDigitalVolume) d = 0xd0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
if (ia == 0x031) {
|
||||
d = 0x21;
|
||||
d = Cps2VolumeStates[Cps2Volume] & 0xff;
|
||||
return d;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,18 @@
|
|||
|
||||
// Input Definitions
|
||||
|
||||
INT32 Cps2Volume = 39;
|
||||
INT32 Cps2DisableDigitalVolume = 0;
|
||||
UINT8 Cps2VolUp;
|
||||
UINT8 Cps2VolDwn;
|
||||
|
||||
UINT16 Cps2VolumeStates[40] = {
|
||||
0xf010, 0xf008, 0xf004, 0xf002, 0xf001, 0xe810, 0xe808, 0xe804, 0xe802, 0xe801,
|
||||
0xe410, 0xe408, 0xe404, 0xe402, 0xe401, 0xe210, 0xe208, 0xe204, 0xe202, 0xe201,
|
||||
0xe110, 0xe108, 0xe104, 0xe102, 0xe101, 0xe090, 0xe088, 0xe084, 0xe082, 0xe081,
|
||||
0xe050, 0xe048, 0xe044, 0xe042, 0xe041, 0xe030, 0xe028, 0xe024, 0xe022, 0xe021
|
||||
};
|
||||
|
||||
static struct BurnInputInfo Cps2FightingInputList[] = {
|
||||
{"P1 Coin" , BIT_DIGITAL , CpsInp020+4, "p1 coin" },
|
||||
{"P1 Start" , BIT_DIGITAL , CpsInp020+0, "p1 start" },
|
||||
|
@ -32,6 +44,8 @@ static struct BurnInputInfo Cps2FightingInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 7" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 8" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Cps2Fighting)
|
||||
|
@ -58,6 +72,8 @@ static struct BurnInputInfo NineXXInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(NineXX)
|
||||
|
@ -84,6 +100,8 @@ static struct BurnInputInfo Nine44InputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Nine44)
|
||||
|
@ -122,6 +140,8 @@ static struct BurnInputInfo ArmwarInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Armwar)
|
||||
|
@ -160,6 +180,8 @@ static struct BurnInputInfo AvspInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Avsp)
|
||||
|
@ -204,6 +226,8 @@ static struct BurnInputInfo BatcirInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Batcir)
|
||||
|
@ -224,6 +248,8 @@ static struct BurnInputInfo ChokoInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Choko)
|
||||
|
@ -252,6 +278,8 @@ static struct BurnInputInfo CsclubInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Csclub)
|
||||
|
@ -282,6 +310,8 @@ static struct BurnInputInfo CybotsInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Cybots)
|
||||
|
@ -334,6 +364,8 @@ static struct BurnInputInfo DdsomInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Ddsom)
|
||||
|
@ -387,6 +419,8 @@ static struct BurnInputInfo DdtodInputList[] =
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset, "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Ddtod)
|
||||
|
@ -415,6 +449,8 @@ static struct BurnInputInfo DimahooInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Dimahoo)
|
||||
|
@ -443,6 +479,8 @@ static struct BurnInputInfo EcofghtrInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Ecofghtr)
|
||||
|
@ -469,6 +507,8 @@ static struct BurnInputInfo GigawingInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Gigawing)
|
||||
|
@ -486,6 +526,8 @@ static struct BurnInputInfo JyangokuInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Jyangoku)
|
||||
|
@ -514,6 +556,8 @@ static struct BurnInputInfo Megaman2InputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Megaman2)
|
||||
|
@ -542,6 +586,8 @@ static struct BurnInputInfo Mmancp2uInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Mmancp2u)
|
||||
|
@ -566,6 +612,8 @@ static struct BurnInputInfo MmatrixInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 2" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 3" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Mmatrix)
|
||||
|
@ -592,6 +640,8 @@ static struct BurnInputInfo MpangInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Mpang)
|
||||
|
@ -620,6 +670,8 @@ static struct BurnInputInfo ProgearInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Progear)
|
||||
|
@ -643,11 +695,13 @@ static struct BurnInputInfo Pzloop2InputList[] = {
|
|||
{"P2 Left" , BIT_DIGITAL , CpsInp000+1 , "p2 left" },
|
||||
{"P2 Right" , BIT_DIGITAL , CpsInp000+0 , "p2 right" },
|
||||
{"P2 Shot" , BIT_DIGITAL , CpsInp000+4 , "p2 fire 1" },
|
||||
A("P2 Paddle" , BIT_ANALOG_REL, &CpsInpPaddle2, "p2 z-axis" ),
|
||||
A("P2 Paddle" , BIT_ANALOG_REL, &CpsInpPaddle2, "p2 z-axis" ),
|
||||
|
||||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1 , "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2 , "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 2" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn , "p1 fire 3" },
|
||||
};
|
||||
|
||||
#undef A
|
||||
|
@ -672,6 +726,8 @@ static struct BurnInputInfo QndreamInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset, "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 5" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 6" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Qndream)
|
||||
|
@ -706,6 +762,8 @@ static struct BurnInputInfo RingdestInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 7" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 8" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Ringdest)
|
||||
|
@ -734,6 +792,8 @@ static struct BurnInputInfo SgemfInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 4" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 5" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Sgemf)
|
||||
|
@ -760,6 +820,8 @@ static struct BurnInputInfo Spf2tInputList[] = {
|
|||
{"Reset" , BIT_DIGITAL , &CpsReset , "reset" },
|
||||
{"Diagnostic" , BIT_DIGITAL , CpsInp021+1, "diag" },
|
||||
{"Service" , BIT_DIGITAL , CpsInp021+2, "service" },
|
||||
{"Volume Up" , BIT_DIGITAL , &Cps2VolUp , "p1 fire 3" },
|
||||
{"Volume Down" , BIT_DIGITAL , &Cps2VolDwn, "p1 fire 4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Spf2t)
|
||||
|
@ -7087,6 +7149,14 @@ STD_ROM_FN(Xmvsfur1)
|
|||
|
||||
// Driver functions
|
||||
|
||||
static INT32 MvscjsingInit()
|
||||
{
|
||||
// The case has a volume knob, and the digital switches are missing and the slider is missing from the test screen
|
||||
Cps2DisableDigitalVolume = 1;
|
||||
|
||||
return Cps2Init();
|
||||
}
|
||||
|
||||
static INT32 Pzloop2Init()
|
||||
{
|
||||
Pzloop2 = 1;
|
||||
|
@ -7137,6 +7207,9 @@ static INT32 DrvExit()
|
|||
Ssf2tb = 0;
|
||||
Xmcota = 0;
|
||||
|
||||
Cps2Volume = 39;
|
||||
Cps2DisableDigitalVolume = 0;
|
||||
|
||||
CpsLayer1XOffs = 0;
|
||||
CpsLayer2XOffs = 0;
|
||||
CpsLayer3XOffs = 0;
|
||||
|
@ -8365,7 +8438,7 @@ struct BurnDriver BurnDrvCpsMvscjsing = {
|
|||
NULL, NULL, NULL, NULL,
|
||||
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_CAPCOM_CPS2, GBF_VSFIGHT, FBF_SF,
|
||||
NULL, MvscjsingRomInfo, MvscjsingRomName, NULL, NULL, Cps2FightingInputInfo, NULL,
|
||||
Cps2Init, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan,
|
||||
MvscjsingInit, DrvExit, Cps2Frame, CpsRedraw, CpsAreaScan,
|
||||
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue