sdvxio-bio2 - [merged] #146

Closed
opened 2020-08-15 05:11:06 +03:00 by icex2 · 35 comments
icex2 commented 2020-08-15 05:11:06 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 04:11

Merges sdvxio-bio2 -> master

Summary

Adds sdvxio-bio2 along with bio2drv and aciotest updates

Description

sdvxio-bio2: Implements the sdvxio interface with a BIO2 device flashed with sdvx firmware
bio2drv: Implements the BIO2 specific detection and protocol info (#7)
aciotest: Added BIO2 sdvx polling to test utility
sdvxhook2/iidxhook8: refactor bio2emu

How Has This Been Tested?

Tested on a real sdvx cab with a BIO2, as well as the BIO2 I have on my desk

In GitLab by @xyen on Aug 15, 2020, 04:11 _Merges sdvxio-bio2 -> master_ ## Summary Adds sdvxio-bio2 along with bio2drv and aciotest updates ## Description sdvxio-bio2: Implements the sdvxio interface with a BIO2 device flashed with sdvx firmware bio2drv: Implements the BIO2 specific detection and protocol info (#7) aciotest: Added BIO2 sdvx polling to test utility sdvxhook2/iidxhook8: refactor bio2emu ## How Has This Been Tested? Tested on a real sdvx cab with a BIO2, as well as the BIO2 I have on my desk
icex2 commented 2020-08-15 05:11:46 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 04:11

added 8 commits

  • 600972b8...3ab55b9e - 2 commits from branch master
  • d77deaf7 - bio2emu: refactor BIO2 emulation
  • b701bf3c - iidxhook-util: allow setting specified ICCA emulation version
  • d7c0bd3e - bio2: bio2_bi2a_state -> bi2a_sdvx_state
  • ac908152 - sdvx: Allow setting digital amp level from sdvxio
  • 837fa049 - sdvxio-bio2: Add sdvxio BIO2 along with bio2drv and aciotest updates
  • 21d43d6f - doc: add documentation for sdvxio-bio2

Compare with previous version

In GitLab by @xyen on Aug 15, 2020, 04:11 added 8 commits <ul><li>600972b8...3ab55b9e - 2 commits from branch <code>master</code></li><li>d77deaf7 - bio2emu: refactor BIO2 emulation</li><li>b701bf3c - iidxhook-util: allow setting specified ICCA emulation version</li><li>d7c0bd3e - bio2: bio2_bi2a_state -&gt; bi2a_sdvx_state</li><li>ac908152 - sdvx: Allow setting digital amp level from sdvxio</li><li>837fa049 - sdvxio-bio2: Add sdvxio BIO2 along with bio2drv and aciotest updates</li><li>21d43d6f - doc: add documentation for sdvxio-bio2</li></ul> [Compare with previous version](/djhackers/bemanitools/-/merge_requests/45/diffs?diff_id=1272&start_sha=600972b80360b9d4a792443850857d7cec102a3e)
icex2 commented 2020-08-15 16:19:00 +03:00 (Migrated from github.com)

Nit: Rather odd name considering there is not actual analog input in the struct? Naming suggestions: struct bi2a_sdvx_sys, struct bi2a_sdvx_operator. IIRC I referred to a similar group as inputs as "sys" on IIDX.

Nit: Rather odd name considering there is not actual analog input in the struct? Naming suggestions: `struct bi2a_sdvx_sys`, `struct bi2a_sdvx_operator`. IIRC I referred to a similar group as inputs as "sys" on IIDX.
icex2 commented 2020-08-15 16:24:26 +03:00 (Migrated from github.com)

Good separatation into "bio2", 'bio2emu" and "bio2emu-iidx" 👍

Nit: It took me a moment to figure out that this commit was mainly about this. Pointing that out in the commit message is imo very helpful to understand the context of the changes faster.

Good separatation into "bio2", 'bio2emu" and "bio2emu-iidx" :+1: Nit: It took me a moment to figure out that this commit was mainly about this. Pointing that out in the commit message is imo very helpful to understand the context of the changes faster.
icex2 commented 2020-08-15 16:26:35 +03:00 (Migrated from github.com)

Can you briefly explain why this change is required or what it is used for? A brief comment here might be good to have.

Can you briefly explain why this change is required or what it is used for? A brief comment here might be good to have.
icex2 commented 2020-08-15 16:28:57 +03:00 (Migrated from github.com)

Taken from the documentation in the header file, I suggest to have some range checking of the values here and clip them if not within range.

Taken from the documentation in the header file, I suggest to have some range checking of the values here and clip them if not within range.
icex2 commented 2020-08-15 16:30:15 +03:00 (Migrated from github.com)

Leftover from testing/debugging?

Leftover from testing/debugging?
icex2 commented 2020-08-15 16:32:44 +03:00 (Migrated from github.com)

Since this is the public API of BT, I suggest adding the valid ranges of the parameters here. For now, I think we can stick to what's used internally, 0-96, though that look rather odd, because why not 0-100. shrug

Might be worth a brief comment to explain that we are exposing what the internal API accepts (similar to what we have done on IIDX already).

Since this is the public API of BT, I suggest adding the valid ranges of the parameters here. For now, I think we can stick to what's used internally, 0-96, though that look rather odd, because why not 0-100. *shrug* Might be worth a brief comment to explain that we are exposing what the internal API accepts (similar to what we have done on IIDX already).
icex2 commented 2020-08-15 16:37:09 +03:00 (Migrated from github.com)

Good note 👍

Good note :+1:
icex2 commented 2020-08-15 16:44:37 +03:00 (Migrated from github.com)

To avoid CPU banging, add a sleep(30) (30 ms ?) to the loop.

To avoid CPU banging, add a sleep(30) (30 ms ?) to the loop.
icex2 commented 2020-08-15 16:47:00 +03:00 (Migrated from github.com)

I assume by how it is used, another async thread is polling the IO. If that's the case, I suggest making this atomic to avoid visibility issues when the IO gets shut down.

I assume by how it is used, another async thread is polling the IO. If that's the case, I suggest making this atomic to avoid visibility issues when the IO gets shut down.
icex2 commented 2020-08-15 16:48:22 +03:00 (Migrated from github.com)

I don't get that part. Why are the different volume levels exposed if you can't set them individually?

I don't get that part. Why are the different volume levels exposed if you can't set them individually?
icex2 commented 2020-08-15 16:49:31 +03:00 (Migrated from github.com)

Can you give an example of how the config entry might look like?

Can you give an example of how the config entry might look like?
icex2 commented 2020-08-15 16:50:24 +03:00 (Migrated from github.com)

Same here, just an example of some config entries with potential values.

Same here, just an example of some config entries with potential values.
icex2 commented 2020-08-15 21:28:11 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/bio2/bi2a-sdvx.h line 7

only the first grouping is system, the other 4 are analog only.

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/bio2/bi2a-sdvx.h line 7](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-1a920aa2e0a8758198f5a03de37c39e7R7) only the first grouping is system, the other 4 are analog only.
icex2 commented 2020-08-15 21:28:11 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/iidxhook-util/acio.h line 25

