MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Flat Mode Flat  

drewcifer
One bad Mutha-(shut yo' mouth!)
Reged: 07/01/04
Posts: 428
Loc: Sweden
Send PM
Re: I need help reading some memory from mame.
11/24/11 03:32 AM


The part of the code you're looking at is pretty deep in the core of MAME. If your goal is to learn the internals of how MAME works, you're definitely looking in the right spot, but I can't help you much off the top of my head.

If, however, you are looking at doing something interesting with the contents of pbaction's RAM, I might recommend adding your own AM_READ or AM_WRITE handlers to the memory map or inspecting the member variables (eg. m_work_ram) that hold the system's memory at each screen refresh or something along those lines.

Andrew



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







Entire thread
Subject Posted by Posted on
* I need help reading some memory from mame. AtomR 11/23/11 08:22 PM
. * Re: I need help reading some memory from mame. R. Belmont  11/27/11 04:10 PM
. * Re: I need help reading some memory from mame. sz72  11/24/11 09:09 PM
. * Re: I need help reading some memory from mame. Sune  11/25/11 08:40 PM
. * Re: I need help reading some memory from mame. drewcifer  11/24/11 03:32 AM

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