Skip to content

Commit 98e5dc2

Browse files
committed
Improve the performance of CMIOSimulator.contend_{48,128}k()
1 parent 70c6e47 commit 98e5dc2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

skoolkit/cmiosimulator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ def contend_48k(self, t, timings):
5151
delay = 0
5252
for address, tstates in timings:
5353
if 0x4000 <= address < 0x8000:
54-
delay += DELAYS_48K[t % 69888]
55-
t += DELAYS_48K[t % 69888]
54+
cd = DELAYS_48K[t % 69888]
55+
delay += cd
56+
t += cd
5657
t += tstates
5758
return delay
5859

@@ -72,8 +73,9 @@ def contend_128k(self, t, timings):
7273
delay = 0
7374
for address, tstates in timings:
7475
if 0x4000 <= address < 0x8000 or (c and address >= 0xC000):
75-
delay += DELAYS_128K[t % 70908]
76-
t += DELAYS_128K[t % 70908]
76+
cd = DELAYS_128K[t % 70908]
77+
delay += cd
78+
t += cd
7779
t += tstates
7880
return delay
7981

0 commit comments

Comments
 (0)