Advertisement
Guest User

Untitled

a guest
Aug 7th, 2015
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. .align 2
  2. .thumb
  3.  
  4. /*special 0x7f is the Tile attribute getter. It returns to var 0x8004 the value
  5. of that tile behaviour bytes and 0x8005 is the tile's back bytes. Designed to
  6. be used with special 0x8f before it (to get the positions) and to be possible to
  7. use the required wild battle randomizer afterwards.
  8. 0x8004 will then keep the background byte and 0x8005 will keep the upper bytes
  9. will return to a given variable the background bytes */
  10.  
  11. Special_7f: push {r1-r4, lr}
  12. ldr r4, var_8004_2
  13. ldrh r0, [r4]
  14. ldrh r1, [r4, #0x2]
  15. add r1, #0x7 /*long story, but it's mainly because that's*/
  16. add r0, #0x7 /*how the game makes the access, anyway*/
  17. mov r2, #0xFF
  18. bl call_tile_evaluator
  19. lsl r1, r0, #0x10 /*the behaviour bytes*/
  20. lsr r0, r0, #0x18 /*the background byte*/
  21. lsr r1, r1, #0x10
  22. strh r0,[r4,#0x0]
  23. strh r1,[r4,#0x2]
  24. mov r1, #0x3
  25. and r0, r1
  26. pop {r1-r4, pc}
  27.  
  28. call_tile_evaluator: ldr r3, evaluator
  29. bx r3
  30. .hword 0x0000
  31. evaluator: .word 0x08058F49
  32. var_8004_2: .word 0x020370c0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement