Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 26-02-2007, 04:09 PM   #1
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

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. k:
__________________

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Old 26-02-2007, 07:53 PM   #2
Data
retired
 
Data's Avatar


 
Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
Default

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)

__________________
Flowing with the stream of life
Data is offline                         Send a private message to Data
Reply With Quote
Old 27-02-2007, 08:53 AM   #3
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

And it has also shown me how I can do certain things better than I did them in this one.

Thanks!!! k:

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
__________________

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Old 28-02-2007, 07:24 AM   #4
Data
retired
 
Data's Avatar


 
Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
Default

it seems the script got even more advanced
http://vogons.zetafleet.com/viewtopic.php?t=14619
__________________
Flowing with the stream of life
Data is offline                         Send a private message to Data
Reply With Quote
Old 28-02-2007, 08:21 AM   #5
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

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.
__________________
Life starts every day anew. Prospects not so good...
Japo is offline                         Send a private message to Japo
Reply With Quote
Old 28-02-2007, 04:12 PM   #6
nitro
Forum hobbit

 
Join Date: Jan 2007
Location: Nunspeet, Netherlands
Posts: 31
Default

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.
nitro is offline                         Send a private message to nitro
Reply With Quote
Old 28-02-2007, 04:17 PM   #7
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

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

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Old 28-02-2007, 09:20 PM   #8
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

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
__________________
Life starts every day anew. Prospects not so good...
Japo is offline                         Send a private message to Japo
Reply With Quote
Old 28-02-2007, 09:54 PM   #9
nitro
Forum hobbit

 
Join Date: Jan 2007
Location: Nunspeet, Netherlands
Posts: 31
Default

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.
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.
nitro is offline                         Send a private message to nitro
Reply With Quote
Old 02-03-2007, 01:51 AM   #10
win98
In the loop on hardware.
 
win98's Avatar

 
Join Date: Apr 2005
Location: Wellington, New Zealand
Posts: 890
Default

Nice one the_fifth_horseman. I like it as I can use it to do stuff I never knew DOS box could do.
win98 is offline                         Send a private message to win98
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking For An Old Wizard Vs Wizard Game Blade13z Cold Cases 2 26-06-2007 05:39 AM
Ultimate Wizard [NON-PC] chainsoar Invalid Requests 1 28-06-2006 09:23 PM
Extended Memory Manager In Dosbox `? swiss Troubleshooting 2 02-11-2005 09:16 PM
Dosbox 0.63 And Memory Manager Problems Ionize Troubleshooting 4 12-01-2005 09:54 AM


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 12:12 AM (GMT)

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