-files now compile in VC++
This commit is contained in:
parent
63614f864e
commit
af06f98596
|
@ -27,7 +27,7 @@ cwindow_struct *updatewindowlist = NULL;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int CWindow_Init(void *win, HINSTANCE hInst, const char * cname, const char * title, int style, int sx, int sy, LRESULT CALLBACK (* wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam))
|
int CWindow_Init(void *win, HINSTANCE hInst, const char * cname, const char * title, int style, int sx, int sy, WNDPROC wP)
|
||||||
{
|
{
|
||||||
static BOOL first = FALSE;
|
static BOOL first = FALSE;
|
||||||
RECT clientaera;
|
RECT clientaera;
|
||||||
|
@ -95,7 +95,7 @@ int CWindow_Init(void *win, HINSTANCE hInst, const char * cname, const char * ti
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int CWindow_Init2(void *win, HINSTANCE hInst, HWND parent, char * title, int ID, BOOL CALLBACK (*wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam))
|
int CWindow_Init2(void *win, HINSTANCE hInst, HWND parent, char * title, int ID, DLGPROC wP)
|
||||||
{
|
{
|
||||||
cwindow_struct *win2=(cwindow_struct *)win;
|
cwindow_struct *win2=(cwindow_struct *)win;
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ typedef struct
|
||||||
void (*Refresh)(void *win);
|
void (*Refresh)(void *win);
|
||||||
} cwindow_struct;
|
} cwindow_struct;
|
||||||
|
|
||||||
int CWindow_Init(void *win, HINSTANCE hInst, const char * cname, const char * title, int style, int sx, int sy, LRESULT CALLBACK (* wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
|
int CWindow_Init(void *win, HINSTANCE hInst, const char * cname, const char * title, int style, int sx, int sy, WNDPROC wP);
|
||||||
int CWindow_Init2(void *win, HINSTANCE hInst, HWND parent, char * title, int ID, BOOL CALLBACK (*wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
|
int CWindow_Init2(void *win, HINSTANCE hInst, HWND parent, char * title, int ID, DLGPROC wP);
|
||||||
void CWindow_Show(void *win);
|
void CWindow_Show(void *win);
|
||||||
void CWindow_Hide(void *win);
|
void CWindow_Hide(void *win);
|
||||||
void CWindow_Refresh(void *win);
|
void CWindow_Refresh(void *win);
|
||||||
|
|
|
@ -69,9 +69,10 @@ void GetINIPath(char *inipath)
|
||||||
szPath = vPath;
|
szPath = vPath;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
char *p;
|
||||||
ZeroMemory(vPath, sizeof(vPath));
|
ZeroMemory(vPath, sizeof(vPath));
|
||||||
GetModuleFileName(NULL, vPath, sizeof(vPath));
|
GetModuleFileName(NULL, vPath, sizeof(vPath));
|
||||||
char *p = vPath + lstrlen(vPath);
|
p = vPath + lstrlen(vPath);
|
||||||
while (p >= vPath && *p != '\\') p--;
|
while (p >= vPath && *p != '\\') p--;
|
||||||
if (++p >= vPath) *p = 0;
|
if (++p >= vPath) *p = 0;
|
||||||
szPath = vPath;
|
szPath = vPath;
|
||||||
|
|
|
@ -411,16 +411,21 @@ LRESULT DisViewBox_OnPaint(disview_struct *win, WPARAM wParam, LPARAM lParam)
|
||||||
SIZE fontsize;
|
SIZE fontsize;
|
||||||
TCHAR text[100];
|
TCHAR text[100];
|
||||||
TCHAR txt[100];
|
TCHAR txt[100];
|
||||||
|
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
int lg;
|
||||||
|
int ht;
|
||||||
|
HDC mem_dc;
|
||||||
|
HBITMAP mem_bmp;
|
||||||
|
u32 nbligne;
|
||||||
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
int lg = rect.right - rect.left;
|
lg = rect.right - rect.left;
|
||||||
int ht = rect.bottom - rect.top;
|
ht = rect.bottom - rect.top;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
HDC mem_dc = CreateCompatibleDC(hdc);
|
mem_dc = CreateCompatibleDC(hdc);
|
||||||
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
||||||
SelectObject(mem_dc, mem_bmp);
|
SelectObject(mem_dc, mem_bmp);
|
||||||
|
|
||||||
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
@ -429,7 +434,7 @@ LRESULT DisViewBox_OnPaint(disview_struct *win, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
GetTextExtentPoint32(mem_dc, "0", 1, &fontsize);
|
GetTextExtentPoint32(mem_dc, "0", 1, &fontsize);
|
||||||
|
|
||||||
u32 nbligne = ht/fontsize.cy;
|
nbligne = ht/fontsize.cy;
|
||||||
|
|
||||||
SetTextColor(mem_dc, RGB(0,0,0));
|
SetTextColor(mem_dc, RGB(0,0,0));
|
||||||
|
|
||||||
|
@ -591,12 +596,16 @@ LRESULT CALLBACK DisViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
SIZE fontsize;
|
SIZE fontsize;
|
||||||
|
HDC dc;
|
||||||
|
HFONT old;
|
||||||
|
int nbligne;
|
||||||
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
HDC dc = GetDC(hwnd);
|
dc = GetDC(hwnd);
|
||||||
HFONT old = (HFONT)SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
|
old = (HFONT)SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
|
||||||
GetTextExtentPoint32(dc, "0", 1, &fontsize);
|
GetTextExtentPoint32(dc, "0", 1, &fontsize);
|
||||||
|
|
||||||
int nbligne = (rect.bottom - rect.top)/fontsize.cy;
|
nbligne = (rect.bottom - rect.top)/fontsize.cy;
|
||||||
|
|
||||||
switch LOWORD(wParam)
|
switch LOWORD(wParam)
|
||||||
{
|
{
|
||||||
|
@ -686,20 +695,21 @@ BOOL CALLBACK DisView_Proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
|
||||||
return 1;
|
return 1;
|
||||||
case IDC_STEP :
|
case IDC_STEP :
|
||||||
{
|
{
|
||||||
BITMAPV4HEADER bmi;
|
BITMAPV4HEADER bmi;
|
||||||
|
int ndstep;
|
||||||
|
|
||||||
//CreateBitmapIndirect(&bmi);
|
//CreateBitmapIndirect(&bmi);
|
||||||
memset(&bmi, 0, sizeof(bmi));
|
memset(&bmi, 0, sizeof(bmi));
|
||||||
bmi.bV4Size = sizeof(bmi);
|
bmi.bV4Size = sizeof(bmi);
|
||||||
bmi.bV4Planes = 1;
|
bmi.bV4Planes = 1;
|
||||||
bmi.bV4BitCount = 16;
|
bmi.bV4BitCount = 16;
|
||||||
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
|
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
|
||||||
bmi.bV4RedMask = 0x001F;
|
bmi.bV4RedMask = 0x001F;
|
||||||
bmi.bV4GreenMask = 0x03E0;
|
bmi.bV4GreenMask = 0x03E0;
|
||||||
bmi.bV4BlueMask = 0x7C00;
|
bmi.bV4BlueMask = 0x7C00;
|
||||||
bmi.bV4Width = 256;
|
bmi.bV4Width = 256;
|
||||||
bmi.bV4Height = -192;
|
bmi.bV4Height = -192;
|
||||||
int ndstep = GetDlgItemInt(hwnd, IDC_SETPNUM, NULL, FALSE);
|
ndstep = GetDlgItemInt(hwnd, IDC_SETPNUM, NULL, FALSE);
|
||||||
NDS_exec(ndstep, TRUE);
|
NDS_exec(ndstep, TRUE);
|
||||||
if(!win->autoup) win->Refresh(win);
|
if(!win->autoup) win->Refresh(win);
|
||||||
CWindow_RefreshALL();
|
CWindow_RefreshALL();
|
||||||
|
|
|
@ -255,9 +255,9 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||||
|
|
||||||
{
|
{
|
||||||
MSG messages; /* Here messages to the application are saved */
|
MSG messages; /* Here messages to the application are saved */
|
||||||
hAppInst=hThisInstance;
|
|
||||||
char text[80];
|
char text[80];
|
||||||
cwindow_struct MainWindow;
|
cwindow_struct MainWindow;
|
||||||
|
hAppInst=hThisInstance;
|
||||||
|
|
||||||
InitializeCriticalSection(§ion);
|
InitializeCriticalSection(§ion);
|
||||||
sprintf(text, "DeSmuME v%s", VERSION);
|
sprintf(text, "DeSmuME v%s", VERSION);
|
||||||
|
@ -534,9 +534,11 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
if(HIWORD(lParam)>=192)
|
if(HIWORD(lParam)>=192)
|
||||||
{
|
{
|
||||||
|
s32 x;
|
||||||
|
s32 y;
|
||||||
SetCapture(hwnd);
|
SetCapture(hwnd);
|
||||||
s32 x = LOWORD(lParam);
|
x = LOWORD(lParam);
|
||||||
s32 y = HIWORD(lParam) - 192;
|
y = HIWORD(lParam) - 192;
|
||||||
if(x<0) x = 0; else if(x>255) x = 255;
|
if(x<0) x = 0; else if(x>255) x = 255;
|
||||||
if(y<0) y = 0; else if(y>192) y = 192;
|
if(y<0) y = 0; else if(y>192) y = 192;
|
||||||
NDS_setTouchPos(x, y);
|
NDS_setTouchPos(x, y);
|
||||||
|
@ -553,10 +555,10 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
{
|
{
|
||||||
case IDM_OPEN:
|
case IDM_OPEN:
|
||||||
{
|
{
|
||||||
NDS_Pause(); //Stop emulation while opening new rom
|
|
||||||
|
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
char filename[MAX_PATH] = "";
|
char filename[MAX_PATH] = "";
|
||||||
|
NDS_Pause(); //Stop emulation while opening new rom
|
||||||
|
|
||||||
ZeroMemory(&ofn, sizeof(ofn));
|
ZeroMemory(&ofn, sizeof(ofn));
|
||||||
ofn.lStructSize = sizeof(ofn);
|
ofn.lStructSize = sizeof(ofn);
|
||||||
ofn.hwndOwner = hwnd;
|
ofn.hwndOwner = hwnd;
|
||||||
|
@ -574,21 +576,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
|
|
||||||
LOG("%s\r\n", filename);
|
LOG("%s\r\n", filename);
|
||||||
|
|
||||||
/* // This should be moved to NDSSystem.c
|
|
||||||
|
|
||||||
// Added for FAT generation
|
|
||||||
// Mic
|
|
||||||
if (ofn.nFileOffset>0) {
|
|
||||||
strncpy(szRomPath,filename,ofn.nFileOffset-1);
|
|
||||||
cflash_close();
|
|
||||||
cflash_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
strcpy(SavName,filename);
|
|
||||||
|
|
||||||
romnum+=1;
|
|
||||||
*/
|
|
||||||
|
|
||||||
if(LoadROM(filename))
|
if(LoadROM(filename))
|
||||||
{
|
{
|
||||||
EnableMenuItem(menu, IDM_EXEC, MF_GRAYED);
|
EnableMenuItem(menu, IDM_EXEC, MF_GRAYED);
|
||||||
|
@ -621,9 +608,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
return 0;
|
return 0;
|
||||||
case IDM_STATE_LOAD:
|
case IDM_STATE_LOAD:
|
||||||
{
|
{
|
||||||
NDS_Pause();
|
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
//char nomFichier[MAX_PATH] = "";
|
NDS_Pause();
|
||||||
ZeroMemory(&ofn, sizeof(ofn));
|
ZeroMemory(&ofn, sizeof(ofn));
|
||||||
ofn.lStructSize = sizeof(ofn);
|
ofn.lStructSize = sizeof(ofn);
|
||||||
ofn.hwndOwner = hwnd;
|
ofn.hwndOwner = hwnd;
|
||||||
|
@ -635,20 +621,18 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
|
|
||||||
if(!GetOpenFileName(&ofn))
|
if(!GetOpenFileName(&ofn))
|
||||||
{
|
{
|
||||||
|
NDS_UnPause();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//log::ajouter(SavName);
|
|
||||||
|
|
||||||
savestate_load(SavName);
|
savestate_load(SavName);
|
||||||
NDS_UnPause();
|
NDS_UnPause();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case IDM_STATE_SAVE:
|
case IDM_STATE_SAVE:
|
||||||
{
|
{
|
||||||
NDS_Pause();
|
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
//char nomFichier[MAX_PATH] = "";
|
NDS_Pause();
|
||||||
ZeroMemory(&ofn, sizeof(ofn));
|
ZeroMemory(&ofn, sizeof(ofn));
|
||||||
ofn.lStructSize = sizeof(ofn);
|
ofn.lStructSize = sizeof(ofn);
|
||||||
ofn.hwndOwner = hwnd;
|
ofn.hwndOwner = hwnd;
|
||||||
|
@ -663,16 +647,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//strncpy(SavName + "dst", FileName, strlen(FileName)-3);
|
|
||||||
//strcpy(SavName, SavName + "dst");
|
|
||||||
//log = "sram saved to: ";
|
|
||||||
//strcat(log, (const char*)SavName);
|
|
||||||
//log::ajouter(log);
|
|
||||||
|
|
||||||
//strncpy(SavName2, SavName, strlen(SavName)-3);
|
|
||||||
//strncat(SavName2, "dst", 3);
|
|
||||||
//strcpy(SavName, SavName + "dst");
|
|
||||||
|
|
||||||
savestate_save(SavName);
|
savestate_save(SavName);
|
||||||
NDS_UnPause();
|
NDS_UnPause();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,33 +35,32 @@ LRESULT MapView_OnPaint(mapview_struct * win, HWND hwnd, WPARAM wParam, LPARAM l
|
||||||
char text[80];
|
char text[80];
|
||||||
u32 dispcnt = ((volatile u32 *)ARM9Mem.ARM9_REG)[(win->lcd*0x400)];
|
u32 dispcnt = ((volatile u32 *)ARM9Mem.ARM9_REG)[(win->lcd*0x400)];
|
||||||
u32 bgcnt = ((volatile u16 *)ARM9Mem.ARM9_REG)[(8 + (win->map<<1) + (win->lcd*0x1000))>>1];
|
u32 bgcnt = ((volatile u16 *)ARM9Mem.ARM9_REG)[(8 + (win->map<<1) + (win->lcd*0x1000))>>1];
|
||||||
|
BITMAPV4HEADER bmi;
|
||||||
|
u16 lg;
|
||||||
BITMAPV4HEADER bmi;
|
u16 ht;
|
||||||
|
|
||||||
//CreateBitmapIndirect(&bmi);
|
//CreateBitmapIndirect(&bmi);
|
||||||
memset(&bmi, 0, sizeof(bmi));
|
memset(&bmi, 0, sizeof(bmi));
|
||||||
bmi.bV4Size = sizeof(bmi);
|
bmi.bV4Size = sizeof(bmi);
|
||||||
bmi.bV4Planes = 1;
|
bmi.bV4Planes = 1;
|
||||||
bmi.bV4BitCount = 16;
|
bmi.bV4BitCount = 16;
|
||||||
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
|
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
|
||||||
bmi.bV4RedMask = 0x001F;
|
bmi.bV4RedMask = 0x001F;
|
||||||
bmi.bV4GreenMask = 0x03E0;
|
bmi.bV4GreenMask = 0x03E0;
|
||||||
bmi.bV4BlueMask = 0x7C00;
|
bmi.bV4BlueMask = 0x7C00;
|
||||||
u16 lg;
|
|
||||||
u16 ht;
|
if(win->lcd)
|
||||||
if(win->lcd)
|
{
|
||||||
{
|
lg = SubScreen.gpu->BGSize[win->map][0];
|
||||||
lg = SubScreen.gpu->BGSize[win->map][0];
|
ht = SubScreen.gpu->BGSize[win->map][1];
|
||||||
ht = SubScreen.gpu->BGSize[win->map][1];
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
lg = MainScreen.gpu->BGSize[win->map][0];
|
||||||
lg = MainScreen.gpu->BGSize[win->map][0];
|
ht = MainScreen.gpu->BGSize[win->map][1];
|
||||||
ht = MainScreen.gpu->BGSize[win->map][1];
|
}
|
||||||
}
|
bmi.bV4Width = lg;
|
||||||
bmi.bV4Width = lg;
|
bmi.bV4Height = -ht;
|
||||||
bmi.bV4Height = -ht;
|
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
|
@ -105,11 +104,11 @@ LRESULT MapView_OnPaint(mapview_struct * win, HWND hwnd, WPARAM wParam, LPARAM l
|
||||||
SetWindowText(GetDlgItem(hwnd, IDC_SCROLL), text);
|
SetWindowText(GetDlgItem(hwnd, IDC_SCROLL), text);
|
||||||
|
|
||||||
if(win->lcd)
|
if(win->lcd)
|
||||||
textBG(SubScreen.gpu, win->map, win->bitmap);
|
textBG(SubScreen.gpu, win->map, (u8 *)win->bitmap);
|
||||||
//rotBG(SubScreen.gpu, win->map, win->bitmap);
|
//rotBG(SubScreen.gpu, win->map, win->bitmap);
|
||||||
//extRotBG(SubScreen.gpu, win->map, win->bitmap);
|
//extRotBG(SubScreen.gpu, win->map, win->bitmap);
|
||||||
else
|
else
|
||||||
textBG(MainScreen.gpu, win->map, win->bitmap);
|
textBG(MainScreen.gpu, win->map, (u8 *)win->bitmap);
|
||||||
//rotBG(MainScreen.gpu, win->map, win->bitmap);
|
//rotBG(MainScreen.gpu, win->map, win->bitmap);
|
||||||
//extRotBG(MainScreen.gpu, win->map, win->bitmap);
|
//extRotBG(MainScreen.gpu, win->map, win->bitmap);
|
||||||
|
|
||||||
|
|
|
@ -301,16 +301,23 @@ LRESULT MemViewBox_OnPaint(memview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
SIZE fontsize;
|
SIZE fontsize;
|
||||||
TCHAR text[80];
|
TCHAR text[80];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
int lg;
|
||||||
|
int ht;
|
||||||
|
HDC mem_dc;
|
||||||
|
HBITMAP mem_bmp;
|
||||||
|
int nbligne;
|
||||||
|
RECT r;
|
||||||
|
u32 adr;
|
||||||
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
int lg = rect.right - rect.left;
|
lg = rect.right - rect.left;
|
||||||
int ht = rect.bottom - rect.top;
|
ht = rect.bottom - rect.top;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
HDC mem_dc = CreateCompatibleDC(hdc);
|
mem_dc = CreateCompatibleDC(hdc);
|
||||||
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
||||||
SelectObject(mem_dc, mem_bmp);
|
SelectObject(mem_dc, mem_bmp);
|
||||||
|
|
||||||
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
@ -319,25 +326,23 @@ LRESULT MemViewBox_OnPaint(memview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
GetTextExtentPoint32(mem_dc, "0", 1, &fontsize);
|
GetTextExtentPoint32(mem_dc, "0", 1, &fontsize);
|
||||||
|
|
||||||
int nbligne = ht/fontsize.cy;
|
nbligne = ht/fontsize.cy;
|
||||||
|
|
||||||
SetTextColor(mem_dc, RGB(0,0,0));
|
SetTextColor(mem_dc, RGB(0,0,0));
|
||||||
|
|
||||||
RECT r;
|
|
||||||
|
|
||||||
r.top = 3;
|
r.top = 3;
|
||||||
r.left = 3;
|
r.left = 3;
|
||||||
r.bottom = r.top+fontsize.cy;
|
r.bottom = r.top+fontsize.cy;
|
||||||
r.right = rect.right-3;
|
r.right = rect.right-3;
|
||||||
|
|
||||||
u32 adr = win->curr_ligne*0x10;
|
adr = win->curr_ligne*0x10;
|
||||||
|
|
||||||
for(i=0; i<nbligne; ++i)
|
for(i=0; i<nbligne; ++i)
|
||||||
{
|
{
|
||||||
|
int j;
|
||||||
sprintf(text, "%04X:%04X", (int)(adr>>16), (int)(adr&0xFFFF));
|
sprintf(text, "%04X:%04X", (int)(adr>>16), (int)(adr&0xFFFF));
|
||||||
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
|
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
|
||||||
r.left += 11*fontsize.cx;
|
r.left += 11*fontsize.cx;
|
||||||
int j;
|
|
||||||
|
|
||||||
if(win->representation == 0)
|
if(win->representation == 0)
|
||||||
for(j=0; j<16; ++j)
|
for(j=0; j<16; ++j)
|
||||||
|
@ -417,12 +422,16 @@ LRESULT CALLBACK MemViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
SIZE fontsize;
|
SIZE fontsize;
|
||||||
|
HDC dc;
|
||||||
|
HFONT old;
|
||||||
|
int nbligne;
|
||||||
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
HDC dc = GetDC(hwnd);
|
dc = GetDC(hwnd);
|
||||||
HFONT old = (HFONT)SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
|
old = (HFONT)SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
|
||||||
GetTextExtentPoint32(dc, "0", 1, &fontsize);
|
GetTextExtentPoint32(dc, "0", 1, &fontsize);
|
||||||
|
|
||||||
int nbligne = (rect.bottom - rect.top)/fontsize.cy;
|
nbligne = (rect.bottom - rect.top)/fontsize.cy;
|
||||||
|
|
||||||
switch LOWORD(wParam)
|
switch LOWORD(wParam)
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,16 +71,20 @@ LRESULT OAMViewBox_OnPaint(oamview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
// TCHAR text[80];
|
// TCHAR text[80];
|
||||||
|
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
int lg;
|
||||||
|
int ht;
|
||||||
|
HDC mem_dc;
|
||||||
|
HBITMAP mem_bmp;
|
||||||
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
int lg = rect.right - rect.left;
|
lg = rect.right - rect.left;
|
||||||
int ht = rect.bottom - rect.top;
|
ht = rect.bottom - rect.top;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
HDC mem_dc = CreateCompatibleDC(hdc);
|
mem_dc = CreateCompatibleDC(hdc);
|
||||||
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
||||||
SelectObject(mem_dc, mem_bmp);
|
SelectObject(mem_dc, mem_bmp);
|
||||||
|
|
||||||
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
@ -131,6 +135,7 @@ LRESULT OamView_OnPaint(oamview_struct *win, WPARAM wParam, LPARAM lParam)
|
||||||
u8 prio[256*192];
|
u8 prio[256*192];
|
||||||
BITMAPV4HEADER bmi;
|
BITMAPV4HEADER bmi;
|
||||||
u16 i;
|
u16 i;
|
||||||
|
s16 x;
|
||||||
|
|
||||||
//CreateBitmapIndirect(&bmi);
|
//CreateBitmapIndirect(&bmi);
|
||||||
memset(&bmi, 0, sizeof(bmi));
|
memset(&bmi, 0, sizeof(bmi));
|
||||||
|
@ -181,8 +186,8 @@ LRESULT OamView_OnPaint(oamview_struct *win, WPARAM wParam, LPARAM lParam)
|
||||||
sprintf(text, "%d 0x%08X", (oam->attr2>>10)&3, oam->attr2);
|
sprintf(text, "%d 0x%08X", (oam->attr2>>10)&3, oam->attr2);
|
||||||
SetWindowText(GetDlgItem(hwnd, IDC_PRIO), text);
|
SetWindowText(GetDlgItem(hwnd, IDC_PRIO), text);
|
||||||
|
|
||||||
signed short x = oam->attr1&0x1FF;
|
x = oam->attr1&0x1FF;
|
||||||
x = ((signed short)(x<<7)>>7);
|
x = ((s16)(x<<7)>>7);
|
||||||
sprintf(text, "%d x %d", x, oam->attr0&0xFF);
|
sprintf(text, "%d x %d", x, oam->attr0&0xFF);
|
||||||
SetWindowText(GetDlgItem(hwnd, IDC_COOR), text);
|
SetWindowText(GetDlgItem(hwnd, IDC_COOR), text);
|
||||||
|
|
||||||
|
@ -204,7 +209,7 @@ LRESULT OamView_OnPaint(oamview_struct *win, WPARAM wParam, LPARAM lParam)
|
||||||
if(oam->attr0&(1<<9))
|
if(oam->attr0&(1<<9))
|
||||||
sprintf(text, "INVISIBLE");
|
sprintf(text, "INVISIBLE");
|
||||||
else
|
else
|
||||||
sprintf(text, "%s %s", oam->attr0&(1<<12)?"H FLIP":"", oam->attr0&(1<<12)?"V FLIP":"");
|
sprintf(text, "%s %s", oam->attr0&(1<<12)?"H FLIP":"", oam->attr0&(1<<13)?"V FLIP":"");
|
||||||
|
|
||||||
SetWindowText(GetDlgItem(hwnd, IDC_PROP0), text);
|
SetWindowText(GetDlgItem(hwnd, IDC_PROP0), text);
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,11 @@ LRESULT TileViewBox_Direct(tileview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
// SIZE fontsize;
|
// SIZE fontsize;
|
||||||
// TCHAR text[80];
|
// TCHAR text[80];
|
||||||
BITMAPV4HEADER bmi;
|
BITMAPV4HEADER bmi;
|
||||||
|
RECT rect;
|
||||||
|
HDC mem_dc;
|
||||||
|
HBITMAP mem_bmp;
|
||||||
|
int lg;
|
||||||
|
int ht;
|
||||||
|
|
||||||
memset(&bmi, 0, sizeof(bmi));
|
memset(&bmi, 0, sizeof(bmi));
|
||||||
bmi.bV4Size = sizeof(bmi);
|
bmi.bV4Size = sizeof(bmi);
|
||||||
|
@ -133,15 +138,14 @@ LRESULT TileViewBox_Direct(tileview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
bmi.bV4Width = 256;
|
bmi.bV4Width = 256;
|
||||||
bmi.bV4Height = -256;
|
bmi.bV4Height = -256;
|
||||||
|
|
||||||
RECT rect;
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
int lg = rect.right - rect.left;
|
lg = rect.right - rect.left;
|
||||||
int ht = rect.bottom - rect.top;
|
ht = rect.bottom - rect.top;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
HDC mem_dc = CreateCompatibleDC(hdc);
|
mem_dc = CreateCompatibleDC(hdc);
|
||||||
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
||||||
SelectObject(mem_dc, mem_bmp);
|
SelectObject(mem_dc, mem_bmp);
|
||||||
|
|
||||||
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
@ -169,6 +173,12 @@ LRESULT TileViewBox_Pal256(tileview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
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;
|
||||||
|
RECT rect;
|
||||||
|
int lg;
|
||||||
|
int ht;
|
||||||
|
HDC mem_dc;
|
||||||
|
HBITMAP mem_bmp;
|
||||||
|
|
||||||
memset(&bmi, 0, sizeof(bmi));
|
memset(&bmi, 0, sizeof(bmi));
|
||||||
bmi.bV4Size = sizeof(bmi);
|
bmi.bV4Size = sizeof(bmi);
|
||||||
bmi.bV4Planes = 1;
|
bmi.bV4Planes = 1;
|
||||||
|
@ -180,15 +190,14 @@ LRESULT TileViewBox_Pal256(tileview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
bmi.bV4Width = 256;
|
bmi.bV4Width = 256;
|
||||||
bmi.bV4Height = -256;
|
bmi.bV4Height = -256;
|
||||||
|
|
||||||
RECT rect;
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
int lg = rect.right - rect.left;
|
lg = rect.right - rect.left;
|
||||||
int ht = rect.bottom - rect.top;
|
ht = rect.bottom - rect.top;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
HDC mem_dc = CreateCompatibleDC(hdc);
|
mem_dc = CreateCompatibleDC(hdc);
|
||||||
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
|
||||||
SelectObject(mem_dc, mem_bmp);
|
SelectObject(mem_dc, mem_bmp);
|
||||||
|
|
||||||
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
@ -232,6 +241,12 @@ LRESULT TileViewBox_Pal16(tileview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
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;
|
||||||
|
RECT rect;
|
||||||
|
int lg;
|
||||||
|
int ht;
|
||||||
|
HDC mem_dc;
|
||||||
|
HBITMAP mem_bmp;
|
||||||
|
|
||||||
memset(&bmi, 0, sizeof(bmi));
|
memset(&bmi, 0, sizeof(bmi));
|
||||||
bmi.bV4Size = sizeof(bmi);
|
bmi.bV4Size = sizeof(bmi);
|
||||||
bmi.bV4Planes = 1;
|
bmi.bV4Planes = 1;
|
||||||
|
@ -243,15 +258,14 @@ LRESULT TileViewBox_Pal16(tileview_struct * win, WPARAM wParam, LPARAM lParam)
|
||||||
bmi.bV4Width = 512;
|
bmi.bV4Width = 512;
|
||||||
bmi.bV4Height = -256;
|
bmi.bV4Height = -256;
|
||||||
|
|
||||||
RECT rect;
|
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
int lg = rect.right - rect.left;
|
lg = rect.right - rect.left;
|
||||||
int ht = rect.bottom - rect.top;
|
ht = rect.bottom - rect.top;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
|
||||||
HDC mem_dc = CreateCompatibleDC(hdc);
|
mem_dc = CreateCompatibleDC(hdc);
|
||||||
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, 512, 256);
|
mem_bmp = CreateCompatibleBitmap(hdc, 512, 256);
|
||||||
SelectObject(mem_dc, mem_bmp);
|
SelectObject(mem_dc, mem_bmp);
|
||||||
|
|
||||||
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
|
Loading…
Reference in New Issue