Zeldara109

SMB Deluxe - Axe run fix.asm

Nov 24th, 2023 (edited)
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; SMB Deluxe
  3. ; Auto-calculate the X position where Mario stops moving, when running forward
  4. ; after the axe in castle levels. Replaces vanilla code to load hardcoded X
  5. ; positions for each world in Original/Challenge/Super Players mode.
  6. ;
  7. ; For assembling with WLA DX
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9.  
  10. ; Base defines
  11.  
  12. .memorymap
  13. slotsize $4000
  14. defaultslot 1
  15. slot 0 $0000
  16. slot 1 $4000
  17. .endme
  18. .rombanksize $4000
  19. .rombanks $40
  20. .computegbchecksum
  21.  
  22. .background "smbdx.gbc"
  23.  
  24. .define W_ChallengeFlag $C283
  25. .define H_PlayerXHigh $FFA8
  26.  
  27. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  28.  
  29. .bank $03 slot 1
  30. .orga $503E
  31. .section "AxeVictory_PlayerStopX auto-calculate" size $5070-$503E overwrite
  32. ldh a,[<H_PlayerXHigh] ;\ Set stop position high byte
  33. inc a ;| to player X high, +1
  34. ld [$C267],a ;/
  35. ld a,[W_ChallengeFlag]
  36. and a
  37. jr nz,@Challenge
  38. ld a,$50 ;\ Non-challenge:
  39. ld [$C265],a ;/ Always use $50 for low byte
  40. ret
  41. @Challenge:
  42. ld a,$60 ;\ Challenge:
  43. ld [$C265],a ;/ Always use $60 for low byte
  44. ret
  45. .ends
  46.  
Advertisement
Add Comment
Please, Sign In to add comment