Fixed another Distella bug wrt RELATIVE addressing. This fixes an

issue I noticed River Raid, where labels were being generated above
0x10000 (the maximum should be 0xFFFF).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2002 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-04-10 21:57:49 +00:00
parent 2193c94b12
commit b3a16fc0a5
1 changed files with 7 additions and 9 deletions

View File

@ -490,27 +490,25 @@ void DiStella::disasm(uInt32 distart, int pass)
// where wraparound occurred on a 32-bit int, and subsequent
// indexing into the labels array caused a crash
d1 = Debugger::debugger().peek(myPC+myOffset); myPC++;
ad = (myPC + (Int8)d1) & 0xfff;
ad = ((myPC + (Int8)d1) & 0xfff) + myOffset;
labfound = mark(ad+myOffset, REFERENCED);
if (pass == 1)
{
if ((addbranch) && !check_bit(labels[ad], REACHABLE))
if ((addbranch) && !check_bit(labels[ad-myOffset], REACHABLE))
{
myAddressQueue.push(ad+myOffset);
mark(ad+myOffset, REACHABLE);
/* addressq=addq(addressq,myPC+myOffset); */
myAddressQueue.push(ad);
mark(ad, REACHABLE);
}
}
else if (pass == 3)
{
int tmp = myPC+ad+myOffset;
if (labfound == 1)
nextline << " L" << HEX4 << tmp;
nextline << " L" << HEX4 << ad;
else
nextline << " $" << HEX4 << tmp;
nextline << " $" << HEX4 << ad;
nextlinebytes << HEX2 << (int)(tmp&0xff) << " " << HEX2 << (int)(tmp>>8);
nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8);
}
break;
}