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

@ -1448,14 +1448,11 @@ FORCEINLINE BOOL compute_sprite_vars(_OAM_ * spriteInfo, u16 l,
//TODO - refactor this so there isnt as much duped code between rotozoomed and non-rotozoomed versions //TODO - refactor this so there isnt as much duped code between rotozoomed and non-rotozoomed versions
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 (spriteInfo->Mode == 3) //sprite is in BMP format
{ {
if (gpu->dispCnt().OBJ_BMP_mapping) if (gpu->dispCnt().OBJ_BMP_mapping)
{ {
//tested by buffy sacrifice damage blood splatters in corner //tested by buffy sacrifice damage blood splatters in corner
src = gpu->sprMem + (spriteInfo->TileIndex<<gpu->sprBMPBoundary) + (y*sprSize.x*2); return gpu->sprMem + (spriteInfo->TileIndex<<gpu->sprBMPBoundary) + (y*sprSize.x*2);
} }
else else
{ {
@ -1464,16 +1461,13 @@ static u32 bmp_sprite_address(GPU* gpu, _OAM_ * spriteInfo, size sprSize, s32 y)
if (gpu->dispCnt().OBJ_BMP_2D_dim) if (gpu->dispCnt().OBJ_BMP_2D_dim)
//256*256, verified by heroes of mana FMV intro //256*256, verified by heroes of mana FMV intro
src = gpu->sprMem + (((spriteInfo->TileIndex&0x3E0) * 64 + (spriteInfo->TileIndex&0x1F) *8 + ( y << 8)) << 1); return gpu->sprMem + (((spriteInfo->TileIndex&0x3E0) * 64 + (spriteInfo->TileIndex&0x1F) *8 + ( y << 8)) << 1);
else else
//128*512, verified by harry potter and the order of the phoenix conversation portraits //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); return gpu->sprMem + (((spriteInfo->TileIndex&0x3F0) * 64 + (spriteInfo->TileIndex&0x0F) *8 + ( y << 7)) << 1);
} }
} }
return src;
}
template<GPU::SpriteRenderMode MODE> template<GPU::SpriteRenderMode MODE>
void GPU::_spriteRender(u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab) void GPU::_spriteRender(u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab)

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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <algorithm> #include <algorithm>
@ -315,11 +313,8 @@ 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; delete DisView7;
DisView7 = NULL; DisView7 = NULL;
}
DisViewWnd[1] = NULL; DisViewWnd[1] = NULL;
//INFO("Close ARM7 disassembler\n"); //INFO("Close ARM7 disassembler\n");
return 1; return 1;
@ -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; delete DisView9;
DisView9 = NULL; 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;
} }
if (LightsView!=NULL)
{
delete LightsView; delete LightsView;
LightsView = NULL; 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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
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; delete MapView;
MapView = NULL; 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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
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; delete MatrixView;
MatrixView = NULL; 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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
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;
} }
if (OAMView!=NULL)
{
delete OAMView; delete OAMView;
OAMView = NULL; 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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
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;
} }
if (PalView!=NULL)
{
delete PalView; delete PalView;
PalView = NULL; 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
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with the this software. If not, see <http://www.gnu.org/licenses/>.
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; delete TileView;
TileView = NULL; TileView = NULL;
}
//INFO("Close Tile view dialog\n"); //INFO("Close Tile view dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
return 1; return 1;