I don't understand palletes and name and pattern tables.
Posted: Tue Jan 23, 2007 9:36 am
Okay, i try to run do a simple demo, but none of this stupid poop works.
Which one of the codes are right for loading the pallete:
Code1
Code2
Or this one:
Every each of these loading routines, gives me a different pallete, but i always use the same .pal file
The yoshi doc is hard to understand for me(because i'm not a native english speaker). And My background always loads the first tile, and copies it through all the space.
And the nes has 16 colors for this and that, so how can i choose which color of the 4color image in the chr file would be green or blue?
Example:
my tile file looks like this(a 4x4 pixel tile, just for an example):
XXXX white
XXXX light gray
XXXX dark grey
XXXX black/trnsparent
And how do i make it look on the screen like:
XXXX blue
XXXX yellow
XXXX red
XXXX black/trnsparent
Because i always get some colors(that even aren't in the palette!)
Please help
Which one of the codes are right for loading the pallete:
Code1
Code: Select all
;these are the writes that setup the palette
lda #$01
sta $2007
lda #$02
sta $2007
lda #$03
sta $2007
lda #$04
sta $2007
lda #$05
sta $2007
lda #$06
sta $2007
lda #$07
sta $2007
lda #$08
sta $2007
lda #$09 ;stop here
sta $2007
lda #$0A
sta $2007
lda #$0B
sta $2007
lda #$0C
sta $2007
lda #$0D
sta $2007
lda #$0E
sta $2007
lda #$0F
sta $2007
lda #$11
sta $2007
lda #$12 ;Start sprite colors
sta $2007
lda #$13
sta $2007
lda #$14
sta $2007
lda #$15
sta $2007
lda #$16
sta $2007
lda #$17
sta $2007
lda #$18
sta $2007
lda #$19
sta $2007
lda #$1A
sta $2007
lda #$1B
sta $2007
lda #$1C
sta $2007
lda #$1D
sta $2007
lda #$1E
sta $2007
lda #$1F
Code2
Code: Select all
;these are the writes that setup the palette
lda #$01
sta $2007
lda #$02
sta $2007
lda #$03
sta $2007
lda #$04
sta $2007
lda #$05
sta $2007
lda #$06
sta $2007
lda #$07
sta $2007
lda #$08
sta $2007
lda #$01 ;stop here
sta $2007
lda #$08
sta $2007
lda #$09
sta $2007
lda #$0A
sta $2007
lda #$01
sta $2007
lda #$0B
sta $2007
lda #$0C
sta $2007
lda #$0D
sta $2007
lda #$01 ;Start sprite colors
sta $2007
lda #$0D
sta $2007
lda #$08
sta $2007
lda #$2B
sta $2007
lda #$01
sta $2007
lda #$05
sta $2007
lda #$06
sta $2007
lda #$07
sta $2007
lda #$01
sta $2007
lda #$08
sta $2007
lda #$09
sta $2007
lda #$0A
sta $2007
lda #$01
sta $2007
lda #$0B
sta $2007
lda #$0C
sta $2007
lda #$0D
sta $2007
Code: Select all
loadpal: ;loading pallette
lda tilepal, x
sta $2007
inx
cpx #$21
bne loadpal
Every each of these loading routines, gives me a different pallete, but i always use the same .pal file
The yoshi doc is hard to understand for me(because i'm not a native english speaker). And My background always loads the first tile, and copies it through all the space.
And the nes has 16 colors for this and that, so how can i choose which color of the 4color image in the chr file would be green or blue?
Example:
my tile file looks like this(a 4x4 pixel tile, just for an example):
XXXX white
XXXX light gray
XXXX dark grey
XXXX black/trnsparent
And how do i make it look on the screen like:
XXXX blue
XXXX yellow
XXXX red
XXXX black/trnsparent
Because i always get some colors(that even aren't in the palette!)
Please help