Thread: Sfs....
View Single Post
Old 15 April 2010, 16:47   #8
Registered User
thomas's Avatar
Join Date: Jan 2002
Location: Germany
Posts: 5,681
Originally Posted by Zetr0 View Post
this setting 0x7FFFFFFe is to use 24bit DMA moves
Eight hexadecimal digits represent 32 bits. If the upper and the lower bits are set to zero, you still have 30 bits. So how can this be 24bit DMA ?

In order to allow 24bit DMA, you set the upper 8 of the 32 bits to zero: 0x00ffffff or 0x00fffffe.

Note that you cannot force DMA by changing the mask. The mask only directs which memory can be used to allocate buffers. If you allow buffers to reside in all available memory, then 24bit DMA cannot be used and if you force buffers into the lower 16 MB (that's what can be addressed by 24 bits), 24bit DMA is possible.

Taking into account that the AllocMem function only accepts a few flags, you can translate the mask value into these possibilities:

0xffff**** -> MEMF_ANY (no restriction)
0x7fff**** -> MEMF_ANY (lower 2G only, but this is an AmigaOS restriction anyway, so no difference to the above)
0x00ff**** -> MEMF_24BITDMA
0x007f**** -> MEMF_CHIP

AFAIK addresses returned by AllocMem are always divisible by 64, so the following thoughts are of theoretical nature only:

0x****ffff -> no alignment restriction
0x****fffe -> aligned to short words (two bytes)
0x****fffc -> aligned to long words (four bytes)

That's all there is about mask. All other values are of no use and are either ignored or lead to unpredictable results. (Like 0x12345678 which does not make any sense and can never be fulfilled by AllocMem)

Last edited by thomas; 15 April 2010 at 16:57.
thomas is offline  
Page generated in 0.05130 seconds with 10 queries