Difference between revisions of "Crystal Switch"

From TLoZ: ALTTP Hacking Resources
Jump to: navigation, search
(Another Section)
Line 1: Line 1:
{{infobox sprite
 
| id = $1E
 
| hp = $00 ($06B191)
 
| damage = $00 ($06B284)
 
| palette = $01 ($06B377)
 
| found = Many Places
 
}}
 
  
== Description ==
+
{{subpage|Sprites}}
 +
 
 +
Sprite {{$|1E}}: Crystal Switch
 +
== Crystal Switch ==
 +
=== Description ===
 
Activating a crystal switch raises or lowers colored pillars.
 
Activating a crystal switch raises or lowers colored pillars.
  
== Combat Strategy ==
+
=== Combat Strategy ===
 +
N/A
 +
 
 +
== Stats And Properties ==
 +
See [[Sprite Properties]]
 +
 
 +
'''{{$|$1E}}'''
 +
{|{{Prettytable}}
 +
!Bit(s)
 +
!Info
 +
!Value
 +
|-
 +
| {{Hex|7}}
 +
| Harmless
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|6}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|5}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|4-0}}
 +
| OAM Slots
 +
| {{Hex|11111}} ({{$|1F}})
 +
|}
 +
 
 +
'''{{$|$1E}}'''
 +
{|{{Prettytable}}
 +
! Bit(s)
 +
! Info
 +
! Value
 +
|-
 +
| {{Hex|7-0}}
 +
| HP
 +
| {{Hex|11111111}} ({{$|FF}})
 +
|}
  
== Known Bugs ==
+
'''{{$|$1E}}'''
 +
{|{{Prettytable}}
 +
! Bit(s)
 +
! Info
 +
! Value
 +
|-
 +
| {{Hex|7-4}}
 +
| ?
 +
| {{Hex|1111}} ({{$|0F}})
 +
|-
 +
| {{Hex|3-0}}
 +
| [[Damage Types|Damage Type]]
 +
| {{Hex|1111}} ({{$|0F}})
 +
|}
  
== Disassembly ==
+
'''{{$|$1E}}'''
 +
{|{{Prettytable}}
 +
! Bit(s)
 +
! Info
 +
! Value
 +
|-
 +
| {{Hex|7}}
 +
| No Death Animation
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|6}}
 +
| Invincible
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|5}}
 +
| Adjust Child coordinates
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|4}}
 +
| Draw Shadow
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|3-1}}
 +
| Palette
 +
| {{Hex|111}} ({{$|07}})
 +
|-
 +
| {{Hex|0}}
 +
| ?
 +
| {{Hex|1}}
 +
|}
  
Todo:
+
'''{{$|$1E}}'''
-Make ram addresses link to proper subsection of RAM map.
+
{|{{Prettytable}}
-Make sub jumps link to proper subsection of bank page.
+
! Bit(s)
 +
! Info
 +
! Value
 +
|-
 +
| {{Hex|7}}
 +
| Ignore Collision Settings
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|6}}
 +
| Statis
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|5}}
 +
| Persist
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|4-0}}
 +
| Hit Box Dimensions
 +
| {{Hex|11111}} ({{$|1F}})
 +
|}
  
----
+
'''{{$|$1E}}'''
 +
{|{{Prettytable}}
 +
! Bit(s)
 +
! Info
 +
! Value
 +
|-
 +
| {{Hex|7-4}}
 +
| Tile Interaction Hit Box
 +
| {{Hex|1111}} ({{$|0F}})
 +
|-
 +
| {{Hex|3}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|2}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|1}}
 +
| Dies Like A Boss
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|0}}
 +
| Falls In Holes
 +
| {{Hex|1}}
 +
|}
  
    ; $338CE-$338CF DATA
+
'''{{$|$1E}}'''
    pool Sprite_CrystalSwitch:
+
{|{{Prettytable}}
    {
+
! Bit(s)
   
+
! Info
    .palettes
+
! Value
        db $02, $04
+
|-
    }
+
| {{Hex|7}}
 +
| Disable Tile Interactions
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|6}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|5}}
 +
| Is shield Blockable
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|4}}
 +
| Alternate Damage Sound
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|3-0}}
 +
| Prize Pack
 +
| {{Hex|1111}} ({{$|0F}})
 +
|}
  
----
+
'''{{$|$1E}}'''
 +
{|{{Prettytable}}
 +
! Bit(s)
 +
! Info
 +
! Value
 +
|-
 +
| {{Hex|7}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|6}}
 +
| ?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|5}}
 +
