No Description

text_lookup_array.s 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. .align 2
  2. .text
  3. .thumb
  4. .global get_text_pointer_from_lookup
  5. get_text_pointer_from_lookup:
  6. push {r4-r5, lr}
  7. ldr r0, =sav_one
  8. ldr r0, [r0]
  9. ldrb r4, [r0, #4] @r4 = bank
  10. ldrb r5, [r0, #5] @r5 = map
  11. ldrh r0, =0x800F
  12. ldr r2, =var_get
  13. bl bxr2 @r0 = person id
  14. ldr r1, =text_lookup_array
  15. lsl r3, r4, #2
  16. add r1, r3
  17. ldr r1, [r1] @load bank
  18. lsl r3, r5, #2
  19. add r1, r3
  20. ldr r1, [r1] @load map
  21. add r1, #4 @skip the global map pointer
  22. lsl r3, r0, #2
  23. add r1, r3
  24. ldr r1, [r1] @load person
  25. mov r4, r1
  26. ldrh r0, =0x500C
  27. ldr r2, =var_get
  28. bl bxr2
  29. lsl r0, #2
  30. add r1, r0, r4
  31. ldr r0, [r1, #0] @load specific ID
  32. ldr r1, lp_offset
  33. str r0, [r1]
  34. mov r0, #0
  35. ldr r1, =0x500C
  36. ldr r2, =var_set
  37. bl bxr2
  38. pop {r4-r5}
  39. pop {r1}
  40. bx r1
  41. .global get_map_pointer_from_lookup
  42. get_map_pointer_from_lookup:
  43. push {r4-r5, lr}
  44. ldr r0, =sav_one
  45. ldr r0, [r0]
  46. ldrb r4, [r0, #4] @r4 = bank
  47. ldrb r5, [r0, #5] @r5 = map
  48. ldr r1, =text_lookup_array
  49. lsl r3, r4, #2
  50. add r1, r3
  51. ldr r1, [r1] @load bank
  52. lsl r3, r5, #2
  53. add r1, r3
  54. ldr r1, [r1] @load map
  55. ldr r4, [r1] @map specific text array
  56. ldrh r0, =0x500C
  57. ldr r2, =var_get
  58. bl bxr2
  59. lsl r0, #2
  60. add r1, r0, r4
  61. ldr r0, [r1, #0] @load specific ID
  62. ldr r1, lp_offset
  63. str r0, [r1]
  64. mov r0, #0
  65. ldr r1, =0x500C
  66. ldr r2, =var_set
  67. bl bxr2
  68. pop {r4-r5}
  69. pop {r1}
  70. bx r1
  71. bxr2:
  72. bx r2
  73. .align 2
  74. lp_offset:
  75. .word 0x03000F14
  76. .align 2
  77. .section .rodata
  78. .global text_lookup_array
  79. text_lookup_array:
  80. .word text_bank_zero
  81. .word text_bank_one
  82. .word text_bank_two
  83. .word text_bank_three
  84. .word text_bank_four
  85. .word text_bank_five
  86. .word 0xDEADBEEF
  87. text_bank_zero:
  88. text_bank_one:
  89. text_bank_two:
  90. text_bank_three:
  91. text_bank_four:
  92. .word text_bank_zero_map_zero
  93. .word text_bank_zero_map_one
  94. .word 0xDEADBEEF
  95. text_bank_five:
  96. .word text_bank_five_map_zero
  97. .word 0xDEADBEEF
  98. text_bank_zero_map_zero:
  99. text_bank_zero_map_one:
  100. .word text_bank_zero_map_zero_global
  101. .word text_bank_zero_amp_zero_ev_one
  102. .word text_bank_zero_amp_zero_ev_two
  103. .word text_bank_zero_amp_zero_ev_three
  104. .word text_bank_zero_amp_zero_ev_four
  105. .word text_bank_zero_amp_zero_ev_five
  106. .word text_bank_zero_amp_zero_ev_six
  107. .word text_bank_zero_amp_zero_ev_seven
  108. .word 0xDEADBEEF
  109. text_bank_zero_amp_zero_ev_one:
  110. text_bank_zero_amp_zero_ev_two:
  111. text_bank_zero_amp_zero_ev_three:
  112. text_bank_zero_amp_zero_ev_four:
  113. text_bank_zero_amp_zero_ev_five:
  114. text_bank_zero_amp_zero_ev_six:
  115. text_bank_zero_amp_zero_ev_seven:
  116. .word str_person_test
  117. .word 0xDEADBEEF
  118. text_bank_zero_map_zero_global:
  119. .word str_person_test
  120. .word str_person_zero
  121. .word 0xDEADBEEF
  122. text_bank_five_map_zero:
  123. .word text_bank_five_map_zero_global
  124. .word 0xDEADBEEF
  125. text_bank_five_map_zero_global:
  126. .word str_tundra_hq_name
  127. .word str_tundra_hq_0
  128. .word str_tundra_hq_1
  129. .word str_tundra_hq_2
  130. .word str_tundra_hq_3
  131. .word str_tundra_hq_4
  132. .word str_tundra_hq_5
  133. .word str_tundra_hq_6
  134. .word str_tundra_hq_7
  135. .word str_tundra_hq_8
  136. .word str_tundra_hq_9
  137. .word str_tundra_hq_10
  138. .word str_tundra_hq_11
  139. .word str_tundra_hq_12