All Projects → jacmoe → retrogardens

jacmoe / retrogardens

Licence: BSD-2-Clause license
16bit retro programming in DosBox with Borland C++ 3.1, Turbo Pascal 7 and TASM

Programming Languages

C++
36643 projects - #6 most used programming language
assembly
5116 projects
c
50402 projects - #5 most used programming language
pascal
1382 projects
POV-Ray SDL
72 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to retrogardens

Nineties
💾 Colors for World Wide Web pioneers
Stars: ✭ 16 (-67.35%)
Mutual labels:  dos, turbo-pascal
reconstruction-of-super-zzt
The Reconstruction of Super ZZT
Stars: ✭ 24 (-51.02%)
Mutual labels:  dos, turbo-pascal
jSH
A Javascript scripting engine for DOS
Stars: ✭ 79 (+61.22%)
Mutual labels:  dos, retrocomputing
dos-game
A Dockerfile for running Docker based DosBox games streamed to a browser client.
Stars: ✭ 49 (+0%)
Mutual labels:  dos, dosbox
dos.zig
Create DOS programs with Zig
Stars: ✭ 48 (-2.04%)
Mutual labels:  dos, retrocomputing
masm-tasm
run and debug TASM/MASM code in VSCode via JSDos, DOSBox and msdos-player
Stars: ✭ 115 (+134.69%)
Mutual labels:  dos, dosbox
mandelbrot
Mandelbrot set drawers for vintage hardware
Stars: ✭ 15 (-69.39%)
Mutual labels:  retrocomputing, 16-bit
mt32-pi-control
MT32-PI.EXE/MT32-PI.TTP/mt32-pi-ctl is a control program for the mt32-pi MIDI synthesizer available for DOS PCs, Atari ST and Amiga computers as well as modern systems running Linux and Windows.
Stars: ✭ 22 (-55.1%)
Mutual labels:  dos, retrocomputing
ukncbtl
UKNCBTL is emulator of Elektronika MS 0511 (UKNC), soviet computer based on two PDP-11 compatible processors.
Stars: ✭ 39 (-20.41%)
Mutual labels:  retrocomputing
Batch-File-examples
🐚 Various batch files (descriptions are in the read me file)
Stars: ✭ 37 (-24.49%)
Mutual labels:  dos
semblance
Disassembler for Windows executables. Supports 16-bit NE (New Executable), MZ (DOS), and PE (Portable Executable, i.e. Win32) files.
Stars: ✭ 110 (+124.49%)
Mutual labels:  16-bit
csol
A small collection of solitaire/patience games (Klondike, FreeCell, Spider, Yukon, etc.) to play in the terminal
Stars: ✭ 25 (-48.98%)
Mutual labels:  dos
osnine-java
6809 and OS-9 emulator in Java
Stars: ✭ 17 (-65.31%)
Mutual labels:  retrocomputing
Safari-Crash
Small HTML DoS exploit kit aimed at mobile browsers that allows rapid deployment and testing
Stars: ✭ 32 (-34.69%)
Mutual labels:  dos
a80
Intel 8080/Zilog Z80 assembler written in D.
Stars: ✭ 23 (-53.06%)
Mutual labels:  retrocomputing
RetroWiFiModem
An ESP8266 based RS232 <-> WiFi modem with Hayes AT style commands and LED indicators
Stars: ✭ 65 (+32.65%)
Mutual labels:  retrocomputing
ayfxedit-improved
AYFX Editor (Improved)
Stars: ✭ 24 (-51.02%)
Mutual labels:  borland-cpp
IBMulator
The IBM PS/1 emulator.
Stars: ✭ 62 (+26.53%)
Mutual labels:  retrocomputing
cpu11
Revengineered ancient PDP-11 CPUs, originals and clones
Stars: ✭ 120 (+144.9%)
Mutual labels:  retrocomputing
convertron3000
Convertron3000 commodore 64 graphics converter
Stars: ✭ 24 (-51.02%)
Mutual labels:  retrocomputing

Update

Retronew is a modern equivalent using Allegro.


retrogardens

16bit retro programming in DosBox with Borland C++ 3.1 Turbo Pascal 7 and TASM

palette

Introduction


Prerequisites

DosBox, Borland C++ 3.1 and Turbo Pascal 7.0.

You don't need both BCPP3.1 and TP7, so if you don't want to use Pascal, don't download and install TP7, or vice versa.

I installed TASM 5.5 also, although I am not sure if you really need to do that.
However, below instructions assume that the Turbo Assember is installed into C:\TASM

Also, besure to check out Fabien Sanglard's excellent article Let's Compile Like Its 1992 about how to use DosBox and Borland C++ 3.1 to compile Id Software's Wolfenstein 3D, if you want a walkthrough with lots of picures and well written text.

Where to get it

BC3.1 and TP7

If you don't already have BC3.1, TASM and TP7 lying around, then you can grab them from WinWorld - go to the Library section.

DosBox

Download it from DosBox.com


Dosbox

While you can read (and you probably should) the DosBox setup and installation wiki page , here is a list of things that I did to get up and running.

Firstly, I simply installed DosBox.

C drive

First, we need a place for our development tools to be installed.

In other words, we need a C:\ drive.

