I am trying to understand how the snes image format works because I don't have windows and I can't use pcx2snes. I've done quite a bit of research and I've manage to figure out 95% percent of it, but there is one part I'm a bit hung up on. I'm trying to read the graphic used in this tutorial (tiles.inc):
http://wiki.superfamicom.org/snes/show/ ... ic-Tac-Toe
The link to the source files is at the bottom of the page.
I know that the dimensions from the pcx source file included are 112x16. I also know that each line in of the table in the snes image file is one 8x8 tile. The part that is confusing to me is that there are 30 rows in the table but I know that only 28 are displayed. It would seem to me that there is an extra to rows of $00 to show that it's a division of the top half of the image from the bottom half. Does anybody know if that is the case and if so how the snes knows that it's not another real tile? Thanks in advance!
SNES Image format
- Ramsis
- SNES-Freak

- Beiträge: 538
- Registriert: 29. Dezember 2011, 15:33
- +Positive Tradingpoints+: 3 von 3
- Wohnort: Löwenhöhle :3
- Kontaktdaten:
Re: SNES Image format
Hi, and welcome to the forums! 
So all in all, there are 6 empty tiles: 2 at the beginning of row 1 (lines 4 and 5 in tiles.inc), 2 at its end (lines 18 and 19), and 2 at the beginning of row 2 (lines 20 and 21).
Hope this helps!
Ramsis
In case you're on Linux, pcx2snes/gfx2snes work just fine using Wine (i.e., by simply invoking ./<filename>.exe in a terminal). Also, there's a tool named sixpack which contains a native Linux binary.Chaz231 hat geschrieben:I am trying to understand how the snes image format works because I don't have windows and I can't use pcx2snes.
A quick look at address $8000 in the assembled ROM reveals that the original 112×16 graphics are .INCBINed as one row of 128×8 pixels (= 16 tiles) and another row of 112×8 px (= 14 tiles). Hence the 30 tiles total. It seems that the gfx converter (pcx2snes in this case) automagically added the two "missing" empty tiles at the end of the first row in order to preserve the vertical alignment of the TicTacToe icons.Chaz231 hat geschrieben:I know that the dimensions from the pcx source file included are 112x16. I also know that each line in of the table in the snes image file is one 8x8 tile. The part that is confusing to me is that there are 30 rows in the table but I know that only 28 are displayed.
So all in all, there are 6 empty tiles: 2 at the beginning of row 1 (lines 4 and 5 in tiles.inc), 2 at its end (lines 18 and 19), and 2 at the beginning of row 2 (lines 20 and 21).
Hope this helps!
Ramsis
- Dateianhänge
-
- tictac.png (14.42 KiB) 4223 mal betrachtet
Re: SNES Image format
Thank you for your response! I'm on mac, but I've tried wine and for some reason it has stopped working for me... Likely because my computer is getting outdated. But my friend and I are actually attempting to build a snes image viewer/editor/converter that is hosted on a website so it's cross platform. That's the main reason I'm trying to figure all this stuff out.
Thank you again for the help!
What do you mean looking at address $8000 in the assembled ROM? Are you running the game in a debugger? And how are you able to see that? That does make sense that it would lengthen the image to 128 pixels though.A quick look at address $8000 in the assembled ROM reveals that the original 112×16 graphics are .INCBINed as one row of 128×8 pixels (= 16 tiles) and another row of 112×8 px (= 14 tiles).
Thank you again for the help!
- Ramsis
- SNES-Freak

- Beiträge: 538
- Registriert: 29. Dezember 2011, 15:33
- +Positive Tradingpoints+: 3 von 3
- Wohnort: Löwenhöhle :3
- Kontaktdaten:
Re: SNES Image format
I loaded the ROM in Tile Layer Pro, a simple tile editor (i.e., a program that lets you view/edit NES/GB/SNES/etc graphics).Chaz231 hat geschrieben:What do you mean looking at address $8000 in the assembled ROM?
Re: SNES Image format
Gotcha. Alrighty! I'll figure it out. Thank you!
