realnc / dosbox-core

A DOSBox core for use in RetroArch and other libretro frontends.
GNU General Public License v2.0
42 stars 16 forks source link

CPU Cycle Up/Cycle Down (Ctrl-F12/Ctrl-F11) Not Working? #42

Closed s-ac closed 2 years ago

s-ac commented 2 years ago

I am having an issue with not being able to increase/decrease cycles in game using Dosbox-core r4473 0654bd7 in RetroArch 1.10.2 on Windows 10. I am not certain if I am doing something incorrectly, or if the cycle adjustment functionality is not working as expected.

I can set cycles properly at the command line and through a conf file. The problem is with using the hotkeys Ctrl-F12 and Ctrl-F11 to adjust on the fly in game. I can't get these to respond either with Retroarch's Game Focus Mode on or off. I am not seeing any noticeable cycle differences even when cycleup and cycledown are set to extreme numbers that should be easily noticeable. It's not clear if the core is even seeing these at all, although all other inputs seem to be working.

I am loading games by having Retroarch load the game's individual conf files where I have cycles set to various fixed numbers depending on the game (for example: cycles = fixed 80000). Dosbox-core is reading these conf files since entering "config -get cpu" returns the expected values at the DOS command prompt, and there are noticeable changes in game when the cycles values are changed. However, the values for cycleup and cycledown do not seem to be used despite being properly reported as well by "config -get cpu".

I am not sure if I am doing something wrong (perhaps there is some other way to adjust cycles besides Ctrl-F12/Ctrl-F11 in Dosbox-core? I couldn't find anything relevant in the README). But I have not been able to figure out how to make this work. Is it perhaps broken?

realnc commented 2 years ago

The cycle hotkeys are not supported. Can't you use the core options UI to change cycles? (It's in the "Specs" section of the core options.) You'd have to remove the cycles field from the conf file first though, otherwise the cycles core options get locked.

I'll look into implementing Ctrl+F11/F12 to change cycles, but since you can just change cycles in the core options UI, it doesn't seem these hotkeys are actually needed.

s-ac commented 2 years ago

For many games this is not an issue - they work fine with a fixed cycle count at launch and don't need to be changed further.

It would be helpful for some games, however, to be able to dynamically change the cycles on the fly. One example is Syndicate Wars which is very cycles sensitive. Some parts of the game are too fast (especially the menus) at one setting and then too slow at other parts.

If I understand you correctly, I would need to use the default settings for the CPU in order to be able to use the Retroarch UI to adjust the cycles mid-game? This might be a partial solution, but it really would be helpful to have more fine control. In other words, be able to set a specific fixed cpu cycle at at launch and then make needed adjustments when the action heats up or slows down.

Thanks for working on this project. It's really great to be able to use DOSBox with Retroarch.

realnc commented 2 years ago

If I understand you correctly, I would need to use the default settings for the CPU in order to be able to use the Retroarch UI to adjust the cycles mid-game?

No. You only need to remove (or comment-out) the cycles field in your conf file.

s-ac commented 2 years ago

No. You only need to remove (or comment-out) the cycles field in your conf file.

I have tried this and it does work to allow for the RetroArch UI to change the cycles during the game.

In regards to the Ctrl-F11/F12 hotkeys not being needed: in my opinion it's not a full replacement for the hotkeys for two reasons. The first is that it doesn't allow the game to be launched at a specific fixed cycle count, and the second is that it is much more cumbersome to use the menus than the hotkeys. It is something I miss in DOSBox-core from the DOSBox standalone when in most every other aspect DOSBox-core is superior.

I don't know how much effort it would be to implement the Ctrl-F11/F12 hotkeys, but it would be a QoL improvement for some games in my view.

I suppose this is more a feature request at this point than a bug report.

realnc commented 2 years ago

Feature added in 4ca514a4bd6c9e044244719d1847562ffedc3b71. CTRL+F11 and CTRL+F12 can now be used to decrement/increment CPU cycles. The cycledown and cycleup values are also adjustable in the core options now.

realnc commented 2 years ago

@s-ac Btw, forgot to mention that RetroArch might not forward the Cttl+F11/12 keys to the core unless you have "Game Focus" activated. By default, Game Focus is toggled on/off with the ScrollLock key.