GithubHelp home page GithubHelp logo

embeddeddoom's Introduction

embeddedDOOM

A port of DOOM targeted for memory-strapped systems.

The first rev of this is lifted directly from https://github.com/id-Software/DOOM.

This is specifically targeted for the shareware version of DOOM, and rips out a few features here and there in favor of being as small (RAM-wise) as possible.s

WARNING: This repository uses LFS to store the Shareware. You will need to do a git lfs fetch in the firmware folder to get it updated. Sometimes something goes wrong with it and you have to git lfs install --force; git lfs pull

Right now, it uses (on -m32 / linux):

  • .bss: 170,992 bytes + DOOM Heap (recommend 294,912 if possible, can use as little as 120kB for E1M1)
    • DOOM Heap: Some levels take more than others, E1M6 takes ~280kB, E1M1 takes ~107kB
    • Configurable in stubs.h -- variable is DOOMHeap
    • Framebuffer lives in this space. It's CombinedScreens -- Note: This is not the normal behavior, normally DOOM Keeps 4 copies of each screen, but we just lie and alias all 4 copies. It does mean you can't get the blood transitions between levels and the end screens get a tad sloppy.
  • .data: 45,600 bytes
  • .text: 108,536 bytes
  • .rodata: 5,685,632 bytes -- Includes the WAD files.

Also, this build requires no file I/O had has highly customizable user input and video output.

So, theoretically, you could run this on a system with only 384kB RAM.

For installing on x64

Because DOOM (in its current state is 32-bit ONLY, you can only compile to 32-bit targets. This is OK though, since the Makefile includes -m32, but you must install the 32-bit compat libs with the following:

On Debian/Ubuntu based systems:

sudo apt-get install gcc-multilib libx11-dev:i386 libxext-dev:i386 libnsl-dev:i386

On Arch based systems:

sudo pacman -S lib32-libx11 lib32-libxext lib32-libnsl gcc-multilib

Btw

Use ./emdoom -warp 1 2 where second number is the map # (1 to 9)

I cut out screen transitions because it took an extra 64kB on the Heap!

Files of interest

  • stubs.h/.c is where most of the control for the pairin
  • doomdef.h - just has some useful bits. Consider turning on RANGECHECK if you are going to be making substantial changes.
  • i_*.c has al the interface files for a host system.
  • Check out if the configuration of COMBINE_SCREENS is what you want. It controls how the screen memory is allocated.

Building, etc.

  • Type "make" -- this builds the .wad into a .c (if build step is uncommented) and into the target arch's .o. Then, it builds doom with that and a very large heap. It runs it once to generate all of the tables used for various things. It then writes those tables to .c files in the support/ folder... Which it compiles into target arch .o's. These .o's are linked in to provide the tables needed in .ro so they aren't taking up prescious ram.

To see memory usage:

  • Type "make emdoom.size" - it'll show you a list of all of the DATA, BSS and TEXT items, increasing in size (second column) as well as size of all sections. You probably care about .text, .rodata, .data and .bss.

TODO:

  • Figure out how to separate out things like the lines and line segments into rodata and .data/.bss.
  • Figure out how to change screen size successfully. It just really loves making errors.

To port

Edit i_video.c Edit i_system.c Configure stubs.h to your liking.

embeddeddoom's People

Contributors

clemdemort avatar cnlohr avatar raspiduino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

embeddeddoom's Issues

Further table squashing

This appears to be something that might be bakeable.

lighttable_t*		scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
lighttable_t*		scalelightfixed[MAXLIGHTSCALE];
lighttable_t*		zlight[LIGHTLEVELS][MAXLIGHTZ];

Allow pre-quash

To do things like remove sprites from the spritemap list.

RISCV Build Instructions

Hey, I'm looking to port DOOM to Computerraria which is baremetal rv32i. This project seems perfect and you're Youtube video on it was awesome!

The project builds perfectly for my Linux desktop and it outputs to the screen properly. However when I try to build for riscv (right now rv32ima) by uncommenting the block in the makefile, I get various different errors. I can't tell if the RISCV build is targetting embedded Linux or baremetal, the compiler in the makefile says riscv64-unknown-elf-gcc, but when I try uncommenting the relevant block in the makefile it complains that it can't find sys/ioctl.h which is definitely Linux . Also the makefile references startup.S, which as far as I can tell isn't referenced anywhere else and doesn't exist. These are solvable issues insofar as I can just remove these dependencies given I don't need sound and network capabilities, but I want to make sure that I'm not missing how I'm supposed to build for RISCV.

emdoom.gentables syntax error

I'm trying to compile for Linux x11, no changes made to the source code. But it fails with

gcc -o support/wadder support/wadder.c
(cd support;./wadder;cd ..)
Table: 1264 4175796
gcc   -m32 -O1 -g -w -flto -DNORMALUNIX -DLINUX  -c -o tmp.o support/rawwad.c
mv tmp.o support/rawwad.o
gcc   -m32 -O1 -g -w -flto -DNORMALUNIX -DLINUX  -L/usr/X11R6/lib -m32 -O1 -g -w -flto -DNORMALUNIX -DLINUX  i_main.c support/rawwad.o -o emdoom.gentables -lXext -lX11 -lnsl -lm -lpthread -DGENERATE_BAKED doomdef.c doomstat.c dstrings.c i_system.c i_video.c tables.c f_finale.c f_wipe.c d_main.c d_items.c g_game.c m_menu.c m_misc.c m_argv.c m_bbox.c m_fixed.c m_swap.c m_cheat.c m_random.c am_map.c p_ceilng.c p_doors.c p_enemy.c p_floor.c p_inter.c p_lights.c p_map.c p_maputl.c p_plats.c p_pspr.c p_setup.c p_sight.c p_spec.c p_switch.c p_mobj.c p_telept.c p_tick.c p_saveg.c p_user.c r_bsp.c r_data.c r_draw.c r_main.c r_plane.c r_segs.c r_sky.c r_things.c w_wad.c wi_stuff.c v_video.c st_lib.c st_stuff.c hu_stuff.c hu_lib.c z_zone.c info.c os_generic.c XDriver.c DrawFunctions.c i_net.c d_net.c stubs.c sounds.c s_sound.c i_sound.c
./emdoom.gentables
./emdoom.gentables: 1: ./emdoom.gentables: Syntax error: word unexpected (expecting ")")
make: *** [Makefile:94: support/baked_texture_data.c] Error 2

additions to the README

(this is a suggestion to add this to the readme because I did not want to bother with a pull request)

dependencies for arch linux:

dependencies :

sudo pacman -S lib32-libx11 lib32-libxext lib32-libnsl gcc-multilib

then compilation works flawlesly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.