{"id":22125640,"url":"https://github.com/jacmoe/retrogardens","last_synced_at":"2025-07-25T16:32:40.694Z","repository":{"id":37677954,"uuid":"83234967","full_name":"jacmoe/retrogardens","owner":"jacmoe","description":"16bit retro programming in DosBox with Borland C++ 3.1, Turbo Pascal 7 and TASM","archived":false,"fork":false,"pushed_at":"2022-04-25T21:09:42.000Z","size":867,"stargazers_count":71,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-16T04:20:11.640Z","etag":null,"topics":["16-bit","borland-cpp","cpp","dos","dosbox","pascal","retro-graphics","retrocomputing","turbo-pascal"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacmoe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-26T19:35:06.000Z","updated_at":"2023-10-06T11:36:36.000Z","dependencies_parsed_at":"2022-09-13T04:42:54.634Z","dependency_job_id":null,"html_url":"https://github.com/jacmoe/retrogardens","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacmoe%2Fretrogardens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacmoe%2Fretrogardens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacmoe%2Fretrogardens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacmoe%2Fretrogardens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacmoe","download_url":"https://codeload.github.com/jacmoe/retrogardens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227594382,"owners_count":17791115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["16-bit","borland-cpp","cpp","dos","dosbox","pascal","retro-graphics","retrocomputing","turbo-pascal"],"created_at":"2024-12-01T16:36:56.581Z","updated_at":"2025-07-25T16:32:40.655Z","avatar_url":"https://github.com/jacmoe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"* retrogardens [Moved to codeberg]\n\n*Achtung*: This repository will not be updated.\n\nIf something new happens with this project, it will happen at -\u003e https://codeberg.org/jacmoe/retrogardens\n\n----------------------------------------------------------------------------------\n\n**Update**\n\n[Retronew][retronew] is a modern equivalent using [Allegro][allegro].\n\n------------------------------------------------------------------------------------------------------------------------------------------------------\n\n# retrogardens\n16bit retro programming in DosBox with Borland C++ 3.1 Turbo Pascal 7 and TASM\n\n![palette][pal]\n\n## Introduction\n\n--------------------------------\n\n## Prerequisites\n\nDosBox, Borland C++ 3.1 and Turbo Pascal 7.0.\n\nYou 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.\n\nI installed TASM 5.5 also, although I am not sure if you really need to do that.  \nHowever, below instructions assume that the Turbo Assember is installed into `C:\\TASM`\n\n\nAlso, besure to check out Fabien Sanglard's excellent article [Let's Compile Like Its 1992][1992compile] 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.\n\n\n### Where to get it\n#### BC3.1 and TP7\nIf you don't already have BC3.1, TASM and TP7 lying around, then you can grab them from [WinWorld][winworld] - go to the *Library* section.\n\n#### DosBox\nDownload it from [DosBox.com][dosbox]\n\n--------------------------------\n\n### Dosbox\nWhile you can read (and you probably should) the [DosBox setup and installation wiki page][dosboxwiki] , here is a list of things that I did to get up and running.\n\nFirstly, I simply installed DosBox.\n\n#### C drive\nFirst, we need a place for our development tools to be installed.\n\nIn other words, we need a `C:\\` drive.\n\nI simply created a directory creatively entitled `DosBox` in my home directory.\n\n\n#### General configuration\n\nYou shouldn't really have to change anything, other than outlined below.\n\nThe configuration file for DosBox is `~/.dosbox/dosbox-0.74.conf` on Linux.\n\nLook it up if you are on other platforms.\n\n#### Autoexec.bat\nOpen up the dosbox configuration file and navigate to the end, where you will find the *autoexec* section.\n\n```\n[autoexec]\n# Lines in this section will be run at startup.\n# You can put your MOUNT lines here.\nmount c ~/DosBox\npath borlandc/bin;tasm/bin;tp7/tp/bin\nc:\n```\nWe mount the C drive, set up the path and change to the C drive.\n\n\n#### Floppy disks\nSince we are going to program like it's 1995, we need to deal with floppy disks.\n\nSo, since our machine does not have a floppy disk station, we use floppy disk images.  \nAnd a directory that we mount as floppy in DosBox.\n\nSo, create a directory for the floppy drive, and add a line in the `autoexec` section of the DosBox configuration file, like so:\n```\nmount a -t floppy ~/DOS/box_disks/floppy\n```\n\nNow, what's in the floppy disk directory will be available from the A drive inside of DosBox.\n\n**Insert and Change floppy disks**  \nSimply open a floppy image ( `disk01.img` ) in a disk image viewer, select all files and copy them to the `floppy` directory.\n\nWhen the installation program asks for the next disk, simply delete the files in `floppy` and copy the files of the next disk into it.\n\nVery low tech. But it works! :p\n\n#### CD ROMs\nIf you need to mount a CD drive, and you have an iso that you want to mount, then you can do that, like so:\n```\nimgmount d ~/DOS/WatcomCPP10.6/watcom10.6.iso -t iso\n```\nWhen you are done with it, simply remove the line, or comment it out (in case you want to mount another iso later).\n\nI 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. :)\n\n#### Cpu cycles\nA CPU speed of 50% works well.  \nPress `Ctrl+F10` to grab the input, and press `CTRL+F11` to decrease CPU cycles.  \nClick `CTRL+F10` to release the mouse again.\n\nSee the [DosBox - Special Keys][dosboxspecialkeys] wiki page for a list of key combos that you can use with it.\n\n#### DosBox Window\n\nIf you want the DosBox to be larger, you can set the size in the `[sdl]` section.\n\nMy settings are:\n```\nwindowresolution=1024x768\noutput=opengl\n```\n\nYou can also set autolock for the mouse to be off:\n```\nautolock=true\n\n```\nThen the mouse will not be grabbed automatically by the DosBox window.  \nYou can use `Ctrl+F10` to grab / ungrab it.\n\n#### DosBox Oddities\nIf you move files around on your C directory from outside of DosBox, you need to restart it to make DOS see it.\n\n--------------------------------\n\n### Borland C++ 3.1\n\n#### General advise\nIt is a good idea to minimize the use of the mouse when using the Borland C++ IDE.\n\nDon't click with your mouse in the DosBox window, if you don't want DosBox to grab it. Or turn off `autolock` (see above).\n\nUse 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.  \n**Achtung!** Do not use `CTRL+F9` to run your project, because that is the DosBox terminate key combo.\n\nUse `ALT+[number]` to quickly switch between windows.\n\n#### Project settings\nWhen a project is open, enter the Options menu - `ALT+O` - and make sure that the following is set:\n\n**Application**  \nDos Standard\n\n**Code Generation**  \nModel : Large  \n\n**Advanced Code Generation**  \nFloating Point : 80287/387  \nInstruction Set : 80386  \n\n**Entry/Exit Code Generation**  \nProlog/Epilog Code Generation : Dos standard  \n\n**C++ Options**  \nUse C++ Compiler : C++ always  \n\n**Linker**  \nOutput : Standard DOS EXE  \n\n**Debugger**\nProgram Heap Size : 350 K bytes  \n\n**Directories**  \nModify the Include / Library directories as needed.  \nConsider adding `C:\\GARD\\BC31\\[project_dir]` to the Source Directories.  \n\nMy *Include Directories* is:\n```\nC:\\BORLANDC\\INCLUDE;C:\\GARD\\BC31\\COMMON\n```\nMy *Library Directories* is:\n```\nC:\\BORLANDC\\LIB;C:\\GARD\\BC31\\COMMON\n```\n\nMake sure that you save the settings before exiting: `ALT+O S K`\n\n\n#### ASM and Turbo Assember\n\n#### Link shenanigans\n\nIn the `COMMON` directory, there are a couple of files in assembly code that needs to be built.\n\nYou 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.\n\nOr you can simply use Turbo Assembler on the command line.  \nDon't ask me how to do that :p\n\n\n##### TASM.EXE\nIf Borland complains that it can't find `TASM.EXE`, then go into `Options  - Transfer` and find `~Turbo Assember` and Edit it.  \nEnter `C:\\TASM\\BIN\\TASM.EXE` in `Program Path` and then hit the `Modify` button.\n\n##### TASM2MSG.EXE\nIf 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.\n\n--------------------------------\n\n### Turbo Pascal 7.0\n\nBecause TP7 needs to be patched to run with faster CPUs, it is a good idea to use version 7.0, and not 7.1.\n\n#### Divide by Zero CRT runtime bug\nTurbo Pascal works, but will produce executables that crashes with a *divide by zero* error at runtime.  \nIt will do that on faster CPUs, unless we patch it.\n\nDownload the  [Crt patch for TP7][tppatch] - get the compile time patches - and extract.  \nI used the first patch, and checked my TP7 version to figure out which patch to apply (it was the first one).\n\nCopy the files to the `bin` directory and run `PATCH PATCH700` (or PATCH701, depending on the date of your TP7).\n\n\n--------------------------------\n\n## Credits\n* General ideas and code from Christopher Lampton's book [Gardens of Imagination][gardens] (1994 - Waite Group) Also available from the [Internet Archive][gardens_arch]\n* VGA code from David Brackeen's [256-Color VGA Programming in C][vgainc] tutorial.\n* Keyboard code from Al Stevens' [Raycaster article - Dr. Dobb's Journal][raycast]\n\nSome code from the *dos/programming* section of the [x2ftp.oulu.fi mirror][x2ftp]\n\n--------------------------------\n\n\n[retronew]: https://codeberg.org/jacmoe/retronew \"Retronew\"\n\n[allegro]: https://liballeg.org/ \"Allegro\"\n\n[1992compile]: http://fabiensanglard.net/Compile_Like_Its_1992/index.php \"Compile Like Its 1992\"\n\n[winworld]: https://winworldpc.com/ \"WinWorld\"\n\n[dosbox]: https://www.dosbox.com/download.php?main=1 \"DosBox - Downloads\"\n\n[dosboxwiki]: https://www.dosbox.com/wiki/Basic_Setup_and_Installation_of_DosBox \"DosBox Wiki - basic setup\"\n\n[dosboxspecialkeys]: http://www.dosbox.com/wiki/Special_Keys \"DosBox Wiki - Special Keys\"\n\n[tppatch]: http://www.ipnet6.org/tppatch.html \"Crt patch for TP7\"\n\n[pal]: https://github.com/jacmoe/retrogardens/raw/master/screenshots/pal.jpg \"Palette\"\n\n[gardens]: https://www.amazon.com/Gardens-Imagination-Programming-Maze-Games/dp/187873959X \"Gardens of Imagination\"\n\n[gardens_arch]: https://archive.org/details/gardensofimagina00lamp \"Gardens of Imagination from the Internet Archive\"\n\n[raycast]: http://www.drdobbs.com/windows/windows-casting-rays-and-developer-days/windows/sourcecode/windows-casting-rays-and-developer-days/30300258 \"Raycaster\"\n\n[vgainc]: http://www.brackeen.com/vga/index.html \"256-Color VGA Programming in C\"\n\n[x2ftp]: http://ftp.lanet.lv/ftp/mirror/x2ftp/msdos/programming/ \"x2ftp.oulu.fi mirror\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacmoe%2Fretrogardens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacmoe%2Fretrogardens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacmoe%2Fretrogardens/lists"}