Skip to content

Roninkoi/REND13X

Repository files navigation

REND13X software renderer

VGA software renderer written in C and x86 assembly. Mode 13h (320x200) or mode X (320x240), 256 colors.

The purpose of this project is to explore early game engine development and x86 assembly graphics programming.

Compiled using Turbo C++ 3 or equivalent (supporting inline assembly). Assembly versions assembled using Turbo Assembler 5. The program can be compiled using the project file REND13X.PRJ or batch file BUILDC.BAT (inline version). Assembly versions built using BUILD13.BAT and BUILDX.BAT. Runs on real hardware (DOS, i486 or equivalent) or in DOSBox.

FEATURES

  • "Fast" x86 assembly draw routines for line drawing and triangle fills.

    • Two video modes: mode 13h or mode X, define MODE13 or MODEX in RENDER.H to enable/disable.
    • Line drawing is implemented using Bresenham's algorithm (mode 13h line draw is faster).
    • Triangle filling is implemented in two ways: a non-clipped inaccurate fast fill (using fixed-point) and clipped accurate slow fill (using Bresenham's algorithm), define FASTFILL in RENDER.H to enable/disable.
    • Graphics routines written in assembly are available inline in C (16-bit) or assembled and linked separately (32-bit), define ASM in the corresponding C file.
  • 3D perspective projected triangle draw with z sorting, geometry clipping, face culling and wireframe rendering.

  • Simple vector/matrix math and transforms.

  • Page flipping in mode X (double buffering).

  • Keyboard interrupt handler for smooth multi-key input.

CONTROLS

Key Action
WASD Move
Arrows Rotate camera
R Fly up
F Fly down
Esc Exit to DOS

TODO

  • Improve mode X fills for better plane handling.

  • Clip geometry partially behind the camera.

  • Set custom color palette.

  • Wish list:

    • Sprite rendering
    • Text rendering
    • Bespoke floor/ceiling/sky draw routines
    • Sound
    • Texturing
    • Z-buffer

About

VGA software renderer (mode 13h / mode X) written in C and x86 asm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published