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

Update GameCube to GBA link cable emulation #2139

Merged
merged 1 commit into from Mar 20, 2015

Conversation

8 participants
@skidau
Contributor

skidau commented Feb 27, 2015

Preliminary update to the GameCube to GBA link cable emulation. Fixes Zelda Wind Waker's Tingle Tuner connection, Pac-Man Vs, Final Fantasy: Crystal Chronicles multiplayer, and most other Gamecube to GBA link cable games.

  • Changed the SI buffer processing so that transfers do not have to be completed instantly
  • Added a second socket at port 49420 (0xc10c) which sends clock information to the GBA slaves
  • Checked for connections every 2 seconds instead of every second to reduce CPU load
  • Handled disconnections from the GBA and GC
  • Made the transfers asynchronous
  • Blocks the socket before the connection times out

Windows VBA-M build and patch:
http://www.mediafire.com/download/d1h8u2hokg4b1ed/VBA-M_update_GameCube_cable.zip

@skidau

This comment has been minimized.

Show comment
Hide comment
Source/Core/Core/HW/SI_DeviceGBA.cpp
+static std::mutex cs_gba_clk;
+static u8 num_connected;
+
+namespace { volatile bool server_running; volatile bool clock_server_running; }

This comment has been minimized.

@delroth

delroth Feb 27, 2015

Member

Common::Flag

@delroth

delroth Feb 27, 2015

Member

Common::Flag

Source/Core/Core/HW/SI_DeviceGBA.cpp
+ break;
+ }
+ default:
+ bytes_transferred = 1;

This comment has been minimized.

@lioncash

lioncash Feb 28, 2015

Member

Might want to add a break here to avoid getting this flagged on higher warning levels.

@lioncash

lioncash Feb 28, 2015

Member

Might want to add a break here to avoid getting this flagged on higher warning levels.

This comment has been minimized.

@BhaaLseN

BhaaLseN Feb 28, 2015

Member

And maybe curly braces, so that it looks like the other cases?

@BhaaLseN

BhaaLseN Feb 28, 2015

Member

And maybe curly braces, so that it looks like the other cases?

+ }
+ case CMD_WRITE:
+ {
+ bytes_transferred = 1;

This comment has been minimized.

@endrift

endrift Mar 3, 2015

Contributor

CMD_WRITE absolutely transfers 6 bytes, not just 1. It just happens to be that some of those bytes are in the opposite direction, but they're still there. Moreover, this timing information doesn't account for the two stop bits involved per transfer—one for the end of the GameCube's data, and one for the end of the GBA's data.

@endrift

endrift Mar 3, 2015

Contributor

CMD_WRITE absolutely transfers 6 bytes, not just 1. It just happens to be that some of those bytes are in the opposite direction, but they're still there. Moreover, this timing information doesn't account for the two stop bits involved per transfer—one for the end of the GameCube's data, and one for the end of the GBA's data.

+ CMD_WRITE = 0x15
+};
+
+const u64 BITS_PER_SECOND = 115200;

This comment has been minimized.

@endrift

endrift Mar 3, 2015

Contributor

As discussed on IRC, the actual bps of the JOY link is closer to 220kbps, not 115.2kbps.

@endrift

endrift Mar 3, 2015

Contributor

As discussed on IRC, the actual bps of the JOY link is closer to 220kbps, not 115.2kbps.

Source/Core/Core/HW/SI_DeviceGBA.cpp
+ if (status == sf::Socket::Disconnected)
+ {
+ clock_sync->disconnect();
+ clock_sync = NULL;

This comment has been minimized.

@lioncash

lioncash Mar 5, 2015

Member

nullptr

@lioncash

lioncash Mar 5, 2015

Member

nullptr

Source/Core/Core/HW/SI_DeviceGBA.cpp
+ {
+ num_connected--;
+ client->disconnect();
+ client = NULL;

This comment has been minimized.

@lioncash

lioncash Mar 5, 2015

Member

nullptr

@lioncash

lioncash Mar 5, 2015

Member

nullptr

Source/Core/Core/HW/SI_DeviceGBA.cpp
client->disconnect();
+ client = NULL;

This comment has been minimized.

@lioncash

lioncash Mar 5, 2015

Member

nullptr

@lioncash

lioncash Mar 5, 2015

Member

nullptr

@JMC47

This comment has been minimized.

Show comment
Hide comment
@JMC47

JMC47 Mar 9, 2015

Contributor

Poke. Latest version seems to work as well as any prior version.

Contributor

JMC47 commented Mar 9, 2015

Poke. Latest version seems to work as well as any prior version.

Preliminary update to the GameCube to GBA link cable emulation. Fixes…
… Zelda Wind Waker's Tingle Tuner connection, Pac-Man Vs, Final Fantasy: Crystal Chronicles multiplayer, and most other Gamecube to GBA link cable games.

* Changed the SI buffer processing so that transfers do not have to be completed instantly
* Added a second socket at port 49420 (0xc10c) which sends clock information to the GBA slaves
* Handled disconnections from the GBA and GC
* Made the transfers asynchronous
* Blocks the socket before the connection times out

Requires VBA-M SVN 1235 or later.

skidau added a commit that referenced this pull request Mar 20, 2015

Merge pull request #2139 from skidau/gc-gba-link
Update GameCube to GBA link cable emulation

@skidau skidau merged commit 9b1c2d3 into dolphin-emu:master Mar 20, 2015

10 checks passed

default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on the Buildbot.
Details
pr-android Build succeeded on the Buildbot.
Details
pr-deb-dbg-x64 Build succeeded on the Buildbot.
Details
pr-deb-x64 Build succeeded on the Buildbot.
Details
pr-osx-x64 Build succeeded on the Buildbot.
Details
pr-ubu-nogui-x64 Build succeeded on the Buildbot.
Details
pr-ubu-x64 Build succeeded on the Buildbot.
Details
pr-win-dbg-x64 Build succeeded on the Buildbot.
Details
pr-win-x64 Build succeeded on the Buildbot.
Details
@aFoxNamedMorris

This comment has been minimized.

Show comment
Hide comment
@aFoxNamedMorris

aFoxNamedMorris Mar 26, 2015

From this version on, I get a core dump when attempting to start the program. Xubuntu 14.04 64-bit, Linux 4.0-rc5 and latest Intel graphics drivers from Oibaf PPA. I am stuck using 5897 for now, which works decently.

From this version on, I get a core dump when attempting to start the program. Xubuntu 14.04 64-bit, Linux 4.0-rc5 and latest Intel graphics drivers from Oibaf PPA. I am stuck using 5897 for now, which works decently.

@skidau

This comment has been minimized.

Show comment
Hide comment
@skidau

skidau Mar 26, 2015

Contributor

@aFoxNamedMorris is there a stack trace that I can view? It would be strange for it to core-dump on starting the program as the code comes into play when a game is started.

Contributor

skidau commented Mar 26, 2015

@aFoxNamedMorris is there a stack trace that I can view? It would be strange for it to core-dump on starting the program as the code comes into play when a game is started.

@DXGLdotinfo

This comment has been minimized.

Show comment
Hide comment
@DXGLdotinfo

DXGLdotinfo Mar 26, 2015

On Windows 10 x64 10041, I can confirm that Wind Waker's Tingle Tuner works, at least for a few minutes at a time. However, it does desync easily, in which case the GBA is stuck and the game on Dolphin thinks it is still connected, even if I close VBA-M.
On the VBA-M side, I would suggest adding a borderless, floating, always-on-top window mode.

On Windows 10 x64 10041, I can confirm that Wind Waker's Tingle Tuner works, at least for a few minutes at a time. However, it does desync easily, in which case the GBA is stuck and the game on Dolphin thinks it is still connected, even if I close VBA-M.
On the VBA-M side, I would suggest adding a borderless, floating, always-on-top window mode.

@aFoxNamedMorris

This comment has been minimized.

Show comment
Hide comment
@aFoxNamedMorris

aFoxNamedMorris Mar 28, 2015

@skidau No longer happens, for whatever reason. It may have been a driver update that caused both the crash, and now the working state. Carry on. :3

@skidau No longer happens, for whatever reason. It may have been a driver update that caused both the crash, and now the working state. Carry on. :3

@skidau

This comment has been minimized.

Show comment
Hide comment
@skidau

skidau Mar 28, 2015

Contributor

Thanks for the update, @aFoxNamedMorris. That problem would have been a tough one to work out.

Contributor

skidau commented Mar 28, 2015

Thanks for the update, @aFoxNamedMorris. That problem would have been a tough one to work out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment