Advertisement
PikalaxALT

Function8e814 efficiency edit

Oct 20th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; The function in the game is:
  2. Function8e814: ; 8e814
  3.     push hl
  4.     push de
  5.     push bc
  6.     push af
  7.     ld hl, wc300
  8.     ld bc, $00c1
  9. .loop
  10.     ld [hl], $0
  11.     inc hl
  12.     dec bc
  13.     ld a, c
  14.     or b
  15.     jr nz, .loop
  16.     pop af
  17.     pop bc
  18.     pop de
  19.     pop hl
  20.     ret
  21.  
  22. ; More efficient would be:
  23. Function8e814_eff:
  24.     push hl
  25.     push bc
  26.     push af
  27.     ld hl, wc300
  28.     ld c, $c1
  29.     xor a
  30. .loop
  31.     ld [hli], a
  32.     dec c
  33.     jr nz, .loop
  34.     pop af
  35.     pop bc
  36.     pop hl
  37.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement