What's new

Tailsnic Retroworks

Professional
Joined
Jan 8, 2019
Messages
418
Reaction score
208
Location
Spain
Hi, I'm trying to make a hack of the pacman rom (Midway license or Puckman) to make this. I want to create 4 separated ghosts (because there will be 4 distinct objects).

A ghost has 8 movement sprites (2 up, 2 down, 2 left and 2 right) and 4 scared sprites, so for representing the 4 ghosts a palette recolor is made. I want to divide 2 movement sprites a 1 scared sprites for each ghost object. The game is compiled in C, so I don't know how to make this change. If anyone can tell me a way of editing the original code and after that compiling it to binary file, I would be very thankful.
 
The game is compiled in C, so I don't know how to make this change. If anyone can tell me a way of editing the original code and after that compiling it to binary file, I would be very thankful.
I don't know of any C source code that can be compiled to be the exact arcade binary, do you have that?
I used disassembly to understand what was happening, then made edits to the binary directly (it's z80: https://clrhome.org/table/#out)

http://cubeman.org/arcade-source/pacman.asm
http://cubeman.org/arcade-source/mspac.asm

As for graphics, you may find you don't have the room to add what you want to do, but here are some resources (it's tiles, but it covers how to view sprites too):
View: https://www.youtube.com/watch?v=bIl5hgVB4JE

https://www.spriters-resource.com/arcade/pacman/
 
Last edited:
I don't know of any C source code that can be compiled to be the exact arcade binary, do you have that?
I used disassembly to understand what was happening, then made edits to the binary directly (it's z80: https://clrhome.org/table/#out)

http://cubeman.org/arcade-source/pacman.asm
http://cubeman.org/arcade-source/mspac.asm

As for graphics, you may find you don't have the room to add what you want to do, but here are some resources (it's tiles, but it covers how to view sprites too):
View: https://www.youtube.com/watch?v=bIl5hgVB4JE

https://www.spriters-resource.com/arcade/pacman/
I can edit the graphics with Turaco, that part is well. The thing is editing what I say for dividing 4 ghosts with less sprites.
I don't know anything about assembly code, so I don't know where to touch.
 
What is Turaco?

Do you just want to replace the existing "scared" sprites with something else? 1C and 1D?

1674404755077.png
 
What is Turaco?

Do you just want to replace the existing "scared" sprites with something else? 1C and 1D?

1674404755077.png
Well, the scared sprites are not a problem. If they cannot be divided (I don't know if 2 o 4 sprites are used in the original Pacman), I'll try something.

If you see, a ghost has 2 sprites for each direction. The 4 ghosts are simply palette recolors, but what I want to do is for example:

- Assign Blinky the 2 right sprites
- Assign Pinky the 2 left sprites
- Assign Inky the 2 up sprites
- Assign Clyde the 2 down sprites

I want to draw 4 specific objects for each ghost.

Turaco is the evolution of A.G.E sprites editor, ms-dos.
 
I pasted the sprite sheet above.

I think you're in for a lot of Z80 assembly if you want to confine certain sprites to certain ghosts. I don't think the original code has a notion of which ghost is which. It only has a notion of setting the movement target for each. http://donhodges.com/pacman_pinky_explanation.htm

So you’re going to construct a notion of ghost identity, then gut the sprite engine (which functions based on current movement) and override it to function depending on such identity. Or some other implementation, I’m not exactly a programming expert. Not for the feint of heart!
 
I pasted the sprite sheet above.

I think you're in for a lot of Z80 assembly if you want to confine certain sprites to certain ghosts. I don't think the original code has a notion of which ghost is which. It only has a notion of setting the movement target for each. http://donhodges.com/pacman_pinky_explanation.htm

So you’re going to construct a notion of ghost identity, then gut the sprite engine (which functions based on current movement) and override it to function depending on such identity. Or some other implementation, I’m not exactly a programming expert. Not for the feint of heart!
The way you are explaining it makes me feel fear, xD. It's going to be difficult then.
 
Well you have full disassemblies and memory maps to start, so that’s a huge load off!
 
Well you have full disassemblies and memory maps to start, so that’s a huge load off!
Yeah, I have seen the ASM and it really is a huge load off. I don't know what to do, really. I thought there were ghost identities
 
Well, there's five instances of ED5B394D LD DE,(#4D39) where it's pulling pac's location into memory. That's presumably pacman's movement, and targetting for each of the 4 ghosts. Disregarding the one for pac, perhaps you can start at those and trace until it is deciding on what sprite to pick for each. See if you can fix each ghost to just use whatever 1 or 2 sprites you wanted. Presumably there's also some code in there where it's selecting the color palette to use for each ghost, that would be another place to start to hook in.

I haven't spent too much time with the asm, but again at least it's all there. If you want you can set a breakpoint at that memory location and start stepping through it on mame. 'mame mspacman -debug' to launch, then 'wpset 4D39,1,r' to set a watchpoint at that memory location.
 
Well, there's five instances of ED5B394D LD DE,(#4D39) where it's pulling pac's location into memory. That's presumably pacman's movement, and targetting for each of the 4 ghosts. Disregarding the one for pac, perhaps you can start at those and trace until it is deciding on what sprite to pick for each. See if you can fix each ghost to just use whatever 1 or 2 sprites you wanted. Presumably there's also some code in there where it's selecting the color palette to use for each ghost, that would be another place to start to hook in.

I haven't spent too much time with the asm, but again at least it's all there. If you want you can set a breakpoint at that memory location and start stepping through it on mame. 'mame mspacman -debug' to launch, then 'wpset 4D39,1,r' to set a watchpoint at that memory location.
I'll try to investigate all you say. Thanks for your help, really
 
Back
Top