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.
|