It's unrelated to sdvxio-bio2, it's needed for emulating specific a ICCA versions for games that may need it. iidxhook_util_acio_override_versionwould be called with a particular version number for games that specify it.

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/iidxhook-util/acio.h line 25](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-0f0edd006871e553b3b6d7774f444e9dR25) It's unrelated to sdvxio-bio2, it's needed for emulating specific a ICCA versions for games that may need it. `iidxhook_util_acio_override_version`would be called with a particular version number for games that specify it.
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/aciodrv/kfca.c line 42

I don't actually know what the real range is, it seems to be 96-0, but I've seen some other code go to 100 as the minimum. Going past 100 is fine too, the device doesn't error out or anything.

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/aciodrv/kfca.c line 42](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-8d31ee7b610b97d9222b2c92c080750cL42) I don't actually know what the real range is, it _seems_ to be 96-0, but I've seen some other code go to 100 as the minimum. Going past 100 is fine too, the device doesn't error out or anything.
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/sdvxhook2/bi2a.c line 112

It's left there and commented out, so that people don't think that the call is missing. (and so they read the above comment).

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/sdvxhook2/bi2a.c line 112](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-746a3ce80a510b99a97dd57598191af8R112) It's left there and commented out, so that people don't think that the call is missing. (and so they read the above comment).
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/bemanitools/sdvxio.h line 101

I agree, I think I'll mention the range here as well.

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/bemanitools/sdvxio.h line 101](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..21d43d6f3dcc4ff370f09fa38b6de3205dba99e5#diff-265296de2ac1356b7bc7c857b8dd8fcdR101) I agree, I think I'll mention the range here as well.
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/sdvxio-bio2/sdvxio.c line 153

good point

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/sdvxio-bio2/sdvxio.c line 153](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-fa6c2d4b771cf358a54641fe0133b64eR153) good point
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on src/main/sdvxio-bio2/sdvxio.c line 322

