Complete, commented Pac-Land boot process source

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
I'm not sure on the legality of posting what is in effect Namco copyrighted IP so if the mods want to remove this then please feel free to do so.

Here's the complete, fully commented source code for the boot process of the main CPU of Pac-Land. It's taken straight out of the Bally Midway version of the game. Hopefully it might help people diagnose a problem with their board.

The source will assemble, as is, into a 16384 byte binary which will boot exactly the same way as Bally Midway Pac-Land does and then sit forever in an idle loop displaying the boot error codes on screen.

It has the full vertical blank interrupt routine taken straight out of the game and is ready for you to add your latest masterpiece game code directly to the main game loop.
smiley2.gif


At the point where it enters the idle loop the board is fully initialised and you have full control over all the hardware.

In order to understand the boot process completely you also need to understand how the sub-cpu boot process works. Whilst I have a near full understanding of that, I don't yet have a fully commented source of the sub boot process.

Hope this helps someone, somewhere.

https://www.ukvac.com/forum/data/uploads/1497/paclandm_boot_process.asm.zip
 

Zabanitu

User
Credits
330CR
hi,
i've taken a look at your disasm and i find it very well done !
i just was curious why
Code:
CMPU    #SubSharedRamStart+$100    ; compare U with $6900 (bad shared ram between $6900 and $693f is allowed)
so if
sub cpu $1000 = main cpu $6800
then (bad shared ram between $6900 and $693f is allowed)
= sub CPU $1100-$113F

looking at the mame driver we find the MCU memory map:
Code:
  AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE_LEGACY("namco", namcos1_cus30_r, namcos1_cus30_w)      /* PSG device, shared RAM */
so probably the initial range $1100-$113F is shared between CUS30, cus60 (MCU) and main cpu (6809).
that's why the ram check routine skips those memory address.
i also remember that playing with my 6809 Fluke pod i found a specific memory location wich was marked as bad, upon further investigation i found out the real content of that location: a counter.... IIRC it was updated by the SOUND chip.

keep up !
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
I'm not 100% sure why the readback routine allows potentially bad ram values in the range $6900-$693f ($1100-$113f from the sub-cpu's point of view). I've just been observing that ram range in the MAME debugger whilst playing a game and it definitely has something to do with the 8-channel PSG. I think that the 64 byte range is probably split into 8 x 8 byte data structures that each channel of the PSG can use.

Still doesn't really explain why the code allows potentially bad values in that range however!

Here's a screen shot from the game taken when you've just received the blue hat from pushing the fire hydrant to the right. The sound effect that plays when you get the hat is one of the few sound effects that uses all 8 channels of the PSG. Here you can clearly see that there are 8 distinct sets of activity in the ram range $1100-$113f. Maybe once I've fully reversed the sub-cpu code it will all make better sense.

Screen_Shot_2013-10-19_at_22.28.50.png
 

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,055CR
Excellent work - well done.

cmonkey said:
I'm not sure on the legality of posting what is in effect Namco copyrighted IP so if the mods want to remove this then please feel free to do so.

I highly doubt there's a problem with posting the boot source. The whole game may well be a different matter since Namco do still actively pursue their Pacman franchise. If they ask us to remove then we will, otherwise I can't see an issue. Just don't post any pre-assembled bins
smiley1.gif
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
Hmmm.... maybe the way to release the full game source (if ever I choose to do so) is to release it 1000 lines at a time, then wait a couple of weeks, delete it from the server, then release then next 1000 lines, and so on!!

That way Namco Bandai can't say that I've released the full source as strictly speaking I haven't! (well, not all in one go anyway!!). It's still a very very grey area though unfortunately and the last thing I'd want is to get UKVAC into trouble.
 

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,055CR
Easiest way is not to release the full source.

It's amazing how these things can still find their way out there even when you don't
smiley2.gif
 
Top