VDP speed curiousity

Page 3/12
1 | 2 | | 4 | 5 | 6 | 7 | 8

By Daemos

Paragon (1669)

Daemos's picture

16-02-2014, 13:16

Quote:

For that speculation to be true, the turboR's Z80 must be switchable to 5.38MHz too.
Who will test this?

I will try some of that stuff in the future when I have a real turbo-r standing on my desk.

However: from many test results that I have seen concerning that speculation the 5,36 Mhz is not going to help. The VDP itself still runs at 3,58 Mhz. Allthough with 6 Mhz you are still within the boundaries of the wait times of the VDP VRAM corruption still occurs when outing. For example. If you do many outi's to 98h no problem but if you do many out(98h)'s things tend to get nasty. This allready at slomo Z80 speed. Imagine your Z80 gets clocked to 6 Mhz. The VDP will send wait signals but according to the schematics the wait pin isn't connected. This means that either the s1990 or the T9679c halts the cpu for a certain time so no speed up Sad

I have a feeling that The T9679c has built in wait mechanisms to make sure the VDP has time to process all the data even when the Z80 is overclocked. This mechanism causes the 5% slowdown and most propably cannot be circumvented.

On the bright side: If your CPU is overclocked, the time to calculate things shortens leaving more time for the VDP to "think" about matters. at 6 Mhz we are allready talking about 30% speed increase. That is 30% more VDP time left per int. Your VDP processes 5% slower so roughly you gain 25% (yes I know this calculation is way off reality but it gives us a nice idea).

Now the R800 is a different story. Each out to the VDP gives us a 8 us wait penalty. This means a speed decrease of 50% for the VDP! Lets say your program does all the calculations on 1 int and does the screenbuild in the other int. You now need 1,5 int to do the screenbeeld but.. the calculations only in 1/6th of a int. Thus you have some gain. Lucky for us: the Turbo-R can switch to Z80 mode, so you do your calculations with R800 and do the VDP stuff with the Z80. At that moment some serious speedgain becomes a reality.

By mars2000you

Enlighted (5470)

mars2000you's picture

16-02-2014, 14:03

I've explored the blueMSX source code, there are delays added by the T9769 and by the S1990 :

#define delayVdpIO(r800, port) do {                                          \
    if ((port & 0xfc) == 0x98) {                                             \
        delayT9769(r800);                                                    \
    }                                                                        \
    if (r800->cpuMode == CPU_R800) {                                         \
        r800->systemTime = 6 * ((r800->systemTime + 5) / 6);                 \
        if ((port & 0xf8) == 0x98) {                                         \
            if (r800->systemTime - r800->vdpTime < r800->delay[DLY_S1990VDP])\
                r800->systemTime = r800->vdpTime + r800->delay[DLY_S1990VDP];\
            r800->vdpTime = r800->systemTime;                                \
        }                                                                    \
    }                                                                        \
} while (0)
    switch (r800->cpuMode) {
    default:
    case CPU_Z80:
   (....)
       r800->delay[DLY_S1990VDP]  = freqAdjust * 0;
       r800->delay[DLY_T9769VDP]  = freqAdjust * ((r800->cpuFlags & CPU_VDP_IO_DELAY)
   (....)
        break;

    case CPU_R800:
   (....)
       r800->delay[DLY_S1990VDP]  = freqAdjust * 57;
       r800->delay[DLY_T9769VDP]  = freqAdjust * ((r800->cpuFlags & CPU_VDP_IO_DELAY) ? 1 : 0);
   (....)
        break;
    }
/*****************************************************
** CpuFlags
**
** CPU configuration
******************************************************
*/
typedef enum { 
    CPU_VDP_IO_DELAY = 0x0001,
    CPU_ENABLE_M1    = 0x0002,
} CpuFlags;
    UInt32 cpuFlags = CPU_ENABLE_M1;

    if (machine->board.type == BOARD_MSX_T9769B ||
        machine->board.type == BOARD_MSX_T9769C)
    {
        cpuFlags |= CPU_VDP_IO_DELAY;
    }

By sd_snatcher

Prophet (3014)

sd_snatcher's picture

16-02-2014, 16:15

Quote:

T9769B and T9769C are pin-compatible. The Z80 core in T9769B can only work at standard speed (1x - ~3.58MHz), while T9769C Z80 core can be soft-switched to "turbo" mode (1.5x - ~5.4Mhz). All Panasonic MSX2+ computers are equiped with T9769C (A1FX, WX and WSX), while all other MSX2+ models, both from Sanyo and Sony, are using T9769B

There are two incorrect statements above:

1) The Sony MSX2+ machines have no T9769 inside. The MSX-Engine used on those machines is the S1985, and the Z80 is a discrete part.

