26 April 2010, 19:04 | #1 |
Posts: n/a
|
Rip graphics: what's the secret with the 4th bitplane?
Hi,
I'm a PC developer and have always been interested in the Amiga. I'd like to do some programming practice and bring a simple game from the Amiga to the PC. I chose Pac Mania by Namco. First thing is to rip the graphics. I'm using "GfxRip" which does a pretty good job but I don't fully understand the Amiga's memory layout. Have a look at the attached image. The ghosts already look correct. I have set the color depth to 5 bit which gives me 32 colors in total (selecting any other color depth breaks the found graphics). I had the unique number of colors in the game counted and the result was 24, so I decided I'd need 5 bits and the result proves me right. The thing is now: I'm hiding bitplane number 4, 5, 6, 7 and 8. If you look top right at the image, "0, 1 and 2" are shown the others are set to "7", meaning: there is nothing. If I switch on plane 4, the graphics get overlayed with horizontal lines. So I assume only 3 planes are used but how does that match with the 5 bit color depth? Also: how do I get the palette right? It should be or must be somewhere but GfxRip cannot find it (I'm broswing an uncompressed state dump of WinUAE). Cannot anybody give me a few hints? Thanks! k |
27 April 2010, 08:54 | #2 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Hello Krumelur
Before I say anything, there are guys on here who are *far* better at this type of stuff than me so I might not be giving you the best ways to do this stuff, but... You can find palette information by looking at the colour registers. I would recommend loading the game into WinUAE with the HRTMon cartridge ROM attached. Get to where you want in the game, go into HRTMon and enter the "e" command (without the quotes...) This will show you the custom registers. Scroll down the list until you get to $180 and that's the value that's in color00, $182 is color01 etc. Remember that the palette isn't set on the Amiga and, due to the way the copper can be used, the palette can be changed mid screen for example if required. So, it's probably also worth looking at the game's copper list. With HRTMon, use the "cop" command. This will return the address of the copper list in use. Then use the "h" command with the returned address to see a hex dump of the copper list and again look for $0180 which will tell you what color00 has been set to. You might find that there's multiple $0180 entries in the copper list so that way you'll be able to see what color00 has been set to at various points down the display. You'll know where down the display as, most likely, there'll be a preceeding copper wait instruction somewhere - it'll look something like: $4101,$fffe You can also find out lots of other things about the display by looking at the copper list, for example how many bitplanes the display is set for by looking at the bplcon0 ($0100) register... Last edited by pmc; 27 April 2010 at 09:39. Reason: Edited the address for BPLcon0 to be correct - thanks Asman! :-) |
27 April 2010, 09:26 | #3 |
Posts: n/a
|
|
27 April 2010, 09:27 | #4 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,601
|
|
27 April 2010, 09:35 | #5 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
|
27 April 2010, 09:36 | #6 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@ Asman - LOL - oooops, yes mate I did.
I've got blitter registers on the brain. |
27 April 2010, 09:40 | #7 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
|
|
27 April 2010, 12:43 | #8 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
I haven't checked the game, but this sounds like the common method to save RAM and disk space, and to increase performance a bit. If each ghost consist of 8 colors there's no need to draw them all in 5 bitplanes each. You'd just store a single 3 bitplane ghost and then use its mask to alter the other 2 bitplanes to get 4 different ghosts.
Simpler example: if you want to draw 24 differently colored circles on the screen you wouldn't keep 24 circles of 5 bitplanes each in RAM, you'd just keep a single circle of 1 bitplane and draw/clear the bitplanes as needed to get a circle in the wanted color. |
27 April 2010, 23:50 | #9 | |
Posts: n/a
|
Quote:
It only looks okay if I set 5 bits and hide plane 4 and 5. |
|
28 April 2010, 02:27 | #10 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
What you're seeing there are the masks for each ghost image. There are two of them and they have a dashed look because they are 32 pixels wide, and the latter 16 pixels on each line are cleared.
|
28 April 2010, 10:24 | #11 | |
Posts: n/a
|
Quote:
If you were to program this game (PacMania) on the Amiga, how would you save the tiles? They are 32x32 pixels but the game is in isometric perspective. I can think of two ways. Paint them/design them isometric. Then make all rows start at x-column 0 (shift 1st row by 31 pixels, 2nd row by 30 pixels...) and save them as. Then when painting, shift the lines back to the correct x-position. Second method would be to store the isomectric tile as is but that would waste memory because the tile would be wider as required. And memory was expensive back then :-) I ask, because I cannot get a clear image of the tiles in GfxRip. They are somehow there. René |
|
28 April 2010, 10:27 | #12 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,775
|
This might intrest you
http://sprites.walen.se/?level=search&searchterms=pac :And this http://eab.abime.net/showthread.php?...light=pacmania |
28 April 2010, 11:14 | #13 |
Posts: n/a
|
Indeed, this DOES interest me! But still I'm more after the technical details.
From the screens I cannot find out how the level tiles are stored. But thanks a lot! This will come handy. René |
28 April 2010, 11:56 | #14 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
I can't quite remember how I ripped them off hand, but try setting the first ghost to look right and then use f/g to move the offset until they all look right
|
28 April 2010, 11:58 | #15 |
Posts: n/a
|
I'm not worried about the ghosts. I can see them already in full glory but I'm still wondering about the level tiles.
|
28 April 2010, 12:00 | #16 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
you need to set the screen height correctly. Find where the tiles are and stretch the screen height. Then set the bitplanes and it might lose some so play with the q/a keys until it looks right
|
28 April 2010, 12:12 | #17 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
The blitter works in 16 bit words and so a 16 pixel wide image might "touch" two adjacent 16 bit words in the screen bitmap, and so most programmers would wrongly think it was a must to add 16 pixels width to all images that were to be blitted on arbitrary positions. This would explain the mask, but I've no idea why the ghost images then are only 16 pixels. The 32x32 format will be quickest when drawing the tiles, and if I was short on disk space and provided the tiles were narrow enough I would store them as 16x32 on disk, and only skew them into 32x32 when I load them to RAM. EDIT: looking at some screenshots I see the tiles are 24x32 and 32x32 when skewed and on screen, so they're most likely stored as 32x32 as well, possibly 48x32 seeing as the programmers already did that once with the ghost masks. Last edited by Leffmann; 28 April 2010 at 12:34. |
|
28 April 2010, 13:34 | #18 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,775
|
I dont know about single tiles but if you X880 - Y848 like Bippy's screen shot you can see the whole level.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to Rip graphics (background and sprite) | NubeCheCorre | project.Sprites | 5 | 19 September 2010 14:27 |
Questions about bitplane DMA | Leffmann | Coders. General | 11 | 15 July 2008 15:08 |
bitplane modulos | bluea | Coders. General | 0 | 09 July 2006 01:58 |
How to put the mask bitplane behind the other bitplanes?? | method | project.Sprites | 6 | 15 February 2006 02:53 |
Save State = Rip Graphics & Mods? | turk182 | support.WinUAE | 5 | 10 September 2004 16:37 |
|
|