Applied labels and byte designators
This commit is contained in:
@@ -17,56 +17,56 @@
|
||||
macro DMA_VRAM(VRAM_HIGH,VRAM_LOW,SRC_BANK,SRC_HIGH,SRC_LOW,LENGTH_HIGH,LENGTH_LOW)
|
||||
PHA
|
||||
; --- preserve DMA registers ----------------------------------------------------
|
||||
LDA !DMA0_REG : PHA
|
||||
LDA !DMA0_DEST_REG : PHA
|
||||
LDA !DMA0_SRC_LOW_REG : PHA
|
||||
LDA !DMA0_SRC_HIGH_REG : PHA
|
||||
LDA !DMA0_SRC_BANK_REG : PHA
|
||||
LDA !DMA0_SIZE_LOW_REG : PHA
|
||||
LDA !DMA0_SIZE_HIGH_REG : PHA
|
||||
LDA.w !DMA0_REG : PHA
|
||||
LDA.w !DMA0_DEST_REG : PHA
|
||||
LDA.w !DMA0_SRC_LOW_REG : PHA
|
||||
LDA.w !DMA0_SRC_HIGH_REG : PHA
|
||||
LDA.w !DMA0_SRC_BANK_REG : PHA
|
||||
LDA.w !DMA0_SIZE_LOW_REG : PHA
|
||||
LDA.w !DMA0_SIZE_HIGH_REG : PHA
|
||||
; -------------------------------------------------------------------------------
|
||||
|
||||
;LDA.b #$80 : STA !DISP_REG ; force vblank
|
||||
LDA #$80 : STA !VMAIN_REG
|
||||
;LDA.b #$80 : STA.w !DISP_REG ; force vblank
|
||||
LDA.b #$80 : STA.w !VMAIN_REG
|
||||
|
||||
; write to vram at $<VRAM_HIGH><VRAM_LOW>
|
||||
LDA <VRAM_LOW> : STA !VRAM_LOW_REG ; Set VRAM destination address low byte
|
||||
LDA <VRAM_HIGH> : STA !VRAM_HIGH_REG ; Set VRAM destination address high byte
|
||||
LDA.b <VRAM_LOW> : STA.w !VRAM_LOW_REG ; Set VRAM destination address low byte
|
||||
LDA.b <VRAM_HIGH> : STA.w !VRAM_HIGH_REG ; Set VRAM destination address high byte
|
||||
|
||||
; Set DMA0 to write a word at a time.
|
||||
LDA #$01
|
||||
STA !DMA0_REG
|
||||
LDA.b #$01
|
||||
STA.w !DMA0_REG
|
||||
|
||||
; Write to $2118 & $2119 - VRAM Data Write Registers (Low) & VRAM Data Write Registers (High)
|
||||
; setting word write mode on DMA0_REG causes a write to $2118 and then $2119
|
||||
; $21xx is assumed
|
||||
LDA #$18
|
||||
STA !DMA0_DEST_REG
|
||||
LDA.b !VRAM_WRITE_REG
|
||||
STA.w !DMA0_DEST_REG
|
||||
|
||||
; Read from $<SRC_BANK>:<SRC_HIGH><SRC_LOW>.
|
||||
LDA.b <SRC_LOW>
|
||||
STA !DMA0_SRC_LOW_REG ; set src address low byte
|
||||
STA.w !DMA0_SRC_LOW_REG ; set src address low byte
|
||||
LDA.b <SRC_HIGH>
|
||||
STA !DMA0_SRC_HIGH_REG ; set src address high byte
|
||||
STA.w !DMA0_SRC_HIGH_REG ; set src address high byte
|
||||
LDA.b <SRC_BANK>
|
||||
STA !DMA0_SRC_BANK_REG ; set src address bank byte
|
||||
STA.w !DMA0_SRC_BANK_REG ; set src address bank byte
|
||||
|
||||
; total bytes to copy: #$1000 bytes.
|
||||
LDA <LENGTH_LOW> : STA $4305 ; length low byte
|
||||
LDA <LENGTH_HIGH> : STA $4306 ; length high byte
|
||||
LDA.b <LENGTH_LOW> : STA.w !DMA0_SIZE_LOW_REG ; length low byte
|
||||
LDA.b <LENGTH_HIGH> : STA.w !DMA0_SIZE_HIGH_REG ; length high byte
|
||||
|
||||
; start DMA on channel 0
|
||||
LDA #$01 ; channel select bitmask
|
||||
STA !DMA_ENABLE_REG
|
||||
LDA.b #$01 ; channel select bitmask
|
||||
STA.w !DMA_ENABLE_REG
|
||||
|
||||
; --- restore DMA registers -----------------------------------------------------
|
||||
PLA : STA !DMA0_SIZE_HIGH_REG
|
||||
PLA : STA !DMA0_SIZE_LOW_REG
|
||||
PLA : STA !DMA0_SRC_BANK_REG
|
||||
PLA : STA !DMA0_SRC_HIGH_REG
|
||||
PLA : STA !DMA0_SRC_LOW_REG
|
||||
PLA : STA !DMA0_DEST_REG
|
||||
PLA : STA !DMA0_REG
|
||||
PLA : STA.w !DMA0_SIZE_HIGH_REG
|
||||
PLA : STA.w !DMA0_SIZE_LOW_REG
|
||||
PLA : STA.w !DMA0_SRC_BANK_REG
|
||||
PLA : STA.w !DMA0_SRC_HIGH_REG
|
||||
PLA : STA.w !DMA0_SRC_LOW_REG
|
||||
PLA : STA.w !DMA0_DEST_REG
|
||||
PLA : STA.w !DMA0_REG
|
||||
; -------------------------------------------------------------------------------
|
||||
PLA
|
||||
endmacro
|
||||
|
||||
@@ -8,21 +8,21 @@ NMIHookActionEnemizer:
|
||||
|
||||
SEP #$20 ; get into 8-bit mode
|
||||
|
||||
LDA !SHELL_DMA_FLAG : BEQ .return ; check our draw flag
|
||||
AND #$01 : BNE .loadKholdstare
|
||||
LDA !SHELL_DMA_FLAG : AND #$02 : BNE .loadTrinexx
|
||||
LDA.l !SHELL_DMA_FLAG : BEQ .return ; check our draw flag
|
||||
AND.b #$01 : BNE .loadKholdstare
|
||||
LDA.l !SHELL_DMA_FLAG : AND.b #$02 : BNE .loadTrinexx
|
||||
BRA .return ; just in case
|
||||
;BIT #$01 : BEQ .loadKholdstare
|
||||
;BIT #$02 : BEQ .loadTrinexx
|
||||
;BIT.b #$01 : BEQ .loadKholdstare
|
||||
;BIT.b #$02 : BEQ .loadTrinexx
|
||||
|
||||
.loadKholdstare
|
||||
JSL DMAKholdstare
|
||||
LDA #$00 : STA !SHELL_DMA_FLAG ; clear our draw flag
|
||||
LDA.b #$00 : STA.l !SHELL_DMA_FLAG ; clear our draw flag
|
||||
BRA .return
|
||||
|
||||
.loadTrinexx
|
||||
JSL DMATrinexx
|
||||
LDA #$00 : STA !SHELL_DMA_FLAG ; clear our draw flag
|
||||
LDA.b #$00 : STA.l !SHELL_DMA_FLAG ; clear our draw flag
|
||||
|
||||
.return
|
||||
PLP
|
||||
@@ -33,7 +33,7 @@ NMIHookActionEnemizer:
|
||||
; Sets DP to $0000
|
||||
LDA.w #$0000 : TCD
|
||||
|
||||
JML.l NMIHookReturnEnemizer
|
||||
JML NMIHookReturnEnemizer
|
||||
}
|
||||
|
||||
DMAKholdstare:
|
||||
|
||||
@@ -14,10 +14,10 @@ Initialize_Blind_Fight:
|
||||
pullpc
|
||||
|
||||
check_blind_boss_room:
|
||||
LDA $A0 ; load room index (low byte)
|
||||
CMP #172 : BNE + ; Is is Thieves Town Boss Room
|
||||
LDA !BLIND_DOOR_FLAG : BNE + ; Blind maiden does not need rescuing
|
||||
LDA.b RoomIndex ; load room index (low byte)
|
||||
CMP.b #$AC : BNE + ; Is is Thieves Town Boss Room
|
||||
LDA.l !BLIND_DOOR_FLAG : BNE + ; Blind maiden does not need rescuing
|
||||
|
||||
LDA FollowerIndicator : JML Check_for_Blind_Fight
|
||||
LDA.l FollowerIndicator : JML Check_for_Blind_Fight
|
||||
+
|
||||
JML Initialize_Blind_Fight
|
||||
|
||||
@@ -5,15 +5,15 @@ change_heartcontainer_position:
|
||||
{
|
||||
PHA
|
||||
LDA.l !CENTER_BOSS_DROP_FLAG : BEQ .not_moldorm_room
|
||||
LDA.b #$78 : STA $0D10, X
|
||||
STA $0D00, X
|
||||
LDA.b #$78 : STA.w SpritePosXLow, X
|
||||
STA.w SpritePosYLow, X
|
||||
|
||||
LDA $23 : STA $0D30, X
|
||||
LDA $21 : STA $0D20, X
|
||||
LDA.b LinkPosX+1 : STA.w SpritePosXHigh, X
|
||||
LDA.b LinkPosY+1 : STA.w SpritePosYHigh, X
|
||||
|
||||
LDA $A0 : CMP #$07 : BNE .not_moldorm_room ; not moldorm room
|
||||
LDA $22 : STA $0D10, X
|
||||
LDA $20 : STA $0D00, X
|
||||
LDA.b RoomIndex : CMP.b #$07 : BNE .not_moldorm_room ; not moldorm room
|
||||
LDA.b LinkPosX : STA.w SpritePosXLow, X
|
||||
LDA.b LinkPosY : STA.w SpritePosYLow, X
|
||||
|
||||
.not_moldorm_room
|
||||
|
||||
|
||||
@@ -5,100 +5,100 @@ boss_move:
|
||||
{
|
||||
; TODO: should probably double check that we don't need to preserve registers (A,X)...
|
||||
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
LDA $A0 ; load room index (low byte)
|
||||
LDX $A1 ; (high byte)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
LDA.b RoomIndex ; load room index (low byte)
|
||||
LDX.b RoomIndex+1 ; (high byte)
|
||||
|
||||
CMP #7 : BNE + ; Is is Hera Tower Boss Room
|
||||
CPX #$00 : BNE +
|
||||
CMP.b #7 : BNE + ; Is it Hera Tower Boss Room
|
||||
CPX.b #$00 : BNE +
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_middle
|
||||
+
|
||||
|
||||
CMP #200 : BNE + ; Is is Eastern Palace Boss Room
|
||||
CMP.b #200 : BNE + ; Is it Eastern Palace Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_right
|
||||
+
|
||||
|
||||
CMP #41 : BNE + ; Is is Skull Woods Boss Room
|
||||
CMP.b #41 : BNE + ; Is it Skull Woods Boss Room
|
||||
; TODO: Add moving floor sprite
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
LDA #$07 : STA $0B00;Spawn the moving floor sprite
|
||||
STZ $0B28
|
||||
INC $0B08
|
||||
LDA.b #$07 : STA.w $0B00 ;Spawn the moving floor sprite
|
||||
STZ.w $0B28
|
||||
INC.w OverlordXLow
|
||||
BRL .move_to_bottom_right
|
||||
+
|
||||
|
||||
CMP #51 : BNE + ; Is is Desert Palace Boss Room
|
||||
CMP.b #51 : BNE + ; Is it Desert Palace Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_left
|
||||
+
|
||||
|
||||
CMP #90 : BNE + ; Is is Palace of darkness Boss Room
|
||||
CMP.b #90 : BNE + ; Is it Palace of darkness Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_right
|
||||
+
|
||||
|
||||
CMP #144 : BNE + ; Is is Misery Mire Boss Room
|
||||
CMP.b #144 : BNE + ; Is it Misery Mire Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_left
|
||||
+
|
||||
|
||||
CMP #172 : BNE + ; Is is Thieve Town Boss Room
|
||||
CMP.b #172 : BNE + ; Is it Thieve Town Boss Room
|
||||
; IF MAIDEN IS NOT RESCUED -> DO NOTHING
|
||||
; IF MAIDEN IS ALREADY RESCUED -> spawn sprites normally
|
||||
JSL Sprite_ResetAll ; removes sprites in thieve town boss room
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
;Close the door if !BLIND_DOOR_FLAG == 1
|
||||
LDA !BLIND_DOOR_FLAG : BEQ .no_blind_door
|
||||
INC $0468 ; $0468[0x02] - Flag that is set when trap doors are down.
|
||||
STZ $068E ; $068E[0x02] - (Dungeon) ???? related to trap doors and if they are open ; possibly bomb doors too? Update: module 0x07.0x4 probably uses this to know whether it's a key door or big key door to open.
|
||||
STZ $0690 ; $0690[0x02] - (Overworld) Generally is used as an animation step indicator, only for doors that animate when they open, such as the Santuary and Hyrule Castle doors. This variable is incremented up to a value of 3, at which point a logic check kicks in and stops animating the opening of a door.
|
||||
INC $0CF3 ; $0CF3[0x01] - free ram
|
||||
LDA.l !BLIND_DOOR_FLAG : BEQ .no_blind_door
|
||||
INC.w TrapDoorFlag
|
||||
STZ.w TileMapDoorPos
|
||||
STZ.w DoorTimer
|
||||
INC.w BossSpecialAction
|
||||
; ;That must be called after the room load!
|
||||
.no_blind_door
|
||||
BRL .move_to_bottom_right
|
||||
+
|
||||
|
||||
CMP #6 : BNE + ; Is is Swamp Palace Boss Room
|
||||
CPX #$00 : BNE +
|
||||
CMP.b #6 : BNE + ; Is it Swamp Palace Boss Room
|
||||
CPX.b #$00 : BNE +
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_left
|
||||
+
|
||||
|
||||
CMP #222 : BNE + ; Is is Ice Palace Boss Room
|
||||
CMP.b #222 : BNE + ; Is it Ice Palace Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_top_right
|
||||
+
|
||||
|
||||
CMP #164 : BNE + ; Is is Turtle Rock Boss Room
|
||||
CMP.b #164 : BNE + ; Is it Turtle Rock Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_left
|
||||
+
|
||||
|
||||
CMP #28 : BNE + ; Is is Gtower (Armos2) Boss Room
|
||||
CPX #$00 : BNE +
|
||||
CMP.b #28 : BNE + ; Is it Gtower (Armos2) Boss Room
|
||||
CPX.b #$00 : BNE +
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_right
|
||||
+
|
||||
|
||||
CMP #108 : BNE + ; Is is Gtower (Lanmo2) Boss Room
|
||||
CMP.b #108 : BNE + ; Is it Gtower (Lanmo2) Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_bottom_left
|
||||
+
|
||||
|
||||
CMP #77 : BNE + ; Is is Gtower (Moldorm2) Boss Room
|
||||
CMP.b #77 : BNE + ; Is it Gtower (Moldorm2) Boss Room
|
||||
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
|
||||
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
|
||||
BRL .move_to_middle
|
||||
@@ -120,106 +120,106 @@ boss_move:
|
||||
|
||||
.move_to_middle
|
||||
;load all sprite of that room and overlord
|
||||
LDX #$00
|
||||
LDX.b #$00
|
||||
|
||||
.loop_middle ; move sprites
|
||||
LDA $0E20, X
|
||||
LDA.w SpriteTypeTable, X
|
||||
JSR ShouldMoveSprite : BCC .no_change
|
||||
LDA $0D10, X : !ADD #$68 : STA $0D10, X
|
||||
LDA $0D00, X : !ADD #$68 : STA $0D00, X
|
||||
LDA.w SpritePosXLow, X : !ADD.b #$68 : STA.w SpritePosXLow, X
|
||||
LDA.w SpritePosYLow, X : !ADD.b #$68 : STA.w SpritePosYLow, X
|
||||
|
||||
.no_change
|
||||
INX : CPX #$10 : BNE .loop_middle
|
||||
LDX #$00
|
||||
INX : CPX.b #$10 : BNE .loop_middle
|
||||
LDX.b #$00
|
||||
|
||||
.loop_middle2 ; move overlords
|
||||
LDA $0B00, X
|
||||
CMP #$E3 : BNE + ;is it moving floor?
|
||||
LDA.w $0B00, X
|
||||
CMP.b #$E3 : BNE + ;is it moving floor?
|
||||
BRA .no_change_ov
|
||||
+
|
||||
LDA $0B08, X : !ADD #$68 : STA $0B08, X
|
||||
LDA $0B18, X : !ADD #$68 : STA $0B18, X
|
||||
LDA.w OverlordXLow, X : !ADD.b #$68 : STA.w OverlordXLow, X
|
||||
LDA.w OverlordYLow, X : !ADD.b #$68 : STA.w OverlordYLow, X
|
||||
|
||||
.no_change_ov
|
||||
INX : CPX #$08 : BNE .loop_middle2
|
||||
INX : CPX.b #$08 : BNE .loop_middle2
|
||||
BRL .return
|
||||
|
||||
|
||||
.move_to_top_right
|
||||
LDX #$00
|
||||
LDX.b #$00
|
||||
|
||||
.loop_top_right ; move sprites
|
||||
LDA $0E20, X
|
||||
LDA.w SpriteTypeTable, X
|
||||
JSR ShouldMoveSprite : BCC .no_change2
|
||||
LDA $0D20, X : !ADD #$00 : STA $0D20, X
|
||||
LDA $0D30, X : !ADD #$01 : STA $0D30, X
|
||||
LDA.w SpritePosYHigh, X : !ADD.b #$00 : STA.w SpritePosYHigh, X
|
||||
LDA.w SpritePosXHigh, X : !ADD.b #$01 : STA.w SpritePosXHigh, X
|
||||
|
||||
.no_change2
|
||||
INX : CPX #$10 : BNE .loop_top_right
|
||||
LDX #$00
|
||||
INX : CPX.b #$10 : BNE .loop_top_right
|
||||
LDX.b #$00
|
||||
|
||||
.loop_top_right2 ; move overlords
|
||||
LDA $0B00, X
|
||||
CMP #$E3 : BNE + ;is it moving floor?
|
||||
LDA.w $0B00, X
|
||||
CMP.b #$E3 : BNE + ;is it moving floor?
|
||||
BRA .no_change_ov2
|
||||
+
|
||||
LDA $0B10, X : !ADD #$01 : STA $0B10, X
|
||||
LDA $0B20, X : !ADD #$00 : STA $0B20, X
|
||||
LDA.w OverlordXHigh, X : !ADD.b #$01 : STA.w OverlordXHigh, X
|
||||
LDA.w OverlordYHigh, X : !ADD.b #$00 : STA.w OverlordYHigh, X
|
||||
|
||||
.no_change_ov2
|
||||
INX : CPX #$08 : BNE .loop_top_right2
|
||||
INX : CPX.b #$08 : BNE .loop_top_right2
|
||||
BRL .return
|
||||
|
||||
|
||||
.move_to_bottom_right
|
||||
LDX #$00
|
||||
LDX.b #$00
|
||||
|
||||
.loop_bottom_right ; move sprites
|
||||
LDA $0E20, X
|
||||
LDA.w SpriteTypeTable, X
|
||||
JSR ShouldMoveSprite : BCC .no_change3
|
||||
LDA $0D20, X : !ADD #$01 : STA $0D20, X
|
||||
LDA $0D30, X : !ADD #$01 : STA $0D30, X
|
||||
LDA.w SpritePosYHigh, X : !ADD.b #$01 : STA.w SpritePosYHigh, X
|
||||
LDA.w SpritePosXHigh, X : !ADD.b #$01 : STA.w SpritePosXHigh, X
|
||||
|
||||
.no_change3
|
||||
INX : CPX #$10 : BNE .loop_bottom_right
|
||||
LDX #$00
|
||||
INX : CPX.b #$10 : BNE .loop_bottom_right
|
||||
LDX.b #$00
|
||||
|
||||
.loop_bottom_right2 ; move overlords
|
||||
LDA $0B00, X
|
||||
CMP #$E3 : BNE + ;is it moving floor?
|
||||
LDA.w $0B00, X
|
||||
CMP.b #$E3 : BNE + ;is it moving floor?
|
||||
BRA .no_change_ov3
|
||||
+
|
||||
LDA $0B10, X : !ADD #$01 : STA $0B10, X
|
||||
LDA $0B20, X : !ADD #$01 : STA $0B20, X
|
||||
LDA.w OverlordXHigh, X : !ADD.b #$01 : STA.w OverlordXHigh, X
|
||||
LDA.w OverlordYHigh, X : !ADD.b #$01 : STA.w OverlordYHigh, X
|
||||
|
||||
.no_change_ov3
|
||||
INX : CPX #$08 : BNE .loop_bottom_right2
|
||||
INX : CPX.b #$08 : BNE .loop_bottom_right2
|
||||
BRL .return
|
||||
|
||||
|
||||
.move_to_bottom_left
|
||||
LDX #$00
|
||||
LDX.b #$00
|
||||
|
||||
.loop_bottom_left ; move sprites
|
||||
LDA $0E20, X
|
||||
LDA.w SpriteTypeTable, X
|
||||
JSR ShouldMoveSprite : BCC .no_change4
|
||||
LDA $0D20, X : !ADD #$01 : STA $0D20, X
|
||||
LDA $0D30, X : !ADD #$00 : STA $0D30, X
|
||||
LDA.w SpritePosYHigh, X : !ADD.b #$01 : STA.w SpritePosYHigh, X
|
||||
LDA.w SpritePosXHigh, X : !ADD.b #$00 : STA.w SpritePosXHigh, X
|
||||
|
||||
.no_change4
|
||||
INX : CPX #$10 : BNE .loop_bottom_left
|
||||
LDX #$00
|
||||
INX : CPX.b #$10 : BNE .loop_bottom_left
|
||||
LDX.b #$00
|
||||
|
||||
.loop_bottom_left2 ; move overlords
|
||||
LDA $0B00, X
|
||||
CMP #$E3 : BNE + ;is it moving floor?
|
||||
LDA.w $0B00, X
|
||||
CMP.b #$E3 : BNE + ;is it moving floor?
|
||||
BRA .no_change_ov4
|
||||
+
|
||||
LDA $0B10, X : !ADD #$00 : STA $0B10, X
|
||||
LDA $0B20, X : !ADD #$01 : STA $0B20, X
|
||||
LDA.w OverlordXHigh, X : !ADD.b #$00 : STA.w OverlordXHigh, X
|
||||
LDA.w OverlordYHigh, X : !ADD.b #$01 : STA.w OverlordYHigh, X
|
||||
|
||||
.no_change_ov4
|
||||
INX : CPX #$08 : BNE .loop_bottom_left2
|
||||
INX : CPX.b #$08 : BNE .loop_bottom_left2
|
||||
BRL .return
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ boss_move:
|
||||
; sets or clears carry flag, set if sprite should be moved
|
||||
ShouldMoveSprite:
|
||||
PHX
|
||||
LDX #$FF
|
||||
LDX.b #$FF
|
||||
- INX : CPX.b #$0F : BCS .done
|
||||
CMP.l BossIds, X : BNE -
|
||||
; match found, move it
|
||||
@@ -248,12 +248,12 @@ db $a2, $a3, $a4, $bd, $cb, $cc, $cd, $ff
|
||||
; Fix the gibdo key drop in skull woods before the boss room - USELESS CODE
|
||||
;--------------------------------------------------------------------------------
|
||||
;gibdo_drop_key:
|
||||
; LDA $A0 : CMP #$39 : BNE .no_key_drop ; Check if the room id is skullwoods before boss
|
||||
; LDA $0DD0, X : CMP #$09 : BNE .no_key_drop ; Check if the sprite is alive
|
||||
; LDA #$01 : STA $0CBA, X;set key
|
||||
; LDA.b RoomIndex : CMP.b #$39 : BNE .no_key_drop ; Check if the room id is skullwoods before boss
|
||||
; LDA.w SpriteAITable, X : CMP.b #$09 : BNE .no_key_drop ; Check if the sprite is alive
|
||||
; LDA.b #$01 : STA.w SpriteForceDrop, X;set key
|
||||
;
|
||||
;.no_key_drop
|
||||
; JSL $06DC5C ;Restore draw shadow
|
||||
; JSL $86DC5C ;Restore draw shadow
|
||||
; RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -261,10 +261,10 @@ db $a2, $a3, $a4, $bd, $cb, $cc, $cd, $ff
|
||||
; Set a flag to draw kholdstare shell on next NMI
|
||||
;--------------------------------------------------------------------------------
|
||||
new_kholdstare_code:
|
||||
LDA $0CBA : BNE .already_iced
|
||||
LDA #$01 : STA $0CBA
|
||||
LDA.w SpriteForceDrop : BNE .already_iced
|
||||
LDA.b #$01 : STA.w SpriteForceDrop
|
||||
|
||||
LDA #$01 : STA !SHELL_DMA_FLAG ; tell our NMI to draw the shell
|
||||
LDA.b #$01 : STA.l !SHELL_DMA_FLAG ; tell our NMI to draw the shell
|
||||
|
||||
.already_iced
|
||||
; restore code
|
||||
@@ -276,14 +276,14 @@ new_kholdstare_code:
|
||||
; Set a flag to draw trinexx shell on next NMI
|
||||
;--------------------------------------------------------------------------------
|
||||
new_trinexx_code:
|
||||
LDA $0CBA : BNE .already_rocked
|
||||
LDA #$01 : STA $0CBA
|
||||
LDA.w SpriteForceDrop : BNE .already_rocked
|
||||
LDA.b #$01 : STA.w SpriteForceDrop
|
||||
|
||||
LDA #$02 : STA !SHELL_DMA_FLAG ; tell our NMI to draw the shell
|
||||
LDA.b #$02 : STA.l !SHELL_DMA_FLAG ; tell our NMI to draw the shell
|
||||
|
||||
.already_rocked
|
||||
; restore code
|
||||
LDA.b #$03 : STA $0DC0, X ; sprite_trinexx.asm (62) : LDA.b #$03 : STA $0DC0, X
|
||||
LDA.b #$03 : STA.w SpriteGFXControl, X ; sprite_trinexx.asm (62) : LDA.b #$03 : STA $0DC0, X
|
||||
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,32 +1,13 @@
|
||||
; this is set inside randomizer application
|
||||
; org $1AFBBB ;Increases chance of getting enemies under random bush
|
||||
; db $01, $0F, $0F, $0F, $0F, $0F, $0F, $12
|
||||
; db $0F, $01, $0F, $0F, $11, $0F, $0F, $03
|
||||
|
||||
; sprite_bush_spawn_table:
|
||||
; {
|
||||
; ; SPRITE DATA TABLE GENERATED BY ENEMIZER
|
||||
; .overworld
|
||||
; ; Skip 0x80(overworld) + 0x128 (dungeons)
|
||||
; skip #$80
|
||||
; .dungeons
|
||||
; skip #$128
|
||||
|
||||
; ;Old sprite table - Could be changed as well (for the item id 04)
|
||||
; .random_sprites ; if item == 04
|
||||
; db #$00, #$D8, #$E3, #$D8
|
||||
; }
|
||||
|
||||
sprite_bush_spawn:
|
||||
{
|
||||
STY $0D ; restored code
|
||||
LDA !BUSHES_FLAG ; That byte is the flag to activate random enemies under bush
|
||||
STY.b Scrap0D ; restored code
|
||||
LDA.l !BUSHES_FLAG ; That byte is the flag to activate random enemies under bush
|
||||
BNE .continue
|
||||
CPY.b #$04 : BNE .not_random_old
|
||||
JSL GetRandomInt : AND.b #$03 : !ADD.b #$13 : TAY
|
||||
|
||||
.not_random_old
|
||||
LDA $81F3, Y;restored code
|
||||
LDA.w $81F3, Y;restored code
|
||||
RTL
|
||||
|
||||
.continue
|
||||
@@ -49,13 +30,13 @@ sprite_bush_spawn:
|
||||
BRA .return
|
||||
|
||||
.newSpriteSpawn
|
||||
LDA $7E040A : TAY ; load the area ID
|
||||
LDA $7EF3C5 : CMP.b #$03 : !BLT .dontGoPhase2 ; check if agahnim 1 is alive
|
||||
LDA.l OverworldIndexMirror : TAY ; load the area ID
|
||||
LDA.l ProgressIndicator : CMP.b #$03 : !BLT .dontGoPhase2 ; check if agahnim 1 is alive
|
||||
; aga1 is dead
|
||||
LDA $7E040A : CMP.b #$40 : !BGE .dontGoPhase2 ; check if we are in DW, if so we can skip shifting table index
|
||||
!ADD #$90 : TAY ; agahnim 1 is dead, so we need to go to the 2nd phase table for LW
|
||||
LDA.l OverworldIndexMirror : CMP.b #$40 : !BGE .dontGoPhase2 ; check if we are in DW, if so we can skip shifting table index
|
||||
!ADD.b #$90 : TAY ; agahnim 1 is dead, so we need to go to the 2nd phase table for LW
|
||||
.dontGoPhase2
|
||||
LDA sprite_bush_spawn_table_overworld, Y ;LDA 408000 + area id
|
||||
LDA.w sprite_bush_spawn_table_overworld, Y ;LDA 408000 + area id
|
||||
|
||||
.return
|
||||
PLB ; restore bank to where it was
|
||||
|
||||
@@ -2,10 +2,10 @@ CheckIfLinkShouldDie:
|
||||
; before this we should have:
|
||||
; LDA $7EF36D - this gets hooked, but we should have LDA at the end of it
|
||||
|
||||
CMP $00 : BCC .dead
|
||||
SEC : SBC $00
|
||||
CMP.b Scrap00 : BCC .dead
|
||||
SEC : SBC.b Scrap00
|
||||
BRA .done
|
||||
.dead
|
||||
LDA #$00
|
||||
LDA.b #$00
|
||||
.done
|
||||
RTL
|
||||
|
||||
@@ -6,13 +6,11 @@ JSL CheckFallingDeathFlag
|
||||
org $86FBF8
|
||||
JSL CheckFallingDeathFlag
|
||||
|
||||
Sprite_ManuallySetDeathFlagUW = $89C2F5
|
||||
|
||||
pullpc
|
||||
|
||||
CheckFallingDeathFlag:
|
||||
LDA.l !ENEMY_FALLING_STAY_ALIVE
|
||||
BEQ +
|
||||
RTL
|
||||
+ JML.l Sprite_ManuallySetDeathFlagUW ; original code
|
||||
+ JML Sprite_ManuallySetDeathFlagUW ; original code
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
; 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 NMIHookActionEnemizer
|
||||
org $0080D5 ; <- D5 - Bank00.asm : 164-167 (PHB, LDA.w #$0000)
|
||||
org $8080D0 ; <- D0 - Bank00.asm : 164-167 (PHB, LDA.w #$0000)
|
||||
JML NMIHookActionEnemizer
|
||||
org $8080D5 ; <- D5 - Bank00.asm : 164-167 (PHB, LDA.w #$0000)
|
||||
NMIHookReturnEnemizer:
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
; Blind door close
|
||||
;--------------------------------------------------------------------------------
|
||||
;
|
||||
org $028849 ; Bank02.asm(1588) - original code : JSL $078000 //Hook on player main when transition are over execute player code
|
||||
org $828849 ; 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
|
||||
org $878000
|
||||
Player_Main:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;================================================================================
|
||||
; Change heart container drop location
|
||||
;--------------------------------------------------------------------------------
|
||||
org $05EF62
|
||||
org $85EF62
|
||||
JSL change_heartcontainer_position
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
; ;================================================================================
|
||||
; ; 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
|
||||
org $89C114
|
||||
Dungeon_ResetSprites: ; Bank09.asm(822)
|
||||
|
||||
; *$4C44E-$4C498 LONG
|
||||
org $9C44E
|
||||
org $89C44E
|
||||
Sprite_ResetAll: ; Bank09.asm(1344)
|
||||
|
||||
;--------------------------------------------------------------------------------
|
||||
@@ -33,13 +11,13 @@ Sprite_ResetAll: ; Bank09.asm(1344)
|
||||
;================================================================================
|
||||
; On Room Transition -> Move Sprite depending on the room loaded
|
||||
;--------------------------------------------------------------------------------
|
||||
org $028979 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
|
||||
org $828979 ; 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
|
||||
org $828C16 ; 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
|
||||
org $829338 ; 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
|
||||
org $828256 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
|
||||
JSL boss_move
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -48,10 +26,10 @@ JSL boss_move
|
||||
;================================================================================
|
||||
; Draw kholdstare shell
|
||||
;--------------------------------------------------------------------------------
|
||||
org $0DD97F ; jump point
|
||||
org $8DD97F ; jump point
|
||||
Kholdstare_Draw:
|
||||
|
||||
org $1E9518 ; sprite_kholdstare.asm (154) : JSL Kholdstare_Draw
|
||||
org $9E9518 ; sprite_kholdstare.asm (154) : JSL Kholdstare_Draw
|
||||
JSL new_kholdstare_code ; Write new gfx in the vram
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;================================================================================
|
||||
; New bush mob randomization
|
||||
;--------------------------------------------------------------------------------
|
||||
org $068279
|
||||
org $868279
|
||||
NOP #$0A
|
||||
JSL sprite_bush_spawn
|
||||
NOP ; we keep the branch
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
org $780CA ; Bank07.asm(179)
|
||||
org $8780CA ; Bank07.asm(179)
|
||||
JSL CheckIfLinkShouldDie : NOP : NOP : NOP
|
||||
;SEC : SBC.b $00 : CMP #$00 : BEQ .linkIsDead ; Bank07.asm(179) -
|
||||
;SEC : SBC.b Scrap00 : CMP.b #$00 : BEQ .linkIsDead ; Bank07.asm(179) -
|
||||
|
||||
org $780D1
|
||||
org $8780D1
|
||||
BNE linkNotDead : NOP : NOP ; Bank07.asm(183) - CMP.b #$A8 : BCC .linkNotDead
|
||||
|
||||
org $780D5
|
||||
org $8780D5
|
||||
linkIsDead:
|
||||
|
||||
org $780F7
|
||||
org $8780F7
|
||||
linkNotDead:
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
; adjust oam position after drawing eyes
|
||||
;ED88E
|
||||
org $1DD88E
|
||||
org $9DD88E
|
||||
{
|
||||
; original: GiantMoldorm_Draw+5lines (sprite_giant_moldorm.asm)
|
||||
; lda $90 : add.w #$0008 : sta $90
|
||||
; INC $92 : INC $92
|
||||
; lda.b $90 : add.w #$0008 : sta.b $90
|
||||
; INC.b $92 : INC.b $92
|
||||
|
||||
JSL Moldorm_UpdateOamPosition
|
||||
NOP #08
|
||||
}
|
||||
|
||||
; set number of eyes
|
||||
;org $1DDBB2 ;$0EDBB2
|
||||
;org $9DDBB2 ;$0EDBB2
|
||||
;{
|
||||
; LDX.b #$01
|
||||
; number of eyes (-1)
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
org $9C50B ; 0x4C50B
|
||||
org $89C50B ; 0x4C50B
|
||||
{
|
||||
; .loadData
|
||||
; ; $4C50B-
|
||||
; STA $01 ; 85 01
|
||||
; STA.b Scrap01 ; 85 01
|
||||
; ; $4C50D-
|
||||
; LDY.w #$0000 ; A0 00 00
|
||||
JSL LoadOverworldSprites
|
||||
NOP
|
||||
}
|
||||
|
||||
org $9C510 ; 0x4C510
|
||||
LDA [$00], Y ; replace LDA ($00), Y
|
||||
org $89C510 ; 0x4C510
|
||||
LDA.b [Scrap00], Y ; replace LDA ($00), Y
|
||||
; CMP.b #$FF : BEQ .stopLoading
|
||||
; INY #2
|
||||
org $9C518 ; 0x4C518
|
||||
LDA [$00], Y ; replace LDA ($00), Y
|
||||
org $89C518 ; 0x4C518
|
||||
LDA.b [Scrap00], Y ; replace LDA ($00), Y
|
||||
; DEY #2 : CMP.b #$F4 : BNE .notFallingRocks
|
||||
; INC $0FFD
|
||||
; INC.w $0FFD
|
||||
; INY #3
|
||||
; BRA .nextSprite
|
||||
; .notFallingRocks ; Anything other than falling rocks.
|
||||
org $9C528 ; 0x4C528
|
||||
LDA [$00], Y ; replace LDA ($00), Y
|
||||
org $89C528 ; 0x4C528
|
||||
LDA.b [Scrap00], Y ; replace LDA ($00), Y
|
||||
; PHA : LSR #4 : ASL #2 :
|
||||
org $9C531 ; 0x4C531
|
||||
STA $0A ; STA $02
|
||||
org $89C531 ; 0x4C531
|
||||
STA.b Scrap0A ; STA.b $02
|
||||
; INY
|
||||
org $9C534 ; 0x4C534
|
||||
LDA [$00], Y ; replace LDA ($00), Y
|
||||
org $89C534 ; 0x4C534
|
||||
LDA.b [Scrap00], 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
|
||||
org $89C53B ; 0x4C53B
|
||||
ADC.b Scrap0A ; ADC.b $02
|
||||
; STA.b $06
|
||||
; PLA : ASL #4 : STA.b $07
|
||||
org $89C546 ; 0x4C546
|
||||
LDA.b [Scrap00], Y ; replace LDA ($00), Y
|
||||
; AND.b #$0F : ORA.b $07 : STA.b $05
|
||||
; INY
|
||||
org $9C54F ; 0x4C54F
|
||||
LDA [$00], Y ; replace LDA ($00), Y
|
||||
; LDX $05 : INC A : STA $7FDF80, X
|
||||
org $89C54F ; 0x4C54F
|
||||
LDA.b [Scrap00], Y ; replace LDA ($00), Y
|
||||
; LDX.b Scrap05 : INC A : STA.l $7FDF80, X
|
||||
|
||||
; ; $4C558-
|
||||
; ; Move on to the next sprite / overlord.
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
org $09C29A
|
||||
org $89C29A
|
||||
JSL LoadUnderworldSprites : NOP
|
||||
|
||||
; these hooks change the LDA.b ($00) commands to use LDA.b [$00] commands
|
||||
; so we can store the sprites in a different bank
|
||||
; also needs to change the use of $02 to $03 for slot index to make that possible
|
||||
|
||||
org $09C2B2
|
||||
LDA.b [$00]
|
||||
org $89C2B2
|
||||
LDA.b [Scrap00]
|
||||
|
||||
org $09C2C1
|
||||
LDA.b [$00],Y
|
||||
org $89C2C1
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C2CA
|
||||
INC.b $03 ; change slot variable to $03
|
||||
org $89C2CA
|
||||
INC.b Scrap03 ; change slot variable to $03
|
||||
|
||||
;org $09C329 standing items overwrote this one
|
||||
;LDA.b [$00],Y
|
||||
;LDA.b [Scrap00],Y
|
||||
|
||||
org $09C332
|
||||
LDA.b [$00],Y
|
||||
org $89C332
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C345
|
||||
DEC.b $03 : LDX.b $03
|
||||
org $89C345
|
||||
DEC.b Scrap03 : LDX.b Scrap03
|
||||
|
||||
org $09C350
|
||||
LDA.b [$00],Y
|
||||
org $89C350
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C35A
|
||||
DEC.b $03
|
||||
org $89C35A
|
||||
DEC.b Scrap03
|
||||
|
||||
org $09C36E
|
||||
org $89C36E
|
||||
JSL GetSpriteSlot16Bit ; depended on high bit being zero, which it isn't anymore
|
||||
|
||||
org $09C383
|
||||
LDX.b $03
|
||||
org $89C383
|
||||
LDX.b Scrap03
|
||||
|
||||
org $09C38C
|
||||
LDA.b [$00],Y
|
||||
org $89C38C
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C398
|
||||
LDA.b [$00],Y
|
||||
org $89C398
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C3AA
|
||||
LDA.b [$00],Y
|
||||
org $89C3AA
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C3BF
|
||||
LDA.b [$00],Y
|
||||
org $89C3BF
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C3DF
|
||||
LDA.b $03
|
||||
org $89C3DF
|
||||
LDA.b Scrap03
|
||||
|
||||
org $09C3F3
|
||||
LDA.b [$00],Y
|
||||
org $89C3F3
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C3FB
|
||||
LDA.b [$00],Y
|
||||
org $89C3FB
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C404
|
||||
LDA.b [$00],Y
|
||||
org $89C404
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
org $09C416
|
||||
LDA.b [$00],Y
|
||||
org $89C416
|
||||
LDA.b [Scrap00],Y
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ pushpc
|
||||
|
||||
org $9EC147
|
||||
JSL NewKodongoCollision
|
||||
JMP.w .continue : NOP #2
|
||||
JMP .continue : NOP #2
|
||||
.continue
|
||||
|
||||
org $9EC152
|
||||
@@ -11,9 +11,9 @@ Kodongo_SetDirection:
|
||||
pullpc
|
||||
|
||||
NewKodongoCollision:
|
||||
LDA $0DE0, X : INC A : AND.b #$03 : STA $0DE0, X
|
||||
LDA.w SpriteMoveDirection, X : INC A : AND.b #$03 : STA.w SpriteMoveDirection, X
|
||||
;If they collide more than 4 times just set direction
|
||||
LDA $0DA0, X : INC A : STA $0DA0, X : CMP #$04 : BCC .continue
|
||||
LDA.w SpriteAuxTable, X : INC A : STA.w SpriteAuxTable, X : CMP.b #$04 : BCC .continue
|
||||
PLA : PLA : PEA.w Kodongo_SetDirection-1
|
||||
.continue
|
||||
RTL
|
||||
@@ -2,13 +2,6 @@
|
||||
|
||||
lorom
|
||||
|
||||
;================================================================================
|
||||
|
||||
!ADD = "CLC : ADC"
|
||||
!SUB = "SEC : SBC"
|
||||
!BLT = "BCC"
|
||||
!BGE = "BCS"
|
||||
|
||||
;=Constants======================================================================
|
||||
|
||||
!BUSHES_FLAG = "$368100"
|
||||
@@ -59,8 +52,8 @@ incsrc falling_death.asm
|
||||
incsrc shell_gfx.asm
|
||||
warnpc $B6FFFF ;if we hit this we need to split stuff by bank
|
||||
|
||||
org $0684BD
|
||||
org $8684BD
|
||||
Sprite_Get16BitCoords_long:
|
||||
|
||||
org $1EC6FA ;F46FA
|
||||
org $9EC6FA ;F46FA
|
||||
SpritePrep_Eyegore:
|
||||
@@ -1,36 +1,34 @@
|
||||
pushpc
|
||||
|
||||
org $0691B6
|
||||
org $8691B6
|
||||
SpritePrep_Eyegore_bounce:
|
||||
JSL SpritePrep_EyegoreNew
|
||||
|
||||
org $068839 ; 0xEF
|
||||
dw #$91B6 ; New sprite_prep
|
||||
dw #$91B6 ; New sprite_prep
|
||||
org $868839 ; 0xEF
|
||||
dw SpritePrep_Eyegore_bounce
|
||||
dw SpritePrep_Eyegore_bounce
|
||||
|
||||
;org $069468 ; These need to go else where
|
||||
;org $869468 ; These need to go else where
|
||||
;dw #$BFF7 ; SpriteModule_Active_Bank1E_bounce
|
||||
;dw #$BFF7 ; SpriteModule_Active_Bank1E_bounce
|
||||
|
||||
;org $1E8B21
|
||||
;org $9E8B21
|
||||
;JSL FixVectorForMimics
|
||||
|
||||
;org $1E8BBB ; New vectors for mimics
|
||||
;org $9E8BBB ; New vectors for mimics
|
||||
;dw #$C795
|
||||
;dw #$C795
|
||||
|
||||
org $0DB818
|
||||
SpritePrep_LoadProperties:
|
||||
|
||||
org $1EC70D
|
||||
org $9EC70D
|
||||
SpritePrep_Eyegore_become_mimic:
|
||||
|
||||
;org $06EC08 ; Sprite_AttemptZapDamage
|
||||
;org $86EC08 ; Sprite_AttemptZapDamage
|
||||
;JSL resetSprite_Mimic : NOP
|
||||
|
||||
org $06ED9E ; Sprite_ApplyCalculatedDamage, skip high sprite id early exit
|
||||
org $86ED9E ; Sprite_ApplyCalculatedDamage, skip high sprite id early exit
|
||||
JSL IsItReallyAMimic : NOP
|
||||
|
||||
org $06EDA6 ; Sprite_ApplyCalculatedDamage .not_absorbable
|
||||
org $86EDA6 ; Sprite_ApplyCalculatedDamage .not_absorbable
|
||||
JSL notItemSprite_Mimic
|
||||
|
||||
pullpc
|
||||
@@ -47,65 +45,65 @@ pullpc
|
||||
; replace SpritePrep_Eyegore if flag is on
|
||||
SpritePrep_EyegoreNew:
|
||||
{
|
||||
LDA !ENABLE_MIMIC_OVERRIDE : BNE .new
|
||||
LDA.l !ENABLE_MIMIC_OVERRIDE : BNE .new
|
||||
; old
|
||||
JSL SpritePrep_Eyegore
|
||||
RTL
|
||||
|
||||
.new
|
||||
LDA $0E20, X : CMP.b #$EF : BCS .mimic ;If sprite id >= EF (unused somaria platform)
|
||||
LDA.w SpriteTypeTable, X : CMP.b #$EF : BCS .mimic ;If sprite id >= EF (unused somaria platform)
|
||||
; seems unnecessary it's just an rtl?
|
||||
; JSL $1EC71A ; 0xF471A set eyegore to be only eyegore (.not_goriya?)
|
||||
; JSL $9EC71A ; 0xF471A set eyegore to be only eyegore (.not_goriya?)
|
||||
RTL
|
||||
.mimic
|
||||
SBC.b #$6C : STA $0E20, X : JSL SpritePrep_LoadProperties ; pretending to be $83 or $84
|
||||
SBC.b #$6C : STA.w SpriteTypeTable, X : JSL SpritePrep_LoadProperties ; pretending to be $83 or $84
|
||||
JSL SpritePrep_Eyegore_become_mimic
|
||||
; LDA.w $0E20, X : ADC #$6C : STA $0E20, X ; set the sprite back to special mimic
|
||||
; LDA.w SpriteTypeTable, X : ADC.b #$6C : STA.w SpriteTypeTable, X ; set the sprite back to special mimic
|
||||
; todo? unsure about this code - seems unnecessary
|
||||
; LDA $0CAA, X : AND #$FB : ORA #$80 : STA $0CAA, X ; STZ $0CAA, X
|
||||
; LDA.w $0CAA, X : AND.b #$FB : ORA.b #$80 : STA.w $0CAA, X ; STZ.w $0CAA, X
|
||||
RTL
|
||||
}
|
||||
|
||||
;resetSprite_Mimic:
|
||||
; LDA !ENABLE_MIMIC_OVERRIDE : BEQ .notMimic ; skip to what it would have done normally
|
||||
; LDA.l !ENABLE_MIMIC_OVERRIDE : BEQ .notMimic ; skip to what it would have done normally
|
||||
;
|
||||
; LDA $0E20, X
|
||||
; LDA.w SpriteTypeTable, X
|
||||
; CMP.b #$EF : BCC .notMimic
|
||||
; LDA $0E20, X : SBC.b #$6C : STA $0E20, X ; overwrite the sprite id with eyegore id
|
||||
; LDA.w SpriteTypeTable, X : SBC.b #$6C : STA.w SpriteTypeTable, X ; overwrite the sprite id with eyegore id
|
||||
;
|
||||
;.notMimic
|
||||
; restore code
|
||||
; LDA $0E20, X : CMP.b #$7A
|
||||
; LDA.w SpriteTypeTable, X : CMP.b #$7A
|
||||
;RTL
|
||||
|
||||
IsItReallyAMimic:
|
||||
LDA !ENABLE_MIMIC_OVERRIDE : BEQ .continue
|
||||
LDA.w $0E20,X : CMP.b #$EF : BEQ .is_mimic
|
||||
LDA.l !ENABLE_MIMIC_OVERRIDE : BEQ .continue
|
||||
LDA.w SpriteTypeTable,X : CMP.b #$EF : BEQ .is_mimic
|
||||
CMP.b #$F0 : BNE .continue
|
||||
|
||||
.is_mimic
|
||||
CLC : RTL
|
||||
|
||||
.continue ; code we hijacked
|
||||
LDA.w $0E20,X
|
||||
LDA.w SpriteTypeTable,X
|
||||
CMP.b #$D8
|
||||
RTL
|
||||
|
||||
; this is just for killable thieves now
|
||||
notItemSprite_Mimic:
|
||||
; if we set killable thief we want to update the sprite id so it can be killed
|
||||
LDA $0E20, X
|
||||
LDA.w SpriteTypeTable, X
|
||||
CMP.l !KILLABLE_THIEVES_ID : BNE .continue ; thief #$C4 (default is B8/dialog tester)
|
||||
|
||||
; if we don't have mimic code turned on we want to skip, but we also need to reload the sprite id because we just smoked it with this LDA
|
||||
; LDA !ENABLE_MIMIC_OVERRIDE : BEQ .reloadSpriteIdAndSkipMimic ; skip to what it would have done normally
|
||||
; LDA.l !ENABLE_MIMIC_OVERRIDE : BEQ .reloadSpriteIdAndSkipMimic ; skip to what it would have done normally
|
||||
|
||||
; LDA $0E20, X ; I hate assembly
|
||||
; LDA.w SpriteTypeTable, X ; I hate assembly
|
||||
; CMP.b #$EF : BCC .continue
|
||||
; SBC.b #$6C : BRA .continue
|
||||
|
||||
.changeSpriteId
|
||||
LDA #$83 ; load green eyegore sprite id so we can kill the thing
|
||||
LDA.b #$83 ; load green eyegore sprite id so we can kill the thing
|
||||
|
||||
.continue
|
||||
; restore code
|
||||
|
||||
@@ -2,10 +2,10 @@ Moldorm_UpdateOamPosition:
|
||||
{
|
||||
PHX
|
||||
|
||||
LDA !MOLDORM_EYES_FLAG : TAX
|
||||
LDA.l !MOLDORM_EYES_FLAG : TAX
|
||||
.more_eyes
|
||||
LDA $90 : CLC : ADC.w #$0004 : STA $90
|
||||
LDA $92 : CLC : ADC.w #$0001 : STA $92
|
||||
LDA.b $90 : CLC : ADC.w #$0004 : STA.b $90
|
||||
LDA.b $92 : CLC : ADC.w #$0001 : STA.b $92
|
||||
DEX : BPL .more_eyes ; X >= 0
|
||||
|
||||
PLX
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
LoadOverworldSprites:
|
||||
; restore code
|
||||
STA $01 ; 85 01
|
||||
STA.b Scrap01 ; 85 01
|
||||
LDY.w #$0000 ; A0 00 00
|
||||
|
||||
; set bank
|
||||
LDA #$09 : STA $02 ; default is bank 9
|
||||
LDA.b #$09 : STA.b Scrap02 ; default is bank 9
|
||||
RTL
|
||||
@@ -3,9 +3,9 @@
|
||||
;================================================================================
|
||||
check_special_action:
|
||||
{
|
||||
LDA $7E0CF3 : BEQ .no_special_action
|
||||
LDA.b #$05 : STA $11 ; $11[0x01] - (Main) Submodule Index (See $B0)
|
||||
STZ $0CF3 ; $0CF3[0x01] - free ram
|
||||
LDA.l BossSpecialAction : BEQ .no_special_action
|
||||
LDA.b #$05 : STA.b GameSubMode
|
||||
STZ.w BossSpecialAction
|
||||
.no_special_action
|
||||
JSL Player_Main
|
||||
RTL
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
LoadUnderworldSprites:
|
||||
STA.b $00 ; part one of what we replaced
|
||||
LDA.w #$0028 : STA.b $02 ; set the bank to 28 for now
|
||||
STA.b Scrap00 ; part one of what we replaced
|
||||
LDA.w #UWSpritesData>>16 : STA.b Scrap02 ; set the bank to 28 for now
|
||||
LDA.w $048E
|
||||
RTL
|
||||
|
||||
GetSpriteSlot16Bit:
|
||||
LDA.b $03 : AND #$00FF
|
||||
LDA.b Scrap03 : AND.w #$00FF
|
||||
ASL A
|
||||
TAY
|
||||
RTL
|
||||
Reference in New Issue
Block a user