MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

dma.request
MAME Fan
Reged: 10/14/10
Posts: 17
Send PM
Re: How to get real offset
11/09/15 09:30 PM


Thank you both for the answers!

...Then let's see... your example:

AM_RANGE(0x1000, 0x1003) AM_MIRROR (0x03fc) AM_WRITE(foo_w)

is equivalent to (linear code):

if ((addr >= 0x1000) && (addr <= (0x1003 | 0x03fc)))
foo_w (...);

???

With 'real offset' or better 'real address' I mean the 'original' address...

For example:

Again in your example:
if real_address = 0x1002, foo_w will be called with offset = 0x1002 - 0x1000 = 0x0002...

But, is there a way inside the foo_w handler to get this value (0x1002) instead of offset 0x0002 ?

Another question: if real_address = 0x1234, then a mirror address..., how to calculate offset? (0x1234 - 0x1000) & 3 = 0x0002 ???

Thanks again.







Entire thread
Subject Posted by Posted on
* How to get real offset dma.request 11/09/15 12:08 PM
. * Re: How to get real offset R. Belmont  11/11/15 08:54 PM
. * Re: How to get real offset dma.request  11/12/15 03:25 AM
. * Re: How to get real offset Haze  11/09/15 07:57 PM
. * Re: How to get real offset dma.request  11/09/15 09:30 PM
. * Re: How to get real offset dma.request  11/10/15 08:33 PM
. * Re: How to get real offset Haze  11/11/15 11:03 AM
. * Re: How to get real offset dma.request  11/11/15 01:07 PM
. * Re: How to get real offset Haze  11/11/15 06:02 PM
. * Re: How to get real offset dma.request  11/11/15 08:45 PM
. * Re: How to get real offset Vas Crabb  11/12/15 05:25 AM
. * Re: How to get real offset AWJ  11/09/15 07:56 PM

Extra information Permissions
Moderator:  Pi 
0 registered and 22 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2587