Advertisement
EliteAnax17

decompilation helps

May 27th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. Which one can you more easily tell whats going on?
  2.  
  3. (Hint: the answer is C)
  4.  
  5. -----------C-----------
  6.  
  7. bool8 CheckRelicanthWailord(void)
  8. {
  9. if (GetMonData(&gPlayerParty, MON_DATA_SPECIES2, 0) == SPECIES_RELICANTH)
  10. {
  11. CalculatePlayerPartyCount();
  12.  
  13. if (GetMonData(&gPlayerParty[gPlayerPartyCount - 1], MON_DATA_SPECIES2, 0) == SPECIES_WAILORD)
  14. return TRUE;
  15. }
  16. return FALSE;
  17. }
  18.  
  19. ----------ASM----------
  20.  
  21. CheckRelicanthWailord:
  22. push {r4, lr}
  23. ldr r4, .L20
  24. add r0, r4, #0
  25. mov r1, #0x41
  26. mov r2, #0x0
  27. bl GetMonData
  28. ldr r1, .L20+0x4
  29. cmp r0, r1
  30. bne .L17 @cond_branch
  31. bl CalculatePlayerPartyCount
  32. ldr r0, .L20+0x8
  33. ldrb r1, [r0]
  34. mov r0, #0x64
  35. mul r0, r0, r1
  36. add r1, r4, #0
  37. sub r1, r1, #0x64
  38. add r0, r0, r1
  39. mov r1, #0x41
  40. mov r2, #0x0
  41. bl GetMonData
  42. mov r1, #0x9d
  43. lsl r1, r1, #0x1
  44. cmp r0, r1
  45. bne .L17 @cond_branch
  46. mov r0, #0x1
  47. b .L19
  48. .L21:
  49. .align 2, 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement