finish installing texthooker

This commit is contained in:
zeromus 2008-06-30 16:13:06 +00:00
parent 0491f34c1d
commit 7e98b2a131
3 changed files with 110 additions and 140 deletions

View File

@ -1349,6 +1349,82 @@ BEGIN
LISTBOX IDC_LIST1,7,7,251,120,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END
TEXTHOOKER DIALOGEX 0, 0, 456, 327
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Text Hooker"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Selection Window",1,0,0,183,164,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 102,207,13,216,94,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_VSCROLL,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
GROUPBOX "Hooked Text",103,200,0,229,131,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Load Table",104,3,169,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Clear Selection",105,67,169,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Pause",106,67,190,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Snap",107,130,169,60,35,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Clear Buffer",108,208,111,60,14,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 111,5,249,115,14,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
PUSHBUTTON "Save Selection",112,130,249,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Save Table",113,3,190,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Load Selection",114,130,268,60,14,0,WS_EX_NOPARENTNOTIFY
GROUPBOX "Translated Text",115,200,140,229,117,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 116,207,156,214,95,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_VSCROLL,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
PUSHBUTTON "Excite.co.jp",117,281,111,60,14,0,WS_EX_NOPARENTNOTIFY
LTEXT "Scanline:",118,5,210,50,8,0,WS_EX_NOPARENTNOTIFY
LTEXT "Update every x frames:",119,68,210,79,8,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 120,5,220,52,14,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
EDITTEXT 121,68,220,52,14,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
PUSHBUTTON "Trim",122,351,111,60,14
COMBOBOX 109,5,269,115,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Japanese:",-1,5,283,47,9
EDITTEXT 131,5,292,115,14,ES_AUTOHSCROLL
LTEXT "English:",-1,130,283,47,9
EDITTEXT 132,130,292,115,14,ES_AUTOHSCROLL
PUSHBUTTON "Add Definition",133,253,292,60,14
CONTROL "Selection Window",341,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,261,80,9
CONTROL "Word Substitution",342,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,274,80,9
LTEXT "(han)dakuten mark position:",-1,324,286,92,8
CONTROL "Above",343,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,297,37,10
CONTROL "Right",344,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,363,297,33,10
LTEXT "New Selection Name:",-1,5,240,68,8
END
CHEATCONSOLE DIALOGEX 0, 0, 384, 178
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Cheat Search"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Active Cheats",201,3,1,133,168,WS_TABSTOP
GROUPBOX "Cheat Search",202,139,1,238,168,WS_TABSTOP
LISTBOX IDC_LIST_CHEATS,12,14,115,110,WS_VSCROLL
LTEXT "Address:",IDC_STATIC,12,134,28,10
LTEXT "Value:",IDC_STATIC,85,134,21,10
LTEXT "Name:",IDC_STATIC,12,118,22,10
EDITTEXT IDC_CHEAT_ADDR,42,132,30,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_VAL,107,132,20,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_NAME,35,116,92,12,ES_AUTOHSCROLL | ES_WANTRETURN
PUSHBUTTON "Add",IDC_BTN_CHEAT_ADD,12,148,35,16
PUSHBUTTON "Delete",IDC_BTN_CHEAT_DEL,52,148,35,16
PUSHBUTTON "Update",IDC_BTN_CHEAT_UPD,92,148,35,16
GROUPBOX "Possibilities",IDC_CHEAT_BOX_POSSIBILITIES,252,13,125,156,WS_TABSTOP
LISTBOX IDC_CHEAT_LIST_POSSIBILITIES,260,25,99,147,LBS_SORT | LBS_WANTKEYBOARDINPUT
SCROLLBAR IDC_CHEAT_SCRL_POSSIBILITIES,360,25,10,138,SBS_VERT
PUSHBUTTON "Reset",IDC_BTN_CHEAT_RESET,146,12,55,15
PUSHBUTTON "Known Value:",IDC_BTN_CHEAT_KNOWN,146,31,55,15
EDITTEXT IDC_CHEAT_VAL_KNOWN,204,32,20,12,ES_UPPERCASE
GROUPBOX "Previous Compare",204,139,51,114,118,WS_TABSTOP
PUSHBUTTON "Equal",IDC_BTN_CHEAT_EQ,146,64,55,15
PUSHBUTTON "Not Equal",IDC_BTN_CHEAT_NE,146,91,55,15
PUSHBUTTON "Greater Than",IDC_BTN_CHEAT_GT,146,118,55,15
PUSHBUTTON "Less Than",IDC_BTN_CHEAT_LT,146,145,55,15
CONTROL "By:",IDC_CHEAT_CHECK_NE_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,94,22,10
CONTROL "By:",IDC_CHEAT_CHECK_GT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,121,22,10
CONTROL "By:",IDC_CHEAT_CHECK_LT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,148,22,10
EDITTEXT IDC_CHEAT_VAL_NE_BY,228,93,20,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_VAL_GT_BY,228,120,20,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_VAL_LT_BY,228,147,20,12,ES_UPPERCASE | ES_WANTRETURN
LTEXT "(Hex)",IDC_STATIC,226,34,19,8
END
/////////////////////////////////////////////////////////////////////////////
//
@ -1474,73 +1550,15 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 152
END
END
#endif // APSTUDIO_INVOKED
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
"TEXTHOOKER", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 449
TOPMARGIN, 7
BOTTOMMARGIN, 320
END
/////////////////////////////////////////////////////////////////////////////
// German (Germany) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
CHEATCONSOLE DIALOGEX 0, 0, 384, 178
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Cheat Search"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Active Cheats",201,3,1,133,168,WS_TABSTOP
GROUPBOX "Cheat Search",202,139,1,238,168,WS_TABSTOP
LISTBOX IDC_LIST_CHEATS,12,14,115,110,WS_VSCROLL
LTEXT "Address:",IDC_STATIC,12,134,28,10
LTEXT "Value:",IDC_STATIC,85,134,21,10
LTEXT "Name:",IDC_STATIC,12,118,22,10
EDITTEXT IDC_CHEAT_ADDR,42,132,30,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_VAL,107,132,20,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_NAME,35,116,92,12,ES_AUTOHSCROLL | ES_WANTRETURN
PUSHBUTTON "Add",IDC_BTN_CHEAT_ADD,12,148,35,16
PUSHBUTTON "Delete",IDC_BTN_CHEAT_DEL,52,148,35,16
PUSHBUTTON "Update",IDC_BTN_CHEAT_UPD,92,148,35,16
GROUPBOX "Possibilities",IDC_CHEAT_BOX_POSSIBILITIES,252,13,125,156,WS_TABSTOP
LISTBOX IDC_CHEAT_LIST_POSSIBILITIES,260,25,99,147,LBS_SORT | LBS_WANTKEYBOARDINPUT
SCROLLBAR IDC_CHEAT_SCRL_POSSIBILITIES,360,25,10,138,SBS_VERT
PUSHBUTTON "Reset",IDC_BTN_CHEAT_RESET,146,12,55,15
PUSHBUTTON "Known Value:",IDC_BTN_CHEAT_KNOWN,146,31,55,15
EDITTEXT IDC_CHEAT_VAL_KNOWN,204,32,20,12,ES_UPPERCASE
GROUPBOX "Previous Compare",204,139,51,114,118,WS_TABSTOP
PUSHBUTTON "Equal",IDC_BTN_CHEAT_EQ,146,64,55,15
PUSHBUTTON "Not Equal",IDC_BTN_CHEAT_NE,146,91,55,15
PUSHBUTTON "Greater Than",IDC_BTN_CHEAT_GT,146,118,55,15
PUSHBUTTON "Less Than",IDC_BTN_CHEAT_LT,146,145,55,15
CONTROL "By:",IDC_CHEAT_CHECK_NE_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,94,22,10
CONTROL "By:",IDC_CHEAT_CHECK_GT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,121,22,10
CONTROL "By:",IDC_CHEAT_CHECK_LT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,148,22,10
EDITTEXT IDC_CHEAT_VAL_NE_BY,228,93,20,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_VAL_GT_BY,228,120,20,12,ES_UPPERCASE | ES_WANTRETURN
EDITTEXT IDC_CHEAT_VAL_LT_BY,228,147,20,12,ES_UPPERCASE | ES_WANTRETURN
LTEXT "(Hex)",IDC_STATIC,226,34,19,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
"CHEATCONSOLE", DIALOG
BEGIN
LEFTMARGIN, 7
@ -1551,7 +1569,7 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
#endif // German (Germany) resources
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
@ -1578,45 +1596,6 @@ BEGIN
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,7,311,214
END
TEXTHOOKER DIALOGEX 0, 0, 456, 327
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Text Hooker"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Selection Window",1,0,0,183,164,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 102,207,13,216,94,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_VSCROLL,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
GROUPBOX "Hooked Text",103,200,0,229,131,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Load Table",104,3,169,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Clear Selection",105,67,169,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Pause",106,67,190,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Snap",107,130,169,60,35,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Clear Buffer",108,208,111,60,14,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 111,5,249,115,14,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
PUSHBUTTON "Save Selection",112,130,249,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Save Table",113,3,190,60,14,0,WS_EX_NOPARENTNOTIFY
PUSHBUTTON "Load Selection",114,130,268,60,14,0,WS_EX_NOPARENTNOTIFY
GROUPBOX "Translated Text",115,200,140,229,117,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 116,207,156,214,95,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_VSCROLL,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
PUSHBUTTON "Excite.co.jp",117,281,111,60,14,0,WS_EX_NOPARENTNOTIFY
LTEXT "Scanline:",118,5,210,50,8,0,WS_EX_NOPARENTNOTIFY
LTEXT "Update every x frames:",119,68,210,79,8,0,WS_EX_NOPARENTNOTIFY
EDITTEXT 120,5,220,52,14,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
EDITTEXT 121,68,220,52,14,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE
PUSHBUTTON "Trim",122,351,111,60,14
COMBOBOX 109,5,269,115,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Japanese:",-1,5,283,47,9
EDITTEXT 131,5,292,115,14,ES_AUTOHSCROLL
LTEXT "English:",-1,130,283,47,9
EDITTEXT 132,130,292,115,14,ES_AUTOHSCROLL
PUSHBUTTON "Add Definition",133,253,292,60,14
CONTROL "Selection Window",341,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,261,80,9
CONTROL "Word Substitution",342,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,274,80,9
LTEXT "(han)dakuten mark position:",-1,324,286,92,8
CONTROL "Above",343,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,297,37,10
CONTROL "Right",344,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,363,297,33,10
LTEXT "New Selection Name:",-1,5,240,68,8
END
/////////////////////////////////////////////////////////////////////////////
//
@ -1633,14 +1612,6 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 243
END
TEXTHOOKER, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 449
TOPMARGIN, 7
BOTTOMMARGIN, 320
END
END
#endif // APSTUDIO_INVOKED

