Language…
15 users online: akidaban, Children's Digest 1950-2009, Daizo Dee Von, EvanEMV, Faro, GatoSlashFish, LiamBLOL, lincade, MorrieTheMagpie, Pancake001, RenanSV, ShadowBoxer_Sandshrew, TheJavabrew, will___, Ziz - Guests: 104 - Bots: 129
Users: 55,575 (2,476 active)
Latest user: Manuel128

Layer 3 BG

Okay. Without turning this into a Layer 3 BG tutorial (I'm writing one, BTW), this is all I can say about my problem:

I am trying to make a Layer 3 BG and the palette isn't working. Furthermore, I don't know what LevelASM to use to put it behind Layer 2 and also make it scroll four times as slow as the FG.

Whatever.

So, I made all of the tiles use palette 3. I know how 2BPP palettes work. It is supposed to use the last four colors of palette 0. I edited the last four colors according to the graphics I made for my cloudy Layer 3 BG to be blue and white. And yet, somehow my clouds manage to stay a lovely chocolate brown.

Are those colors hardcoded in Layer 3? Does my Layer 3 ExGFX patch have anything to do with it? And if they are hardcoded, what RAM address do I change to the contrary? (RAM, not ROM. I'm looking to change the colors it loads, not the colors stored in the ROM)
What the hell is Pop Tart Cat?
Dammit, I think the only person who can solve my problem is Lynnes... prove me wrong guys...

Also bump. It's been 24 hours.
What the hell is Pop Tart Cat?
First of all:
Originally posted by mszegedy
I know how 2BPP palettes work. It is supposed to use the last four colors of palette 0.

First of all, this is incorrect. Layer 3 can use all the colors of palette 0 and 1. Layer 3 colors are not hardcoded in SMW (thanks to Lunar Magic anyway).

This is how you can solve your problem: find out what palette your layer 3 background is using. to find it out, look into the layer 3 tilemap's YXPCCCTT properties; the CCC portions. Just one tile is enough. I hope you know how YXPCCCTT works. If not, visit the wiki page dedicated to it:
http://www.smwiki.net/wiki/YXPCCCTT_format.

Looking into the CCC portion, when:
CCC = 000 = Palette 0
CCC = 001 = Palette 1
CCC = 010 = Palette 2
CCC = 011 = Palette 3
CCC = 100 = Palette 4
CCC = 101 = Palette 5
CCC = 110 = Palette 6
CCC = 111 = Palette 7

(you can read this as "when CCC is 000 then the background uses Palette 0")

Now, this is how the Layer 3 palette is laid out:

Excuse the obvious MS-paint editing but I'm generally lazy when it comes to making example images.

The red numbers are layer 3 palette numbers.

Each layer 3 palette consists of 4 colors. The first one is always transparent/see-through so layer 3 tiles can practically use 3 colors at once.

The next step is finding your 'chocolate-brown' color in the palette your background uses, and edit it in the Lunar Magic palette editor. Then you can save it to the ROM and try it out.

Good luck!
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
Nonono, I meant exactly what you said. Its palette starts on color C of palette 0, and ends on color F. I made all of the tiles use this palette; palette 3. I have made sure about fifty times that they are supposed to be using palette 3.

As for finding my chocolate brown, I have made a super-distinctive palette that I occasionally use for finding what colors of what palette something uses. And even after applying this palette, my clouds are still the same brown, a color not naturally present in the level.

Also, I use this levelASM for my level:

Code
REP #$20
LDA $1C
LSR A
LSR A
STA $24
LDA $1A ; Scroll four times as slow as Layer 1.
LSR A
LSR A
STA $22 ; Layer 3 X.
LDA #$1F1F
STA $2122
SEP #$20
	RTS


It has turned the bottom scanline red, my blue HDMA pink, and my Layer 2 BG blood red. My Layer 3 BG doesn't appear at all. I tried INIT and LEVEL both individually and together, with slightly different but all unsatisfactory results. The clouds only appear at all if I do not have any ASM at all, and then they are chocolate-brown.

Help?
What the hell is Pop Tart Cat?
Your code is writing $1F to both the palette and the window mask registers (a 16-bit write to $2122 spills over into $2123), so you're getting a half-updated palette entry, along with corrupted window mask settings. Why is it doing that?
It seems like you have misunderstood how register $2122 works. I'll explain it, mszegedy.

Register $2122 is a write-twice register, NOT a 16-bit wide register. This means you will have to write two 8-bit values to it consecutively.

Before writing to $2122, you'll have to write to $2121 first. It's a single write register. That register determines the color destination of your palette write. So for example if you write $26 to it, it will select color 6 of palette 2 to write.

Anyway, after selecting the color, write twice to $2122 using 8-bit values. First the low byte, then the high byte. The values you need to write must be the SNES RGB value (which ranges from $0000-$7FFF). So for a pure white color you'd go for:

LDA #$FF
STA $2122
LDA #$7F
STA $2122

I hope this all made sense.
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
Oh. In that case, I'm removing that part of the code entirely unless I can't find a better solution to my palette problems. My Layer 3 still disappears, though, and is still chocolate brown.
What the hell is Pop Tart Cat?
Do you actually have a upload code for your layer 3 tilemap? Unless using Terra Stripe there should be no problem with layer 3 images at all. For best testing try setting layer 3 X/Y position to zero aka:

Code
STZ $22
STZ $23
STZ $24
STZ $25


As for the scrolling part of layer, this should do the job:

Code
REP #$20
LDA $1A ; Layer 1-X
LSR A
LSR A
STA $22 ; Layer 3-X.

LDA $1C ; Layer 1-Y
LSR A
LSR A
STA $24 ; Layer 3-Y
SEP #$20


This should work fine, not sure about bsnes/snes9x though.
Huh. For some reason, this doesn't even cause a checksum error. Usually, that's my foolproof way of testing whether or not a patch was actually applied to my hack, but it seems not to be so. Anywho, it does absolutely nothing besides stop my Layer 3 from loading. Or possibly it is getting covered by my BG. Nope, simply not loading. What is the RAM address for Layer 3 Z position?

Also, not even setting the palette using ASM helps with the choco coloring. Wat. I see Layer 3 palette addresses in the ROM section, but how do I use them?
What the hell is Pop Tart Cat?
If it refuses to show the proper palette, it's probably because the tileset and layer 3 image combo is set to upload the smasher palette. For more info, take a look at this post.
Yeah, that's probably why (thx!), but my ROM addresses are apparently Royally Fucked Up. Unfortunately, I can't find any such table in my ROM, neither at x9F88 nor by searching. I don't think anything hijacks this; maybe it's like this because I expanded the ROM. Or maybe because of all those zeroes at the beginning; are those supposed to be there?
What the hell is Pop Tart Cat?
It was $009F88 SNES, not PC.

----------------

I'm working on a hack! Check it out here.
I know that. As I said, my addresses are Fucked Up. Where can I find the routine that uses these addresses?
What the hell is Pop Tart Cat?
$009FCC seems to be the only place that table is ever referenced.

----------------

I'm working on a hack! Check it out here.
Okay, never mind. I got past that. Now tell me: why do the scroll codes always make my Layer 3 disappear? They seem logical enough.
What the hell is Pop Tart Cat?
Never mind. Turned out I put my BG3 image too low. Wot an idiot. Anyway, thanks for putting up with me, guys!
What the hell is Pop Tart Cat?