From 97b5a7ed1d7591c44e7e047f1038bfd98e02172b Mon Sep 17 00:00:00 2001 From: luigi__ Date: Sun, 25 Dec 2011 18:17:36 +0000 Subject: [PATCH] MMU: add (experimental) support for writing to VCount. This is apparently required for proper multiplayer sync. --- desmume/src/MMU.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 1ffaf8a30..14cf8b4c4 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -1870,6 +1870,9 @@ if(_startmode==0 && wordcount==1) { int zzz=9; } + if (enable && procnum==1 && (!(chan&1)) && _startmode==6) + printf("!!!---!!! WIFI DMA: %08X TO %08X, %i WORDS !!!---!!!\n", saddr, daddr, wordcount); + //analyze enabling and startmode. //note that we only do this if the dma was freshly enabled. //we should probably also only be latching these other regs in that case too.. @@ -3824,6 +3827,16 @@ void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val) //Address is an IO register switch(adr) { + case REG_DISPA_VCOUNT: + if (nds.VCount >= 202 && nds.VCount <= 212) + { + printf("VCOUNT set to %i (previous value %i)\n", val, nds.VCount); + nds.VCount = val; + } + else + printf("Attempt to set VCOUNT while not within 202-212 (%i), ignored\n", nds.VCount); + return; + case REG_RTC: rtcWrite(val); break;