* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Friday, August 1, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Sens. Blackburn, Warnock introduce CREATE Act to provide tax relief to music creators – Yahoo Home

    Sens. Blackburn and Warnock Launch CREATE Act to Deliver Tax Relief for Music Creators

    That’s (Political) Entertainment: When Theatre Meets Politics

    Future Script: How Generative AI Is Changing Collective Bargaining in the Entertainment Industry – Jackson Lewis

    Future Script: How Generative AI Is Transforming Collective Bargaining in Entertainment

    The SBA’s live-entertainment bailout was supposed to end two years ago. We still don’t know how $1.5 billion was spent. – Yahoo Home

    $1.5 Billion Live-Entertainment Bailout: Two Years Later, Where Did the Money Go?

    Wall Street Bets: Caesars, Golden Entertainment, Churchill Downs, GLPI, Boyd – CDC Gaming

    Top Wall Street Bets: Caesars, Golden Entertainment, Churchill Downs, GLPI, and Boyd Take Center Stage

    Micro wrestling coming to NE Ohio – Cleveland.com

    Get Ready, NE Ohio: Micro Wrestling Is Making Its Exciting Debut!

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Emory orthopaedic surgeons use robotic technology to transform knee replacement surgery – Emory News Center

    How Robotic Technology is Revolutionizing Knee Replacement Surgery

    Cognizant Technology Solutions Corp (CTSH) Q2 2025 Earnings Call Highlights: Strong Revenue … – Yahoo.co

    Cognizant Q2 2025 Earnings: Impressive Revenue Growth and Key Takeaways

    Revving Up The U.S. Technology Engine – Forbes

    Revving Up The U.S. Technology Engine – Forbes

    More than just a hockey player – Rochester Institute of Technology Athletics

    Beyond the Ice: The Inspiring Journey of a Remarkable Athlete from Rochester Institute of Technology

    Smart Logistics in Warehousing – From Legacy Protocols to Green IoT – How Technology Is Reshaping the Sustainable Supply Chain – Logistics Viewpoints –

    Smart Logistics in Warehousing – From Legacy Protocols to Green IoT – How Technology Is Reshaping the Sustainable Supply Chain – Logistics Viewpoints –

    AI’s race in the dark with China – Axios

    The High-Stakes AI Race: Innovation and Competition in the Shadows

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Sens. Blackburn, Warnock introduce CREATE Act to provide tax relief to music creators – Yahoo Home

    Sens. Blackburn and Warnock Launch CREATE Act to Deliver Tax Relief for Music Creators

    That’s (Political) Entertainment: When Theatre Meets Politics

    Future Script: How Generative AI Is Changing Collective Bargaining in the Entertainment Industry – Jackson Lewis

    Future Script: How Generative AI Is Transforming Collective Bargaining in Entertainment

    The SBA’s live-entertainment bailout was supposed to end two years ago. We still don’t know how $1.5 billion was spent. – Yahoo Home

    $1.5 Billion Live-Entertainment Bailout: Two Years Later, Where Did the Money Go?

    Wall Street Bets: Caesars, Golden Entertainment, Churchill Downs, GLPI, Boyd – CDC Gaming

    Top Wall Street Bets: Caesars, Golden Entertainment, Churchill Downs, GLPI, and Boyd Take Center Stage

    Micro wrestling coming to NE Ohio – Cleveland.com

    Get Ready, NE Ohio: Micro Wrestling Is Making Its Exciting Debut!

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Emory orthopaedic surgeons use robotic technology to transform knee replacement surgery – Emory News Center

    How Robotic Technology is Revolutionizing Knee Replacement Surgery

    Cognizant Technology Solutions Corp (CTSH) Q2 2025 Earnings Call Highlights: Strong Revenue … – Yahoo.co

    Cognizant Q2 2025 Earnings: Impressive Revenue Growth and Key Takeaways

    Revving Up The U.S. Technology Engine – Forbes

    Revving Up The U.S. Technology Engine – Forbes

    More than just a hockey player – Rochester Institute of Technology Athletics

    Beyond the Ice: The Inspiring Journey of a Remarkable Athlete from Rochester Institute of Technology

    Smart Logistics in Warehousing – From Legacy Protocols to Green IoT – How Technology Is Reshaping the Sustainable Supply Chain – Logistics Viewpoints –

    Smart Logistics in Warehousing – From Legacy Protocols to Green IoT – How Technology Is Reshaping the Sustainable Supply Chain – Logistics Viewpoints –

    AI’s race in the dark with China – Axios

    The High-Stakes AI Race: Innovation and Competition in the Shadows

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home Technology

Let’s compile like it’s 1992 (2014)

February 26, 2024
in Technology
Share on FacebookShare on Twitter

August 10th, 2014

I have been tinkering with the vanilla source code of Wolfenstein 3D from 1992. Even though it
is more than 20 years old and has rotten for modern systems, you can still compile it if you recreate the environment.
All you need is :

Wolfenstein 3D source code.
DosBox.
The Compiler Borland C++ 3.1.
Wolfenstein 3D shareware (for the assets).