| Is Interactive
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|4}}
 +
| Deflect Projectiles
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|3}}
 +
| Collide With Less Tiles
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|2}}
 +
| Impervious To Sword/Hammer
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|1}}
 +
| Impervious To Arrows?
 +
| {{Hex|1}}
 +
|-
 +
| {{Hex|0}}
 +
| ?
 +
| {{Hex|1}}
 +
|}
  
    ; *$338D0-$3394B JUMP LOCATION
+
== Code ==
    Sprite_CrystalSwitch:
 
    {
 
        ; AND the palette value with 0xF1
 
        LDA $0F50, X : AND.b #$F1 : STA $0F50, X
 
       
 
        ; Blue / Orange barrier state
 
        LDA $7EC172 : AND.b #$01 : TAY
 
       
 
        ; Select the palette for the peg switch based on that state.
 
        LDA .palettes, Y : ORA $0F50, X : STA $0F50, X
 
       
 
        JSR OAM_AllocateDeferToPlayer
 
        JSR Sprite_PrepAndDrawSingleLarge
 
        JSR Sprite_CheckIfActive
 
       
 
        JSR Sprite_CheckDamageToPlayer_same_layer : BCC .no_player_collision
 
       
 
        JSL Sprite_NullifyHookshotDrag
 
       
 
        STZ $5E
 
       
 
        JSL Sprite_RepelDashAttackLong
 
   
 
    .no_player_collision
 
   
 
        LDA $0DF0, X : BNE .skipSparkleGeneration
 
       
 
        LDA $1A : AND.b #$07 : STA $00
 
                              STZ $01
 
       
 
        JSL GetRandomInt : AND.b #$07 : STA $02
 
                                        STZ $03
 
       
 
        ; Attempt to add a sparkle effect
 
        JSL Sprite_SpawnSimpleSparkleGarnish
 
       
 
        ; Restart sparkle countdown timer.
 
        LDA.b #$1F : STA $0DF0, X
 
   
 
    .skipSparkleGeneration
 
   
 
        LDA $0EA0, X : BNE .switching_already_scheduled
 
       
 
        LDA $3C : DEC A : CMP.b #$08 : BPL .ignore_player_poke_attack
 
       
 
        JSR Sprite_CheckDamageFromPlayer
 
   
 
    .ignore_player_poke_attack
 
   
 
        RTS
 
   
 
    .switching_already_scheduled
 
   
 
        DEC $0EA0, X : CMP.b #$0B : BNE .dont_switch_state
 
       
 
        ; Change the orange/blue barrier state
 
        LDA $7EC172 : EOR.b #$01 : STA $7EC172
 
       
 
        LDA.b #$16 : STA $11
 
       
 
        LDA.b #$25 : JSL Sound_SetSfx3PanLong
 
   
 
    .dont_switch_state
 
   
 
        RTS
 
    }
 

Revision as of 00:37, 24 July 2017

This is a subpage of Sprites

Sprite $1E: Crystal Switch

Crystal Switch

Description

Activating a crystal switch raises or lowers colored pillars.

Combat Strategy

N/A

Stats And Properties

See Sprite Properties

$$1E

Bit(s) Info Value
7 Harmless 1
6  ? 1
5  ? 1
4-0 OAM Slots 11111 ($1F)

$$1E

Bit(s) Info Value
7-0 HP 11111111 ($FF)

$$1E

Bit(s) Info Value
7-4  ? 1111 ($0F)
3-0 Damage Type 1111 ($0F)

$$1E

Bit(s) Info Value
7 No Death Animation 1
6 Invincible 1
5 Adjust Child coordinates 1
4 Draw Shadow 1
3-1 Palette 111 ($07)
0  ? 1

$$1E

Bit(s) Info Value
7 Ignore Collision Settings 1
6 Statis 1
5 Persist 1
4-0 Hit Box Dimensions 11111 ($1F)

$$1E

Bit(s) Info Value
7-4 Tile Interaction Hit Box 1111 ($0F)
3  ? 1
2  ? 1
1 Dies Like A Boss 1
0 Falls In Holes 1

$$1E

Bit(s) Info Value
7 Disable Tile Interactions 1
6  ? 1
5 Is shield Blockable 1
4 Alternate Damage Sound 1
3-0 Prize Pack 1111 ($0F)

$$1E

Bit(s) Info Value
7  ? 1
6  ? 1
5 Is Interactive 1
4 Deflect Projectiles 1
3 Collide With Less Tiles 1
2 Impervious To Sword/Hammer 1
1 Impervious To Arrows? 1
0  ? 1

Code