diff --git a/Items/ocarina.asm b/Items/ocarina.asm index 497359e..53ff9fc 100644 --- a/Items/ocarina.asm +++ b/Items/ocarina.asm @@ -185,9 +185,12 @@ LinkItem_NewFlute: ; Are we indoors? LDA.b $1B : BNE .return - ; Are we in the dark world? The flute doesn't work there. - LDA.b $8A : AND.b #$40 : BNE .return - + ; Are we in the dark world? Then become Moosh form. + LDA.b $8A : AND #$40 : BEQ .light_world + JSL Link_TransformMoosh + RTS + .light_world + ; Also doesn't work in special areas like Master Sword area. LDA.b $10 : CMP.b #$0B : BEQ .return @@ -398,7 +401,7 @@ UpdateFluteSong_Long: ; R Button Pressed - Increment song INC $030F ; increment $030F Song RAM LDA $030F ; load incremented Song RAM - CMP.b #$04 + CMP.b #$05 BCS .wrap_to_min .update_song RTL diff --git a/Masks/all_masks.asm b/Masks/all_masks.asm index 62ec36e..5ba9e55 100644 --- a/Masks/all_masks.asm +++ b/Masks/all_masks.asm @@ -60,4 +60,8 @@ org $388000 org $3B8000 incbin gfx/gbc_link.4bpp - incsrc "Masks/gbc_form.asm" \ No newline at end of file + incsrc "Masks/gbc_form.asm" + +org $338000 + incbin gfx/moosh.4bpp + incsrc "Masks/moosh.asm" diff --git a/Masks/gfx/moosh.4bpp b/Masks/gfx/moosh.4bpp new file mode 100644 index 0000000..0273a7d Binary files /dev/null and b/Masks/gfx/moosh.4bpp differ diff --git a/Masks/mask_routines.asm b/Masks/mask_routines.asm index d05f51f..b26d08e 100644 --- a/Masks/mask_routines.asm +++ b/Masks/mask_routines.asm @@ -108,6 +108,7 @@ Palette_ArmorAndGloves: CMP.b #$04 : BEQ .bunny_hood CMP.b #$05 : BEQ .minish_form CMP.b #$06 : BEQ .gbc_form + CMP.b #$07 : BEQ .moosh_form JMP .original_sprite .deku_mask @@ -139,11 +140,13 @@ Palette_ArmorAndGloves: LDA.b #$39 : STA $BC : JMP .original_palette .gbc_form - ; Load GBC Link Location - LDA.b #$3B : STA $BC JSL UpdateGbcPalette RTL + .moosh_form + JSL UpdateMooshPalette + RTL + .original_sprite ; Load Original Sprite Location LDA.b #$10 : STA $BC @@ -301,11 +304,10 @@ Link_TransformMask: TAY ; LDA $02B2 CPY !CurrentMask : BEQ .unequip ; check if mask is on - STA $02B2 : TAX LDA .mask_gfx, X : STA $BC ; set the mask gfx JSL Palette_ArmorAndGloves ; set the palette - STA $02F5 ; Somaria platform flag, no dash + ; STA $02F5 ; Somaria platform flag, no dash PLB : CLC : RTL .unequip @@ -322,6 +324,20 @@ Link_TransformMask: db $00, $35, $36, $38, $37, $39, $3A, $3B } +; TODO: Return to normal Link. +Link_TransformMoosh: +{ + PHB : PHK : PLB + + LDA.b #$07 : STA.w !CurrentMask + LDA.b #$33 : STA $BC + %PlayerTransform() + JSL Palette_ArmorAndGloves + + PLB + RTL +} + ; ========================================================= ; Modifies the value of the Y register before it indexes the table @@ -335,6 +351,12 @@ DekuLink_SpinOrRecoil: LDY.b #$05 ; Recoil JML $0DA435 ; JML $0DA40B .spin + ; Moosh form configuration + LDA.w $02B2 : CMP.b #$07 : BEQ + + TYA + LDY.b #$16 ; Pushing + JML $0DA435 + + TYA LDY.b #$1B ; Spin and die JML $0DA40B @@ -1302,6 +1324,7 @@ LinkOAM_CheckForDrawShield: + CMP.w #$0001 : BEQ .no_shield CMP.w #$0003 : BEQ .no_shield + CMP.w #$0007 : BEQ .no_shield .shield RTL } diff --git a/Masks/moosh.asm b/Masks/moosh.asm new file mode 100644 index 0000000..a6314d5 --- /dev/null +++ b/Masks/moosh.asm @@ -0,0 +1,35 @@ +UpdateMooshPalette: +{ + REP #$30 ; change 16bit mode + LDX #$001E + + .loop + LDA.l MooshPalette, 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 +} + + +MooshPalette: +{ + dw #$0000, #$7FFF, #$237E, #$46FF, #$369E, #$14A5, #$01FF, #$1078 + dw #$6E25, #$7AEF, #$6759, #$0A4A, #$12EF, #$2A5C, #$1571, #$7A18 +} + +Link_HoverIfMooshWantsToDash: +{ + LDA.w !CurrentMask : CMP.b #$07 : BNE .return + JSL PrepareQuakeSpell + LDA.b #$0A : STA.b $5D + + .return + JSL Link_HandleMovingAnimation_FullLongEntry + RTL +} +print "End of Masks/moosh.asm ", pc + +org $079093 + JSL Link_HoverIfMooshWantsToDash \ No newline at end of file diff --git a/Oracle_main.asm b/Oracle_main.asm index 2e58d13..c2a122f 100644 --- a/Oracle_main.asm +++ b/Oracle_main.asm @@ -10,7 +10,7 @@ ; 2E - HUD ; 2F - Unused ; 30-32 Sprites: all_sprites.asm -; 33 - Unused +; 33 - Moosh Form Gfx and Palette ; 34 - Time System, Custom Overworld Overlays ; 35 - Deku Link Gfx and Palette ; 36 - Zora Link Gfx and Palette