mirror of
https://github.com/holub/mame
synced 2025-06-27 14:49:11 +03:00
65C02 opcode timing and bus usage corrections
- BBR and BBS use one or two extra cycles when the branch is taken, like other conditional branches - TRB and TSB perform an extra read of the operand instead of an extra write
This commit is contained in:
parent
c9a6c7ff4d
commit
df14344669
@ -163,6 +163,10 @@ bbr_zpb
|
||||
read(TMP);
|
||||
TMP = read_pc();
|
||||
if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) {
|
||||
read_pc_noinc();
|
||||
if(page_changing(PC, int8_t(TMP))) {
|
||||
read_arg(set_l(PC, PC+int8_t(TMP)));
|
||||
}
|
||||
PC += int8_t(TMP);
|
||||
}
|
||||
prefetch();
|
||||
@ -173,6 +177,10 @@ bbs_zpb
|
||||
read(TMP);
|
||||
TMP = read_pc();
|
||||
if(TMP2 & (1 << ((inst_state >> 4) & 7))) {
|
||||
read_pc_noinc();
|
||||
if(page_changing(PC, int8_t(TMP))) {
|
||||
read_arg(set_l(PC, PC+int8_t(TMP)));
|
||||
}
|
||||
PC += int8_t(TMP);
|
||||
}
|
||||
prefetch();
|
||||
@ -709,7 +717,7 @@ trb_aba
|
||||
TMP = read_pc();
|
||||
TMP = set_h(TMP, read_pc());
|
||||
TMP2 = read(TMP);
|
||||
write(TMP, TMP2);
|
||||
read(TMP);
|
||||
if(A & TMP2)
|
||||
P &= ~F_Z;
|
||||
else
|
||||
@ -721,7 +729,7 @@ trb_aba
|
||||
trb_zpg
|
||||
TMP = read_pc();
|
||||
TMP2 = read(TMP);
|
||||
write(TMP, TMP2);
|
||||
read(TMP);
|
||||
if(A & TMP2)
|
||||
P &= ~F_Z;
|
||||
else
|
||||
@ -734,7 +742,7 @@ tsb_aba
|
||||
TMP = read_pc();
|
||||
TMP = set_h(TMP, read_pc());
|
||||
TMP2 = read(TMP);
|
||||
write(TMP, TMP2);
|
||||
read(TMP);
|
||||
if(A & TMP2)
|
||||
P &= ~F_Z;
|
||||
else
|
||||
@ -746,7 +754,7 @@ tsb_aba
|
||||
tsb_zpg
|
||||
TMP = read_pc();
|
||||
TMP2 = read(TMP);
|
||||
write(TMP, TMP2);
|
||||
read(TMP);
|
||||
if(A & TMP2)
|
||||
P &= ~F_Z;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user