mirror of https://github.com/stella-emu/stella.git
Update to BUS FastJump.
This commit is contained in:
parent
78cb21d798
commit
145d47315e
|
@ -221,13 +221,15 @@ uInt8 CartridgeBUS::peek(uInt16 address)
|
||||||
if(bankLocked())
|
if(bankLocked())
|
||||||
return peekvalue;
|
return peekvalue;
|
||||||
|
|
||||||
// implement JMP FASTJMP which fetches the destination address from stream 33
|
// implement JMP FASTJMP which fetches the destination address from stream 17
|
||||||
if (myFastJumpActive)
|
if (myFastJumpActive
|
||||||
|
&& myJMPoperandAddress == address)
|
||||||
{
|
{
|
||||||
uInt32 pointer;
|
uInt32 pointer;
|
||||||
uInt8 value;
|
uInt8 value;
|
||||||
|
|
||||||
myFastJumpActive--;
|
myFastJumpActive--;
|
||||||
|
myJMPoperandAddress++;
|
||||||
|
|
||||||
pointer = getDatastreamPointer(JUMPSTREAM);
|
pointer = getDatastreamPointer(JUMPSTREAM);
|
||||||
value = myDisplayImage[ pointer >> 20 ];
|
value = myDisplayImage[ pointer >> 20 ];
|
||||||
|
@ -236,17 +238,20 @@ uInt8 CartridgeBUS::peek(uInt16 address)
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test for JMP FASTJUMP where FASTJUMP = $0000
|
// test for JMP FASTJUMP where FASTJUMP = $0000
|
||||||
if (BUS_STUFF_ON
|
if (BUS_STUFF_ON
|
||||||
&& peekvalue == 0x4C
|
&& peekvalue == 0x4C
|
||||||
&& myProgramImage[(myCurrentBank << 12) + address+1] == 0
|
&& myProgramImage[(myCurrentBank << 12) + address+1] == 0
|
||||||
&& myProgramImage[(myCurrentBank << 12) + address+2] == 0)
|
&& myProgramImage[(myCurrentBank << 12) + address+2] == 0)
|
||||||
{
|
{
|
||||||
myFastJumpActive = 2; // return next two peeks from datastream 31
|
myFastJumpActive = 2; // return next two peeks from datastream 17
|
||||||
|
myJMPoperandAddress = address + 1;
|
||||||
return peekvalue;
|
return peekvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myJMPoperandAddress = 0;
|
||||||
|
|
||||||
// save the STY's zero page address
|
// save the STY's zero page address
|
||||||
if (BUS_STUFF_ON && mySTYZeroPageAddress == address)
|
if (BUS_STUFF_ON && mySTYZeroPageAddress == address)
|
||||||
myBusOverdriveAddress = peekvalue;
|
myBusOverdriveAddress = peekvalue;
|
||||||
|
@ -564,6 +569,7 @@ bool CartridgeBUS::save(Serializer& out) const
|
||||||
// Addresses for bus override logic
|
// Addresses for bus override logic
|
||||||
out.putShort(myBusOverdriveAddress);
|
out.putShort(myBusOverdriveAddress);
|
||||||
out.putShort(mySTYZeroPageAddress);
|
out.putShort(mySTYZeroPageAddress);
|
||||||
|
out.putShort(myJMPoperandAddress);
|
||||||
|
|
||||||
// Save cycles and clocks
|
// Save cycles and clocks
|
||||||
out.putInt(mySystemCycles);
|
out.putInt(mySystemCycles);
|
||||||
|
@ -607,6 +613,7 @@ bool CartridgeBUS::load(Serializer& in)
|
||||||
// Addresses for bus override logic
|
// Addresses for bus override logic
|
||||||
myBusOverdriveAddress = in.getShort();
|
myBusOverdriveAddress = in.getShort();
|
||||||
mySTYZeroPageAddress = in.getShort();
|
mySTYZeroPageAddress = in.getShort();
|
||||||
|
myJMPoperandAddress = in.getShort();
|
||||||
|
|
||||||
// Get system cycles and fractional clocks
|
// Get system cycles and fractional clocks
|
||||||
mySystemCycles = (Int32)in.getInt();
|
mySystemCycles = (Int32)in.getInt();
|
||||||
|
|
|
@ -247,9 +247,13 @@ class CartridgeBUS : public Cartridge
|
||||||
// set to address of ZP if last byte peeked was $84 (STY ZP)
|
// set to address of ZP if last byte peeked was $84 (STY ZP)
|
||||||
uInt16 mySTYZeroPageAddress;
|
uInt16 mySTYZeroPageAddress;
|
||||||
|
|
||||||
|
// set to address of the JMP operand if last byte peeked was 4C
|
||||||
|
// *and* the next two bytes in ROM are 00 00
|
||||||
|
uInt16 myJMPoperandAddress;
|
||||||
|
|
||||||
// System cycle count when the last update to music data fetchers occurred
|
// System cycle count when the last update to music data fetchers occurred
|
||||||
Int32 mySystemCycles;
|
Int32 mySystemCycles;
|
||||||
|
|
||||||
// ARM cycle count from when the last callFunction() occurred
|
// ARM cycle count from when the last callFunction() occurred
|
||||||
Int32 myARMCycles;
|
Int32 myARMCycles;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue