Hello, I'm still having troubles with making the palette fade in. It's really bugging me now, and I just can't see why it's failing.
Now, I can get the palette line to fade out perfectly fine (thanks for the help, MJ):

I then make it fade out:
super_shoes:
addq.w #1,(a2)
bset #2,status_secondary(a1)
move.b #$96,speedshoes_time(a1)
movem.l d7/a0,-(sp)
move.w #$600F,($FFFFF626).w
jsr Pal_FadeFrom2
movem.l (sp)+,d7/a0
cmpa.w #MainCharacter,a1
bne.s loc_12A10
cmpi.w #2,(Player_mode).w ; Maybe set if the char is Tails?
beq.s loc_12A10
move.b #$2, (sonicsbursting).w ; when speed boots are active, make sonic in burst mode
move.w #$C00,(Sonic_top_speed).w
move.w #$18,(Sonic_acceleration).w
move.w #$80,(Sonic_deceleration).w
bra.s loc_12A22

(The blue is from a different palette line so ignore that for now)
But no matter what I do, I cannot fade it back in.
Pal_FadeTo:
move.w #$3F,($FFFFF626).w
Pal_FadeTo2:
moveq #0,d0
lea (Normal_palette).w,a0
Pal_FadeTo3:
move.b ($FFFFF626).w,d0
adda.w d0,a0
moveq #0,d1
move.b ($FFFFF627).w,d0
; loc_23DE:
Pal_ToBlack:
move.w d1,(a0)+
dbf d0,Pal_ToBlack ; fill palette with $000 (black)
moveq #$0E,d4 ; MJ: prepare maximum colour check
moveq #$00,d6 ; MJ: clear d6
- bsr.w RunPLC_RAM
move.b #$12,(Delay_Time).w
bsr.w DelayProgram
bchg #$00,d6 ; MJ: change delay counter
beq.s - ; MJ: if null, delay a frame
bsr.s Pal_FadeIn
subq.b #$02,d4 ; MJ: decrease colour check
bne.s - ; MJ: if it has not reached null, branch
move.b #$12,(Delay_Time).w ; MJ: wait for V-blank again (so colours transfer)
bra.w DelayProgram ; MJ: ''
; End of function Pal_FadeTo
I've put Pal_fadeto3, so in my objects code, I can move my own data to a0 and the RAM address.
shield_monitor:
movem.l d7/a0,-(sp)
move.w #$600F,($FFFFF626).w
moveq #0,d0
lea (Normal_palette_line4).w,a0
jsr Pal_FadeTo3
movem.l (sp)+,d7/a0
moveq #$4D,d0
jsr (LoadPLC2).l
bclr #3,status_secondary(a1)
addq.w #1,(a2)
bset #0,status_secondary(a1)
move.w #$AF,d0
jsr (PlayMusic).l
move.b #$38,(Object_RAM+$2180).w ; load Obj38 (shield) at $FFFFD180
move.w a1,(Object_RAM+$2180+parent).w
rts
Now, it doesn't matter what I "Lea" to a0, Normal_palette_line, 2, 3 or 4, or even put my own data in a new RAM address and move it to a0 (lea (Myownpalette).w,a0). Whatever I do, I ALWAYS get this:

I'm obviously doing something wrong. Anyone with any ideas? Thanks for the help!
redhotsonic
EDIT: I tried making it jump to different places rather than Pal_FadeTo3 and I either get the samething, or it styas black, or it freezes.
Edited by redhotsonic, 01 May 2012 - 11:45 AM.