I simply created a directory creatively entitled DosBox in my home directory.

General configuration

You shouldn't really have to change anything, other than outlined below.

The configuration file for DosBox is ~/.dosbox/dosbox-0.74.conf on Linux.

Look it up if you are on other platforms.

Autoexec.bat

Open up the dosbox configuration file and navigate to the end, where you will find the autoexec section.

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
mount c ~/DosBox
path borlandc/bin;tasm/bin;tp7/tp/bin
c:

We mount the C drive, set up the path and change to the C drive.

Floppy disks

Since we are going to program like it's 1995, we need to deal with floppy disks.

So, since our machine does not have a floppy disk station, we use floppy disk images.
And a directory that we mount as floppy in DosBox.

So, create a directory for the floppy drive, and add a line in the autoexec section of the DosBox configuration file, like so:

mount a -t floppy ~/DOS/box_disks/floppy

Now, what's in the floppy disk directory will be available from the A drive inside of DosBox.

Insert and Change floppy disks
Simply open a floppy image ( disk01.img ) in a disk image viewer, select all files and copy them to the floppy directory.

When the installation program asks for the next disk, simply delete the files in floppy and copy the files of the next disk into it.

Very low tech. But it works! :p

CD ROMs

If you need to mount a CD drive, and you have an iso that you want to mount, then you can do that, like so:

imgmount d ~/DOS/WatcomCPP10.6/watcom10.6.iso -t iso

When you are done with it, simply remove the line, or comment it out (in case you want to mount another iso later).

I have no idea how to swap CDs - but this is DOS and 1995 and I don't recall ever having to swap CDs when installing. :)

Cpu cycles

A CPU speed of 50% works well.
Press Ctrl+F10 to grab the input, and press CTRL+F11 to decrease CPU cycles.
Click CTRL+F10 to release the mouse again.

See the DosBox - Special Keys wiki page for a list of key combos that you can use with it.

DosBox Window

If you want the DosBox to be larger, you can set the size in the [sdl] section.

My settings are:

windowresolution=1024x768
output=opengl

You can also set autolock for the mouse to be off:

autolock=true

Then the mouse will not be grabbed automatically by the DosBox window.
You can use Ctrl+F10 to grab / ungrab it.

DosBox Oddities

If you move files around on your C directory from outside of DosBox, you need to restart it to make DOS see it.


Borland C++ 3.1

General advise

It is a good idea to minimize the use of the mouse when using the Borland C++ IDE.

Don't click with your mouse in the DosBox window, if you don't want DosBox to grab it. Or turn off autolock (see above).

Use the ALT key to quickly issue commands - for example use ALT+P ENTER to open a project, and ALT+R Enter to run your project.
Achtung! Do not use CTRL+F9 to run your project, because that is the DosBox terminate key combo.

Use ALT+[number] to quickly switch between windows.

Project settings

When a project is open, enter the Options menu - ALT+O - and make sure that the following is set:

Application
Dos Standard

Code Generation
Model : Large

Advanced Code Generation
Floating Point : 80287/387
Instruction Set : 80386

Entry/Exit Code Generation
Prolog/Epilog Code Generation : Dos standard

C++ Options
Use C++ Compiler : C++ always

Linker
Output : Standard DOS EXE

Debugger Program Heap Size : 350 K bytes

Directories
Modify the Include / Library directories as needed.
Consider adding C:\GARD\BC31\[project_dir] to the Source Directories.

My Include Directories is:

C:\BORLANDC\INCLUDE;C:\GARD\BC31\COMMON

My Library Directories is:

C:\BORLANDC\LIB;C:\GARD\BC31\COMMON

Make sure that you save the settings before exiting: ALT+O S K

ASM and Turbo Assember

Link shenanigans

In the COMMON directory, there are a couple of files in assembly code that needs to be built.

You can either do this, by first removing the object files from the projejct ( del ), and add the .ASM files ( Ins button in the Project window ) and build them ( ALT+C L ) and then remove them from the project again, and add the object ( .OBJ ) files again.

Or you can simply use Turbo Assembler on the command line.
Don't ask me how to do that :p

TASM.EXE

If Borland complains that it can't find TASM.EXE, then go into Options - Transfer and find ~Turbo Assember and Edit it.
Enter C:\TASM\BIN\TASM.EXE in Program Path and then hit the Modify button.

TASM2MSG.EXE

If Borland complains that it can't find TASM2MSG.EXE, find it in C:\BORLANDC\BIN and place a copy in C:\BORLANDC and a copy next to the .ASM file that you want to link.


Turbo Pascal 7.0

Because TP7 needs to be patched to run with faster CPUs, it is a good idea to use version 7.0, and not 7.1.

Divide by Zero CRT runtime bug

Turbo Pascal works, but will produce executables that crashes with a divide by zero error at runtime.
It will do that on faster CPUs, unless we patch it.

Download the Crt patch for TP7 - get the compile time patches - and extract.
I used the first patch, and checked my TP7 version to figure out which patch to apply (it was the first one).

Copy the files to the bin directory and run PATCH PATCH700 (or PATCH701, depending on the date of your TP7).


Credits

Some code from the dos/programming section of the x2ftp.oulu.fi mirror


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].