moved timers id for Windows port in common.h :)

This commit is contained in:
mtabachenko 2009-02-03 22:26:01 +00:00
parent 3d7cfba55f
commit 23f54c7d71
12 changed files with 2050 additions and 2051 deletions

View File

@ -34,6 +34,19 @@ extern u8 gba_header_data_0x04[156];
#define _WINSOCKAPI_ #define _WINSOCKAPI_
#include <windows.h> #include <windows.h>
#define IDT_VIEW_DISASM7 50001
#define IDT_VIEW_DISASM9 50002
#define IDT_VIEW_MEM7 50003
#define IDT_VIEW_MEM9 50004
#define IDT_VIEW_IOREG 50005
#define IDT_VIEW_PAL 50006
#define IDT_VIEW_TILE 50007
#define IDT_VIEW_MAP 50008
#define IDT_VIEW_OAM 50009
#define IDT_VIEW_MATRIX 50010
#define IDT_VIEW_LIGHTS 50011
#define IDM_EXEC 50112
#define CLASSNAME "DeSmuME" #define CLASSNAME "DeSmuME"
extern HINSTANCE hAppInst; extern HINSTANCE hAppInst;

View File

@ -1056,10 +1056,6 @@
RelativePath=".\palView.h" RelativePath=".\palView.h"
> >
</File> </File>
<File
RelativePath=".\res_timer_ids.h"
>
</File>
<File <File
RelativePath=".\resource.h" RelativePath=".\resource.h"
> >

View File

