(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-17-24 11:06 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - NES Graphics format question
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
Tauwasser
Posts: 6/46
The original Code was in Bits and he arranged it so after 8 byte he had a line break so the Bits supposed to be for 1 px were on top of each other.

cYa,

Tauwasser
Disch
Posts: 29/202
BMF has a good example. I can't make heads or tails of your original example though, DD :P

On the off-chance you're asking this for work in an editor -- this C-pseudo-code snippit (of a variation thereof) is probably one of the easiest ways to convert from NES graphics:


BYTE a, b; // temp vars

int row;
for(row = 0; row < 8; row++)
{
  a = rom[ tile_offset + row ];
  b = rom[ tile_offset + row + 8];
  output_pixel( 0, row, palette[ ((a >> 7) & 1) | ((b >> 6) & 2) ] );
  output_pixel( 1, row, palette[ ((a >> 6) & 1) | ((b >> 5) & 2) ] );
  output_pixel( 2, row, palette[ ((a >> 5) & 1) | ((b >> 4) & 2) ] );
  output_pixel( 3, row, palette[ ((a >> 4) & 1) | ((b >> 3) & 2) ] );
  output_pixel( 4, row, palette[ ((a >> 3) & 1) | ((b >> 2) & 2) ] );
  output_pixel( 5, row, palette[ ((a >> 2) & 1) | ((b >> 1) & 2) ] );
  output_pixel( 6, row, palette[ ((a >> 1) & 1) | ((b     ) & 2) ] );
  output_pixel( 7, row, palette[ ((a     ) & 1) | ((b << 1) & 2) ] );
}
BMF54123
Posts: 147/876
Bytes 0-7 (plane 1): 00000000 01111110 01000010 01011010 01011010 01000010 01111110 00000000
Bytes 8-F (plane 2): 00000000 00000000 00111100 00111100 00111100 00111100 00000000 00000000




So, yeah, your second example was right.
Dan
Posts: 50/219
Wait, I am wrong. My old code is just unreadable.
Tauwasser
Posts: 4/46
It's still wrong tho <<

cYa,

Tauwasser
DahrkDaiz
Posts: 84/403
thanks Dan, I knew you'd pull through
Dan
Posts: 48/219
The first nibble is made up from the first 8 bytes, and the second nibble is made up from the second 8 bytes.

The first one, then.
Kailieann
Posts: 251/808
With all due respect, wouldn't it have been easier and faster to just change the binary in a graphics file and figure it out yourself?

Asking here isn't the best idea. There aren't many regulars in this neck of the woods, precious few of them have made editors, none to my knowledge have made emulators, and most of us are throwovers from back when this was Advanced SMW Hacking, so NES graphics aren't necessarily a strong point for most.
DahrkDaiz
Posts: 82/403
I'd rather get a response from someone who's written an emulator or a editor who's dealt with this stuff.
Tauwasser
Posts: 3/46
The latter according to TLP. You seriously should just have checked out the gfx progs out there.

cYa,

Tauwasser
DahrkDaiz
Posts: 81/403
I know the format is 16 bytes make up 1 8x8 tile, with the first 8 bytes making half of the 2 bit pairs of each line, the next 8 making the 2nd bit in each line of the tiles... however, what order do these bit pairs go?

Basically, lets say you have this:


01010101 01111101 01010101 01010101 01010101 01111101 01010101 01010101
11000110 01111110 01100110 01100110 01100110 01111110 01100110 01100110


does that translate into

01 11 00 10 00 11 01 10
etc

or

10 11 00 01 00 11 10 01
etc
Acmlm's Board - I3 Archive - ROM Hacking - NES Graphics format question


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.003 seconds; used 351.84 kB (max 396.97 kB)