Minor NSS/SNES cleanups [Fabio Priuli]

This commit is contained in:
R. Belmont 2008-09-28 01:13:07 +00:00
parent 6c05b835a2
commit a51c28697d
2 changed files with 3 additions and 46 deletions

View File

@ -38,10 +38,12 @@
#define SNES_SCR_HEIGHT_PAL 274 /* ??? */
#define SNES_VTOTAL_NTSC 262 /* Maximum number of lines for NTSC systems */
#define SNES_VTOTAL_PAL 312 /* Maximum number of lines for PAL systems */
#define SNES_HTOTAL 341 /* Maximum number pixels per line (incl. hblank) */
#define SNES_HTOTAL 341 /* Maximum number pixels per line (incl. hblank) */
#define SNES_DMA_BASE 0x4300 /* Base DMA register address */
#define SNES_MODE_20 0x1 /* Lo-ROM cart */
#define SNES_MODE_21 0x2 /* Hi-ROM cart */
#define SNES_MODE_22 0x4 /* Extended Lo-ROM cart - SDD-1 */
#define SNES_MODE_25 0x8 /* Extended Hi-ROM cart */
#define SNES_NTSC 0x00
#define SNES_PAL 0x10
#define SNES_VRAM_SIZE 0x20000 /* 128kb of video ram */
@ -371,8 +373,6 @@ extern WRITE8_HANDLER( snes_w_bank6 );
extern WRITE8_HANDLER( snes_w_io );
extern WRITE8_HANDLER( snes_w_sram );
extern int snes_validate_infoblock( UINT8 *infoblock, UINT16 offset );
extern void snes_gdma( UINT8 channels );
extern void snes_hdma_init(void);
extern void snes_hdma(void);

View File

@ -1481,48 +1481,6 @@ WRITE8_HANDLER( snes_w_io )
snes_ram[offset] = data;
}
/* This function checks everything is in a valid range and returns how
* 'valid' this section is as an information block. */
int snes_validate_infoblock( UINT8 *infoblock, UINT16 offset )
{
INT8 valid = 6;
/* Check the CRC and inverse CRC */
if( ((infoblock[offset + 0x1c] + (infoblock[offset + 0x1d] << 8)) |
(infoblock[offset + 0x1e] + (infoblock[offset + 0x1f] << 8))) != 0xffff )
{
valid -= 3;
}
/* Check the ROM Size is in a valid range */
if( infoblock[offset + 0x17] > 13 )
{
valid--;
}
/* Check the SRAM size */
if( infoblock[offset + 0x18] > 8 )
{
valid--;
}
/* Check the Country is in a valid range */
if( infoblock[offset + 0x19] > 13 )
{
valid--;
}
/* Check the game version */
if( infoblock[offset + 0x1b] >= 128 )
{
valid--;
}
if( valid < 0 )
{
valid = 0;
}
return valid;
}
#ifndef MESS
/* for mame we use an init, maybe we will need more for the different games */
DRIVER_INIT( snes )
{
@ -1614,7 +1572,6 @@ DRIVER_INIT( snes_hirom )
snes_cart.sram = snes_cart.sram_max;
}
}
#endif /* MESS */
void snes_hdma_init()
{