Originally Posted by
AndrewHunter
I believe the problem you are having here is a communication issue. The "DOS" you speak of in windows is not actually dos, it is an emulator, hence Win32 console.
No, there isn't a communication problem, at least not from my site. I know the difference between a Win32 console application and 16 bit DOS programs. And yes, my program is really a DOS program. It's a game that uses Mode13h and that is compiled with Turbo C++ 3.0 or Microsoft Visual C++ 1.52c. It's not a Win32 console application. The fact that I don't have a DOS computer right at hand and test the application under Windows XP (which is still able to run real 16 bit DOS programs) doesn't change the fact that my program is still a real DOS program. For example, my program includes lines like:
Code:
unsigned char far *screen = (unsigned char far *)MK_FP(0xA000, 0x0000);
or stuff like
Code:
REGS in, out;
in.h.ah = 0x00;
in.h.al = 0x13;
int86(intNumber, &in, &out);
or
Code:
void WaitForVBlank()
{
while (inp(0x3DA) & 8)
;
while (!(inp(0x3DA) & 8))
;
}
You see? It's really a DOS program.
Originally Posted by
AndrewHunter
In order to run actual DOS you need to do what Salem has suggested.
Not necessarily. Even though Windows XP is not based on DOS anymore, but on Windows NT, it's still capable of running actual DOS applications. And that's what I do: As long as I'm still working on the basic things, I just test the program under my usual operation system, Windows XP. Later, when it comes to performance and all that stuff, I can set up a DOS installation and test it there. But in the moment, I don't need that yet.
However, it is a DOS program, not a Win32 console application, otherwise I would have already used the Sleep function (since I mentioned it in my very first post). But this DOS program, due to a loop, pushes the processor load. And since I've seen that Turbo C++'s delay function has the same problem while Turbo C++'s sleep function hasn't, but can only wait full seconds, all I want to know is: How do I implement a delay that works like Turbo C++'s sleep function, but can wait milliseconds instead of seconds?
Originally Posted by
AndrewHunter
EDIT: If you are worried about complexity, it is actually quite easy to implement a DOS style game using the Win32 API. In fact I would say it is easier to program a console BitBlt style game taking advantage of the API then it is to code an original DOS game. A lot of the complexity with memory management is taken out of the equation.
Yes, I could write a Windows game. In fact, I'm writing the game in a way that all platform independent things are separated from the OS specific stuff, so that I can easily replace the graphics and input engine later and still have the game behave absolutely the same. But in the moment I want to program an original DOS game. And I don't have a problem with anything, except the fact that Turbo C++ has a sloppily implemented delay function and Visual C++ 1.52c doesn't have one at all.
P.S.: There's actually more memory management with Windows GDI with all their DeleteDC and ReleaseDC and DeleteBitmap and stuff. DirectX isn't much better with all their surfaces and clippers and palettes. In DOS, all I have to do is call a delete[] for each of my sprites and the back buffer when I don't need them anymore.