CPU tests
Important
- Always start Staging with
--noprimaryconf.- Use the release build for the tests, then repeat with the debug build to make sure no asserts are tripped.
- Optional, but recommended — create a custom release build for testing:
- In
dosbox.cpp, findincrease_ticks()and change#if 0to#if 1inside the function, then create a release > build. This will log the momentary cycles values in auto-cycles mode.
Use the included #cpu-tests.zip test pack for the tests:
Contents:
-
TESTS\KOPIO.EXE— Late '90s protected mode demo. Needs high cycles values to run smoothly, so the lower FPS gives a good indication that lower cycles values are in effect. -
TESTS\TUBE.COM— Real mode 256-byte intro (yes!) that needs high cycles values to run smoothly (around ~80k to get stable FPS without frame drops). -
TESTS\FT2.EXE— Fast Tracker II. It uses protected mode, so it's useful to get quickly in and out of pmode. -
TESTS\SC.BAT— Helper batch file to print the current modercpu_*settings to the console. -
NO\*.*— No by NoooN (demo). Uses protected mode, good general test case. -
STARS\*.*— Stars by NoooN (demo). Uses protected mode, good general test case, and it does some weird switching between real and pmode at startup with highlighted a few regressions with my modern implementation (the whole process crashed after a few seconds of starting the demo).
"Modern" cpu_* tests
Basic tests
- Start with
--noprimaryconfand the includeddosbox.conf(note all cycles settings are commented out; don't touch them yet). - Confirm there are no cycles related warning messages in the logs with
CPU:prefix. - Run
SC.BATand confirm the default values:cpu_cycles— 3000cpu_cycles_protected— 60,000cpu_throttle— false
- Run
FT2. Now we're in pmode, so confirm the title bar shows60000 cycles/ms. - Exit to DOS (Esc, then Enter).
- We're back to real mode, confirm the title bar shows 3000 cycles.
Fixed settings
- Start with
--noprimaryconfand the includeddosbox.conf. - Set
cpu_cycles 1234and confirm the setting in the title bar. - Set
cpu_cycles_protected 65432(no change in the title bar, we're in real mode). - Start
FT2, confirm 65432 cycles in the title bar. - Exit, confirm 1234 cycles has been restored.
- Press Cmd/Ctrl+F12 twice to increase the real mode cycles; the title bar should show 1493 cycles.
- Confirm the
cpu_cyclessetting is kept in sync (just runcpu_cycles, orSC.BAT). - Start
FT2, press Cmd/Ctrl+F12 three times so the title bar shows 37866 cycles. - Exit, confirm the title bar shows 1493 cycles, then run SC and confirm the
cpu_*settings are synced:cpu_cycles— 1493cpu_cycles_protected— 37,866cpu_throttle— false
- Start
FT2one more time to double-check 37866 is the new pmode setting. - Exit and confirm we're back to 1493 cycles in real mode.
Throttled — general
- Start with
--noprimaryconfand the includeddosbox.conf. - Run
cpu_throttle on, confirm the title bar shows "3000 cycles (throttled)". - Repeat the "Fixed settings" tests and make sure throttled mode stays on.
- At the end, turn off throttling with
cpu_throttle off. Confirm that the last set settings have been retained in both real and protected mode.
Throttling — real mode
- Start with
--noprimaryconfand the includeddosbox.conf. - Set
cpu_throttle on, thencpu_cycles 1000000(1 million). Confirm in the logs that the momentary cycles value however aroud 300k-400k actual cycles. - Start
TUBE. Confirm the title bar shows 1000000 cycles, the animation is smooth with no frame drops, and the momentary cycles value is around 100-140k in the logs. - Exit with
Esc, then turn off throttled mode (cpu_throttle off). Confirm the title bar still shows 10000000. RunSC, confirmcpu_cyclesis still 10000000. - Turn throttling on again, set
cpu_cycles 30000. - Start
TUBE, confirm the momentary cycles stays at30000. - Don't exit yet! 😎
Throttling — protected mode
- Start
KOPIO. Confirm we're in 60,000 cycles throttled mode (that's the protected mode default). Note the frame rate is quite choppy. - Exit back to real mode with
Esc, confirm we're in 1,000,000 cycles throttled mode. - Set
cpu_cycles_protected 200000then startKOPIO. Note the frame rate is now 100% smooth. - Esc, confirm the correct real mode setting, then start
KOPIOagain. - Use Cmd/Ctrl+F11 to decrease the cycles to under 100k, note the animation became choppy.
- Increase the cycles with Cmd/Ctrl+F12 until the animation becomes smooth again, they keep increasing until about 1 million cycles. Confirm in the logs that the momentary cycles values is around 400-500k because of the throttling. Note down the cycles number in the titlebar.
- Exit with Esc, the restart
KOPIO. Confirm the previous protected cycles setting was restored. - Check with
SC.BATthat the config values are correct and reflect the cycles values set by the hotkeys.
Max cycles — global
- Start with
--noprimaryconfand the includeddosbox.conf. - Set
cpu_cycles max. Confirm the title bar shows "max cycles/ms" and the logs will show the momentary cycles value (around 350k on my M1 Mac). - Also confirmt the following warning appeared in the logs:
CPU: Invalid 'cpu_cycles_protected' setting: '60000'; fixed values are not allowed if 'cpu_cycles' is 'max', using 'auto'
- Run
SC.BAT, and confirm the config setting values:cpu_cycles—maxcpu_cycles_protected—autocpu_throttle—false(has no effect in "max cycles" mode)
- Start
TUBE(real mode). Confirm the title bar still shows "max cycles/ms", the animation is smooth with no frame drops, and the momentary cycles value is around 100-140k in the logs. - Confirm the increase/decrease cycles hotkeys have no effect.
- Exit with Esc, then start
KOPIO(protected mode). Confirm the same things as per above. - Set
cpu_throttle onand confirm "(throttled)" doesn't show up in the title bar after the cycles setting in real mode (so you should see "max cycles/ms" only).
Max cycles — protected mode only
- Start with
--noprimaryconfand the includeddosbox.conf. - Set
cpu_cycles_protected maxandcpu_cycles 20000. Confirm the title bar shows 20,000 cycles. - Start
TUBEand confirm it's really laggy at 20k cycles. - Modify the current cycles value with the hotkeys, then exit with Esc.
- Confirm that the real mode cycles value is retained.
- Start
KOPIO(pmode). The animation should be perfectly smooth at "max cycles", confirm "max cycles" shows up in the title bar, etc. - Exit with Esc, confirm the previously set real mode cycles setting is restored.
- Set
cpu_throttle onand confirm "(throttled)" doesn't show up in the title bar after the cycles setting in protected mode (so you should see "max cycles/ms" only).
Cycles limits
- Keep pressing the decrease cycles hotkey and confirm you can't go below 50.
- Set
cpu_throttle onandcpu_cycles 1000000(1 million). Keep pressing the increase cycles hotkey and confirm you can't go above 2,000,000. - Try setting
cpu_cyclesandcpu_cycles_throttledvalues outside of the valid 50 to 2,000,000 range. Confirm a warning is logged and the value is clamped to the valid range. Also confirm withSC.BATthe config settings are kept in sync with the actual clamped values.
"Legacy mode" tests (cycles setting)
TODO
General
How-to's
- Adding utilities
- Applications
- Config file examples
- Dual-mouse gaming
- Getting started
- Instant launch
- Joysticks and Gamepads
- Keymapper
- Multiplayer & serial ports
- Windows
Lists
- AUTOTYPE candidates
- CDDA / GUS / MIDI games
- DOS/32A compatibility
- Dual OPL2 and OPL3 games
- Games with enhanced Tandy & PCjr graphics and sound
- Shaders
- Special keys
Audio
- Audio mixer signal flow diagram
- Audio configuration recommendations
- GUS enhancements
- MIDI
- Sound cards
- True 16-bit audio games
Video
Issues
Dev
- How to contribute
- Release process
- Audio tests
- CPU tests
- DOS tests
- Input tests
- Performance tests
- Video tests — Video modes
- Video tests — CRT shaders
- Video tests — Presentation
- Learning DOS programming
- Intel compiler tips