Is a MSX2 machine slower than a MSX1 one?

Page 2/3
1 | | 3

By gdx

Prophet (3036)

gdx's picture

16-10-2019, 12:36

MSX2 are slower since code has been added in almost all BIOS routines of the main ROM instead of add specific routines to the MSX2. MSX2+ and Turbo R are also slower than MSX2 since code has been added in Sub-ROM routines and in some other routines.

By Grauw

Ascended (8452)

Grauw's picture

16-10-2019, 13:25

Metalion wrote:
Grauw wrote:

Either way, the simplest code solution is to manually write SCNCNT yourself (e.g. in a H.TIMI hook). I think this is better than making a custom ISR. Set it to 0 continuously to make it always take the fast path (and scan manually).

Not sure about that. The BIOS code in MSX1 is :

LD      HL,SCNCNT
DEC     (HL)            ;Need to scan?
JR      NZ,INTRET       ;No, return soon
LD      (HL),3          ;Time delay of first repeat

Therefore it scans when SCNCNT is equal to zero.
Is MSX2 BIOS different ?

It scans when SCNCNT is equal to zero after the decrement. So setting SCNCNT to 0 means it will skip it for 255 frames. Setting it to 1 means it will do it immediately at the next opportunity.

Btw NTSC MSX2 BIOS does:

LD      HL,SCNCNT
DEC     (HL)            ;Need to scan?
JR      NZ,INTRET       ;No, return soon
LD      (HL),2          ;Time delay of first repeat

And PAL MSX2 BIOS does:

LD      HL,SCNCNT
DEC     (HL)            ;Need to scan?
JR      NZ,INTRET       ;No, return soon
LD      (HL),1          ;Time delay of first repeat

By jltursan

Prophet (2179)

jltursan's picture

16-10-2019, 19:12

I suposse the NTSC machines are trying to find a balance between the higher frequency and the keyboard scanning period. The MSX1, having the higher delay between scans, doesn't seems sloppy at all, I never thought that my MSX1 was feeling unresponsive.

Definitely, the PAL MSX2 BIOS seems a bit overkill and makes me think about patching the ROM to try a faster one :-)

By PingPong

Prophet (3448)

PingPong's picture

16-10-2019, 19:23

does it affect also the autorepeat speed?

By Grauw

Ascended (8452)

Grauw's picture

16-10-2019, 20:07

On PAL MSX1 repeating a key 100 times takes 300 frames (5,98 s)
On PAL MSX2 repeating a key 100 times takes 200 frames (3,99 s).
On NTSC MSX2 repeating a key 100 times takes 200 frames (3,34 s).

The key repeat time is determined by REPCNT, on PAL MSX1 and NTSC MSX2 this is reset to 1, and on PAL MSX2 this is reset to 2, which accounts for the 1201 cycle ISR time difference measured previously.

The initial REPCNT delay value after you press a key for the first time is set to 13 on PAL MSX1 (0.78 s), 20 on NTSC MSX2 (0.67 s), and 32 on PAL MSX2 (0.64 s).

10 I$=INPUT$(1) : I$=INPUT$(1)
20 T=TIME
30 FOR I=0 TO 99
40 I$=INPUT$(1)
50 NEXT
60 PRINT TIME - T

p.s. Note that the ISR enables interrupts after a few hundred cycles, so the ISR can be reentrant and due to this the maximum interrupt response time is a few hundreds of cycles rather than thousands.

By Metalion

Paladin (1006)

Metalion's picture

17-10-2019, 18:21

jltursan wrote:

Definitely, the PAL MSX2 BIOS seems a bit overkill and makes me think about patching the ROM to try a faster one :-)

Alternatively, you can just use H.TIMI (which is called before the test of SCNCNT) to modify its value at your will.

By NYYRIKKI

Enlighted (5382)

NYYRIKKI's picture

18-10-2019, 08:57

Grauw wrote:

On PAL MSX1 repeating a key 100 times takes 300 frames (5,98 s)
On PAL MSX2 repeating a key 100 times takes 200 frames (3,99 s).
On NTSC MSX2 repeating a key 100 times takes 200 frames (3,34 s).

Try the same on Brazilian MSX and you will be bored to death before you get the result. Big smile

Ps. This already mentioned program will report the key repeat rates as well.

By DarkSchneider

Paladin (869)

DarkSchneider's picture

18-10-2019, 11:45

So on brazilian MSX the repeat key is disabled (or almost)?

By jltursan

Prophet (2179)

jltursan's picture

18-10-2019, 12:05

Metalion wrote:
jltursan wrote:

Definitely, the PAL MSX2 BIOS seems a bit overkill and makes me think about patching the ROM to try a faster one :-)

Alternatively, you can just use H.TIMI (which is called before the test of SCNCNT) to modify its value at your will.

Done, and now the european MSX2 it's more in pair with the MSX1. Later I'll upload new pictures to illustrate this and the patch tied to H.TIMI.

By NYYRIKKI

Enlighted (5382)

NYYRIKKI's picture

18-10-2019, 14:17

DarkSchneider wrote:

So on brazilian MSX the repeat key is disabled (or almost)?

I was trying to find out what exact model I meant, but seems that I'm unable to pinpoint it anymore... I have some faint memory that it would have been some Gradiente model, but now that I checked all the models I tried were working more or less normally. If I'm correct the key scan interval was something like 5 and delay between key repeats was something like 1,2 seconds.

Page 2/3
1 | | 3