From 88f35501da47b5724717b2cf48c8921c09250f27 Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 21 Dec 2022 13:45:52 -0500 Subject: [PATCH] update palettes for mask transformations --- Masks/bunny_hood.asm | 24 ++++++++++++++++++++++-- Masks/deku_mask.asm | 3 ++- Masks/wolf_mask.asm | 24 ++++++++++++++++++++++-- Masks/zora_mask.asm | 1 + 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/Masks/bunny_hood.asm b/Masks/bunny_hood.asm index 8a602c1..335e534 100644 --- a/Masks/bunny_hood.asm +++ b/Masks/bunny_hood.asm @@ -33,11 +33,13 @@ LinkItem_Ether: JSL AddTransformationCloud LDA.b #$14 : JSR Player_DoSfx2 - LDA $02B2 : CMP #$04 : BEQ .unequip ; is the hood already on? - LDA #$37 : STA $BC ; change link's sprite + LDA $02B2 : CMP #$04 : BEQ .unequip ; is the hood already on? + JSL UpdateBunnyPalette + LDA #$37 : STA $BC ; change link's sprite LDA #$04 : STA $02B2 BRA .return .unequip + JSL Palette_ArmorAndGloves LDA #$10 : STA $BC : STZ $02B2 ; take the hood off .return @@ -48,6 +50,24 @@ LinkItem_Ether: org $378000 incbin bunny_link.4bpp +UpdateBunnyPalette: +{ + REP #$30 ; change 16bit mode + LDX #$001E + + .loop + LDA.l bunny_palette, X : STA $7EC6E0, X + DEX : DEX : BPL .loop + + SEP #$30 ; go back to 8 bit mode + INC $15 ; update the palette + RTL ; or RTS depending on where you need it +} + + +bunny_palette: +dw #$7BDE, #$7FFF, #$2F7D, #$19B5, #$3A9C, #$14A5, #$19FD, #$14B6, #$55BB, #$362A, #$3F4E, #$162B, #$22D0, #$2E5A, #$1970, #$7616, #$6565, #$7271, #$2AB7, #$477E, #$1997, #$14B5, #$459B, #$69F2, #$7AB8, #$2609, #$19D8, #$3D95, #$567C, #$1890, #$52F6, #$2357, #$0000 + org $87E330 JSR $FD66 diff --git a/Masks/deku_mask.asm b/Masks/deku_mask.asm index 30b1b2a..0492803 100644 --- a/Masks/deku_mask.asm +++ b/Masks/deku_mask.asm @@ -22,11 +22,12 @@ LinkItem_Quake: LDA.b #$14 : JSR Player_DoSfx2 LDA $02B2 : CMP #$01 : BEQ .unequip ; is the deku mask on? + JSL Palette_ArmorAndGloves LDA #$35 : STA $BC ; put the mask on LDA #$01 : STA $02B2 BRA .return .unequip - + JSL Palette_ArmorAndGloves LDA #$10 : STA $BC : STZ $02B2 ; take the mask off .return diff --git a/Masks/wolf_mask.asm b/Masks/wolf_mask.asm index e0533ca..8b3c02a 100644 --- a/Masks/wolf_mask.asm +++ b/Masks/wolf_mask.asm @@ -23,13 +23,15 @@ LinkItem_WolfMask: LDY.b #$04 : LDA.b #$23 JSL AddTransformationCloud LDA.b #$14 : JSR Player_DoSfx2 - + LDA $02B2 : CMP #$03 : BEQ .unequip ; is the wolf mask already on? + JSL UpdateWolfPalette LDA #$38 : STA $BC ; change link's sprite LDA #$03 : STA $02B2 BRA .return .unequip + JSL Palette_ArmorAndGloves LDA #$10 : STA $BC : STZ $02B2 ; take the mask off .return @@ -38,4 +40,22 @@ LinkItem_WolfMask: } org $388000 -incbin wolf_link.4bpp \ No newline at end of file +incbin wolf_link.4bpp + +UpdateWolfPalette: +{ + REP #$30 ; change 16bit mode + LDX #$001E + + .loop + LDA.l mypalette, X : STA $7EC6E0, X + DEX : DEX : BPL .loop + + SEP #$30 ; go back to 8 bit mode + INC $15 ; update the palette + RTL ; or RTS depending on where you need it +} + + +mypalette: +dw #$7BDE, #$7FFF, #$2F7D, #$19B5, #$3A9C, #$14A5, #$1A3D, #$14B6, #$4650, #$362A, #$3F4E, #$162B, #$318A, #$39CC, #$1CE7, #$76D1, #$6565, #$7271, #$14B5, #$459B, #$3D95, #$22D0, #$567C, #$1890, #$7616, #$0000 diff --git a/Masks/zora_mask.asm b/Masks/zora_mask.asm index 44bd5db..a7425a3 100644 --- a/Masks/zora_mask.asm +++ b/Masks/zora_mask.asm @@ -18,6 +18,7 @@ LinkItem_ZoraMask: LDA #$02 : STA $02B2 BRA .return .unequip + JSL Palette_ArmorAndGloves LDA #$10 : STA $BC : STZ $02B2 ; take the mask off .return