Skip to content
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

Battle Gear 4 Key/RFID + IO Plus emulation #1086

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

derole1
Copy link

@derole1 derole1 commented Feb 24, 2025

As title says, please see some taito-specific JVS commands that have been emulated which now allow key emulation to work properly with Battle Gear 4 Tuned without memory patches etc.

Two bugs have also been patched to ensure emulation lines up with real Universal JVS I/O packets:

  • Watchdog reset response has been changed from 0x00, 0x00 to 0xA0. Real JVS/IO only returns 1 byte not 2 and its always 0xA0
  • An exception to the TaitoStick specific response to JvsGetDigitalReply has been added to remove the 4th byte. This should really check the data bytes parameter of the request to determine how many bytes the game wants back, battle gear 4 requests 3 and as TP JVS emulation does not check this for TaitoStick games it will return 4 regardless. This may well fix JVS emulation issues elsewhere too as it invalidates everything after the switch request in the packet (which is the first request in the chain).

With minor modification I would wager this is also applicable to other Taito Universal JVS I/O games (HL2 Survivor etc?).

Raising as a draft to tidy up/add a way to configure the key id, figure out unknown values, as well as ensure I havent broken anything. Would appreciate any comments/feedback! It is fully working in its current state from what I can see.

@EmiMidnight EmiMidnight marked this pull request as ready for review February 24, 2025 15:07
@EmiMidnight EmiMidnight marked this pull request as draft February 24, 2025 15:08
@derole1 derole1 changed the title Key/RFID emulation for Battle Gear 4 Tuned Battle Gear 4 Key/RFID + IO Plus emulation Feb 27, 2025
@derole1
Copy link
Author

derole1 commented Feb 27, 2025

This PR also addresses issue #960

@derole1 derole1 marked this pull request as ready for review March 1, 2025 19:55
@derole1
Copy link
Author

derole1 commented Mar 1, 2025

Requesting a review on this PR. Is pretty much ready and has been tested extensively with a G27 and confirmed 6MT and sequential are both working as expected and all switches etc are also. Valve Limit R (another taito game that uses the same IO config roughly) is also unaffected.

This is with one caveat however. There is a slight bug where you cannot push View and Hazard buttons at the same time, as well as the Overtake button turning the Key switch on (which is inverted by the game).

This existed prior to this PR for SD mode and is due to how TP handles joystick inputs. Essentially TP disallows both Left+Right and Up+Down to be pressed at the same time. This is not an issue with traditional games that use the joystick inputs as intended but when they are used for switches this becomes an issue, especially if two in opposing directions need to be pressed independantly.

I would like some maintainer/developer input here on how best I can work around this before merging. I imagine it is there due to traditional stick JVS games having the joystick physically limit which switches can be pressed (e.g. a joystick cannot physically press left+right or up+down at the same time) however this is not part of the JVS spec and I believe many JVS boards will pass physically "invalid" switch inputs like this without question.

Once this is discussed and PR is merged I will mark the matching OpenParrot PR for review (if the OpenParrot one gets merged before this it will break BG4 tuned pro support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant