GXTX / YACardEmu

Software emulator for Sanwa CRP-1231BR-10 / CRP-1231LR-10NAB / CR-S31R-10HS3 card readers.
GNU General Public License v2.0
32 stars 10 forks source link

ability to see if front shutter (?) is open or not (WMMT3DX+) #13

Closed hjri closed 2 years ago

hjri commented 2 years ago

Real reader won't accept cards if game doesn't request one, i.e. trying to stick card into reader while game is already running won't work - card won't even go all the way in.

For purposes of creating NFC replacement it would be nice to be able to know this state, i.e. to make NFC reader ignore card taps unless game requests card (or if there's dummy card present to transfer it to a new card) as well as to add some LED effects to attract user's attention to nfc reader.

GXTX commented 2 years ago

This behavior was present when I first started working on this, but I found that MT3 didn't always request a "waiting for card" status and instead would try to read from nothing, setting a read error on this would cause the game to need to be rebooted. I'm not sure a good work around for this, perhaps always setting waiting for card when you receive a request for read? Not sure.

https://github.com/GXTX/YACardEmu/commit/197ea136

hjri commented 2 years ago

MT3DX+ does have some weirdness in regards with card reader - it would try to eject the card when rebooting, i'm assuming if card reader reports card present - i.e. machine was reset while card was still inside (like in case i mentioned in #11 where it emulator would feed it zeroes and game would error out). It also has this thing that on POST if card-reader check failed (i.e. emulator was miscofingured parity/baud) it would always fail the check after every soft reset, the error will go away only if you hard-reset the machine (by unplugging it).

I think that MT3 keeps its own internal state of the cardreader instead of asking it directly, again - i mentioned in #12 how "filling" the "empty" dispenser has no effect - game doesn't ask the state of it and instead assumes that it's still empty.

I think at least exposing internal state (localStatus?) in API could help monitoring the situation and writing NFC replacement tool

hjri commented 2 years ago

IMG_20220729_201415

Did the necessary changes, wrote controller for it, IT WORKS

GXTX commented 2 years ago

Closed by #14