Pacman tile format

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,725CR
Spent a bit of time this morning trying top decode the tile rom (pacman.5e), used info on the net which was wrong. Now got it sussed so in the viewer program I wrote I decided to (for once) do a full bit of commenting.

so here it is for anyone else looking to write some new tiles into this rom (which is what I will now be able to do)

[font="Courier New, Courier, mono"] /// <remarks>[/font]

[font="Courier New, Courier, mono"] /// THIS ASSUMES WE ARE LOOKING AT VISUALISATION ON VERTICAL MONITOR[/font]

[font="Courier New, Courier, mono"] /// tile format as follows 16 bytes per tile[/font]

[font="Courier New, Courier, mono"] /// 8 x 8 pixels[/font]

[font="Courier New, Courier, mono"] /// first 8 bytes are for the lower half of the tile rows 4 to 7[/font]

[font="Courier New, Courier, mono"] /// second 8 bytes are for the upper half of tile rows 0 to 3[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// each byte specifies colour of 4 pixels for a particular column[/font]

[font="Courier New, Courier, mono"] /// upper nibble holds bit plane 1[/font]

[font="Courier New, Courier, mono"] /// lower nibble holds bit plane 0[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// combine bit 4 and bit 0 to get a 2 bit value representing colour 0-3[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// the first byte specifies the right hand column of pixels (column 7)[/font]

[font="Courier New, Courier, mono"] /// second byte specifies column 6 and so on[/font]

[font="Courier New, Courier, mono"] /// the eigth byte specifies column 0[/font]

[font="Courier New, Courier, mono"] /// so they are read right to left[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// in each nibble[/font]

[font="Courier New, Courier, mono"] /// the msb (bit 3) specifies the top row of the column - row 0[/font]

[font="Courier New, Courier, mono"] /// the lsb (bit 0) specifies the final row of the column - row 3[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// Here is the data for tile 3F (tile 63) a simple L shape in colour 3[/font]

[font="Courier New, Courier, mono"] /// held at address 3F0 in pacman.5e[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// 11, 11, 11, 11, 11, 11, 11, FF bottom half of tile[/font]

[font="Courier New, Courier, mono"] /// 00, 00, 00, 00, 00, 00, 00, FF top half of tile[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// x represents colour 3[/font]

[font="Courier New, Courier, mono"] /// . represents colour 0[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// X...... - FF show colour 3 for all 4 pixels in column[/font]

[font="Courier New, Courier, mono"] /// X......[/font]

[font="Courier New, Courier, mono"] /// X......[/font]

[font="Courier New, Courier, mono"] /// X......[/font]

[font="Courier New, Courier, mono"] /// X......[/font]

[font="Courier New, Courier, mono"] /// X......[/font]

[font="Courier New, Courier, mono"] /// X......[/font]

[font="Courier New, Courier, mono"] /// XXXXXXX - 11 represent colour 3 for final pixel of column[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// full rep with bits and bytes in correct positions[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// {3FF BIT 7,3 - 3}{3FE BIT 7,3 - 0}{3FD BIT 7,3 - 0}{3FC BIT 7,3 - 0}{3FB BIT 7,3 - 0}{3FA BIT 7,3 - 0}{3F9 BIT 7,3 - 0}{3F8 BIT 7,3 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3FF BIT 6,2 - 3}{3FE BIT 6,2 - 0}{3FD BIT 6,2 - 0}{3FC BIT 6,2 - 0}{3FB BIT 6,2 - 0}{3FA BIT 6,2 - 0}{3F9 BIT 6,2 - 0}{3F8 BIT 6,2 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3FF BIT 5,1 - 3}{3FE BIT 5,1 - 0}{3FD BIT 5,1 - 0}{3FC BIT 5,1 - 0}{3FB BIT 5,1 - 0}{3FA BIT 5,1 - 0}{3F9 BIT 5,1 - 0}{3F8 BIT 5,1 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3FF BIT 4,0 - 3}{3FE BIT 4,0 - 0}{3FD BIT 4,0 - 0}{3FC BIT 4,0 - 0}{3FB BIT 4,0 - 0}{3FA BIT 4,0 - 0}{3F9 BIT 4,0 - 0}{3F8 BIT 4,0 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3F7 BIT 7,3 - 3}{3F6 BIT 7,3 - 0}{3F5 BIT 7,3 - 0}{3F4 BIT 7,3 - 0}{3F3 BIT 7,3 - 0}{3F2 BIT 7,3 - 0}{3F1 BIT 7,3 - 0}{3F0 BIT 7,3 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3F7 BIT 6,2 - 3}{3F6 BIT 6,2 - 0}{3F5 BIT 6,2 - 0}{3F4 BIT 6,2 - 0}{3F3 BIT 6,2 - 0}{3F2 BIT 6,2 - 0}{3F1 BIT 6,2 - 0}{3F0 BIT 6,2 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3F7 BIT 5,1 - 3}{3F6 BIT 5,1 - 0}{3F5 BIT 5,1 - 0}{3F4 BIT 4,1 - 0}{3F3 BIT 5,1 - 0}{3F2 BIT 5,1 - 0}{3F1 BIT 5,1 - 0}{3F0 BIT 5,1 - 0}[/font]

