Git Product home page Git Product logo

Comments (6)

alunbestor avatar alunbestor commented on July 23, 2024

As you've observed, if no controller is connected then Boxer disables gameport emulation and reports no joystick device to the game. This differs from DOSBox by design: in fact Boxer does this precisely because of Privateer, and games like it, because otherwise users wouldn't be able to start up Privateer at all without having a controller or a fake JOYA.DAT file - making the game otherwise unplayable out-of-the-box.

This behaviour does get in the way of a user-applied workaround for this MIDI bug however, since there is currently no way to force Boxer to present a joystick to the DOS game without having a controller attached. Boxer could selectively override its behaviour for Privateer, but that would then rely on the user having a JOYA.DAT file in place, and would break the game for everybody who doesn't.

So, a truly automatic workaround for this bug would require Boxer to:

  • Pretend there is a joystick even when there isn't; and simultaneously
  • Feed the game a fake JOYA.DAT file if a real one is not present.

Boxer could do the former without much trouble, but it has no functionality for the latter at the moment; I have been planning to implement such a system for handling problems like this though. (Such a system would be most useful if it could also patch DOS binaries in memory, but that's a whole other kettle of fish.)

One question: does your fake JOYA.DAT contain valid calibration data that results in usable joystick control if one later connects a real controller? The game will not ask the user to recalibrate if JOYA.DAT is present, so it's vital that the calibration data in the file is valid.

from boxer.

isrob avatar isrob commented on July 23, 2024

A good analysis of the impact of some of the workarounds, thank you. There's real calibration data in that JOYA.DAT file, yes, but who knows if that would be appropriate for different controllers so it certainly isn't a solution in itself. I don't know the details of Privateer's calibration data, but unfortunately I would assume as a file it's only useful in the absence of an actual controller and calibration data.

from boxer.

alunbestor avatar alunbestor commented on July 23, 2024

Well helpfully modern USB and bluetooth game controllers provide consistent inputs that Boxer can reliably normalize, so calibration data that's accurate for one controller is also accurate for any other.

(In practice there's one or two exceptions to this: principally when calibrating on a controller with square axis travel, like a PC gamepad, then using the same calibration data with a controller with circular travel, like a console gamepad - they can't reach the same diagonal extents, so the game doesn't think they're pushing all the way. That's not a major problem with Privateer though.)

from boxer.

isrob avatar isrob commented on July 23, 2024

I see. The file's taken from somewhere floating around the web, so if this was something that ended up as a bundled workaround I would recommend recalibrating with an actual controller connected to OS X and Boxer as I can't vouch for its accuracy. Unfortunately I don't have one.

from boxer.

isrob avatar isrob commented on July 23, 2024

Bit more info:

I got in touch with Mario Brito (of http://hcl.solsector.net/), who has been in the Wing Commander modding scene for literally decades. Asked him about the issue and he was aware of it, so poked at the executable and actually came up with a fix. In short, the game tells the CPU to ignore interrupts during reads of the joystick; this would generally be good (guarantees timing accuracy) but the game doesn't re-enable interrupts when it's done. They get re-enabled 'at some point' later, messing the music timing.

Patch out the interrupt ignore instruction and bam, solved. Mario's going to revisit the patch at a later date to look into making the joystick reading generally more robust (read: timed), but cursory checks don't suggest any issues (either with or without a joystick attached).

BSDiff patch for PRCD.exe:
http://isrob.com/files/prcd_patch.bdf

from boxer.

alunbestor avatar alunbestor commented on July 23, 2024

Oh nice catch! That explanation does make a lot of sense. I'll test this myself and will let GOG know of the fix so hopefully they'll integrate it into the copy of Privateer they're selling.

(If the diff could get weaponised as a patcher exe, that could go up on wcnews.com as well - I dunno what tools are available for wrapping bspatches though.)

from boxer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.