MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

Azumanga
MAME Fan
Reged: 12/29/08
Posts: 10
Send PM


Finding a full pacman memory map
#311691 - 07/20/13 11:30 AM


I want to demonstrate pacman as part of a talk about AI, and thought it would be nice to demonstrate the ghost's behaviour in depth.

To do this I would like to be able to:

1) Disable each ghost individually.
2) Switch between scatter and chase at will (and stop the automatic switching between them).

I'm sure this is possible with MAME cheats. After some googling I can't find anyone who has described the memory layout in enough detail to do this. I just wondered if anyone either knows this, or knows how to find it, before I start trying to do it myself.

Edited by Azumanga (07/20/13 11:30 AM)



drewcifer
One bad Mutha-(shut yo' mouth!)
Reged: 07/01/04
Posts: 428
Loc: Sweden
Send PM


Re: Finding a full pacman memory map new [Re: Azumanga]
#311706 - 07/20/13 07:55 PM


The two best sources I know are these:

Full pacman disassembly:
http://cubeman.org/arcade-source/pacman.asm

Don Hodges (search for "pac" and you'll find a few articles that show he really knows what he's doing):
http://donhodges.com/archive.htm

Don hangs out on these boards as Phantom DJ and may know how to do what you're looking for off the top of his head.

Good luck, and keep us posted if you succeed!
Andrew



Luca Elia
Mame dev
Reged: 10/28/07
Posts: 81
Loc: Naples, Italy
Send PM


Re: Finding a full pacman memory map new [Re: drewcifer]
#311709 - 07/20/13 11:54 PM


Google for: "vigasoco" pacman disassembly

also see this thread and search for VIGASOCO source code (a thorough C++ implementation of Pac-Man).



Phantom DJ
MAME Fan
Reged: 04/05/06
Posts: 99
Send PM


Re: Finding a full pacman memory map new [Re: Azumanga]
#311726 - 07/21/13 07:20 AM


What you want might be do-able, but it depends on exactly what you desire and how you expect these hacks to be triggered.

Are you using this on MAME? If so, it is usually easier to hack by using the debugger, by setting breakpoints that can do certain things, such as disable a ghost.

More serious hacking, like your request #2 below, might require writing new subroutines which could be patched in by either using a MAME cheat, or by revising the appropriate ROM file(s). This is more involved and also requires checksum hacks to keep the game playable in MAME. I assume you are not wishing to burn new ROMs to insert into a real pacman PCB.

You want to "Disable each ghost individually". What do you mean, exactly? Do you want a ghost, when disabled, to not move in the maze at all? Or disappear? When disabled, will the ghost still turn blue when an energizer is eaten? how do you expect to trigger a particular ghost to be disabled, by pressing either or both of the start buttons? If using a MAME cheat, separate cheats could be created to disable a particular ghost, and the could be enabled via the cheat menu.

You want to "Switch between scatter and chase at will (and stop the automatic switching between them)." While related, these are two separate things. Stopping the automatic switching would be fairly easy, I think, but which mode do you want the ghosts in by default? Scatter? Or do you want it, say, when the cheat is enabled, to just keep the ghosts in whatever mode they are currently in? As for switching "at will" between modes, how do you want this to be triggered? pressing the player 1 button perhaps? Or do you want this also to be triggered by a MAME cheat which you can enable via the cheat menu?

edit:

here are mame debug build console hacks to do your request #2, using the P1 start button to trigger the mode change. Enter these in the mame debugger after loading pacman:


Code:

bp 0e3e,1,{a=7 ; g}
bp 0e40,{(b@5040 & 20) == 0}, {a = b@4dc1; pc = 0e5e; g}



The result of these hacks is that the ghosts never change from chase to scatter or from scatter to chase, unless the player presses the P1 start button. Be careful and press the button very quickly. It is easy to hold the button down too long and end up doing 2 quick reversals, which end up doing nothing.

Also be aware that the original game code prevents any mode changes from taking place while an energizer is active. This behavior is retained, and the P1 button will have no effect when any ghosts are edible.

Don Hodges


> I want to demonstrate pacman as part of a talk about AI, and thought it would be nice
> to demonstrate the ghost's behaviour in depth.
>
> To do this I would like to be able to:
>
> 1) Disable each ghost individually.
> 2) Switch between scatter and chase at will (and stop the automatic switching between
> them).
>
> I'm sure this is possible with MAME cheats. After some googling I can't find anyone
> who has described the memory layout in enough detail to do this. I just wondered if
> anyone either knows this, or knows how to find it, before I start trying to do it
> myself.

Edited by Phantom DJ (07/21/13 08:34 AM)



Azumanga
MAME Fan
Reged: 12/29/08
Posts: 10
Send PM


Re: Finding a full pacman memory map new [Re: Phantom DJ]
#311747 - 07/22/13 12:08 AM


Thanks very much for the pointers!

I'm entirely happy to only do these things in MAME, using the cheat mode. Now you ask, exactly what I want by 'disable ghosts' I should probably decide. To be honest, just fix into one location (some corner?) would be sufficient I think (which would require just using a cheat to fix their location, if you knew which memory cell that was stored in). I was hoping, just when having one ghost at a time moving, it would be easier to convince an audience that each ghost does indeed have different behaviour.



Phantom DJ
MAME Fan
Reged: 04/05/06
Posts: 99
Send PM


Re: Finding a full pacman memory map new [Re: Azumanga]
#311794 - 07/23/13 08:00 AM


I created some MAME debugger hacks to provide this request:


Code:

//Blinky:
bp 92,1,{w@4d00=8064 ; g }
// Pinky:
bp 91,1,{w@4d02=807c ; g }
// Inky:
bp 8e,1,{w@4d04=907c ; g }
// Clyde:
bp 8d,1,{w@4d06=707c ; g }



The above codes will fix the position of each ghost to its starting tile.

You can change the value in the assignment to any value you wish. For example, if you want to fix the position of Blinky to the top right corner, use this code

bp 92,1,{w@4d00=1c16 ; g }


These debugger hacks could be converted into formal MAME cheat codes. Pugsy at the cheat database could help with that. These codes simply force 2 memory locations for each ghost to a x,y coordinate.

Note that if a ghost is eaten while its position is fixed, its eyes will be fixed as well and never make it home until the hack/cheat is disabled. If that is a problem, a new hack could be created to allow for eyes to return home.


Have fun

Don Hodges
http://donhodges.com

You wrote:

> Thanks very much for the pointers!
>
> I'm entirely happy to only do these things in MAME, using the cheat mode. Now you
> ask, exactly what I want by 'disable ghosts' I should probably decide. To be honest,
> just fix into one location (some corner?) would be sufficient I think (which would
> require just using a cheat to fix their location, if you knew which memory cell that
> was stored in). I was hoping, just when having one ghost at a time moving, it would
> be easier to convince an audience that each ghost does indeed have different
> behaviour.



Azumanga
MAME Fan
Reged: 12/29/08
Posts: 10
Send PM


Re: Finding a full pacman memory map new [Re: Phantom DJ]
#311808 - 07/23/13 12:58 PM


Thanks for these. I will be sure to report how well things go.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 142 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2519