[font="Courier New, Courier, mono"] /// {3F7 BIT 4,0 - 3}{3F6 BIT 4,0 - 3}{3F5 BIT 4,0 - 3}{3F4 BIT 4,0 - 3}{3F3 BIT 4,0 - 3}{3F2 BIT 4,0 - 3}{3F1 BIT 4,0 - 3}{3F0 BIT 4,0 - 3}[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// </remarks>[/font]

Hope this is of some use to some of you.

Any questions ask.

I now need to look at the sprite format in pacman.5f next

Hurray Banana2015-02-19 14:12:41
 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,725CR
Here's what I think the sprite format is:
[font="Courier New, Courier, mono"]
[/font]

[font="Courier New, Courier, mono"] /// <remarks>[/font]

[font="Courier New, Courier, mono"] /// Sprite format[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// Follows the system for tiles[/font]

[font="Courier New, Courier, mono"] /// 8 bytes produce the colour for 8 columns 4 rows high[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// sprite is 16x16 4 colours[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// 8 blocks of 8 bytes produce the sprite[/font]

[font="Courier New, Courier, mono"] /// sprite drawn as follows[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// col 0-7 | col 8 - 15[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// row 0-3 bytes 40-47 | bytes 8-15[/font]

[font="Courier New, Courier, mono"] /// ------------+------------[/font]

[font="Courier New, Courier, mono"] /// row 4-7 bytes 48-55 | bytes 16-23[/font]

[font="Courier New, Courier, mono"] /// ------------+------------[/font]

[font="Courier New, Courier, mono"] /// row 8-11 bytes 56-63 | bytes 23-31[/font]

[font="Courier New, Courier, mono"] /// ------------+------------[/font]

[font="Courier New, Courier, mono"] /// row 12-15 bytes 32-39 | bytes 0-7[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// very strange ordering indeed[/font]

[font="Courier New, Courier, mono"] /// [/font]

[font="Courier New, Courier, mono"] /// </remarks>[/font]
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
Why didn't you just take this info from the MAME driver? Or do you like reinventing the wheel dude!!
smiley36.gif


static const gfx_layout tilelayout =
{

8,8, /* 8*8 characters */

RGN_FRAC(1,2), /* 256 characters */

2, /* 2 bits per pixel */

{ 0, 4 }, /* the two bitplanes for 4 pixels are packed into one byte */

{ 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }, /* bits are packed in groups of four */

{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },

16*8 /* every char takes 16 bytes */

};

static const gfx_layout spritelayout =

{

16,16, /* 16*16 sprites */

RGN_FRAC(1,2), /* 64 sprites */

2, /* 2 bits per pixel */

{ 0, 4 }, /* the two bitplanes for 4 pixels are packed into one byte */

{ 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,

24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3 },

{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,

32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },

64*8 /* every sprite takes 64 bytes */

};
 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,725CR
Ade, when I worked out the dkong rom format, I found the gfx_layout really hard to read and even tho I now know the format for pacman, that still seems hard to read
smiley5.gif
 

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,055CR
I'd say your comment version above is infinitely more understandable than the mame code. But then I've never found the mame code to be written in a way that is easy to just pick up.
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
Which leads me to believe that I spend WAAAAY too much time looking at MAME code as I can look at that and decipher it without breaking into a sweat these days....
smiley9.gif


Anyway, good work all the same Eric, I'm sure many people will find this info very useful.
smiley20.gif
 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,725CR
cmonkey said:
Which leads me to believe that I spend WAAAAY too much time looking at MAME code as I can look at that and decipher it without breaking into a sweat these days....
smiley9.gif


