View Full Version : Dosbox Memory Wizard
The Fifth Horseman
26-02-2007, 04:09 PM
Just something I came up with last night and decided to make the concept a reality.
Since DosBox allows command-line based changing of emulation parameters, this little batchfile (I know, I suck at programming <_< ) allows the user to change the EMS/XMS/UMB settings easily. :ok:
Nice one.
You might want to take a look at the db-info.bat created here
http://vogons.zetafleet.com/viewtopic.php?t=14601
It shows some power of the config utility. (things you probably didn't know)
The Fifth Horseman
27-02-2007, 08:53 AM
And it has also shown me how I can do certain things better than I did them in this one.
Thanks!!! :ok:
I was thinking how to code a more extensive config utility without having to do it the way I did this one (grossly inefficient code).
Guess I know what I'll be doing this evening :D
it seems the script got even more advanced
http://vogons.zetafleet.com/viewtopic.php?t=14619
Better use input parameters, it's more agile. For example, EMS.BAT:
@echo off
if %1=="true"**goto true
if %1=="TRUE"**goto true
if %1=="on"****goto true
if %1=="ON"****goto true
if %1=="false" goto false
if %1=="FALSE" goto false
if %1=="off"** goto false
if %1=="OFF"** goto false
config -get "dos ems"
echo.
echo.
goto end
:true
config -set "dos ems=true"
goto end
:false
config -set "dos ems=false"
:end
It sets the EMS emulation as you tell it, or alternatively tells you its status if you type no parameters. There are four ifs for each instance only to make it more user-friendly, you get the idea. This gave me the idea about one that tells you the cycles --in case you're fullscreen-- or alternatively sets them. The second part is easy, although it would be only as foolproof as the CONFIG command itself --in case the user types letters or nothing instead of numbers the cycles are set to 2500:
@config -set "cpu cycles=%1"
But as far as I know you can't tell a BAT file to do something in case the user has *not* typed a given parameter. :(
nitro
28-02-2007, 04:12 PM
I like he idea, but I see there is room for improvement.
I don't know if it's too difficult to check in advance what all the settings are instead of enabling them all.
Maybe it is an idea to use a real programming language like C, because you can use more functions and control structures.
Keep up the good work.
The Fifth Horseman
28-02-2007, 04:17 PM
I don't know if it's too difficult to check in advance what all the settings are instead of enabling them all.[/b]
I've been trying to do that, but it turned out a bit more difficult than it seemed at first. Still trying, though. :)
Maybe it is an idea to use a real programming language like C, because you can use more functions and control structures.[/b]
It's an idea, except I know less about programming in C than I do about voodoo magic. :P Maybe one day...
To check the settings in advance use the same structure as what Data linked:
config -get "dos ems" > nul
if %CONFIG%=="true"**...
if %CONFIG%=="false" ...
Replace the "..." with commands, a goto one if you want more than one command to be executed for each option. You wouldn't need the %CONFIG% variable to be created if the CONFIG command returned errorlevels, but it always returns 0. But still command prompt input is faster than menus. I won't start with C code, I'm not that bored right now. :P
nitro
28-02-2007, 09:54 PM
It's an idea, except I know less about programming in C than I do about voodoo magic. :P Maybe one day...
[/b]
I don't think you can configure Dosbox with Voodoo magic. :D
Maybe when I'm really bored then I'll try a version in C or maybe in Quickbasic, but right now I think I already have enough unfinished projects going.
Good luck with your project.
win98
02-03-2007, 01:51 AM
Nice one the_fifth_horseman. I like it as I can use it to do stuff I never knew DOS box could do.
The Fifth Horseman
02-03-2007, 11:43 AM
<div class='quotetop'>QUOTE(Japofran @ Feb 28 2007, 11:20 PM) 281341</div>
To check the settings in advance use the same structure as what Data linked:
config -get "dos ems" > nul
if %CONFIG%=="true"**...
if %CONFIG%=="false" ...
Replace the "..." with commands, a goto one if you want more than one command to be executed for each option. You wouldn't need the %CONFIG% variable to be created if the CONFIG command returned errorlevels, but it always returns 0. But still command prompt input is faster than menus. I won't start with C code, I'm not that bored right now. :P
[/b]
Tried that, doesn't seem to work. In fact, DB-info doesn't seem to cope well with any of the DosBox versions I have installed on my PC - reports v0.65 as 0.63 or lower, and for 0.66 it doesn't return the values for settings.
I haven't tried DB-INFO.BAT but I've just tried my code with DOSBox 0.65 and it works all right. (??)
The Fifth Horseman
05-03-2007, 08:50 AM
Figured out why. Turned out that after leaving Norton everything worked allright.
So I went and re-worked the code (adding appropriate error messages). The entire thing weighs in at 2019 bytes now, 1394 without the chunks responsible for error reporting.
I might actually expand this thing to allow control of most DosBox settings. ^_^
nitro
05-03-2007, 03:33 PM
Wow this look great :ok:
I never thought you could make it like this just in a bat file. And the code also looks ok.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.