Go Penguin WIP platformer for MSX 1

Page 11/15
4 | 5 | 6 | 7 | 8 | 9 | 10 | | 12 | 13 | 14 | 15

By Grauw

Ascended (9912)

Grauw's picture

24-06-2021, 01:20

albs_br wrote:

I noted something strange: the game runs smooth on MSX 1, but slows down on 2+ or even worse on Turbo R.

Indeed, there are a few lines of difference from one machine to another.
Why that happens? Is there something to do with how the interruption routines are implemented on each machine?

The T9769 MSX-ENGINE inserts one or two extra wait cycles on every VDP I/O access. Specifically, the T9769A and T9769B add two cycles and the T9769C adds one cycle.

The turboR has a T9769C so it adds 1 extra cycle per VDP I/O. The WSX has a B or C type so depending on the board revision it adds 1 or 2 cycles. The Sanyo MSX2+ computers all add 2 cycles.

As for why this extra wait was added, my explanation is that it was needed for the 5.37 MHz turbo mode that the T9769 supports, although not all computers with this MSX-ENGINE support the turbo mode (only the Panasonic MSX2+es), and it is unfortunately also present in 3.58 MHz mode.

The MSX turboR BIOS interrupt routine also takes a little longer due to the addition of the pause key handling, and MSX-MIDI handling on the GT, though looking at the source I don’t think that’s more than 150 cycles or so (less than a scanline).

By gdx

Enlighted (4498)

gdx's picture

24-06-2021, 01:36

The explanation is also here:
https://www.msx.org/wiki/Z80_Programming

By Grauw

Ascended (9912)

Grauw's picture

24-06-2021, 01:43

gdx wrote:

The explanation is also here:
https://www.msx.org/wiki/Z80_Programming

The M1 wait cycle is present on all MSX computers, and it’s not what I was referring to. The extra VDP I/O cycles are mentioned on the T9769 wiki page though.

By gdx

Enlighted (4498)

gdx's picture

24-06-2021, 01:57

The wiki not say that the M1 wait cycle is not present on all MSX computers. It says only "The MSX-Engine inserts an extra wait in the Z80’s M1 cycle." but if you think the explanation is insuffisant despite the link to your site, please enhance it.

By albs_br

Champion (296)

albs_br's picture

24-06-2021, 04:48

If I understood well, there is no way to work around this issue. I have to program for the worst case (Turbo R)... Not an easy task as I'm too close of the limit of the CPU, and still have more things to implement, such as music.

By thegeps

Paladin (832)

thegeps's picture

24-06-2021, 06:50

Well, your target is msx1. So work for it. It doesn't matter if something could sometimes slow down... but if you really feel that pressure you can do this (I thought to do the same on Freedom Fighter but I didn't, in the end): on msx and higher machines you can force the 50Hz mode, so there are more cycles per frame.

By jltursan

Prophet (2520)

jltursan's picture

24-06-2021, 08:21

That rings a bell to me

It depends on the way you've coded it; but maybe it could explain some things...

By Parn

Hero (645)

Parn's picture

24-06-2021, 13:09

albs_br wrote:

If I understood well, there is no way to work around this issue. I have to program for the worst case (Turbo R)... Not an easy task as I'm too close of the limit of the CPU, and still have more things to implement, such as music.

What if you use R800 mode in turboR? Is it possible at all? That would make MSX2+ the worst case. Not the best scenario but might be better than what you have now.

By gdx

Enlighted (4498)

gdx's picture

24-06-2021, 13:55

Use you the BIOS interrupt routine?

By Grauw

Ascended (9912)

Grauw's picture

24-06-2021, 15:18

gdx wrote:

The wiki not say that the M1 wait cycle is not present on all MSX computers.

Then why did you bring it up?

Page 11/15
4 | 5 | 6 | 7 | 8 | 9 | 10 | | 12 | 13 | 14 | 15