someone decides to check for null before deleting. someone else thinks its an error to do that. removing them to make ticket #3413784 go away.

This commit is contained in:
zeromus 2011-11-14 08:12:36 +00:00
parent bfab5b230f
commit c87c49c17d
10 changed files with 134 additions and 183 deletions

View File

@ -1449,29 +1449,23 @@ FORCEINLINE BOOL compute_sprite_vars(_OAM_ * spriteInfo, u16 l,
static u32 bmp_sprite_address(GPU* gpu, _OAM_ * spriteInfo, size sprSize, s32 y) static u32 bmp_sprite_address(GPU* gpu, _OAM_ * spriteInfo, size sprSize, s32 y)
{ {
u32 src; if (gpu->dispCnt().OBJ_BMP_mapping)
if (spriteInfo->Mode == 3) //sprite is in BMP format
{ {
if (gpu->dispCnt().OBJ_BMP_mapping) //tested by buffy sacrifice damage blood splatters in corner
{ return gpu->sprMem + (spriteInfo->TileIndex<<gpu->sprBMPBoundary) + (y*sprSize.x*2);
//tested by buffy sacrifice damage blood splatters in corner
src = gpu->sprMem + (spriteInfo->TileIndex<<gpu->sprBMPBoundary) + (y*sprSize.x*2);
}
else
{
//2d mapping:
//verified in rotozoomed mode by knights in the nightmare intro
if (gpu->dispCnt().OBJ_BMP_2D_dim)
//256*256, verified by heroes of mana FMV intro
src = gpu->sprMem + (((spriteInfo->TileIndex&0x3E0) * 64 + (spriteInfo->TileIndex&0x1F) *8 + ( y << 8)) << 1);
else
//128*512, verified by harry potter and the order of the phoenix conversation portraits
src = gpu->sprMem + (((spriteInfo->TileIndex&0x3F0) * 64 + (spriteInfo->TileIndex&0x0F) *8 + ( y << 7)) << 1);
}
} }
else
{
//2d mapping:
//verified in rotozoomed mode by knights in the nightmare intro
return src; if (gpu->dispCnt().OBJ_BMP_2D_dim)
//256*256, verified by heroes of mana FMV intro
return gpu->sprMem + (((spriteInfo->TileIndex&0x3E0) * 64 + (spriteInfo->TileIndex&0x1F) *8 + ( y << 8)) << 1);
else
//128*512, verified by harry potter and the order of the phoenix conversation portraits
return gpu->sprMem + (((spriteInfo->TileIndex&0x3F0) * 64 + (spriteInfo->TileIndex&0x0F) *8 + ( y << 7)) << 1);
}
} }

View File

@ -92,7 +92,7 @@ void generateAR(HWND dialog, u32 addr, u32 val, u8 size)
{ {
// Action Replay code generate // Action Replay code generate
if (size > 3) size = 3; if (size > 3) size = 3;
char buf[17] = {0}; char buf[64] = {0};
sprintf(buf, "%X%07X %08X", 3-size, addr | 0x02000000, val); sprintf(buf, "%X%07X %08X", 3-size, addr | 0x02000000, val);
SetWindowText(GetDlgItem(dialog, IDC_AR_CODE), buf); SetWindowText(GetDlgItem(dialog, IDC_AR_CODE), buf);
} }

View File

@ -1,21 +1,19 @@
/* Copyright (C) 2006 yopyop /*
Copyright (C) 2006-2010 DeSmuME team Copyright (C) 2006 yopyop
Copyright (C) 2006-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <algorithm> #include <algorithm>
@ -290,8 +288,8 @@ BOOL CALLBACK ViewDisasm_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA
return false; return false;
switch (message) switch (message)
{ {
case WM_INITDIALOG : case WM_INITDIALOG :
{ {
SetWindowText(hwnd, "ARM7 Disassembler"); SetWindowText(hwnd, "ARM7 Disassembler");
SetDlgItemInt(hwnd, IDC_SETPNUM, 1, FALSE); SetDlgItemInt(hwnd, IDC_SETPNUM, 1, FALSE);
@ -307,7 +305,7 @@ BOOL CALLBACK ViewDisasm_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA
DisViewWnd[1] = NULL; DisViewWnd[1] = NULL;
return 1; return 1;
} }
case WM_CLOSE : case WM_CLOSE :
{ {
EndDialog(hwnd,0); EndDialog(hwnd,0);
if(DisView7->autoup) if(DisView7->autoup)
@ -315,16 +313,13 @@ BOOL CALLBACK ViewDisasm_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA
KillTimer(hwnd, IDT_VIEW_DISASM7); KillTimer(hwnd, IDT_VIEW_DISASM7);
DisView7->autoup = false; DisView7->autoup = false;
} }
if (DisView7!=NULL) delete DisView7;
{ DisView7 = NULL;
delete DisView7;
DisView7 = NULL;
}
DisViewWnd[1] = NULL; DisViewWnd[1] = NULL;
//INFO("Close ARM7 disassembler\n"); //INFO("Close ARM7 disassembler\n");
return 1; return 1;
} }
case WM_PAINT: case WM_PAINT:
DisViewDialog_OnPaint(hwnd, DisView7, wParam, lParam); DisViewDialog_OnPaint(hwnd, DisView7, wParam, lParam);
return 1; return 1;
case WM_TIMER: case WM_TIMER:
@ -555,7 +550,7 @@ BOOL CALLBACK ViewDisasm_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA
DisViewWnd[0] = NULL; DisViewWnd[0] = NULL;
return 1; return 1;
} }
case WM_CLOSE : case WM_CLOSE :
{ {
EndDialog(hwnd,0); EndDialog(hwnd,0);
if(DisView9->autoup) if(DisView9->autoup)
@ -563,11 +558,8 @@ BOOL CALLBACK ViewDisasm_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA
KillTimer(hwnd, IDT_VIEW_DISASM9); KillTimer(hwnd, IDT_VIEW_DISASM9);
DisView9->autoup = false; DisView9->autoup = false;
} }
if (DisView9!=NULL) delete DisView9;
{ DisView9 = NULL;
delete DisView9;
DisView9 = NULL;
}
DisViewWnd[0] = NULL; DisViewWnd[0] = NULL;
//INFO("Close ARM9 disassembler\n"); //INFO("Close ARM9 disassembler\n");
return 1; return 1;

View File

@ -121,12 +121,8 @@ BOOL CALLBACK ViewLightsProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
KillTimer(hwnd, IDT_VIEW_LIGHTS); KillTimer(hwnd, IDT_VIEW_LIGHTS);
LightsView->autoup = false; LightsView->autoup = false;
} }
delete LightsView;
if (LightsView!=NULL) LightsView = NULL;
{
delete LightsView;
LightsView = NULL;
}
//INFO("Close lights viewer dialog\n"); //INFO("Close lights viewer dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
break; break;

View File

@ -1,22 +1,19 @@
/* Copyright (C) 2006 yopyop /*
yopyop156@ifrance.com Copyright (C) 2006 yopyop
yopyop156.ifrance.com Copyright (C) 2006-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "mapView.h" #include "mapView.h"
@ -232,11 +229,8 @@ BOOL CALLBACK ViewMapsProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
KillTimer(hwnd, IDT_VIEW_MAP); KillTimer(hwnd, IDT_VIEW_MAP);
MapView->autoup = false; MapView->autoup = false;
} }
if (MapView!=NULL) delete MapView;
{ MapView = NULL;
delete MapView;
MapView = NULL;
}
//INFO("Close Map view dialog\n"); //INFO("Close Map view dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
return 0; return 0;

View File

@ -1,20 +1,19 @@
/* Copyright (C) 2007 Acid Burn /*
Copyright (C) 2007 Acid Burn
Copyright (C) 2007-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "matrixView.h" #include "matrixView.h"
@ -187,11 +186,8 @@ BOOL CALLBACK ViewMatricesProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
MatrixView->autoup = false; MatrixView->autoup = false;
} }
if (MatrixView!=NULL) delete MatrixView;
{ MatrixView = NULL;
delete MatrixView;
MatrixView = NULL;
}
//INFO("Close Matrix view dialog\n"); //INFO("Close Matrix view dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
return 0; return 0;

View File

@ -1,22 +1,19 @@
/* Copyright (C) 2006 yopyop /*
yopyop156@ifrance.com Copyright (C) 2006 yopyop
yopyop156.ifrance.com Copyright (C) 2006-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "CWindow.h" #include "CWindow.h"
@ -220,7 +217,8 @@ INT_PTR CALLBACK MemView_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
u8 memory[0x100]; u8 memory[0x100];
int line; int line;
MMU_DumpMemBlock(wnd->cpu, wnd->address, 0x100, memory); //MMU_DumpMemBlock(wnd->cpu, wnd->address, 0x100, memory);
for(int i=0;i<0x100;i++) memory[i] = MMU.ARM9_LCD[wnd->address+i];
f = fopen(fileName, "a"); f = fopen(fileName, "a");
@ -376,7 +374,8 @@ LRESULT MemView_ViewBoxPaint(CMemView* wnd, HWND hCtl, WPARAM wParam, LPARAM lPa
} }
TextOut(mem_hdc, startx, 0, text, strlen(text)); TextOut(mem_hdc, startx, 0, text, strlen(text));
MMU_DumpMemBlock(wnd->cpu, wnd->address, 0x100, memory); //MMU_DumpMemBlock(wnd->cpu, wnd->address, 0x100, memory);
for(int i=0;i<0x100;i++) memory[i] = MMU.ARM9_LCD[wnd->address+i];
for(line = 0; line < 16; line++, addr += 0x10) for(line = 0; line < 16; line++, addr += 0x10)
{ {
@ -675,7 +674,9 @@ LRESULT CALLBACK MemView_ViewBoxProc(HWND hCtl, UINT uMsg, WPARAM wParam, LPARAM
switch(wnd->viewMode) switch(wnd->viewMode)
{ {
case 0: MMU_write8(wnd->cpu, wnd->selAddress, (u8)wnd->selNewVal); wnd->selAddress++; break; case 0: MMU_write8(wnd->cpu, wnd->selAddress, (u8)wnd->selNewVal); wnd->selAddress++; break;
case 1: MMU_write16(wnd->cpu, wnd->selAddress, (u16)wnd->selNewVal); wnd->selAddress += 2; break; //case 1: MMU_write16(wnd->cpu, wnd->selAddress, (u16)wnd->selNewVal); wnd->selAddress += 2; break;
//case 1: MMU_write16(wnd->cpu, wnd->selAddress, (u16)wnd->selNewVal); wnd->selAddress += 2; break;
case 1: MMU.ARM9_LCD[wnd->selAddress] = wnd->selNewVal; break;
case 2: MMU_write32(wnd->cpu, wnd->selAddress, wnd->selNewVal); wnd->selAddress += 4; break; case 2: MMU_write32(wnd->cpu, wnd->selAddress, wnd->selNewVal); wnd->selAddress += 4; break;
} }
wnd->selPart = 0; wnd->selPart = 0;

View File

@ -1,22 +1,19 @@
/* Copyright (C) 2006 yopyop /*
yopyop156@ifrance.com Copyright (C) 2006 yopyop
yopyop156.ifrance.com Copyright (C) 2006-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "oamView.h" #include "oamView.h"
@ -299,12 +296,8 @@ BOOL CALLBACK ViewOAMProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
KillTimer(hwnd, IDT_VIEW_OAM); KillTimer(hwnd, IDT_VIEW_OAM);
OAMView->autoup = false; OAMView->autoup = false;
} }
delete OAMView;
if (OAMView!=NULL) OAMView = NULL;
{
delete OAMView;
OAMView = NULL;
}
DeleteObject(bhScyx); DeleteObject(bhScyx);
DeleteObject(bhBack); DeleteObject(bhBack);
//INFO("Close OAM viewer dialog\n"); //INFO("Close OAM viewer dialog\n");

View File

@ -1,22 +1,19 @@
/* Copyright (C) 2006 yopyop /*
yopyop156@ifrance.com Copyright (C) 2006 yopyop
yopyop156.ifrance.com Copyright (C) 2006-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "palView.h" #include "palView.h"
@ -136,12 +133,8 @@ BOOL CALLBACK ViewPalProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
KillTimer(hwnd, IDT_VIEW_DISASM7); KillTimer(hwnd, IDT_VIEW_DISASM7);
PalView->autoup = false; PalView->autoup = false;
} }
delete PalView;
if (PalView!=NULL) PalView = NULL;
{
delete PalView;
PalView = NULL;
}
//INFO("Close Palette view dialog\n"); //INFO("Close Palette view dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
return 0; return 0;

View File

@ -1,22 +1,19 @@
/* Copyright (C) 2006 yopyop /*
yopyop156@ifrance.com Copyright (C) 2006 yopyop
yopyop156.ifrance.com Copyright (C) 2006-2011 DeSmuME team
This file is part of DeSmuME This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "tileView.h" #include "tileView.h"
@ -117,7 +114,6 @@ LRESULT TileViewBox_Pal256(HWND hwnd, tileview_struct * win, WPARAM wParam, LPAR
HDC hdc; HDC hdc;
PAINTSTRUCT ps; PAINTSTRUCT ps;
// SIZE fontsize; // SIZE fontsize;
TCHAR text[80];
u16 bitmap[256*256]; u16 bitmap[256*256];
u16 * pal = ((u16 *)win->pal) + win->palnum*256; u16 * pal = ((u16 *)win->pal) + win->palnum*256;
BITMAPV4HEADER bmi; BITMAPV4HEADER bmi;
@ -188,7 +184,6 @@ LRESULT TileViewBox_Pal16(HWND hwnd, tileview_struct * win, WPARAM wParam, LPARA
HDC hdc; HDC hdc;
PAINTSTRUCT ps; PAINTSTRUCT ps;
// SIZE fontsize; // SIZE fontsize;
TCHAR text[80];
u16 bitmap[512*512]; u16 bitmap[512*512];
u16 * pal = ((u16 *)win->pal) + win->palnum*16; u16 * pal = ((u16 *)win->pal) + win->palnum*16;
BITMAPV4HEADER bmi; BITMAPV4HEADER bmi;
@ -429,11 +424,8 @@ BOOL CALLBACK ViewTilesProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
KillTimer(hwnd, IDT_VIEW_TILE); KillTimer(hwnd, IDT_VIEW_TILE);
TileView->autoup = false; TileView->autoup = false;
} }
if (TileView!=NULL) delete TileView;
{ TileView = NULL;
delete TileView;
TileView = NULL;
}
//INFO("Close Tile view dialog\n"); //INFO("Close Tile view dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
return 1; return 1;