mirror of
https://github.com/hoglet67/AtomBusMon.git
synced 2024-06-17 11:29:31 +00:00
R65C02: correct cycle counts of JMP (ind) and JMP (ind,x) to 6
Change-Id: I3f7659b0db8d9c6a62577cb5b17052267a0b4154
This commit is contained in:
parent
c184b6466a
commit
6b67360bf3
|
@ -41,9 +41,9 @@ end R65C02;
|
||||||
-- Rti (6) => fetch, cycle2, stack1, stack2, stack3, cycleJump
|
-- Rti (6) => fetch, cycle2, stack1, stack2, stack3, cycleJump
|
||||||
-- Jsr (6) => fetch, cycle2, .. cycle5, cycle6, cycleJump
|
-- Jsr (6) => fetch, cycle2, .. cycle5, cycle6, cycleJump
|
||||||
-- Jmp abs (3) => fetch, cycle2, cycleJump
|
-- Jmp abs (3) => fetch, cycle2, cycleJump
|
||||||
-- Jmp (ind) (5) => fetch, cycle2, cycle3, cycleRead, cycleJump
|
-- Jmp (ind) (6) => fetch, cycle2, cycle3, cycleRead, cycleRead2, cycleJump
|
||||||
-- Jmp (ind,x) (5) => fetch, cycle2, cycle3, cycleRead, cycleJump
|
-- Jmp (ind,x) (6) => fetch, cycle2, cycle3, cycleRead, cycleRead2, cycleJump
|
||||||
-- Brk / irq (6) => fetch, cycle2, stack2, stack3, stack4
|
-- Brk (7) => fetch, cycle2, stack2, stack3, stack4, cycleRead2, cycleJump
|
||||||
-- -----------------------------------------------------------------------
|
-- -----------------------------------------------------------------------
|
||||||
|
|
||||||
architecture Behavioral of R65C02 is
|
architecture Behavioral of R65C02 is
|
||||||
|
@ -1058,9 +1058,7 @@ begin
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
when cycleRead =>
|
when cycleRead =>
|
||||||
if opcInfo(opcJump) = '1' then
|
if opcInfo(opcJump) = '1' or indexOut(8) = '1' then
|
||||||
nextCpuCycle <= cycleJump;
|
|
||||||
elsif indexOut(8) = '1' then
|
|
||||||
nextCpuCycle <= cycleRead2;
|
nextCpuCycle <= cycleRead2;
|
||||||
elsif opcInfo(opcRmw) = '1' then
|
elsif opcInfo(opcRmw) = '1' then
|
||||||
nextCpuCycle <= cycleRmw;
|
nextCpuCycle <= cycleRmw;
|
||||||
|
@ -1070,7 +1068,9 @@ begin
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
when cycleRead2 =>
|
when cycleRead2 =>
|
||||||
if opcInfo(opcRmw) = '1' then
|
if opcInfo(opcJump) = '1' then
|
||||||
|
nextCpuCycle <= cycleJump;
|
||||||
|
elsif opcInfo(opcRmw) = '1' then
|
||||||
nextCpuCycle <= cycleRmw;
|
nextCpuCycle <= cycleRmw;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
@ -1104,7 +1104,7 @@ begin
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
when cycleStack4 =>
|
when cycleStack4 =>
|
||||||
nextCpuCycle <= cycleRead;
|
nextCpuCycle <= cycleRead2;
|
||||||
|
|
||||||
when cycleJump =>
|
when cycleJump =>
|
||||||
if opcInfo(opcIncrAfter) = '1' then
|
if opcInfo(opcIncrAfter) = '1' then
|
||||||
|
@ -1460,16 +1460,16 @@ begin
|
||||||
nextAddr <= nextAddrZPIndexed;
|
nextAddr <= nextAddrZPIndexed;
|
||||||
when cycleRead =>
|
when cycleRead =>
|
||||||
nextAddr <= nextAddrPc;
|
nextAddr <= nextAddrPc;
|
||||||
if opcInfo(opcJump) = '1' then
|
if indexOut(8) = '1' then
|
||||||
nextAddr <= nextAddrIncr;
|
|
||||||
elsif indexOut(8) = '1' then
|
|
||||||
nextAddr <= nextAddrIncrH;
|
nextAddr <= nextAddrIncrH;
|
||||||
elsif opcInfo(opcRmw) = '1' then
|
elsif opcInfo(opcRmw) = '1' or opcInfo(opcJump) = '1' then
|
||||||
nextAddr <= nextAddrHold;
|
nextAddr <= nextAddrHold;
|
||||||
end if;
|
end if;
|
||||||
when cycleRead2 =>
|
when cycleRead2 =>
|
||||||
nextAddr <= nextAddrPc;
|
nextAddr <= nextAddrPc;
|
||||||
if opcInfo(opcRmw) = '1' then
|
if opcInfo(opcJump) = '1' then
|
||||||
|
nextAddr <= nextAddrIncr;
|
||||||
|
elsif opcInfo(opcRmw) = '1' then
|
||||||
nextAddr <= nextAddrHold;
|
nextAddr <= nextAddrHold;
|
||||||
end if;
|
end if;
|
||||||
when cycleRmw =>
|
when cycleRmw =>
|
||||||
|
@ -1542,11 +1542,7 @@ begin
|
||||||
when nextAddrAbs =>
|
when nextAddrAbs =>
|
||||||
myAddr <= di & T;
|
myAddr <= di & T;
|
||||||
when nextAddrAbsIndexed =>
|
when nextAddrAbsIndexed =>
|
||||||
if theOpcode = x"7C" then
|
myAddr <= di & indexOut(7 downto 0);
|
||||||
myAddr <= (di & T) + (x"00"& X);
|
|
||||||
else
|
|
||||||
myAddr <= di & indexOut(7 downto 0);
|
|
||||||
end if;
|
|
||||||
when nextAddrZeroPage =>
|
when nextAddrZeroPage =>
|
||||||
myAddr <= "00000000" & di;
|
myAddr <= "00000000" & di;
|
||||||
when nextAddrZPIndexed =>
|
when nextAddrZPIndexed =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user