Banner
Views: 240,614,041
Time: 2013-06-19 07:37:15 PM
20 users online: Akireyano, AlCaPwN, buggy789, Cesar the FoxWolf, Henix Aurorus, in3D, Jack Kitetsu, JaphethMario21st, leod, Magiluigi, mario90, phenolatukas, Pixels, RaindropDry, Sapphire, o ShadowPhoenix, ShrooboidBrat, Spiderpig2398, The Secret Exit, o TRS - Guests: 36 - Bots: 28Users: 23,084 (1,325 active)
Latest: ITGAlex
Tip: Avoid making large, flat, boring stretches of land. Vary up the architecture and spritework in your levels.
Palette depending on X position
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Palette depending on X position
Pages: « 1 »
Hi, I'd want to know if it's possible to make a sprite have a different palette depending of its X position. If it is, may I know how?

EDIT: More specifically, I'd like it to choose between 4 palettes, A, B, C and D. Position 00 gives palette A, 01 gives B, and so on.
Last edited on 2012-04-06 04:16:00 PM by King Dedede.
Just do something like this:

Code
LDA $E4,x
AND #$01	; Number of palettes
PHX
TAX
LDA Table,x
ORA $64
STA $0303,y
PLX
Last edited on 2012-04-06 04:17:08 PM by wiiqwertyuiop.
Where do I put it? In the graphics routine? I want to use it with the NPC v3.0, btw. It seems to already have something to check the sprite's X position.

I'm kinda newbie to ASM, so I need more info.

EDIT: Also, for the "number of palettes" part, is it the number of palettes minus one? Like, 00 meaning 1, 01 meaning 2, etc. ?

EDIT2: 400 posts in more than a year of activity... it's bad, isn't it?
Last edited on 2012-04-06 07:33:54 PM by King Dedede.
Originally posted by King Dedede
EDIT: Also, for the "number of palettes" part, is it the number of palettes minus one? Like, 00 meaning 1, 01 meaning 2, etc. ?

Yes, and of note, that method only works with exponents of 2.

So, 01, 03, 07, 0F, etc.
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Palette depending on X position

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 29

Menu