alinebee / Boxer

The DOS game emulator that's fit for your Mac.
http://boxerapp.com/
770 stars 139 forks source link

Make Boxer 64-bit compatible for macOS 10.14 #76

Open simonbrueckner opened 6 years ago

simonbrueckner commented 6 years ago

A couple of days ago, macOS 10.13.4 was released which starts issuing warnings that apps which don't support 64-bit will be retired with macOS 10.14 (expected in Autumn '18).

This means that Boxer will in its current setup stop working on the latest macOS later this year.

I get it that the main issue is that underlying DosBox is not 64-bit compatible - but at least it has been compiled with 64-bit support a couple of years ago: https://hexeract.wordpress.com/2016/09/10/building-dosbox-as-x64-binary-for-macos-sierra/

It would be great to keep Boxer running for the macOS community!

chrismaaz commented 4 years ago

If anyone likes their DOS games in macOS apps/wrappers and is impatient to wait for Boxer improvements, I reverse engineered a DOSBox based GOG wrapper to use the SDL2 version of DOSBox SVN, with all the performance gains of 0.74-3 (and more). It also seems to fix audio bugs and the MT-32 music/graphics lag issue noted above.

Have you run any benchmarks on it and compared it to DosBox 0.74-3. If so, mind posting them here?

Also, has it or can Glide support be added?

almeath commented 4 years ago

For Glide support, I also have a DOSBox-X version of the wrapper, which I can only get to work in SDL1 mode, but the test results are still good either way. Using the same tests that you did:

DOSBox SVN (SDL2):

Chris 3D Benchmark: 558.3 fps

Quake: 113.2 fps

DOSBox-X (SDL1):

Chris 3D Benchmark: 340.8 fps

The Quake test did not work in DOSBox-X, giving an error about a "missing gfx/pop.lmp". I did not have time to mess with the extensive DOSBox-X settings to try to fix this. I can only presume that SDL2 DOSBox-X would be more comparable in performance to SVN, but I am still working on that one.

I ran this on a 2019 iMac, Mojave 10.14.6, 3.6 GHz Intel Core i9 with 40 GB RAM and AMD Vega 48 with 8GB RAM.

MaddTheSane commented 4 years ago

Good news: I was able to migrate to glCallList and it seems to have increased speed. Bad news: the view can end up flipped upside-down or quarter-sized.

You can test it on my sdl2test branch. It probably should only be used for benchmarking until the flipping, etc… can be resolved.

Note: although this is on an SDL2 test branch, SDL2 is not needed to use glCallList.

For Glide: There are patches out there that add Glide support to DOS. There might need some work to add it to Boxer, though.

chrismaaz commented 4 years ago

You can test it on my sdl2test branch. It probably should only be used for benchmarking until the flipping, etc… can be resolved.

Great! Can you also supply a build to test for us who doesn't have the tools / knowledge to compile the source? Cheers!

almeath commented 4 years ago

Here you go:

https://www.dropbox.com/s/j5p6f4ua6tgtreh/sdl2test%2012.22.19.zip?dl=0

PatTheMav commented 4 years ago

@MaddTheSane Glide-support is finicky even in ECE and SVN builds. There is one patch for Voodoo1-based games that translates Glide into OpenGL directly, and another one that redirects Glide calls into the Dosbox binary (which then requires another Glide wrapper to take over rendering duties) for Voodoo2+ (and a combo-patch that includes both).

The more (de-)pressing issue might be OpenGL's assured (and at worst very soon-ish, aka in macOS 10.16) removal on macOS. It's been deprecated since 10.14, hasn't been updated since and won't receive any driver updates.

It's a big pain in the butt, but doing anything 3d-related on macOS and not using Metal is just postponing the inevitable - see also: 64-bit. 😬

chrismaaz commented 4 years ago

Here you go:

https://www.dropbox.com/s/j5p6f4ua6tgtreh/sdl2test%2012.22.19.zip?dl=0

Tried it and it runs at the same speed for me as the 64-bit 2.0 alpha, maybe even a bit slower.

Good news: I was able to migrate to glCallList and it seems to have increased speed. Bad news: the view can end up flipped upside-down or quarter-sized.

You can test it on my sdl2test branch. It probably should only be used for benchmarking until the flipping, etc… can be resolved.

Can you compile and release a build of this please? 💯

Schweini07 commented 4 years ago

Here you go:

https://www.dropbox.com/s/j5p6f4ua6tgtreh/sdl2test%2012.22.19.zip?dl=0

DOS games are upside-down and really small.

Welp - Seems like this AWESOME fellow named YOZY decided to make it work (or compiled the 64-bit branch?) on 64-bit - I tested and verified it's working in Catalina dancer

Forum I found it from:

https://www.dosgameclub.com/forums/topic/boxer-app-64-bit/

File Link: https://yozy.net/files/downloads/2019/Boxer-2019-03-03.zip

Would be great to see this officially updated for Catalina

That helped

MaddTheSane commented 4 years ago

Can you compile and release a build of this please? 💯

@almeath's compiled build should be the version with the speed-up.

DOS games are upside-down and really small.

This is a known issue. It's why I mentioned that it should only be used for benchmarking.

chrismaaz commented 4 years ago

Welp - Seems like this AWESOME fellow named YOZY decided to make it work (or compiled the 64-bit branch?) on 64-bit - I tested and verified it's working in Catalina dancer

Forum I found it from:

https://www.dosgameclub.com/forums/topic/boxer-app-64-bit/

File Link: https://yozy.net/files/downloads/2019/Boxer-2019-03-03.zip

Would be great to see this officially updated for Catalina

That helped

I already tried the Yozy build but it's not running as fast as DosBox. Also, there seem to be a lot of branches and unofficial builds of Boxer now, would be great if people could collaborate into something awesome instead :)

Schweini07 commented 4 years ago

Yeah.. After Boxer is appereantly pretty dead a new project would be interesting

MaddTheSane commented 4 years ago

FYI, YOZY has an account on GitHub It's @jlegeny.

jlegeny commented 4 years ago

Hey, yozy here! Sorry for not finding this conversation earlier. My repository is here and I have committed the (tiny) changes I've made to the branch: https://github.com/jlegeny/Boxer/commit/9ff4112439e3160877fab203d07be43f4a1dbb2e

I've only modified it so it would compile. I don't actually have a computer that can run Catalina so I can't really work on it right now but I would be definitely interested in collaboration to make this work. For example one of the issues with my "fix" is that opening the game folder no longer correctly works.

agustincordes commented 4 years ago

Hi folks, I've been using Boxer since it launched. One of my all-time favorite apps, so thank you for keeping it alive! I can confirm that @MaddTheSane's superb branch works almost flawlessly on Catalina. I say "almost" because some minor bugs remain while importing games or using the inspector. However, I've been testing many titles, including Win3.1 games, without issues. Shadow boxing, the holy grail required to keep boxes intact, is working great too 🙏

I'd love to contribute and commit fixes, UI polishing, etc., but I agree that we should decide which one is going to be the "semi-official" branch. maddsV2 is IMO the perfect candidate.

BTW @MaddTheSane: I've tweaked the CRT shader to make it look more authentic, relying less on annoying scanlines. Is it OK if I push it to your branch? https://i.imgur.com/yWo0TDe.jpg

chrismaaz commented 4 years ago

Hi folks, I've been using Boxer since it launched. One of my all-time favorite apps, so thank you for keeping it alive! I can confirm that @MaddTheSane's superb branch works almost flawlessly on Catalina. I say "almost" because some minor bugs remain while importing games or using the inspector. However, I've been testing many titles, including Win3.1 games, without issues. Shadow boxing, the holy grail required to keep boxes intact, is working great too 🙏

Can you confirm the speed on that branch? My tests indicate that it ist still way behind DosBox 0.74-3 in terms of performance.

agustincordes commented 4 years ago

Yeah @chrismaaz, the difference is brutal. Tested on Catalina 10.15.2, 3.7 GHZ 6-core.

Chris 3D Benchmark:

Boxer (max speed): 65.6 DOSBox 0.74-3 (default settings): 505.5 DOSBox 0.74-2 (default settings): 24.3

However, do note that Boxer is performing notably better than 0.74-2. It's quite interesting, what seems to be a minor release throws a way higher performance on Mac.

agustincordes commented 4 years ago

Ah, this would explain it:

It looks like DOSBox migrated from glDrawArrays to glCallList

Call lists are way faster. It shouldn't be too difficult to upgrade the DOSBox that's bundled with Boxer...

MaddTheSane commented 4 years ago

The part of the code that uses glDrawArrays is in Boxer's end, not DOSBox. I have done some initial work on porting it to glCallList on my sdl2test branch, but it still needs work so it isn't a quarter of the window or upside-down.

I think 0.74-3 adds support for the dynamic core for x86-64 systems. That's where the speed increase is happening. Also, my Boxer fork implements the changes from DOSBox trunk, including the dynamic core. That's probably why the speed isn't lower than 0.74-2.

I've tweaked the CRT shader to make it look more authentic, relying less on annoying scanlines. Is it OK if I push it to your branch?

Go ahead!

chrismaaz commented 4 years ago

Yay! I hope that @MaddTheSane and @agustincordes (and whoever else) can collaborate on this to make Boxer 2.0 close enough to DosBox 0.74-3 in terms of performance. Everything is great with Boxer and it's my go-to platform for Dos emulation.

agustincordes commented 4 years ago

Done @MaddTheSane!

I was wondering about some merges that I noticed from 0.74-3. That explains why Boxer falls somewhere in between now.

I won't be able to contribute much right now, but what I can do is report all the issues I'm finding and other ideas (ie: the ability to quickly browse a shadowed folder to backup saves, etc). We can either collect these issues in Madd's fork, or perhaps launch a Trello board.

chrismaaz commented 4 years ago

Any news about future builds?

cfq commented 4 years ago

Hello all,

I'm sure everyone is very busy and this problem might not be easy to solve, but I'm really waiting to see if this can be resolved. I've been playing a copy of Colonization I got from GOG for a good 3 or 4 years now, and it has been working wonderfully thanks to Boxer. They've reverted back to a really horrible Dosbox wrapper which doesn't have any of the features I depended on, such as numpad emulation and window resizing/scaling.

Is there any chance we will ever see another version of Boxer?

Many thanks!

almeath commented 4 years ago

Some of the older GOG DOSBox wrappers are not great, but I had much success with tweaking some of their more recent wrappers (i.e. the one that comes with WarCraft). I have got it to the stage where I can now use a generic wrapper and drop the latest builds of DOSBox (SDL1 or SDL2) or DOSBox-X inside it to keep it up-to-date with the latest features, many of which have never been available within Boxer. There has also been much progress in the last 6-8 months with the DOSBox performance in 64-bit. In addition, the latest SDL2 build supports a Metal renderer.

The one thing this option cannot re-produce is the macOS user-friendliness of Boxer. It has taken me weeks and months of constant tweaking to make my wrappers work perfectly. Each game needs to be manually adjusted using DOSBox config options and it is not a mainstream solution. That being said, there is hardly anything Boxer does that I have not been able to get working again in the DOSBox wrappers with proper configuration.

marnovo commented 4 years ago

@almeath would you mind sharing this generic wrapper?

almeath commented 4 years ago

@marnovo I would be happy to provide you with the wrapper/s and instructions but there appears to be no way to PM each other on here. As mentioned in my posts above, I am concerned that I have reverse engineered a GOG wrapper and I would rather not post a link publicly on here.

Anyone who is interested, please either PM me on the Vogons.org forum (username is almeath) or email me at my above username at the domain eftel.com

almeath commented 4 years ago

As an example of things implemented in the wrapper that are not available in Boxer, you can use GLSL shaders. Here I have the CRT-Lottes shader working in the wrapper under Mojave:

https://www.dropbox.com/sh/261pji131xrj42a/AADaP8gwCIB50bb0wb7UWSR5a?dl=0

justinswart commented 4 years ago

To those folks trying to revive this and get it working again - you are seen and appreciated! If I knew more about C/C++ I'd try to help out.

I'm wondering if we could get some sort of sponsorship together to fund future development. I'd personally be happy to contribute to keeping this great little app alive.

augmentedfourth commented 4 years ago

None of the binary 64-bit builds in this thread work with my USB Gravis GamePad Pro. The buttons all seem to work, but Boxer doesn't recognize movement on the directional pad. Is there anything I can do about that? The best one I've found is "maddsV2 12.07.2019.zip" (at least the video is right-side up and looks normal), but the aforementioned joypad problem is present and the audio is a little choppy. I wish I could help develop, but testing/reporting bugs is all I'm really good for on this project.

almeath commented 4 years ago

None of the binary 64-bit builds in this thread work with my USB Gravis GamePad Pro. The >buttons all seem to work, but Boxer doesn't recognize movement on the directional pad.

Unfortunately that issue has been outstanding for a long time now. It was reported several times over the last couple of years, such as here: https://github.com/alunbestor/Boxer/issues/102

It must be a bug in the 64-bit alpha code because the problem does not occur with Boxer 1.4 (32-bit).

chrismaaz commented 4 years ago

I have tried all 64-bit builds and Boxer still sadly runs like Garbage on my Macbook Pro with Catalina 10.15.4. The 32-bit version ran way better, even om my much slower Mac. And the 64-bit build of DosBox runs perfect. I always preferred Boxer for games though and I would like to continue to run Boxer, so what's missing to get Boxer to run with the same performance as its 32-bit build?

aminta commented 4 years ago

Hi all!

I've tried the @MaddTheSane version (2020-12-07), games work but installers don't work, I get always a "session is not ready" message, please see the attached image...

Schermata 2020-06-13 alle 11 38 29
almeath commented 4 years ago

In relation to “session not ready”, refer to my comments above of 21 October 2019.

aminta commented 4 years ago

In relation to “session not ready”, refer to my comments above of 21 October 2019.

Perfect, thanks!

almeath commented 4 years ago

I presume that DOSBox has received many patches and optimizations which are not reflected in the Boxer 2.0 alpha code. DOSBox is being continually developed, whereas no official Boxer release has occurred since 2016. While I thought that the various patched builds of Boxer will draw on the same updated DOSBox core when being compiled, there must be parts of the code that clash or do not integrate properly, resulting in poor performance on some systems. Personally, I found Boxer 2.0 works acceptably on a range of Macs, but it will be blown away in the benchmarks against DOSBox.

getaaron commented 4 years ago

I presume that DOSBox has received many patches and optimizations which are not reflected in the Boxer 2.0 alpha code. DOSBox is being continually developed, whereas no official Boxer release has occurred since 2016. While I thought that the various patched builds of Boxer will draw on the same updated DOSBox core when being compiled, there must be parts of the code that clash or do not integrate properly, resulting in poor performance on some systems.

Personally, I found Boxer 2.0 works acceptably on a range of Macs, but it will be blown away in the benchmarks against DOSBox.

Maybe it’s time we fork Boxer into a new project and make an official release?

MaddTheSane commented 4 years ago

@stuartcarnie is working on making a Metal renderer for Boxer. It will use OpenEmu shaders. His fork can be found here: https://github.com/stuartcarnie/Boxer/tree/sgc/metal Yes, I'll probably merge this into my fork.

stuartcarnie commented 4 years ago

Pushed all the updates so that:

Here is a taste of a couple of shots from 2nd Reality running 60fps at 4k on my 2019 MBP

2nd Reality 2020-07-11 at 8 32 15 PM 2nd Reality 2020-07-11 at 8 32 40 PM

TheQL commented 4 years ago

That's pretty awesome. Is there a build available of the current status?

chrismaaz commented 4 years ago

That's pretty awesome. Is there a build available of the current status?

I second that, does anyone have a build of this we can try without having to compile it ourselves?

This looks really great @stuartcarnie - I salute you. I guess there's some speed increase using Metal? Previous 64-bit builds I have tried have been unusable on my machine.

MaddTheSane commented 4 years ago

Previous 64-bit builds I have tried have been unusable on my machine.

Part of that is my inexperience with OpenGL, and Boxer's use of glDrawArrays. With the move to Metal, we no longer have to worry about substandard OpenGL coding practices.

hanej commented 4 years ago

I would like to salute everyone working on this project to keep retro gaming alive on MacOS. You guys are doing great work and it doesn't go unnoticed or unappreciated. Thank you all very much.

aminta commented 4 years ago

Pushed all the updates so that:

  • OpenGL is gone
  • Upgraded Boxer and DOSBox to SDL2 (via C_SDL2 define similar to other forks)
  • Added CRT, smooth and pixel shaders, though OpenEmuShaders provides a whole lot more (including parameters and support for all slang-shaders)

Here is a taste of a couple of shots from 2nd Reality running 60fps at 4k on my 2019 MBP

Great!

Though, I've tried to compile on Catalina 10.5.5 MacbookPro 2017 Xcode 11.5 and gives me these errors:

Schermata 2020-07-13 alle 12 54 24
stuartcarnie commented 4 years ago

@aminta those are missing git submodules. git submodule update --init --recurse

(I have built it on Catalina)

aminta commented 4 years ago

@aminta those are missing git submodules. git submodule update --init --recurse

(I have built it on Catalina)

git submodule update --init --recurse doesn't work, tried with git submodule update --init --recursive but same build error...

stuartcarnie commented 4 years ago

Sorry, was typing on my phone earlier. Try:

$ git pull --recurse-submodules
chrismaaz commented 4 years ago

Pushed all the updates so that:

Any chance for a downloadable build so we all don't have to get Xcode and compile ourselves? Cheers! :)

aminta commented 4 years ago

Sorry, was typing on my phone earlier. Try:

$ git pull --recurse-submodules

it says: "Already up to date."

agustincordes commented 4 years ago

Extremely good update, @stuartcarnie! The difference is day and night. You can tell when toggling between window/fullscreen just how fast and smooth this is. Congratulations, superb work!

I'd recommend we keep the CRT shader that I submitted to @MaddTheSane a while ago -- it's more accurate and eases down those rough scanlines. Moreover, the shader in your build produced a strange flickering with hi-res games such as Dark Seed II.

stuartcarnie commented 4 years ago

I included CRT Geom, which has an interlaced emulation. I will improve Boxer’s shader support to be similar to OpenEmu, where you will be able to tweak all the parameters, including disabling interlacing or using advanced shaders like CRT Royale Kurozumi

stuartcarnie commented 4 years ago

That also includes support for the shader you previously included 👏🏻