MAMEWorld >> Programming
Index   Flat Mode Flat  

AWJ
Reged: 03/08/05
Posts: 936
Loc: Ottawa, Ontario
Send PM
Re: How to get real offset
11/09/15 07:56 PM


> Hi again .
>
> If I have for example:
> AM_RANGE(0x1000, 0x1FFF) AM_MIRROR(0x3FC) AM_WRITE (test_w)
>
> WRITE8_MEMBER (test_state :: test_w)
> {
> int real_ofs = ??? (offset);
> printf ("0x%04X\n", real_ofs);
> }
>
> How to get the real offset (e.g. excluding the mirror address 'effect') into the
> test_w handler?
>
> Additionally, what exactly AM_MIRROR does?
>
> Is it a module of 0x3FC of the address, perhaps?

That's not how you use AM_MIRROR and that address map entry doesn't make any sense. AM_MIRROR causes the specified mirror bits to be ORed with the AM_RANGE bits. For example,

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

causes foo_w to be mapped at every address from 0x1000 to 0x13ff.

Your use of AM_MIRROR doesn't make any sense because the range 0x1000, 0x1fff already contains all the bits in 0x3fc.

I think what you actually want is AM_MASK, but it isn't clear to me what you're trying to do. Can you try to explain better what you mean by "real offset"?







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 1 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2437