Boxer

Developer diary: plans and progress reports.

Now in Stereo Tuesday 29th June 2010

A new Boxer 1.0 alpha build is fresh out of the oven. Since this build has ended up focusing on UI refinement, a few gratuitous screenshots seemed in order:

Multiple sessions at once

Opening additional gameboxes or DOS windows will launch additional Boxer instances to handle them. More on this below.

A usability injection for the program-chooser panel

Besides looking cleaner, the panel now highlights the default program and bumps it to the start of the list. It also slides away after clicking the default program, instead of hanging around taking up space.

And a few more improvements

So what are you waiting for? Go grab it already.

An aside for technically-minded people regarding multiple sessions

A limitation which has dogged Boxer 1.0 from the very beginning is DOSBox’s one-shot nature. Because DOSBox is compiled into Boxer, Boxer’s memory is DOSBox’s memory; and DOSBox stores its emulation state in a vast hive of global variables, which it doesn’t bother cleaning up afterwards.

This prevents DOSBox from handling two emulation sessions at once — because each session clobbers the other one’s state — and from starting up a second emulation session after finishing the first — because the subsequent session inherits a hopelessly polluted state from the first one. Imagine a living room the morning after a student party.

This is of no concern to a hard-living Windows transplant like DOSBox, which was designed to quit as soon as the emulation exits. But it is of concern to a well-behaved native app like Boxer, which wants to stay open in the Dock, and to be able to open and reopen as many windows as it needs, just like all its other Mac chums.

Boxer was a sad panda. Until now.

The ideal solution

Would be for Boxer to move the DOSBox emulator core to a separate child process with its own isolated memory space, and spawn instances of this emulator process for each window. This way DOSBox could shit in its own sandpit as much as it likes, it could run alongside other emulator processes without fear of cross-pollution, and it could be terminated or paused or restarted at will by the parent application (Boxer) without ruining everyone else’s day.

This was the approach that Google Chrome took for its tabs, that OpenEMU adopted for its multi-emulator cores, and that Boxer will eventually use for its DOS sessions.

However, restructuring Boxer to manage this parent-child process relationship is complex and has a lot of pitfalls. The groundwork for it is pretty far along, but it’s unlikely to be ready in time for Boxer 1.0.

So instead, the cheap and cheerful solution

Is for Boxer to simply launch more Boxers. When Boxer has a DOS window open and it gets a request to open another, it just spawns a new Boxer instance and tells that to open the window instead. If you try to open a new window after closing one, then Boxer quits and immediately relaunches to open the new window with a clean slate.

This approach has disadvantages. Each Boxer instance is a separate application as far as OS X is concerned: so they appear separately in the Dock and CmdTab switcher. Instances can’t coordinate with each other: so windows tend to open exactly over the top of existing ones, and preference changes in one don’t take effect immediately in another. This is very much a stopgap solution.

But, grubby and hackish though this is, it’s so dramatically better than before that I wanted to get it out there for people to play with right away.

Commentary

  1. Amazing work, as usual. Many, many thanks.

  2. Love the new program chooser panel, works really well. Looking forward to version 1 and the eventual reintroduction of joysticks! (Tie Fighter is calling to me).

  3. Great product! You certainly made quick work of the crash - Glad I could help. Awaiting the 'next'.

  4. if Dosbox is compiled into Boxer, wouldn't you need to make the changes public? GPL comes to mind.

  5. They are public: the full sourcecode for Boxer is released under the GPL, and can be downloaded from Boxer's bitbucket repository (the same place as the alpha builds).

  6. First time for me to try Boxer, and I'm really impressed, tried it with System Shock and everything was so easy, drag and dropping the volumes, ... How would switching between CDs work in multi CDs games? Is 64bits in the pipe (just a question , not a request :P)? Look forward to trying the next builds! Awesome work!

  7. Hi Ben, glad you’re liking it :)

    Switching physical CDs works just as you'd expect in 1.0: eject one and insert the other, and Boxer will take care of the rest. If you have the CDs stored as folders or disc images, you can swap them via the Drives panel by unmounting the drive and remounting another in its place, though this is rather labour-intensive.

    I have plans for a whizzy-neat UI for mounting a set of disc images and/or folders on a single drive, and then hot-swapping between them with a quick toggle. However, this is a significant amount of work and will remain unimplemented until after 1.0. The proposed design is documented in this Boxer issue.

    Boxer itself is 64-bit-ready but won’t be released as 64-bit until DOSBox itself moves to doing 64-bit builds. At the moment they release only 32-bit binaries where possible, because the 64-bit code for the dynamic CPU core is not as well-optimised as the 32-bit and has some hairy FPU limitations (at least that's my understanding). In other words, a 64-bit Boxer would just give worse performance than 32-bit, rather than any benefit.

Add your two cents

Design by 40watt.