2) The T9769 versions have nothing to do with the turbo feature (probably both can support turbo just fine). The turbo feature of the Panasonic MSX2+ machines is implemented by a separate custom IC: the 6140140. This chip isn't present on either Sanyo MSX2+ or Turbo-Rs. This is why the Z80 is stuck to 3.57MHz on those machines.

By mars2000you

Enlighted (5470)

mars2000you's picture

16-02-2014, 17:08

For the clarity :

- Sony MSX2+ : S-1985
- Sanyo MSX2+ and Panasonic MSX2+ : T-9769B (+ 6140140 on Panasonic MSX2+)
- Panasonic TurboR : T-9769C and S-1990

I've remade the tests on blueMSX with the Sony HB-F1XDJ MSX2+ machine, the results are the same (or very close) as for the generic MSX2 Japanese machine :

test 1 : 122217 - test 2 : 79092 - test 3 : 7284 - test 4 : 25918 - test 5 : 18830 - test 6 : 9033

The generic MSX2+ Japanese machine in blueMSX is actually based on Panasonic FS-A1WX (firmware removed and replaced by X-BASIC2, 512 kb RAM, added PAC S-RAM, MSX-AUDIO chip and MoonSound rom), while the generic MSX2 Japanese machine is based on Panasonic FS-A1F and boosted in a similar way, including addition of MSX2+ MUSIC rom.

By Manuel

Ascended (15450)

Manuel's picture

16-02-2014, 17:16

Good that you now clarify which machines they actually are, because these generic machines are not good to run benchmarks on. You can't compare them to real machines, because they don't exist in reality.

By Daemos

Paragon (1669)

Daemos's picture

16-02-2014, 17:43

Quote:

2) The T9769 versions have nothing to do with the turbo feature (probably both can support turbo just fine). The turbo feature of the Panasonic MSX2+ machines is implemented by a separate custom IC: the 6140140. This chip isn't present on either Sanyo MSX2+ or Turbo-Rs. This is why the Z80 is stuck to 3.57MHz on those machines.

Didn't knew that one. So basicly the cpu clock in the T9679x is fed externally?

By Manuel

Ascended (15450)

Manuel's picture

16-02-2014, 18:10

Quote:

MSX2+ Japanese and TurboR Japanese - test 1 : 120155 - test 2 : 77711 - test 3 : 6917 - test 4 : 25009 - test 5 : 18049 - test 6 : 8848

on openMSX (FS-A1GT):
120140
77702
6916
25006
18048
8848

Real GT to be posted soon (run via Nowind).

By mars2000you

Enlighted (5470)

mars2000you's picture

16-02-2014, 18:21

It is also interesting to compare both CPU modes of turboR for the VDP speed. Tests made on generic Turbo-R machine in blueMSX, this machine is based on GT (firmware removed and replaced by X-BASIC2, added MSX-AUDIO chip, MoonSound ROM and PAC S-RAM).

Z80 mode (under DOS 1)
test 1 : 120155 - test 2 : 77711 - test 3 : 6917 - test 4 : 25009 - test 5 : 18049 - test 6 : 8848

R800 mode (under DOS 2)
test 1 : 247003 - test 2 : 148009 - test 3 : 4821 - test 4 : 24601 - test 5 : 15112 - test 6 : 15032

By hit9918

Prophet (2853)

hit9918's picture

16-02-2014, 18:34

All the many board chips. I would like to know more general things.
Is 5.4Mhz mode too shielded against too fast VDP acess.
Does the benchmark maybe run faster in 5.4Mhz mode.
Does MSX2+ have a bios call for toggeling Turbo mode.

By mars2000you

Enlighted (5470)

mars2000you's picture

16-02-2014, 19:00

Turbo mode on Panasonic MSX2+ : OUT 64,8: OUT 65,0 - Back to normal mode with OUT 64,8: OUT 65,1.

As the tests are under DOS, you need to go to BASIC first, enter the OUt's, then go back to DOS with CALL SYSTEM.

Tests made in blueMSX with the Panasonic FS-A1WX machine (the turbo mode is not included in the generic MSX2+ machine of blueMSX) :

Normal mode
test 1 : 120155 - test 2 : 77711 - test 3 : 6917 - test 4 : 25009 - test 5 : 18049 - test 6 : 8848

Turbo mode
test 1 : 180472 - test 2 : 116734 - test 3 : 10388 - test 4 : 37567 - test 5 : 27108 - test 6 : 13290

Page 3/12
1 | 2 | | 4 | 5 | 6 | 7 | 8