Setup filesystem

Open a command line and create two folders, one for each DOS drive needed:

cd ~
mkdir system
cd system
mkdir c
mkdir a
cd ~

Download

Download Borland 3.1 to system/a.
Download Wolfenstein 3D source code to system/c
Download VGA files to system/c (the purpose of those is explained at the bottom of this page.

cd system/a
curl -O http://fabiensanglard.net/Compile_Like_Its_1992/tools/BCPP31.zip

cd ../c
curl -O http://fabiensanglard.net/Compile_Like_Its_1992/tools/wolfsrc.zip
curl -O http://fabiensanglard.net/Compile_Like_Its_1992/tools/vgafiles.zip

Now we have all the files in the filesytem. Just to check, type:

cd ..
find ~/system

You should have the following :

/Users/fabiensanglard/system
/Users/fabiensanglard/system/a
/Users/fabiensanglard/system/a/BCPP31.zip
/Users/fabiensanglard/system/c
/Users/fabiensanglard/system/c/vgafiles.zip
/Users/fabiensanglard/system/c/wolfsrc.zip

Decompress everything

cd ~/system/a
unzip BCPP31.zip

cd ~/system/c
unzip vgafiles.zip
unzip wolfsrc.zip

DosBox

Download and start DosBox:

Mount

Mount the filesystem, one folder for each drive :

Z:/> mount c ~/system/c
Z:/> mount a ~/system/a

Install the compiler

Now is time to install Borland C++ 3.1 :

Z:> a:
A:> cd BCPP31
A:> install



Press enter when you select the source drive ( it should already be A drive )

Install Wolfenstein 3D source code

We have a system running and a compiler on it: Time to decompress (again) the source code.

A:> c:
C:> cd
C:> install


Type ‘C’


Keep the default path: WOLFSRC


Y to create the directory.

Installing !

Compiling

Start Borland C++ 3.1:

C:> cd
C:> cd borlandc
C:> cd bin
C:> bc.exe


After pressing OK, use the mouse or the shortcuts to Project -> Open Project ….WOLFSRCWOLF3D.PRJ:

Select Options -> Directories and change the value as follow :

Include Directories: C:BORLANDCINCLUDE

Library Directories: C:BORLANDCLIB

Ouptput Directories: OBJ

Source Directories: C:WOLFSRC

Let’s try to compile: Compile -> Build All

We get an error: “Cannot find executable TASM”

Exit Borland C++, we need to set the PATH:

C:> CD ..
C:> PATH=C:BORLANDCBIN
C:> BC.EXE

Getting the assets

Download the shareware version or even better: Purchase as full version on Wolfenstein 3D.

cd ~/system/c
curl -O http://fabiensanglard.net/Compile_Like_Its_1992/tools/1wolf14.zip
unzip 1wolf14.zip

Go back to DosBox and install the game to C:WOLF3D.

C:> c:
C:> cd
C:> cd 1wolf14
C:1WOLF14> install

After installation of the game, copy the .EXE we just compiled to the game folder,

C:> c:
C:> cd wolf3d
C:WOLF3D> copy WOLF3D.EXE WOLF3D.OLD
C:WOLF3D> copy ../WOLRSRC/WOLF.EXE .

Running the game

Try to run it:

C:> cd wolf3d
C:WOLF3D> copy WOLF3D.EXE WOLF3D.OLD
C:WOLF3D> copy ../WOLRSRC/OBJ/WOLF3D.EXE .
C:WOLF3D> WOLF3D.EXE

Hm, that looks weird…..


Uh…

What ?

I did not remember it like that….

Ok something must be very wrong here !!

What happened ?

It has to do with the production access pipeline and how they are used by the engine.
When Adrian Carmack and Kevin Cloud were done crafting all the graphic files, they used a tool (IGRABed) to pack them together.
The output was made of 3+2 files.

VGAHEAD.WL1
VGAGRAPH.WL1
VGADICT.WL1

The VGAHEAD file is an index containing pointers to the VGAGRAPH where the data is stored huffman compressed. VGADICT
contains the huffman dictionaries to decompress the data.

The two other files produced:

GRE.H
GRE.EQU

Are compiled into engine as seen in the following drawing :

What are the .H and .EQU files needed for? In short, to allow access by name. When IGRABed assembled all files
it would also create an enum with matching indices:

GRE.H

enum{
H_WOLFLOGOPIC
GETPSYCHEDPIC
L_GUYPIC
.
.
} graphicnums

GRE.EQU

H_WOLFLOGOPIC =0
GETPSYCHEDPIC =1
L_GUYPIC =2

This way when the engine requested a particular asset, it could use a logical name (L_GUYPIC) instead of a “magic number” (2).

That means the engine shipped with the indices of the images in the VGA files HARD-CODED. Since the assets and
codebase evolved after shipping wolf3D shareware (with Spears of Destiny), the newly compiled game indices do not
match the location in the original assets files.

Running the game (again)

Fortunately there is a simple solution to this problem: Somebody regenerated the VGA assets so they match the indices in the .H and .EQU
released with the source code. Just copy those files (if you use the shareware assets you will have to change the file extension from .WL6 to .WL1).

C:> copy C:vgafilesVGADICT.WL6 C:WOLF3DVGADICT.WL1
C:> copy C:vgafilesVGAGRAPH.WL6 C:WOLF3DVGAGRAPH.WL1
C:> copy C:vgafilesVGAHEAD.WL6 C:WOLF3DVGAHEAD.WL1

Let’s try again:

C:WOLF3D> WOLF3D.EXE

It works !!

Yet we are are not done !

VGA framebuffer and screen aspect ratio

It may not be obvious to people that never saw the original game but the DosBox image above is not what people saw in 1992.
The VGA framebuffer was 320×200 but the CRT monitors had an aspect ratio of 4:3. Which mean the framebuffer was stretched vertically
when sent to the monitor. DosBox has an option to compensate for that :

vi ~/Library/Preferences/DOSBox 0.74 Preferences

[render]
# frameskip: How many frames DOSBox skips before drawing one.
# aspect: Do aspect correction, if your output method doesn’t support scaling this can slow things down!.
# scaler: Scaler used to enlarge/enhance low resolution modes.
# If ‘forced’ is appended, then the scaler will be used even if the result might not be desired.
# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, …

frameskip=0
aspect=false
scaler=normal2x

Change that aspect to true:

Try again :

C:WOLF3D> WOLF3D.EXE

Recommended Readings

@

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : Hacker News – https://fabiensanglard.net/Compile_Like_Its_1992/index.php

Tags: compileLet'stechnology
Previous Post

Genie: Generative Interactive Environments

Next Post

The 14 pains of building your own billing system

Women’s Voices Are the Only Way Forward for Climate Change Solutions: ‘As Women, We Have to Stand Up and Back Up Women’ – Ms. Magazine

Women’s Voices Are the Only Way Forward for Climate Change Solutions: ‘As Women, We Have to Stand Up and Back Up Women’ – Ms. Magazine

August 1, 2025
“A Danger to the Entire Planet”: Amid Deadly Extreme Weather, Trump’s EPA Rejects Climate Science – Democracy Now!

“A Danger to the Entire Planet”: Amid Deadly Extreme Weather, Trump’s EPA Rejects Climate Science – Democracy Now!

August 1, 2025
Ten Lifestyle Group Announces Total Voting Rights and Share Capital Update – TipRanks

Ten Lifestyle Group Announces Total Voting Rights and Share Capital Update – TipRanks

August 1, 2025
Five different countries take gold medals on a wide-open day at the swim world championships – AP News

Five Countries Triumph in a Thrilling, Unpredictable Day at the Swim World Championships

August 1, 2025
US employers slash hiring as Trump advances a punishing trade agenda – AP News

US Employers Slash Hiring as Trump’s Aggressive Trade Policies Shake the Market

August 1, 2025
Duffer Brothers and Jerry Bruckheimer Join Program for Entertainment and Technology Summit – Variety

Duffer Brothers and Jerry Bruckheimer Join Forces for an Exciting Entertainment and Technology Summit

August 1, 2025
Alabama schools enhance mental health support as students return to the classroom – WBMA

Alabama Schools Ramp Up Mental Health Support as Students Return to Classrooms

August 1, 2025
Platts­burgh town su­per­visor eyed for Dem ticket in N.Y. Assembly special election – Spectrum News

Platts­burgh town su­per­visor eyed for Dem ticket in N.Y. Assembly special election – Spectrum News

August 1, 2025
Emory orthopaedic surgeons use robotic technology to transform knee replacement surgery – Emory News Center

How Robotic Technology is Revolutionizing Knee Replacement Surgery

August 1, 2025
Carlos Correa trade grades: Astros score ‘A’ for stunning deadline deal, Twins get their salary dump – CBS Sports

Carlos Correa Trade Grades: Astros Land an ‘A’ for Blockbuster Deadline Deal, Twins Successfully Shed Salary

August 1, 2025

Categories

Archives

August 2025
MTWTFSS
 123
45678910
11121314151617
18192021222324
25262728293031
« Jul    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (749)
  • Economy (774)
  • Entertainment (21,652)
  • General (16,230)
  • Health (9,811)
  • Lifestyle (782)
  • News (22,149)
  • People (775)
  • Politics (783)
  • Science (15,987)
  • Sports (21,270)
  • Technology (15,752)
  • World (757)

Recent News

Women’s Voices Are the Only Way Forward for Climate Change Solutions: ‘As Women, We Have to Stand Up and Back Up Women’ – Ms. Magazine

Women’s Voices Are the Only Way Forward for Climate Change Solutions: ‘As Women, We Have to Stand Up and Back Up Women’ – Ms. Magazine

August 1, 2025
“A Danger to the Entire Planet”: Amid Deadly Extreme Weather, Trump’s EPA Rejects Climate Science – Democracy Now!

“A Danger to the Entire Planet”: Amid Deadly Extreme Weather, Trump’s EPA Rejects Climate Science – Democracy Now!

August 1, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version