mirror of https://github.com/PCSX2/pcsx2.git
wxGui branch: Removed several unneeded files from the Win32 builds (removing them since I can reference them from trunk, and if they're deleted I won't have to spend time merging possible changes and stuff later).
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@907 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
cffa379f9c
commit
915c827a63
|
@ -1,73 +0,0 @@
|
||||||
/* Pcsx2 - Pc Ps2 Emulator
|
|
||||||
* Copyright (C) 2002-2009 Pcsx2 Team
|
|
||||||
*
|
|
||||||
* This program 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.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Win32.h"
|
|
||||||
|
|
||||||
#include "AboutDlg.h"
|
|
||||||
#include "Common.h"
|
|
||||||
|
|
||||||
#include "Hyperlinks.h"
|
|
||||||
|
|
||||||
#define IDC_STATIC (-1)
|
|
||||||
|
|
||||||
static HWND hW;
|
|
||||||
static HBITMAP hSilverBMP;
|
|
||||||
|
|
||||||
LRESULT WINAPI AboutDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
switch(uMsg)
|
|
||||||
{
|
|
||||||
case WM_INITDIALOG:
|
|
||||||
hSilverBMP = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_PS2SILVER));
|
|
||||||
|
|
||||||
SetWindowText(hDlg, "About PCSX2");
|
|
||||||
|
|
||||||
Button_SetText(GetDlgItem(hDlg, IDOK), "OK");
|
|
||||||
Static_SetText(GetDlgItem(hDlg, IDC_PCSX_ABOUT_AUTHORS), LabelAuthors);
|
|
||||||
Static_SetText(GetDlgItem(hDlg, IDC_PCSX_ABOUT_GREETS), LabelGreets);
|
|
||||||
|
|
||||||
ConvertStaticToHyperlink( hDlg, IDC_LINK_GOOGLECODE );
|
|
||||||
ConvertStaticToHyperlink( hDlg, IDC_LINK_WEBSITE );
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
|
||||||
switch(wParam)
|
|
||||||
{
|
|
||||||
case IDOK:
|
|
||||||
EndDialog( hDlg, TRUE );
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case IDC_LINK_WEBSITE:
|
|
||||||
ShellExecute(hDlg, "open", "http://www.pcsx2.net/",
|
|
||||||
NULL, NULL, SW_SHOWNORMAL);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case IDC_LINK_GOOGLECODE:
|
|
||||||
ShellExecute(hDlg, "open", "http://code.google.com/p/pcsx2",
|
|
||||||
NULL, NULL, SW_SHOWNORMAL);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
case WM_CLOSE:
|
|
||||||
EndDialog( hDlg, TRUE );
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
/* Pcsx2 - Pc Ps2 Emulator
|
|
||||||
* Copyright (C) 2002-2009 Pcsx2 Team
|
|
||||||
*
|
|
||||||
* This program 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.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _PCSX2_ABOUTDLG_H_
|
|
||||||
#define _PCSX2_ABOUTDLG_H_
|
|
||||||
|
|
||||||
//LRESULT WINAPI AboutDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "Win32.h"
|
#include "Win32.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "libintlmsc.h"
|
|
||||||
|
|
||||||
#include "System.h"
|
#include "System.h"
|
||||||
#include "McdsDlg.h"
|
#include "McdsDlg.h"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,373 +0,0 @@
|
||||||
/* Pcsx2 - Pc Ps2 Emulator
|
|
||||||
* Copyright (C) 2002-2009 Pcsx2 Team
|
|
||||||
*
|
|
||||||
* This program 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.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Win32.h"
|
|
||||||
|
|
||||||
#include "Debugger.h"
|
|
||||||
#include "RDebugger.h"
|
|
||||||
#include "Common.h"
|
|
||||||
#include "R3000A.h"
|
|
||||||
#include "../rdebug/deci2.h"
|
|
||||||
|
|
||||||
u32 port=8510;
|
|
||||||
SOCKET serversocket, remote;
|
|
||||||
char message[1024]; //message to add to listbox
|
|
||||||
|
|
||||||
volatile long runStatus=STOP;
|
|
||||||
int runCode=0, runCount=1;
|
|
||||||
Threading::Semaphore* runEvent = NULL;
|
|
||||||
|
|
||||||
DECI2_DBGP_BRK ebrk[32],
|
|
||||||
ibrk[32];
|
|
||||||
int ebrk_count=0,
|
|
||||||
ibrk_count=0;
|
|
||||||
|
|
||||||
int debuggedCpu=0; //default is to debug EE cpu; IOP=1
|
|
||||||
u32 breakAddress=0; //disabled; ie. you cannot use address 0 for a breakpoint
|
|
||||||
u32 breakCycle=0; //disabled; ie. you cannot stop after 0 cycles
|
|
||||||
|
|
||||||
int CreateSocket(HWND hDlg, int port){
|
|
||||||
WSADATA wsadata;
|
|
||||||
SOCKADDR_IN saServer;
|
|
||||||
|
|
||||||
if (WSAStartup( MAKEWORD(1, 1), &wsadata) ||
|
|
||||||
((serversocket=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))==INVALID_SOCKET)){
|
|
||||||
MessageBox(hDlg, "Could not create socket\n[Is TCP/IP installed? WinSock 1.1 or above?]", 0, MB_OK);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
sprintf(message, "[PCSX2] %s status=%s", wsadata.szDescription, wsadata.szSystemStatus);
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), message);
|
|
||||||
|
|
||||||
saServer.sin_family = AF_INET;
|
|
||||||
saServer.sin_addr.S_un.S_addr = INADDR_ANY; // accept any address
|
|
||||||
saServer.sin_port = htons(port); // port to listen to
|
|
||||||
|
|
||||||
if (bind(serversocket, (LPSOCKADDR)&saServer, sizeof(struct sockaddr))==SOCKET_ERROR){
|
|
||||||
sprintf(message, "Could not bind to port %d\n"
|
|
||||||
"[Is there another server running on that port?]", port);
|
|
||||||
MessageBox(hDlg, message, 0, MB_OK);
|
|
||||||
closesocket(serversocket);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
sprintf(message, "[PCSX2] Port %d is opened", port);
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), message);
|
|
||||||
|
|
||||||
// SOMAXCONN connections in queque? maybe 1 is enough...
|
|
||||||
if (listen(serversocket, SOMAXCONN) == SOCKET_ERROR){
|
|
||||||
sprintf(message, "Listening for a connection failed\n"
|
|
||||||
"[dunno?]");
|
|
||||||
MessageBox(hDlg, message, 0, MB_OK);
|
|
||||||
closesocket(serversocket);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
sprintf(message, "[PCSX2] Listening for a connection to establish...");
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), message);
|
|
||||||
|
|
||||||
cpuRegs.CP0.n.EPC=cpuRegs.pc;
|
|
||||||
psxRegs.CP0.n.EPC=psxRegs.pc;
|
|
||||||
sprintf(message, "%08X", cpuRegs.pc);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_EEPC), message);
|
|
||||||
sprintf(message, "%08X", psxRegs.pc);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_IOPPC), message);
|
|
||||||
sprintf(message, "%d", cpuRegs.cycle);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_EECYCLE), message);
|
|
||||||
sprintf(message, "%d", psxRegs.cycle);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_IOPCYCLE), message);
|
|
||||||
Button_SetCheck(GetDlgItem(hDlg, IDC_DEBUGEE), (debuggedCpu==0));
|
|
||||||
Button_SetCheck(GetDlgItem(hDlg, IDC_DEBUGIOP), (debuggedCpu==1));
|
|
||||||
Edit_LimitText(GetDlgItem(hDlg, IDC_STOPAT), 8); //8 hex digits
|
|
||||||
Edit_LimitText(GetDlgItem(hDlg, IDC_STOPAFTER), 10);//10 decimal digits
|
|
||||||
sprintf(message, "%08X", breakAddress);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_STOPAT), message);
|
|
||||||
sprintf(message, "%d", breakCycle);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_STOPAFTER), message);
|
|
||||||
|
|
||||||
Button_Enable(GetDlgItem(hDlg, IDC_DEBUGIOP), FALSE);////////////////////////
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int readData(u8 *buffer){
|
|
||||||
int r, count=0;
|
|
||||||
u8 *p=buffer;
|
|
||||||
|
|
||||||
memset(buffer, 0, BUFFERSIZE);
|
|
||||||
while (((count+= r = recv(remote, (char*)p, BUFFERSIZE, 0))!=INVALID_SOCKET) &&
|
|
||||||
(count<*(u16*)buffer))
|
|
||||||
p+=r;
|
|
||||||
|
|
||||||
if (r==INVALID_SOCKET)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
int writeData(const u8 *result){
|
|
||||||
int r;/*, i;
|
|
||||||
static char l[300], p[10];
|
|
||||||
DECI2_HEADER *header=(DECI2_HEADER*)result;
|
|
||||||
*/
|
|
||||||
r = send(remote, (const char*)result, *(u16*)result, 0);
|
|
||||||
if (r==SOCKET_ERROR)
|
|
||||||
return 0;
|
|
||||||
/*
|
|
||||||
sprintf(l, "size=%d, src=%c dst=%c proto=0x%04X ",
|
|
||||||
header->length-8, header->source, header->destination, header->protocol);
|
|
||||||
for (i=8; i<*(u16*)result; i++){
|
|
||||||
sprintf(p, "%02X ", result[i]);
|
|
||||||
strcat(l, p);
|
|
||||||
}
|
|
||||||
Msgbox::Alert(l);
|
|
||||||
*/
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD WINAPI ServingFunction(LPVOID lpParam){
|
|
||||||
static u8 buffer[BUFFERSIZE], //a big buffer
|
|
||||||
result[BUFFERSIZE]; //a big buffer
|
|
||||||
static TCHAR eepc[9], ioppc[9], eecy[15], iopcy[15];
|
|
||||||
SOCKADDR_IN saClient;
|
|
||||||
HWND hDlg=(HWND)lpParam;
|
|
||||||
int size=sizeof(struct sockaddr);
|
|
||||||
int exit=FALSE;
|
|
||||||
|
|
||||||
if ((remote = accept(serversocket, (struct sockaddr*)&saClient, &size))==INVALID_SOCKET){
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), "[PCSX2] Commmunication lost. THE END");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
sprintf(message, "[PCSX2] Connected to %d.%d.%d.%d on remote port %d",
|
|
||||||
saClient.sin_addr.S_un.S_un_b.s_b1,
|
|
||||||
saClient.sin_addr.S_un.S_un_b.s_b2,
|
|
||||||
saClient.sin_addr.S_un.S_un_b.s_b3,
|
|
||||||
saClient.sin_addr.S_un.S_un_b.s_b4,
|
|
||||||
saClient.sin_port);
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), message);
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), "[PCSX2] Start serving...");
|
|
||||||
connected=1;//from this point on, all log stuff goes to ttyp
|
|
||||||
|
|
||||||
//sendBREAK('E', 0, 0xff, 0x21, 1); //do not enable this unless you know what you are doing!
|
|
||||||
while (!exit && readData(buffer)){
|
|
||||||
DECI2_HEADER *header=(DECI2_HEADER*)buffer;
|
|
||||||
|
|
||||||
switch(header->protocol){
|
|
||||||
case 0x0000:exit=TRUE; break;
|
|
||||||
case PROTO_DCMP:D2_DCMP(buffer, result, message); break;
|
|
||||||
// case 0x0120:D2_DRFP_EE(buffer, result, message); break;
|
|
||||||
// case 0x0121:D2_DRFP_IOP(buffer, result, message); break;
|
|
||||||
// case 0x0122:break;
|
|
||||||
case PROTO_IDBGP:D2_DBGP(buffer, result, message, eepc, ioppc, eecy, iopcy); break;
|
|
||||||
// case 0x0140:break;
|
|
||||||
case PROTO_ILOADP:D2_ILOADP(buffer, result, message); break;
|
|
||||||
case PROTO_EDBGP:D2_DBGP(buffer, result, message, eepc, ioppc, eecy, iopcy);break;
|
|
||||||
// case 0x0240:break;
|
|
||||||
case PROTO_NETMP:D2_NETMP(buffer, result, message); break;
|
|
||||||
default:
|
|
||||||
sprintf(message, "[DECI2 %c->%c/%04X] Protocol=0x%04X",
|
|
||||||
header->source, header->destination,
|
|
||||||
header->length, header->protocol);
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), message);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (exit==FALSE){
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), message);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_EEPC), eepc);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_IOPPC), ioppc);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_EECYCLE), eecy);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_IOPCYCLE), iopcy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
connected=0;
|
|
||||||
|
|
||||||
ListBox_AddString(GetDlgItem(hDlg, IDC_COMMUNICATION), "[PCSX2] Connection closed. THE END");
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD WINAPI Run2(LPVOID lpParam){
|
|
||||||
HWND hDlg=(HWND)lpParam;
|
|
||||||
static char pc[9];
|
|
||||||
int i;
|
|
||||||
|
|
||||||
while (1){
|
|
||||||
if (runStatus==RUN){
|
|
||||||
const u32 opcode = memRead32(cpuRegs.pc);
|
|
||||||
if (opcode==0x0000000D){
|
|
||||||
sendBREAK('E', 0, runCode, 0x22, runCount);
|
|
||||||
InterlockedExchange(&runStatus, STOP);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((runCode==2) && (//next
|
|
||||||
((opcode & 0xFC000000)==0x0C000000) ||//JAL
|
|
||||||
((opcode & 0xFC00003F)==0x00000009) ||//JALR
|
|
||||||
((opcode & 0xFC00003F)==0x0000000C) //SYSCALL
|
|
||||||
)){u32 tmppc=cpuRegs.pc, skip=(opcode & 0xFC00003F)==0x0000000C ? 4 : 8;
|
|
||||||
while (cpuRegs.pc!=tmppc+skip)
|
|
||||||
Cpu->Step();
|
|
||||||
}else
|
|
||||||
Cpu->Step(); //use this with breakpoints & step-by-step
|
|
||||||
// Cpu->ExecuteBlock(); //use this to run faster, but not for stepping
|
|
||||||
// sprintf(pc, "%08X", cpuRegs.pc);Edit_SetText(GetDlgItem(hDlg, IDC_EEPC), pc);
|
|
||||||
// sprintf(pc, "%08X", psxRegs.pc);Edit_SetText(GetDlgItem(hDlg, IDC_IOPPC), pc);
|
|
||||||
// sprintf(pc, "%d", cpuRegs.cycle);Edit_SetText(GetDlgItem(hDlg, IDC_EECYCLE), pc);
|
|
||||||
// sprintf(pc, "%d", psxRegs.cycle);Edit_SetText(GetDlgItem(hDlg, IDC_IOPCYCLE), pc);
|
|
||||||
if (runCount!=0 && --runCount==0){
|
|
||||||
sendBREAK('E', 0, runCode, 0x23, runCount);
|
|
||||||
InterlockedExchange(&runStatus, STOP);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((breakAddress) && (breakAddress==cpuRegs.pc)){
|
|
||||||
sendBREAK('E', 0, runCode, 0x21, runCount);
|
|
||||||
InterlockedExchange(&runStatus, STOP);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((breakCycle) && (breakCycle==cpuRegs.cycle)){
|
|
||||||
sendBREAK('E', 0, runCode, 0x21, runCount);
|
|
||||||
InterlockedExchange(&runStatus, STOP);
|
|
||||||
breakCycle=0;
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_STOPAFTER), "0");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (i=0; i<ebrk_count; i++)
|
|
||||||
if (cpuRegs.pc==ebrk[i].address && ebrk[i].count!=0){
|
|
||||||
if (ebrk[i].count==0xFFFFFFFF || (--ebrk[i].count)==0){
|
|
||||||
sendBREAK('E', 0, runCode, 0x22, runCount);
|
|
||||||
InterlockedExchange(&runStatus, STOP);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
cpuRegs.CP0.n.EPC=cpuRegs.pc;
|
|
||||||
psxRegs.CP0.n.EPC=psxRegs.pc;
|
|
||||||
runEvent->Wait();
|
|
||||||
//WaitForSingleObject(runEvent, INFINITE);
|
|
||||||
runStatus=RUN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE; //never get here
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT WINAPI RemoteDebuggerProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){
|
|
||||||
static HANDLE th=NULL, runth=NULL;
|
|
||||||
static DWORD thid=0;
|
|
||||||
|
|
||||||
switch(uMsg){
|
|
||||||
case WM_INITDIALOG:
|
|
||||||
ShowCursor(TRUE);
|
|
||||||
//open socket & thread
|
|
||||||
ListBox_SetHorizontalExtent(GetDlgItem(hDlg, IDC_COMMUNICATION), 1700);
|
|
||||||
if (CreateSocket(hDlg, port)==FALSE){
|
|
||||||
ClosePlugins( false );
|
|
||||||
EndDialog(hDlg, FALSE );
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
connected=0;
|
|
||||||
th=CreateThread(NULL, 0, ServingFunction, (LPVOID)hDlg,
|
|
||||||
CREATE_SUSPENDED, &thid);
|
|
||||||
runth=CreateThread(NULL, 0, Run2, (LPVOID)hDlg,
|
|
||||||
CREATE_SUSPENDED, &thid);
|
|
||||||
runEvent = new Threading::Semaphore();
|
|
||||||
if (th==NULL || runth==NULL ){
|
|
||||||
MessageBox(hDlg, _("Could not create threads or event"), 0, MB_OK);
|
|
||||||
connected=0;
|
|
||||||
closesocket(serversocket);
|
|
||||||
ClosePlugins( false );
|
|
||||||
EndDialog(hDlg, FALSE );
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
ResumeThread(runth);
|
|
||||||
ResumeThread(th);//run, baby, run...
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
|
||||||
if ((HIWORD (wParam) == EN_CHANGE) &&
|
|
||||||
((LOWORD(wParam)==IDC_STOPAT)||(LOWORD(wParam)==IDC_STOPAFTER))){
|
|
||||||
if (LOWORD(wParam)==IDC_STOPAT){char at[8+1]; int i;
|
|
||||||
Edit_GetText((HWND)lParam, at, 8+1);
|
|
||||||
sscanf (at, "%08X", &breakAddress);
|
|
||||||
for (i=0; at[i]; i++)
|
|
||||||
if (!isxdigit(at[i])){
|
|
||||||
sprintf(at, "%08X", breakAddress);
|
|
||||||
Edit_SetText((HWND)lParam, at);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}else{char cycle[10+1];
|
|
||||||
Edit_GetText((HWND)lParam, cycle, 10+1);
|
|
||||||
sscanf (cycle, "%d", &breakCycle);
|
|
||||||
}
|
|
||||||
}else
|
|
||||||
switch(wParam){
|
|
||||||
case IDC_DEBUGEE:
|
|
||||||
debuggedCpu=0;
|
|
||||||
MessageBox(hDlg, _("In debugger:\nPut EE in stop state\nand IOP in run state"), _("Notice on debugging EE"), 0);
|
|
||||||
break;
|
|
||||||
case IDC_DEBUGIOP:
|
|
||||||
debuggedCpu=1;
|
|
||||||
MessageBox(hDlg, _("In debugger:\nPut IOP in stop state\nand EE in run state"), _("Notice on debugging IOP"), 0);
|
|
||||||
break;
|
|
||||||
case IDC_CLEAR:
|
|
||||||
ListBox_ResetContent(GetDlgItem(hDlg, IDC_COMMUNICATION));
|
|
||||||
break;
|
|
||||||
case IDOK:
|
|
||||||
//close socket and stuff
|
|
||||||
connected=0;
|
|
||||||
CloseHandle(th);
|
|
||||||
CloseHandle(runth);
|
|
||||||
safe_delete( runEvent );
|
|
||||||
closesocket(serversocket);
|
|
||||||
WSACleanup();
|
|
||||||
ClosePlugins( false );
|
|
||||||
EndDialog(hDlg, TRUE );
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT WINAPI RemoteDebuggerParamsProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){
|
|
||||||
char strport[6+1];//short value
|
|
||||||
|
|
||||||
switch(uMsg){
|
|
||||||
case WM_INITDIALOG:{
|
|
||||||
ShowCursor(TRUE);
|
|
||||||
sprintf(strport, "%d", port);
|
|
||||||
Edit_LimitText(GetDlgItem(hDlg, IDC_PORT), 5);
|
|
||||||
Edit_SetText(GetDlgItem(hDlg, IDC_PORT), strport);
|
|
||||||
Button_Enable(GetDlgItem(hDlg, IDC_DEBUGBIOS), TRUE);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
|
||||||
switch(wParam){
|
|
||||||
case IDOK:
|
|
||||||
Edit_GetText(GetDlgItem(hDlg, IDC_PORT), strport, 6);
|
|
||||||
strport[5]=0;
|
|
||||||
port=atol(strport);
|
|
||||||
port=std::min(port,(u32)65535);
|
|
||||||
|
|
||||||
EndDialog(hDlg, (Button_GetCheck(GetDlgItem(hDlg, IDC_DEBUGBIOS))!=0)+1);
|
|
||||||
return TRUE;
|
|
||||||
case IDCANCEL:
|
|
||||||
EndDialog(hDlg, FALSE);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/* Pcsx2 - Pc Ps2 Emulator
|
|
||||||
* Copyright (C) 2002-2009 Pcsx2 Team
|
|
||||||
*
|
|
||||||
* This program 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.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "RedtapeWindows.h"
|
|
||||||
#include <commdlg.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#define BUFFERSIZE (128*1024)
|
|
||||||
|
|
||||||
extern LRESULT WINAPI RemoteDebuggerParamsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
|
||||||
extern LRESULT WINAPI RemoteDebuggerProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
@ -274,38 +274,6 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="OldGUI"
|
Name="OldGUI"
|
||||||
>
|
>
|
||||||
<File
|
|
||||||
RelativePath="..\AboutDlg.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
PrecompiledHeaderThrough="Win32.h"
|
|
||||||
PrecompiledHeaderFile="$(IntDir)\win32.pch"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Devel|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
PrecompiledHeaderThrough="Win32.h"
|
|
||||||
PrecompiledHeaderFile="$(IntDir)\win32.pch"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\AdvancedDlg.cpp"
|
RelativePath="..\AdvancedDlg.cpp"
|
||||||
>
|
>
|
||||||
|
@ -372,10 +340,6 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\gnuLanguages.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\HacksDlg.cpp"
|
RelativePath="..\HacksDlg.cpp"
|
||||||
>
|
>
|
||||||
|
@ -486,38 +450,6 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\RDebugger.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
PrecompiledHeaderThrough="Win32.h"
|
|
||||||
PrecompiledHeaderFile="$(IntDir)\win32.pch"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Devel|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
PrecompiledHeaderThrough="Win32.h"
|
|
||||||
PrecompiledHeaderFile="$(IntDir)\win32.pch"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\WindowsPCH.cpp"
|
RelativePath="..\WindowsPCH.cpp"
|
||||||
>
|
>
|
||||||
|
@ -542,38 +474,6 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\WinMain.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
PrecompiledHeaderThrough="Win32.h"
|
|
||||||
PrecompiledHeaderFile="$(IntDir)\win32.pch"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Devel|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
PrecompiledHeaderThrough="Win32.h"
|
|
||||||
PrecompiledHeaderFile="$(IntDir)\win32.pch"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
ExcludedFromBuild="true"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\WinSysExec.cpp"
|
RelativePath="..\WinSysExec.cpp"
|
||||||
>
|
>
|
||||||
|
@ -697,10 +597,6 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="Include"
|
Name="Include"
|
||||||
>
|
>
|
||||||
<File
|
|
||||||
RelativePath="..\AboutDlg.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\HostGui.h"
|
RelativePath="..\..\HostGui.h"
|
||||||
>
|
>
|
||||||
|
@ -713,10 +609,6 @@
|
||||||
RelativePath="..\McdsDlg.h"
|
RelativePath="..\McdsDlg.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\RDebugger.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\resource.h"
|
RelativePath="..\resource.h"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,144 +0,0 @@
|
||||||
/* Pcsx2 - Pc Ps2 Emulator
|
|
||||||
* Copyright (C) 2002-2009 Pcsx2 Team
|
|
||||||
*
|
|
||||||
* This program 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.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Win32.h"
|
|
||||||
|
|
||||||
#include "System.h"
|
|
||||||
#include "DebugTools/Debug.h"
|
|
||||||
|
|
||||||
namespace Console
|
|
||||||
{
|
|
||||||
static HANDLE hConsole = NULL;
|
|
||||||
|
|
||||||
static const int tbl_color_codes[] =
|
|
||||||
{
|
|
||||||
0 // black
|
|
||||||
, FOREGROUND_RED | FOREGROUND_INTENSITY
|
|
||||||
, FOREGROUND_GREEN | FOREGROUND_INTENSITY
|
|
||||||
, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
|
|
||||||
, FOREGROUND_BLUE | FOREGROUND_INTENSITY
|
|
||||||
, FOREGROUND_RED | FOREGROUND_BLUE
|
|
||||||
, FOREGROUND_GREEN | FOREGROUND_BLUE
|
|
||||||
, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
|
|
||||||
};
|
|
||||||
|
|
||||||
void SetTitle( const string& title )
|
|
||||||
{
|
|
||||||
if( !hConsole ) return;
|
|
||||||
SetConsoleTitle( title.c_str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Open()
|
|
||||||
{
|
|
||||||
COORD csize;
|
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
|
||||||
SMALL_RECT srect;
|
|
||||||
|
|
||||||
if( hConsole ) return;
|
|
||||||
AllocConsole();
|
|
||||||
SetConsoleTitle(_("Ps2 Output"));
|
|
||||||
|
|
||||||
csize.X = 100;
|
|
||||||
csize.Y = 2048;
|
|
||||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), csize);
|
|
||||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbiInfo);
|
|
||||||
|
|
||||||
srect = csbiInfo.srWindow;
|
|
||||||
srect.Right = srect.Left + 99;
|
|
||||||
srect.Bottom = srect.Top + 64;
|
|
||||||
SetConsoleWindowInfo(GetStdHandle(STD_OUTPUT_HANDLE), TRUE, &srect);
|
|
||||||
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Close()
|
|
||||||
{
|
|
||||||
if( hConsole == NULL ) return;
|
|
||||||
FreeConsole();
|
|
||||||
hConsole = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline void __fastcall SetColor( Colors color )
|
|
||||||
{
|
|
||||||
SetConsoleTextAttribute( hConsole, tbl_color_codes[color] );
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline void ClearColor()
|
|
||||||
{
|
|
||||||
SetConsoleTextAttribute( hConsole,
|
|
||||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Writes a newline to the console.
|
|
||||||
__forceinline bool __fastcall Newline()
|
|
||||||
{
|
|
||||||
if (hConsole != NULL)
|
|
||||||
{
|
|
||||||
DWORD tmp;
|
|
||||||
WriteConsole(hConsole, "\r\n", 2, &tmp, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (emuLog != NULL)
|
|
||||||
{
|
|
||||||
fputs("\n", emuLog);
|
|
||||||
fflush( emuLog );
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Writes an unformatted string of text to the console (fast!)
|
|
||||||
// No newline is appended.
|
|
||||||
__forceinline bool __fastcall Write( const char* fmt )
|
|
||||||
{
|
|
||||||
if (hConsole != NULL)
|
|
||||||
{
|
|
||||||
DWORD tmp;
|
|
||||||
WriteConsole(hConsole, fmt, (DWORD)strlen(fmt), &tmp, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No flushing here -- only flush after newlines.
|
|
||||||
if (emuLog != NULL)
|
|
||||||
fputs(fmt, emuLog);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Msgbox
|
|
||||||
{
|
|
||||||
bool Alert( const char* fmt )
|
|
||||||
{
|
|
||||||
MessageBox(0, fmt, _("Pcsx2 Msg"), 0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pops up an alert Dialog Box.
|
|
||||||
// Replacement for SysMessage.
|
|
||||||
bool Alert( const char* fmt, VARG_PARAM dummy, ... )
|
|
||||||
{
|
|
||||||
varg_assert();
|
|
||||||
|
|
||||||
va_list list;
|
|
||||||
va_start(list,dummy);
|
|
||||||
MessageBox(0, vfmt_string(fmt,list).c_str(), _("Pcsx2 Msg"), 0);
|
|
||||||
va_end(list);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
/* Pcsx2 - Pc Ps2 Emulator
|
|
||||||
* Copyright (C) 2002-2009 Pcsx2 Team
|
|
||||||
*
|
|
||||||
* This program 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.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
|
||||||
#include "win32.h"
|
|
||||||
|
|
||||||
// Antiquated gnu gettext version of languaging. I'm going to make my own --air
|
|
||||||
|
|
||||||
WIN32_FIND_DATA lFindData;
|
|
||||||
HANDLE lFind;
|
|
||||||
int lFirst;
|
|
||||||
|
|
||||||
void InitLanguages() {
|
|
||||||
lFind = FindFirstFile("Langs\\*", &lFindData);
|
|
||||||
lFirst = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *GetLanguageNext() {
|
|
||||||
for (;;) {
|
|
||||||
if (!strcmp(lFindData.cFileName, ".")) {
|
|
||||||
if (FindNextFile(lFind, &lFindData) == FALSE)
|
|
||||||
return NULL;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(lFindData.cFileName, "..")) {
|
|
||||||
if (FindNextFile(lFind, &lFindData) == FALSE)
|
|
||||||
return NULL;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (lFirst == 0) {
|
|
||||||
if (FindNextFile(lFind, &lFindData) == FALSE)
|
|
||||||
return NULL;
|
|
||||||
} else lFirst = 0;
|
|
||||||
if (lFind==INVALID_HANDLE_VALUE) return NULL;
|
|
||||||
|
|
||||||
return lFindData.cFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloseLanguages() {
|
|
||||||
if (lFind!=INVALID_HANDLE_VALUE) FindClose(lFind);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChangeLanguage(char *lang) {
|
|
||||||
strcpy_s(Config.Lang, lang);
|
|
||||||
SaveConfig();
|
|
||||||
LoadConfig();
|
|
||||||
}
|
|
Binary file not shown.
|
@ -1,116 +0,0 @@
|
||||||
/* This file is part of a Windows32 DLL Interface to:
|
|
||||||
GNU gettext - internationalization aids
|
|
||||||
Copyright (C) 1996, 1998 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file was written by Franco Bez <franco.bez@gmx.de>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program 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 Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
||||||
|
|
||||||
/* REPLACEMENT FOR ORIGINAL LIBINTL.H for use with Windows32 */
|
|
||||||
|
|
||||||
#if !defined(__LIBINTL_H_INCLUDED)
|
|
||||||
#define __LIBINTL_H_INCLUDED
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* See if we allready know what we want static or dll linkage or none at all*/
|
|
||||||
#if defined DONT_USE_GETTEXT || ( defined USE_SAFE_GETTEXT_DLL && defined USE_GETTEXT_STATIC ) || ( defined USE_GETTEXT_DLL && defined USE_SAFE_GETTEXT_DLL ) || ( defined USE_GETTEXT_DLL && defined USE_GETTEXT_STATIC )
|
|
||||||
/* TWO IS HARDLY POSSIBLE */
|
|
||||||
#undef USE_GETTEXT_DLL
|
|
||||||
#undef USE_GETTEXT_STATIC
|
|
||||||
#undef USE_SAFE_GETTEXT_DLL
|
|
||||||
#endif /* MORE THAN ONE - OR NONE AT ALL */
|
|
||||||
|
|
||||||
#if !defined USE_GETTEXT_DLL && !defined USE_SAFE_GETTEXT_DLL && !defined USE_GETTEXT_STATIC && !defined DONT_USE_GETTEXT
|
|
||||||
/* not explicitly defined so try to guess it -
|
|
||||||
if GNUC is used - we use static linkage by default
|
|
||||||
because at the moment this is the only plattform
|
|
||||||
for which a static lib is available
|
|
||||||
else we use the DLL built with GNUC */
|
|
||||||
# if defined __GNUC__
|
|
||||||
# define USE_GETTEXT_STATIC
|
|
||||||
# else
|
|
||||||
# define USE_GETTEXT_DLL
|
|
||||||
# endif /* __GNUC__ */
|
|
||||||
#endif /* NONE */
|
|
||||||
|
|
||||||
/* NOW ONLY ONE OF
|
|
||||||
DONT_USE_GETTEXT , USE_GETTEXT_DLL , USE_SAFE_GETTEXT_DLL , USE_GETTEXT_STATIC
|
|
||||||
IS DEFINED */
|
|
||||||
|
|
||||||
#if defined USE_GETTEXT_DLL
|
|
||||||
/* exported functions in DLL gnu_gettext.dll
|
|
||||||
you should link with import library
|
|
||||||
-lgnu_gettext (for mingw32) OR gnu_gettext.lib (MSVC) */
|
|
||||||
__declspec(dllimport) char *gettext(const char *__msgid);
|
|
||||||
__declspec(dllimport) char *dgettext(const char *__domainname,const char *__msgid);
|
|
||||||
__declspec(dllimport) char *dcgettext(const char *__domainname,const char *__msgid, int __category);
|
|
||||||
__declspec(dllimport) char *textdomain(const char *__domainname);
|
|
||||||
__declspec(dllimport) char *bindtextdomain(const char *__domainname,const char *__dirname);
|
|
||||||
/* calling _putenv from within the DLL */
|
|
||||||
__declspec(dllexport) int gettext_putenv(const char *envstring);
|
|
||||||
#endif /* DLL */
|
|
||||||
|
|
||||||
#if defined USE_SAFE_GETTEXT_DLL
|
|
||||||
/* Uses DLL gnu_gettext.dll ONLY if present, otherwise NO translation will take place
|
|
||||||
you should link with "safe_gettext_dll.o -lstdc++" see README for safe_gettext_dll for Details */
|
|
||||||
/* The safe gettext functions */
|
|
||||||
extern char *gettext(const char *szMsgId);
|
|
||||||
extern char *dgettext(const char *szDomain,const char *szMsgId);
|
|
||||||
extern char *dcgettext(const char *szDomain,const char *szMsgId,int iCategory);
|
|
||||||
extern char *textdomain(const char *szDomain);
|
|
||||||
extern char *bindtextdomain(const char *szDomain,const char *szDirectory);
|
|
||||||
/* calling _putenv from within the DLL */
|
|
||||||
extern int gettext_putenv(const char *envstring);
|
|
||||||
#endif /* SAFE DLL */
|
|
||||||
|
|
||||||
#if defined USE_GETTEXT_STATIC
|
|
||||||
/* exported functions in static library libintl.a
|
|
||||||
and supporting macros
|
|
||||||
you should link with -lintl (mingw32) */
|
|
||||||
extern char *gettext__(const char *__msgid);
|
|
||||||
extern char *dgettext__(const char *__domainname,const char *__msgid);
|
|
||||||
extern char *dcgettext__(const char *__domainname,const char *__msgid, int __category);
|
|
||||||
extern char *textdomain__(const char *__domainname);
|
|
||||||
extern char *bindtextdomain__(const char *__domainname,const char *__dirname);
|
|
||||||
#define gettext(szMsgId) gettext__(szMsgId)
|
|
||||||
#define dgettext(szDomain,szMsgId) dgettext__(szDomain,szMsgId)
|
|
||||||
#define dcgettext(szDomain,szMsgId,iCategory) dcgettext__(szDomain,szMsgId,iCategory)
|
|
||||||
#define textdomain(szDomain) textdomain__(szDomain)
|
|
||||||
#define bindtextdomain(szDomain,szDirectory) bindtextdomain__(szDomain,szDirectory)
|
|
||||||
// dummy - for static linkage - calling _putenv from within the DLL
|
|
||||||
#define gettext_putenv(a) _putenv(a)
|
|
||||||
#endif /* STATIC */
|
|
||||||
|
|
||||||
#if defined DONT_USE_GETTEXT
|
|
||||||
/* DON'T USE GETTEXT AT ALL
|
|
||||||
MAKROS TO MAKE CODE COMPILE WELL, BUT GETTEXT WILL NOT BE USESD
|
|
||||||
*/
|
|
||||||
# define gettext(Msgid) (Msgid)
|
|
||||||
# define dgettext(Domainname, Msgid) (Msgid)
|
|
||||||
# define dcgettext(Domainname, Msgid, Category) (Msgid)
|
|
||||||
# define textdomain(Domainname) ((char *) Domainname)
|
|
||||||
# define bindtextdomain(Domainname, Dirname) ((char *) Dirname)
|
|
||||||
// dummy - for static linkage - calling _putenv from within the DLL
|
|
||||||
# define gettext_putenv(a) _putenv(a)
|
|
||||||
#endif /* DON'T USE AT ALL */
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /*!defined(__LIBINTL_H_INCLUDED)*/
|
|
Loading…
Reference in New Issue