Skip to content
master
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

libjwdpmi

This library aims to be a complete development framework for DPMI (32-bit DOS) applications, written in C++20.
It's still in the experimental stage. Anything may change at any time.

Features

Current features include:

  • C++ interfaces to access many DPMI services.
  • Interrupt handling, including dynamic IRQ assignment, IRQ sharing, and nested interrupts.
  • CPU exception handling, also nested and re-entrant.
  • Automatic translation of CPU exceptions to C++ language exceptions.
  • Cooperative multi-threading and coroutines.
  • Event-driven keyboard interface.
  • Integrated GDB remote debugging backend.
  • Access to PIT, RTC and RDTSC clocks using std::chrono interface.
  • Yamaha OPL2/OPL3 driver with automatic channel allocation.
  • MIDI protocol implementation and MPU-401 driver.
  • VESA VBE3 graphics interface.
  • Accurate analog game port driver.
  • Serial port driver with std::iostream interface.

Installing

  • Build and install gcc with --target=i386-pc-msdosdjgpp, and install the djgpp standard library.
    An easy to use build script is available here: https://github.com/jwt27/build-gcc

  • Set your PATH accordingly:

$ export PATH=/usr/local/cross/bin:$PATH
  • Add this repository as a submodule in your own project
$ git submodule add https://github.com/jwt27/libjwdpmi.git ./lib/libjwdpmi
$ git submodule update --init
  • In your makefile, export your AR, CXX and CXXFLAGS, and add a rule to build libjwdpmi:
AR:=i386-pc-msdosdjgpp-ar
CXX:=i386-pc-msdosdjgpp-g++
CXXFLAGS:=-std=gnu++2a -masm=intel

export AR CXX CXXFLAGS
libjwdpmi:
    $(MAKE) -C lib/libjwdpmi/
  • Add the include/ directory to your global include path (-I) and link your program with libjwdpmi.a, found in the bin/ directory.
obj/%.o: src/%.cpp
    $(CXX) $(CXXFLAGS) -o $@ -Ilib/libjwdpmi/include -c $<

bin/program.exe: $(OBJ) libjwdpmi
    $(CXX) $(CXXFLAGS) -o $@ $(OBJ) -Llib/libjwdpmi/bin -ljwdpmi -Wl,@lib/libjwdpmi/tools/ldflags

Using

See the wiki page, where I'm slowly adding documentation.
Read the header files in include/, most functions should be self-explanatory (I hope :)). The detail namespaces contain implementation details, you shouldn't need to use anything in it (file a feature request if you do).

License

It's GPLv3, for now. I may decide to move to a different (less restrictive) license in the future. Therefore I am unable to accept code contributions at this time.

About

C++20 development framework for 32-bit DOS applications

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages