Update of /cvsroot/desmume/desmume/src/windows
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28296
Added Files:
CWindow.cpp CWindow.hpp des_view.cpp des_view.hpp DeSmuME.dev
DeSmuME.exe.Manifest DeSmuME.ico DeSmuME.layout ginfo.cpp
ginfo.hpp GPU.cpp GPU.hpp IORegView.cpp IORegView.hpp main.cpp
Makefile.win mapView.cpp mapView.hpp mem_view.cpp mem_view.hpp
oamView.cpp oamView.h palView.cpp palView.hpp resource.hpp
resources.rc tileView.cpp tileView.hpp yopyop_private.hpp
yopyop_private.rc
Log Message:
-Initial source add. Windows-specific code
--- NEW FILE: main.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
//#define RENDER3D
#include <windows.h>
#include <stdio.h>
#include "CWindow.hpp"
#include "../MMU.hpp"
#include "../ARM_CPU.hpp"
#include "../NDSSystem.hpp"
#include "resource.hpp"
#include "mem_view.hpp"
#include "des_view.hpp"
#include "ginfo.hpp"
#include "IORegView.hpp"
#include "palView.hpp"
#include "tileView.hpp"
#include "oamView.hpp"
#include "../log.hpp"
#include "mapview.hpp"
#ifdef RENDER3D
#include "OGLRender.h"
#endif
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "DeSmuME";
CWindow * mainWindow;
DWORD threadID;
HWND hwnd;
HDC hdc;
HINSTANCE hAppInst;
bool execute = false;
unsigned long glock = 0;
bool click = false;
bool fini = false;
DWORD WINAPI run( LPVOID lpParameter)
{
unsigned long long count;
unsigned long long freq;
unsigned long long nextcount=0;
unsigned long nbframe = 0;
char txt[80];
BITMAPV4HEADER bmi;
//CreateBitmapIndirect(&bmi);
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
bmi.bV4Width = 256;
bmi.bV4Height = -192;
unsigned long cycles = 0;
#ifdef RENDER3D
OGLRender::init(&hdc);
#endif
QueryPerformanceFrequency((LARGE_INTEGER *)&freq);
QueryPerformanceCounter((LARGE_INTEGER *)&count);
nextcount = count + freq;
while(!fini)
{
while(execute)
{
cycles = nds.exec((560190<<1)-cycles,false);
++nbframe;
QueryPerformanceCounter((LARGE_INTEGER *)&count);
if(nextcount<=count)
{
sprintf(txt,"DeSmuME %d", nbframe);
SetWindowText(hwnd, txt);
nbframe = 0;
nextcount += freq;
}
#ifndef RENDER3D
SetDIBitsToDevice(hdc, 0, 0, 256, 192*2, 0, 0, 0, 192*2, GPU::screen, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
//SetDIBitsToDevice(hdc, 0, 192, 256, 192*2, 0, 0, 192, 192*2, GPU::screen, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
#else
SetDIBitsToDevice(hdc, 0, 0, 256, 192*2, 0, 0, 192, 192*2, GPU::screen, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
//SetDIBitsToDevice(hdc, 0, 0, 256, 192, 0, 0, 0, 192, GPU::screen, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
#endif
CWindow::refreshALL();
Sleep(0);
//execute = false;
}
Sleep(500);
}
return 1;
}
bool loadRom(char * nomFichier)
{
if(!strlen(nomFichier)) return false;
if((*nomFichier)=='\"')
{
++nomFichier;
nomFichier[strlen(nomFichier)-1] = '\0';
}
if(strncmp(nomFichier + strlen(nomFichier)-3, "nds", 3))
{
MessageBox(hwnd,"Erreur le fichier n'est pas un nds","Erreur",MB_OK);
return false;
}
HANDLE Fichier;
Fichier = CreateFile(nomFichier,
GENERIC_READ | FILE_FLAG_OVERLAPPED,
FILE_SHARE_READ,
NULL,OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if(Fichier == INVALID_HANDLE_VALUE)
{
MessageBox(hwnd,"Erreur lors de l'ouverture du fichier","Erreur",MB_OK);
return false;
}
execute = false;
unsigned long tailleFichier = GetFileSize(Fichier, NULL) - 1;
unsigned long nblu = 0;
unsigned long mask = tailleFichier;
mask |= (mask >>1);
mask |= (mask >>2);
mask |= (mask >>4);
mask |= (mask >>8);
mask |= (mask >>16);
unsigned char * ROM = (unsigned char *)malloc((mask+1)*sizeof(unsigned char));
ReadFile(Fichier, ROM, tailleFichier, &nblu, NULL);
nds.loadROM(ROM, mask);
CloseHandle(Fichier);
return true;
}
HMENU menu;
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
MSG messages; /* Here messages to the application are saved */
hAppInst=hThisInstance;
InitializeCriticalSection(§ion);
mainWindow = new CWindow(hThisInstance, szClassName, "DeSmuME v0.3.3",
WS_CAPTION| WS_SYSMENU |WS_MINIMIZEBOX | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
256, 384, WindowProcedure);
hwnd = mainWindow->hwnd;
menu = LoadMenu(hThisInstance, "MENU_PRINCIPAL");
SetMenu(hwnd, menu);
hdc = GetDC(hwnd);
DragAcceptFiles(hwnd, true);
/* Make the window visible on the screen */
mainWindow->show();
InitMemViewBox();
InitDesViewBox();
InitTileViewBox();
InitOAMViewBox();
log::raz();
//ARM7 BIOS IRQ HANDLER
MMU::writeWord(1, 0x00, 0xE25EF002);
MMU::writeWord(1, 0x04, 0xEAFFFFFE);
MMU::writeWord(1, 0x18, 0xEA000000);
MMU::writeWord(1, 0x20, 0xE92D500F);
MMU::writeWord(1, 0x24, 0xE3A00301);
MMU::writeWord(1, 0x28, 0xE28FE000);
MMU::writeWord(1, 0x2C, 0xE510F004);
MMU::writeWord(1, 0x30, 0xE8BD500F);
MMU::writeWord(1, 0x34, 0xE25EF004);
//ARM9 BIOS IRQ HANDLER
MMU::writeWord(0, 0xFFF0018, 0xEA000000);
MMU::writeWord(0, 0xFFF0020, 0xE92D500F);
MMU::writeWord(0, 0xFFF0024, 0xEE190F11);
MMU::writeWord(0, 0xFFF0028, 0xE1A00620);
MMU::writeWord(0, 0xFFF002C, 0xE1A00600);
MMU::writeWord(0, 0xFFF0030, 0xE2800C40);
MMU::writeWord(0, 0xFFF0034, 0xE28FE000);
MMU::writeWord(0, 0xFFF0038, 0xE510F004);
MMU::writeWord(0, 0xFFF003C, 0xE8BD500F);
MMU::writeWord(0, 0xFFF0040, 0xE25EF004);
MMU::writeWord(0, 0x0000004, 0xE3A0010E);
MMU::writeWord(0, 0x0000008, 0xE3A01020);
// MMU::writeWord(0, 0x000000C, 0xE1B02110);
MMU::writeWord(0, 0x000000C, 0xE1B02040);
MMU::writeWord(0, 0x0000010, 0xE3B02020);
// MMU::writeWord(0, 0x0000010, 0xE2100202);
CreateThread(NULL, 0, run, NULL, 0, &threadID);
if(loadRom(lpszArgument)) execute = true;
while (GetMessage (&messages, NULL, 0, 0))
{
// Translate virtual-key messages into character messages
TranslateMessage(&messages);
// Send message to WindowProcedure
DispatchMessage(&messages);
}
log::fermer();
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) // handle the messages
{
case WM_CREATE:
return 0;
case WM_DESTROY:
execute = false;
fini = true;
PostQuitMessage (0); // send a WM_QUIT to the message queue
return 0;
case WM_CLOSE:
execute = false;
fini = true;
PostMessage(hwnd, WM_QUIT, 0, 0);
return 0;
case WM_DROPFILES:
{
char nomFichier[MAX_PATH] = "";
DragQueryFile((HDROP)wParam,0,nomFichier,256);
DragFinish((HDROP)wParam);
if(loadRom(nomFichier)) execute = true;
}
return 0;
case WM_KEYDOWN:
switch(HIWORD(lParam))
{
case 0x10 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFFE;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFFE;
break;
case 0x11 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFFD;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFFD;
break;
case 0x0E :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFFB;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFFB;
break;
case 0x1C :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFF7;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFF7;
break;
case 0x14D :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFEF;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFEF;
break;
case 0x14B :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFDF;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFDF;
break;
case 0x148 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFFBF;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFFBF;
break;
case 0x150 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFF7F;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFF7F;
break;
case 0x12 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFEFF;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFEFF;
break;
case 0x20 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] &= 0xFDFF;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] &= 0xFDFF;
break;
case 0x1E :
MMU::ARM7_REG[0x136] &= 0xFE;
break;
case 0x1F :
MMU::ARM7_REG[0x136] &= 0xFD;
break;
case 0x21 :
nds.ARM9.wIRQ = true;
break;
}
return 0;
case WM_KEYUP:
switch(HIWORD(lParam)&0xFFF)
{
case 0x10 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x1;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x1;
break;
case 0x11 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x2;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x2;
break;
case 0x0E :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x4;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x4;
break;
case 0x1C :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x8;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x8;
break;
case 0x14D :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x10;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x10;
break;
case 0x14B :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x20;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x20;
break;
case 0x148 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x40;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x40;
break;
case 0x150 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x80;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x80;
break;
case 0x12 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x100;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x100;
break;
case 0x20 :
((unsigned short *)MMU::ARM9_REG)[0x130>>1] |= 0x200;
((unsigned short *)MMU::ARM7_REG)[0x130>>1] |= 0x200;
break;
case 0x1E :
MMU::ARM7_REG[0x136] |= 1;
break;
case 0x1F :
MMU::ARM7_REG[0x136] |= 2;
break;
/*case 0x21 :
MMU::REG_IME[0] = 1;*/
}
return 0;
case WM_MOUSEMOVE:
{
if (wParam & MK_LBUTTON)
{
signed long x = (signed long)((signed short)LOWORD(lParam));
signed long y = (signed long)((signed short)HIWORD(lParam)) - 192;
if(x<0) x = 0; else if(x>255) x = 255;
if(y<0) y = 0; else if(y>192) y = 192;
nds.setTouchPos(x, y);
return 0;
}
}
nds.releasTouch();
return 0;
case WM_LBUTTONDOWN:
if(HIWORD(lParam)>=192)
{
SetCapture(hwnd);
signed long x = LOWORD(lParam);
signed long y = HIWORD(lParam) - 192;
if(x<0) x = 0; else if(x>255) x = 255;
if(y<0) y = 0; else if(y>192) y = 192;
nds.setTouchPos(x, y);
click = true;
}
return 0;
case WM_LBUTTONUP:
if(click)
ReleaseCapture();
nds.releasTouch();
return 0;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_OUVRIR:
{
OPENFILENAME ofn;
char nomFichier[MAX_PATH] = "";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Fichier nds (*.nds)\0*.nds\0Tout Fichier (*.*)\0*.*\0\0";
ofn.nFilterIndex = 1;
ofn.lpstrFile = nomFichier;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "nds";
if(!GetOpenFileName(&ofn))
{
return 0;
}
log::ajouter(nomFichier);
if(loadRom(nomFichier)) execute = false;
}
return 0;
case IDM_GAME_INFO:
{
CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_GAME_INFO), hwnd, ginfo_view_proc);
}
return 0;
case IDM_PAL:
{
CPalView * view = new CPalView(hAppInst, HWND_DESKTOP);
view->show();
}
return 0;
case IDM_TILE:
{
CTileView * view = new CTileView(hAppInst, HWND_DESKTOP);
view->show();
}
return 0;
case IDM_IOREG:
{
CWindow * view = new CWindow(hAppInst, HWND_DESKTOP, "IO REG VIEW", IDD_IO_REG, ioreg_view_proc);
view->show();
}
return 0;
case IDM_QUITTER:
PostMessage(hwnd, WM_QUIT, 0, 0);
return 0;
case IDM_MEMOIRE:
{
CMemView * view = new CMemView(hAppInst, HWND_DESKTOP, "ARM7 memory viewer", 1);
view->show();
view = new CMemView(hAppInst, HWND_DESKTOP, "ARM9 memory viewer", 0);
view->show();
}
return 0;
case IDM_DESASSEMBLEUR:
{
CDesView * view = new CDesView(hAppInst, HWND_DESKTOP, "Desassembleur ARM7", &nds.ARM7);
view->show();
view = new CDesView(hAppInst, HWND_DESKTOP, "Desassembleur ARM9", &nds.ARM9);
view->show();
}
return 0;
case IDM_MAP:
{
CMapView * view = new CMapView(hAppInst, HWND_DESKTOP);
view->add2RefreshList();
view->show();
}
return 0;
case IDM_OAM:
{
oamView * view = new oamView(hAppInst, HWND_DESKTOP);
view->add2RefreshList();
view->show();
}
return 0;
case IDM_MBG0 :
if(nds.mainGPU->dispBG[0])
{
nds.mainGPU->remove(0);
CheckMenuItem(menu, IDM_MBG0, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.mainGPU->addBack(0);
CheckMenuItem(menu, IDM_MBG0, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_MBG1 :
if(nds.mainGPU->dispBG[1])
{
nds.mainGPU->remove(1);
CheckMenuItem(menu, IDM_MBG1, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.mainGPU->addBack(1);
CheckMenuItem(menu, IDM_MBG1, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_MBG2 :
if(nds.mainGPU->dispBG[2])
{
nds.mainGPU->remove(2);
CheckMenuItem(menu, IDM_MBG2, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.mainGPU->addBack(2);
CheckMenuItem(menu, IDM_MBG2, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_MBG3 :
if(nds.mainGPU->dispBG[3])
{
nds.mainGPU->remove(3);
CheckMenuItem(menu, IDM_MBG3, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.mainGPU->addBack(3);
CheckMenuItem(menu, IDM_MBG3, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_SBG0 :
if(nds.subGPU->dispBG[0])
{
nds.subGPU->remove(0);
CheckMenuItem(menu, IDM_SBG0, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.subGPU->addBack(0);
CheckMenuItem(menu, IDM_SBG0, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_SBG1 :
if(nds.subGPU->dispBG[1])
{
nds.subGPU->remove(1);
CheckMenuItem(menu, IDM_SBG1, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.subGPU->addBack(1);
CheckMenuItem(menu, IDM_SBG1, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_SBG2 :
if(nds.subGPU->dispBG[2])
{
nds.subGPU->remove(2);
CheckMenuItem(menu, IDM_SBG2, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.subGPU->addBack(2);
CheckMenuItem(menu, IDM_SBG2, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_SBG3 :
if(nds.subGPU->dispBG[3])
{
nds.subGPU->remove(3);
CheckMenuItem(menu, IDM_SBG3, MF_BYCOMMAND | MF_UNCHECKED);
}
else
{
nds.subGPU->addBack(3);
CheckMenuItem(menu, IDM_SBG3, MF_BYCOMMAND | MF_CHECKED);
}
return 0;
case IDM_EXEC:
execute = true;
return 0;
case IDM_PAUSE:
execute = false;
return 0;
case IDM_RESET:
return 0;
}
return 0;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
--- NEW FILE: des_view.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "../MMU.hpp"
#include "../Disassembler.hpp"
#include "des_view.hpp"
#include "resource.hpp"
#define INDEX(i) ((((i)>>16)&0xFF0)|(((i)>>4)&0xF))
extern HDC hdc;
LRESULT CALLBACK DesViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
unsigned long cycles = 1;
void InitDesViewBox()
{
WNDCLASSEX wc;
wc.cbSize = sizeof(wc);
wc.lpszClassName = _T("DesViewBox");
wc.hInstance = GetModuleHandle(0);
wc.lpfnWndProc = DesViewBoxWndProc;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
wc.style = 0;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof( CWindow * );
wc.hIconSm = 0;
RegisterClassEx(&wc);
}
LRESULT DesViewBox_OnPaint(CDesView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = GetDlgItem(win->hwnd, IDC_DES_BOX);
HDC hdc;
PAINTSTRUCT ps;
SIZE fontsize;
TCHAR text[100];
TCHAR txt[100];
RECT rect;
GetClientRect(hwnd, &rect);
int lg = rect.right - rect.left;
int ht = rect.bottom - rect.top;
hdc = BeginPaint(hwnd, &ps);
HDC mem_dc = CreateCompatibleDC(hdc);
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
SelectObject(mem_dc, mem_bmp);
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
SelectObject(mem_dc, GetStockObject(SYSTEM_FIXED_FONT));
GetTextExtentPoint32(mem_dc, "0", 1, &fontsize);
unsigned long nbligne = ht/fontsize.cy;
SetTextColor(mem_dc, RGB(0,0,0));
if((win->mode==1) || ((win->mode==0) && (win->cpu->CPSR.bits.T == 0)))
{
unsigned long adr = win->curr_ligne*4;
for(unsigned long i = 0; i < nbligne; ++i)
{
unsigned long ins = MMU::readWord(win->cpu->proc_ID, adr);
des_arm_instructions_set[INDEX(ins)](adr, ins, txt);
sprintf(text, "%04X:%04X %08X %s", adr>>16, adr&0xFFFF, ins, txt);
DrawText(mem_dc, text, -1, &rect, DT_TOP | DT_LEFT | DT_NOPREFIX);
rect.top+=fontsize.cy;
adr += 4;
}
if(((win->cpu->instruct_adr&0x0FFFFFFF) >= win->curr_ligne<<2)&&((win->cpu->instruct_adr&0x0FFFFFFF) <= (win->curr_ligne+nbligne<<2)))
{
HBRUSH brjaune = CreateSolidBrush(RGB(255, 255, 0));
SetBkColor(mem_dc, RGB(255, 255, 0));
rect.top = (((win->cpu->instruct_adr&0x0FFFFFFF)>>2) - win->curr_ligne)*fontsize.cy;
rect.bottom = rect.top + fontsize.cy;
FillRect(mem_dc, &rect, brjaune);
des_arm_instructions_set[INDEX(win->cpu->instruction)](win->cpu->instruct_adr, win->cpu->instruction, txt);
sprintf(text, "%04X:%04X %08X %s", (win->cpu->instruct_adr&0x0FFFFFFF)>>16, win->cpu->instruct_adr&0xFFFF, win->cpu->instruction, txt);
DrawText(mem_dc, text, -1, &rect, DT_TOP | DT_LEFT | DT_NOPREFIX);
DeleteObject(brjaune);
}
}
else
{
unsigned long adr = win->curr_ligne*2;
for(unsigned long i = 0; i < nbligne; ++i)
{
unsigned long ins = MMU::readHWord(win->cpu->proc_ID, adr);
des_thumb_instructions_set[ins>>6](adr, ins, txt);
sprintf(text, "%04X:%04X %04X %s", adr>>16, adr&0xFFFF, ins, txt);
DrawText(mem_dc, text, -1, &rect, DT_TOP | DT_LEFT | DT_NOPREFIX);
rect.top+=fontsize.cy;
adr += 2;
}
if(((win->cpu->instruct_adr&0x0FFFFFFF) >= win->curr_ligne<<1)&&((win->cpu->instruct_adr&0x0FFFFFFF) <= (win->curr_ligne+nbligne<<1)))
{
HBRUSH brjaune = CreateSolidBrush(RGB(255, 255, 0));
SetBkColor(mem_dc, RGB(255, 255, 0));
rect.top = (((win->cpu->instruct_adr&0x0FFFFFFF)>>1) - win->curr_ligne)*fontsize.cy;
rect.bottom = rect.top + fontsize.cy;
FillRect(mem_dc, &rect, brjaune);
des_thumb_instructions_set[((win->cpu->instruction)&0xFFFF)>>6](win->cpu->instruct_adr, win->cpu->instruction&0xFFFF, txt);
sprintf(text, "%04X:%04X %04X %s", (win->cpu->instruct_adr&0x0FFFFFFF)>>16, win->cpu->instruct_adr&0xFFFF, win->cpu->instruction&0xFFFF, txt);
DrawText(mem_dc, text, -1, &rect, DT_TOP | DT_LEFT | DT_NOPREFIX);
DeleteObject(brjaune);
}
}
BitBlt(hdc, 0, 0, lg, ht, mem_dc, 0, 0, SRCCOPY);
DeleteDC(mem_dc);
DeleteObject(mem_bmp);
EndPaint(hwnd, &ps);
return 1;
}
LRESULT DesViewDialog_OnPaint(HWND hwnd, CDesView * win, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
TCHAR text[80];
hdc = BeginPaint(hwnd, &ps);
for(unsigned long i = 0; i < 16; ++i)
{
sprintf(text, "%08X", win->cpu->R[i]);
SetWindowText(GetDlgItem(hwnd, IDC_R0+i), text);
}
#define OFF 16
SetBkMode(hdc, TRANSPARENT);
if(win->cpu->CPSR.bits.N)
SetTextColor(hdc, RGB(255,0,0));
else
SetTextColor(hdc, RGB(70, 70, 70));
TextOut(hdc, 452+OFF, 238, "N", 1);
if(win->cpu->CPSR.bits.Z)
SetTextColor(hdc, RGB(255,0,0));
else
SetTextColor(hdc, RGB(70, 70, 70));
TextOut(hdc, 464+OFF, 238, "Z", 1);
if(win->cpu->CPSR.bits.C)
SetTextColor(hdc, RGB(255,0,0));
else
SetTextColor(hdc, RGB(70, 70, 70));
TextOut(hdc, 475+OFF, 238, "C", 1);
if(win->cpu->CPSR.bits.V)
SetTextColor(hdc, RGB(255,0,0));
else
SetTextColor(hdc, RGB(70, 70, 70));
TextOut(hdc, 486+OFF, 238, "V", 1);
if(win->cpu->CPSR.bits.Q)
SetTextColor(hdc, RGB(255,0,0));
else
SetTextColor(hdc, RGB(70, 70, 70));
TextOut(hdc, 497+OFF, 238, "Q", 1);
if(!win->cpu->CPSR.bits.I)
SetTextColor(hdc, RGB(255,0,0));
else
SetTextColor(hdc, RGB(70, 70, 70));
TextOut(hdc, 508+OFF, 238, "I", 1);
sprintf(text, "%02X", win->cpu->CPSR.bits.mode);
SetWindowText(GetDlgItem(hwnd, IDC_MODE), text);
sprintf(text, "%08X", MMU::timer[0][0]);//win->cpu->SPSR);
SetWindowText(GetDlgItem(hwnd, IDC_TMP), text);
EndPaint(hwnd, &ps);
return 1;
}
LRESULT CALLBACK DesViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CDesView * win = (CDesView *)GetWindowLong(hwnd, 0);
switch(msg)
{
case WM_NCCREATE:
SetScrollRange(hwnd, SB_VERT, 0, 0x3FFFFF7, true);
SetScrollPos(hwnd, SB_VERT, 10, true);
return 1;
case WM_NCDESTROY:
free(win);
return 1;
case WM_PAINT:
DesViewBox_OnPaint(win, wParam, lParam);
return 1;
case WM_VSCROLL :
{
RECT rect;
SIZE fontsize;
GetClientRect(hwnd, &rect);
HDC dc = GetDC(hwnd);
HFONT old = (HFONT)SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
GetTextExtentPoint32(dc, "0", 1, &fontsize);
int nbligne = (rect.bottom - rect.top)/fontsize.cy;
switch LOWORD(wParam)
{
case SB_LINEDOWN :
win->curr_ligne = min(0x3FFFFF7*(1+win->cpu->CPSR.bits.T), win->curr_ligne+1);
break;
case SB_LINEUP :
win->curr_ligne = (unsigned long)max(0, (signed long)win->curr_ligne-1);
break;
case SB_PAGEDOWN :
win->curr_ligne = min(0x3FFFFF7*(1+win->cpu->CPSR.bits.T), win->curr_ligne+nbligne);
break;
case SB_PAGEUP :
win->curr_ligne = (unsigned long)max(0, (signed long)win->curr_ligne-nbligne);
break;
}
SelectObject(dc, old);
SetScrollPos(hwnd, SB_VERT, win->curr_ligne, true);
InvalidateRect(hwnd, NULL, FALSE);
UpdateWindow(hwnd);
}
return 1;
case WM_ERASEBKGND:
return 1;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
// DES VIEWER
BOOL CALLBACK des_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CDesView * win = (CDesView *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
SetDlgItemInt(hwnd, IDC_SETPNUM, 1, false);
SendMessage(GetDlgItem(hwnd, IDC_AUTO_DES), BM_SETCHECK, TRUE, 0);
return 1;
case WM_CLOSE :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_PAINT:
DesViewDialog_OnPaint(hwnd, win, wParam, lParam);
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 0;
case IDC_AUTO_DES :
win->mode = 0;
InvalidateRect(GetDlgItem(hwnd, IDC_DES_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_DES_BOX));
return 1;
case IDC_ARM :
win->mode = 1;
InvalidateRect(GetDlgItem(hwnd, IDC_DES_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_DES_BOX));
return 1;
case IDC_THUMB :
win->mode = 2;
InvalidateRect(GetDlgItem(hwnd, IDC_DES_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_DES_BOX));
return 1;
case IDC_AUTO_UPDATE :
if(win->autoup)
{
win->remove2RefreshList();
win->autoup = false;
return 1;
}
win->add2RefreshList();
win->autoup = true;
return 1;
case IDC_STEP :
{
BITMAPV4HEADER bmi;
//CreateBitmapIndirect(&bmi);
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
bmi.bV4Width = 256;
bmi.bV4Height = -192;
int ndstep = GetDlgItemInt(hwnd, IDC_SETPNUM, NULL, false);
nds.exec(ndstep, true);
if(!win->autoup) win->refresh();
CWindow::refreshALL();
SetDIBitsToDevice(hdc, 0, 0, 256, 192*2, 0, 0, 0, 192*2, GPU::screen, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
}
return 1;
case IDC_GO :
{
char tmp[8];
int lg = GetDlgItemText(hwnd, IDC_GOTODES, tmp, 8);
unsigned long adr = 0;
for(unsigned short i = 0; i<lg; ++i)
{
if((tmp[i]>='A')&&(tmp[i]<='F'))
{
adr = adr*16 + (tmp[i]-'A'+10);
continue;
}
if((tmp[i]>='0')&&(tmp[i]<='9'))
{
adr = adr*16 + (tmp[i]-'0');
continue;
}
}
win->curr_ligne = adr>>2;
InvalidateRect(hwnd, NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_DES_BOX));
}
return 1;
return 1;
}
return 0;
}
return 0;
}
CDesView::CDesView(HINSTANCE hInst, HWND parent, char * titre, ARMCPU * CPU) :
CWindow(hInst, parent, titre, IDD_DESASSEMBLEUR_VIEWER, des_view_proc), cpu(CPU), mode(0)
{
SetWindowLong(GetDlgItem(hwnd, IDC_DES_BOX), 0, (LONG)this);
}
void CDesView::refresh()
{
if(((cpu->instruct_adr&0x0FFFFFFF)>>(2-cpu->CPSR.bits.T))>=8)
if(((cpu->instruct_adr&0x0FFFFFFF)>>(2-cpu->CPSR.bits.T))<=0x3FFFFF7*(1+cpu->CPSR.bits.T))
curr_ligne = ((cpu->instruct_adr&0x0FFFFFFF)>>(2-cpu->CPSR.bits.T))-8;
else
curr_ligne = 0x3FFFFEF*(1+cpu->CPSR.bits.T);
else
curr_ligne = 0;
SetScrollRange(GetDlgItem(hwnd, IDC_DES_BOX), SB_VERT, 0, 0x3FFFFF7*(1+cpu->CPSR.bits.T), true);
SetScrollPos(GetDlgItem(hwnd, IDC_DES_BOX), SB_VERT, curr_ligne, true);
InvalidateRect(hwnd, NULL, FALSE);
}
--- NEW FILE: GPU.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
[...1337 lines suppressed...]
unsigned char c = src[(x&0x3) + ((x&0xFFFC)<<3)];
if((c&0xF)&&(prioTab[sprX]>=prio))
{
dst[sprX] = pal[(c&0xF)+((aux->attr2>>12)*0x10)];
prioTab[sprX] = prio;
}
//else dst[sprX] = 0x7FFF;
++sprX;
if((c>>4)&&(prioTab[sprX]>=prio))
{
dst[sprX] = pal[(c>>4)+((aux->attr2>>12)*0x10)];
prioTab[sprX] = prio;
}
//else dst[sprX] = 0x7FFF;
++sprX;
}
}
}
--- NEW FILE: CWindow.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 "CWindow.hpp"
#include "resource.hpp"
CWindow * CWindow::prems=NULL;
CRITICAL_SECTION section;
CWindow::CWindow(HINSTANCE hInst, const char * cname, const char * titre, int style, int sx, int sy, LRESULT CALLBACK (* wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)) :
autoup(false)
{
static bool first = false;
RECT clientaera;
if(!first)
{
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hInst;
wincl.lpszClassName = cname;
wincl.lpfnWndProc = wP; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (hInst, MAKEINTRESOURCE(IconDeSmuME));//IDI_APPLICATION);
wincl.hIconSm = LoadIcon (hInst, MAKEINTRESOURCE(IconDeSmuME));//IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return;
prems=NULL;
first = true;
}
clientaera.left = 0;
clientaera.top = 0;
clientaera.right = sx;
clientaera.bottom = sy;
AdjustWindowRectEx(&clientaera, style, true, 0);
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
cname, /* Classname */
titre, /* Title Text */
style, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
clientaera.right - clientaera.left, /* The programs width */
clientaera.bottom - clientaera.top, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hInst, /* Program Instance handler */
NULL /* No Window Creation data */
);
prec = NULL;
suiv = NULL;
}
CWindow::CWindow(HINSTANCE hInst, HWND parent, char * titre, int ID, BOOL CALLBACK (*wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)) :
autoup(false)
{
hwnd = CreateDialog(hInst, MAKEINTRESOURCE(ID), parent, wP);
SetWindowLong(hwnd, DWL_USER, (LONG)this);
SetWindowText(hwnd, titre);
prec = NULL;
suiv = NULL;
}
void CWindow::show()
{
ShowWindow (hwnd, SW_SHOW);
}
void CWindow::hide()
{
ShowWindow (hwnd, SW_HIDE);
}
void CWindow::refresh()
{
InvalidateRect(hwnd, NULL, FALSE);
}
void CWindow::add2RefreshList()
{
EnterCriticalSection(§ion);
prec = NULL;
suiv = prems;
if(prems)
prems->prec = this;
prems = this;
LeaveCriticalSection(§ion);
}
void CWindow::remove2RefreshList()
{
EnterCriticalSection(§ion);
if(prems == this)
{
prems = suiv;
if(prems) prems->prec = NULL;
}
else
if(prec)
{
prec->suiv = suiv;
if(suiv) suiv->prec = prec;
}
suiv = NULL;
prec = NULL;
LeaveCriticalSection(§ion);
}
--- NEW FILE: mapView.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef MAPVIEW_H
#define MAPVIEW_H
#include <windows.h>
#include "CWindow.hpp"
class CMapView : public CWindow
{
public :
CMapView(HINSTANCE hInst, HWND parent);
unsigned short map;
unsigned short lcd;
unsigned short bitmap[1024*1024];
};
#endif
--- NEW FILE: mapView.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 "mapview.hpp"
#include "resource.hpp"
#include "../MMU.hpp"
#include "../NDSSystem.hpp"
LRESULT mapView_OnPaint(CMapView * win, HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
char text[80];
unsigned long dispcnt = ((volatile unsigned long *)MMU::ARM9_REG)[(win->lcd*0x400)];
unsigned long bgcnt = ((volatile unsigned short *)MMU::ARM9_REG)[(8 + (win->map<<1) + (win->lcd*0x1000))>>1];
BITMAPV4HEADER bmi;
//CreateBitmapIndirect(&bmi);
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
unsigned short lg;
unsigned short ht;
if(win->lcd)
{
lg = nds.subGPU->BGSize[win->map][0];
ht = nds.subGPU->BGSize[win->map][1];
}
else
{
lg = nds.mainGPU->BGSize[win->map][0];
ht = nds.mainGPU->BGSize[win->map][1];
}
bmi.bV4Width = lg;
bmi.bV4Height = -ht;
hdc = BeginPaint(hwnd, &ps);
sprintf(text, "%d %08X, %08X", dispcnt&7, dispcnt, bgcnt);
SetWindowText(GetDlgItem(hwnd, IDC_MODE), text);
if(!(bgcnt&(1<<7)))
sprintf(text, "normale 16");
else
if(!(dispcnt&(1<<30)))
sprintf(text, "normale 256");
else
switch(win->map)
{
case 0 :
sprintf(text, "extended slot %d", (bgcnt&(1<<13))?2:0);
break;
case 1 :
sprintf(text, "extended slot %d", (bgcnt&(1<<13))?3:1);
break;
default :
sprintf(text, "extended slot %d", nds.mainGPU->BGExtPalSlot[win->map]);
break;
}
SetWindowText(GetDlgItem(hwnd, IDC_PAL), text);
sprintf(text, "%d", bgcnt&3);
SetWindowText(GetDlgItem(hwnd, IDC_PRIO), text);
sprintf(text, "0x%08X", 0x6000000 + ((bgcnt>>2)&0xF)*0x4000 + win->lcd*0x200000 +((dispcnt>>24)&7)*0x10000);
SetWindowText(GetDlgItem(hwnd, IDC_CHAR), text);
sprintf(text, "0x%08X", 0x6000000 + 0x800*((bgcnt>>8)&0x1F) + win->lcd*0x200000 + ((dispcnt>>27)&7)*0x10000);
SetWindowText(GetDlgItem(hwnd, IDC_SCR), text);
//sprintf(text, "%d x %d", nds.mainGPU->BGPA[win->map], nds.mainGPU->BGPB[win->map]);
sprintf(text, "%d x %d", nds.mainGPU->BGSize[win->map][0], nds.mainGPU->BGSize[win->map][1]);
SetWindowText(GetDlgItem(hwnd, IDC_MSIZE), text);
sprintf(text, "%d x %d", nds.mainGPU->BGPC[win->map], nds.mainGPU->BGPD[win->map]);
SetWindowText(GetDlgItem(hwnd, IDC_SCROLL), text);
if(win->lcd)
textBG(nds.subGPU, win->map, win->bitmap);
//rotBG(nds.subGPU, win->map, win->bitmap);
//extRotBG(nds.subGPU, win->map, win->bitmap);
else
textBG(nds.mainGPU, win->map, win->bitmap);
//rotBG(nds.mainGPU, win->map, win->bitmap);
//extRotBG(nds.mainGPU, win->map, win->bitmap);
SetDIBitsToDevice(hdc, 200, 4, lg, ht, 0, 0, 0, ht, win->bitmap, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
//SetDIBitsToDevice(hdc, 200, 4, 256, 192, 0, 0, 0, 192, win->bitmap, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
EndPaint(hwnd, &ps);
}
BOOL CALLBACK mapView_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CMapView * win = (CMapView *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
{
HWND combo = GetDlgItem(hwnd, IDC_BG_SELECT);
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main BackGround 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main BackGround 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main BackGround 2");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main BackGround 3");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub BackGround 0");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub BackGround 1");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub BackGround 2");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub BackGround 3");
SendMessage(combo, CB_SETCURSEL, 0, 0);
}
return 1;
case WM_CLOSE :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_PAINT:
mapView_OnPaint(win, hwnd, wParam, lParam);
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case IDC_BG_SELECT :
switch(HIWORD(wParam))
{
case CBN_CLOSEUP :
{
unsigned long sel= SendMessage(GetDlgItem(hwnd, IDC_BG_SELECT), CB_GETCURSEL, 0, 0);
switch(sel)
{
case 0 :
case 1 :
case 2 :
case 3 :
win->map = sel;
win->lcd = 0;
break;
case 4 :
case 5 :
case 6 :
case 7 :
win->map = sel-4;
win->lcd = 1;
break;
}
}
win->refresh();
return 1;
}//switch et case
}//switch
return 1;
}
return 0;
}
CMapView::CMapView(HINSTANCE hInst, HWND parent) :
CWindow(hInst, parent, "Map viewer", IDD_MAP, mapView_proc), map(0), lcd(0)
{
}
--- NEW FILE: tileView.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef TILEVIEW_H
#define TILEVIEW_H
#include "CWindow.hpp"
class CTileView : public CWindow
{
public :
CTileView(HINSTANCE hInst, HWND parent);
unsigned char * mem;
unsigned short * pal;
signed short palnum;
unsigned short tilenum;
unsigned char coul;
unsigned long x;
unsigned long y;
};
void InitTileViewBox();
#endif
--- NEW FILE: DeSmuME.layout ---
[Editor_9]
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
Open=0
Top=0
[Editors]
Focused=46
Order=
[Editor_0]
Open=0
Top=0
CursorCol=3
CursorRow=18
TopLine=1
LeftChar=1
[Editor_1]
Open=0
Top=0
CursorCol=21
CursorRow=439
TopLine=425
LeftChar=1
[Editor_2]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_3]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_4]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_5]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_6]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_7]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_8]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_10]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_11]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_12]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_13]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_14]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_15]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_16]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_17]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_18]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_19]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_20]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_21]
Open=0
Top=0
CursorCol=35
CursorRow=17
TopLine=1
LeftChar=1
[Editor_22]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_23]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_24]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_25]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_26]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_27]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_28]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_29]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_30]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_31]
Open=0
Top=0
CursorCol=1
CursorRow=14
TopLine=1
LeftChar=1
[Editor_32]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_33]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_34]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_35]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_36]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_37]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_38]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_39]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_40]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_41]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_42]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_43]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_44]
Open=0
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_45]
Open=1
Top=0
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
[Editor_46]
Open=1
Top=1
CursorCol=1
CursorRow=4
TopLine=1
LeftChar=1
--- NEW FILE: resource.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef RESOURCE_H
#define RESOURCE_H
#include "../NDSSystem.hpp"
extern NDSSystem nds;
extern bool execute;
extern unsigned long glock;
void refreshAll();
#define IconDeSmuME 100
#define IDC_STATIC 101
#define IDM_OUVRIR 102
#define IDM_QUITTER 103
#define IDC_FERMER 104
#define IDC_STEP 105
#define IDC_SETPNUM 106
#define IDC_SCROLLER 107
#define IDC_GO 108
#define IDC_AUTO_UPDATE 109
#define IDM_MEMOIRE 110
#define IDM_DESASSEMBLEUR 111
#define IDM_GAME_INFO 112
#define IDM_EXEC 113
#define IDM_PAUSE 114
#define IDM_RESET 115
#define IDM_IOREG 116
#define IDM_LOG 117
#define IDM_PAL 118
#define IDM_TILE 119
#define IDM_MAP 120
#define IDM_MBG0 121
#define IDM_MBG1 122
#define IDM_MBG2 123
#define IDM_MBG3 124
#define IDM_SBG0 125
#define IDM_SBG1 126
#define IDM_SBG2 127
#define IDM_SBG3 128
#define IDM_OAM 129
#define IDD_MEM_VIEWER 301
#define IDC_8_BIT 302
#define IDC_16_BIT 303
#define IDC_32_BIT 304
#define IDC_MEM_BOX 305
#define IDC_GOTOMEM 306
#define IDD_DESASSEMBLEUR_VIEWER 401
#define IDC_DES_BOX 402
#define IDC_R0 403
#define IDC_R1 404
#define IDC_R2 405
#define IDC_R3 406
#define IDC_R4 407
#define IDC_R5 408
#define IDC_R6 409
#define IDC_R7 410
#define IDC_R8 411
#define IDC_R9 412
#define IDC_R10 413
#define IDC_R11 414
#define IDC_R12 415
#define IDC_R13 416
#define IDC_R14 417
#define IDC_R15 418
#define IDC_MODE 419
#define IDC_AUTO_DES 420
#define IDC_ARM 421
#define IDC_THUMB 422
#define IDC_GOTODES 423
#define IDC_TMP 424
#define IDD_GAME_INFO 501
#define IDC_NOM_JEU 502
#define IDC_CDE 503
#define IDC_FAB 504
#define IDC_TAILLE 505
#define IDC_ARM9_T 506
#define IDC_ARM7_T 507
#define IDC_DATA 508
#define IDD_IO_REG 601
#define IDC_INTHAND 602
#define IDC_IE 603
#define IDC_IME 604
#define IDC_DISPCNT 605
#define IDC_DISPSTAT 606
#define IDC_IPCSYNC 607
#define IDC_IPCFIFO 608
#define IDD_LOG 701
#define IDC_LOG 702
#define IDD_PAL 703
#define IDD_TILE 704
#define IDC_PAL_SELECT 705
#define IDC_PALNUM 706
#define IDC_MEM_SELECT 707
#define IDC_Tile_BOX 708
#define IDC_BITMAP 709
#define IDC_256COUL 710
#define IDC_16COUL 711
#define IDC_MINI_TILE 712
#define IDC_TILENUM 713
#define IDD_MAP 800
#define IDC_BG_SELECT 801
#define IDC_PAL 803
#define IDC_PRIO 804
#define IDC_CHAR 805
#define IDC_SCR 806
#define IDC_MSIZE 807
#define IDC_SCROLL 808
#define IDD_OAM 900
#define IDC_SCR_SELECT 901
#define IDC_TILE 902
#define IDC_OAMNUM 903
#define IDC_COOR 904
#define IDC_DIM 905
#define IDC_ROT 906
#define IDC_MOS 907
#define IDC_PROP0 908
#define IDC_PROP1 909
#define IDC_OAM_BOX 910
#endif
--- NEW FILE: Makefile.win ---
# Project: DeSmuME
# Makefile created by Dev-C++ 4.9.9.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES = obj/yopyop_private.res
OBJ = obj/main.o obj/MMU.o obj/mem_view.o obj/ARM_CPU.o obj/arm_instructions.o obj/des_view.o obj/Desassembleur.o obj/thumb_instructions.o obj/NDSSystem.o obj/ginfo.o obj/CP15.o obj/bios.o obj/IORegView.o obj/log.o obj/palView.o obj/CWindow.o obj/tileView.o obj/mapView.o obj/GPU.o obj/oamView.o $(RES)
LINKOBJ = obj/main.o obj/MMU.o obj/mem_view.o obj/ARM_CPU.o obj/arm_instructions.o obj/des_view.o obj/Desassembleur.o obj/thumb_instructions.o obj/NDSSystem.o obj/ginfo.o obj/CP15.o obj/bios.o obj/IORegView.o obj/log.o obj/palView.o obj/CWindow.o obj/tileView.o obj/mapView.o obj/GPU.o obj/oamView.o $(RES)
LIBS = -L"C:/teleir/Dev-Cpp/lib" -lmingw32 -lopengl32 -lSDLmain -lSDL -mwindows -s -march=pentium4 -msse2
INCS = -I"C:/teleir/Dev-Cpp/include"
CXXINCS = -I"C:/teleir/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/teleir/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/teleir/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/teleir/Dev-Cpp/include/c++/3.4.2" -I"C:/teleir/Dev-Cpp/include"
BIN = DeSmuME.exe
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3 -march=pentium4 -msse2
CFLAGS = $(INCS) -fexpensive-optimizations -O3 -march=pentium4 -msse2
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before DeSmuME.exe all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "DeSmuME.exe" $(LIBS)
obj/main.o: main.cpp
$(CPP) -c main.cpp -o obj/main.o $(CXXFLAGS)
obj/MMU.o: ../EmuSRC/MMU.cpp
$(CPP) -c ../EmuSRC/MMU.cpp -o obj/MMU.o $(CXXFLAGS)
obj/mem_view.o: mem_view.cpp
$(CPP) -c mem_view.cpp -o obj/mem_view.o $(CXXFLAGS)
obj/ARM_CPU.o: ../EmuSRC/ARM_CPU.cpp
$(CPP) -c ../EmuSRC/ARM_CPU.cpp -o obj/ARM_CPU.o $(CXXFLAGS)
obj/arm_instructions.o: ../EmuSRC/arm_instructions.cpp
$(CC) -c ../EmuSRC/arm_instructions.cpp -o obj/arm_instructions.o $(CFLAGS)
obj/des_view.o: des_view.cpp
$(CPP) -c des_view.cpp -o obj/des_view.o $(CXXFLAGS)
obj/Desassembleur.o: ../EmuSRC/Desassembleur.cpp
$(CC) -c ../EmuSRC/Desassembleur.cpp -o obj/Desassembleur.o $(CFLAGS)
obj/thumb_instructions.o: ../EmuSRC/thumb_instructions.cpp
$(CC) -c ../EmuSRC/thumb_instructions.cpp -o obj/thumb_instructions.o $(CFLAGS)
obj/NDSSystem.o: ../EmuSRC/NDSSystem.cpp
$(CPP) -c ../EmuSRC/NDSSystem.cpp -o obj/NDSSystem.o $(CXXFLAGS)
obj/ginfo.o: ginfo.cpp
$(CPP) -c ginfo.cpp -o obj/ginfo.o $(CXXFLAGS)
obj/CP15.o: ../EmuSRC/CP15.cpp
$(CPP) -c ../EmuSRC/CP15.cpp -o obj/CP15.o $(CXXFLAGS)
obj/bios.o: ../EmuSRC/bios.cpp
$(CC) -c ../EmuSRC/bios.cpp -o obj/bios.o $(CFLAGS)
obj/IORegView.o: IORegView.cpp
$(CPP) -c IORegView.cpp -o obj/IORegView.o $(CXXFLAGS)
obj/log.o: ../EmuSRC/log.cpp
$(CPP) -c ../EmuSRC/log.cpp -o obj/log.o $(CXXFLAGS)
obj/palView.o: palView.cpp
$(CPP) -c palView.cpp -o obj/palView.o $(CXXFLAGS)
obj/CWindow.o: CWindow.cpp
$(CPP) -c CWindow.cpp -o obj/CWindow.o $(CXXFLAGS)
obj/tileView.o: tileView.cpp
$(CPP) -c tileView.cpp -o obj/tileView.o $(CXXFLAGS)
obj/mapView.o: mapView.cpp
$(CPP) -c mapView.cpp -o obj/mapView.o $(CXXFLAGS)
obj/GPU.o: GPU.cpp
$(CPP) -c GPU.cpp -o obj/GPU.o $(CXXFLAGS)
obj/oamView.o: oamView.cpp
$(CPP) -c oamView.cpp -o obj/oamView.o $(CXXFLAGS)
obj/yopyop_private.res: yopyop_private.rc resources.rc
$(WINDRES) -i yopyop_private.rc --input-format=rc -o obj/yopyop_private.res -O coff
--- NEW FILE: tileView.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "tileView.hpp"
#include "resource.hpp"
#include "../MMU.hpp"
LRESULT CALLBACK tileViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK minitileViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitTileViewBox()
{
WNDCLASSEX wc;
wc.cbSize = sizeof(wc);
wc.lpszClassName = _T("TileViewBox");
wc.hInstance = GetModuleHandle(0);
wc.lpfnWndProc = tileViewBoxWndProc;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
wc.style = 0;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof( CWindow * );
wc.hIconSm = 0;
RegisterClassEx(&wc);
wc.cbSize = sizeof(wc);
wc.lpszClassName = _T("MiniTileViewBox");
wc.hInstance = GetModuleHandle(0);
wc.lpfnWndProc = minitileViewBoxWndProc;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
wc.style = 0;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof( CWindow * );
wc.hIconSm = 0;
RegisterClassEx(&wc);
}
LRESULT minitileViewBox_Paint(CTileView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd_dst = GetDlgItem(win->hwnd, IDC_MINI_TILE);
HWND hwnd_src = GetDlgItem(win->hwnd, IDC_Tile_BOX);
HDC hdc_src;
HDC hdc_dst;
char txt[80];
PAINTSTRUCT ps;
hdc_dst = BeginPaint(hwnd_dst, &ps);
hdc_src = GetDC(hwnd_src);
StretchBlt(hdc_dst, 0, 0, 80, 80, hdc_src, win->x, win->y, 8, 8, SRCCOPY);
sprintf(txt, "Tile num : 0x%X", win->tilenum);
SetWindowText(GetDlgItem(win->hwnd, IDC_TILENUM), txt);
EndPaint(hwnd_dst, &ps);
}
LRESULT CALLBACK minitileViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CTileView * win = (CTileView *)GetWindowLong(hwnd, 0);
switch(msg)
{
case WM_NCCREATE:
return 1;
case WM_NCDESTROY:
return 1;
case WM_PAINT :
minitileViewBox_Paint(win, wParam, lParam);
return 1;
case WM_ERASEBKGND:
return 1;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
LRESULT tileViewBox_direct(CTileView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = GetDlgItem(win->hwnd, IDC_Tile_BOX);
HDC hdc;
PAINTSTRUCT ps;
SIZE fontsize;
TCHAR text[80];
BITMAPV4HEADER bmi;
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
bmi.bV4Width = 256;
bmi.bV4Height = -256;
RECT rect;
GetClientRect(hwnd, &rect);
int lg = rect.right - rect.left;
int ht = rect.bottom - rect.top;
hdc = BeginPaint(hwnd, &ps);
HDC mem_dc = CreateCompatibleDC(hdc);
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
SelectObject(mem_dc, mem_bmp);
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
SetDIBitsToDevice(mem_dc, 0, 0, 256, 256, 0, 0, 0, 256, win->mem, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
BitBlt(hdc, 0, 0, lg, ht, mem_dc, 0, 0, SRCCOPY);
DeleteDC(mem_dc);
DeleteObject(mem_bmp);
EndPaint(hwnd, &ps);
}
LRESULT tileViewBox_pal256(CTileView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = GetDlgItem(win->hwnd, IDC_Tile_BOX);
HDC hdc;
PAINTSTRUCT ps;
SIZE fontsize;
TCHAR text[80];
unsigned short bitmap[256*256];
unsigned short * pal = ((unsigned short *)win->pal) + win->palnum*256;
BITMAPV4HEADER bmi;
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
bmi.bV4Width = 256;
bmi.bV4Height = -256;
RECT rect;
GetClientRect(hwnd, &rect);
int lg = rect.right - rect.left;
int ht = rect.bottom - rect.top;
hdc = BeginPaint(hwnd, &ps);
HDC mem_dc = CreateCompatibleDC(hdc);
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
SelectObject(mem_dc, mem_bmp);
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
if(win->pal)
{
/*for(unsigned long i = 0; i<256*256; ++i)
bitmap[i] = pal[win->mem[i]];*/
for(unsigned long num2 = 0; num2<32; ++num2)
for(unsigned long num = 0; num<32; ++num)
for(unsigned long y = 0; y<8; ++y)
for(unsigned long x = 0; x<8; ++x)
bitmap[x + (y*256) + (num*8) +(num2*256*8)] = pal[win->mem[x + (y*8) + (num*64) +(num2*2048)]];
SetDIBitsToDevice(mem_dc, 0, 0, 256, 256, 0, 0, 0, 256, bitmap, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
sprintf(text, "Pal : %d", win->palnum);
SetWindowText(GetDlgItem(win->hwnd, IDC_PALNUM), text);
}
else
TextOut(mem_dc, 3, 3, "Il n'y a pas de palette", 23);
BitBlt(hdc, 0, 0, lg, ht, mem_dc, 0, 0, SRCCOPY);
DeleteDC(mem_dc);
DeleteObject(mem_bmp);
EndPaint(hwnd, &ps);
}
LRESULT tileViewBox_pal16(CTileView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = GetDlgItem(win->hwnd, IDC_Tile_BOX);
HDC hdc;
PAINTSTRUCT ps;
SIZE fontsize;
TCHAR text[80];
unsigned short bitmap[512*512];
unsigned short * pal = ((unsigned short *)win->pal) + win->palnum*16;
BITMAPV4HEADER bmi;
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
bmi.bV4Width = 512;
bmi.bV4Height = -256;
RECT rect;
GetClientRect(hwnd, &rect);
int lg = rect.right - rect.left;
int ht = rect.bottom - rect.top;
hdc = BeginPaint(hwnd, &ps);
HDC mem_dc = CreateCompatibleDC(hdc);
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, 512, 256);
SelectObject(mem_dc, mem_bmp);
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
if(win->pal)
{
for(unsigned long num2 = 0; num2<32; ++num2)
for(unsigned long num = 0; num<64; ++num)
for(unsigned long y = 0; y<8; ++y)
for(unsigned long x = 0; x<4; ++x)
{
bitmap[(x<<1) + (y*512) + (num*8) +(num2*512*8)] = pal[win->mem[x + (y*4) + (num*32) +(num2*2048)]&0xF];
bitmap[(x<<1)+1 + (y*512) + (num*8) +(num2*512*8)] = pal[win->mem[x + (y*4) + (num*32) +(num2*2048)]>>4];
}
SetDIBitsToDevice(mem_dc, 0, 0, 512, 256, 0, 0, 0, 256, bitmap, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
sprintf(text, "Pal : %d", win->palnum);
SetWindowText(GetDlgItem(win->hwnd, IDC_PALNUM), text);
}
else
TextOut(mem_dc, 3, 3, "Il n'y a pas de palette", 23);
BitBlt(hdc, 0, 0, lg, ht, mem_dc, 0, 0, SRCCOPY);
DeleteDC(mem_dc);
DeleteObject(mem_bmp);
EndPaint(hwnd, &ps);
}
LRESULT CALLBACK tileViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CTileView * win = (CTileView *)GetWindowLong(hwnd, 0);
switch(msg)
{
case WM_NCCREATE:
return 1;
case WM_NCDESTROY:
return 1;
case WM_PAINT:
switch(win->coul)
{
case 0 :
tileViewBox_direct(win, wParam, lParam);
return 1;
case 1 :
tileViewBox_pal256(win, wParam, lParam);
return 1;
case 2 :
tileViewBox_pal16(win, wParam, lParam);
return 1;
}
return 1;
case WM_LBUTTONDOWN :
switch(win->coul)
{
case 0 :
case 1 :
if(LOWORD(lParam)<(32*8))
{
win->x = ((LOWORD(lParam)>>3)<<3);
win->y = (HIWORD(lParam)>>3)<<3;
win->tilenum = (LOWORD(lParam)>>3) + (HIWORD(lParam)>>3)*32;
}
break;
case 2 :
win->x = ((LOWORD(lParam)>>3)<<3);
win->y = (HIWORD(lParam)>>3)<<3;
win->tilenum = (LOWORD(lParam)>>3) + (HIWORD(lParam)>>3)*64;
break;
}
InvalidateRect(GetDlgItem(win->hwnd, IDC_MINI_TILE), NULL, FALSE);
UpdateWindow(GetDlgItem(win->hwnd, IDC_MINI_TILE));
//win->refresh();
return 1;
case WM_ERASEBKGND:
return 1;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
BOOL CALLBACK tileView_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CTileView * win = (CTileView *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
{
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);
combo = GetDlgItem(hwnd, IDC_MEM_SELECT);
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6000000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6010000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6020000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6030000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6040000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6050000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6060000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-BG - 0x6070000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"B-BG - 0x6200000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"B-BG - 0x6210000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-OBJ- 0x6400000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-OBJ- 0x6410000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-OBJ- 0x6420000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"A-OBJ- 0x6430000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"B-OBJ- 0x6600000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"B-OBJ- 0x6610000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6800000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6810000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6820000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6830000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6840000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6850000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6860000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6870000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6880000");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"LCD - 0x6890000");
SendMessage(combo, CB_SETCURSEL, 0, 0);
SendMessage(GetDlgItem(hwnd, IDC_BITMAP), BM_SETCHECK, TRUE, 0);
}
return 1;
case WM_CLOSE :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_HSCROLL :
switch LOWORD(wParam)
{
case SB_LINERIGHT :
++(win->palnum);
if(win->palnum>15)
win->palnum = 15;
break;
case SB_LINELEFT :
--(win->palnum);
if(win->palnum<0)
win->palnum = 0;
break;
}
win->refresh();
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case IDC_AUTO_UPDATE :
if(win->autoup)
{
win->remove2RefreshList();
win->autoup = false;
return 1;
}
win->add2RefreshList();
win->autoup = true;
return 1;
case IDC_BITMAP :
win->coul = 0;
win->refresh();
return 1;
case IDC_256COUL :
win->coul = 1;
win->refresh();
return 1;
case IDC_16COUL :
win->coul = 2;
win->refresh();
return 1;
case IDC_MEM_SELECT :
switch(HIWORD(wParam))
{
case CBN_CLOSEUP :
{
unsigned long sel = SendMessage(GetDlgItem(hwnd, IDC_MEM_SELECT), CB_GETCURSEL, 0, 0);
switch(sel)
{
case 0 :
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
win->mem = MMU::ARM9_ABG + 0x10000*sel;
break;
case 8 :
case 9 :
win->mem = MMU::ARM9_BBG + 0x10000*(sel-8);
break;
case 10 :
case 11 :
case 12 :
case 13 :
win->mem = MMU::ARM9_AOBJ + 0x10000*(sel-10);
break;
case 14 :
case 15 :
win->mem = MMU::ARM9_BOBJ + 0x10000*(sel-14);
break;
case 16 :
case 17 :
case 18 :
case 19 :
case 20 :
case 21 :
case 22 :
case 23 :
case 24 :
case 25 :
win->mem = MMU::ARM9_LCD + 0x10000*(sel-16);
break;
default :
return 1;
}
win->refresh();
return 1;
}
}
return 1;
case IDC_PAL_SELECT :
switch(HIWORD(wParam))
{
case CBN_CLOSEUP :
{
unsigned long sel = SendMessage(GetDlgItem(hwnd, IDC_PAL_SELECT), CB_GETCURSEL, 0, 0);
switch(sel)
{
case 0 :
win->pal = (unsigned short *)MMU::ARM9_VMEM;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), true);
break;
case 1 :
win->pal = ((unsigned short *)MMU::ARM9_VMEM) + 0x200;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), true);
break;
case 2 :
win->pal = (unsigned short *)MMU::ARM9_VMEM + 0x100;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), true);
break;
case 3 :
win->pal = ((unsigned short *)MMU::ARM9_VMEM) + 0x300;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), true);
break;
case 4 :
case 5 :
case 6 :
case 7 :
win->pal = ((unsigned short *)(MMU::ExtPal[0][sel-4]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), false);
if(win->coul == 2)
{
SendMessage(GetDlgItem(hwnd, IDC_256COUL), BM_SETCHECK, TRUE, 0);
SendMessage(GetDlgItem(hwnd, IDC_16COUL), BM_SETCHECK, FALSE, 0);
win->coul = 1;
}
break;
case 8 :
case 9 :
case 10 :
case 11 :
win->pal = ((unsigned short *)(MMU::ExtPal[1][sel-8]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), false);
if(win->coul == 2)
{
SendMessage(GetDlgItem(hwnd, IDC_256COUL), BM_SETCHECK, TRUE, 0);
SendMessage(GetDlgItem(hwnd, IDC_16COUL), BM_SETCHECK, FALSE, 0);
win->coul = 1;
}
break;
case 12 :
case 13 :
win->pal = ((unsigned short *)(MMU::ObjExtPal[0][sel-12]));
win->palnum = 0;
if(win->coul == 2)
{
SendMessage(GetDlgItem(hwnd, IDC_256COUL), BM_SETCHECK, TRUE, 0);
SendMessage(GetDlgItem(hwnd, IDC_16COUL), BM_SETCHECK, FALSE, 0);
win->coul = 1;
}
break;
case 14 :
case 15 :
win->pal = ((unsigned short *)(MMU::ObjExtPal[1][sel-14]));
win->palnum = 0;
if(win->coul == 2)
{
SendMessage(GetDlgItem(hwnd, IDC_256COUL), BM_SETCHECK, TRUE, 0);
SendMessage(GetDlgItem(hwnd, IDC_16COUL), BM_SETCHECK, FALSE, 0);
win->coul = 1;
}
break;
case 16 :
case 17 :
case 18 :
case 19 :
win->pal = ((unsigned short *)(MMU::texPalSlot[sel-16]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_16COUL), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_16COUL), true);
break;
default :
return 1;
}
win->refresh();
return 1;
}
}
}
return 0;
}
return 0;
}
CTileView::CTileView(HINSTANCE hInst, HWND parent) :
CWindow(hInst, parent, "Tile viewer", IDD_TILE, tileView_proc), mem(MMU::ARM9_ABG), pal(((unsigned short *)MMU::ARM9_VMEM)), palnum(0), coul(0), x(0), y(0)
{
SetWindowLong(GetDlgItem(hwnd, IDC_Tile_BOX), 0, (LONG)this);
SetWindowLong(GetDlgItem(hwnd, IDC_MINI_TILE), 0, (LONG)this);
}
--- NEW FILE: DeSmuME.exe.Manifest ---
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="DevCpp.Apps.DeSmuME"
processorArchitecture="x86"
version="1.0.0.0"
type="win32"/>
<description>DeSmuME</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
--- NEW FILE: mem_view.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef MEM_VIEW_H
#define MEM_VIEW_H
#include "CWindow.hpp"
class CMemView : public CWindow
{
public :
CMemView(HINSTANCE hInst, HWND parent, char * titre, unsigned char CPU);
char cpu;
unsigned long curr_ligne;
unsigned char representation;
};
void InitMemViewBox();
//BOOL CALLBACK mem_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
--- NEW FILE: IORegView.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef IO_REG_H
#define IO_REG_H
BOOL CALLBACK ioreg_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
--- NEW FILE: GPU.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef GPU_H
#define GPU_H
#include "../MMU.hpp"
struct OAM
{
unsigned short attr0;
unsigned short attr1;
unsigned short attr2;
unsigned short attr3;
};
struct size
{
signed short x;
signed short y;
};
class GPU
{
public :
GPU(unsigned char l);
inline void ligne(unsigned short * buffer, unsigned short l);
void setVideoProp(unsigned long p);
void setBGProp(unsigned short num, unsigned short p);
void scrollX(unsigned char num, unsigned short v);
void scrollY(unsigned char num, unsigned short v);
void scrollXY(unsigned char num, unsigned long v);
void setX(unsigned char num, unsigned long v);
void setXH(unsigned char num, unsigned short v);
void setXL(unsigned char num, unsigned short v);
void setY(unsigned char num, unsigned long v);
void setYH(unsigned char num, unsigned short v);
void setYL(unsigned char num, unsigned short v);
void setPA(unsigned char num, unsigned short v);
void setPB(unsigned char num, unsigned short v);
void setPC(unsigned char num, unsigned short v);
void setPD(unsigned char num, unsigned short v);
void setPAPB(unsigned char num, unsigned long v);
void setPCPD(unsigned char num, unsigned long v);
void remove(unsigned char num);
void addBack(unsigned char num);
unsigned long prop;
unsigned short BGProp[4];
unsigned char * (BGBmpBB[4]);
unsigned char * (BGChBB[4]);
unsigned short * (BGScrBB[4]);
unsigned char BGExtPalSlot[4];
unsigned long BGSize[4][2];
unsigned short BGSX[4];
unsigned short BGSY[4];
signed long BGX[4];
signed long BGY[4];
signed short BGPA[4];
signed short BGPB[4];
signed short BGPC[4];
signed short BGPD[4];
unsigned char lcd;
unsigned char nbBGActif;
unsigned char BGIndex[4];
unsigned char ordre[4];
bool dispBG[4];
OAM * oam;
unsigned char * sprMem;
unsigned char sprBlock;
unsigned char sprBMPBlock;
unsigned char sprBMPMode;
void (*spriteRender)(GPU * gpu, unsigned short l, unsigned short * dst, unsigned char * prioTab);
static unsigned short screen[2*256*192];
};
void textBG(GPU * gpu, unsigned char num, unsigned short * DST);
void rotBG(GPU * gpu, unsigned char num, unsigned short * DST);
void extRotBG(GPU * gpu, unsigned char num, unsigned short * DST);
void sprite1D(GPU * gpu, unsigned short l, unsigned short * dst, unsigned char * prioTab);
void sprite2D(GPU * gpu, unsigned short l, unsigned short * dst, unsigned char * prioTab);
extern short sizeTab[4][4][2];
extern size sprSizeTab[4][4];
extern char mode2type[8][4];
extern void (*modeRender[8][4])(GPU * gpu, unsigned char num, unsigned short l, unsigned short * DST);
void GPU::ligne(unsigned short * buffer, unsigned short l)
{
unsigned short * dst = buffer + l*256;
unsigned short spr[256];
unsigned char sprPrio[256];
unsigned char bgprio;
unsigned long c = ((unsigned short *)MMU::ARM9_VMEM)[0+lcd*0x200];
c |= (c<<16);
for(unsigned char i = 0; i< 128; ++i)
{
((unsigned long *)dst)[i] = c;
((unsigned long *)spr)[i] = c;
((unsigned short *)sprPrio)[i] = (4<<8) | (4);
}
if(!nbBGActif)
{
spriteRender(this, l, dst, sprPrio);
return;
}
spriteRender(this, l, spr, sprPrio);
if((BGProp[ordre[0]]&3)!=3)
{
for(unsigned short i = 0; i < 128; ++i)
((unsigned long *)dst)[i] = ((unsigned long *)spr)[i];
}
for(unsigned char i = 0; i < nbBGActif; ++i)
{
modeRender[prop&7][ordre[i]](this, ordre[i], l, dst);
bgprio = BGProp[ordre[i]]&3;
for(unsigned short i = 0; i < 256; ++i)
if(bgprio>=sprPrio[i])
dst[i] = spr[i];
}
}
#endif
--- NEW FILE: resources.rc ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include "resource.hpp"
IconDeSmuME ICON MOVEABLE PURE LOADONCALL DISCARDABLE "DeSmuME.ico"
//IconDeSmuME ICON MOVEABLE PURE LOADONCALL DISCARDABLE "DeSmuME3D.ico"
MENU_PRINCIPAL MENU
{
POPUP "&Fichier"
{
MENUITEM "&Ouvrir", IDM_OUVRIR
MENUITEM "&Info rom", IDM_GAME_INFO
MENUITEM SEPARATOR
MENUITEM "&Quitter", IDM_QUITTER
}
POPUP "&Emulation"
{
MENUITEM "&Execute", IDM_EXEC
MENUITEM "&Pause", IDM_PAUSE
MENUITEM "&Reset", IDM_RESET
}
POPUP "&Outils"
{
MENUITEM "&Desassembleur", IDM_DESASSEMBLEUR
MENUITEM "Visualiser la &memoire", IDM_MEMOIRE
MENUITEM "Visualiser les ®istres", IDM_IOREG
// MENUITEM "Visualiser le &log", IDM_LOG
MENUITEM "Visualiser les &palettes", IDM_PAL
MENUITEM "Visualiser les &tiles", IDM_TILE
MENUITEM "Visualiser les m&aps", IDM_MAP
MENUITEM "Visualiser les &oams", IDM_OAM
MENUITEM SEPARATOR
POPUP "&Visualiser les &couches"
{
MENUITEM "Main BG 0", IDM_MBG0, CHECKED
MENUITEM "Main BG 1", IDM_MBG1, CHECKED
MENUITEM "Main BG 2", IDM_MBG2, CHECKED
MENUITEM "Main BG 3", IDM_MBG3, CHECKED
MENUITEM SEPARATOR
MENUITEM "Sub BG 0", IDM_SBG0, CHECKED
MENUITEM "Sub BG 1", IDM_SBG1, CHECKED
MENUITEM "Sub BG 2", IDM_SBG2, CHECKED
MENUITEM "Sub BG 3", IDM_SBG3, CHECKED
}
}
}
IDD_MEM_VIEWER DIALOG DISCARDABLE 0, 0, 428, 178
STYLE WS_SYSMENU
CAPTION "Visualisation de la memoire"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "8 bit",IDC_8_BIT,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,4,29,10
CONTROL "16 bit",IDC_16_BIT,"Button",BS_AUTORADIOBUTTON,44,4,33,10
CONTROL "32 bit",IDC_32_BIT,"Button",BS_AUTORADIOBUTTON,82,4,33,10
LTEXT "Aller E:",IDC_STATIC,130,4,33,10
EDITTEXT IDC_GOTOMEM,155,1,82,14,ES_UPPERCASE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_GROUP
PUSHBUTTON "&GO",IDC_GO,240,1,20,14
CONTROL "Auto-update",IDC_AUTO_UPDATE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,350,1,75,14
CONTROL "Edit", IDC_MEM_BOX,"MemViewBox",WS_TABSTOP | WS_VSCROLL,4,16,424,142,WS_EX_CLIENTEDGE
PUSHBUTTON "&Fermer",IDC_FERMER,185,162,50,14
END
IDD_DESASSEMBLEUR_VIEWER DIALOG DISCARDABLE 0, 0, 380, 186
STYLE WS_SYSMENU
CAPTION "Desassembleur"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Auto ",IDC_AUTO_DES,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,4,35,10
CONTROL "ARM",IDC_ARM,"Button",BS_AUTORADIOBUTTON,44,4,35,10
CONTROL "Thumb",IDC_THUMB,"Button",BS_AUTORADIOBUTTON,82,4,40,10
LTEXT "Aller E:",IDC_STATIC,130,4,33,10
EDITTEXT IDC_GOTODES,155,1,82,14,ES_UPPERCASE | ES_AUTOHSCROLL |
ES_WANTRETURN | WS_GROUP
PUSHBUTTON "&GO",IDC_GO,240,1,20,14
CONTROL "Auto-update",IDC_AUTO_UPDATE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,300,1,75,14
CONTROL "Edit", IDC_DES_BOX,"DesViewBox",WS_TABSTOP | WS_VSCROLL,4,16,296,150,WS_EX_CLIENTEDGE
PUSHBUTTON "&Fermer",IDC_FERMER,185,170,50,14
EDITTEXT IDC_SETPNUM,5,170,65,14,ES_UPPERCASE | ES_AUTOHSCROLL | WS_GROUP | ES_NUMBER
PUSHBUTTON "&Step",IDC_STEP,75,170,50,14
LTEXT "R0 :",IDC_STATIC,304,16,17,8
LTEXT "R1 :",IDC_STATIC,304,24,17,8
LTEXT "R2 :",IDC_STATIC,304,32,17,8
LTEXT "R3 :",IDC_STATIC,304,40,17,8
LTEXT "R4 :",IDC_STATIC,304,48,17,8
LTEXT "R5 :",IDC_STATIC,304,56,17,8
LTEXT "R6 :",IDC_STATIC,304,64,17,8
LTEXT "R7 :",IDC_STATIC,304,72,17,8
LTEXT "R8 :",IDC_STATIC,304,80,17,8
LTEXT "R9 :",IDC_STATIC,304,88,17,8
LTEXT "R10 :",IDC_STATIC,304,96,17,8
LTEXT "R11 :",IDC_STATIC,304,104,17,8
LTEXT "R12 :",IDC_STATIC,304,112,17,8
LTEXT "SP :",IDC_STATIC,304,120,17,8
LTEXT "LR :",IDC_STATIC,304,128,17,8
LTEXT "PC :",IDC_STATIC,304,136,17,8
LTEXT "Mode :",IDC_STATIC,304,158,22,8
LTEXT "SPSR :",IDC_STATIC,304,168,22,8
LTEXT "00000000",IDC_R0,325,16,40,8
LTEXT "00000000",IDC_R1,325,24,40,8
LTEXT "00000000",IDC_R2,325,32,40,8
LTEXT "00000000",IDC_R3,325,40,40,8
LTEXT "00000000",IDC_R4,325,48,40,8
LTEXT "00000000",IDC_R5,325,56,40,8
LTEXT "00000000",IDC_R6,325,64,40,8
LTEXT "00000000",IDC_R7,325,72,40,8
LTEXT "00000000",IDC_R8,325,80,40,8
LTEXT "00000000",IDC_R9,325,88,40,8
LTEXT "00000000",IDC_R10,325,96,40,8
LTEXT "00000000",IDC_R11,325,104,40,8
LTEXT "00000000",IDC_R12,325,112,40,8
LTEXT "00000000",IDC_R13,325,120,40,8
LTEXT "00000000",IDC_R14,325,128,40,8
LTEXT "00000000",IDC_R15,325,136,40,8
LTEXT "",IDC_MODE,327,158,28,8
LTEXT "",IDC_TMP,327,168,40,8
END
IDD_GAME_INFO DIALOG DISCARDABLE 0, 0, 150, 150
STYLE WS_VISIBLE | WS_SYSMENU
CAPTION "Info ROM"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "&Fermer",IDC_FERMER,50,134,50,14
LTEXT "Nom du jeu :",IDC_STATIC,4,4,41,8
LTEXT "Code :",IDC_STATIC,4,12,41,8
LTEXT "Fabriquant :",IDC_STATIC,4,20,41,8
LTEXT "Taille :",IDC_STATIC,4,28,41,8
LTEXT "ARM9 taille :",IDC_STATIC,4,36,41,8
LTEXT "ARM7 taille :",IDC_STATIC,4,44,41,8
LTEXT "Donnee :",IDC_STATIC,4,52,41,8
LTEXT "",IDC_NOM_JEU,45,4,100,8
LTEXT "",IDC_CDE,45,12,100,8
LTEXT "",IDC_FAB,45,20,100,8
LTEXT "",IDC_TAILLE,45,28,100,8
LTEXT "",IDC_ARM9_T,45,36,100,8
LTEXT "",IDC_ARM7_T,45,44,100,8
LTEXT "",IDC_DATA,45,52,100,8
END
IDD_IO_REG DIALOG DISCARDABLE 0, 0, 150, 150
STYLE WS_SYSMENU
CAPTION "IO REG"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "&Fermer",IDC_FERMER,50,134,50,14
LTEXT "Int Handler :",IDC_STATIC,4,4,41,8
LTEXT "IE :",IDC_STATIC,4,12,41,8
LTEXT "IME :",IDC_STATIC,4,20,41,8
LTEXT "DISPCNT :",IDC_STATIC,4,28,41,8
LTEXT "DISPSTAT :",IDC_STATIC,4,36,41,8
LTEXT "IPCSYNC :",IDC_STATIC,4,44,41,8
LTEXT "IPCFIFO :",IDC_STATIC,4,52,41,8
LTEXT "",IDC_INTHAND,45,4,100,8
LTEXT "",IDC_IE,45,12,130,8
LTEXT "",IDC_IME,45,20,130,8
LTEXT "",IDC_DISPCNT,45,28,130,8
LTEXT "",IDC_DISPSTAT,45,36,130,8
LTEXT "",IDC_IPCSYNC,45,44,130,8
LTEXT "",IDC_IPCFIFO,45,52,130,8
END
IDD_LOG DIALOG DISCARDABLE 0, 0, 300, 300
STYLE WS_SYSMENU
CAPTION "Log"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Edit", IDC_LOG,"LogView",WS_TABSTOP | WS_VSCROLL,4,4,292,280,WS_EX_CLIENTEDGE
PUSHBUTTON "&Fermer",IDC_FERMER,125,285,50,14
END
IDD_PAL DIALOG DISCARDABLE 0, 0, 120, 165
STYLE WS_SYSMENU
CAPTION "PAL VIEW"
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_PAL_SELECT, 15, 3, 90, 14, WS_TABSTOP | CBS_DROPDOWN
LTEXT "Pal : 0",IDC_PALNUM,3,21,25,8
SCROLLBAR IDC_SCROLLER,30,18,20,14, SBS_HORZ
CONTROL "Auto-update",IDC_AUTO_UPDATE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,60,18,75,14
PUSHBUTTON "&Fermer",IDC_FERMER,35,149,50,14
END
IDD_TILE DIALOG DISCARDABLE 0, 0, 446, 180
STYLE WS_SYSMENU
CAPTION "TILE VIEW"
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_PAL_SELECT, 4, 13, 90, 14, WS_TABSTOP | CBS_DROPDOWN
LTEXT "Pal : 0",IDC_PALNUM,4,31,25,8
SCROLLBAR IDC_SCROLLER,30,28,20,14, SBS_HORZ
COMBOBOX IDC_MEM_SELECT, 4, 50, 90, 14, WS_TABSTOP | CBS_DROPDOWN
CONTROL "Bitmap",IDC_BITMAP,"Button",BS_AUTORADIOBUTTON | WS_GROUP,4,68,35,10
CONTROL "256 couleurs",IDC_256COUL,"Button",BS_AUTORADIOBUTTON,4,80,55,10
CONTROL "16 couleurs",IDC_16COUL,"Button",BS_AUTORADIOBUTTON,4,92,50,10
CONTROL "Auto-update",IDC_AUTO_UPDATE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,369,164,75,14
CONTROL "Edit", IDC_Tile_BOX,"TileViewBox",WS_TABSTOP ,100,2,344,160,WS_EX_CLIENTEDGE
CONTROL "Edit", IDC_MINI_TILE,"MiniTileViewBox",WS_TABSTOP ,22,116,56,52,WS_EX_CLIENTEDGE
LTEXT "Tile num : 0",IDC_TILENUM,23,170,100,8
PUSHBUTTON "&Fermer",IDC_FERMER,198,164,50,14
END
IDD_MAP DIALOG DISCARDABLE 0, 0, 485, 320
STYLE WS_SYSMENU
CAPTION "MAP VIEW"
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_BG_SELECT, 4, 4, 90, 14, WS_TABSTOP | CBS_DROPDOWN
LTEXT "Mode :",IDC_STATIC,4,20,45,8
LTEXT "Palette :",IDC_STATIC,4,30,45,8
LTEXT "Prio :",IDC_STATIC,4,40,45,8
LTEXT "Char base :",IDC_STATIC,4,50,45,8
LTEXT "Screen base :",IDC_STATIC,4,60,45,8
LTEXT "Size :",IDC_STATIC,4,70,45,8
LTEXT "Scroll :",IDC_STATIC,4,80,45,8
LTEXT "",IDC_MODE,48,20,85,8
LTEXT "",IDC_PAL,48,30,85,8
LTEXT "",IDC_PRIO,48,40,85,8
LTEXT "",IDC_CHAR,48,50,85,8
LTEXT "",IDC_SCR,48,60,85,8
LTEXT "",IDC_MSIZE,48,70,85,8
LTEXT "",IDC_SCROLL,48,80,85,8
// CONTROL "Edit", IDC_MAP_BOX,"MapViewBox",WS_TABSTOP | WS_VSCROLL | WS_HSCROLL,4,16,296,150,WS_EX_CLIENTEDGE
PUSHBUTTON "&Fermer",IDC_FERMER,4,300,50,14
END
IDD_OAM DIALOG DISCARDABLE 0, 0, 300, 200//150, 150
STYLE WS_SYSMENU
CAPTION "OAM Viewer"
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_SCR_SELECT, 4, 4, 90, 14, WS_TABSTOP | CBS_DROPDOWN
SCROLLBAR IDC_SCROLLER,48,20,20,14, SBS_HORZ
LTEXT "Mode :",IDC_STATIC,4,36,45,8
LTEXT "Tile :",IDC_STATIC,4,46,45,8
LTEXT "Palette :",IDC_STATIC,4,56,45,8
LTEXT "Prio :",IDC_STATIC,4,66,45,8
LTEXT "Coordonnées :",IDC_STATIC,4,76,45,8
LTEXT "Dimensions :",IDC_STATIC,4,86,45,8
LTEXT "Rotation :",IDC_STATIC,4,96,45,8
LTEXT "Mosaic :",IDC_STATIC,4,106,45,8
LTEXT "OAM : 0",IDC_OAMNUM,4,24,40,8
LTEXT "",IDC_MODE,48,36,42,8
LTEXT "",IDC_TILE,48,46,72,8
LTEXT "",IDC_PAL,48,56,72,8
LTEXT "",IDC_PRIO,48,66,72,8
LTEXT "",IDC_COOR,48,76,42,8
LTEXT "",IDC_DIM,48,86,42,8
LTEXT "",IDC_ROT,48,96,42,8
LTEXT "",IDC_MOS,48,106,42,8
LTEXT "",IDC_PROP0,4,116,86,8
LTEXT "",IDC_PROP1,4,126,86,8
// CONTROL "Edit", IDC_OAM_BOX,"OAMViewBox",WS_TABSTOP,100,50,45,42,WS_EX_CLIENTEDGE
PUSHBUTTON "&Fermer",IDC_FERMER,50,134,50,14
END
--- NEW FILE: mem_view.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "mem_view.hpp"
#include "../MMU.hpp"
#include "resource.hpp"
LRESULT CALLBACK MemViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitMemViewBox()
{
WNDCLASSEX wc;
wc.cbSize = sizeof(wc);
wc.lpszClassName = _T("MemViewBox");
wc.hInstance = GetModuleHandle(0);
wc.lpfnWndProc = MemViewBoxWndProc;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
wc.style = 0;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof( CWindow * );
wc.hIconSm = 0;
RegisterClassEx(&wc);
}
LRESULT MemViewBox_OnPaint(CMemView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = GetDlgItem(win->hwnd, IDC_MEM_BOX);
HDC hdc;
PAINTSTRUCT ps;
SIZE fontsize;
TCHAR text[80];
RECT rect;
GetClientRect(hwnd, &rect);
int lg = rect.right - rect.left;
int ht = rect.bottom - rect.top;
hdc = BeginPaint(hwnd, &ps);
HDC mem_dc = CreateCompatibleDC(hdc);
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
SelectObject(mem_dc, mem_bmp);
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
SelectObject(mem_dc, GetStockObject(SYSTEM_FIXED_FONT));
GetTextExtentPoint32(mem_dc, "0", 1, &fontsize);
int nbligne = ht/fontsize.cy;
SetTextColor(mem_dc, RGB(0,0,0));
RECT r;
r.top = 3;
r.left = 3;
r.bottom = r.top+fontsize.cy;
r.right = rect.right-3;
unsigned long adr = win->curr_ligne*0x10;
for(int i=0; i<nbligne; ++i)
{
sprintf(text, "%04X:%04X", adr>>16, adr&0xFFFF);
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
r.left += 11*fontsize.cx;
int j;
if(win->representation == 0)
for(j=0; j<16; ++j)
{
sprintf(text, "%02X", MMU::readByte(win->cpu, adr+j));
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
r.left+=3*fontsize.cx;
}
else
if(win->representation == 1)
for(j=0; j<16; j+=2)
{
sprintf(text, "%04X", MMU::readHWord(win->cpu, adr+j));
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
r.left+=5*fontsize.cx;
}
else
for(j=0; j<16; j+=4)
{
sprintf(text, "%08X", MMU::readWord(win->cpu, adr+j));
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
r.left+=9*fontsize.cx;
}
r.left+=fontsize.cx;
for(j=0; j<16; ++j)
{
unsigned char c = MMU::readByte(win->cpu, adr+j);
if(c >= 32 && c <= 127) {
text[j] = (char)c;
}
else
text[j] = '.';
}
text[j] = '\0';
DrawText(mem_dc, text, -1, &r, DT_TOP | DT_LEFT | DT_NOPREFIX);
adr+=0x10;
r.top += fontsize.cy;
r.bottom += fontsize.cy;
r.left = 3;
}
BitBlt(hdc, 0, 0, lg, ht, mem_dc, 0, 0, SRCCOPY);
DeleteDC(mem_dc);
DeleteObject(mem_bmp);
EndPaint(hwnd, &ps);
return 1;
}
LRESULT CALLBACK MemViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CMemView * win = (CMemView *)GetWindowLong(hwnd, 0);
switch(msg)
{
case WM_NCCREATE:
SetScrollRange(hwnd, SB_VERT, 0, 0x0FFFFFFF, true);
SetScrollPos(hwnd, SB_VERT, 10, true);
return 1;
case WM_NCDESTROY:
return 1;
case WM_PAINT:
MemViewBox_OnPaint(win, wParam, lParam);
return 1;
case WM_ERASEBKGND:
return 1;
case WM_VSCROLL :
{
RECT rect;
SIZE fontsize;
GetClientRect(hwnd, &rect);
HDC dc = GetDC(hwnd);
HFONT old = (HFONT)SelectObject(dc, GetStockObject(SYSTEM_FIXED_FONT));
GetTextExtentPoint32(dc, "0", 1, &fontsize);
int nbligne = (rect.bottom - rect.top)/fontsize.cy;
switch LOWORD(wParam)
{
case SB_LINEDOWN :
win->curr_ligne = min(0X0FFFFFFFF, win->curr_ligne+1);
break;
case SB_LINEUP :
win->curr_ligne = (unsigned long)max(0, (signed long)win->curr_ligne-1);
break;
case SB_PAGEDOWN :
win->curr_ligne = min(0X0FFFFFFFF, win->curr_ligne+nbligne);
break;
case SB_PAGEUP :
win->curr_ligne = (unsigned long)max(0, (signed long)win->curr_ligne-nbligne);
break;
}
SelectObject(dc, old);
SetScrollPos(hwnd, SB_VERT, win->curr_ligne, true);
InvalidateRect(hwnd, NULL, FALSE);
UpdateWindow(hwnd);
}
return 1;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
// MEM VIEWER
BOOL CALLBACK mem_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CMemView * win = (CMemView *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
SendMessage(GetDlgItem(hwnd, IDC_8_BIT), BM_SETCHECK, TRUE, 0);
return 1;
case WM_CLOSE :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_8_BIT :
win->representation = 0;
InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX));
return 1;
case IDC_16_BIT :
win->representation = 1;
InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX));
return 1;
case IDC_32_BIT :
win->representation = 2;
InvalidateRect(GetDlgItem(hwnd, IDC_MEM_BOX), NULL, FALSE);
UpdateWindow(GetDlgItem(hwnd, IDC_MEM_BOX));
return 1;
case IDC_AUTO_UPDATE :
if(win->autoup)
{
win->remove2RefreshList();
win->autoup = false;
return 1;
}
win->add2RefreshList();
win->autoup = true;
return 1;
case IDC_GO :
{
char tmp[8];
int lg = GetDlgItemText(hwnd, IDC_GOTOMEM, tmp, 8);
unsigned long adr = 0;
for(unsigned short i = 0; i<lg; ++i)
{
if((tmp[i]>='A')&&(tmp[i]<='F'))
{
adr = adr*16 + (tmp[i]-'A'+10);
continue;
}
if((tmp[i]>='0')&&(tmp[i]<='9'))
{
adr = adr*16 + (tmp[i]-'0');
continue;
}
}
win->curr_ligne = (adr>>4);
InvalidateRect(hwnd, NULL, FALSE);
UpdateWindow(hwnd);
}
return 1;
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
}
return 0;
}
return 0;
}
CMemView::CMemView(HINSTANCE hInst, HWND parent, char * titre, unsigned char CPU) :
CWindow(hInst, parent, titre, IDD_MEM_VIEWER, mem_view_proc), cpu(CPU), curr_ligne(0), representation(0)
{
SetWindowLong(GetDlgItem(hwnd, IDC_MEM_BOX), 0, (LONG)this);
}
--- NEW FILE: palView.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef PALVIEW_H
#define PALVIEW_H
#include "CWindow.hpp"
class CPalView : public CWindow
{
public :
CPalView(HINSTANCE hInst, HWND parent);
//virtual void refresh();
unsigned short * adr;
signed short palnum;
};
//BOOL CALLBACK palView_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
--- NEW FILE: ginfo.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include "resource.h"
#include "../EmuSRC/MMU.h"
#include <stdio.h>
#include "CWindow.h"
LRESULT ginfo_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
TCHAR text[80];
NDS_header * header = nds.getROMHeader();
hdc = BeginPaint(hwnd, &ps);
//sprintf(text, "%08X", MMU::ARM9_MEM_MASK[0x80]);
SetWindowText(GetDlgItem(hwnd, IDC_NOM_JEU), header->gameTile);
SetWindowText(GetDlgItem(hwnd, IDC_CDE), header->gameCode);
sprintf(text, "%d", header->makerCode);
SetWindowText(GetDlgItem(hwnd, IDC_FAB), text);
sprintf(text, "%d", header->cardSize);
SetWindowText(GetDlgItem(hwnd, IDC_TAILLE), text);
sprintf(text, "%d", header->ARM9binSize);
SetWindowText(GetDlgItem(hwnd, IDC_ARM9_T), text);
sprintf(text, "%d", header->ARM7binSize);
SetWindowText(GetDlgItem(hwnd, IDC_ARM7_T), text);
sprintf(text, "%d", header->ARM7binSize + header->ARM7src);
SetWindowText(GetDlgItem(hwnd, IDC_DATA), text);
EndPaint(hwnd, &ps);
}
BOOL CALLBACK ginfo_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
return 1;
case WM_CLOSE :
EndDialog(hwnd, 0);
return 1;
case WM_PAINT:
ginfo_OnPaint(hwnd, wParam, lParam);
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
EndDialog(hwnd, 0);
return 1;
}
return 0;
}
return 0;
}
--- NEW FILE: IORegView.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include "CWindow.hpp"
#include "resource.hpp"
#include "../MMU.hpp"
#include <stdio.h>
LRESULT ioreg_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
TCHAR text[80];
NDS_header * header = nds.getROMHeader();
hdc = BeginPaint(hwnd, &ps);
sprintf(text, "%08X", ((unsigned long *)MMU::ARM9_DTCM)[0x3FFC>>2]);
SetWindowText(GetDlgItem(hwnd, IDC_INTHAND), text);
sprintf(text, "%08X", MMU::REG_IF[0]);
SetWindowText(GetDlgItem(hwnd, IDC_IE), text);
sprintf(text, "%08X", MMU::REG_IME[0]);
SetWindowText(GetDlgItem(hwnd, IDC_IME), text);
sprintf(text, "%08X", ((unsigned short *)MMU::ARM9_REG)[0x0004>>1]);//((unsigned long *)MMU::ARM9_REG)[0x10>>2]);
SetWindowText(GetDlgItem(hwnd, IDC_DISPCNT), text);
sprintf(text, "%08X", ((unsigned short *)MMU::ARM7_REG)[0x0004>>1]);//MMU::DMACycle[0][1]);//((unsigned short *)MMU::ARM9_REG)[0x16>>1]);
SetWindowText(GetDlgItem(hwnd, IDC_DISPSTAT), text);
sprintf(text, "%08X", ((unsigned long *)MMU::ARM9_REG)[0x180>>2]);//MMU::DMACycle[0][2]);//((unsigned long *)MMU::ARM9_REG)[0x001C>>2]);//MMU::fifos[0].data[MMU::fifos[0].deb]);//((unsigned long *)MMU::ARM7_REG)[0x210>>2]);
SetWindowText(GetDlgItem(hwnd, IDC_IPCSYNC), text);
sprintf(text, "%08X", ((unsigned long *)MMU::ARM7_REG)[0x180>>2]);//MMU::DMACycle[0][3]);//nds.ARM9.SPSR.bits.I);//((unsigned long *)MMU::ARM7_REG)[0x184>>2]);
SetWindowText(GetDlgItem(hwnd, IDC_IPCFIFO), text);
EndPaint(hwnd, &ps);
}
BOOL CALLBACK ioreg_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CWindow * win = (CWindow *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
return 1;
case WM_CLOSE :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_PAINT:
ioreg_OnPaint(hwnd, wParam, lParam);
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
}
return 0;
}
return 0;
}
--- NEW FILE: yopyop_private.rc ---
/* THIS FILE WILL BE OVERWRITTEN BY DEV-C++ */
/* DO NOT EDIT! */
#include <windows.h> // include for version info constants
#include "resources.rc"
//
// SUPPORT FOR WINDOWS XP THEMES:
// THIS WILL MAKE THE PROGRAM USE THE COMMON CONTROLS
// LIBRARY VERSION 6.0 (IF IT IS AVAILABLE)
//
1 24 "DeSmuME.exe.Manifest"
//
// TO CHANGE VERSION INFORMATION, EDIT PROJECT OPTIONS...
//
1 VERSIONINFO
FILEVERSION 0,0,0,1
PRODUCTVERSION 0,0,0,1
FILETYPE VFT_APP
{
BLOCK "StringFileInfo"
{
BLOCK "040C04E4"
{
VALUE "CompanyName", "yopyop"
VALUE "FileVersion", ""
VALUE "FileDescription", "NDS(tm) emulator"
VALUE "InternalName", ""
VALUE "LegalCopyright", ""
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", ""
VALUE "ProductName", "DeSmuME"
VALUE "ProductVersion", ""
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x040C, 1252
}
}
--- NEW FILE: oamView.h ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef OAMVIEW_H
#define OAMVIEW_H
#include "CWindow.hpp"
#include "GPU.hpp"
class oamView : public CWindow
{
public :
oamView(HINSTANCE hInst, HWND parent);
signed short num;
OAM * oam;
GPU * gpu;
};
extern void InitOAMViewBox();
#endif
--- NEW FILE: des_view.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef DES_VIEW_H
#define DES_VIEW_H
#include "../NDSSystem.hpp"
#include "../ARM_CPU.hpp"
#include "CWindow.hpp"
class CDesView : public CWindow
{
public :
CDesView(HINSTANCE hInst, HWND parent, char * titre, ARMCPU * CPU);
virtual void refresh();
unsigned long curr_ligne;
ARMCPU * cpu;
unsigned short mode;
};
void InitDesViewBox();
#endif
--- NEW FILE: DeSmuME.ico ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: DeSmuME.dev ---
[Project]
FileName=DeSmuME.dev
Name=DeSmuME
UnitCount=47
Type=0
Ver=1
ObjFiles=
Includes=
Libs=
PrivateResource=yopyop_private.rc
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=
IsCpp=1
Icon=
ExeOutput=
ObjectOutput=obj
OverrideOutput=0
OverrideOutputName=DeSmuME.exe
HostApplication=
Folders=EmuSRC,EmuSRC/CPU,EmuSRC/Desassembleur,EmuSRC/MMU,EmuSRC/NDSSys,Resources
CommandLine=
UseCustomMakefile=0
CustomMakefile=
IncludeVersionInfo=1
SupportXPThemes=1
CompilerSet=0
CompilerSettings=00000000010010000001ib
[Unit1]
FileName=main.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit2]
FileName=..\EmuSRC\MMU.cpp
CompileCpp=1
Folder=EmuSRC/MMU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[VersionInfo]
Major=0
Minor=0
Release=0
Build=1
LanguageID=1036
CharsetID=1252
CompanyName=yopyop
FileVersion=
FileDescription=NDS(tm) emulator
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=DeSmuME
ProductVersion=
AutoIncBuildNr=0
[Unit3]
FileName=..\EmuSRC\MMU.h
CompileCpp=1
Folder=EmuSRC/MMU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit4]
FileName=resource.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit5]
FileName=resources.rc
Folder=Resources
Compile=1
Link=0
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit6]
FileName=mem_view.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit7]
FileName=mem_view.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit8]
FileName=..\EmuSRC\ARM_CPU.cpp
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit9]
FileName=..\EmuSRC\ARM_CPU.h
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit10]
FileName=..\EmuSRC\arm_instructions.cpp
CompileCpp=0
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c arm_instructions.cpp -o obj/arm_instructions.o $(CFLAGS)
[Unit11]
FileName=..\EmuSRC\arm_instructions.h
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit12]
FileName=des_view.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit13]
FileName=des_view.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit14]
FileName=..\EmuSRC\Desassembleur.h
CompileCpp=1
Folder=EmuSRC/Desassembleur
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit15]
FileName=..\EmuSRC\Desassembleur.cpp
CompileCpp=0
Folder=EmuSRC/Desassembleur
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c Desassembleur.cpp -o obj/Desassembleur.o $(CFLAGS)
[Unit16]
FileName=..\EmuSRC\instruction_tabdef.inc
Folder=EmuSRC/CPU
Compile=0
Link=0
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit17]
FileName=..\EmuSRC\ICoProc.h
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit18]
FileName=..\EmuSRC\thumb_instructions.cpp
CompileCpp=0
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c thumb_instructions.cpp -o obj/thumb_instructions.o $(CFLAGS)
[Unit19]
FileName=..\EmuSRC\thumb_tabdef.inc
Folder=EmuSRC/CPU
Compile=0
Link=0
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit20]
FileName=..\EmuSRC\thumb_instructions.h
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit21]
FileName=..\EmuSRC\NDSSystem.cpp
CompileCpp=1
Folder=EmuSRC/NDSSys
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit22]
FileName=..\EmuSRC\NDSSystem.h
CompileCpp=1
Folder=EmuSRC/NDSSys
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit23]
FileName=ginfo.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit24]
FileName=ginfo.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit25]
FileName=..\EmuSRC\CP15.h
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit26]
FileName=..\EmuSRC\CP15.cpp
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit27]
FileName=..\EmuSRC\bios.cpp
CompileCpp=0
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c bios.cpp -o obj/bios.o $(CFLAGS)
[Unit28]
FileName=..\EmuSRC\bios.h
CompileCpp=1
Folder=EmuSRC/CPU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit29]
FileName=..\EmuSRC\FIFO.h
CompileCpp=1
Folder=EmuSRC/MMU
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit32]
FileName=..\EmuSRC\log.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit33]
FileName=..\EmuSRC\log.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit34]
FileName=palView.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit37]
FileName=CWindow.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit41]
FileName=mapView.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit42]
FileName=GPU.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit43]
FileName=GPU.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit46]
FileName=OGLRender.h
CompileCpp=1
Folder=DeSmuME
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit35]
FileName=palView.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit40]
FileName=mapView.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit44]
FileName=oamView.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit45]
FileName=oamView.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit47]
FileName=OGLRender.cpp
CompileCpp=1
Folder=DeSmuME
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit48]
FileName=mapView.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit49]
FileName=mapView.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit50]
FileName=GPU.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit51]
FileName=GPU.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit30]
FileName=IORegView.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit31]
FileName=IORegView.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit36]
FileName=CWindow.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit38]
FileName=tileView.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit39]
FileName=tileView.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
--- NEW FILE: oamView.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <tchar.h>
#include "resource.hpp"
#include "oamView.hpp"
#include "GPU.hpp"
#include "../EmuSRC/MMU.h"
const char dimm[4][4][8] =
{
{"8 x 8", "16 x 8", "8 x 16", "- x -"},
{"16 x 16", "32 x 8", "8 x 32", "- x -"},
{"32 x 32", "32 x 16", "16 x 32", "- x -"},
{"64 x 64", "64 x 32", "32 x 64", "- x -"},
};
LRESULT CALLBACK OAMViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitOAMViewBox()
{
WNDCLASSEX wc;
wc.cbSize = sizeof(wc);
wc.lpszClassName = _T("OAMViewBox");
wc.hInstance = GetModuleHandle(0);
wc.lpfnWndProc = OAMViewBoxWndProc;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
wc.style = 0;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof( CWindow * );
wc.hIconSm = 0;
RegisterClassEx(&wc);
}
LRESULT OAMViewBox_OnPaint(oamView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = GetDlgItem(win->hwnd, IDC_OAM_BOX);
HDC hdc;
PAINTSTRUCT ps;
TCHAR text[80];
RECT rect;
GetClientRect(hwnd, &rect);
int lg = rect.right - rect.left;
int ht = rect.bottom - rect.top;
hdc = BeginPaint(hwnd, &ps);
HDC mem_dc = CreateCompatibleDC(hdc);
HBITMAP mem_bmp = CreateCompatibleBitmap(hdc, lg, ht);
SelectObject(mem_dc, mem_bmp);
FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
BitBlt(hdc, 0, 0, lg, ht, mem_dc, 0, 0, SRCCOPY);
DeleteDC(mem_dc);
DeleteObject(mem_bmp);
EndPaint(hwnd, &ps);
}
LRESULT CALLBACK OAMViewBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
oamView * win = (oamView *)GetWindowLong(hwnd, 0);
switch(msg)
{
case WM_NCCREATE:
return 1;
case WM_NCDESTROY:
return 1;
/*case WM_PAINT:
OAMViewBox_OnPaint(win, wParam, lParam);
return 1;*/
case WM_ERASEBKGND:
return 1;
default:
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
LRESULT oamViewPaint(oamView * win, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = win->hwnd;
HDC hdc;
PAINTSTRUCT ps;
OAM * oam = win->oam + win->num;
char text[80];
unsigned short bitmap[256*192];
unsigned char prio[256*192];
BITMAPV4HEADER bmi;
//CreateBitmapIndirect(&bmi);
memset(&bmi, 0, sizeof(bmi));
bmi.bV4Size = sizeof(bmi);
bmi.bV4Planes = 1;
bmi.bV4BitCount = 16;
bmi.bV4V4Compression = BI_RGB|BI_BITFIELDS;
bmi.bV4RedMask = 0x001F;
bmi.bV4GreenMask = 0x03E0;
bmi.bV4BlueMask = 0x7C00;
bmi.bV4Width = 256;
bmi.bV4Height = -192;
for(unsigned short i = 0; i < 256*192; ++i)
{
bitmap[i] = 0x7F0F;
prio[i] = 4;
}
hdc = BeginPaint(hwnd, &ps);
sprintf(text, "OAM : %d", win->num);
SetWindowText(GetDlgItem(hwnd, IDC_OAMNUM), text);
switch(oam->attr0&(3<<10))
{
case 0 :
SetWindowText(GetDlgItem(hwnd, IDC_MODE), "Normal");
break;
case (1<<10) :
SetWindowText(GetDlgItem(hwnd, IDC_MODE), "Smi-transp");
break;
case (2<<10) :
SetWindowText(GetDlgItem(hwnd, IDC_MODE), "OBJ Window");
break;
case (3<<10) :
SetWindowText(GetDlgItem(hwnd, IDC_MODE), "Bitmap");
}
sprintf(text, "0x%08X", oam->attr0/*oam->attr2&0x3FF*/);
SetWindowText(GetDlgItem(hwnd, IDC_TILE), text);
sprintf(text, "0x%08X", oam->attr1/*oam->attr2&0x3FF*/);
SetWindowText(GetDlgItem(hwnd, IDC_PAL), text);
//SetWindowText(GetDlgItem(hwnd, IDC_PAL), (oam->attr0&(1<<13))?"256 couleurs": "16 couleurs");
sprintf(text, "%d 0x%08X", (oam->attr2>>10)&3, oam->attr2);
SetWindowText(GetDlgItem(hwnd, IDC_PRIO), text);
signed short x = oam->attr1&0x1FF;
x = ((signed short)(x<<7)>>7);
sprintf(text, "%d x %d", x, oam->attr0&0xFF);
SetWindowText(GetDlgItem(hwnd, IDC_COOR), text);
SetWindowText(GetDlgItem(hwnd, IDC_DIM), dimm[oam->attr1>>14][oam->attr0>>14]);
SetWindowText(GetDlgItem(hwnd, IDC_ROT), oam->attr0&(1<<8)?"ON" : "OFF");
SetWindowText(GetDlgItem(hwnd, IDC_MOS), oam->attr0&(1<<12)?"ON" : "OFF");
if(oam->attr0&(1<<8))
{
sprintf(text, "Rot param : %d", (oam->attr1>>9)&0x1F);
SetWindowText(GetDlgItem(hwnd, IDC_PROP0), text);
SetWindowText(GetDlgItem(hwnd, IDC_PROP1), (oam->attr0&(1<<9))?"Double size": "");
}
else
{
if(oam->attr0&(1<<9))
sprintf(text, "INVISIBLE");
else
sprintf(text, "%s %s", oam->attr0&(1<<12)?"H FLIP":"", oam->attr0&(1<<12)?"V FLIP":"");
SetWindowText(GetDlgItem(hwnd, IDC_PROP0), text);
SetWindowText(GetDlgItem(hwnd, IDC_PROP1), "");
}
for(unsigned short i = 0; i < 192; ++i)
{
win->gpu->spriteRender(win->gpu, i, bitmap + i*256, prio + i*256);
}
SetDIBitsToDevice(hdc, 180, 4, 256, 192, 0, 0, 0, 192, bitmap, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
EndPaint(hwnd, &ps);
}
BOOL CALLBACK oamView_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
oamView * win = (oamView *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
{
HWND combo = GetDlgItem(hwnd, IDC_SCR_SELECT);
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Main screen sprite");
SendMessage(combo, CB_ADDSTRING, 0,(LPARAM)"Sub screen sprite");
SendMessage(combo, CB_SETCURSEL, 0, 0);
}
return 1;
case WM_CLOSE :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_PAINT:
oamViewPaint(win, wParam, lParam);
return 1;
case WM_HSCROLL :
switch LOWORD(wParam)
{
case SB_LINERIGHT :
++(win->num);
if(win->num>127)
win->num = 127;
break;
case SB_LINELEFT :
--(win->num);
if(win->num<0)
win->num = 0;
break;
}
win->refresh();
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case IDC_SCR_SELECT :
switch(HIWORD(wParam))
{
case CBN_CLOSEUP :
{
unsigned long sel = SendMessage(GetDlgItem(hwnd, IDC_SCR_SELECT), CB_GETCURSEL, 0, 0);
switch(sel)
{
case 0 :
win->oam = (OAM *)MMU::ARM9_OAM;
win->num = 0;
win->gpu = nds.mainGPU;
break;
case 1 :
win->oam = (OAM *)(MMU::ARM9_OAM+0x400);
win->num = 0;
win->gpu = nds.subGPU;
break;
}
}
win->refresh();
return 1;
}
return 1;
}
return 0;
}
return 0;
}
oamView::oamView(HINSTANCE hInst, HWND parent) :
CWindow(hInst, parent, "OAM Viewer", IDD_OAM, oamView_proc), oam((OAM *)(MMU::ARM9_OAM)), num(0), gpu(nds.mainGPU)
{
SetWindowLong(GetDlgItem(hwnd, IDC_OAM_BOX), 0, (LONG)this);
}
--- NEW FILE: CWindow.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef CWINDOW_H
#define CWINDOW_H
#include <windows.h>
extern CRITICAL_SECTION section;
class CWindow
{
public :
CWindow() {}
CWindow(HINSTANCE hInst, const char * cname, const char * titre, int style, int sx, int sy, LRESULT CALLBACK (* wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
CWindow(HINSTANCE hInst, HWND parent, char * titre, int ID, BOOL CALLBACK (*wP) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
void show();
void hide();
void add2RefreshList();
void remove2RefreshList();
virtual void refresh();
HWND hwnd;
bool autoup;
CWindow * prec;
CWindow * suiv;
static inline void refreshALL()
{
EnterCriticalSection(§ion);
CWindow * aux = prems;
while(aux)
{
aux->refresh();
aux = aux->suiv;
}
LeaveCriticalSection(§ion);
}
private :
static CWindow * prems;
};
#endif
--- NEW FILE: ginfo.hpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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
*/
#ifndef GINFO_H
#define GINFO_H
BOOL CALLBACK ginfo_view_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
--- NEW FILE: palView.cpp ---
/* Copyright (C) 2006 yopyop
yopyop156@...
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 <windows.h>
#include "resource.hpp"
#include "palView.hpp"
#include "../MMU.hpp"
#include <stdio.h>
LRESULT palView_OnPaint(unsigned short * adr, unsigned short num, HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
HBRUSH brush;
unsigned short c;
char tmp[80];
rect.left = 3;
rect.top = 55;
rect.right = 13;
rect.bottom = 65;
hdc = BeginPaint(hwnd, &ps);
if(adr)
{
for(unsigned long y = 0; y < 16; ++y)
{
for(unsigned long 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);
}
BOOL CALLBACK palView_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
//ATTENTION null Ela creation donc la boite ne doit pas être visible a la création
CPalView * win = (CPalView *)GetWindowLong(hwnd, DWL_USER);
switch (message)
{
case WM_INITDIALOG :
{
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 :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case WM_PAINT:
palView_OnPaint(win->adr, win->palnum, hwnd, wParam, lParam);
return 1;
case WM_HSCROLL :
switch LOWORD(wParam)
{
case SB_LINERIGHT :
++(win->palnum);
if(win->palnum>15)
win->palnum = 15;
break;
case SB_LINELEFT :
--(win->palnum);
if(win->palnum<0)
win->palnum = 0;
break;
}
win->refresh();
return 1;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDC_FERMER :
win->remove2RefreshList();
delete win;
EndDialog(hwnd, 0);
return 1;
case IDC_AUTO_UPDATE :
if(win->autoup)
{
win->remove2RefreshList();
win->autoup = false;
return 1;
}
win->add2RefreshList();
win->autoup = true;
return 1;
case IDC_PAL_SELECT :
switch(HIWORD(wParam))
{
case CBN_CLOSEUP :
{
unsigned long sel = SendMessage(GetDlgItem(hwnd, IDC_PAL_SELECT), CB_GETCURSEL, 0, 0);
switch(sel)
{
case 0 :
win->adr = (unsigned short *)MMU::ARM9_VMEM;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), false);
break;
case 1 :
win->adr = ((unsigned short *)MMU::ARM9_VMEM) + 0x200;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), false);
break;
case 2 :
win->adr = (unsigned short *)MMU::ARM9_VMEM + 0x100;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), false);
break;
case 3 :
win->adr = ((unsigned short *)MMU::ARM9_VMEM) + 0x300;
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_HIDE);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), false);
break;
case 4 :
case 5 :
case 6 :
case 7 :
win->adr = ((unsigned short *)(MMU::ExtPal[0][sel-4]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), true);
break;
case 8 :
case 9 :
case 10 :
case 11 :
win->adr = ((unsigned short *)(MMU::ExtPal[1][sel-8]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), true);
break;
case 12 :
case 13 :
win->adr = ((unsigned short *)(MMU::ObjExtPal[0][sel-12]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), true);
break;
case 14 :
case 15 :
win->adr = ((unsigned short *)(MMU::ObjExtPal[1][sel-14]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), true);
break;
case 16 :
case 17 :
case 18 :
case 19 :
win->adr = ((unsigned short *)(MMU::texPalSlot[sel-16]));
win->palnum = 0;
ShowWindow(GetDlgItem(hwnd, IDC_SCROLLER), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, IDC_SCROLLER), true);
break;
default :
return 1;
}
win->refresh();
return 1;
}
}
return 1;
}
return 0;
}
return 0;
}
CPalView::CPalView(HINSTANCE hInst, HWND parent) :
CWindow(hInst, parent, "Palette viewer", IDD_PAL, palView_proc), palnum(0), adr(((unsigned short *)MMU::ARM9_VMEM))
{
}
--- NEW FILE: yopyop_private.hpp ---
/* THIS FILE WILL BE OVERWRITTEN BY DEV-C++ */
/* DO NOT EDIT ! */
#ifndef YOPYOP_PRIVATE_H
#define YOPYOP_PRIVATE_H
/* VERSION DEFINITIONS */
#define VER_STRING "0.0.0.1"
#define VER_MAJOR 0
#define VER_MINOR 0
#define VER_RELEASE 0
#define VER_BUILD 1
#define COMPANY_NAME "yopyop"
#define FILE_VERSION ""
#define FILE_DESCRIPTION "NDS(tm) emulator"
#define INTERNAL_NAME ""
#define LEGAL_COPYRIGHT ""
#define LEGAL_TRADEMARKS ""
#define ORIGINAL_FILENAME ""
#define PRODUCT_NAME "DeSmuME"
#define PRODUCT_VERSION ""
#endif /*YOPYOP_PRIVATE_H*/
|