[dorkbotdc-blabber] Pacman MAME Rom Color Prom editing
kenny george
george.kd at gmail.com
Fri May 8 13:42:47 EDT 2009
Alberto, As far as the color tables go I found this bit in my research which
may be of help.
.7f is the palette prom
32 bytes
32 one byte per color entry
.4a is the 4-color lookup table prom
it consists of 64 entries, each is an index into the .7f color prom
on sprites, the first entry is transparent (color 0 in the sprite), for
background tiles, it is observed.
----------------------------------------
Lookup ROM Layout
This is just a collection of four-byte sets, specifying each of the
color entries available for the Color RAM or Floating Sprite hardware.
You will reference one of these color entries for each sprite you want
to put to the screen.
Quite simply, they specify what color 0, 1, 2, and 3 on the sprite
maps to on the palette. They are just stored raw in the rom. ie:
[byte 0] [byte 1] [byte 2] [byte 3] = color entry 0.
[byte 4] [byte 5] [byte 6] [byte 7] = color entry 1.
These reference back into the Palette ROM. So if the palette rom
had the following colors as bytes 0 thru 7:
0 1 2 3 4 5 6 7
[black][red][yellow][green][cyan][blue][purple][white]
And the lookup ROM had: (starting at the beginning of the Lookup ROM)
0x00 0x00 0x00 0x00 /* color entry 0: black black black black */
0x00 0x01 0x05 0x07 /* color entry 1: black red blue white */
0x00 0x01 0x04 0x07 /* color entry 2: black red cyan white */
This means that if you were to use color 0 on a character or sprite,
it would all be black. If you used color 1, then the four colors used
to paint that sprite or character on the screen are black, red, blue,
and white.
----------------------------------------
Color ROMS
Pacman and Pengo have different capabilties for color. Both have support
for 32 colors, but Pengo can have four times as many lookup entries.
Type File Entries What it means
Pacman palette .7f 32x1 byte 32 discrete colors max
lookup .4a 64x4 byte 64 four-color entries
---
and from the mame source (i have a copy of 0.77 that I use for hacking)
Convert the color PROMs into a more useable format.
Pac Man has a 32x8 palette PROM and a 256x4 color lookup table PROM
Thanks for the notes on hex notation. When I said I struggle with hex that
may have been an understatement. I normally make hardware configurations
and am not really a software guy. I really know nothing about hex, but am
trying to learn. When I edited the sprites I used TURACO so never had to
edit code, it was all graphic editing. If you would like a copy of the
actual rom let me know and I will send it your way. Thanks again and I will
talk to you soon.
Kenny
On Fri, May 8, 2009 at 1:25 PM, Alberto Gaitán <alberto.gaitan at gmail.com>wrote:
> Hi Kenny,
>
> (I'm using HTML pre tags, below, to demarcate code.)
>
> I started out by searching for "color" in the assembly code. I was looking
> for tables that would provide color data to the assembly program.
>
> If you look at lines 2980 - 2993 of mspac.asm, you'll find the annotated
> table for fruit shapes, colors and point values:
>
> <!-- Begin quotation of code snippet -->
> <pre>
>
> ;; $0efd - 0f3b = table for fruit shapes, colors, point value.
> ;; (the 3 bytes are stored in the above order)
>
> <snipped>
>
> 00000ef0 00 14 06
> 00000f00 01 0f 07 02 15 08 02 15 08 04 14 09 04 14 09 05
>
> <snipped>
>
> ;; shape 00 color 14 points 06
> ;; shape 01 color 0f points 07
> ;; etc...
>
> </pre>
> <!-- End quotation of code snippet -->
>
> Lines 2991 - 2993 explain how to read the table: each record is three (hex)
> bytes. These numbers (bytes) correspond to the shape, color, and value of
> the fruits, respectively. The first record is 0x00 0x14 0x06 (0x is a prefix
> that means the number is in hexadecimal notation), the second record is 0x01
> 0x0F 0x07, etc. The decimal equivalent of this record is 0 20 6 (if you
> don't have a programmer's calculator to cross-convert dec-hex there are many
> online; Ubuntu has one).
>
> You're interested in the color so I'd begin by changing the color field
> (the middle number on each record) in each record and compiling/testing the
> program. From what I remember about the Commodore-64 (and I don't know how
> different its sprites are), you could use 256 colors (0 - 255 decimal or
> 0x00 - 0xFF hex) in monochrome mode (dots in the spite matrix were one of
> 256 colors and no dots were transparent) and 16 colors in multicolor mode.
>
> I don't know where the color table is so I don't know what color=20 gets
> you. It may be that color=0 (0x00) is black and color=255 (0xFF) is probably
> white. I may have time this weekend to look around for that table.
>
> Hope this gets you started. Please let us know what you find out via your
> blog or wherever.
>
> Alberto
>
>
>
>
>
> On 5/8/09 9:13 AM, kenny george wrote:
>
>> Hi All,
>>
>> I am working on a project that requires I edit the Pacman MAME ROM. So
>> far I have had success editing the sprite maps, and text but cannot figure
>> out the color proms. It is important to my project that I am able to change
>> the colors of the character and the bonus fruits to have things be
>> consistent. I am attaching a link with the pacman commented code. I know
>> that in the pacman romset 7f is the pallete rom and prom lookup, but I do
>> not know enough hex (or any for that matter) to make sense of it. I think
>> that just changing the colors in the palletes assigned to the Pacman Sprite
>> and each Bonus fruit should be sufficent, and hopefully I won't have to go
>> digging for the program Roms for each fruit. Here is the commented code.
>>
>> http://umlautllama.com/projects/pacdocs/mspac/mspac.asm
>>
>> If this project interests anyone, and you want to lend a hand, shoot me an
>> email, and I will send you the ROM thus far. Oh yeah, here is a link to my
>> blog documenting this project.
>>
>> http://www.pacguy.blogspot.com/
>>
>>
>>
>> --
>> Kenneth George
>> www.kennethdgeorge.com <http://www.kennethdgeorge.com>
>> george.kd at gmail.com <mailto:george.kd at gmail.com>
>>
>>
>> ------------------------------------------------------------------------
>>
>> ........................................................................
>> .......dorkbot dc: people doing strange things with electricity.........
>> ................... http://dorkbot.org/dorkbotdc .......................
>> ................... SUBSCRIPTION MANAGEMENT .......................
>> ........ http://dorkbot.org/mailman/listinfo/dorkbotdc-blabber ........
>> ........................................................................
>>
> ........................................................................
> .......dorkbot dc: people doing strange things with electricity.........
> ................... http://dorkbot.org/dorkbotdc .......................
> ................... SUBSCRIPTION MANAGEMENT .......................
> ........ http://dorkbot.org/mailman/listinfo/dorkbotdc-blabber ........
> ........................................................................
>
--
Kenneth George
www.kennethdgeorge.com
george.kd at gmail.com
202-294-9011
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://music.columbia.edu/pipermail/dorkbotdc-blabber/attachments/20090508/baea11f8/attachment-0001.html
More information about the dorkbotdc-blabber
mailing list