View File

@ -130,8 +130,6 @@
#define IDD_DIALOG2 115
#define LBL_CLEAR_AH 116
#define IDC_CHECK_LOG_UPDATE_WINDOW 116
#define IDD_DIALOG3 120
#define TEXTHOOKER 120
#define CHECK_SOUND_8BIT 122
#define CHECK_SOUND_GLOBAL_FOCUS 124
#define CHECK_SOUND_ENABLED 126

View File

@ -73,7 +73,7 @@ uint8 pausedTileToggles[32][30]; //same as above, but is used during the emulato
int lmousedown = 0; //keeps track of the the left mousebuttons down state (for click/drag selection)
int drawingorerasing = 1; //keeps track of whether the user is selecting or deselecting on the selection window
char chartable[256][4]; //used for table mappings
int TableFileLoaded = 0; //boolean for whether a table file is loaded or not
static int TableFileLoaded = 0; //boolean for whether a table file is loaded or not
uint16 tile = 0x0000; //used to store the value of a tile at a given x,y location
int tileattr = 0; //used to store the corresponding attribute location for tile (see getTextHookerTile)
uint16 maru = 0x1000; //used to store the lookup value for the handakuten mark
@ -98,7 +98,7 @@ HGDIOBJ thTmpObj0;//,thTmpObj1;
//this struct is used to store ja/en words for word replacement
typedef struct notllword {
struct llword {
//holds the japanese word
char ja[40];
@ -106,8 +106,8 @@ typedef struct notllword {
char en[40];
//holds the next item in the sequence
void* next;
} llword;
llword* next;
};
llword *words; //initial word
@ -397,7 +397,7 @@ void KillTextHooker() {
//this is defined elsewhere and is called by TextHookerLoadTableFile
//i don't think it's ever actually used, though...
extern void StopSound(void);
//extern void StopSound(void);
/*
@ -417,7 +417,7 @@ int TextHookerLoadTableFile(){
const char filter[]="Table Files (*.THT)\0*.tht\0";
char nameo[2048]; //todo: possibly no need for this? can lpstrfilter point to loadedcdfile instead?
OPENFILENAME ofn;
StopSound();
//StopSound(); //mbg merge 6/30/08
memset(&ofn,0,sizeof(ofn));
ofn.lStructSize=sizeof(ofn);
ofn.hInstance=fceu_hInstance;
@ -610,12 +610,12 @@ int TextHookerLoadTableFile(){
//init words if we need to
if ( words == NULL ) {
words = malloc( sizeof( llword ) );
words = (llword*)malloc( sizeof( llword ) );
words->next = NULL;
}
//create the word item
llword *newitem = malloc( sizeof( llword ) );
llword *newitem = (llword*)malloc( sizeof( llword ) );
strcpy( newitem->en, en );
strcpy( newitem->ja, ja );
newitem->next = NULL;
@ -680,7 +680,7 @@ int TextHookerSaveTableFile(){
const char filter[]="Table Files (*.THT)\0*.tht\0";
char nameo[2048]; //todo: possibly no need for this? can lpstrfilter point to loadedcdfile instead?
OPENFILENAME ofn;
StopSound();
//StopSound(); //mbg merge 6/30/08
memset(&ofn,0,sizeof(ofn));
ofn.lStructSize=sizeof(ofn);
ofn.hInstance=fceu_hInstance;
@ -839,7 +839,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
KillTextHooker();
break;
case WM_MOVING:
StopSound();
//StopSound(); //mbg merge 6/30/08
break;
case WM_MOVE:
GetWindowRect(hwndDlg,&wrect);
@ -1048,7 +1048,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
} else { //not in the table...
//place a space
memset( tempchar, 0, sizeof( char ) * 4 );
tempchar[0] = 0x81;
tempchar[0] = (char)0x81;
tempchar[1] = 0x40;
strcat( str, tempchar );
}
@ -1069,7 +1069,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
memset( bufferstrtemp, 0, sizeof( str ) ); //init the temp buffer
if ( found ) { //if we found it, replace it
//add a null byte after the first half
strcpy( found, "\0" );
strcpy( (char*)found, "\0" );
//copy the first half of the haystack
strcpy( bufferstrtemp, str );
@ -1078,7 +1078,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
strcat( bufferstrtemp, current->en );
//tack on the rest of the haystack
strcat( bufferstrtemp, found + ( sizeof( char ) * strlen( current->ja ) ) );
strcat( bufferstrtemp, (char*)found + ( strlen( current->ja ) ) );
//copy the temp back to the haystack
strcpy( str, bufferstrtemp );
@ -1105,8 +1105,8 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case 117: //excite.co.jp
//init the buffers
textToTrans = malloc( sizeof( char ) * 1024 );
transText = malloc( sizeof( char ) * 2048 );
textToTrans = (char*)malloc( sizeof( char ) * 1024 );
transText = (char*)malloc( sizeof( char ) * 2048 );
memset( textToTrans, 0, sizeof( char ) * 1024 );
//get the buffer into textToTrans
@ -1141,7 +1141,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
memset( bufferstrtemp, 0, sizeof( str ) ); //init the temp buffer
if ( found ) { //found something to replace!
//add a null byte after the first half
strcpy( found, "\0" );
strcpy( (char*)found, "\0" );
//copy the first half of the haystack
strcpy( bufferstrtemp, str );
@ -1150,7 +1150,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
strcat( bufferstrtemp, " " );
//tack on the rest of the haystack
strcat( bufferstrtemp, found + ( sizeof( char ) * 2 ) );
strcat( bufferstrtemp, (char*)found + 2 );
//copy the temp back to the haystack
strcpy( str, bufferstrtemp );
@ -1199,7 +1199,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for ( i = 0; i < 32; i++ ) {
for ( j = 0; j < 30; j++ ) {
//add to x
x += (int)pow( 2, y ) * tileToggles[i][j];
x += (1<<y) * tileToggles[i][j];
y++;
if ( y >= 6 ) { //we have a full byte now
@ -1268,7 +1268,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for ( i = 0; i < sizeof( byteline ); i++ ) {
x = byteline[i];
for ( y = 0; y < 6; y++ ) {
if ( ( x & (int)pow( 2, y ) ) != 0 ) {
if ( ( x & (1<<y)) != 0 ) {
strcat( binstring, "1" );
} else {
strcat( binstring, "0" );
@ -1307,7 +1307,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case 133: //save word
//add the word to the words list
//create the word item
newitem = malloc( sizeof( llword ) );
newitem = (llword*)malloc( sizeof( llword ) );
//get the english and japanese values
GetDlgItemText(hwndDlg,131,newitem->ja,40);
@ -1325,7 +1325,7 @@ BOOL CALLBACK TextHookerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
//init words if we need to
if ( words == NULL ) {
words = malloc( sizeof( llword ) );
words = (llword*)malloc( sizeof( llword ) );
words->next = NULL;
}
@ -1433,10 +1433,10 @@ int excitecojp() {
// Successfully connected!
char *buffer; // buffer to hold our http request
buffer = malloc( sizeof( char ) * 2048 );
buffer = (char*)malloc( sizeof( char ) * 2048 );
memset( buffer, 0, 2048 );
char *urlEscapedText; // holds the url escaped textToTrans
urlEscapedText = malloc( sizeof( char ) * 2048 );
urlEscapedText = (char*)malloc( sizeof( char ) * 2048 );
memset( urlEscapedText, 0, 2048 );
memset( buffer, 0, 2048 );
@ -1467,9 +1467,9 @@ int excitecojp() {
}
char *recvbuffer; //server response is read one char at a time
recvbuffer = malloc( sizeof( char ) * 4 );
recvbuffer = (char*)malloc( sizeof( char ) * 4 );
char *theLine; //holds the current line being read from the server response
theLine = malloc( sizeof( char ) * 2048 );
theLine = (char*)malloc( sizeof( char ) * 2048 );
memset( buffer, 0, 2048 );
memset( theLine, 0, 2048 );
memset( transText, 0, 2048 );
@ -1560,6 +1560,7 @@ void DoTextHooker() {
}
*/ //adelikat - Who needs error messages? (in fceuxdspce, GI = FCEUGI typedef and no longer exists, but it shouldn't be hard to find another way to determine these conditions.
if (!hTextHooker) hTextHooker = CreateDialog(fceu_hInstance,"TEXTHOOKER",NULL,TextHookerCallB);
DWORD ret = GetLastError();
CheckDlgButton( hTextHooker, 341, BST_CHECKED );
CheckDlgButton( hTextHooker, 342, BST_CHECKED );