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

Some code was sent my way #776

Closed
arcadez2003 opened this issue Mar 11, 2020 · 1 comment
Closed

Some code was sent my way #776

arcadez2003 opened this issue Mar 11, 2020 · 1 comment

Comments

@arcadez2003
Copy link
Collaborator

Hi there @twinaphex

Some code was sent my way which will be of benefit to both MAME2003 and MAME2003+
although im retired from working on this core there is no point in letting it go to waste
if you or anyone else decide to use the code credits goto BritneysPAIRS...........

Attached is the change for MAME2003+ to support absolute light gun positioning. Note the mame source was from a few months ago and may have changed since then a tiny bit. We needed this to be fixed and have supplied the fixes for this (same for when the xbox was broken some years ago and needed to be fixed).

http://s000.tinyupload.com/index.php?file_id=98464986887089762673

Regards Ken

Line47-48: added light gun position array, it used to only store mouse positions
Line1207-1208: added input callback inside retro_run(), this is for our code to return lightgun position
Line1209-1210: converts position from callback to mame2003 (light gun returns absolute positions from 0-4095, mame uses -128~128 -> converts absolute to mame using (x-2028)/16)
Line1919-1921: osd_lightgun_read() mame uses this to read the lightgun positions, this used to be an empty function with no input or return values

Missing parts in the original mame2003 code:

  1. didn't store absolute positions for lightguns, just relative positions for mice
  2. didn't have input callback to get light gun device
  3. had to convert light gun coordinate to mame's
  4. missing code inside osd_lightgun_read()

Regards!!

@arcadez2003
Copy link
Collaborator Author

Hi arcadez is it possible to change the links to this as there is an error in the first lot. This patch can just directly insert now for testing as they will like

https://anonfiles.com/zfN4g0h1of/lightgun_patch

Regards Ken

I have tested this on an legends arcade so its best to use this new link please and I will be looking at steering wheel etc soon to see if I can get these working properly

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

No branches or pull requests

1 participant