Even just tweaking the key repeat counter makes such a difference? I thought it would only make a 5 scanline or so difference… (SCNCNT being the bigger factor.)
htimi: ld hl,REPCNT
ld a,(hl)
dec a
jr z,.incr
cp 1
jr z,.end
ret
.incr: ld a,2
.end: ld (hl),a
ret
dec a vs. cp 1
dec a is a smaller and faster way to check if a equal 1
It writes a to (hl) after the compare so using dec a is not functionally identical.
You're right, and the gain is too insignificant if we do "inc a" after, forget what I said
Quite shocking indeed, between the above ISR installed or not there're slightly more than a dozen scanlines. I've double-checked this and that's what i'm getting.
EDIT: In fact, disabling all OpenMSX effects, I can count more than twice the above...
jltursan, what do you mean exactly? openMSX effects have no influence on the timing of the running MSX programs of course...
I mean that in my previous screenshots, the scanlines and blur make difficult to manually count the scanlines difference. With these effects disabled, is easier to spot a bigger difference in speed. Of course it has nothing to do in how the program runs
I hope this does not count as necroposting, but I would like to add some details in case someone reaches this thread in the future:
It seems to be some relationship between the value the SCNCNT is reset (ld [hl],n ; @$0c96
) to and the values REPCNT is initially set, then reset (ld a,n ; @$0d49
and ld [hl],n ; @$0cf0
). The SCNCNT is loosely correlated to the MSX generation, but there are differences between 50/60Hz and every some particular models:
- Most MSX 1 do scan every 3 frames (and repeat key every scan after a delay of 13 scans).
- But several MSX 1 50Hz (Casio MX-15, Sony HitBit 10P/20P/101P/201P/501P, Yamaha CX5MII and maybe others) do scan every frame (and repeat key every 3 scans after a delay of 39 scans). I guess this was a decision to make the typing more responsive and, as there are more CPU time per frame, performance is not worse than 60Hz counterparts. Note the values of the repeat key are adjusted so the feeling is similar. Curiously enough, Sony HitBit 55P/75P/75D do not fall into this category, but the previous one (scan every 3 frames).
- Some MSX 2/2+ 60Hz (Sony HitBit F1/F1XD/F1XDJ/F1XV; maybe other computers as well) do scan every two frames (and repeat key every scan after a dealy of 20 scans).
- Sony HitBit F9P do scan every frame, but repeat key every 2 scans after a delay of 32 scans. The Russian variant of this computer falls into the previous category.
Disclaimer: Please take this with a grain of salt. I have found this doing something completely unrelated, so I haven't checked all the BIOS (but the ones that were relevant for me) and I haven't verified one by one I was using the right dump, but trusted the filenames.