Enemizer migration

This commit is contained in:
aerinon
2022-09-20 16:38:20 -06:00
parent 6b853222f2
commit 5e93e59727
27 changed files with 1133 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
;================================================================================
; NMI Hook
;--------------------------------------------------------------------------------
; rando already hooks the Bank00.asm : 164 (PHA : PHX : PHY : PHD : PHB) so we have to hook after that
org $0080D0 ; <- D0 - Bank00.asm : 164-167 (PHB, LDA.w #$0000)
JML.l NMIHookAction
org $0080D5 ; <- D5 - Bank00.asm : 164-167 (PHB, LDA.w #$0000)
NMIHookReturn:
;--------------------------------------------------------------------------------

View File

@@ -0,0 +1,13 @@
;================================================================================
; Blind Boss fight
;--------------------------------------------------------------------------------
org $1DA081 ; Original Code
JML check_blind_boss_room
Check_for_Blind_Fight:
org $1DA090
Initialize_Blind_Fight:

View File

@@ -0,0 +1,11 @@
;================================================================================
; Blind door close
;--------------------------------------------------------------------------------
;
org $028849 ; Bank02.asm(1588) - original code : JSL $078000 //Hook on player main when transition are over execute player code
JSL check_special_action ;using the variable 7E0CF3 if it not 00 then trap the player in that room
;could be changed easily to support more than only 1 function
;--------------------------------------------------------------------------------
org $078000
Player_Main:

View File

@@ -0,0 +1,6 @@
;================================================================================
; Change heart container drop location
;--------------------------------------------------------------------------------
org $05EF62
JSL change_heartcontainer_position
;--------------------------------------------------------------------------------

View File

@@ -0,0 +1,210 @@
; ;================================================================================
; ; insert kholdstare & trinexx shell gfx file
; ;--------------------------------------------------------------------------------
; ; pc file address = 0x123000
; org $24B000
; GFX_Kholdstare_Shell:
; incbin shell.gfx
; warnpc $24C001 ; should have written 0x1000 bytes and apparently we need to go 1 past that or it'll yell at us
; org $24C000
; GFX_Trinexx_Shell:
; incbin rocks.gfx
; warnpc $24C801
; GFX_Trinexx_Shell2:
; incbin rocks2.gfx
; warnpc $24C8C1
; ;--------------------------------------------------------------------------------
; ; *$4C290-$4C2D4 LOCAL
; Dungeon_LoadSprites:
; *$4C114-$4C174 LONG
org $9C114
Dungeon_ResetSprites: ; Bank09.asm(822)
; *$4C44E-$4C498 LONG
org $9C44E
Sprite_ResetAll: ; Bank09.asm(1344)
;================================================================================
; fix skull woods gibdo key drop
;--------------------------------------------------------------------------------
;Gibdo key drop hardcoded in skullwoods to fix problems
;some bosses are dropping a key when there's a key drop avaiable in
;the previous room
; org $09DD74 ; Gibdo draw code (JSL Sprite_DrawShadowLong)
; db #$00, #$00 ; Remove key drop in skull woods
; org $1EBB37 ; Gibdo draw code (JSL Sprite_DrawShadowLong)
; JSL gibdo_drop_key
;--------------------------------------------------------------------------------
; todo make the boss data change dynamic
;================================================================================
; Move All Bosses Sprites in Top Left Quadrant
;--------------------------------------------------------------------------------
; sprite values for rooms, with coordinates changed
;Trinexx
org $09E5BA ; 0x4E5BA ; [0xB]
db $00 ; "Sort Spr" in Hyrule Magic
db $05, $07, $CB ; trinexx body? ; 15 07 CB
db $05, $07, $CC ; trinexx ice head? ; 15 07 CC
db $05, $07, $CD ; trinexx fire head? ; 15 07 CD
db $FF ; terminator
;Armos - Eastern
org $09E887 ; 0x4E887 ; [0x17]
db $00 ; "Sort Spr" in Hyrule Magic
db $05, $04, $53 ; armos ;15 14 53
db $05, $07, $53 ; armos ;15 17 53
db $05, $0A, $53 ; armos ;15 1A 53
db $08, $0A, $53 ; armos ;18 1A 53
db $08, $07, $53 ; armos ;18 17 53
db $08, $04, $53 ; armos ;18 14 53
db $08, $E7, $19 ; armos overlord ;18 F7 19
db $FF ; terminator
;Kholdstare
org $09EA01 ; 0x4EA01 ; [0xB]
db $00 ; "Sort Spr" in Hyrule Magic
db $05, $07, $A3 ; kholdstare shell ;05 17 A3
db $05, $07, $A4 ; fallling ice ;05 17 A4
db $05, $07, $A2 ; kholdstare ;05 17 A2
db $FF ; terminator
;Arrghus
org $09D997 ; 0x4D997 ; [0x2C]
db $00 ; "Sort Spr" in Hyrule Magic
db $07, $07, $8C ; arrghus ;17 07 8C
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $07, $07, $8D ; spawn ;17 07 8D
db $FF ; terminator
;Moldorm - ToH
org $09D9C3 ; 0x4D9C3 ; [0x5]
db $00 ; "Sort Spr" in Hyrule Magic
db $09, $09, $09 ; moldorm ;0E 12 09
db $FF ; terminator
;Mothula
org $09DC31 ; 0x4DC31 ; [0x5] (really [0x8])
db $00 ; "Sort Spr" in Hyrule Magic
db $06, $08, $88 ; mothula ;16 18 88
; truncated moving floor overlord ;16 E7 07
db $FF ; terminator
;Lanmolas - Desert
org $09DCCB ; 0x4DCCB ; [0xB]
db $00 ; "Sort Spr" in Hyrule Magic
db $07, $06, $54 ; lanmolas ;17 06 54
db $07, $09, $54 ; lanmolas ;17 09 54
db $09, $07, $54 ; lanmolas ;19 07 54
db $FF ; terminator
;Helmasaure
org $09E049 ; 0x4E049 ; [0x5]
db $00 ; "Sort Spr" in Hyrule Magic
db $06, $07, $92 ; helmasaur ;16 17 92
db $FF ; terminator
;Vitreous
org $09E457 ; 0x4E457 ; [0x5]
db $00 ; "Sort Spr" in Hyrule Magic
db $05, $07, $BD ; vitreous ;15 07 BD
db $FF ; terminator
;Blind
org $09E654 ; 0x4E654 ; [0x5]
db $00 ; "Sort Spr" in Hyrule Magic
db $05, $09, $CE ; blind ;15 19 CE
db $FF ; terminator
; Armos - GT ; this shouldn't get used unless boss randomization is turned off
org $09DB23 ; 0x4DB23 ; [0x23] // need 0x38 to fit arrghus+spawn and fairies (use 0x4D87E-)
db $00
db $05, $04, $53 ; armos ;15 14 53
db $05, $07, $53 ; armos ;15 17 53
db $05, $0A, $53 ; armos ;15 1A 53
db $08, $0A, $53 ; armos ;18 1A 53
db $08, $07, $53 ; armos ;18 17 53
db $08, $04, $53 ; armos ;18 14 53
db $08, $E7, $19 ; armos overlord ;18 F7 19
db $07, $07, $E3 ; fairy ;07 07 E3
db $07, $08, $E3 ; fairy ;07 08 E3
db $08, $07, $E3 ; fairy ;08 07 E3
db $08, $08, $E3 ; fairy ;08 08 E3
db $FF
; Lanmola - GT ; this shouldn't get used unless boss randomization is turned off
org $09E1BE ; 0x4E1BE ; [0x11] // need 0x32 to fit arrghus+spawn and bunny beam+medusa (use 0x4D8B6-)
db $00
db $07, $06, $54 ; lanmolas ;17 06 54
db $07, $09, $54 ; lanmolas ;17 09 54
db $09, $07, $54 ; lanmolas ;19 07 54
db $18, $17, $D1 ; bunny beam ;18 17 D1
db $1C, $03, $C5 ; medusa ;1C 03 C5
db $FF
; Moldorm - GT ; this shouldn't get used unless boss randomization is turned off
org $09DF1E ; 0x4DF1E ; [0x5]
db $00 ; "Sort Spr" in Hyrule Magic
db $09, $09, $09 ; moldorm ;0E 12 09
db $FF ; terminator
;--------------------------------------------------------------------------------
;================================================================================
; On Room Transition -> Move Sprite depending on the room loaded
;--------------------------------------------------------------------------------
org $028979 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move
org $028C16 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move
org $029338 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move
org $028256 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move
;--------------------------------------------------------------------------------
; todo make arghuss room change dynamic
;================================================================================
; water tiles removed in arrghus room
;--------------------------------------------------------------------------------
org $1FA15C
db $FF, $FF, $FF, $FF, $F0, $FF, $61, $18, $FF, $FF
; Arrghus can stand on ground
org $0DB6BE
db $00
;--------------------------------------------------------------------------------
;================================================================================
; Draw kholdstare shell
;--------------------------------------------------------------------------------
org $0DD97F ; jump point
Kholdstare_Draw:
org $1E9518 ; sprite_kholdstare.asm (154) : JSL Kholdstare_Draw
JSL new_kholdstare_code ; Write new gfx in the vram
;--------------------------------------------------------------------------------
;================================================================================
; Draw trinexx shell
;--------------------------------------------------------------------------------
org $1DAD67 ; sprite_trinexx.asm (62) : LDA.b #$03 : STA $0DC0, X
JSL new_trinexx_code
;--------------------------------------------------------------------------------

View File

@@ -0,0 +1,8 @@
;================================================================================
; New bush mob randomization
;--------------------------------------------------------------------------------
org $068279
NOP #$0A
JSL sprite_bush_spawn
NOP ; we keep the branch
;--------------------------------------------------------------------------------

View File

@@ -0,0 +1,12 @@
org $780CA ; Bank07.asm(179)
JSL CheckIfLinkShouldDie : NOP : NOP : NOP
;SEC : SBC.b $00 : CMP #$00 : BEQ .linkIsDead ; Bank07.asm(179) -
org $780D1
BNE linkNotDead : NOP : NOP ; Bank07.asm(183) - CMP.b #$A8 : BCC .linkNotDead
org $780D5
linkIsDead:
org $780F7
linkNotDead:

View File

@@ -0,0 +1,9 @@
newKodongoCollision:
{
LDA $0DE0, X : INC A : AND.b #$03 : STA $0DE0, X
;If they collide more than 32time then kill them !
LDA $0DA0, X : INC A : STA $0DA0, X : CMP #$20 : BCC .continue
STZ $0DD0, X
.continue
RTL
}

View File

@@ -0,0 +1,3 @@
org $1EC147
JSL newKodongoCollision
NOP #$05

View File

@@ -0,0 +1,39 @@
;Hooks
; sprite_prep.asm (2466) -> SpritePrep_EyegoreTrampoline:
org $0691B6 ; 0311B6 1E:C6FA? ; SpriteActive3_Transfer?
JSL SpritePrep_EyegoreNew ;set eyegore to be only eyegore
; sprite_prep.asm (203) -> dw SpritePrep_DoNothing ; 0xB8 - Dialogue Testing Sprite
org $0687CB ; 0307CB replace debugged sprite create by eyegore
dw #$91B6 ; SpritePrep_Eyegore jump table
; Bank1E.asm (140) -> dw Sprite_DialogueTester ; 0xB8 - debug artifact, dialogue tester
org $1E8BB1
dw #$C795 ;Sprite_Eyegore jump table
; table starts at 6B8F1
org $0DB9A9
db $00 ; sprite B8 needs a damage type
org $06EC08 ; Bank06.asm (4593) - damage calcs
{
JSL resetSprite_Mimic
NOP
}
org $06EDA6 ; Bank06.asm (4876) - .notItemSprite
{
; original
; REP #$20 : ASL #4 : ORA $0CF2 : PHX : REP #$10 : TAX ;C2 20 : 0A 0A 0A 0A : 0D F2 0C : DA : C2 10 : AA
; SEP #$20 ;E2 20
; LDA $7F6000, X : STA $02 ;BF 00 60 7F : 85 02
; SEP #$10
JSL notItemSprite_Mimic ; C2 20 : 0A 0A
;NOP : NOP : NOP : NOP : NOP : NOP : NOP : NOP : NOP ; 0A 0A : 0D F2 0C : DA : C2 10 : AA
;NOP : NOP ; E2 20
;NOP : NOP : NOP : NOP : NOP : NOP ; BF 00 60 7F : 85 02
;NOP ;
}

View File

@@ -0,0 +1,20 @@
; adjust oam position after drawing eyes
;ED88E
org $1DD88E
{
; original: GiantMoldorm_Draw+5lines (sprite_giant_moldorm.asm)
; lda $90 : add.w #$0008 : sta $90
; INC $92 : INC $92
JSL Moldorm_UpdateOamPosition
NOP #08
}
; set number of eyes
org $1DDBB2 ;$0EDBB2
{
; LDX.b #$01
; number of eyes (-1)
;0EDBB2 0EDBB3
LDX.b #$07
}

View File

@@ -0,0 +1,54 @@
org $9C50B ; 0x4C50B
{
; .loadData
; ; $4C50B-
; STA $01 ; 85 01
; ; $4C50D-
; LDY.w #$0000 ; A0 00 00
JSL LoadOverworldSprites
NOP
}
org $9C510 ; 0x4C510
LDA [$00], Y ; replace LDA ($00), Y
; CMP.b #$FF : BEQ .stopLoading
; INY #2
org $9C518 ; 0x4C518
LDA [$00], Y ; replace LDA ($00), Y
; DEY #2 : CMP.b #$F4 : BNE .notFallingRocks
; INC $0FFD
; INY #3
; BRA .nextSprite
; .notFallingRocks ; Anything other than falling rocks.
org $9C528 ; 0x4C528
LDA [$00], Y ; replace LDA ($00), Y
; PHA : LSR #4 : ASL #2 :
org $9C531 ; 0x4C531
STA $0A ; STA $02
; INY
org $9C534 ; 0x4C534
LDA [$00], Y ; replace LDA ($00), Y
; LSR #4 : CLC
org $9C53B ; 0x4C53B
ADC $0A ; ADC $02
; STA $06
; PLA : ASL #4 : STA $07
org $9C546 ; 0x4C546
LDA [$00], Y ; replace LDA ($00), Y
; AND.b #$0F : ORA $07 : STA $05
; INY
org $9C54F ; 0x4C54F
LDA [$00], Y ; replace LDA ($00), Y
; LDX $05 : INC A : STA $7FDF80, X
; ; $4C558-
; ; Move on to the next sprite / overlord.
; INY ; C8
; ; $4C559-
; BRA .nextSprite ; 80 B5
; .stopLoading
; ; $4C55B-
; SEP #$10 ; E2 10
; ; $4C55D-
; RTS ; 60