First post, by carangil
I've been wanting to run DOSBOX in weird places, sometimes those that don't have a working SDL port. I've found a few people randomly asking online if DOSBOX can be used without SDL. I've also thought it would be cool to have DOSBOX more like a library anyone can build their own UI around, and without dependence on SDL, lightweight DOS emulation can easily be incorporated into any project.
I've spent some time the last couple days hacking around gui/sdlmain.cpp, getting DOSBOX to always render to a 32-bit color buffers (literally just char of the correct size) without using a SDL surface. I also abstracted the keyboard interface a bit, and now I have a fork of dosbox that doesn't need SDL for video or keyboard... I don't even SDL_Init VIDEO anymore. The buffers are currently being displayed (and keyboard events generated) by using a PixelToaster window. The intention isn't to port DOSBOX to PixelToaster, but rather port DOSBOX to a simple interface that just periodically says "HERE's a new framebuffer" or "got any keys/mouse for me?" For now I am ignoring ( commented out) joysticks, as that is a lot of SDL code, and I've never been that into them... This is mostly at the proof of concept phase... If someone really wants joysticks and find this interesting, they can do the work.
I'm moving onto sound today, and again it's going to be a simple "Here's some audio" kinda interface. I think keyboard/display/sound is a nice minimum working proof of concept... everything else can be commented out stubs. There are a handful of small things like GetTicks that I need to work out, but reading the time isn't exactly hard.
My eventual goal is to port DOSBOX to DOS, without using HX extender. If I don't have SDL, but get a 32bit linear framebuffer, then the interface I made up above should be able to copy into the real framebuffer no problem. For sound I will need to grab the ac97 and hda drivers for MPXPLAY, but I think HX extender did the same thing.
Another idea I have (this one is a bit of a stretch) is I'm also considering porting it to be a command in the iPXE bootloader. WHY? It has a fairly complete runtime, and can set VESA or UEFI graphics up on lots of video cards already, and has filesystem drivers and extensive network support... (No sound, but again that's solvable and not necessary for a proof of concept) Why would I want to shove DOSBOX into a bootloader? Just because... it will be DOSBOX directly booting off of a modern UEFI PC, with no linux kernel sitting underneath it, and with significantly less stuff going on than booting freedos and running HX (plus freedos can't do uefi partitions...) If this works, then that makes iPXE-DOSBOX a DOS-compatible operating system for modern PCs.