These are based on the KFCA's values (from SDVX1-4) where they are settable individually.

(where the goal of sdvxio-bio2 is to let you play older titles on new cabs).

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [src/main/sdvxio-bio2/sdvxio.c line 322](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-fa6c2d4b771cf358a54641fe0133b64eR322) These are based on the KFCA's values (from SDVX1-4) where they are settable individually. (where the goal of sdvxio-bio2 is to let you play older titles on new cabs).
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on doc/sdvxhook/sdvxio-bio2.md line 16

The config file is auto generated, and I think it's pretty clear:

# Autodetect BIO2 port (default: on)
bio2.autodetect=true

# BIO2 serial port
bio2.port=COM4

# BIO2 bus baudrate (real devices expect 115200)
bio2.baud=115200
In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [doc/sdvxhook/sdvxio-bio2.md line 16](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-81e1eb1afa80d203d28dd7b422eb3aacR16) The config file is auto generated, and I think it's pretty clear: ``` # Autodetect BIO2 port (default: on) bio2.autodetect=true # BIO2 serial port bio2.port=COM4 # BIO2 bus baudrate (real devices expect 115200) bio2.baud=115200 ```
icex2 commented 2020-08-15 21:28:12 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:28

Commented on doc/sdvxhook/sdvxio-bio2.md line 17

see above

In GitLab by @xyen on Aug 15, 2020, 20:28 Commented on [doc/sdvxhook/sdvxio-bio2.md line 17](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-81e1eb1afa80d203d28dd7b422eb3aacR17) see above
icex2 commented 2020-08-15 21:36:06 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:36

Commented on src/main/sdvxio-bio2/sdvxio.c line 35

Kind of, the goal isn't to prevent the IO getting shut down too early, but to prevent the application from killing itself when there's still a poll in-flight.

The worst case is that the processing_io bit gets read late in sdvx_io_fini which is still fine.

In GitLab by @xyen on Aug 15, 2020, 20:36 Commented on [src/main/sdvxio-bio2/sdvxio.c line 35](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..47e8e7618e59a05ea67cfe14dc0b2f0fc0e6b3a0#diff-fa6c2d4b771cf358a54641fe0133b64eR35) Kind of, the goal isn't to prevent the IO getting shut down too early, but to prevent the application from killing itself when there's still a poll in-flight. The worst case is that the processing_io bit gets read late in `sdvx_io_fini` which is still fine.
icex2 commented 2020-08-15 21:37:17 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:37

Commented on src/main/bemanitools/sdvxio.h line 101

changed this line in version 3 of the diff

In GitLab by @xyen on Aug 15, 2020, 20:37 Commented on [src/main/bemanitools/sdvxio.h line 101](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..21d43d6f3dcc4ff370f09fa38b6de3205dba99e5#diff-265296de2ac1356b7bc7c857b8dd8fcdR101) changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/45/diffs?diff_id=1273&start_sha=21d43d6f3dcc4ff370f09fa38b6de3205dba99e5#f3e4768dcdc33b18aad87237ea6765481173e8c2_101_101)
icex2 commented 2020-08-15 21:37:19 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 15, 2020, 20:37

added 9 commits

  • 350ba005 - bio2emu: refactor BIO2 emulation
  • ccaf053a - iidxhook-util: allow setting specified ICCA emulation version
  • 4f43f6db - bio2: bio2_bi2a_state -> bi2a_sdvx_state
  • 22c69cf8 - Merge branch 'master' of dev.s-ul.eu:djhackers/bemanitools
  • b99abc5d - sdvx: Allow setting digital amp level from sdvxio
  • c7817352 - sdvxio-bio2: Add sdvxio BIO2 along with bio2drv and aciotest updates
  • 600972b8 - doc: add documentation for sdvxio-bio2
  • fc290a91 - Merge branch 'sdvxio-bio2' of dev.s-ul.eu:djhackers/bemanitools into sdvxio-bio2
  • 47e8e761 - sdvxio-bio2: Add better comments to amp command, and sleep in fini

Compare with previous version

In GitLab by @xyen on Aug 15, 2020, 20:37 added 9 commits <ul><li>350ba005 - bio2emu: refactor BIO2 emulation</li><li>ccaf053a - iidxhook-util: allow setting specified ICCA emulation version</li><li>4f43f6db - bio2: bio2_bi2a_state -&gt; bi2a_sdvx_state</li><li>22c69cf8 - Merge branch &#39;master&#39; of dev.s-ul.eu:djhackers/bemanitools</li><li>b99abc5d - sdvx: Allow setting digital amp level from sdvxio</li><li>c7817352 - sdvxio-bio2: Add sdvxio BIO2 along with bio2drv and aciotest updates</li><li>600972b8 - doc: add documentation for sdvxio-bio2</li><li>fc290a91 - Merge branch &#39;sdvxio-bio2&#39; of dev.s-ul.eu:djhackers/bemanitools into sdvxio-bio2</li><li>47e8e761 - sdvxio-bio2: Add better comments to amp command, and sleep in fini</li></ul> [Compare with previous version](/djhackers/bemanitools/-/merge_requests/45/diffs?diff_id=1273&start_sha=21d43d6f3dcc4ff370f09fa38b6de3205dba99e5)
icex2 commented 2020-08-16 12:31:08 +03:00 (Migrated from github.com)

what are the other 4 fields? I can only see 3: unk1, unk2 and a_val.

what are the other 4 fields? I can only see 3: unk1, unk2 and a_val.
icex2 commented 2020-08-16 12:32:36 +03:00 (Migrated from github.com)

That might be something to add to the comments then.

That might be something to add to the comments then.
icex2 commented 2020-08-16 12:38:04 +03:00 (Migrated from github.com)

Well, theoretically, the other value might not become visible to the other thread at all, though rather unlikely. I would still like to see the use of an atomic here because we have them since C11, it highlights the awareness of this situation and is simply safe and correct.

Well, theoretically, the other value might not become visible to the other thread at all, though rather unlikely. I would still like to see the use of an atomic here because we have them since C11, it highlights the awareness of this situation and is simply safe and correct.
icex2 commented 2020-08-17 05:56:48 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 17, 2020, 04:56

Commented on src/main/bio2/bi2a-sdvx.h line 7

struct bi2a_sdvx_analog analogs[4];

Only analogs[0] contains the system bits, 1-3 do not.

In GitLab by @xyen on Aug 17, 2020, 04:56 Commented on [src/main/bio2/bi2a-sdvx.h line 7](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..9fa83cef641a1f4e2904b13976f428b419d84261#diff-1a920aa2e0a8758198f5a03de37c39e7R7) `struct bi2a_sdvx_analog analogs[4];` Only analogs[0] contains the system bits, 1-3 do not.
icex2 commented 2020-08-17 06:57:32 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 17, 2020, 05:57

resolved all threads

In GitLab by @xyen on Aug 17, 2020, 05:57 resolved all threads
icex2 commented 2020-08-17 06:59:17 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 17, 2020, 05:59

Commented on src/main/sdvxio-bio2/sdvxio.c line 35

changed this line in version 4 of the diff

In GitLab by @xyen on Aug 17, 2020, 05:59 Commented on [src/main/sdvxio-bio2/sdvxio.c line 35](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..47e8e7618e59a05ea67cfe14dc0b2f0fc0e6b3a0#diff-fa6c2d4b771cf358a54641fe0133b64eR35) changed this line in [version 4 of the diff](/djhackers/bemanitools/-/merge_requests/45/diffs?diff_id=1274&start_sha=47e8e7618e59a05ea67cfe14dc0b2f0fc0e6b3a0#3976aee18b933b4c6929999387eb29b49f556486_35_35)
icex2 commented 2020-08-17 06:59:19 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 17, 2020, 05:59

added 1 commit

  • 9fa83cef - sdvxio: Add atomics to kfca/bio2

Compare with previous version

In GitLab by @xyen on Aug 17, 2020, 05:59 added 1 commit <ul><li>9fa83cef - sdvxio: Add atomics to kfca/bio2</li></ul> [Compare with previous version](/djhackers/bemanitools/-/merge_requests/45/diffs?diff_id=1274&start_sha=47e8e7618e59a05ea67cfe14dc0b2f0fc0e6b3a0)
icex2 commented 2020-08-17 14:24:24 +03:00 (Migrated from github.com)

approved this merge request

approved this merge request
icex2 commented 2020-08-17 19:51:44 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 17, 2020, 18:51

merged

In GitLab by @xyen on Aug 17, 2020, 18:51 merged
icex2 commented 2020-11-11 05:07:07 +03:00 (Migrated from github.com)

In GitLab by @xyen on Nov 11, 2020, 03:07

mentioned in commit a8a43254c5a3eae5d177f56266e4126bd9fc58c9

In GitLab by @xyen on Nov 11, 2020, 03:07 mentioned in commit a8a43254c5a3eae5d177f56266e4126bd9fc58c9
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Max/djhackersdev_bemanitools#146