Mame address mapping

Purity

The Oracle
vacBacker
Feedback
17 (100%)
Credits
2,999CR
After seeing Marks AR81 video, and his mapping tool, I was interested to understand address mapping in Mame, and started looking at the source code. I was wondering if someone could validate my understanding on this.

I am looking at the segaybd.cpp in Mame.

I believe this tells me that CPU address map starts a 0 and ends at 0x1fffff, so if I wanted I could use the Autolearn function on a Fluke to understand exactly where the rom, ram locations are etc? Do't know how reliable this is?

Looking at more specific on the ROMs of pdrift:

epr-12017.25 starts at 0 (0x000000) and is (0x20000) in length, so this is a 1MB eprom. The range on a Fluke would be 0 to 1ffff

epr-12016.24 starts at 1 (0x000001) and is (0x20000) in length, so this is another 1MB eprom. The range on a Fluke would be 1 to 20000 ?

epr-11748.27 starts at 40000 (0x040000) and is (0x20000) in length, so this
is another 1MB eprom. The range on a Fluke would be 40000 to 5ffff

The sprites epr-11789.16 starts at (0x000000) and is (0x20000) in length, so this is a 1MB eprom. The range on a Fluke would be 0 to 1ffff

epr-11791.14 starts at 1 (0x000001) and is (0x20000) in length, so this
is another 1MB eprom. The range on a Fluke would be 1 to 20000 ?

etc etc

The CPU map tells me the RAM is located at the following points, so just a case of running tests between either point. e.g. c0000 to cffff for the shared ram. Not really sure in Mame what is read only or writeable

cpu main
0x080000, 0x080007
0x084000, 0x08401f
0x0c0000, 0x0cffff
0x180000, 0x18ffff
0x1f8000, 0x1fbfff
0x1fc000, 0x1fffff

sub cpu
0x180000, 0x1807ff
0x188000, 0x188fff
0x190000, 0x193fff
0x198000, 0x19ffff

Sound ram
0xf800, 0xffff

Am I on the right path of understanding this?
Purity2016-12-24 22:43:27
 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,756CR
Ben, I assume that the Macros at the end of the the AM_RANGE lines e.g.

AM_RANGE(0x082000, 0x083fff) AM_WRITE(sound_data_w)

Indicate the type of memory access

AM_READWRITE - read/write

AM_WRITE - write only

AM_ROM - read only

Hurray Banana2016-12-24 13:53:08
 

Purity

The Oracle
vacBacker
Feedback
17 (100%)
Credits
2,999CR
Cheers Eric, that's useful.

It says AM_RAM is short for AM_READWRITE, so that answers that

AM_MIRROR says AM_DEVREADWRITE so would be RW
Purity2016-12-24 14:35:08
 

porchy

Active member
Feedback
5 (100%)
Credits
994CR
Purity said:
epr-12017.25 starts at 0 (0x000000) and is (0x20000) in length, so this is a 128k eprom. The range on a Fluke would be 0 to 1ffff

epr-12016.24 starts at 1 (0x000001) and is (0x20000) in length, so this is another 128k eprom. The range on a Fluke would be 1 to 20000 ?

epr-11748.27 starts at 40000 (0x040000) and is (0x20000) in length, so this is another 128k eprom. The range on a Fluke would be 40000 to 5ffff

The sprites epr-11789.16 starts at (0x000000) and is (0x20000) in length, so this is a 128k eprom. The range on a Fluke would be 0 to 1ffff

epr-11791.14 starts at 1 (0x000001) and is (0x20000) in length, so this is another 128k eprom. The range on a Fluke would be 1 to 20000 ?

etc etc

The CPU map tells me the RAM is located at the following points, so just a case of running tests between either point. e.g. c0000 to cffff for the shared ram. Not really sure in Mame what is read only or writeable

cpu main
0x080000, 0x080007
0x084000, 0x08401f
0x0c0000, 0x0cffff
0x180000, 0x18ffff
0x1f8000, 0x1fbfff
0x1fc000, 0x1fffff

sub cpu
0x180000, 0x1807ff
0x188000, 0x188fff
0x190000, 0x193fff
0x198000, 0x19ffff

Sound ram
0xf800, 0xffff

Am I on the right path of understanding this?

This also tells you that that the data is split between two ROM's. Assuming its a 16 bit CPU then 8 bits will come from one ROM and 8 bits from the other. If you dumped both ROM's and looked at them in a HEX editor then you would need to interleave them to see the correct code.

If you are using the ROM check function on the Fluke then I think you might get an error if tried to read up to an odd address.
 
Top