non-Hugo Hugo question (more regarding C, DOS and W98)

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

non-Hugo Hugo question (more regarding C, DOS and W98)

Post by Ice Cream Jonsey »

OK, here's what I want to accomplish:

o Write an .exe program in C that either runs "hewin.exe game.hex" if it detects DOS 7.00 or a form of Windows, or "hegr -h1024 -m game.hex" if it detects DOS 6.22 (or lower, I guess).

"hewin.exe game.hex" essentially runs a Hugo game (hard-coded to "game.hex" as a filename in this case, but that's alright) using the Windows terp. The other line would set up the DOS Hugo Engine to run at a resolution of 1024x768 using "millions" of colors. (I presume that is more colors than what's in the 16-bit option, right?)

(As for the reason I want to do this -- I did end up getting some feedback from some people who grabbed my last game off Download.com who didn't know they had to run hewin first. Also, I think one person tried loading the save games with hewin directly, which also caused some confusion. Having an .exe file there which does all the thinking would be beneficial.)

It's possible to easily detect, in C, if you are in DOS 6.22 (that's called "real mode," right?) or not, right? I suspect this to be the case, but I figure I'll throw this out there in case (unknown to me) it's well-known that such a thing is a pain to deal with or whatnot.
the dark and gritty...Ice Cream Jonsey!

Kent

A couple of things

Post by Kent »

Robb--

Re: what you'd like to do with building an application launcher goes, there are a couple of stumbling blocks I can think of.

1. I'm not sure what compiler you would use. I don't know if MSVC++ will build executables that will run on plain DOS (without the "This program must be run in DOS mode" bail message). And if you use something like the venerable djgpp, you'll have problems running on XP (and maybe 2K, I'm not sure) without applying certain patches that I haven't experience with. I also don't know much about using gcc as part of the Cygwin package; maybe that might be the route to go. Or you could do it with an old 16-bit compiler like QuickC or one of the Borland compilers; those are most likely to be able to build a simple console-mode application that would run in any environment. As long as you can shell out a command-line containing "he[win|gr] mygame.hex" you're in business.

2. I think maybe I only had the one stumbling block.

3. Okay, not a stumbling block, but a sort of solution. You could build different executables, one runme_dos.exe and one runme_win.exe, and leave it up to users to run the right one. But this is pretty shabby, so you'd probably want to look into (1) if anything.

--Kent

User avatar
Ice Cream Jonsey
Posts: 28925
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Hey, thanks for the input on that. I see what you're saying in regards to the bail message. It could abort before ever getting to the point where it would run the Windows hewin part of the code.

Nobody's currently working on a .hex-to-exe coverter, are they? (I'll probably see you on the mud and ask you this before you see it here, but still. This at least will remind me to ask.) Hmm, but even then the problem isn't solved as graphic-less Inform and TADS story files (which someone has written an exe converter/merger for) look the same whether you're in DOS 6.22 or W98, but that's not the case for Hugo files. Maybe I'm over complicating things and should just have two .bat files, one for DOS (to invoke hegr) and one for Windows which runs the game properly.
the dark and gritty...Ice Cream Jonsey!

Post Reply