VOGONS

Common searches


First post, by codyw1996

User metadata
Rank Newbie
Rank
Newbie

I'm using DOSBox Enhanced Community Edition r4052

I know how to increase/decrease the cycle rate (ctrl+F11/F12)
I know that you can adjust the granularity of the increase/decrease rate via the configuration file.

What I'm looking to do is switch with just a single hotkey from 20,000 cycles down to 100 cycles.
Then binding another hotkey to reverse it back to 20,000 (Or use the same hotkey to toggle the two cycle rates.)

This would be extremely convenient for me. I'm using DOSBox as an assembly development environment.

Is there any way to do this?

Reply 1 of 7, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

no, although setting

[cpu]
cycles=20000
cycleup=19900
cycledown=19900

does it more or less

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 7, by codyw1996

User metadata
Rank Newbie
Rank
Newbie

Yeah, I thought of that, but sometimes I do want to be able to gradually speed up and slow down.

Technically I could have 2 different copies of DOSBox configured differently...
Isn't there a way to load a different config file with a command?
Maybe I could just wrap two different config files in a batch file with a 1 letter long file name.
I couldn't load it mid program obviously, I don't know.

Reply 3 of 7, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

you can start dosbox with a different configuration file through the -conf switch.
alternatively you can run a batch file inside dosbox that reprograms the numbers for cycles, cycleup,cycle down using config -set

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 7, by Osprey

User metadata
Rank Member
Rank
Member

I've written an AutoHotkey script and compiled it into an executable to do it. Hopefully, you're using Windows.

It allows you to define three preset cycle values and jump to them via hotkeys. There's also a hotkey to return to the default cycles value.

I've written up and included some general instructions in the zip. For your specific usage, though, codyw1996, I recommend setting the following:

cycles=20100
cycleup=1000
cycledown=1000
cyclepreset1=100
cyclepreset2=10100
cyclepreset3=20100

If you don't want to read my included instructions and just want the quick and dirty: add those lines to your .conf file, copy the .exe to the same folder, run it and use Shift+F10 to go to 100 and Shift+F12 to go to 20100.

You want to use 20100 instead of 20000 since you want cyclepreset1 to be only 100 and, ideally, cycles and the preset values should all be separated by multiples of cycleup/cycledown. That's because the script uses the cycleup and cycledown hotkeys repeatedly to arrive at the preset values. If you were to set cycles and cyclepreset3 to 20000, it would cycle down 1000 at a time until it stopped at 1000 (since one more would drop it below the target of 100 and be 0, besides), which would be 10x as fast as you want. 20100 allows it to cycle down 20 times to arrive exactly at 100. Alternately, you could set cycleup/cycledown to 100 so that you could use 20000, but you probably wouldn't enjoy manually cycling up or down only 100 at a time.

Attachments

Last edited by Osprey on 2017-11-05, 18:55. Edited 3 times in total.

Reply 5 of 7, by Osprey

User metadata
Rank Member
Rank
Member

I've expanded the utility to support 3 presets and to control the exit behavior with an extra value added to the .conf file, both to reduce the need for people to edit the script to suit their needs. I've replaced the attachment above and updated the rest of the post. The one person (woo!) who downloaded the first version may care to re-download it.

Reply 6 of 7, by codyw1996

User metadata
Rank Newbie
Rank
Newbie

Thanks, I kinda wish I would of checked back before writing a quick and dirty timing procedure using the RTC.
I can just pass it a number of seconds to delay.

I'll still make some use of your script, i'm sure.

Reply 7 of 7, by Osprey

User metadata
Rank Member
Rank
Member

Yeah, I was wondering where you went. If you find it usable, I'm glad. I started out just trying to whip something up for you, but ended up having fun making it better and a general solution for anyone who might need it. Hopefully, more people than just you have a use for it.

BTW, I updated it again since you last downloaded it. Now, it can launch DOSBox for you and can be used with more than one DOSBox window (if you run it more than once). If you have any feature requests or suggestions or if you think that I should change the default value of cyclepresetrunexit, I'm happy to listen. I might upload this somewhere when I'm done tweaking, since it seems to be rounding into something that people may generally find useful.