fix #790 RIGHT NOW for some lazy guy. this means addresses such as "$1234" are no longer replaced with "mysymbol" but will now appear as "$1234 mysymbol". If anyone doesn't like this, you'll have to write about it in the bug ticket and I'll add it as an option. also fix replacement of zero page addresses (for instance, $F0 couldn't be replaced because the search token was $00F0)
This commit is contained in:
parent
3077b3c904
commit
08b81a9089
|
@ -470,7 +470,9 @@ void HighlightSyntax(int lines)
|
|||
numpos = SendDlgItemMessage(hDebug, IDC_DEBUGGER_DISASSEMBLY, EM_FINDTEXT, (WPARAM)FR_DOWN, (LPARAM)&num);
|
||||
if (numpos != 0)
|
||||
{
|
||||
if (debug_str[numpos + 3] == ',' || debug_str[numpos + 3] == ')' || debug_str[numpos + 3] == '\n')
|
||||
if (debug_str[numpos + 3] == ',' || debug_str[numpos + 3] == ')' || debug_str[numpos + 3] == '\n'
|
||||
|| debug_str[numpos + 3] == ' ' //zero 30-nov-2017 - in support of combined label/offset disassembly. not sure this is a good idea
|
||||
)
|
||||
wordbreak = numpos + 2;
|
||||
else
|
||||
wordbreak = numpos + 4;
|
||||
|
|
|
@ -533,12 +533,38 @@ void replaceNames(Name* list, char* str, std::vector<uint16>* addressesLog)
|
|||
*buff = 0;
|
||||
src = str;
|
||||
|
||||
while (pos = strstr(src, list->offset))
|
||||
int addrlen = 5;
|
||||
|
||||
//zero 30-nov-2017 - handle zero page differently
|
||||
char test[64];
|
||||
strcpy(test, list->offset);
|
||||
if(!strncmp(test,"$00",3))
|
||||
{
|
||||
*pos = 0;
|
||||
strcat(buff, src);
|
||||
strcpy(test,"$");
|
||||
strcat(test,list->offset+3);
|
||||
addrlen = 3;
|
||||
}
|
||||
|
||||
while (pos = strstr(src, test))
|
||||
{
|
||||
//zero 30-nov-2017 - change how this works so we can display the address still
|
||||
//*pos = 0;
|
||||
//strcat(buff, src);
|
||||
//strcat(buff, list->name);
|
||||
//src = pos + 5; // 5 = strlen(beg->offset), because all offsets are in "$XXXX" format
|
||||
|
||||
//zero 30-nov-2017 - change how this works so we can display the address still
|
||||
//append beginning part, plus addrlen for the offset
|
||||
strncat(buff,src,pos-src+addrlen);
|
||||
//append a space
|
||||
strcat(buff," ");
|
||||
//append the label
|
||||
strcat(buff, list->name);
|
||||
src = pos + 5; // 5 = strlen(beg->offset), because all offsets are in "$XXXX" format
|
||||
//begin processing after that offset
|
||||
src = pos + addrlen;
|
||||
//append a space.. unless what's next is an RParen, I guess
|
||||
if(*src != ')') strcat(buff," ");
|
||||
|
||||
if (addressesLog)
|
||||
addressesLog->push_back(list->offsetNumeric);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue