Program detect it's running inside DOSBox?

General information and assistance with DOSBox.

Program detect it's running inside DOSBox?

Postby MontyOnTheRun » 2017-12-08 @ 17:50

I was wondering is there is any way to detect in runtime if we're running inside DOSBox? Maybe exploit some quirk on the emulation that would allow probing the "system"? It would be useful for debugging stuff that's only available in real hardware ie: I'm working on OPL2LPT support for my games - having that output redirected to a regular Adlib (when applicable) would be useful.

Thanks!

Context: I'm using GCC 7.1 with DJGPP.
MontyOnTheRun
Newbie
 
Posts: 3
Joined: 2017-12-07 @ 11:41

Re: Program detect it's running inside DOSBox?

Postby Qbix » 2017-12-08 @ 18:05

I am sure this question has been answered before. DOSBox has written DOSBox at several location in the emulation memory (like the bios name for example) (which you can find in the ROM at the right location)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10557
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Program detect it's running inside DOSBox?

Postby MontyOnTheRun » 2017-12-08 @ 18:47

I tried searching the forum, but got no useful result
Gonna try the suggested approach, thanks!
MontyOnTheRun
Newbie
 
Posts: 3
Joined: 2017-12-07 @ 11:41

Re: Program detect it's running inside DOSBox?

Postby IIGS_User » 2017-12-09 @ 20:14

This one checks for z: drive and some other DOSBox-only stuff:

My little DB-INFO script
Klimawandel.
User avatar
IIGS_User
Oldbie
 
Posts: 895
Joined: 2007-3-14 @ 19:59
Location: native_lang=ger

Re: Program detect it's running inside DOSBox?

Postby Srandista » 2017-12-09 @ 20:25

Could you please re-upload it, if you have it (the original upload is down)?
My overkill "retro" PC - Pentium E6500K, 512MB/2GB RAM, Radeon 9500@9700 (Softmod), 80GB HDD, Win 98/XP
User avatar
Srandista
Member
 
Posts: 191
Joined: 2017-4-07 @ 17:14
Location: Czech Republic

Re: Program detect it's running inside DOSBox?

Postby MontyOnTheRun » 2017-12-11 @ 12:00

Sometimes the simpler is the most effective! =)
Gonna check for drive Z in my debug builds. Thanks!
MontyOnTheRun
Newbie
 
Posts: 3
Joined: 2017-12-07 @ 11:41

Re: Program detect it's running inside DOSBox?

Postby IIGS_User » 2017-12-11 @ 16:37

Srandista wrote:Could you please re-upload it, if you have it (the original upload is down)?

This is db-info.bat made by forum member Minimax, but be aware that there will be some incompatibilities with the latest versions of DOSBox.
Attachments
db-info.zip
db-info.bat by forum member Minimax
(1.93 KiB) Downloaded 13 times
Klimawandel.
User avatar
IIGS_User
Oldbie
 
Posts: 895
Joined: 2007-3-14 @ 19:59
Location: native_lang=ger


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 1 guest