Skip to content

Commit

Permalink
Revert "* Some more physics tweaks!"
Browse files Browse the repository at this point in the history
This reverts commit 0d118a2.
  • Loading branch information
iProgramMC committed Jan 25, 2025
1 parent ec29c96 commit 7d00891
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 91 deletions.
2 changes: 1 addition & 1 deletion src/defines.asm
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ sjumpvelLO = ((-(jumpvel / 2)) & $FF)
plr_y_bot = 16
plr_y_bot_wall = 14 ; for wall checking
plr_y_bot_cc = 11 ; for climb hop checking
plr_y_bot_wjc = 14 ; for wall jump checking
plr_y_bot_wjc = 12 ; for wall jump checking
plr_y_top = (plr_y_bot - plrheight)
plr_y_top_ceil = plr_y_top + plrceiltoly
plr_y_mid = (plr_y_bot_wall - plrheight / 2)
Expand Down
100 changes: 10 additions & 90 deletions src/x_physic.asm
Original file line number Diff line number Diff line change
Expand Up @@ -613,16 +613,12 @@ gm_walljump:
and #<~g4_nosjump
sta gamectrl4
lda game_cont
and #(cont_right|cont_left)
bne :+
lda #0
sta player_vl_x
sta player_vs_x
; note: cjwalldir is the direction you must hold for a wall jump stamina refund!
: lda playerctrl
lda playerctrl
and #pl_left ; pl_left is equal to 1
sta cjwalldir
eor #1
Expand Down Expand Up @@ -2952,13 +2948,6 @@ noForcedRelease:
and #<~g4_nodeath
sta gamectrl4
; check if we are higher than needed
jsr checkClimbHopTile
bne noNeedToLower
inc player_y
noNeedToLower:
lda game_cont
and #(cont_up | cont_down)
pha
Expand Down Expand Up @@ -3065,37 +3054,6 @@ table: .byte 0, pl_wallleft
table2lo: .byte $00,$55,$40,$00
table2hi: .byte $00,$01,$FF,$00

; returns zero flag CLEAR if should lower
checkClimbHopTile:
jsr gm_getfacex_wj
tax
jsr gm_getbottomy_cc
tay
jsr h_get_tile
tax
ldy metatile_info, x
lda @collidableTable, y
; this tile is collidable
bne @return
; , so might want to lower, but also check
; if we're hanging against the top of a tile.
jsr gm_getfacex_wj
tax
jsr gm_gettopy
tay
jsr h_get_tile
tax
ldy metatile_info, x
lda @collidableTable, x
rts

@return:
rts

@collidableTable: .byte 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 ; full, dream, cass1, cass2 are set

checkClimbHopSafety:
ldy entground
bmi @skipEntityChecking
Expand Down Expand Up @@ -3477,12 +3435,6 @@ advancedTraceDisabled:
rts
.endproc

h_get_colltype:
jsr h_get_tile
tay
lda metatile_info, y
rts

; ** SUBROUTINE: gm_death_hacks
; desc: Checks the player for conditions that may kill her. This is marked a hack
; because other things are supposed to handle such deaths.
Expand All @@ -3497,7 +3449,9 @@ h_get_colltype:
tax
jsr gm_getmidy
tay
jsr h_get_colltype
jsr h_get_tile
tax
lda metatile_info, x
cmp #ct_full
beq @kill
Expand All @@ -3510,57 +3464,23 @@ h_get_colltype:
tax
jsr gm_getbottomy_w
tay
jsr h_get_colltype
jsr h_get_tile
tax
lda metatile_info, x
cmp #ct_deadlyUP
beq @kill
jsr gm_getrightx
tax
jsr gm_getbottomy_w
tay
jsr h_get_colltype
jsr h_get_tile
tax
lda metatile_info, x
cmp #ct_deadlyUP
beq @kill
@notOnGround:
; If we are climbing, check if we are standing inside spikes.
lda #pl_climbing
bit playerctrl
beq @notClimbing
jsr gm_getleftx
tax
jsr gm_gettopy
tay
jsr h_get_colltype
cmp #ct_deadlyRT
beq @kill
jsr gm_getleftx
tax
jsr gm_getbottomy_cc
tay
jsr h_get_colltype
cmp #ct_deadlyRT
beq @kill
jsr gm_getrightx
tax
jsr gm_gettopy
tay
jsr h_get_colltype
cmp #ct_deadlyLT
beq @kill
jsr gm_getrightx
tax
jsr gm_getbottomy_cc
tay
jsr h_get_colltype
cmp #ct_deadlyLT
beq @kill
@notClimbing:
@return:
rts
@kill:
Expand Down

0 comments on commit 7d00891

Please sign in to comment.