A Doom 2 MAP01 renderer written in GnuCOBOL with SDL2 pixel display.
~8,300 lines of COBOL (99.1%) + 72 lines of C shim (0.9%).
sudo apt install gnucobol)sudo apt install libsdl2-dev)This game requires freedoom2.wad — a free, open-source Doom 2 IWAD.
Download: https://github.com/freedoom/freedoom/releases
Get the latest freedoom-0.13.0.zip (or newer), extract freedoom2.wad and place it in this directory.
Or via command line:
wget https://github.com/freedoom/freedoom/releases/download/v0.13.0/freedoom-0.13.0.zip
unzip freedoom-0.13.0.zip freedoom-0.13.0/freedoom2.wad
mv freedoom-0.13.0/freedoom2.wad .
rm -rf freedoom-0.13.0 freedoom-0.13.0.zip
make
./doom2
| Key | Action |
|---|---|
| W/S | Move forward/backward |
| A/D | Turn left/right |
| SPACE | Shoot |
| E | Open door / use |
| LSHIFT | Run |
| 1/2 | Switch weapon |
COBOL (doom2.cob + 20 copybooks)
├── WAD parser (wad-parser.cpy, wad-textures.cpy)
├── Map loader (map-loader-proc.cpy) — Bresenham vector→grid
├── Raycaster (raycaster-proc.cpy) — DDA + depth buffer
├── Floor/ceiling (floor-ceil-proc.cpy) — scanline casting
├── Sprites (sprites-proc.cpy) — depth-sorted projection
├── Enemies (enemies-proc.cpy) — FSM AI with LOS
├── Weapons (weapons-proc.cpy) — hitscan + spread
├── Doors/Pickups (doors-proc.cpy)
└── HUD (hud-proc.cpy) — bitmap font status bar
C shim (display.c, 72 lines)
└── SDL2 window, texture upload, keyboard polling, WAD file I/O
The COBOL code fills a 320x200 RGBA framebuffer every frame. The C shim only uploads it to an SDL2 texture for display.
COBOL
99.2%
A Doom 2 MAP01 renderer written in GnuCOBOL with SDL2 pixel display.
~8,300 lines of COBOL (99.1%) + 72 lines of C shim (0.9%).
sudo apt install gnucobol)sudo apt install libsdl2-dev)This game requires freedoom2.wad — a free, open-source Doom 2 IWAD.
Download: https://github.com/freedoom/freedoom/releases
Get the latest freedoom-0.13.0.zip (or newer), extract freedoom2.wad and place it in this directory.
Or via command line:
wget https://github.com/freedoom/freedoom/releases/download/v0.13.0/freedoom-0.13.0.zip
unzip freedoom-0.13.0.zip freedoom-0.13.0/freedoom2.wad
mv freedoom-0.13.0/freedoom2.wad .
rm -rf freedoom-0.13.0 freedoom-0.13.0.zip
make
./doom2
| Key | Action |
|---|---|
| W/S | Move forward/backward |
| A/D | Turn left/right |
| SPACE | Shoot |
| E | Open door / use |
| LSHIFT | Run |
| 1/2 | Switch weapon |
COBOL (doom2.cob + 20 copybooks)
├── WAD parser (wad-parser.cpy, wad-textures.cpy)
├── Map loader (map-loader-proc.cpy) — Bresenham vector→grid
├── Raycaster (raycaster-proc.cpy) — DDA + depth buffer
├── Floor/ceiling (floor-ceil-proc.cpy) — scanline casting
├── Sprites (sprites-proc.cpy) — depth-sorted projection
├── Enemies (enemies-proc.cpy) — FSM AI with LOS
├── Weapons (weapons-proc.cpy) — hitscan + spread
├── Doors/Pickups (doors-proc.cpy)
└── HUD (hud-proc.cpy) — bitmap font status bar
C shim (display.c, 72 lines)
└── SDL2 window, texture upload, keyboard polling, WAD file I/O
The COBOL code fills a 320x200 RGBA framebuffer every frame. The C shim only uploads it to an SDL2 texture for display.
COBOL
99.2%