From fc6cf5dbef0ae52157640b16d83c38096f079e72 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Thu, 14 Jun 2007 00:21:15 +0000 Subject: [PATCH] DMA / memcpy the actual size, rather then over-estimated (can cause crashes) added alternative to memcpy, for debugging --- Extras/BulletMultiThreaded/SpuFakeDma.cpp | 42 ++++++++++-- .../SpuGatheringCollisionTask.cpp | 67 ++++++++++++++++--- 2 files changed, 92 insertions(+), 17 deletions(-) diff --git a/Extras/BulletMultiThreaded/SpuFakeDma.cpp b/Extras/BulletMultiThreaded/SpuFakeDma.cpp index 2b9456874..3193a903f 100644 --- a/Extras/BulletMultiThreaded/SpuFakeDma.cpp +++ b/Extras/BulletMultiThreaded/SpuFakeDma.cpp @@ -1,24 +1,54 @@ #include "SpuFakeDma.h" +//Disabling memcpy sometimes helps debugging DMA + +#define USE_MEMCPY 1 + int cellDmaLargeGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid) { - void* targetMainMem = (void*)ea; - memcpy(ls,targetMainMem,size); + char* mainMem = (char*)ea; + char* localStore = (char*)ls; + +#ifdef USE_MEMCPY + memcpy(localStore,mainMem,size); +#else + for (uint32_t i=0;i