Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions platform/ds/arm9/source/nifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ int nifiStartLink() {

nifiFrameCounter = -1;

memset((void*)&receivedInputReady, 0, sizeof(receivedInputReady));
memset((void*)&receivedInput, 0, sizeof(receivedInput));
memset(oldInputs, 0, sizeof(oldInputs));

mgr_reset();
if (nifiLinkType == LINK_CABLE) {
printLog("Start Gb2\n");
Expand All @@ -574,12 +578,6 @@ int nifiStartLink() {
if (nifiLinkType == LINK_CABLE)
mgr_setInternalClockGb(gameboy);

// Fill in first few frames of client's input
for (int i=0; i<CLIENT_FRAME_LAG; i++) {
receivedInputReady[i] = true;
receivedInput[i] = 0xff;
}

// Set input destinations
if (nifiLinkType == LINK_SGB) {
nifiInputDest = &gameboy->controllers[0];
Expand All @@ -599,10 +597,6 @@ int nifiStartLink() {
if (nifiLinkType == LINK_CABLE)
mgr_setInternalClockGb(gb2);

// First few frames of input are skipped, so fill them in
for (int i=0; i<OLD_INPUTS_BUFFER_SIZE; i++)
oldInputs[i] = 0xff;

// Set input destinations
if (nifiLinkType == LINK_SGB) {
nifiInputDest = &gameboy->controllers[1];
Expand Down