@ -1,172 +1,171 @@
/* Copyright (C) 2006 yopyop /* Copyright (C) 2006 yopyop
yopyop156@ifrance.com yopyop156@ifrance.com
yopyop156.ifrance.com yopyop156.ifrance.com
This file is part of DeSmuME This file is part of DeSmuME
DeSmuME 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, DeSmuME 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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "ioregview.h" #include "ioregview.h"
#include <commctrl.h> #include <commctrl.h>
#include "debug.h" #include "debug.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h" #include "../MMU.h"
#include "../MMU.h" #include "../armcpu.h"
#include "../armcpu.h"
typedef struct
typedef struct {
{ u32 autoup_secs;
u32 autoup_secs; bool autoup;
bool autoup; } ioregview_struct;
} ioregview_struct;
ioregview_struct *IORegView;
ioregview_struct *IORegView;
LRESULT Ioreg_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
LRESULT Ioreg_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam) {
{ HDC hdc;
HDC hdc; PAINTSTRUCT ps;
PAINTSTRUCT ps; TCHAR text[80];
TCHAR text[80];
hdc = BeginPaint(hwnd, &ps);
hdc = BeginPaint(hwnd, &ps);
// ARM9 registers
// ARM9 registers sprintf(text, "0x%08X", (int)((u32 *)ARM9Mem.ARM9_DTCM)[0x3FFC>>2]);
sprintf(text, "0x%08X", (int)((u32 *)ARM9Mem.ARM9_DTCM)[0x3FFC>>2]); SetWindowText(GetDlgItem(hwnd, IDC_INTHAND9), text);
SetWindowText(GetDlgItem(hwnd, IDC_INTHAND9), text);
sprintf(text, "0x%08X", (int)MMU.reg_IE[ARMCPU_ARM9]);
sprintf(text, "0x%08X", (int)MMU.reg_IE[ARMCPU_ARM9]); SetWindowText(GetDlgItem(hwnd, IDC_IE9), text);
SetWindowText(GetDlgItem(hwnd, IDC_IE9), text);
sprintf(text, "0x%08X", (int)MMU.reg_IF[ARMCPU_ARM9]);
sprintf(text, "0x%08X", (int)MMU.reg_IF[ARMCPU_ARM9]); SetWindowText(GetDlgItem(hwnd, IDC_IF9), text);
SetWindowText(GetDlgItem(hwnd, IDC_IF9), text);
sprintf(text, "0x%08X", (int)MMU.reg_IME[ARMCPU_ARM9]);
sprintf(text, "0x%08X", (int)MMU.reg_IME[ARMCPU_ARM9]); SetWindowText(GetDlgItem(hwnd, IDC_IME9), text);
SetWindowText(GetDlgItem(hwnd, IDC_IME9), text);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x0000>>1]);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x0000>>1]); SetWindowText(GetDlgItem(hwnd, IDC_DISPCNTA9), text);
SetWindowText(GetDlgItem(hwnd, IDC_DISPCNTA9), text);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x0004>>1]);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x0004>>1]); SetWindowText(GetDlgItem(hwnd, IDC_DISPSTATA9), text);
SetWindowText(GetDlgItem(hwnd, IDC_DISPSTATA9), text);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x1000>>1]);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x1000>>1]); SetWindowText(GetDlgItem(hwnd, IDC_DISPCNTB9), text);
SetWindowText(GetDlgItem(hwnd, IDC_DISPCNTB9), text);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x1004>>1]);
sprintf(text, "0x%08X", ((u16 *)ARM9Mem.ARM9_REG)[0x1004>>1]); SetWindowText(GetDlgItem(hwnd, IDC_DISPSTATB9), text);
SetWindowText(GetDlgItem(hwnd, IDC_DISPSTATB9), text);
sprintf(text, "0x%08X", (int)((u32 *)ARM9Mem.ARM9_REG)[0x180>>2]);
sprintf(text, "0x%08X", (int)((u32 *)ARM9Mem.ARM9_REG)[0x180>>2]); SetWindowText(GetDlgItem(hwnd, IDC_IPCSYNC9), text);
SetWindowText(GetDlgItem(hwnd, IDC_IPCSYNC9), text);
sprintf(text, "0x%08X", (int)((u32 *)ARM9Mem.ARM9_REG)[0x184>>2]);
sprintf(text, "0x%08X", (int)((u32 *)ARM9Mem.ARM9_REG)[0x184>>2]); SetWindowText(GetDlgItem(hwnd, IDC_IPCFIFO9), text);
SetWindowText(GetDlgItem(hwnd, IDC_IPCFIFO9), text);
sprintf(text, "0x%08X", (int)((u32 *)(MMU.MMU_MEM[ARMCPU_ARM9][0x40]))[0x600>>2]);
sprintf(text, "0x%08X", (int)((u32 *)(MMU.MMU_MEM[ARMCPU_ARM9][0x40]))[0x600>>2]); SetWindowText(GetDlgItem(hwnd, IDC_GXSTAT9), text);
SetWindowText(GetDlgItem(hwnd, IDC_GXSTAT9), text);
// ARM7 registers
// ARM7 registers sprintf(text, "0x%08X", (int)MMU.reg_IE[ARMCPU_ARM7]);
sprintf(text, "0x%08X", (int)MMU.reg_IE[ARMCPU_ARM7]); SetWindowText(GetDlgItem(hwnd, IDC_IE7), text);
SetWindowText(GetDlgItem(hwnd, IDC_IE7), text);
sprintf(text, "0x%08X", (int)MMU.reg_IF[ARMCPU_ARM7]);
sprintf(text, "0x%08X", (int)MMU.reg_IF[ARMCPU_ARM7]); SetWindowText(GetDlgItem(hwnd, IDC_IF7), text);
SetWindowText(GetDlgItem(hwnd, IDC_IF7), text);
sprintf(text, "0x%08X", (int)MMU.reg_IME[ARMCPU_ARM7]);
sprintf(text, "0x%08X", (int)MMU.reg_IME[ARMCPU_ARM7]); SetWindowText(GetDlgItem(hwnd, IDC_IME7), text);
SetWindowText(GetDlgItem(hwnd, IDC_IME7), text);
sprintf(text, "0x%08X", (int)((u32 *)MMU.ARM7_REG)[0x180>>2]);
sprintf(text, "0x%08X", (int)((u32 *)MMU.ARM7_REG)[0x180>>2]); SetWindowText(GetDlgItem(hwnd, IDC_IPCSYNC7), text);
SetWindowText(GetDlgItem(hwnd, IDC_IPCSYNC7), text);
sprintf(text, "0x%08X", (int)((u32 *)MMU.ARM7_REG)[0x184>>2]);
sprintf(text, "0x%08X", (int)((u32 *)MMU.ARM7_REG)[0x184>>2]); SetWindowText(GetDlgItem(hwnd, IDC_IPCFIFO7), text);
SetWindowText(GetDlgItem(hwnd, IDC_IPCFIFO7), text); EndPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
return 0;
return 0; }
}
BOOL CALLBACK IoregView_Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK IoregView_Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
{ switch (message)
switch (message) {
{ case WM_INITDIALOG :
case WM_INITDIALOG : IORegView = new ioregview_struct;
IORegView = new ioregview_struct; memset(IORegView, 0, sizeof(ioregview_struct));
memset(IORegView, 0, sizeof(ioregview_struct)); IORegView->autoup_secs = 5;
IORegView->autoup_secs = 5; SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), UDM_SETRANGE, 0, MAKELONG(99, 1));
UDM_SETRANGE, 0, MAKELONG(99, 1)); SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), UDM_SETPOS32, 0, IORegView->autoup_secs);
UDM_SETPOS32, 0, IORegView->autoup_secs); return 1;
return 1; case WM_CLOSE :
case WM_CLOSE : if(IORegView->autoup)
if(IORegView->autoup) {
{ KillTimer(hwnd, IDT_VIEW_IOREG);
KillTimer(hwnd, IDT_VIEW_IOREG); IORegView->autoup = false;
IORegView->autoup = false;
} }
if (IORegView!=NULL) if (IORegView!=NULL)
{ {
delete IORegView; delete IORegView;
IORegView = NULL; IORegView = NULL;
} }
PostQuitMessage(0); PostQuitMessage(0);
return 1; return 1;
case WM_PAINT: case WM_PAINT:
Ioreg_OnPaint(hwnd, wParam, lParam); Ioreg_OnPaint(hwnd, wParam, lParam);
return 1; return 1;
case WM_TIMER: case WM_TIMER:
SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0); SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0);
return 1; return 1;
case WM_COMMAND : case WM_COMMAND :
switch (LOWORD (wParam)) switch (LOWORD (wParam))
{ {
case IDC_FERMER : case IDC_FERMER :
SendMessage(hwnd, WM_CLOSE, 0, 0); SendMessage(hwnd, WM_CLOSE, 0, 0);
return 1; return 1;
case IDC_AUTO_UPDATE : case IDC_AUTO_UPDATE :
if(IORegView->autoup) if(IORegView->autoup)
{ {
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false);
KillTimer(hwnd, IDT_VIEW_IOREG); KillTimer(hwnd, IDT_VIEW_IOREG);
IORegView->autoup = FALSE; IORegView->autoup = FALSE;
return 1; return 1;
} }
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true);
IORegView->autoup = TRUE; IORegView->autoup = TRUE;
SetTimer(hwnd, IDT_VIEW_IOREG, IORegView->autoup_secs*1000, (TIMERPROC) NULL); SetTimer(hwnd, IDT_VIEW_IOREG, IORegView->autoup_secs*1000, (TIMERPROC) NULL);
return 1; return 1;
case IDC_AUTO_UPDATE_SECS: case IDC_AUTO_UPDATE_SECS:
{ {
int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE); int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE);
if (t != IORegView->autoup_secs) if (t != IORegView->autoup_secs)
{ {
IORegView->autoup_secs = t; IORegView->autoup_secs = t;
if (IORegView->autoup) if (IORegView->autoup)
SetTimer(hwnd, IDT_VIEW_IOREG, SetTimer(hwnd, IDT_VIEW_IOREG,
IORegView->autoup_secs*1000, (TIMERPROC) NULL); IORegView->autoup_secs*1000, (TIMERPROC) NULL);
} }
} }
return 1; return 1;
case IDC_REFRESH: case IDC_REFRESH:
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
} }
return 0; return 0;
} }
return FALSE; return FALSE;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,185 +1,184 @@
/* Copyright (C) 2007 Acid Burn /* Copyright (C) 2007 Acid Burn
This file is part of DeSmuME This file is part of DeSmuME
DeSmuME 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, DeSmuME 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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "lightView.h" #include "lightView.h"
#include "commctrl.h" #include "commctrl.h"
#include "colorctrl.h" #include "colorctrl.h"
#include "gfx3d.h" #include "gfx3d.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h" #include "debug.h"
#include "debug.h"
// Convert B5G5R5 color format into R8G8B8 color format
// Convert B5G5R5 color format into R8G8B8 color format unsigned int ColorConv_B5R5R5ToR8G8B8(const unsigned int color)
unsigned int ColorConv_B5R5R5ToR8G8B8(const unsigned int color) {
{ return (((color&31)<<16)<<3) | // red
return (((color&31)<<16)<<3) | // red ((((color>>5)&31)<<8)<<3) | // green
((((color>>5)&31)<<8)<<3) | // green (((color>>10)&31)<<3); // blue
(((color>>10)&31)<<3); // blue }
}
typedef struct
typedef struct {
{ u32 autoup_secs;
u32 autoup_secs; bool autoup;
bool autoup; } lightsview_struct;
} lightsview_struct;
lightsview_struct *LightsView = NULL;
lightsview_struct *LightsView = NULL;
void LightView_OnPaintLight(HWND hwnd, int index)
void LightView_OnPaintLight(HWND hwnd, int index) {
{ const int idcDir[4] =
const int idcDir[4] = {
{ IDC_LIGHT_VIEWER_LIGHT0VECTOR_EDIT, IDC_LIGHT_VIEWER_LIGHT1VECTOR_EDIT,
IDC_LIGHT_VIEWER_LIGHT0VECTOR_EDIT, IDC_LIGHT_VIEWER_LIGHT1VECTOR_EDIT, IDC_LIGHT_VIEWER_LIGHT2VECTOR_EDIT, IDC_LIGHT_VIEWER_LIGHT3VECTOR_EDIT
IDC_LIGHT_VIEWER_LIGHT2VECTOR_EDIT, IDC_LIGHT_VIEWER_LIGHT3VECTOR_EDIT };
};
const int idcColorEdit[4] =
const int idcColorEdit[4] = {
{ IDC_LIGHT_VIEWER_LIGHT0COLOR_EDIT, IDC_LIGHT_VIEWER_LIGHT1COLOR_EDIT,
IDC_LIGHT_VIEWER_LIGHT0COLOR_EDIT, IDC_LIGHT_VIEWER_LIGHT1COLOR_EDIT, IDC_LIGHT_VIEWER_LIGHT2COLOR_EDIT, IDC_LIGHT_VIEWER_LIGHT3COLOR_EDIT
IDC_LIGHT_VIEWER_LIGHT2COLOR_EDIT, IDC_LIGHT_VIEWER_LIGHT3COLOR_EDIT };
};
const int idcColorCtrl[4] =
const int idcColorCtrl[4] = {
{ IDC_LIGHT_VIEWER_LIGHT0COLOR_COLORCTRL, IDC_LIGHT_VIEWER_LIGHT1COLOR_COLORCTRL,
IDC_LIGHT_VIEWER_LIGHT0COLOR_COLORCTRL, IDC_LIGHT_VIEWER_LIGHT1COLOR_COLORCTRL, IDC_LIGHT_VIEWER_LIGHT2COLOR_COLORCTRL, IDC_LIGHT_VIEWER_LIGHT3COLOR_COLORCTRL
IDC_LIGHT_VIEWER_LIGHT2COLOR_COLORCTRL, IDC_LIGHT_VIEWER_LIGHT3COLOR_COLORCTRL };
};
unsigned int color;
unsigned int color; unsigned int direction;
unsigned int direction; ColorCtrl* colorCtrl;
ColorCtrl* colorCtrl; char buffer[128];
char buffer[128];
// Get necessary information from gfx3d module
// Get necessary information from gfx3d module gfx3d_glGetLightColor(index, &color);
gfx3d_glGetLightColor(index, &color); gfx3d_glGetLightDirection(index, &direction);
gfx3d_glGetLightDirection(index, &direction);
// Print Light Direction
// Print Light Direction sprintf(buffer, "%.8x", direction);
sprintf(buffer, "%.8x", direction); SetWindowText(GetDlgItem(hwnd, idcDir[index]), buffer);
SetWindowText(GetDlgItem(hwnd, idcDir[index]), buffer);
// Print Light Color
// Print Light Color sprintf(buffer, "%.4x", color);
sprintf(buffer, "%.4x", color); SetWindowText(GetDlgItem(hwnd, idcColorEdit[index]), buffer);
SetWindowText(GetDlgItem(hwnd, idcColorEdit[index]), buffer);
// Set Light Color in ColorDisplay component
// Set Light Color in ColorDisplay component ColorCtrl_SetColor(GetDlgItem(hwnd, idcColorCtrl[index]), ColorConv_B5R5R5ToR8G8B8(color));
ColorCtrl_SetColor(GetDlgItem(hwnd, idcColorCtrl[index]), ColorConv_B5R5R5ToR8G8B8(color)); }
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
BOOL LightView_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
BOOL LightView_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam) {
{ HDC hdc;
HDC hdc; PAINTSTRUCT ps;
PAINTSTRUCT ps;
hdc = BeginPaint(hwnd, &ps);
hdc = BeginPaint(hwnd, &ps);
LightView_OnPaintLight(hwnd, 0);
LightView_OnPaintLight(hwnd, 0); LightView_OnPaintLight(hwnd, 1);
LightView_OnPaintLight(hwnd, 1); LightView_OnPaintLight(hwnd, 2);
LightView_OnPaintLight(hwnd, 2); LightView_OnPaintLight(hwnd, 3);
LightView_OnPaintLight(hwnd, 3);
EndPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
return TRUE;
return TRUE; }
}
BOOL CALLBACK ViewLightsProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK ViewLightsProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
{ switch (message)
switch (message) {
{ case WM_INITDIALOG:
case WM_INITDIALOG: LightsView = new lightsview_struct;
LightsView = new lightsview_struct; memset(LightsView, 0, sizeof(lightsview_struct));
memset(LightsView, 0, sizeof(lightsview_struct)); LightsView->autoup_secs = 5;
LightsView->autoup_secs = 5; SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), UDM_SETRANGE, 0, MAKELONG(99, 1));
UDM_SETRANGE, 0, MAKELONG(99, 1)); SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), UDM_SETPOS32, 0, LightsView->autoup_secs);
UDM_SETPOS32, 0, LightsView->autoup_secs); break;
break;
case WM_CLOSE:
case WM_CLOSE: if(LightsView->autoup)
if(LightsView->autoup) {
{ KillTimer(hwnd, IDT_VIEW_LIGHTS);
KillTimer(hwnd, IDT_VIEW_LIGHTS); LightsView->autoup = false;
LightsView->autoup = false;
} }
if (LightsView!=NULL) 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;
case WM_PAINT: case WM_PAINT:
LightView_OnPaint(hwnd, wParam, lParam); LightView_OnPaint(hwnd, wParam, lParam);
break; break;
case WM_TIMER: case WM_TIMER:
SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0); SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0);
return 1; return 1;
case WM_COMMAND: case WM_COMMAND:
switch (LOWORD (wParam)) switch (LOWORD (wParam))
{ {
case IDOK: case IDOK:
SendMessage(hwnd, WM_CLOSE, 0, 0); SendMessage(hwnd, WM_CLOSE, 0, 0);
return 1; return 1;
case IDC_AUTO_UPDATE : case IDC_AUTO_UPDATE :
if(LightsView->autoup) if(LightsView->autoup)
{ {
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false);
KillTimer(hwnd, IDT_VIEW_LIGHTS); KillTimer(hwnd, IDT_VIEW_LIGHTS);
LightsView->autoup = FALSE; LightsView->autoup = FALSE;
return 1; return 1;
} }
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true);
LightsView->autoup = TRUE; LightsView->autoup = TRUE;
SetTimer(hwnd, IDT_VIEW_LIGHTS, LightsView->autoup_secs*1000, (TIMERPROC) NULL); SetTimer(hwnd, IDT_VIEW_LIGHTS, LightsView->autoup_secs*1000, (TIMERPROC) NULL);
return 1; return 1;
case IDC_AUTO_UPDATE_SECS: case IDC_AUTO_UPDATE_SECS:
{ {
int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE); int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE);
if (!LightsView) if (!LightsView)
{ {
SendMessage(hwnd, WM_INITDIALOG, 0, 0); SendMessage(hwnd, WM_INITDIALOG, 0, 0);
} }
if (t != LightsView->autoup_secs) if (t != LightsView->autoup_secs)
{ {
LightsView->autoup_secs = t; LightsView->autoup_secs = t;
if (LightsView->autoup) if (LightsView->autoup)
SetTimer(hwnd, IDT_VIEW_LIGHTS, SetTimer(hwnd, IDT_VIEW_LIGHTS,
LightsView->autoup_secs*1000, (TIMERPROC) NULL); LightsView->autoup_secs*1000, (TIMERPROC) NULL);
} }
} }
return 1; return 1;
case IDC_REFRESH: case IDC_REFRESH:
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
} }
return 0; return 0;
} }
return FALSE; return FALSE;
} }

View File

@ -44,7 +44,6 @@
#include "../addons.h" #include "../addons.h"
#endif #endif
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h"
#include "memView.h" #include "memView.h"
#include "disView.h" #include "disView.h"
#include "ginfo.h" #include "ginfo.h"

View File

@ -21,7 +21,6 @@
#include "mapView.h" #include "mapView.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h"
#include <commctrl.h> #include <commctrl.h>
#include "../MMU.h" #include "../MMU.h"

View File

@ -21,7 +21,6 @@
#include <commctrl.h> #include <commctrl.h>
#include "debug.h" #include "debug.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h"
#include "gfx3d.h" #include "gfx3d.h"
typedef struct typedef struct

View File

@ -25,13 +25,12 @@
#include "../MMU.h" #include "../MMU.h"
#include "debug.h" #include "debug.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h"
typedef struct typedef struct
{ {
u32 autoup_secs; u32 autoup_secs;
bool autoup; bool autoup;
s8 cpu; s8 cpu;
u32 curr_ligne; u32 curr_ligne;
u8 representation; u8 representation;
@ -206,8 +205,8 @@ LRESULT CALLBACK ViewMem_ARM7BoxProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
BOOL CALLBACK ViewMem_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) BOOL CALLBACK ViewMem_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
//bail out early if the dialog isnt initialized //bail out early if the dialog isnt initialized
if(!MemView7 && message != WM_INITDIALOG) if(!MemView7 && message != WM_INITDIALOG)
return false; return false;
switch (message) switch (message)
@ -219,19 +218,19 @@ BOOL CALLBACK ViewMem_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
MemView7 = new memview_struct; MemView7 = new memview_struct;
memset(MemView7, 0, sizeof(memview_struct)); memset(MemView7, 0, sizeof(memview_struct));
MemView7->cpu = 1; MemView7->cpu = 1;
MemView7->autoup_secs = 5; MemView7->autoup_secs = 5;
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
UDM_SETRANGE, 0, MAKELONG(99, 1)); UDM_SETRANGE, 0, MAKELONG(99, 1));
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
UDM_SETPOS32, 0, MemView7->autoup_secs); UDM_SETPOS32, 0, MemView7->autoup_secs);
return 0; return 0;
} }
case WM_CLOSE: case WM_CLOSE:
{ {
if(MemView7->autoup) if(MemView7->autoup)
{ {
KillTimer(hwnd, IDT_VIEW_MEM7); KillTimer(hwnd, IDT_VIEW_MEM7);
MemView7->autoup = false; MemView7->autoup = false;
} }
if (MemView7!=NULL) if (MemView7!=NULL)
@ -243,8 +242,8 @@ BOOL CALLBACK ViewMem_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
PostQuitMessage(0); PostQuitMessage(0);
return 0; return 0;
} }
case WM_TIMER: case WM_TIMER:
SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0); SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0);
return 1; return 1;
case WM_COMMAND : case WM_COMMAND :
@ -265,38 +264,38 @@ BOOL CALLBACK ViewMem_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE); InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX)); UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX));
return 1; return 1;
case IDC_AUTO_UPDATE : case IDC_AUTO_UPDATE :
if(MemView7->autoup) if(MemView7->autoup)
{ {
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false);
KillTimer(hwnd, IDT_VIEW_MEM7); KillTimer(hwnd, IDT_VIEW_MEM7);
MemView7->autoup = FALSE; MemView7->autoup = FALSE;
return 1; return 1;
} }
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true);
MemView7->autoup = TRUE; MemView7->autoup = TRUE;
SetTimer(hwnd, IDT_VIEW_MEM7, MemView7->autoup_secs*1000, (TIMERPROC) NULL); SetTimer(hwnd, IDT_VIEW_MEM7, MemView7->autoup_secs*1000, (TIMERPROC) NULL);
return 1; return 1;
case IDC_AUTO_UPDATE_SECS: case IDC_AUTO_UPDATE_SECS:
{ {
int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE); int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE);
if (!MemView7) if (!MemView7)
{ {
SendMessage(hwnd, WM_INITDIALOG, 0, 0); SendMessage(hwnd, WM_INITDIALOG, 0, 0);
} }
if (t != MemView7->autoup_secs) if (t != MemView7->autoup_secs)
{ {
MemView7->autoup_secs = t; MemView7->autoup_secs = t;
if (MemView7->autoup) if (MemView7->autoup)
SetTimer(hwnd, IDT_VIEW_MEM7, SetTimer(hwnd, IDT_VIEW_MEM7,
MemView7->autoup_secs*1000, (TIMERPROC) NULL); MemView7->autoup_secs*1000, (TIMERPROC) NULL);
} }
} }
return 1; return 1;
case IDC_REFRESH: case IDC_REFRESH:
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
case IDC_GO : case IDC_GO :
{ {
@ -394,8 +393,8 @@ LRESULT CALLBACK ViewMem_ARM9BoxProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
BOOL CALLBACK ViewMem_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) BOOL CALLBACK ViewMem_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
//bail out early if the dialog isnt initialized //bail out early if the dialog isnt initialized
if(!MemView9 && message != WM_INITDIALOG) if(!MemView9 && message != WM_INITDIALOG)
return false; return false;
switch (message) switch (message)
@ -407,19 +406,19 @@ BOOL CALLBACK ViewMem_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
MemView9 = new memview_struct; MemView9 = new memview_struct;
memset(MemView9, 0, sizeof(memview_struct)); memset(MemView9, 0, sizeof(memview_struct));
MemView9->cpu = 0; MemView9->cpu = 0;
MemView9->autoup_secs = 5; MemView9->autoup_secs = 5;
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
UDM_SETRANGE, 0, MAKELONG(99, 1)); UDM_SETRANGE, 0, MAKELONG(99, 1));
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
UDM_SETPOS32, 0, MemView9->autoup_secs); UDM_SETPOS32, 0, MemView9->autoup_secs);
return 1; return 1;
} }
case WM_CLOSE: case WM_CLOSE:
{ {
if(MemView9->autoup) if(MemView9->autoup)
{ {
KillTimer(hwnd, IDT_VIEW_MEM9); KillTimer(hwnd, IDT_VIEW_MEM9);
MemView9->autoup = false; MemView9->autoup = false;
} }
if (MemView9!=NULL) if (MemView9!=NULL)
@ -431,8 +430,8 @@ BOOL CALLBACK ViewMem_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
PostQuitMessage(0); PostQuitMessage(0);
return 0; return 0;
} }
case WM_TIMER: case WM_TIMER:
SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0); SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0);
return 1; return 1;
case WM_COMMAND : case WM_COMMAND :
@ -453,38 +452,38 @@ BOOL CALLBACK ViewMem_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE); InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX)); UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX));
return 1; return 1;
case IDC_AUTO_UPDATE : case IDC_AUTO_UPDATE :
if(MemView9->autoup) if(MemView9->autoup)
{ {
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false);
KillTimer(hwnd, IDT_VIEW_MEM9); KillTimer(hwnd, IDT_VIEW_MEM9);
MemView9->autoup = FALSE; MemView9->autoup = FALSE;
return 1; return 1;
} }
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true);
MemView9->autoup = TRUE; MemView9->autoup = TRUE;
SetTimer(hwnd, IDT_VIEW_MEM9, MemView9->autoup_secs*1000, (TIMERPROC) NULL); SetTimer(hwnd, IDT_VIEW_MEM9, MemView9->autoup_secs*1000, (TIMERPROC) NULL);
return 1; return 1;
case IDC_AUTO_UPDATE_SECS: case IDC_AUTO_UPDATE_SECS:
{ {
int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE); int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE);
if (!MemView9) if (!MemView9)
{ {
SendMessage(hwnd, WM_INITDIALOG, 0, 0); SendMessage(hwnd, WM_INITDIALOG, 0, 0);
} }
if (t != MemView9->autoup_secs) if (t != MemView9->autoup_secs)
{ {
MemView9->autoup_secs = t; MemView9->autoup_secs = t;
if (MemView9->autoup) if (MemView9->autoup)
SetTimer(hwnd, IDT_VIEW_MEM9, SetTimer(hwnd, IDT_VIEW_MEM9,
MemView9->autoup_secs*1000, (TIMERPROC) NULL); MemView9->autoup_secs*1000, (TIMERPROC) NULL);
} }
} }
return 1; return 1;
case IDC_REFRESH: case IDC_REFRESH:
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
case IDC_GO : case IDC_GO :
{ {

View File

@ -23,7 +23,6 @@
#include <commctrl.h> #include <commctrl.h>
#include "debug.h" #include "debug.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h"
#include "../MMU.h" #include "../MMU.h"
#include "../GPU.h" #include "../GPU.h"
#include "../NDSSystem.h" #include "../NDSSystem.h"

View File

@ -1,140 +1,139 @@
/* Copyright (C) 2006 yopyop /* Copyright (C) 2006 yopyop
yopyop156@ifrance.com yopyop156@ifrance.com
yopyop156.ifrance.com yopyop156.ifrance.com
This file is part of DeSmuME This file is part of DeSmuME
DeSmuME 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, DeSmuME 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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "palView.h" #include "palView.h"
#include <commctrl.h> #include <commctrl.h>
#include "debug.h" #include "debug.h"
#include "resource.h" #include "resource.h"
#include "res_timer_ids.h" #include "../MMU.h"
#include "../MMU.h"
typedef struct
typedef struct {
{ u32 autoup_secs;
u32 autoup_secs; bool autoup;
bool autoup;
u16 *adr;
u16 *adr; s16 palnum;
s16 palnum; } palview_struct;
} palview_struct;
palview_struct *PalView = NULL;
palview_struct *PalView = NULL;
LRESULT PalView_OnPaint(const u16 * adr, u16 num, HWND hwnd, WPARAM wParam, LPARAM lParam)
LRESULT PalView_OnPaint(const u16 * adr, u16 num, HWND hwnd, WPARAM wParam, LPARAM lParam) {
{ HDC hdc;
HDC hdc; PAINTSTRUCT ps;
PAINTSTRUCT ps; RECT rect;
RECT rect; HBRUSH brush;
HBRUSH brush; u16 c;
u16 c; char tmp[80];
char tmp[80];
rect.left = 3;
rect.left = 3; rect.top = 55;
rect.top = 55; rect.right = 13;
rect.right = 13; rect.bottom = 65;
rect.bottom = 65; hdc = BeginPaint(hwnd, &ps);
hdc = BeginPaint(hwnd, &ps);
if(adr)
if(adr) {
{ u32 y;
u32 y;
for(y = 0; y < 16; ++y)
for(y = 0; y < 16; ++y) {
{ u32 x;
u32 x;
for(x = 0; x < 16; ++x)
for(x = 0; x < 16; ++x) {
{ c = adr[(y<<4)+x+0x100*num];
c = adr[(y<<4)+x+0x100*num]; brush = CreateSolidBrush(RGB((c&0x1F)<<3, (c&0x3E0)>>2, (c&0x7C00)>>7));
brush = CreateSolidBrush(RGB((c&0x1F)<<3, (c&0x3E0)>>2, (c&0x7C00)>>7)); FillRect(hdc, &rect, brush);
FillRect(hdc, &rect, brush); DeleteObject(brush);
DeleteObject(brush); rect.left += 11;
rect.left += 11; rect.right += 11;
rect.right += 11; }
} rect.top += 11;
rect.top += 11; rect.bottom += 11;
rect.bottom += 11; rect.left = 3;
rect.left = 3; rect.right = 13;
rect.right = 13; }
} sprintf(tmp, "Pal : %d", num);
sprintf(tmp, "Pal : %d", num); SetWindowText(GetDlgItem(hwnd, IDC_PALNUM), tmp);
SetWindowText(GetDlgItem(hwnd, IDC_PALNUM), tmp); }
} else
else TextOut(hdc, 3, 55, "Pas de palette", 14);
TextOut(hdc, 3, 55, "Pas de palette", 14); EndPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
return 0;
return 0; }
}
BOOL CALLBACK ViewPalProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL CALLBACK ViewPalProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
{ //bail out early if the dialog isnt initialized
//bail out early if the dialog isnt initialized if(!PalView && message != WM_INITDIALOG)
if(!PalView && message != WM_INITDIALOG) return false;
return false;
switch (message)
switch (message) {
{ case WM_INITDIALOG :
case WM_INITDIALOG : {
{ PalView = new palview_struct;
PalView = new palview_struct; memset(PalView, 0, sizeof(palview_struct));
memset(PalView, 0, sizeof(palview_struct)); PalView->adr = (u16 *)ARM9Mem.ARM9_VMEM;
PalView->adr = (u16 *)ARM9Mem.ARM9_VMEM; PalView->autoup_secs = 5;
PalView->autoup_secs = 5; SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), UDM_SETRANGE, 0, MAKELONG(99, 1));
UDM_SETRANGE, 0, MAKELONG(99, 1)); SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN),
SendMessage(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), UDM_SETPOS32, 0, PalView->autoup_secs);
UDM_SETPOS32, 0, PalView->autoup_secs);
HWND combo = GetDlgItem(hwnd, IDC_PAL_SELECT);
HWND combo = GetDlgItem(hwnd, IDC_PAL_SELECT); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen BG PAL");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen BG PAL"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen BG PAL");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen BG PAL"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen SPR PAL");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen SPR PAL"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen SPR PAL");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen SPR PAL"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 0"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 1"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 2");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 2"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 3");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen ExtPAL 3"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 0"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 1"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 2");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 2"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 3");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen ExtPAL 3"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main spr ExtPAL 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main spr ExtPAL 0"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main spr ExtPAL 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main spr ExtPAL 1"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub spr ExtPAL 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub spr ExtPAL 0"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub spr ExtPAL 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub spr ExtPAL 1"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 0"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 1"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 2");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 2"); SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 3");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Texture pal 3"); SendMessage(combo, CB_SETCURSEL, 0, 0);
SendMessage(combo, CB_SETCURSEL, 0, 0); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE); }
} return 1;
return 1;
case WM_CLOSE : case WM_CLOSE :
{ {
if(PalView->autoup) if(PalView->autoup)
{ {
KillTimer(hwnd, IDT_VIEW_DISASM7); KillTimer(hwnd, IDT_VIEW_DISASM7);
PalView->autoup = false; PalView->autoup = false;
} }
if (PalView!=NULL) if (PalView!=NULL)
@ -145,152 +144,152 @@ BOOL CALLBACK ViewPalProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
//INFO("Close Palette view dialog\n"); //INFO("Close Palette view dialog\n");
PostQuitMessage(0); PostQuitMessage(0);
return 0; return 0;
} }
case WM_PAINT: case WM_PAINT:
PalView_OnPaint(PalView->adr, PalView->palnum, hwnd, wParam, lParam); PalView_OnPaint(PalView->adr, PalView->palnum, hwnd, wParam, lParam);
return 1; return 1;
case WM_TIMER: case WM_TIMER:
SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0); SendMessage(hwnd, WM_COMMAND, IDC_REFRESH, 0);
return 1; return 1;
case WM_HSCROLL : case WM_HSCROLL :
switch LOWORD(wParam) switch LOWORD(wParam)
{ {
case SB_LINERIGHT : case SB_LINERIGHT :
++(PalView->palnum); ++(PalView->palnum);
if(PalView->palnum>15) if(PalView->palnum>15)
PalView->palnum = 15; PalView->palnum = 15;
break; break;
case SB_LINELEFT : case SB_LINELEFT :
--(PalView->palnum); --(PalView->palnum);
if(PalView->palnum<0) if(PalView->palnum<0)
PalView->palnum = 0; PalView->palnum = 0;
break; break;
} }
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
case WM_COMMAND : case WM_COMMAND :
switch (LOWORD (wParam)) switch (LOWORD (wParam))
{ {
case IDC_FERMER : case IDC_FERMER :
SendMessage(hwnd, WM_CLOSE, 0, 0); SendMessage(hwnd, WM_CLOSE, 0, 0);
return 1; return 1;
case IDC_AUTO_UPDATE : case IDC_AUTO_UPDATE :
if(PalView->autoup) if(PalView->autoup)
{ {
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), false);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), false);
KillTimer(hwnd, IDT_VIEW_PAL); KillTimer(hwnd, IDT_VIEW_PAL);
PalView->autoup = FALSE; PalView->autoup = FALSE;
return 1; return 1;
} }
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SECS), true);
EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true); EnableWindow(GetDlgItem(hwnd, IDC_AUTO_UPDATE_SPIN), true);
PalView->autoup = TRUE; PalView->autoup = TRUE;
SetTimer(hwnd, IDT_VIEW_PAL, PalView->autoup_secs*1000, (TIMERPROC) NULL); SetTimer(hwnd, IDT_VIEW_PAL, PalView->autoup_secs*1000, (TIMERPROC) NULL);
return 1; return 1;
case IDC_AUTO_UPDATE_SECS: case IDC_AUTO_UPDATE_SECS:
{ {
int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE); int t = GetDlgItemInt(hwnd, IDC_AUTO_UPDATE_SECS, FALSE, TRUE);
if (!PalView) if (!PalView)
{ {
SendMessage(hwnd, WM_INITDIALOG, 0, 0); SendMessage(hwnd, WM_INITDIALOG, 0, 0);
} }
if (t != PalView->autoup_secs) if (t != PalView->autoup_secs)
{ {
PalView->autoup_secs = t; PalView->autoup_secs = t;
if (PalView->autoup) if (PalView->autoup)
SetTimer(hwnd, IDT_VIEW_PAL, SetTimer(hwnd, IDT_VIEW_PAL,
PalView->autoup_secs*1000, (TIMERPROC) NULL); PalView->autoup_secs*1000, (TIMERPROC) NULL);
} }
} }
return 1; return 1;
case IDC_REFRESH: case IDC_REFRESH:
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
case IDC_PAL_SELECT : case IDC_PAL_SELECT :
switch(HIWORD(wParam)) switch(HIWORD(wParam))
{ {
case CBN_SELCHANGE : case CBN_SELCHANGE :
case CBN_CLOSEUP : case CBN_CLOSEUP :
{ {
u32 sel = SendMessage(GetDlgItem(hwnd, IDC_PAL_SELECT), CB_GETCURSEL, 0, 0); u32 sel = SendMessage(GetDlgItem(hwnd, IDC_PAL_SELECT), CB_GETCURSEL, 0, 0);
switch(sel) switch(sel)
{ {
case 0 : case 0 :
PalView->adr = (u16 *)ARM9Mem.ARM9_VMEM; PalView->adr = (u16 *)ARM9Mem.ARM9_VMEM;
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE);
break; break;
case 1 : case 1 :
PalView->adr = ((u16 *)ARM9Mem.ARM9_VMEM) + 0x200; PalView->adr = ((u16 *)ARM9Mem.ARM9_VMEM) + 0x200;
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE);
break; break;
case 2 : case 2 :
PalView->adr = (u16 *)ARM9Mem.ARM9_VMEM + 0x100; PalView->adr = (u16 *)ARM9Mem.ARM9_VMEM + 0x100;
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE);
break; break;
case 3 : case 3 :
PalView->adr = ((u16 *)ARM9Mem.ARM9_VMEM) + 0x300; PalView->adr = ((u16 *)ARM9Mem.ARM9_VMEM) + 0x300;
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), FALSE);
break; break;
case 4 : case 4 :
case 5 : case 5 :
case 6 : case 6 :
case 7 : case 7 :
PalView->adr = ((u16 *)(ARM9Mem.ExtPal[0][sel-4])); PalView->adr = ((u16 *)(ARM9Mem.ExtPal[0][sel-4]));
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE);
break; break;
case 8 : case 8 :
case 9 : case 9 :
case 10 : case 10 :
case 11 : case 11 :
PalView->adr = ((u16 *)(ARM9Mem.ExtPal[1][sel-8])); PalView->adr = ((u16 *)(ARM9Mem.ExtPal[1][sel-8]));
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE);
break; break;
case 12 : case 12 :
case 13 : case 13 :
PalView->adr = ((u16 *)(ARM9Mem.ObjExtPal[0][sel-12])); PalView->adr = ((u16 *)(ARM9Mem.ObjExtPal[0][sel-12]));
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE);
break; break;
case 14 : case 14 :
case 15 : case 15 :
PalView->adr = ((u16 *)(ARM9Mem.ObjExtPal[1][sel-14])); PalView->adr = ((u16 *)(ARM9Mem.ObjExtPal[1][sel-14]));
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE);
break; break;
case 16 : case 16 :
case 17 : case 17 :
case 18 : case 18 :
case 19 : case 19 :
PalView->adr = ((u16 *)(ARM9Mem.texPalSlot[sel-16])); PalView->adr = ((u16 *)(ARM9Mem.texPalSlot[sel-16]));
PalView->palnum = 0; PalView->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW); ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), TRUE);
break; break;
default : default :
return 1; return 1;
} }
InvalidateRect(hwnd, NULL, FALSE); InvalidateRect(hwnd, NULL, FALSE);
return 1; return 1;
} }
} }
return 1; return 1;
} }
return 0; return 0;
} }
return false; return false;
} }

File diff suppressed because it is too large Load Diff