Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   Dosbox Memory Wizard (http://www.abandonia.com/vbullet/showthread.php?t=13595)

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:

Data 26-02-2007 07:53 PM

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

Data 28-02-2007 07:24 AM

it seems the script got even more advanced
http://vogons.zetafleet.com/viewtopic.php?t=14619

Japo 28-02-2007 08:21 AM

Better use input parameters, it's more agile. For example, EMS.BAT:

Code:

@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:

Code:

@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

Quote:

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. :)

Quote:

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...

Japo 28-02-2007 09:20 PM

To check the settings in advance use the same structure as what Data linked:

Code:

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

Quote:

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 current time is 05:45 PM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.