Anyway, good work all the same Eric, I'm sure many people will find this info very useful.
smiley20.gif

yeah well I'm starting to doubt your human ade
smiley1.gif


Need to starting spending time looking at the source so I can start picking up the info buried there
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
I wouldn't have been able to do everything that I've done so far on the L System without the aid of the MAME source. I'd like to publicly express my gratitude to everybody who either currently works on the MAMEdev team or who has worked previously on the MAMEdev team. The very fact that MAME is open source opens a whole world of arcade homebrew coding opportunities to the general public at large. The source contains more info than one single person could ever absorb in an entire lifetime, it's a amazing collection of info gathered by some incredibly clever people over the past 18 years. Ignore it at your peril!
 

Baggers69

Newbie
Credits
46CR
I have to agree, looking at the data, I didn't see how it was referring to how the data was stored, so I just did a test of how it looked, and then depending on what I saw, tweaked it accordingly until I got it into the correct format for when I did PacManicMinerMan.
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
I echo what Hurray Banana has said, truly excellent work on PacManicMinerMan. Seeing a Spectrum game running on arcade hardware was one of the biggest drivers for me wanting to port Chuckie Egg 2 to Taito L System.

I doff my hat to you sir!
 

Baggers69

Newbie
Credits
46CR
Cheers matey :D
Want to work together on doing Chuckie Egg 2 for Taito? as I know someone else who would like to see Chuckie Egg on hardware lol

Where can I get my hands on a Taito L System? and how much do they go for?

PS are you going to Play Blackpool?
 

ben76

Hunts Spies
Feedback
7 (100%)
Credits
1,136CR
Baggers69 said:
Cheers matey :D
Want to work together on doing Chuckie Egg 2 for Taito? as I know someone else who would like to see Chuckie Egg on hardware lol

Where can I get my hands on a Taito L System? and how much do they go for?

PS are you going to Play Blackpool?
I so want to play both games on a cab! Jim As much as I love Plotting/Flipull I will happily lend you my pcb as long as I can have it back! (and it can still play Plotting/Flipull lol) Actually somewhere I have a faulty Champ Wrestler you can have (slightly different pcb layout though)

and to stay on topic Eric again amazing work
smiley1.gif
you can also borrow a pcb if I have it to test stuff on
smiley1.gif
I don't have a pac man pcb though lol

- Ben
 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,725CR
ben76 said:
Baggers69 said:
Cheers matey :D
Want to work together on doing Chuckie Egg 2 for Taito? as I know someone else who would like to see Chuckie Egg on hardware lol

Where can I get my hands on a Taito L System? and how much do they go for?

PS are you going to Play Blackpool?
I so want to play both games on a cab! Jim As much as I love Plotting/Flipull I will happily lend you my pcb as long as I can have it back! (and it can still play Plotting/Flipull lol) Actually somewhere I have a faulty Champ Wrestler you can have (slightly different pcb layout though)

and to stay on topic Eric again amazing work
smiley1.gif
you can also borrow a pcb if I have it to test stuff on
smiley1.gif
I don't have a pac man pcb though lol

- Ben

Cheers for the offer Ben, pacman is just a way of getting my rusty assembler ass of the ground I'm already starting to think assembler ways of coding again instead of all the high level and oop stuff I have to do at work. I'll move on when I've got pacman doing something interesting (to me anyway)
 

Baggers69

Newbie
Credits
46CR
Oh, and Ben, thanks for the offer, but I'd rather buy one I can keep :D as I'd want to play it afterwards lol and not just on emu.

Edit: I may get you to test stuff if I can't get hold of a board, if that's ok?
Baggers692015-02-21 10:51:41
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
Baggers69 said:
Cheers matey :D
Want to work together on doing Chuckie Egg 2 for Taito? as I know someone else who would like to see Chuckie Egg on hardware lol

Where can I get my hands on a Taito L System? and how much do they go for?

PS are you going to Play Blackpool?

I'd be honoured to work alongside you on my CE2 for L System remake! I can sort you out with an L System Plotting/Puzznic board, which is my chosen target board for the remake. I'm currently putting the finishing touches to an extensive document on coding for the L System which will be released in the next couple of days, it contains all the details you'd ever need to get started on that board. I'll also release some sample source at the same time to get text/tiles/sprites on screen, so that people can get up and running quickly.

I am planning on being at Play Blackpool for at least one of the days, not sure whether that'll be the Saturday or the Sunday at the moment.
 
Top