ben

Homebrew for pacman

Recommended Posts

Hi all,

after chatting with Jack, I decided I would try and make a homebrew game for the pacman machine. Short of ideas, I went for tetris...

it's not quite polished yet, or even finished (no score, no 2 player-game, no title screen, no animation and sound for the exploding lines, no fancy graphics), but this gives a pretty good idea of what you can do : it even includes music ! (the Bach tune from the game boy version)

to get it to work (on linux, sorry for the windowers...) :

- unzip the archive, it the source project,

- install srecord and z88dk (on ubuntu, the stock packages works fine)

- type "make rom.o" => you get the binary for the code, you can put it in place of the original code rom in your pacman papilio bit file (use the same roms for graphics and sound).

to try it with mame :

- grab your favorite mame roms for "puckman" (google is your friend there)

- unzip it into the puckman directory (actually, you do not need the namcoxxx roms, as they will be overwritten)

- install mame, of course,

- the 'from source' debug version of mame I use reads the provided mame.ini file and runs fine from the "tetris" dir, but if your mame complains, you'll want to add a pointer to the project directory in the right config file

- patch the paths in the makefile,

- type "make" and enjoy

note 1 : controls are obvious except for the "rotate" command, which is mapped on "up" (no button on pacman...)

note 2 : the C code should be readable, although I have not spent hours commenting it. You can have a look at the crt0.asm file if you are curious : it's very crude, only what is needed for zd88dk to work is included.

To have a complete devkit for the pacman machine, we will need a graphics/palette editor... the sprite format is quite straightforward, so it should be easy to at least make a bmp=>rom converter

Ben

Source code is in the attachments

This post has been promoted to an article

Share this post


Link to post
Share on other sites

Ok,

This is sweet! I'm going to document the steps I take to recreate this dev environment for the PacMan hardware. I'm running ubuntu in a virtual machine for this.

  • sudo apt-get install z88dk
  • sudo apt-get install srecord
  • sudo apt-get install mame
  • download tetris.zip and unzip it.
  • unzip tetris.zip
  • cd tetris
  • copy pacman rom files into tetris/puckman
  • make
  • edit /etc/mame/mami.ini with following
  • rompath                  $HOME/tetris
  • mame puckman

That brings up the game in mame for me. MAME isn't behaving very well in my virtual machine. To run on the Papilio Arcade hardware I just copied the contents of the puckman directory into my pacman_rel004_sp3e_papilio/roms/pacman directory and then ran pacman_rel004_sp3e_papilio/scripts/merge_roms_pacman.bat. This generated pacman_rel004_sp3e_papilio/bit_files/pacman_on_pacman_hardware_p1_500K.bit which I loaded to the hardware and...

Voila! Tetris on the Pacman hardware running on the Arcade MegaWing.

Very cool! Thank you for putting this together Ben.

Jack.

Share this post


Link to post
Share on other sites

To have a complete devkit for the pacman machine, we will need a graphics/palette editor... the sprite format is quite straightforward, so it should be easy to at least make a bmp=>rom converter

Here it is : a small java app that converts rom graphics into png and vice versa. Enjoy tetris with custom graphics !

Note : couldn't make out the format for the second rom (.5f), which seems is bit different (???) but 256 sprites are plenty for a start. And, while I was at it, I included common sprite formats for other machines (planar 1bit, planar 2bit=>NES, GameBoy, and planar 4bit=>Sega MasterSystem etc.)

tetris.zip

Share this post


Link to post
Share on other sites

Sweeet! I just downloaded it so I can play with it later. :)

There is a TON of information about programming for the pacman hardware at Scott's Arcade Hacking site. And now that we have a dev environment and some tools we can start putting that info to good use. :)

Jack.

Share this post


Link to post
Share on other sites

Heh, from the title I thought this was about package managers.

Rotation in Tetris games in general can be complicated, especially if you want to accommodate any of the modern conveniences such as wall-kicks. To make it simple, I'd recommend implementing one of the existing rotation systems. TetrisConcept has extensive explanations and diagrams of the most prevalent ones:

http://tetrisconcept.net/wiki/Category:Rotation_Systems

The lack buttons is unfortunate, as typically "up" is mapped to "hard drop". I suppose it's only really a loss if you're trying to make a competitive/speed-based game, in which case you'd need multiple rotate buttons (CW, CCW, 180), anyway...

Share this post


Link to post
Share on other sites

Heh, from the title I thought this was about package managers.

Rotation in Tetris games in general can be complicated, especially if you want to accommodate any of the modern conveniences such as wall-kicks. To make it simple, I'd recommend implementing one of the existing rotation systems. TetrisConcept has extensive explanations and diagrams of the most prevalent ones:

http://tetrisconcept...otation_Systems

The lack buttons is unfortunate, as typically "up" is mapped to "hard drop". I suppose it's only really a loss if you're trying to make a competitive/speed-based game, in which case you'd need multiple rotate buttons (CW, CCW, 180), anyway...

well, it was more a proof of concept than any serious stuff, so I just went for a very basic system. I'd say displaying a score counter comes higher in the TODO list...

still, thanks for the link. that's comforting to know that some guys out on the internet have taken the care of documenting tetris so thouroughly. i would never have guessed there were so many subtleties about the rotation systems.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now