mirror of https://github.com/stella-emu/stella.git
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:
parent
2193c94b12
commit
b3a16fc0a5
|
@ -490,27 +490,25 @@ void DiStella::disasm(uInt32 distart, int pass)
|
||||||
// where wraparound occurred on a 32-bit int, and subsequent
|
// where wraparound occurred on a 32-bit int, and subsequent
|
||||||
// indexing into the labels array caused a crash
|
// indexing into the labels array caused a crash
|
||||||
d1 = Debugger::debugger().peek(myPC+myOffset); myPC++;
|
d1 = Debugger::debugger().peek(myPC+myOffset); myPC++;
|
||||||
ad = (myPC + (Int8)d1) & 0xfff;
|
ad = ((myPC + (Int8)d1) & 0xfff) + myOffset;
|
||||||
|
|
||||||
labfound = mark(ad+myOffset, REFERENCED);
|
labfound = mark(ad+myOffset, REFERENCED);
|
||||||
if (pass == 1)
|
if (pass == 1)
|
||||||
{
|
{
|
||||||
if ((addbranch) && !check_bit(labels[ad], REACHABLE))
|
if ((addbranch) && !check_bit(labels[ad-myOffset], REACHABLE))
|
||||||
{
|
{
|
||||||
myAddressQueue.push(ad+myOffset);
|
myAddressQueue.push(ad);
|
||||||
mark(ad+myOffset, REACHABLE);
|
mark(ad, REACHABLE);
|
||||||
/* addressq=addq(addressq,myPC+myOffset); */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pass == 3)
|
else if (pass == 3)
|
||||||
{
|
{
|
||||||
int tmp = myPC+ad+myOffset;
|
|
||||||
if (labfound == 1)
|
if (labfound == 1)
|
||||||
nextline << " L" << HEX4 << tmp;
|
nextline << " L" << HEX4 << ad;
|
||||||
else
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue