Alright, this is a LITTLE too weird, but in the trailer, we see Sora and Riku in the ending of KH2. Then they change into KH1 clothes. As you can see Riku is about to face Ansem while Sora faces Xemnas. So I think Yensid must have prepared them by giving them a dream, which is DDD. I know it might seem strange, but that's what I think.