Live data from Hacker News

Why Castrol Honda Superbike crashes on (most) modern systems

seri.tools

31–36 of 36 posts

Re: Why Castrol Honda Superbike crashes on (most) modern systems

#31

Its interesting to see how bad assumptions that almost certainly held up at the time really don't any more and that leads to this bug being exposed. Modern machines have a lot more addressable devices and a failure to properly filter and using a vector ultimately leads to a bug that on the surface feels like since it works on Win98 must be caused by Windows but isn't.

I mean that's just a bad assumption no matter how anyone looks at it - if you created an array for 8 devices then just stop adding to it when you reach 8. The "a user will never have more than 8 gamepads" is a bad assumption because the logical question then is "what if they do" and the answer even back in the day would have been "the game will crash" which isn't how any code should be written. Stop processing at 8 if you are so sure there will never be more than 8, but have the most basic sanity checks.

Re: Why Castrol Honda Superbike crashes on (most) modern systems

#32

Its interesting to see how bad assumptions that almost certainly held up at the time really don't any more and that leads to this bug being exposed. Modern machines have a lot more addressable devices and a failure to properly filter and using a vector ultimately leads to a bug that on the surface feels like since it works on Win98 must be caused by Windows but isn't.

I mean that's just a bad assumption no matter how anyone looks at it - if you created an array for 8 devices then just stop adding to it when you reach 8. The "a user will never have more than 8 gamepads" is a bad assumption because the logical question then is "what if they do" and the answer even back in the day would have been "the game will crash" which isn't how any code should be written. Stop processing at 8 i…

Back in the days of manually setting IRQs enough of them were used by the system that no, you couldn't use 8 gamepads. Assuming you could even connect them.

(I think this game is probably past those times but not by much)

Re: Why Castrol Honda Superbike crashes on (most) modern systems

#33

> Microsoft has only kept the documentation for the DX8 version of EnumDevices left online This saddens me. Who knows how much valuable info has been lost. I recall back in the days of MSDN, we had docs back to early Windows, and it was a wonderful historical record. Today's Docs site seems to keep info only for a few versions.

Also of note Valve's Proton only goes back to DX8. Versions prior to that were considered not worth it.

That's only kind of true; Wine itself supports older versions of DirectX with the target API being OpenGL instead of Vulkan. It's just not quite super performant and kinda buggy. That said, there's other wrappers you can use to convert older DirectX versions into new ones, and if you can get to DirectX 8 or 9, now you've got DXVK.

Re: Why Castrol Honda Superbike crashes on (most) modern systems

#34
post #32

Earlier quoted context omitted.

I mean that's just a bad assumption no matter how anyone looks at it - if you created an array for 8 devices then just stop adding to it when you reach 8. The "a user will never have more than 8 gamepads" is a bad assumption because the logical question then is "what if they do" and the answer even back in the day would have been "the game will crash" which isn't how any code should be written. Stop processing at 8 i…

Back in the days of manually setting IRQs enough of them were used by the system that no, you couldn't use 8 gamepads. Assuming you could even connect them. (I think this game is probably past those times but not by much)

I specifically checked if DirectInput from DirectX 5 already supports/provides USB HID devices, and it does! Granted, even then it was unlikely to encounter 8 USB devices, let alone HID devices in particular.

Re: Why Castrol Honda Superbike crashes on (most) modern systems

#35

> Microsoft has only kept the documentation for the DX8 version of EnumDevices left online This saddens me. Who knows how much valuable info has been lost. I recall back in the days of MSDN, we had docs back to early Windows, and it was a wonderful historical record. Today's Docs site seems to keep info only for a few versions.

Why share something which you can sell for exorbitant prices? /s

They are not selling it either.
Post reply on HN