Skip to content

Instantly share code, notes, and snippets.

@erfg12
Created April 6, 2022 20:27
Show Gist options
  • Save erfg12/d36a18d55a3f48383b3cac15beaa4b53 to your computer and use it in GitHub Desktop.
Save erfg12/d36a18d55a3f48383b3cac15beaa4b53 to your computer and use it in GitHub Desktop.
Programming Games in C/C++ on DOS
#include <stdio.h>
// FOR MORE INFO: http://nuclear.mutantstargoat.com/articles/retrocoding/dos01-setup
// GET OpenWatcom FOR DOS: https://sourceforge.net/projects/openwatcom/files/open-watcom-1.9/open-watcom-c-dos-1.9.exe/download
// MAKE FOLDER FOR DOS CONTENT ON MAIN OS. PLACE OpenWatcom EXE IN FOLDER. INSTALL AND OPEN DOSBOX. USE MOUNT C <PATH> COMMAND. EXECUTE EXE IN DOSBOX.
// IN DOSBOX CONFIG ADD "mount c <path>, C:, AUTOEXEC" AFTER OpenWatcom INSTALL. RESTART DOSBOX.
// USE LibAllegro 4.2 FOR GAME DEV: https://github.com/liballeg/allegro5/tree/4.2
// IN DOSBOX, PRESS CTRL+F4 (hold FN key on MacBooks) TO RELOAD CONTENT WHEN EDITING CODE ON MAIN OS
int main(int argc, char **argv){
puts("HELLO WORK");
return 0;
}
obj = main.obj
bin = main.exe
CC = wcc
CFLAGS = -zq
LD = wlink
$(bin): $(obj)
$(LD) name $@ file { $(obj) }
.c.obj:
$(CC) -fo=$@ $(CFLAGS) $<
clean: .symbolic
del *.obj
del $(bin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment