Got it, the first part. It's actually very obvious from 'gberet' driver since it defines both original and bootleg PCBs, and funny enough original refreshes screen at 30 while bootleg at 60 FPS:
*gberet static struct MachineDriver machine_driver_gberet =
{
/* basic machine hardware */
{
{
CPU_Z80,
18432000/6, /* X1S (generated by a custom IC) */
readmem,writemem,0,0,
gberet_interrupt,32 /* 1 IRQ + 16 NMI (generated by a custom IC) */
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
*gberetb ...
gberet_interrupt,16 /* 1 IRQ + 8 NMI */
}
},
60, DEFAULT_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
--> "gberet_interrupt,16" : defines how many times will main game loop be updated per animation frame, this is usually "1", and gberet seem to be rather odd exception with 16 interrupts per 1/60 of a second. Anyway, the point is, by changing this number we practically redefine game speed in relation to display refresh rate, which is exactly what my previous modification needed to get the speed back down to normal.
So, applying this to "popeye.c"...
static struct MachineDriver machine_driver_popeyebl =
{
/* basic machine hardware */
{
{
CPU_Z80,
4000000, /* 4 Mhz */
readmem,writemem,readport,writeport,
nmi_interrupt,2
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
CHANGE: "nmi_interrupt,1"
CHANGE: "60, DEFAULT_60HZ_VBLANK_DURATION"
Similarly, in 'gberet' change the number of loops from 32 to 16, together with changing 30 to 60 in the line below, just like it is defined for bootleg gberet PCB in the same file. Ok, this was easy since 30Hz mode looks like hack/derivate of 60Hz to start with, but unfortunately this logic can not help us with setting up global arbitrary refresh rates (without impacting original game speed) ...unless perhaps we define number of loops as float instead of integer, but that just sounds like awful thing to do with 'counter' variable.
Btw, I want to lock all games to 50Hz as some of my SCART TVs (PAL) can't quite sync above 53-54Hz, but if you have arcade monitor then you'd probably want to lock games to 60Hz, and if you use PC monitor you might even go for 100Hz and above, but now this 'temporal resolution' would be unrelated to game spatial resolution properties such as size/shape and number of pixels. Yes, no? Good, bad? Possible, impossible? Authentic emulation, or unforgivable hack?