Added the fixes from Wizard Coder that I have verified using visual leak detector (actually picked some of them up in Finalburn Alpha 2001 but didn't think to push them back). The others are marked as only "possible" leaks so I have left them out.

This commit is contained in:
tmaul 2013-01-21 01:02:38 +00:00
parent 4c7317dd15
commit 0a8cbe4f05
12 changed files with 28 additions and 18 deletions

View File

@ -493,8 +493,10 @@ static INT32 DrvFrame()
}
{
memset (DrvInputs, 0xff, 3);
for (INT32 i = 0; i < 8; i++) {
memset (DrvInputs, 0xff, sizeof ( DrvInputs ));
for (INT32 i = 0; i < 8; i++)
{
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
DrvDips[2] ^= (DrvJoy3[i] & 1) << i;

View File

@ -1386,8 +1386,10 @@ static INT32 DrvFrame()
}
{
memset (DrvInputs, 0xff, 5);
for (INT32 i = 0; i < 16; i++) {
memset (DrvInputs, 0xff, sizeof ( DrvInputs ));
for (INT32 i = 0; i < 16; i++)
{
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;

View File

@ -1092,7 +1092,7 @@ struct OAM
int height, width;
};
static struct OAM oam_list[SNES_SCR_WIDTH / 2];
static struct OAM oam_list[(SNES_SCR_WIDTH / 2) + 1];
#if 0

View File

@ -1090,7 +1090,7 @@ UINT8 __fastcall bonze_sound_read(UINT16 a)
static void DrvMakeInputs()
{
memset (TC0220IOCInput, 0xff, 3);
memset (TC0220IOCInput, 0xff, sizeof ( TC0220IOCInput ));
TC0220IOCInput[2] &= ~TaitoInputConfig; // asuka

View File

@ -16,7 +16,8 @@ UINT8 TaitoInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TaitoInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TaitoInputPort3[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TaitoInputPort4[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TaitoInputPort5[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TaitoInputPort5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TaitoDip[2] = { 0, 0 };
UINT8 TaitoInput[6] = { 0, 0, 0, 0, 0, 0 };
UINT8 TaitoReset = 0;

View File

@ -3,7 +3,7 @@ extern UINT8 TaitoInputPort1[8];
extern UINT8 TaitoInputPort2[8];
extern UINT8 TaitoInputPort3[8];
extern UINT8 TaitoInputPort4[8];
extern UINT8 TaitoInputPort5[8];
extern UINT8 TaitoInputPort5[16];
extern UINT8 TaitoDip[2];
extern UINT8 TaitoInput[6];
extern UINT8 TaitoReset;

View File

@ -198,7 +198,7 @@ extern UINT8 TC0220IOCInputPort0[8];
extern UINT8 TC0220IOCInputPort1[8];
extern UINT8 TC0220IOCInputPort2[8];
extern UINT8 TC0220IOCDip[2];
extern UINT8 TC0220IOCInput[3];
extern UINT8 TC0220IOCInput[6];
UINT8 TC0220IOCPortRead();
UINT8 TC0220IOCHalfWordPortRead();

View File

@ -7,7 +7,8 @@ UINT8 TC0220IOCInputPort0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TC0220IOCInputPort1[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TC0220IOCInputPort2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
UINT8 TC0220IOCDip[2] = { 0, 0 };
UINT8 TC0220IOCInput[3] = { 0, 0, 0 };
UINT8 TC0220IOCInput[6] = { 0, 0, 0, 0, 0, 0 };
static UINT8 TC0220IOCRegs[8];
static UINT8 TC0220IOCPort;

View File

@ -124,12 +124,12 @@ BOOL RegNewMDIChild()
wcex.lpfnWndProc = VideoWndProc; // video window process callback
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hAppInst; // fba instance handle
wcex.hIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP)); // fba icon
wcex.hCursor = LoadCursor(NULL, IDC_ARROW); // regular cursor
wcex.hbrBackground = CreateSolidBrush(0); // black video window background
wcex.lpszMenuName = NULL; // no menu
wcex.lpszClassName = szVidWndClass; // video window class (MDI child)
wcex.hInstance = hAppInst; // fba instance handle
wcex.hIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP)); // fba icon
wcex.hCursor = LoadCursor(NULL, IDC_ARROW); // regular cursor
wcex.hbrBackground = static_cast<HBRUSH>( GetStockObject( BLACK_BRUSH )); // black video window background
wcex.lpszMenuName = NULL; // no menu
wcex.lpszClassName = szVidWndClass; // video window class (MDI child)
wcex.hIconSm = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP));
if(!RegisterClassEx(&wcex))

View File

@ -2791,7 +2791,7 @@ static int ScrnRegister()
WndClassEx.hInstance = hAppInst;
WndClassEx.hIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP));
WndClassEx.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClassEx.hbrBackground = CreateSolidBrush(0);
WndClassEx.hbrBackground = static_cast<HBRUSH>( GetStockObject ( BLACK_BRUSH ));
WndClassEx.lpszClassName = szClass;
// Register the window class with the above information:

View File

@ -499,7 +499,7 @@ static int SelListMake()
if (szSearchString[0]) {
TCHAR *StringFound = NULL;
TCHAR *StringFound2 = NULL;
TCHAR szDriverName[100];
TCHAR szDriverName[256];
wcscpy(szDriverName, BurnDrvGetText(DRV_FULLNAME));
for (int k =0; k < 100; k++) {
szSearchString[k] = _totlower(szSearchString[k]);

View File

@ -3505,6 +3505,10 @@ void Z80Reset()
void Z80Exit()
{
if (SZHVC_add) free(SZHVC_add);
SZHVC_add = NULL;
if (SZHVC_sub) free(SZHVC_sub);
SZHVC_sub = NULL;
}
int Z80Execute(int cycles)