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_
#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"
extern HINSTANCE hAppInst;

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff