Advertisement
Guest User

Untitled

a guest
Jan 17th, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. ...
  2. ROMF:604F 3A ldd a,(hl) ;*read base power from RAM
  3. ROMF:6050 A7 and a
  4. ROMF:6051 C8 ret z ;do nothing if it's zero
  5. ROMF:6052 2B dec hl
  6. ROMF:6053 4E ld c,(hl) ;read move #
  7. ROMF:6054 1A ld a,(de)
  8. ROMF:6055 CB 57 bit 2,a
  9. ROMF:6057 20 08 jr nz,6061
  10. ROMF:6059 CB 20 sla b
  11. ROMF:605B 30 06 jr nc,6063
  12. ROMF:605D 06 FF ld b,ff
  13. ROMF:605F 18 02 jr 6063
  14. ROMF:6061 CB 38 slr b
  15. ROMF:6063 21 8E 60 ld hl,608e(moveTable) ;table of high critical hit moves
  16. .loop
  17. ROMF:6066 2A ldi a,(hl) ;read move from move table
  18. ROMF:6067 B9 cp c ;matches the move about to be used?
  19. ROMF:6068 28 07 jr z,6071(highCritical)
  20. ROMF:606A 3C inc a ;FF terminates loop
  21. ROMF:606B 20 F9 jr nz,6066(loop)
  22. .break
  23. ROMF:606D CB 38 slr b ;/2 for regular move (effective 1/512)
  24. ROMF:606F 18 0C jr 607d(skipHighCritical)
  25. .highCritical
  26. ROMF:6071 CB 20 sla b ;*2...
  27. ROMF:6073 30 02 jr nc,6077
  28. ROMF:6075 06 FF ld b,ff ;set to FF (max) on overflow
  29. ROMF:6077 CB 20 sla b ;*4 for high critical move (effective 1/64)
  30. ROMF:6079 30 02 jr nc,607d
  31. ROMF:607B 06 FF ld b,ff
  32. .skipHighCritical
  33. ROMF:607D CD 9B 6E call 6e9b ;random 8bit number? check later
  34. ROMF:6080 CB 07 rlc a
  35. ROMF:6082 CB 07 rlc a
  36. ROMF:6084 CB 07 rlc a
  37. ROMF:6086 B8 cp b
  38. ROMF:6087 D0 ret nc ;no critical hit if no borrow (99.6% thing applies)
  39. ROMF:6088 3E 01 ld a,01
  40. ROMF:608A EA 5E D0 ld (d05e),a ;set critical hit flag
  41. ROMF:608D C9 ret
  42.  
  43. .moveTable:
  44. db $02,$4B,$98,$A3 ;karate chop,razor leaf,crabhammer,slash
  45. db $FF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement