Good afternoon, I've been trying for two very troublesome days to understand the inner workings of mame. I think I finally got a good grasp of how to access info on the emulated ram. First off I'm specifically working with the pbaction driver. Which has the following memory setup
Code:
static ADDRESS_MAP_START( pbaction_map, AS_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROM AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE_MEMBER(pbaction_state, m_work_ram) AM_RANGE(0xd000, 0xd3ff) E(pbaction_videoram2_w) AM_BASE_MEMBER(pbaction_state, m_videoram2) AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(pbaction_colorram2_w) AM_BASE_MEMBER(pbaction_state, m_colorram2) AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(pbaction_videoram_w) AM_BASE_MEMBER(pbaction_state, m_videoram) AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(pbaction_colorram_w) AM_BASE_MEMBER(pbaction_state, m_colorram) AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE_SIZE_MEMBER(pbaction_state, m_spriteram, m_spriteram_size) AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram) AM_RANGE(0xe600, 0xe600) AM_READ_PORT("P1") AM_WRITE(interrupt_enable_w) AM_RANGE(0xe601, 0xe601) AM_READ_PORT("P2") AM_RANGE(0xe602, 0xe602) AM_READ_PORT("SYSTEM") AM_RANGE(0xe604, 0xe604) AM_READ_PORT("DSW1") AM_WRITE(pbaction_flipscreen_w) AM_RANGE(0xe605, 0xe605) AM_READ_PORT("DSW2") AM_RANGE(0xe606, 0xe606) AM_READNOP /* ??? */ AM_WRITE(pbaction_scroll_w) AM_RANGE(0xe800, 0xe800) AM_WRITE(pbaction_sh_command_w) ADDRESS_MAP_END
So I've put in the running_machine::run method the following code, inside the if(!m_paused)
Code:
memory_region *r = m_regionlist.find("maincpu"); if(r!=NULL) { printf("%s\n",r->name()); for(int i=0xC000;i<0xC010;i++) printf("%02X",r->u8(i)); } printf("\n");
Basically my question is, why is it that memory data below address 0xC000 shows exactly as the dump file does, but anything above that address just comes out 00 when I can see in the dumpfile that there is actual data there?
I appreciate any help you can give. Thanks.
|