Skip to content

Commit

Permalink
Prevent slowdown when using dolphin
Browse files Browse the repository at this point in the history
Prevent slowdown when using dolphin
  • Loading branch information
KittyPBoxx committed Jan 17, 2024
1 parent f82ebc9 commit 14bc8f0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion PokecomChannel/PokecomChannel/source/linkcableclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@

#define SERVER_NAME_SIZE 32

/*
* Honestly, I give up... trying to get get a good speed on a real wii with a ton of latency and dolphin with no latency
* is impossible. So we just detect if they are running dolphin and prevent the slow down fallback option.
*/
#define SPR_ECID_U 924
#define __stringify_1(x) #x
#define __stringify(x) __stringify_1(x)

#define mfspr(rn) ({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \
: "=r" (rval)); rval; })
bool IsDolphin(void)
{
return (mfspr(SPR_ECID_U) == 0x0d96e200);
}

// ======================= GBA LINK STUFF ======================================================

enum {
Expand Down Expand Up @@ -761,7 +777,10 @@ static void *seriald (void * port)
{
print_ui_log("SERIAL ERROR");
LOG_NS("Connection Error Resetting...\n");
switchToSlowTransfer();

if (!IsDolphin())
switchToSlowTransfer();

connector.requestSend = 0;
connector.requestReceive = 0;
connector.requestStop = 0;
Expand Down

0 comments on commit 14bc8f0

Please sign in to comment.