@sg2
Which bit exactly do you need?
I can send you the bit where I call StartDMA() and the allocation... if you really want it I can send you the bit after StartDMA too but there doesn't seem much point as it's never called (StartDMA returning NULL of course)...
mDisplayBitmap = IP96->p96AllocBitMap( prefs->Width, prefs->Height, 32, 0, NULL, RGBFB_B8G8R8A8 );
mFrameBuffer = (unsigned char *)IExec->AllocVec( prefs->Width * prefs->Height * 4, MEMF_PUBLIC | MEMF_HWALIGNED );
printf( "Getting physical address of frame buffer.\n" );
// APTR tStack = IExec->SuperState();
// mFrameBufferPhysical = (unsigned char *)IExec->Supervisor(IMMU->GetPhysicalAddress( mFrameBuffer ));
// IExec->UserState( tStack );
mFrameBufferPhysical = mFrameBuffer;
IExec->LockMem( mFrameBuffer, prefs->Width * prefs->Height * 4 );
printf("Frame buffer is at 0x%p.\n", mFrameBufferPhysical );
The bit about the FrameBufferPhysical is where I was trying to get the physical address. I didn't need to do that before. Also of course I didn't need to worry about going into Supervisor state or anything before.
Also the LockMem() wasn't there before, I just put that in to see what would happen after it was suggested above.
void Console::StartDMAList()
{
int tResult;
printf( "Starting DMA at 0x%p, size=%d, flags = %d.\n", (ULONG)mFrameBufferPhysical, mPrefs->Width * mPrefs->Height *4, 0 );
tResult = IExec->StartDMA( mFrameBufferPhysical, mPrefs->Width * mPrefs->Height * 4, 0 );
if ( tResult > 0 )
{
mDMAList = (struct DMAEntry *)IExec->AllocVec( tResult * sizeof( DMAEntry ), MEMF_ANY );
if ( mDMAList )
{
IExec->GetDMAList( mFrameBuffer, mPrefs->Width * mPrefs->Height * 4, 0, mDMAList );
}
else
{
printf( "Can't allocate DMA list.\n" );
}
}
else
{
printf( "Can't start DMA transfer.\n");
}
}
This code probably looks very familiar if you wrote the autodoc. :) tResult is set to 0 of course, signifying the DMA failing to start.
Help? :)