Turbo R slower than MSX/MSX2+ ?

Page 1/2
| 2

By Bengalack

Expert (118)

Bengalack's picture

06-05-2020, 18:55

I have no access to real HW when it comes to Turbo R, so I wonder if the provided "speed-test" is accurate. In the image below the 3 different machines are running the same sample program. I set the background color at different parts of the code.

There is no normal interrupt being run. 0038 is fully dedicated to this program in the screenshots.

Red, red and crimson are interrupt-code. All other parts are mainloop. Black is "nothing" (busy waiting).


(Click to enlarge or open in new frame)

The turbo r (in the middle) behaves very strange: The first red block is bigger. That there are no brown colors - I don't understand, and that the gray part is so much bigger (takes longer time), is problematic.

I'm sure this is a known issue --I just haven't been here long enough :)

Login or register to post comments

By Daemos

Paragon (1710)

Daemos's picture

06-05-2020, 19:06

Access to vdp on turbo-r is significantly slower than other msx types so yes vdp behaviour will be different on turbo-r

By Grauw

Ascended (8927)

Grauw's picture

06-05-2020, 19:32

The turboR in Z80 mode is the same speed as any MSX, but there are the following notes:

1. The standard interrupt routine takes a little longer because it includes MIDI handling (but you’ve disabled it).

2. The VDP access in Z80 mode has 1 extra wait cycle per VDP access (@ 3.58 MHz). This is also the case on some MSX2+ machines, some even have two extra cycles! It’s not a super significant difference but it can matter sometimes.

3. In R800 mode it enforces a strong wait of up to 52 extra cycles (@ 7.16 MHz) between VDP I/O instructions, so if you access it faster than that it slows down the CPU until it reaches that time. So if you do bulk data transfer to VRAM it will actually be slower than it is in Z80 mode.

So it depends on what you’re doing in those areas that grew larger, but if it is writing to VRAM then that slow-down is probably due to that VDP wait in R800 mode. You can consider using Z80 mode, or keep using R800 mode and gain the performance back elsewhere. The absence of the brown area is probably because it’s finished so quickly that it is done before the VDP draws the lines on the top. Note there are 22 lines of blanking between the bottom and top of the screen that are not visible in the emulator.

By Bengalack

Expert (118)

Bengalack's picture

06-05-2020, 20:05

Thanks for the quick response guys!

I'm not sure what mode I run in, I just start up the emulator with no settings, although I think I read somewhere that it starts in z80 mode when booting from msxdos1. Which I do.

Yes, the gray area (after red line) + light blue (after crimson) are heavy pumping of data. Loop with 32 rolled out OUTIs pr block (=one "tile"-line in screen 4). The gray area is 16 lines and the lightblue is 7 lines. So, a lot of VDP-writing.

The first red block is ram->vram pump as well. Brown/dark blue is "plain logic".

Hmm.. I need to figure out how to control and verify what mode I am running.

By Bengalack

Expert (118)

Bengalack's picture

06-05-2020, 20:06

The above is 60Hz BTW

By Grauw

Ascended (8927)

Grauw's picture

06-05-2020, 20:21

Cartridges always boot in Z80 mode. I think whether DOS boots in Z80 or R800 mode depends on whether the disk is formatted for DOS2 (not necessarily whether it then boots into DOS1). If you use the openMSX dir-as-disk feature it will be formatted for DOS2 probably.

In openMSX check with get_active_cpu.

You can change the CPU mode with the CHGCPU BIOS call.

On the one hand it’s nice to use the R800 power when it’s available and you have a good use for it. However if the game needs to runs smooth on MSX2+ as well and you really have no good use for the R800 CPU power, it can be simpler to just stick to Z80 mode so that you don’t have to deal with different VDP access bandwidths and OPLL sound chip waits. This is what I do in the game I’m working on as well.

By Bengalack

Expert (118)

Bengalack's picture

06-05-2020, 20:21

Yup. It's says:
r800

Prime target for me (based on nostalgic reasons) is MSX2/9938 and special code for r800 is not a priority.

Thanks for the info! will investigate this little BIOS call Smile

By Grauw

Ascended (8927)

Grauw's picture

06-05-2020, 20:25

Be sure to check the MSX version number at 002DH is >= 3 before calling it.

By Bengalack

Expert (118)

Bengalack's picture

06-05-2020, 20:29

Yes, thanks.

By Bengalack

Expert (118)

Bengalack's picture

07-05-2020, 10:59

I also found this: "but we can force the Z80 mode by holding the '1' key during start up" on this page: https://www.msx.org/wiki/The_Memory

Which made it easy to do a quick check for me. The app behaves perfectly now.

By Grauw

Ascended (8927)

Grauw's picture

07-05-2020, 11:08

Yes Smile.

By the way, I removed the whole sentence "but we can force the Z80 mode by holding the '1' key during start up. Then the main RAM is detected as described above", because the latter part is not true.

Page 1/2
| 2