#97160 - cold_as_ice - Tue Aug 08, 2006 7:05 am
Hello i've got a question about dmaset:
when i run this code:
DmaSet(VRAM_A,RGB(31,0,31),256 * 192);
it works on the emulator but somehow it crashes on the real hardware.
can someone explain that. O yeah i already tried it with flushing cache memory.
here's my code for dmaset since ndslib doens't have it:
void DmaSet(void *dest,int value,int len)
{
DMA_SRC(DMACHANNEL) = (u32)&value;
DMA_DEST(DMACHANNEL) = (u32)dest;
DMA_CR(DMACHANNEL) = DMA_COPY_HALFWORDS | DMA_SRC_FIX| ((len >> 1) & ~1);
while(DMA_CR(3) & DMA_BUSY);
}
when i run this code:
DmaSet(VRAM_A,RGB(31,0,31),256 * 192);
it works on the emulator but somehow it crashes on the real hardware.
can someone explain that. O yeah i already tried it with flushing cache memory.
here's my code for dmaset since ndslib doens't have it:
void DmaSet(void *dest,int value,int len)
{
DMA_SRC(DMACHANNEL) = (u32)&value;
DMA_DEST(DMACHANNEL) = (u32)dest;
DMA_CR(DMACHANNEL) = DMA_COPY_HALFWORDS | DMA_SRC_FIX| ((len >> 1) & ~1);
while(DMA_CR(3) & DMA_BUSY);
}