VOGONS


First post, by rfnagel

User metadata
Rank Oldbie
Rank
Oldbie

The game "Heroes" by RealTech and Olympus ( http://gadl.free.fr/heroes/heroes.html ), which is a fancy Nibbles clone, supports several command line parameters. Directly from the help text:

Command line parameters:

You can use theses options when you run Heroes.

GO! Skip the introduction and start directly at the front menu.
DEFOPTIONS Restore the default options (like keyboard defs, volume, speed, etc...).
DEFSCORES Restore an empty highscores list.
DEFSAVES Restore an empty savedgames list.
HLP Start this help reader.
HELP Start this help reader.
INFO Start this help reader.
CD Start the CD player.
INSTALL Start the installation program to copy Heroes on your hard drive.
COPY Start the installation program to copy Heroes on your hard drive.
JOYOFF Disable joystick.
ORDER Display an order form.
MONO Disable stereo sound.
NOSFX Disable sound FX.
NODOUBLEFX Prevent from running rotozoom and mushroom at the same time (for slow computers).
SETUP Run the sound setup menu.
SWAPSIDE Swap player-1 and player-2's views.
WIN Use this option under windows95.

For exemple, "heroes joyoff mono" will start Heroes in mono and without joystick support.

A strange thing; When the game is run under DOSBox, the command line parameters do nothing... as if maybe DOSBox isn't passing them to the executable (HEREOS.EXE). Yet, under a Windows XP DOS shell, they work fine (of course, there are sound and performance issues when the game is run under WinDoZe XPee).

Any idea of what could be the problem?

(edit) P.S. Otherwise, the game works just fine under DOSBox.

Rich ¥Weeds¥ Nagel
http://www.richnagel.net

Reply 1 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The game calls INT 21/55 to create a child PSP, but DOSBox does not copy the parent's command line into the child. Seems pretty straightforward to fix:

bool DOS_ChildPSP(Bit16u segment, Bit16u size) {
DOS_PSP psp(segment);
psp.MakeNew(size);
DOS_PSP psp_parent(psp.GetParent());
psp.CopyFileTable(&psp_parent,true);
+ psp.SetCommandTail(RealMake(psp.GetParent(),0x80));
psp.SetEnvironment(psp_parent.GetEnvironment());
psp.SetSize(size);
return true;
}

It also looks like real DOS copies both FCB entries as well, but the game in question doesn't care about it.

A note to the DOSBox devs: the game is triggering the stack wrap E_Exit at execution in SVN builds.

Reply 2 of 5, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

does changing the e_exit to a log message make it work ?
(e.g does it work with the current implementation ?)

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yes, the game runs with the E_Exit removed. It's a case of SP=0 in the executable header, which isn't problematic like SP=2 used to be, but just reporting because that's why the E_Exit is there. 😉

Reply 4 of 5, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

well they will become log(log_exec,log_error) before the release 😀

How safe is that cmdtail fix ? it looks pretty safe to me, but their are more ways to create psps.

Water flows down the stream
How to ask questions the smart way!

Reply 5 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I mostly copied that line from DOS_NewPSP(), so it seems reasonably safe, assuming that the method of determining the parent is the same in all conditions. However, you might want to observe what DOS does with the FCBs to decide if that should be handled as well.