Offline
Tokyo, Japan

I am dabbling with logones and I am having a bit of trouble understanding how the pallettes work. I am comfortable with .chr and nametable and I am using shirus  nesST to edit both. The one thing which is tripping me up is the colors. As far as I can work out, the 4 pallets are defined in logones NOT in nesST. The relevant code is this part here

palette:                        ; palette data
;                 p1    p1   p1   p1   p2  p2    p2   p2   p3   p3   p3   p3   p4    p4  p4   p4
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 0 - aligns with pic0.nam below
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$0F,$0F,$00,$0F ; palette 1 - alings with pic1.nam below
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 2 - aligns with you know what below...
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 3
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 4
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 5
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 6
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 7
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 8
        .byte $08,$00,$10,$30,$0F,$05,$26,$30,$0F,$13,$23,$33,$08,$18,$18,$08 ; palette 9

But the nametables dont always seem to use the palettes I expect after I complile the rom. As far as I can work out, each 16x16 square of tiles has some way to specify which of the 4 palettes it should use? Is that right? However when I am using nesST I cant quite nail down how to specify that. Also in logo nes. it is pallet 4 which color cycles?

Sorry if that is a bit specific but thanks to anyone who can help!

Offline

Sorry. I was a little drunk when I first read this.  I missed the fact you already had the code posted. Ignore.

Last edited by DSC (Jan 1, 2013 6:55 am)

Offline
Toronto, Canada

I don't know what LogoNES is but in memory there is 960 bytes of the nametable (32 x 30 set of tiles to use) followed by 64 bytes of attribute (palette to use for each 2x2 tile region, 4 to a byte). If using shiru's tool make sure that you "save nametable and attributes", which should save the whole thing together as a 1kb block of data.

Offline
Praha, Czech republic

I'm not really familiar with logoNES or the other tools, only with PPU palettes in general.

Lazerbeat wrote:

But the nametables dont always seem to use the palettes I expect after I complile the rom.

Are they completely off, or do they differ in some of the colors only?
The thing is, three of those 16 colors (bytes 4, 8, 12) are not really used, instead, the PPU uses the first byte's value. Might be related. (...)

Lazerbeat wrote:

As far as I can work out, each 16x16 square of tiles has some way to specify which of the 4 palettes it should use?

Yep, the so-called attribute tables define this relation.

Sorry I can't be of more help. Hey, if noone else can help, I could look into this. :]

Last edited by kvee (Jan 2, 2013 6:47 pm)

Offline
Tokyo, Japan

Thanks Kvee, I kind of worked it out. I am fiddling around with a 16 color image which kind of "fades" from top to bottom. I am trying to convert it to nes but the palettes were really confusing me. Thanks for clarifying!