Tidied CPS-3 drivers

This commit is contained in:
Barry Harris 2011-12-13 20:50:09 +00:00
parent d5c1086cd2
commit cdfef273fc
2 changed files with 12 additions and 18 deletions

View File

@ -485,19 +485,19 @@ static INT32 MemIndex()
RamMain = Next; Next += 0x0080000;
RamPal = (UINT16 *) Next; Next += 0x0040000;
RamSpr = (UINT32 *) Next; Next += 0x0080000;
RamPal = (UINT16 *) Next; Next += 0x0020000 * sizeof(UINT16);
RamSpr = (UINT32 *) Next; Next += 0x0020000 * sizeof(UINT32);
RamCRam = (UINT32 *) Next; Next += 0x0800000;
RamSS = (UINT32 *) Next; Next += 0x0010000;
RamCRam = (UINT32 *) Next; Next += 0x0200000 * sizeof(UINT32);
RamSS = (UINT32 *) Next; Next += 0x0004000 * sizeof(UINT32);
RamVReg = (UINT32 *) Next; Next += 0x0000100;
RamVReg = (UINT32 *) Next; Next += 0x0000040 * sizeof(UINT32);
EEPROM = (UINT16 *) Next; Next += 0x0000400;
EEPROM = (UINT16 *) Next; Next += 0x0000100 * sizeof(UINT16);
RamEnd = Next;
Cps3CurPal = (UINT16 *) Next; Next += 0x040002; // iq_132 - layer disable
Cps3CurPal = (UINT16 *) Next; Next += 0x020001 * sizeof(UINT16); // iq_132 - layer disable
RamScreen = (UINT32 *) Next; Next += (512 * 2) * (224 * 2 + 32) * sizeof(UINT32);
MemEnd = Next;
@ -1060,7 +1060,7 @@ INT32 cps3Init()
Mem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen); // blank all memory
MemIndex();
@ -1203,10 +1203,7 @@ INT32 cps3Exit()
{
Sh2Exit();
if (Mem) {
free(Mem);
Mem = NULL;
}
BurnFree(Mem);
cps3SndExit();

View File

@ -91,7 +91,7 @@ void __fastcall cps3SndWriteLong(UINT32 addr, UINT32 data)
INT32 cps3SndInit(UINT8 * sndrom)
{
chip = (cps3snd_chip *) malloc( sizeof(cps3snd_chip) );
chip = (cps3snd_chip *)BurnMalloc( sizeof(cps3snd_chip) );
if ( chip ) {
memset( chip, 0, sizeof(cps3snd_chip) );
chip->rombase = sndrom;
@ -118,10 +118,7 @@ void cps3SndReset()
void cps3SndExit()
{
if (chip) {
free( chip );
chip = NULL;
}
BurnFree( chip );
}
void cps3SndUpdate()
@ -132,7 +129,7 @@ void cps3SndUpdate()
return;
}
memset(pBurnSoundOut, 0, nBurnSoundLen * 2 * 2 );
memset(pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16));
INT8 * base = (INT8 *)chip->rombase;
cps3_voice *vptr = &chip->voice[0];