Advertisement
Guest User

Untitled

a guest
Oct 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org $00D308
  2.     PHB : PHK : PLB
  3.     JSL CopyShield
  4.     PLB
  5.     RTL
  6.  
  7. org $00D2C8
  8.     PHB : PHK : PLB
  9.     JSL CopySword
  10.     PLB
  11.     RTL
  12.  
  13.  
  14. org $228140
  15.     swordgfx:
  16.     incbin swords.gfx
  17.     shieldgfx:
  18.     incbin shields.gfx
  19.  
  20.  
  21. CopySword:
  22. {
  23.     PHB : PHK : PLB
  24.     PHP ;push processor byte
  25.     REP #$30 ; set everything to 16-bit
  26.     LDY #$0000
  27.     LDA $7EF359 : AND.w #$00FF : ASL : TAX ;Load Sword Value
  28.     LDA.w .sword_positon_gfx, X : TAX
  29.     .loop_copy
  30.     LDA swordgfx, X : PHX : TYX : STA $7E9000, X : PLX
  31.     LDA swordgfx+#$200, X : PHX : TYX : STA $7E9180, X : PLX
  32.     INX : INX : INY : INY
  33.     CPY #$0180 : BCC .loop_copy
  34.     PLP ;pull processor byte
  35.     PLB
  36.     RTL
  37.     .sword_positon_gfx
  38.     dw #$0000, #$0000, #$0400, #$0800, #$0C00 ; swords position in gfx file
  39. }
  40.  
  41. CopyShield:
  42. {
  43.     PHB : PHK : PLB
  44.     PHP ;push processor byte
  45.     REP #$30 ; set everything to 16-bit
  46.     LDY #$0300
  47.     LDA $7EF35A : AND.w #$00FF : ASL : TAX ;Load Shield value
  48.     LDA.w .shield_positon_gfx, X : TAX
  49.     .loop_copy
  50.     LDA shieldgfx, X : PHX : TYX : STA $7E9000, X : PLX
  51.     LDA shieldgfx+#$200, X : PHX : TYX : STA $7E90C0, X : PLX
  52.     INX : INX : INY : INY
  53.     CPY #$03C0 : BCC .loop_copy
  54.     PLP ;pull processor byte
  55.     PLB
  56.     RTL
  57.     .shield_positon_gfx
  58.     dw #$0000,#$0000, #$0400, #$0800
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement