palette loading problem (new to asm68K)

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
Cydeenwins
Newbie
Posts: 2
Joined: Sun Feb 14, 2021 2:27 pm

palette loading problem (new to asm68K)

Post by Cydeenwins » Wed Feb 24, 2021 12:49 pm

Hi,
I'm a complete newbie to sega megadrive coding so I tried to do the most basic thing : creating and loading color palette.
But the palette won't load, can anyone tell me what did I done wrong?

Code: Select all

    ORG $0000

    INCLUDE Palettes.X68
    INCLUDE PaletteRoutine.X68
    

    LEA.L PaletteX,A0 

    move.w #$01,d0 

    jsr ChargementPalette

(Palettes.X68)

Code: Select all

PaletteX:
    DC.W	$0C80,$0000,$000C,$0899	
    DC.W	$0F84,$0FA5,$0F01,$0FC6
    DC.W	$0F80,$0777,$08AF,$006F
    DC.W	$0C40,$0EEE,$0B02,$0000
(PaletteRoutine.X68)

Code: Select all

ChargementPalette:
	
    MOVE.L	#$C0000000,($00C00004)
    MULU	#$10,D0
    SUB.W	#$01,D0

ChargementPaletteBoucle:

    MOVE.W	(A0)+,($00C00000)
    DBF	D0,ChargementPaletteBoucle
    RTS


ob1
Very interested
Posts: 463
Joined: Wed Dec 06, 2006 9:01 am
Location: Aix-en-Provence, France

Re: palette loading problem (new to asm68K)

Post by ob1 » Wed Feb 24, 2021 2:07 pm

Hello Cydeenwins.
Your code looks good, but since it states it starts at 0, I wonder if you put a valid header ...

Post Reply