aoineko-fr / MSXgl

The MSX Game Library in C language
113 stars 9 forks source link

VDP_SetMode should not touch the frequency setting #8

Closed Jeroen-Smael closed 2 years ago

Jeroen-Smael commented 2 years ago

When I do VDP_SetMode(VDP_MODE_SCREEN5); the VDP frequency is set to 50Hz, even if it was set to 60Hz before. This is undesirable behavior. The VDP frequency should not be touched.

Reproduction scenario: Program snippet:

#include "msxgl.h"
#include "vdp.h"

void main()
{
    VDP_SetMode(VDP_MODE_SCREEN5);
    while (true) {
        // no need to do anything
    }
}

Start with e.g. CBIOS MSX2+ (which runs at 60Hz normally)

After the screen has been set, you can see in the openMSX / menu / advanced / toys and utilities / info panel that the frequency has been changed to 50Hz.

aoineko-fr commented 2 years ago

To prevent 50 Hz to be set by VDP_SetMode() on MSX2 you can either, in your msxgl_config.h: