win32-set symbolic debugger name entry dialog text limits even when creating a new label; and add some hacks for me

This commit is contained in:
zeromus 2014-03-14 18:03:04 +00:00
parent 6302ac7d26
commit a9066961c7
6 changed files with 39 additions and 6 deletions

View File

@ -284,8 +284,15 @@ char *Disassemble(int addr, uint8 *opcode) {
}
#ifdef BRK_3BYTE_HACK
case 0x00:
sprintf(str,"BRK %02X %02X", opcode[1], opcode[2]);
break;
#else
case 0x00: strcpy(str,"BRK"); break;
#endif
//odd, 1-byte opcodes
case 0x00: strcpy(str,"BRK"); break;
case 0x08: strcpy(str,"PHP"); break;
case 0x0A: strcpy(str,"ASL"); break;
case 0x18: strcpy(str,"CLC"); break;

View File

@ -2082,7 +2082,15 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
//mbg merge 7/18/06 changed pausing check and set
if (FCEUI_EmulationPaused()) {
UpdateRegs(hwndDlg);
if (GetMem(tmp=X.PC) == 0x20) {
uint8 opcode = GetMem(tmp=X.PC);
bool jsr = opcode==0x20;
bool call = jsr;
#ifdef BRK_3BYTE_HACK
//with this hack, treat BRK similar to JSR
if(opcode == 0x00)
call = true;
#endif
if (call) {
if ((watchpoint[64].flags) && (MessageBox(hwndDlg,"Step Over is currently in process. Cancel it and setup a new Step Over watch?","Step Over Already Active",MB_YESNO|MB_ICONINFORMATION) != IDYES)) break;
watchpoint[64].address = (tmp+3);
watchpoint[64].flags = WP_E|WP_X;

View File

@ -554,7 +554,12 @@ char* generateNLFilenameForAddress(uint16 address)
strcat(NLfilename, ".ram.nl");
} else
{
sprintf(NLfilename, "%s.%X.nl", mass_replace(LoadedRomFName, "|", ".").c_str(), getBank(address));
int bank = getBank(address);
#ifdef DW3_NL_0F_1F_HACK
if(bank == 0x0F)
bank = 0x1F;
#endif
sprintf(NLfilename, "%s.%X.nl", mass_replace(LoadedRomFName, "|", ".").c_str(), bank);
}
return NLfilename;
}
@ -813,15 +818,16 @@ BOOL CALLBACK SymbolicNamingCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
Name* node = findNode(getNamesPointerForAddress(newAddress), newAddress);
if (node)
{
SendDlgItemMessage(hwndDlg, IDC_SYMBOLIC_NAME, EM_SETLIMITTEXT, NL_MAX_NAME_LEN, 0);
if (node->name && node->name[0])
SetDlgItemText(hwndDlg, IDC_SYMBOLIC_NAME, node->name);
SendDlgItemMessage(hwndDlg, IDC_SYMBOLIC_COMMENT, EM_SETLIMITTEXT, NL_MAX_MULTILINE_COMMENT_LEN, 0);
if (node->comment && node->comment[0])
SetDlgItemText(hwndDlg, IDC_SYMBOLIC_COMMENT, node->comment);
}
// set focus to IDC_SYMBOLIC_NAME
SendMessage(hwndDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hwndDlg, IDC_SYMBOLIC_NAME), true);
//always set the limits
SendDlgItemMessage(hwndDlg, IDC_SYMBOLIC_NAME, EM_SETLIMITTEXT, NL_MAX_NAME_LEN, 0);
SendDlgItemMessage(hwndDlg, IDC_SYMBOLIC_COMMENT, EM_SETLIMITTEXT, NL_MAX_MULTILINE_COMMENT_LEN, 0);
break;
}
case WM_CLOSE:

View File

@ -22,6 +22,12 @@
#ifndef __FCEU_TYPES
#define __FCEU_TYPES
//enables a hack designed for debugging dragon warrior 3 which treats BRK as a 3-byte opcode
//#define BRK_3BYTE_HACK
//enables a hack designed for debugging dragon warrior 3 which treats 0F and 1F NL files both as 1F
//#define DW3_NL_0F_1F_HACK
///causes the code fragment argument to be compiled in if the build includes debugging
#ifdef FCEUDEF_DEBUGGER
#define DEBUG(X) X;

View File

@ -532,7 +532,12 @@ void FCEUI_GetIVectors(uint16 *reset, uint16 *irq, uint16 *nmi)
//the opsize table is used to quickly grab the instruction sizes (in bytes)
const uint8 opsize[256] = {
/*0x00*/ 1,2,0,0,0,2,2,0,1,2,1,0,0,3,3,0,
#ifdef BRK_3BYTE_HACK
/*0x00*/ 3, //BRK
#else
/*0x00*/ 1, //BRK
#endif
/*0x01*/ 2,0,0,0,2,2,0,1,2,1,0,0,3,3,0,
/*0x10*/ 2,2,0,0,0,2,2,0,1,3,0,0,0,3,3,0,
/*0x20*/ 3,2,0,0,2,2,2,0,1,2,1,0,3,3,3,0,
/*0x30*/ 2,2,0,0,0,2,2,0,1,3,0,0,0,3,3,0,

1
trunk/vc/.gitignore vendored
View File

@ -19,3 +19,4 @@
/vc8_obj_Debug
/vc8_fceux.suo
/*.user
/vc8_obj_Release