-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOS backend #98
base: master
Are you sure you want to change the base?
DOS backend #98
Conversation
I’m wondering why is this |
There are functions to scale content, with and without bilinear filtering |
The silent fail is merely due to me having only implemented a 1:1 blit and a very bad 1:2 blit. You mean minifb has functions to scale buffers? I shall amend the PR then! |
Oh, how did I not see these before? Thanks for the pointer! https://github.com/emoon/minifb/blob/master/src/MiniFB_internal.c |
Alrighty, I fixed it up using |
Nice to know. I'm a little afraid of maintaining so many backends in the future 😅 |
I totally understand. For what it's worth, I'm actively using minifb in a bunch of projects that also require the web and DOS backend to keep working. I'd be happy to maintain them. If you want a track record of my OSS work, I'm the creator of libGDX, which has a track record of 12 years of maintenance :) |
Nice to know. |
Let me know when this PR is finished (solve the conflicts) |
# Conflicts: # .gitignore # CMakeLists.txt
I've fixed up the merge conflicts. I still need to modify the README.md file to document usage and limitations, and also do some testing on Linux. I'll ping you here once I think it's ready. |
Ok |
…--with-vs-code` flag.
Update README.md with (hopefully) extensive instructions. Tested everything on Windows, Linux, and macOS, including the debugging. Looks good to go on my end. Note: on Windows you need Ninja as the build generator again, just like with Emscripten. Wished MSBuild could handle it :/ |
Alright, I think I've fixed it all up well. Also tested on 86Box in vanilla MS-DOS 6.22, which does actual cycle accurate hardware emulation. Works well! I believe this is ready, if you think it's a nice addition to MiniFB. |
Excuse me for the long delay. Thanks in advance! |
After adding the Web backend, I figured why not try DOS as well. This PR adds support for DOS, to be more specific, minifb applications compiled with DJGPP, a popular 32-bit DOS compiler based on GCC, running on DOS hardware or emulators that support VESA.
The backend has a couple of limitations:
mfb_window_open()
must match a VESA mode available on the "machine" the app is running on. 320x240, 640x480, 800x600 work in DOSBox, but may not work on real hardware depending on the graphics card.mfb_update_ex()
must either be a perfect match of the window dimensions, or 1/2 the window dimensions. E.g.:The current minifb tests do not adhere to these limitations, so I added
tests/dos/dos.c
.To compile and run this test, you'll need DJGPP and DOSBox-x. The
tests/dos/tools/download-dos-tools.sh
script will download all the dependencies (and also a GDB version that understand COFF binaries) totests/dos/tools/
:You can then build for DOS via:
You can run then run the
dos.c
test via DOSBox-x:This is what it looks like in DOSBox :)
I know this has a super low probability to be merged, but I figured someone else who wants to use minifb for little DOS experiments may find this PR and use it.