No Description

text_lookup_array.s 3.5KB

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