812 lines
26 KiB
NASM
812 lines
26 KiB
NASM
; =========================================================
|
||
; Sprite RAM and Functions
|
||
|
||
SprY = $0D00
|
||
SprX = $0D10
|
||
SprYH = $0D20
|
||
SprXH = $0D30
|
||
|
||
SprYSpeed = $0D40
|
||
SprXSpeed = $0D50
|
||
|
||
SprYRound = $0D60
|
||
SprXRound = $0D70
|
||
|
||
SprCachedX = $0FD8
|
||
SprCachedY = $0FDA
|
||
|
||
SprAction = $0D80 ; Indexes the action jump table
|
||
SprFrame = $0D90 ; Indexes the SprGfx for drawing
|
||
SprGfx = $0DC0 ; Determine the GFX used for the sprite
|
||
|
||
SprMiscA = $0DA0 ; Sprite_DamageFlash palette index
|
||
SprMiscB = $0DB0 ; Various usages, truly auxiliary
|
||
SprMiscC = $0DE0 ; Cardinal direction the sprite is facing
|
||
SprMiscD = $0E90 ; Pikit stolen item, misc usage
|
||
SprMiscE = $0EB0 ; Head direction 0123 -> udlr
|
||
SprMiscF = $0EC0 ;
|
||
SprMiscG = $0ED0 ;
|
||
|
||
SprMiscH = $0FC7 ; Luck based prize pack
|
||
|
||
SprTimerA = $0DF0 ; Action, decreased by 1 each frame
|
||
SprTimerB = $0E00 ; Animation, decreased by 1 each frame
|
||
SprTimerC = $0E10 ; decreased by 1 each frame
|
||
SprTimerD = $0EE0 ; decreased by 1 each frame
|
||
SprTimerE = $0F10 ; decreased by 1 each frame
|
||
SprTimerF = $0F80 ; Gravity, decreased by 2 each frame
|
||
|
||
SprSlot = $0FA0 ; Current sprite slot being executed
|
||
|
||
SprStunTimer = $0B58 ; counts down from 0xFF
|
||
|
||
SprPause = $0F00 ; Inactive if nonzero
|
||
SprFloor = $0F20 ; 0 (top layer), 1 (bottom layer)
|
||
SprType = $0E20 ; Sprite ID
|
||
SprSubtype = $0E30 ; Sprite subtype
|
||
|
||
; hmwo oooo
|
||
; o - define the number of OAM slots used by the sprite
|
||
; w - Causes enemies to go towards the walls
|
||
; m - Master sword ceremony sprite flag
|
||
; h - If set, harmless. Unset you take damage from contact.
|
||
SprNbrOAM = $0E40
|
||
SprHealth = $0E50
|
||
|
||
; 0x00 - Sprite is dead, totally inactive
|
||
; 0x01 - Sprite falling into a pit with generic animation.
|
||
; 0x02 - Sprite transforms into a puff of smoke, often producing an item
|
||
; 0x03 - Sprite falling into deep water (optionally making a fish jump up?)
|
||
; 0x04 - Death mode for bosses
|
||
; 0x05 - Sprite falling into a pit that has a special animation
|
||
; 0x06 - Death Mode for normal creatures.
|
||
; 0x08 - Sprite is being spawned at load time.
|
||
; An initialization routine will be run for one frame,
|
||
; and then move on to the active state (0x09) next frame.
|
||
; 0x09 - Sprite is in the normal, active mode.
|
||
; 0x0A - Sprite is being carried by the player.
|
||
; 0x0B - Sprite is frozen and / or stunned.
|
||
SprState = $0DD0
|
||
|
||
; nios pppt
|
||
; n - if set, don't draw extra death anim
|
||
; i - impervious to attacks and collision? TODO
|
||
; o - shadow size (0: normal | 1: small)
|
||
; s - shadow (0: no shadow | 1: shadow)
|
||
; p - palette used for OAM props
|
||
; t - name table used for OAM props
|
||
SprGfxProps = $0E60
|
||
|
||
; Direction of sprite collision with wall
|
||
SprCollision = $0E70
|
||
|
||
; Used in sprite state 0x03 (falling in water)
|
||
; used as delay in most of the sprites
|
||
SprDelay = $0E80
|
||
|
||
; Definitely closely tied to the process of a sprite taking damage.
|
||
; Seems to serve as a palette cycling index, or a state variable.
|
||
; When this value is positive
|
||
; 0x80 - Signal that the recoil process has finished
|
||
; and will terminate during this frame.
|
||
SprRecoil = $0EA0 ; Recoil Timer
|
||
|
||
; abbbbbbb:
|
||
; a - start death timer
|
||
; b - death timer
|
||
SprDeath = $0EF0
|
||
|
||
SprYRecoil = $0F30
|
||
SprXRecoil = $0F40
|
||
|
||
; DIWS UUUU
|
||
; D - boss death
|
||
; I - Impervious to all attacks
|
||
; W - Water slash
|
||
; S - Draw Shadow
|
||
; U - Unused
|
||
SprProps = $0F50
|
||
|
||
; ISPH HHHH
|
||
; I - ignore collisions
|
||
; S - Statis (not alive eg beamos)
|
||
; P - Persist code still run outside of camera
|
||
; H - Hitbox
|
||
SprHitbox = $0F60
|
||
SprHeight = $0F70 ; Distance from the shadow
|
||
SprHeightS = $0F90 ; Distance from the shadow subpixel
|
||
SprFreeze = $0FC1 ; Seems to freeze sprites
|
||
|
||
OAMPtr = $90
|
||
OAMPtrH = $92
|
||
|
||
OamBackup = $0FEC
|
||
|
||
DungeonMainCheck = $021B
|
||
SpriteRanCheck = $8E
|
||
|
||
; Primarily deals with bump damage
|
||
; tzpd bbbb
|
||
; t - TODO
|
||
; z - High priority target for bees to give hints
|
||
; p - Powder interaction (0: normal | 1: ignore)
|
||
; d - Behavior when a boss spawns (0: die | 1: live)
|
||
; b - bump damage class
|
||
; Bump damage classes are read from a table at $06F42D
|
||
; Each table entry has 3 values, for green, blue, and red mails
|
||
; class g b r
|
||
; 0x00 2 1 1
|
||
; 0x01 4 4 4
|
||
; 0x02 0 0 0
|
||
; 0x03 8 4 2
|
||
; 0x04 8 8 8
|
||
; 0x05 16 8 4
|
||
; 0x06 32 16 8
|
||
; 0x07 32 24 16
|
||
; 0x08 24 16 8
|
||
; 0x09 64 48 24
|
||
;
|
||
; Higher values are invalid, but here's what they are:
|
||
; 0x0A 169 48 32
|
||
; 0x0B 142 246 169
|
||
; 0x0C 144 133 71
|
||
; 0x0D 169 16 133
|
||
; 0x0E 70 169 33
|
||
; 0x0F 34 124 187
|
||
SprBump = $0CD2
|
||
|
||
; Damage sprite is enduring
|
||
SprDmgTaken = $0CE2
|
||
|
||
; Sprite Deflection Properties
|
||
; abcdefgh
|
||
; a - If set, sprite is active
|
||
; b - Same as bit 'a' for Zora.
|
||
; c - Never queried, pushable interaction flag
|
||
; d - If hit from front, deflect Ice Rod, Somarian missile,
|
||
; boomerang, hookshot, and sword beam, and arrows stick in
|
||
; it harmlessly. If bit 1 is also set, frontal arrows will
|
||
; instead disappear harmlessly. No monsters have bit 4 set
|
||
; in the ROM data, but it was functional and interesting
|
||
; enough to include.
|
||
; e - If set, sprite collides with less tiles than usual
|
||
; f - If set, impervious to sword and hammer type attacks
|
||
; g - If set, impervious to arrows, but may have other additional meanings.
|
||
; h - Handles behavior with previous deaths flagged in $7FDF80 (0: default | 1: ignore)
|
||
SprDefl = $0CAA
|
||
|
||
; iwbs pppp
|
||
; i - disable tile interaction
|
||
; w - something water
|
||
; b - sprite is blocked by shield
|
||
; s - taking damage sfx to use TODO name
|
||
; p - prize pack
|
||
SprPrize = $0BE0
|
||
|
||
; tttt a.bp
|
||
; t - tile interaction hitbox
|
||
; a - deflect arrows TODO VERIFY
|
||
; b - boss death
|
||
; p - Sprite ignores falling into a pit when frozen?
|
||
SprTileDie = $0B6B
|
||
|
||
SprPriority = $0B89
|
||
|
||
; For sprites that interact with speical objects (arrows in particular)
|
||
; the special object will identify its type to the sprite via this location.
|
||
SprSpecial = $0BB0
|
||
|
||
; If nonzero, ancillae do not interact with the sprite
|
||
; Bulletproof
|
||
SprBulletproof = $0BA0
|
||
|
||
SprRoom = $0C9A ;X W Contains the area or room id the sprite has been loaded in
|
||
SprDrop = $0CBA ;X W 00: Drop nothing, 01: drop normal key, 03: Drop green rupee, OtherValues: Drop big key
|
||
|
||
; =========================================================
|
||
|
||
; The record format for the low table is 4 bytes:
|
||
; byte OBJ*4+0: xxxxxxxx
|
||
; byte OBJ*4+1: yyyyyyyy
|
||
; byte OBJ*4+2: cccccccc
|
||
; byte OBJ*4+3: vhoopppN
|
||
|
||
; The record format for the high table is 2 bits:
|
||
; bit 0/2/4/6 of byte OBJ/4: X
|
||
; bit 1/3/5/7 of byte OBJ/4: s
|
||
|
||
; Xxxxxxxxx = X position of the sprite. signed but see below.
|
||
; yyyyyyyy = Y position of the sprite.
|
||
; cccccccc = First tile of the sprite.
|
||
; N = Name table of the sprite. See below for VRAM address calculation
|
||
; ppp = Palette of the sprite. The first palette index is 128+ppp*16.
|
||
; oo = Sprite priority. See below for details.
|
||
; h/v = Horizontal/Vertical flip flags.
|
||
; s = Sprite size flag. See below for details.
|
||
|
||
SpriteData_OAMProp = $0DB359
|
||
|
||
; Clear all properties for sprites
|
||
SpritePrep_ResetProperties = $0DB871
|
||
|
||
; =========================================================
|
||
; set the oam coordinate for the sprite draw
|
||
Sprite_PrepOamCoord = $06E416
|
||
|
||
; =========================================================
|
||
; Draw the sprite depending of the position of the player
|
||
; (if he has to be over or under link)
|
||
Sprite_OAM_AllocateDeferToPlayer = $06F864
|
||
|
||
OAM_AllocateFromRegionA = $0DBA80 ; Above
|
||
OAM_AllocateFromRegionB = $0DBA84 ; Below
|
||
OAM_AllocateFromRegionC = $0DBA88 ; Above
|
||
OAM_AllocateFromRegionD = $0DBA8C ; Above
|
||
OAM_AllocateFromRegionE = $0DBA90 ; Above
|
||
OAM_AllocateFromRegionF = $0DBA94 ; Above
|
||
|
||
Sprite_DrawMultiple_quantity_preset = $05DF70
|
||
|
||
; =========================================================
|
||
; check if the sprite is getting damage from player or items
|
||
Sprite_CheckDamageFromPlayer = $06F2AA
|
||
|
||
; =========================================================
|
||
; check if the sprite is touching the player to damage
|
||
Sprite_CheckDamageToPlayer = $06F121
|
||
|
||
; =========================================================
|
||
; damage the player everywhere on screen?
|
||
Sprite_AttemptDamageToPlayerPlusRecoil = $06F41F
|
||
|
||
; =========================================================
|
||
; makes all the sprites on screen shaking
|
||
ApplyRumbleToSprites = $0680FA
|
||
|
||
; =========================================================
|
||
; args:
|
||
; pos1_low = $00
|
||
; pos1_size = $02
|
||
; pos2_low = $04
|
||
; pos2_size = $06
|
||
; pos1_high = $08
|
||
; pos2_high = $0A
|
||
; ans_low = $0F
|
||
; ans_high = $0C
|
||
; returns carry clear if there was no overlap
|
||
CheckIfHitBoxesOverlap = $0683E6
|
||
|
||
; =========================================================
|
||
; $0FD8 = sprite's X coordinate
|
||
; $0FDA = sprite's Y coordinate
|
||
Sprite_Get_16_bit_Coords = $0684BD
|
||
|
||
; =========================================================
|
||
; load / draw a 16x16 sprite
|
||
Sprite_PrepAndDrawSingleLarge = $06DBF0
|
||
|
||
; =========================================================
|
||
; load / draw a 8x8 sprite
|
||
Sprite_PrepAndDrawSingleSmall = $06DBF8
|
||
|
||
; =========================================================
|
||
; draw shadow (requires additional oam allocation)
|
||
Sprite_DrawShadow = $06DC54
|
||
|
||
; =========================================================
|
||
; check if the sprite is colliding with a solid tile set $0E70, X
|
||
; ----udlr , u = up, d = down, l = left, r = right
|
||
Sprite_CheckTileCollision = $06E496
|
||
|
||
; =========================================================
|
||
; $00[0x02] - Entity Y coordinate
|
||
; $02[0x03?] - Entity X coordinate
|
||
; $0FA5
|
||
Sprite_GetTileAttr = $06E87B
|
||
|
||
; =========================================================
|
||
; check if the sprite is colliding with a solid sloped tile
|
||
Sprite_CheckSlopedTileCollision = $06E8FD
|
||
|
||
; =========================================================
|
||
; set the velocity x,y towards the player (A = speed)
|
||
Sprite_ApplySpeedTowardsPlayer = $06EA12
|
||
|
||
; =========================================================
|
||
; \return $0E is low byte of player_y_pos - sprite_y_pos
|
||
; \return $0F is low byte of player_x_pos - sprite_x_pos
|
||
Sprite_DirectionToFacePlayer = $06EAA0
|
||
|
||
; =========================================================
|
||
; if Link is to the left of the sprite, Y = 1, otherwise Y = 0.
|
||
Sprite_IsToRightOfPlayer = $06EACD
|
||
|
||
; =========================================================
|
||
; return Y=1 sprite is below player, otherwise Y = 0
|
||
Sprite_IsBelowPlayer = $06EAE4
|
||
|
||
; =========================================================
|
||
; $06 = sprite's Y coordinate
|
||
; $07 = sprite's X coordinate
|
||
Sprite_IsBelowLocation = $06EB1D
|
||
|
||
; =========================================================
|
||
; check damage done to player if they collide on same layer
|
||
Sprite_CheckDamageToPlayerSameLayer = $06F129
|
||
|
||
; =========================================================
|
||
; check damage done to player if they collide even if they are not on same layer
|
||
Sprite_CheckDamageToPlayerIgnoreLayer = $06F131
|
||
|
||
; =========================================================
|
||
; play a sound loaded in A
|
||
Sound_SetSfx1PanLong = $0DBB6E
|
||
Sound_SetSfx2PanLong = $0DBB7C
|
||
Sound_SetSfx3PanLong = $0DBB8A
|
||
|
||
; =========================================================
|
||
; spawn a new sprite on screen, A = sprite id
|
||
; when using this function you have to set the position yourself
|
||
; these values belong to the sprite who used that function not the new one
|
||
; $00 low x, $01 high x
|
||
; $02 low y, $03 high y
|
||
; $04 height, $05 low x (overlord)
|
||
; $06 high x (overlord), $07 low y (overlord)
|
||
; $08 high y (overlord)
|
||
Sprite_SpawnDynamically = $1DF65D
|
||
|
||
Sprite_SetSpawnedCoords = $09AE64
|
||
Sprite_SetSpawnedCoordinates = $09AE64
|
||
|
||
; =========================================================
|
||
; move the sprite if he stand on a conveyor belt
|
||
Sprite_ApplyConveyorAdjustment = $1D8010
|
||
|
||
; =========================================================
|
||
; Setup sprite hitbox for comparison with scrap ram
|
||
Sprite_SetupHitBoxLong = $0683EA
|
||
|
||
; =========================================================
|
||
; set tile of dungeon
|
||
Dungeon_SpriteInducedTilemapUpdate = $01E7A9
|
||
|
||
; =========================================================
|
||
; player can't pass through the sprite
|
||
Sprite_PlayerCantPassThrough = $1EF4F3
|
||
|
||
; =========================================================
|
||
; player can't hookshot to that sprite
|
||
Sprite_NullifyHookshotDrag = $0FF540
|
||
|
||
; =========================================================
|
||
; show a message box without any condition
|
||
; A = low byte of message ID to use.
|
||
; Y = high byte of message ID to use.
|
||
Sprite_ShowMessageUnconditional = $05E219
|
||
|
||
|
||
; =========================================================
|
||
; show a message if we press A and face the sprite
|
||
; A = low byte of message ID to use.
|
||
; Y = high byte of message ID to use.
|
||
Sprite_ShowSolicitedMessageIfPlayerFacing = $05E1A7
|
||
|
||
; =========================================================
|
||
; show a message if we touch the sprite
|
||
; should be used with Sprite_PlayerCantPassThrough
|
||
; A = low byte of message ID to use.
|
||
; Y = high byte of message ID to use.
|
||
Sprite_ShowMessageFromPlayerContact = $05E1F0
|
||
|
||
; Parameters: Stack, A
|
||
UseImplicitRegIndexedLocalJumpTable = $008781
|
||
|
||
EnableForceBlank = $00893D
|
||
|
||
Snitch_SpawnGuard = $09C02F
|
||
|
||
Sprite_KillFriends = $09EF56
|
||
|
||
Sprite_KillSelf = $09F1F8
|
||
|
||
; =========================================================
|
||
; $04 = X
|
||
; $05 = HighX
|
||
; $06 = Y
|
||
; $07 = HighY
|
||
; A = Speed
|
||
; \return $00 - Y Velocity
|
||
; \return $01 - X Velocity
|
||
|
||
Sprite_ProjectSpeedTowardsEntityLong = $06EA22
|
||
|
||
; =========================================================
|
||
; Misc long functions
|
||
|
||
GetRandomInt = $0DBA71
|
||
|
||
Sprite_SpawnFireball = $0DDA06
|
||
|
||
Sprite_MoveLong = $1D808C
|
||
|
||
Sprite_DrawRippleIfInWater = $1EFF8D
|
||
|
||
SpriteDraw_WaterRipple = $059FFA
|
||
|
||
Sprite_SpawnSmallSplash = $1EA820
|
||
|
||
Sprite_SpawnSparkleGarnish = $058008
|
||
|
||
Sprite_ProjectSpeedTowardsPlayer = $06EA1A
|
||
|
||
Sprite_CheckDamageFromPlayerLong = $06F2AA
|
||
|
||
Sprite_CheckIfLifted = $06AA0C
|
||
|
||
Sprite_TransmuteToBomb = $06AD50
|
||
|
||
Guard_ParrySwordAttacks = $06EB5E
|
||
|
||
ThrownSprite_TileAndSpriteInteraction_long = $06DFF2
|
||
|
||
Sprite_RepelDash = $079291
|
||
|
||
; =========================================================
|
||
; Local functions which may be useful for sprites
|
||
; Sprite_AttemptZapDamage - 06EC02
|
||
|
||
; =========================================================
|
||
; Misc RAM
|
||
|
||
FrameCounter = $1A ; value that is increasing every frame
|
||
Indoor = $1B ; 0: outside, 1: indoor
|
||
UpdPalFlag = $15 ; Update all palettes $7EC500-$7EC700 if non-zero
|
||
|
||
RoomIndex = $A0 ; Return the current room ID
|
||
AreaIndex = $8A ; Return the current overworld area ID
|
||
|
||
; set the mosaic setting ($2106) XXXXDCBA
|
||
; [ABCD BG1/BG2/BG3/BG4][X size of the mosaic pixels 0-16]
|
||
Mosaic = $95
|
||
|
||
; Underworld:
|
||
; Flags sprite deaths in underworld based on slot.
|
||
; Indexed by 2 * room ID.
|
||
; Overworld:
|
||
; Holds ID+1 of sprite with each position being assigned a unique byte
|
||
; 0x00 indicates no sprite in this slot
|
||
UWDEATH = $7FDF80
|
||
|
||
; =========================================================
|
||
; Controllers
|
||
|
||
; BYSTUDLR
|
||
; [B BButton][Y YButton]
|
||
; [SSelect Button][TStart Button]
|
||
; [UDLR dpad buttons Up, Down, Left, Right]
|
||
RawJoypad1L = $F0
|
||
; AXLRIIII
|
||
; [A AButton][X Xbutton][L LButton][R RButton][I = controller ID]
|
||
RawJoypad1H = $F2
|
||
|
||
; BYSTUDLR
|
||
; [B BButton][Y YButton]
|
||
; [SSelect Button][TStart Button]
|
||
; [UDLR dpad buttons Up, Down, Left, Right]
|
||
PressPad1L = $F4
|
||
|
||
; AXLRIIII
|
||
; [A AButton][X Xbutton]
|
||
; [L LButton][R RButton][I = controller ID]
|
||
PressPad1H = $F6
|
||
|
||
ButtonAFlag = $3B ; bit7: Button A is down (A-------)
|
||
|
||
|
||
; =========================================================
|
||
; Link RAM and Functions
|
||
|
||
LinkY = $20 ; Position Y of link
|
||
LinkYH = $21 ; High position Y of link
|
||
LinkX = $22 ; Position X of link
|
||
LinkXH = $23 ; High position X of link
|
||
|
||
; ----UDLR
|
||
; [U Up][D Down][L Left][R Right]
|
||
; Direction link is pushing against
|
||
LinkPushDir = $26
|
||
|
||
; Link's subpixel velocity
|
||
; when this value overflows, Link's main velocity gains an extra pixel
|
||
; reset on direction change, so not really a positional subpixel
|
||
LinkSubVelY = $2A
|
||
LinkSubVelX = $2B
|
||
|
||
; Direction link is facing
|
||
; 00:Up, 02:Down, 04:Left, 06:Right
|
||
LinkFaceDir = $2F
|
||
|
||
; Last direction link moved towards
|
||
; 00:Up, 01:Down, 02:Left, 03:Right
|
||
LinkLastDir = $66
|
||
|
||
; ----UDLR
|
||
; [U Up][D Down][L Left][R Right]
|
||
; direction link is "walking towards"
|
||
LinkMoveDir = $67
|
||
|
||
; 0: Not moving, 1: Moving cardinal, 2: Moving diagonally
|
||
LinkMoveInfo = $6A
|
||
|
||
LinkRecoilY = $27 ; Recoiling speed Y of link
|
||
LinkRecoilX = $28 ; Recoiling speed X of link
|
||
|
||
LinkVisible = $4B ; if set to 0x0C link will be invisible
|
||
LinkBunnyGfx = $56 ; if set to 1 link will be bunny, otherwise link
|
||
|
||
; 0x00: normal speed, 0x01-0x0F: slow,<2C>> 0x10:fast
|
||
LinkSpeed = $57
|
||
|
||
; 0x00: normal speed, 0x02: walking on stair speed, 0x10: dashing speed
|
||
LinkSpeedTbl = $5E
|
||
|
||
; if is set to 0x02 or 0x03 link is falling
|
||
LinkFalling = $5B
|
||
|
||
; LinkState_Default : 0x00
|
||
; LinkState_Pits : 0x01
|
||
; LinkState_Recoil : 0x02
|
||
; LinkState_SpinAttack : 0x03
|
||
; LinkState_Swimming : 0x04
|
||
; LinkState_OnIce : 0x05
|
||
; LinkState_Recoil : 0x06
|
||
; LinkState_Zapped : 0x07
|
||
; LinkState_UsingEther : 0x08
|
||
; LinkState_UsingBombos : 0x09
|
||
; LinkState_UsingQuake : 0x0A
|
||
; LinkState_HoppingSouthOW : 0x0B
|
||
; LinkState_HoppingHorizontallyOW : 0x0C
|
||
; LinkState_HoppingDiagonallyUpOW : 0x0D
|
||
; LinkState_HoppingDiagonallyDownOW : 0x0E
|
||
; LinkState_0F : 0x0F
|
||
; LinkState_0F : 0x10
|
||
; LinkState_Dashing : 0x11
|
||
; LinkState_ExitingDash : 0x12
|
||
; LinkState_Hookshotting : 0x13
|
||
; LinkState_CrossingWorlds : 0x14
|
||
; LinkState_ShowingOffItem : 0x15
|
||
; LinkState_Sleeping : 0x16
|
||
; LinkState_Bunny : 0x17
|
||
; LinkState_HoldingBigRock : 0x18
|
||
; LinkState_ReceivingEther : 0x19
|
||
; LinkState_ReceivingBombos : 0x1A
|
||
; LinkState_ReadingDesertTablet : 0x1B
|
||
; LinkState_TemporaryBunny : 0x1C
|
||
; LinkState_TreePull : 0x1D
|
||
; LinkState_SpinAttack : 0x1E
|
||
LinkState = $5D
|
||
|
||
; 0: Link is not in a doorway
|
||
; 1: is in a vertical doorway
|
||
; 2: is in horizontal doorway
|
||
LinkDoorway = $6C
|
||
|
||
; 0: Nothing
|
||
; 1: a hand in the air
|
||
; 2: 2 hands in the air (like getting triforce)
|
||
LinkGrabGfx = $02DA
|
||
|
||
; if not 0 add a poof gfx on link
|
||
LinkPoofGfx = $02E1
|
||
|
||
; Bunny timer for link before transforming back
|
||
LinkBunTimer = $02E2
|
||
|
||
; if not 0 prevent link from moving and opening the menu
|
||
LinkMenuMove = $02E4
|
||
|
||
; if not 0 prevent link from getting any damages from sprites
|
||
LinkDamage = $037B
|
||
|
||
; ----CCCC
|
||
; [C Touching chest id]
|
||
LinkColChest = $02E5
|
||
|
||
; 0: Not on somaria platform, 2: On somaria platform
|
||
LinkSomaria = $02F5
|
||
|
||
; BP-AETHR
|
||
; [B Boomerang][P Powder]
|
||
; [A Bow&Arrows][E UnusedItem]
|
||
; [T UnusedItem][H Hammer][R Rods]
|
||
LinkItemUse = $0301
|
||
|
||
LinkItemY = $0303 ; Currently equipped item on the Y button
|
||
|
||
; 0: Nothing, 1:Picking up something, 2: Throwing something
|
||
LinkCarrying = $0308
|
||
|
||
; .... ..tl
|
||
; t - tossing object
|
||
; l - lifting object
|
||
LinkCarryOrToss = $0309
|
||
|
||
; 0: Normal
|
||
; 1: Shovel
|
||
; 2: Praying
|
||
; 4: Hookshot
|
||
; 8: Somaria
|
||
; 10: Bug net
|
||
; 20: Read book
|
||
; 40: Tree pull
|
||
LinkAnim = $037A
|
||
|
||
LinkWallCheat = $037F ; If non zero can walk through walls
|
||
|
||
; =========================================================
|
||
|
||
Link_ReceiveItem = $0799AD ; Y = item id
|
||
|
||
Link_CancelDash = $0791B9
|
||
|
||
Link_Initialize = $07F13C
|
||
Link_ResetProperties_A = $07F1A3
|
||
Link_ResetProperties_B = $07F1E6
|
||
Link_ResetProperties_C = $07F1FA
|
||
Link_ResetSwimmingState = $07983A
|
||
Link_ResetStateAfterDamagingPit = $07984B
|
||
Link_ItemReset_FromOverworldThings = $07B107
|
||
|
||
; Used by Agahnim2 fight
|
||
CallForDuckIndoors = $07A45F
|
||
|
||
ApplyLinksMovementToCamera = $07E9D3
|
||
|
||
HandleIndoorCameraAndDoors = $07F42F
|
||
|
||
Link_HandleVelocityAndSandDrag = $07E3DD
|
||
|
||
Link_HandleMovingAnimation_FullLongEntry = $07E6A6
|
||
Link_HandleMovingAnimation_General = $07E765
|
||
Link_HandleMovingAnimationSwimming = $07E7FA
|
||
|
||
LinkHop_FindArbitraryLandingSpot = $07E370
|
||
|
||
HandleFollowersAfterMirroring = $07AAA2
|
||
|
||
TileDetect_BigArea_long = $07CF0A
|
||
|
||
Hookshot_CheckTileCollision = $07D576
|
||
|
||
|
||
; =========================================================
|
||
; Ancilla
|
||
|
||
AnciOAMPrior = $0280 ; Ancilla oam priority if non zero use highest priority for draw
|
||
AnciColTimer = $028A ; Ancilla collision timer to prevent doing collision code too often set to 06 after a collision
|
||
AnciZSpeed = $0294 ; Ancilla Z Speed
|
||
AnciHeight = $029E ; Ancilla Height how far it is from its shadow
|
||
AnciHeightH = $02A8 ; Ancilla Height hight byte how far it is from its shadow
|
||
|
||
AnciMiscA = $0BF0 ; This can be used to do anything in ancilla
|
||
AnciMiscB = $0C54 ; This can be used to do anything in ancilla
|
||
AnciMiscC = $0C5E ; This can be used to do anything in ancilla (often used to track item received)
|
||
AnciMiscD = $0C72 ; This can be used to do anything in ancilla (often used to track direction)
|
||
|
||
AnciTimerA = $0C68 ; This is a timer, value is decreased by 1 every frame
|
||
|
||
AnciY = $0BFA ; Position Y of the ancilla (Up to Down)
|
||
AnciX = $0C04 ; Position X of the ancilla (Left to Right)
|
||
AnciYH = $0C0E ; High (often determine the room) Position Y of the ancilla (Up to Down)
|
||
AnciXH = $0C18 ; High (often determine the room) Position X of the ancilla (Left to Right)
|
||
AnciXSpeed = $0C22 ; Y Speed of the ancilla can go negative to go up
|
||
AnciYSpeed = $0C2C ; X Speed of the ancilla can go negative to go left
|
||
AnciLayer = $0C7C ; return the floor where the ancilla is
|
||
AnciOamBuf = $0C86 ; Oam buffer?
|
||
AnciOAMNbr = $0C90 ; Number of OAM slots used
|
||
|
||
AnciYsub = $0C36 ; sub pixel for Y position for ancilla
|
||
AnciXsub = $0C40 ; sub pixel for X position for ancilla
|
||
|
||
; Ancilla IDs
|
||
; db $00 ; 0x00 - NOTHING
|
||
; db $08 ; 0x01 - SOMARIA BULLET
|
||
; db $0C ; 0x02 - FIRE ROD SHOT
|
||
; db $10 ; 0x03 - UNUSED
|
||
; db $10 ; 0x04 - BEAM HIT
|
||
; db $04 ; 0x05 - BOOMERANG
|
||
; db $10 ; 0x06 - WALL HIT
|
||
; db $18 ; 0x07 - BOMB
|
||
; db $08 ; 0x08 - DOOR DEBRIS
|
||
; db $08 ; 0x09 - ARROW
|
||
; db $08 ; 0x0A - ARROW IN THE WALL
|
||
; db $00 ; 0x0B - ICE ROD SHOT
|
||
; db $14 ; 0x0C - SWORD BEAM_BOUNCE
|
||
; db $00 ; 0x0D - SPIN ATTACK FULL CHARGE SPARK
|
||
; db $10 ; 0x0E - BLAST WALL EXPLOSION
|
||
; db $28 ; 0x0F - BLAST WALL EXPLOSION
|
||
; db $18 ; 0x10 - BLAST WALL EXPLOSION
|
||
; db $10 ; 0x11 - ICE ROD WALL HIT
|
||
; db $10 ; 0x12 - BLAST WALL EXPLOSION
|
||
; db $10 ; 0x13 - ICE ROD SPARKLE
|
||
; db $10 ; 0x14 - BAD POINTER
|
||
; db $0C ; 0x15 - SPLASH
|
||
; db $08 ; 0x16 - HIT STARS
|
||
; db $08 ; 0x17 - SHOVEL DIRT
|
||
; db $50 ; 0x18 - ETHER SPELL
|
||
; db $00 ; 0x19 - BOMBOS SPELL
|
||
; db $10 ; 0x1A - POWDER DUST
|
||
; db $08 ; 0x1B - SWORD WALL HIT
|
||
; db $40 ; 0x1C - QUAKE SPELL
|
||
; db $00 ; 0x1D - SCREEN SHAKE
|
||
; db $0C ; 0x1E - DASH DUST
|
||
; db $24 ; 0x1F - HOOKSHOT
|
||
; db $10 ; 0x20 - BLANKET
|
||
; db $0C ; 0x21 - SNORE
|
||
; db $08 ; 0x22 - ITEM GET
|
||
; db $10 ; 0x23 - LINK POOF
|
||
; db $10 ; 0x24 - GRAVESTONE
|
||
; db $04 ; 0x25 - BAD POINTER
|
||
; db $0C ; 0x26 - SWORD SWING SPARKLE
|
||
; db $1C ; 0x27 - DUCK
|
||
; db $00 ; 0x28 - WISH POND ITEM
|
||
; db $10 ; 0x29 - MILESTONE ITEM GET
|
||
; db $14 ; 0x2A - SPIN ATTACK SPARKLE A
|
||
; db $14 ; 0x2B - SPIN ATTACK SPARKLE B
|
||
; db $10 ; 0x2C - SOMARIA BLOCK
|
||
; db $08 ; 0x2D - SOMARIA BLOCK FIZZ
|
||
; db $20 ; 0x2E - SOMARIA BLOCK FISSION
|
||
; db $10 ; 0x2F - LAMP FLAME
|
||
; db $10 ; 0x30 - BYRNA WINDUP SPARK
|
||
; db $10 ; 0x31 - BYRNA SPARK
|
||
; db $04 ; 0x32 - BLAST WALL FIREBALL
|
||
; db $00 ; 0x33 - BLAST WALL EXPLOSION
|
||
; db $80 ; 0x34 - SKULL WOODS FIRE
|
||
; db $10 ; 0x35 - MASTER SWORD GET
|
||
; db $04 ; 0x36 - FLUTE
|
||
; db $30 ; 0x37 - WEATHERVANE EXPLOSION
|
||
; db $14 ; 0x38 - CUTSCENE DUCK
|
||
; db $10 ; 0x39 - SOMARIA PLATFORM POOF
|
||
; db $00 ; 0x3A - BIG BOMB EXPLOSION
|
||
; db $10 ; 0x3B - SWORD UP SPARKLE
|
||
; db $00 ; 0x3C - SPIN ATTACK CHARGE SPARKLE
|
||
; db $00 ; 0x3D - ITEM SPLASH
|
||
; db $08 ; 0x3E - RISING CRYSTAL
|
||
; db $00 ; 0x3F - BUSH POOF
|
||
; db $10 ; 0x40 - DWARF POOF
|
||
; db $08 ; 0x41 - WATERFALL SPLASH
|
||
; db $78 ; 0x42 - HAPPINESS POND RUPEES
|
||
; db $80 ; 0x43 - GANONS TOWER CUTSCENE
|
||
AnciType = $0C4A
|
||
|
||
AncillaInit_SetCoordsAndExit = $0980C3
|
||
|
||
AncillaAdd_Snoring = $0980C8
|
||
AncillaAdd_Bomb = $09811F
|
||
AncillaAdd_Boomerang = $09820F
|
||
AncillaAdd_BoomerangAsClink = $098345
|
||
AddHappinessPondRupees = $098AE0
|
||
AncillaAdd_DugUpFlute = $098C73
|
||
AncillaAdd_ChargedSpinAttackSparkle = $098CB1
|
||
AncillaAdd_ExplodingWeatherVane = $098D11
|
||
AncillaAdd_CutsceneDuck = $098D90
|
||
AncillaAdd_SomariaPlatformPoof = $098DD2
|
||
AncillaAdd_SuperBombExplosion = $098DF9
|
||
ConfigureRevivalAncillae = $098E4E
|
||
AncillaAdd_CaneOfByrnaInitSpark = $098EE0
|
||
AncillaAdd_LampFlame = $098F1C
|
||
AncillaAdd_ShovelDirt = $098F5B
|
||
AncillaAdd_BlastWallFireball = $099031
|
||
AncillaAdd_Arrow = $0990A4
|
||
AncillaAdd_CapePoof = $09912C
|
||
AncillaAdd_BushPoof = $0991C3
|
||
AncillaAdd_EtherSpell = $0991FC
|
||
AncillaAdd_VictorySpin = $0992AC
|
||
AncillaAdd_MagicPowder = $0992F0
|
||
AncillaAdd_WallTapSpark = $099395
|
||
AncillaAdd_SwordSwingSparkle = $0993C2
|
||
AncillaAdd_QuakeSpell = $099589
|
||
AncillaAdd_IceRodShot = $099863
|
||
AncillaAdd_Splash = $0998FC
|
||
|
||
DeleteBoomAndByrnaSparks = $0FFD86 |