Unverified Commit 84eb9d92 authored by barbudreadmon's avatar barbudreadmon Committed by GitHub
Browse files

Merge pull request #230 from CupcakeFan/add-xevious

Add xevious
parents 03cac487 33b7c19d
This diff is collapsed.
......@@ -262,26 +262,26 @@ inline static INT32 readbit(const UINT8 *src, INT32 bitnum)
return src[bitnum / 8] & (0x80 >> (bitnum % 8));
}
void GfxDecode(INT32 num, INT32 numPlanes, INT32 xSize, INT32 ySize, INT32 planeoffsets[], INT32 xoffsets[], INT32 yoffsets[], INT32 modulo, UINT8 *pSrc, UINT8 *pDest)
{
INT32 c;
for (c = 0; c < num; c++) {
INT32 plane, x, y;
UINT8 *dp = pDest + (c * xSize * ySize);
memset(dp, 0, xSize * ySize);
for (plane = 0; plane < numPlanes; plane++) {
INT32 planebit = 1 << (numPlanes - 1 - plane);
INT32 planeoffs = (c * modulo) + planeoffsets[plane];
for (y = 0; y < ySize; y++) {
INT32 yoffs = planeoffs + yoffsets[y];
dp = pDest + (c * xSize * ySize) + (y * xSize);
for (x = 0; x < xSize; x++) {
if (readbit(pSrc, yoffs + xoffsets[x])) dp[x] |= planebit;
void GfxDecode(INT32 numOfSymbols, INT32 numPlanes, INT32 xSize, INT32 ySize, INT32 planeOffsets[], INT32 xOffsets[], INT32 yOffsets[], INT32 planeModulo, UINT8 *pSrc, UINT8 *pDest)
{
for (INT32 symbol = 0; symbol < numOfSymbols; symbol ++)
{
UINT8 *destPtr = pDest + (symbol * xSize * ySize);
memset(destPtr, 0, xSize * ySize);
for (INT32 plane = 0; plane < numPlanes; plane ++)
{
INT32 planeBit = 1 << (numPlanes - 1 - plane);
INT32 srcOffs = planeOffsets[plane] + (symbol * planeModulo);
destPtr = pDest + (symbol * xSize * ySize);
for (INT32 y = 0; y < ySize; y ++)
{
for (INT32 x = 0; x < xSize; x ++)
{
if (readbit(pSrc, srcOffs + yOffsets[y] + xOffsets[x]))
*destPtr |= planeBit;
destPtr ++;
}
}
}
......@@ -2098,7 +2098,8 @@ void RenderCustomTile_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight, INT32
UINT16* pPixel = pDestDraw + (StartY * nScreenWidth) + StartX;
for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth) {
for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pTileData += nWidth)
{
if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) {
continue;
}
......@@ -4211,6 +4212,7 @@ void RenderCustomTile_Prio_Clip(UINT16* pDestDraw, INT32 nWidth, INT32 nHeight,
UINT8 *pPri = pPrioDraw + (StartY * nScreenWidth) + StartX;
for (INT32 y = 0; y < nHeight; y++, pPixel += nScreenWidth, pPri += nScreenWidth, pTileData += nWidth) {
if ((StartY + y) < nScreenHeightMin || (StartY + y) >= nScreenHeightMax) {
continue;
}
......
......@@ -179,7 +179,7 @@ static void InpDIPSWGetOffset (void)
for(int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++)
{
if (bdi.nFlags == 0xF0)
if (0xF0 == bdi.nFlags)
{
nDIPOffset = bdi.nInput;
log_cb(RETRO_LOG_INFO, "DIP switches offset: %d.\n", bdi.nInput);
......@@ -221,12 +221,13 @@ static int InpDIPSWInit()
if (!drvname)
return 0;
for (int i = 0, j = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++)
int i= 0;
while (0 == BurnDrvGetDIPInfo(&bdi, i))
{
/* 0xFE is the beginning label for a DIP switch entry */
/* 0xFD are region DIP switches */
if ((bdi.nFlags == 0xFE || bdi.nFlags == 0xFD) && bdi.nSetting > 0)
if (((0xFE == bdi.nFlags) || (0xFD == bdi.nFlags)) && (bdi.nSetting > 0))
{
dipswitch_core_options.push_back(dipswitch_core_option());
dipswitch_core_option *dip_option = &dipswitch_core_options.back();
......@@ -237,7 +238,7 @@ static int InpDIPSWInit()
// Some dipswitch has no name...
if (bdi.szText)
{
strcpy(option_name, bdi.szText);
strncpy(option_name, bdi.szText, sizeof(option_name));
}
else // ... so, to not hang, we will generate a name based on the position of the dip (DIPSWITCH 1, DIPSWITCH 2...)
{
......@@ -277,7 +278,7 @@ static int InpDIPSWInit()
break;
}
if (bdi_value.nFlags == 0xFE || bdi_value.nFlags == 0xFD)
if ((0xFE == bdi_value.nFlags) || (0xFD == bdi_value.nFlags))
{
log_cb(RETRO_LOG_WARN, "Error in %sDIPList for DIPSWITCH '%s': Start of next DIPSWITCH is too early\n", drvname, dip_option->friendly_name);
break;
......@@ -286,14 +287,15 @@ static int InpDIPSWInit()
struct GameInp *pgi_value = GameInp + bdi_value.nInput + nDIPOffset;
// When the pVal of one value is NULL => the DIP switch is unusable. So it will be skipped by removing it from the list
if (pgi_value->Input.pVal == 0)
if (0 == pgi_value->Input.pVal)
{
skip_unusable_option = true;
log_cb(RETRO_LOG_WARN, "Error in %sDIPList for DIPSWITCH '%s'%d: Unusable Option Found\n", drvname, dip_option->friendly_name, k + 1);
break;
}
// Filter away NULL entries
if (bdi_value.nFlags == 0)
if (0 == bdi_value.nFlags)
{
log_cb(RETRO_LOG_WARN, "Error in %sDIPList for DIPSWITCH '%s': the line '%d' is useless\n", drvname, dip_option->friendly_name, k + 1);
continue;
......@@ -324,7 +326,7 @@ static int InpDIPSWInit()
{
// Truncate the list at the values_count found to not have empty values
dip_option->values.resize(values_count + 1); // +1 for default value
log_cb(RETRO_LOG_WARN, "Error in %sDIPList for DIPSWITCH '%s': '%d' values were intended and only '%d' were found\n", drvname, dip_option->friendly_name, bdi.nSetting, values_count);
log_cb(RETRO_LOG_WARN, "Error in %sDIPList for %d DIPSWITCH '%s': '%d' values were intended and only '%d' were found\n", drvname, i, dip_option->friendly_name, bdi.nSetting, values_count);
}
// Skip the unusable option by removing it from the list
......@@ -351,8 +353,8 @@ static int InpDIPSWInit()
}
std::basic_string<char>(dip_option->values_str).swap(dip_option->values_str);
j++;
}
i++;
}
evaluate_neogeo_bios_mode(drvname);
......
// This file was generated by src/dep/scripts/gamelist.pl (perl 5.026002)
// This file was generated by gamelist.pl (perl 5.018002)
 
// Declaration of all drivers
#define DRV extern struct BurnDriver
......@@ -12148,6 +12148,7 @@ DRV BurnDrvsms_xenon2;
DRV BurnDrvsms_xenon2v;
DRV BurnDrvThreein1semi;
DRV BurnSpecxevious;
DRV BurnDrvXevious;
DRV BurnDrvpce_xevious;
DRV BurnDrvXexexa;
DRV BurnDrvXexex;
......@@ -24501,6 +24502,7 @@ static struct BurnDriver* pDriver[] = {
&BurnDrvsms_xenon2v, // Xenon 2 - Megablast (Virgin) (Euro)
&BurnDrvThreein1semi, // XESS - The New Revolution (SemiCom 3-in-1)
&BurnSpecxevious, // Xevious (48K)
&BurnDrvXevious, // Xevious (Namco)
&BurnDrvpce_xevious, // Xevious - Fardraut Densetsu
&BurnDrvXexexa, // Xexex (ver AAA)
&BurnDrvXexex, // Xexex (ver EAA)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment