-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add Pokémon Colosseum,XD support #31
Conversation
That should be a different data format:
So in this case we'd need to modify the data to work correct. Now the question is, does Pokemon XD actually use the left/right buttons? Or do they use the dynamic depth feature? The code could be something like (not tested): else if (receivedBytes == 3 && command[0] == 0x40 && (command[1] == 0x03 || command[1] == 0x00))
{
// Minimum of left + right trigger
if (command[1] == 0x00) {
if (report->left > report->right) {
report->left = report->right;
}
report->right = 0x00;
}
gc_n64_send(report->raw8, sizeof(Gamecube_Report_t), modePort, outPort, bitMask);
[...] |
Thank you for your quick reply. |
I am checking the dolphin code: And this PR: It turns out, that my annotations are possibly incorrect. I currently aint got time or a setup to test this. I do not even know what analog A and B would be. There is no such thing on a normal controller. Do you know any custom controller with such buttons? |
Please try this: |
src/Gamecube.c
Outdated
if (command[1] == 0x03) | ||
{ | ||
gc_n64_send(report->raw8, sizeof(Gamecube_Report_t), modePort, outPort, bitMask); | ||
ret = 3; | ||
} else { | ||
Gamecube_Different_Report_t dif; | ||
gc_report_convert(report, &dif, command[1]); | ||
gc_n64_send(dif.raw8, sizeof(Gamecube_Different_Report_t), modePort, outPort, bitMask); | ||
ret = 3; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the question is, if we can simplify this by adding a return on mode 3 into the convert function and always send the dif
. Like:
Gamecube_Different_Report_t dif;
gc_report_convert(report, &dif, command[1]);
gc_n64_send(dif.raw8, sizeof(Gamecube_Different_Report_t), modePort, outPort, bitMask);
ret = 3;
And this in the convert function:
else if (mode == 3)
{
return;
}
The downside is, that for normal reading mode an additional memcpy call is made. I am not sure if that additional time will cause issues, but I guess it will work, if it also works for the other modes that do additional move operations. Could you please compare the flash size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check the flash size difference? Was it a good change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very good at English, and I'm not sure I fully read your intent... (This text is also written in translation.)
What do you mean by flash?
Which structure are you referring to? (mode0~4? Gamecube_Different_Report_t?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood.
"mode3=return" in the conversion function seems to reduce the size of the flash on the contrary.
I tried it with mode0 going through the function, but it didn't cause any noticeable delay.
The last commit is not what I wanted. Let me do the cleanup real quick... |
Closing in favor of: #42 |
Hello, thanks for the great library.
I found a problem where data could not be sent only when running Pokémon Colosseum/XD.
When running Pokémon Colosseum/XD, the GameCube seems to return different data than the other games.
However, i solved the problem by copying line 114 and below of Gamecube.c and changing
else if (receivedBytes == 3 && command[0] == 0x40 && command[1] == 0x03)
to
else if (receivedBytes == 3 && command[0] == 0x40 && command[1] == 0x00)
If you are comfortable with this change, I would appreciate it if you could merge the code.
Thank you.