diff --git a/src/NDS.cpp b/src/NDS.cpp index a2329bc6..9d8772a4 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -935,7 +935,9 @@ bool DoSavestate(Savestate* file) { // 'dept of redundancy dept' // but we do need to update the mappings - MapSharedWRAM(WRAMCnt); + u8 wramcnt = WRAMCnt; + WRAMCnt ^= 0xFF; + MapSharedWRAM(wramcnt); InitTimings(); SetGBASlotTimings(); diff --git a/src/frontend/qt_sdl/Netplay.cpp b/src/frontend/qt_sdl/Netplay.cpp index 4765f59b..dbf4b2ab 100644 --- a/src/frontend/qt_sdl/Netplay.cpp +++ b/src/frontend/qt_sdl/Netplay.cpp @@ -615,7 +615,7 @@ printf("[MC] finish blob type=%d len=%d\n", type, len); if (Blobs[Blob_CartROM]) { res = NDS::LoadCart(Blobs[Blob_CartROM], BlobLens[Blob_CartROM], - Blobs[Blob_CartSRAM], BlobLens[Blob_CartSRAM]); + Blobs[Blob_CartSRAM], BlobLens[Blob_CartSRAM]); if (!res) { printf("!!!! FAIL!!\n"); @@ -647,6 +647,10 @@ printf("[MC] finish blob type=%d len=%d\n", type, len); BlobLens[i] = 0; } + /*Savestate* zorp = new Savestate("netplay3.mln", true); + NDS::DoSavestate(zorp); + delete zorp;*/ + printf("[MC] state loaded, PC=%08X/%08X\n", NDS::GetPC(0), NDS::GetPC(1)); ENetPacket* resp = enet_packet_create(buf, 1, ENET_PACKET_FLAG_RELIABLE); enet_peer_send(peer, 1, resp);