Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Diabaig compiled for DOS (Announce)

posted by bencollver Homepage, 30.10.2025, 21:40
(edited by bencollver on 30.10.2025, 21:58)

I updated to Diabaig 1.0.1. See download links below.

https://archive.org/details/diabaig-1.0.1-for-dos

gopher://tilde.pink/1/~bencollver/files/dos386/game/diabaig/

A reviewer on the Internet Archive pointed out that while this runs on an 80386, it runs slowly and isn't really playable on anything less than a Pentium.

* * *

This version presented a fun debugging challenge for me:

Diabaig crashed every time i used the "run" command. Debug logs indicated that the crash happened in autopilo.c (autopilot.c) when returning from do_autopilot(). I wanted to use the Watcom debugger, but the crash cannot be reproduced when built with debug symbols. I asked for help on social media, and was told that it sounds like stack corruption from a buffer overflow.

Using debug logs and commenting out sections of code in do_autopilot() i narrowed the crash down to the following line of code:

autopilot.c_inroom=c_inroom(p);

For reference, here's the function prototype:

int c_inroom()

OpenWatcom 1.9 does not give any warnings when compiling the c_inroom(p) invokation in spite of the extra argument. After returning from c_inroom(p), do_autopilot() will continue through the rest of the function and finally crash on the return statement.

The following change will cause OpenWatcom 1.9 to produce an error at build time.

OLD: int c_inroom()
NEW: int c_inroom(void)


The following change fixed the crash:

OLD: autopilot.c_inroom=c_inroom(p);
NEW: autopilot.c_inroom=c_inroom();

 

Complete thread:

Back to the forum
Board view  Mix view
22788 Postings in 2123 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum