Well, that was fast. Fixed bug in parsing constants from the DASM lst file.

I wasn't completely sure how the file was structured, but it's starting to
make a lot more sense now.  I think in the end, it will be better to use this
file as much as possible.

Bumped version #, and starting all over again.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2815 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-08-22 21:34:22 +00:00
parent c1398bc331
commit 587959c273
2 changed files with 15 additions and 9 deletions

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "3.9.1"
#define STELLA_VERSION "3.9.2_pre"
#define STELLA_BUILD atoi("$Rev$" + 6)
#endif

View File

@ -755,8 +755,8 @@ string CartDebug::loadListFile()
while(!in.eof())
{
string line, addr1;
int value = -1;
string line, addr_s;
int addr = -1;
getline(in, line);
@ -766,18 +766,24 @@ string CartDebug::loadListFile()
{
stringstream buf(line);
// Swallow first value
buf >> value >> addr1;
// Swallow first value, then get actual numerical value for address
// We need to read the address as a string, since it may contain 'U'
buf >> addr >> addr_s;
if(addr_s.length() == 0)
continue;
const char* p = addr_s[0] == 'U' ? addr_s.c_str() + 1 : addr_s.c_str();
addr = strtoul(p, NULL, 16);
// Search for lines containing Uxxxx
if(addr1.length() > 0 && toupper(addr1[0]) == 'U')
// For now, completely ignore ROM addresses
if(!(addr & 0x1000))
{
// Search for pattern 'xx yy CONSTANT ='
buf.seekg(20); // skip potential '????'
int xx = -1, yy = -1;
char eq = '\0';
buf >> hex >> xx >> hex >> yy >> line >> eq;
if(xx == 0 && yy >= 0 && eq == '=')
myUserCLabels.insert(make_pair(yy, line));
if(xx >= 0 && yy >= 0 && eq == '=')
myUserCLabels.insert(make_pair(xx*256+yy, line));
}
}
}