Pokemon Center | 口袋中心 以口袋妖怪为主题并带有其他动漫游戏的讨论

 找回密码
 加入口袋中心
搜索

ASM杂项集合【802/绿宝石】

[复制链接]

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-3 15:12:30 | 显示全部楼层
本帖最后由 本站第一萌新 于 2020-5-3 15:19 编辑

绿宝石802专享:
这个源码使用了802的三属性框架,当然现在回头看这并不是最优的方法

制作觉醒石系统,携带对应属性觉醒石的精灵可以在战斗中获得额外属性
也是好久前写的代码了,和上面一样,不修改了
  1. .gba
  2. .thumb
  3. .include "header/ArmipsBSMacros.asm"
  4. .create "3.0.gba",0x8000000
  5. .close
  6. .open "test.gba","3.0.gba", 0x8000000

  7. .org 0x08F80000
  8. CheckHasAwakeningStone:
  9.         mov r0, #0x58
  10.         mul r0, r4
  11.         ldr r1, =(0x02024084 + 0x2E)
  12.         add r0, r1
  13.         ldrh r0, [r0]
  14.         mov r1, #80
  15.         lsl r1, #3
  16.         add r1, #18
  17.         cmp r0, r1        ;0x292
  18.         bgt HasNoAwakeningStone
  19.         sub r1, #17
  20.         cmp r0, r1        ;0x281
  21.         blt HasNoAwakeningStone
  22.         push {r5}
  23.         sub r5, r0, r1
  24.         ldr r1, =(0x08FC2C7C + 0x28)
  25.         mov r2, #0x2C
  26.         mul r0, r2
  27.         ldrb r0, [r0, r1]
  28.         ldr r3, =0x02024218
  29.         ldr r3, [r3]
  30.         mov r2, #0x24
  31.         mul r2, r4
  32.         add r1, r3, r2
  33.         add r1, #6
  34.         strb r0, [r1]
  35.         add r3, #0x9F
  36.         strb r4, [r3]
  37.         ldr r0, =(0x02024332 + 0x05)
  38.         strb r5, [r0]
  39.         pop {r5}
  40.         ldr r0, =BS_HASSTONE
  41.         ldr r3, =(0x08E073E4|1)
  42.         bl call_bx
  43.         ldr r3, =(0x08E19B64|1)
  44.         bx r3
  45. HasNoAwakeningStone:       
  46.         cmp r5, #0x95
  47.         beq GotoSub8E19B6A
  48.         bhi GotoSub8E19AEE
  49.         cmp r5, #0x20
  50.         ldr r3, =(0x08E19AD4|1)
  51.         bx r3
  52. GotoSub8E19B6A:
  53.         ldr r3, =(0x08E19B6A|1)
  54.         bx r3
  55. GotoSub8E19AEE:
  56.         ldr r3, =(0x08E19AEE|1)
  57.         bx r3
  58. .pool

  59. MoreBattlestring:
  60.         mov r3, #147
  61.         lsl r3, #2
  62.         add r1 ,r3, #1
  63.         cmp r0, r3
  64.         bgt More
  65.         mov r3, #0x7C
  66.         add r3, #0xFF
  67.         cmp r0, r3
  68.         bls GotoSub8E06654
  69.         ldr r3, =(0x08E0664C|1)
  70.         bx r3
  71. More:
  72.         ldr r3, =NewBattleStringsTable
  73.         sub r0, r1
  74.         ldr r1, =(0x08E06658|1)
  75.         bx r1
  76. GotoSub8E06654:
  77.         ldr r3, =(0x08E06654|1)
  78.         bx r3
  79. .pool

  80. call_bx:
  81.         bx r3
  82. .pool

  83. BS_HASSTONE:
  84.         printfromtable AwakeningStoneType
  85.         waitmessage 0x40
  86.         end3

  87. STR_SUMMARY_NORMAL:
  88. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x0F, 0x0B, 0x01, 0x42, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  89. STR_SUMMARY_FIGHT:
  90. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x04, 0x5B, 0x03, 0x5C, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  91. STR_SUMMARY_FLYING:
  92. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x03, 0xCC, 0x0E, 0x5B, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  93. STR_SUMMARY_POISON:
  94. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x03, 0x63, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  95. STR_SUMMARY_GROUND:
  96. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x03, 0x1F, 0x09, 0x7E, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  97. STR_SUMMARY_ROCK:
  98. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x0E, 0xBB, 0x0B, 0xEB, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  99. STR_SUMMARY_BUG:
  100. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x02, 0x68, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  101. STR_SUMMARY_GHOST:
  102. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x04, 0xB5, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  103. STR_SUMMARY_STEEL:
  104. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x04, 0x40, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  105. STR_SUMMARY_FIRE:
  106. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x05, 0x7D, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  107. STR_SUMMARY_WATER:
  108. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x0C, 0x51, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  109. STR_SUMMARY_GRASS:
  110. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x02, 0x01, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  111. STR_SUMMARY_ELECTRIC:
  112. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x03, 0x2E, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  113. STR_SUMMARY_PSYCHIC:
  114. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x02, 0x2E, 0x09, 0xD2, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  115. STR_SUMMARY_ICE:
  116. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x01, 0xB6, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  117. STR_SUMMARY_DRAGON:
  118. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0xCD, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  119. STR_SUMMARY_DARK:
  120. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x03, 0x96, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  121. STR_SUMMARY_FAIRY:
  122. .byte 0x09, 0xD2, 0x04, 0x83, 0x0B, 0x43, 0x01, 0x63, 0x07, 0xD7, 0x09, 0x66, 0x0F, 0xE6, 0x10, 0x30, 0xFE, 0x03, 0x5C, 0x10, 0xA1, 0x07, 0xA5, 0x0E, 0x5C, 0x0E, 0xE6, 0x07, 0x5B, 0x0C, 0x39, 0x0E, 0x5F, 0xFE, 0x03, 0x0B, 0x0B, 0xCF, 0x0A, 0xA1, 0x03, 0x07, 0x07, 0x8F, 0xAD, 0xFF

  123. STR_USE_NORMAL:
  124. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x0F, 0x0B, 0x01, 0x42, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  125. STR_USE_FIGHT:
  126. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x04, 0x5B, 0x03, 0x5C, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  127. STR_USE_FLYING:
  128. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x03, 0xCC, 0x0E, 0x5B, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  129. STR_USE_POISON:
  130. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x03, 0x63, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  131. STR_USE_GROUND:
  132. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x03, 0x1F, 0x09, 0x7E, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  133. STR_USE_ROCK:
  134. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x0E, 0xBB, 0x0B, 0xEB, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  135. STR_USE_BUG:
  136. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x02, 0x68, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  137. STR_USE_GHOST:
  138. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x04, 0xB5, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  139. STR_USE_STEEL:
  140. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x04, 0x40, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  141. STR_USE_FIRE:
  142. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x05, 0x7D, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  143. STR_USE_WATER:
  144. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x0C, 0x51, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  145. STR_USE_GRASS:
  146. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x02, 0x01, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  147. STR_USE_ELECTRIC:
  148. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x03, 0x2E, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  149. STR_USE_PSYCHIC:
  150. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x02, 0x2E, 0x09, 0xD2, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  151. STR_USE_ICE:
  152. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x01, 0xB6, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  153. STR_USE_DRAGON:
  154. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x08, 0xCD, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  155. STR_USE_DARK:
  156. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x03, 0x96, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  157. STR_USE_FAIRY:
  158. .byte 0xFD, 0x12, 0x07, 0xA5, 0x0E, 0x5C, 0x08, 0x9E, 0x0E, 0xE6, 0x07, 0x5B, 0x0C, 0x39, 0x0E, 0x5F, 0xAB, 0xFF

  159. .align 4
  160. NewBattleStringsTable:
  161. .word STR_USE_NORMAL
  162. .word STR_USE_FIGHT
  163. .word STR_USE_FLYING
  164. .word STR_USE_POISON
  165. .word STR_USE_GROUND
  166. .word STR_USE_ROCK
  167. .word STR_USE_BUG
  168. .word STR_USE_GHOST
  169. .word STR_USE_STEEL
  170. .word STR_USE_FIRE
  171. .word STR_USE_WATER
  172. .word STR_USE_GRASS
  173. .word STR_USE_ELECTRIC
  174. .word STR_USE_PSYCHIC
  175. .word STR_USE_ICE
  176. .word STR_USE_DRAGON
  177. .word STR_USE_DARK
  178. .word STR_USE_FAIRY
  179. .word 0x00

  180. AwakeningStoneType:
  181. .halfword 0x24D, 0x24E, 0x24F, 0x250, 0x251, 0x252, 0x253, 0x254, 0x255, 0x256, 0x257, 0x258, 0x259, 0x25A, 0x25B, 0x25C, 0x25D, 0x25E

  182. .align 4
  183. StonePic:
  184. .word 0x00012010, 0xF0000036, 0xC0078001, 0x0F0013F0, 0x00CC04CC, 0x00BBBBCC, 0xD4BBBB02, 0x07701DF0
  185. .word 0xBC12300C, 0x88C00330, 0x0003B090, 0xBB03108C, 0x00BBABAB, 0xBBBA8BBB, 0xBB88AB8B, 0xA88A8A00
  186. .word 0x88A8A8B8, 0x888800A8, 0x8A88B88A, 0x8805B888, 0xCBB8A888, 0x009B5600, 0x00BB765A, 0x1003904C
  187. .word 0xA3F0C817, 0x0F8801E0, 0xCC888888, 0xB3100200, 0xA3601EF0, 0x4001F0C0, 0x00000001

  188. .align 4
  189. StonePal:
  190. .word 0x00002010, 0xFF7FFF00, 0x1F7C1F03, 0x7FE00000, 0x7C0003E0, 0xFF000000, 0x1A1B7E3F, 0x302B9F1B
  191. .word 0x190022B9, 0x00000100

  192. .org 0x08E19ACC
  193.         ldr r3, =(CheckHasAwakeningStone|1)
  194.         bx r3
  195. .pool

  196. .org 0x08E06644
  197.         ldr r3, =(MoreBattlestring|1)
  198.         bx r3
  199. .pool

  200. .org (0x08FC9AA8 + 0x2C * 0x00)
  201. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x0F, 0x0B, 0x01, 0x42, 0xFF, 0x00, 0x00

  202. .org (0x08FC9ABC + 0x2C * 0x00)
  203. .word STR_SUMMARY_NORMAL

  204. .org (0x08FC9AD0 + 0x2C * 0x00)
  205. .byte 0x00

  206. .org (0x08FCD3FC + 0x08 * 0x00)
  207. .word StonePic
  208. .word StonePal

  209. .org (0x08FC9AA8 + 0x2C * 0x01)
  210. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x04, 0x5B, 0x03, 0x5C, 0xFF, 0x00, 0x00

  211. .org (0x08FC9ABC + 0x2C * 0x01)
  212. .word STR_SUMMARY_FIGHT

  213. .org (0x08FC9AD0 + 0x2C * 0x01)
  214. .byte 0x01

  215. .org (0x08FCD3FC + 0x08 * 0x01)
  216. .word StonePic
  217. .word StonePal

  218. .org (0x08FC9AA8 + 0x2C * 0x02)
  219. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x03, 0xCC, 0x0E, 0x5B, 0xFF, 0x00, 0x00

  220. .org (0x08FC9ABC + 0x2C * 0x02)
  221. .word STR_SUMMARY_FLYING

  222. .org (0x08FC9AD0 + 0x2C * 0x02)
  223. .byte 0x02

  224. .org (0x08FCD3FC + 0x08 * 0x02)
  225. .word StonePic
  226. .word StonePal

  227. .org (0x08FC9AA8 + 0x2C * 0x03)
  228. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x03, 0x63, 0xFF, 0x00, 0x00, 0x00, 0x00

  229. .org (0x08FC9ABC + 0x2C * 0x03)
  230. .word STR_SUMMARY_POISON

  231. .org (0x08FC9AD0 + 0x2C * 0x03)
  232. .byte 0x03

  233. .org (0x08FCD3FC + 0x08 * 0x03)
  234. .word StonePic
  235. .word StonePal

  236. .org (0x08FC9AA8 + 0x2C * 0x04)
  237. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x03, 0x1F, 0x09, 0x7E, 0xFF, 0x00, 0x00

  238. .org (0x08FC9ABC + 0x2C * 0x04)
  239. .word STR_SUMMARY_GROUND

  240. .org (0x08FC9AD0 + 0x2C * 0x04)
  241. .byte 0x04

  242. .org (0x08FCD3FC + 0x08 * 0x04)
  243. .word StonePic
  244. .word StonePal

  245. .org (0x08FC9AA8 + 0x2C * 0x05)
  246. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x0E, 0xBB, 0x0B, 0xEB, 0xFF, 0x00, 0x00

  247. .org (0x08FC9ABC + 0x2C * 0x05)
  248. .word STR_SUMMARY_ROCK

  249. .org (0x08FC9AD0 + 0x2C * 0x05)
  250. .byte 0x05

  251. .org (0x08FCD3FC + 0x08 * 0x05)
  252. .word StonePic
  253. .word StonePal

  254. .org (0x08FC9AA8 + 0x2C * 0x06)
  255. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x02, 0x68, 0xFF, 0x00, 0x00, 0x00, 0x00

  256. .org (0x08FC9ABC + 0x2C * 0x06)
  257. .word STR_SUMMARY_BUG

  258. .org (0x08FC9AD0 + 0x2C * 0x06)
  259. .byte 0x06

  260. .org (0x08FCD3FC + 0x08 * 0x06)
  261. .word StonePic
  262. .word StonePal

  263. .org (0x08FC9AA8 + 0x2C * 0x07)
  264. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x04, 0xB5, 0xFF, 0x00, 0x00, 0x00, 0x00

  265. .org (0x08FC9ABC + 0x2C * 0x07)
  266. .word STR_SUMMARY_GHOST

  267. .org (0x08FC9AD0 + 0x2C * 0x07)
  268. .byte 0x07

  269. .org (0x08FCD3FC + 0x08 * 0x07)
  270. .word StonePic
  271. .word StonePal

  272. .org (0x08FC9AA8 + 0x2C * 0x08)
  273. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x04, 0x40, 0xFF, 0x00, 0x00, 0x00, 0x00

  274. .org (0x08FC9ABC + 0x2C * 0x08)
  275. .word STR_SUMMARY_STEEL

  276. .org (0x08FC9AD0 + 0x2C * 0x08)
  277. .byte 0x08

  278. .org (0x08FCD3FC + 0x08 * 0x08)
  279. .word StonePic
  280. .word StonePal

  281. .org (0x08FC9AA8 + 0x2C * 0x09)
  282. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x05, 0x7D, 0xFF, 0x00, 0x00, 0x00, 0x00

  283. .org (0x08FC9ABC + 0x2C * 0x09)
  284. .word STR_SUMMARY_FIRE

  285. .org (0x08FC9AD0 + 0x2C * 0x09)
  286. .byte 0x0A

  287. .org (0x08FCD3FC + 0x08 * 0x09)
  288. .word StonePic
  289. .word StonePal

  290. .org (0x08FC9AA8 + 0x2C * 0x0A)
  291. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x0C, 0x51, 0xFF, 0x00, 0x00, 0x00, 0x00

  292. .org (0x08FC9ABC + 0x2C * 0x0A)
  293. .word STR_SUMMARY_WATER

  294. .org (0x08FC9AD0 + 0x2C * 0x0A)
  295. .byte 0x0B

  296. .org (0x08FCD3FC + 0x08 * 0x0A)
  297. .word StonePic
  298. .word StonePal

  299. .org (0x08FC9AA8 + 0x2C * 0x0B)
  300. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x02, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00

  301. .org (0x08FC9ABC + 0x2C * 0x0B)
  302. .word STR_SUMMARY_GRASS

  303. .org (0x08FC9AD0 + 0x2C * 0x0B)
  304. .byte 0x0C

  305. .org (0x08FCD3FC + 0x08 * 0x0B)
  306. .word StonePic
  307. .word StonePal

  308. .org (0x08FC9AA8 + 0x2C * 0x0C)
  309. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x03, 0x2E, 0xFF, 0x00, 0x00, 0x00, 0x00

  310. .org (0x08FC9ABC + 0x2C * 0x0C)
  311. .word STR_SUMMARY_ELECTRIC

  312. .org (0x08FC9AD0 + 0x2C * 0x0C)
  313. .byte 0x0D

  314. .org (0x08FCD3FC + 0x08 * 0x0C)
  315. .word StonePic
  316. .word StonePal

  317. .org (0x08FC9AA8 + 0x2C * 0x0D)
  318. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x02, 0x2E, 0x09, 0xD2, 0xFF, 0x00, 0x00

  319. .org (0x08FC9ABC + 0x2C * 0x0D)
  320. .word STR_SUMMARY_PSYCHIC

  321. .org (0x08FC9AD0 + 0x2C * 0x0D)
  322. .byte 0x0E

  323. .org (0x08FCD3FC + 0x08 * 0x0D)
  324. .word StonePic
  325. .word StonePal

  326. .org (0x08FC9AA8 + 0x2C * 0x0E)
  327. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x01, 0xB6, 0xFF, 0x00, 0x00, 0x00, 0x00

  328. .org (0x08FC9ABC + 0x2C * 0x0E)
  329. .word STR_SUMMARY_ICE

  330. .org (0x08FC9AD0 + 0x2C * 0x0E)
  331. .byte 0x0F

  332. .org (0x08FCD3FC + 0x08 * 0x0E)
  333. .word StonePic
  334. .word StonePal

  335. .org (0x08FC9AA8 + 0x2C * 0x0F)
  336. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x08, 0xCD, 0xFF, 0x00, 0x00, 0x00, 0x00

  337. .org (0x08FC9ABC + 0x2C * 0x0F)
  338. .word STR_SUMMARY_DRAGON

  339. .org (0x08FC9AD0 + 0x2C * 0x0F)
  340. .byte 0x010

  341. .org (0x08FCD3FC + 0x08 * 0x0F)
  342. .word StonePic
  343. .word StonePal

  344. .org (0x08FC9AA8 + 0x2C * 0x10)
  345. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x03, 0x96, 0xFF, 0x00, 0x00, 0x00, 0x00

  346. .org (0x08FC9ABC + 0x2C * 0x10)
  347. .word STR_SUMMARY_DARK

  348. .org (0x08FC9AD0 + 0x2C * 0x10)
  349. .byte 0x11

  350. .org (0x08FCD3FC + 0x08 * 0x10)
  351. .word StonePic
  352. .word StonePal

  353. .org (0x08FC9AA8 + 0x2C * 0x11)
  354. .byte 0x07, 0xA5, 0x0E, 0x5C, 0x0B, 0xEB, 0x00, 0x0E, 0xE6, 0x07, 0x5B, 0xFF, 0x00, 0x00

  355. .org (0x08FC9ABC + 0x2C * 0x11)
  356. .word STR_SUMMARY_FAIRY

  357. .org (0x08FC9AD0 + 0x2C * 0x11)
  358. .byte 0x17

  359. .org (0x08FCD3FC + 0x08 * 0x11)
  360. .word StonePic
  361. .word StonePal

  362. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-4 15:01:57 | 显示全部楼层
本帖最后由 本站第一萌新 于 2020-5-4 15:06 编辑

输入脚本地址,执行脚本
也是和初始村蓝胖对话查看效果
顺便说一下,我是因为偷懒才这么搞得。如果你想作用于其他NPC,请删掉
  1. .org 0x089C0DFC
  2. .word Script_ScriptRunner
复制代码
并将Script_ScriptRunner给你想要的NPC
  1. .gba
  2. .thumb
  3. .loadtable "header/CharTable.txt"
  4. .include "header/ArmipsMacros.asm"
  5. .create "3.0.gba",0x8000000
  6. .close
  7. .open "test.gba","3.0.gba", 0x8000000

  8. .org 0x08F80000
  9. .func ScriptRunner
  10.         push {r4-r5, lr}
  11.         ldr r0, =(Task_SRProcessInput|1)
  12.         mov r1, #0
  13.         ldr r4, =(0x080A8FB0|1)
  14.         bl call_bx
  15.         ldr r5, =0x03005E00
  16.         mov r1, #40
  17.         mul r0, r1
  18.         add r5, r0
  19.         mov r0, #0 ;X
  20.         mov r1, #0 ;Y
  21.         mov r2, #8 ;W
  22.         mov r3, #2 ;H
  23.         ldr r4, =(0x080E2A1C|1)
  24.         bl call_bx
  25.         strh r0, [r5, #8] ;twindowId
  26.         mov r1, #0
  27.         strh r1, [r5, #10] ;tstate
  28.         str r1, [r5, #12] ;tpointer
  29.         strh r1, [r5, #16] ;tslot
  30.         mov r1, #0
  31.         ldr r4, =(0x08197854|1)
  32.         bl call_bx
  33.         mov r0, #0
  34.         ldr r4, =(0x081999BC|1)
  35.         bl call_bx
  36.         pop {r4-r5, pc}
  37. .endfunc
  38. .pool

  39. .func Task_SRProcessInput
  40.         push {r4-r7, lr}
  41.         mov r5, r0
  42.         ldr r7, =0x03005E00
  43.         mov r1, #40
  44.         mul r0, r1
  45.         add r7, r0
  46.         ldrh r6, [r7, #8] ;twindowId
  47.         ldrh r0, [r7, #10] ;tstate
  48.         cmp r0, #0
  49.         beq ShowScriptRunner
  50.         ldr r0, =0x030022C0
  51.         ldrh r0, [r0, #0x2E]
  52.         cmp r0, #1
  53.         beq A_Pressed
  54.         cmp r0, #2
  55.         beq B_Pressed
  56.         cmp r0, #0x10
  57.         beq Right_Pressed
  58.         cmp r0, #0x20
  59.         beq Left_Pressed
  60.         cmp r0, #0x40
  61.         beq Up_Pressed
  62.         cmp r0, #0x80
  63.         beq Down_Pressed
  64.         b InputEnd
  65. A_Pressed:
  66.         ldr r0, =0x020375E0
  67.         strh r5, [r0]
  68.         mov r1, #1
  69.         strh r1, [r0, #0x10]
  70.         b InputEnd ;理论上这里应该先把window free了,但是懒得改了
  71. B_Pressed:
  72.         mov r0, r5
  73.         mov r1, r6
  74.         bl DeleteTaskAndFreeWindow
  75.         ldr r0, =0x020375E0
  76.         mov r1, #0
  77.         strh r1, [r0, #0x10]
  78.         b InputEnd
  79. Right_Pressed:
  80.         ldrh r0, [r7, #16]
  81.         cmp r0, #3
  82.         bge InputEnd
  83.         add r0, #1
  84.         strh r0, [r7, #16]
  85.         mov r2, r0
  86.         ldr r0, [r7, #12]
  87.         mov r1, r6
  88.         bl ShowPointer
  89.         b InputEnd
  90. Left_Pressed:
  91.         ldrh r0, [r7, #16]
  92.         cmp r0, #0
  93.         ble InputEnd
  94.         sub r0, #1
  95.         strh r0, [r7, #16]
  96.         mov r2, r0
  97.         ldr r0, [r7, #12]
  98.         mov r1, r6
  99.         bl ShowPointer
  100.         b InputEnd
  101. Up_Pressed:
  102.         ldrh r0, [r7, #16]
  103.         mov r1, #3
  104.         sub r1, r0
  105.         mov r2, r7
  106.         add r2, #12
  107.         ldrb r0, [r2, r1]
  108.         cmp r0, #0xFF
  109.         bge InputEnd
  110.         add r0, #1
  111.         strb r0, [r2, r1]
  112.         ldr r0, [r7, #12]
  113.         mov r1, r6
  114.         ldrh r2, [r7, #16]
  115.         bl ShowPointer
  116.         b InputEnd
  117. Down_Pressed:
  118.         ldrh r0, [r7, #16]
  119.         mov r1, #3
  120.         sub r1, r0
  121.         mov r2, r7
  122.         add r2, #12
  123.         ldrb r0, [r2, r1]
  124.         cmp r0, #0
  125.         ble InputEnd
  126.         sub r0, #1
  127.         strb r0, [r2, r1]
  128.         ldr r0, [r7, #12]
  129.         mov r1, r6
  130.         ldrh r2, [r7, #16]
  131.         bl ShowPointer
  132.         b InputEnd
  133. ShowScriptRunner:
  134.         ldr r0, [r7, #12] ;tpointer
  135.         mov r1, r6 ;twindowId
  136.         ldrh r2, [r7, #16] ;tslot
  137.         bl ShowPointer
  138.         mov r0, #1
  139.         strh r0, [r7, #10]
  140. InputEnd:
  141.         pop {r4-r7, pc}
  142. .endfunc
  143. .pool

  144. .func ShowPointer
  145.         push {r4-r7, lr}
  146.         mov r4, r8
  147.         push {r4}
  148.         add sp, #-8
  149.         mov r5, r0
  150.         mov r8, r1
  151.         mov r6, r2
  152.         mov r0, r1
  153.         mov r1, #17
  154.         ldr r4, =(0x08003C48|1)
  155.         bl call_bx
  156.         mov r7, #0
  157. PrintPointerLoop:
  158.         cmp r7, #4
  159.         bge LoopEnd
  160.         mov r0, #0xFF
  161.         mov r1, #8
  162.         mov r2, #3
  163.         sub r2, r7
  164.         mul r1, r2
  165.         lsl r0, r1
  166.         and r0, r5
  167.         lsr r0, r1
  168.         mov r1, r0
  169.         ldr r0, =0x02021FC4
  170.         mov r2, #2
  171.         mov r3, #2
  172.         ldr r4, =(0x08008E20|1)
  173.         bl call_bx
  174.         cmp r7, r6
  175.         bne NotHighLight
  176.         ldr r0, =0x02021EC4
  177.         ldr r1, =gText_HignLight
  178.         ldr r4, =(0x08008EE0|1)
  179.         bl call_bx
  180.         ldr r0, =0x02021EC4
  181.         ldr r1, =0x02021FC4
  182.         ldr r4, =(0x08008BC0|1)
  183.         bl call_bx
  184.         mov r0, #0
  185.         str r0, [sp]
  186.         str r0, [sp, #4]
  187.         mov r0, r8
  188.         ldr r1, =0x02021EC4
  189.         mov r2, #16
  190.         mul r2, r7
  191.         add r2, #1
  192.         mov r3, #1
  193.         ldr r4, =(0x080E04A4|1)
  194.         bl call_bx
  195.         b PrepareToNext
  196. NotHighLight:
  197.         mov r0, #0
  198.         str r0, [sp]
  199.         str r0, [sp, #4]
  200.         mov r0, r8
  201.         ldr r1, =0x02021FC4
  202.         mov r2, #16
  203.         mul r2, r7
  204.         add r2, #1
  205.         mov r3, #1
  206.         ldr r4, =(0x080E04A4|1)
  207.         bl call_bx
  208. PrepareToNext:
  209.         add r7, #1
  210.         b PrintPointerLoop
  211. LoopEnd:
  212.         add sp, #8
  213.         pop {r4}
  214.         mov r8, r4
  215.         pop {r4-r7, pc}
  216. .endfunc
  217. .pool

  218. .func RunScript
  219.         push {r4-r5, lr}
  220.         ldr r0, =0x020375E0
  221.         ldrh r0, [r0] ;taskId
  222.         ldr r2, =0x03005E00
  223.         mov r1, #40
  224.         mul r1, r0
  225.         add r2, r1
  226.         ldrh r1, [r2, #8]
  227.         ldr r5, [r2, #12]
  228.         bl DeleteTaskAndFreeWindow
  229.         mov r0, r5
  230.         ldr r4, =(0x08098EF8|1)
  231.         bl call_bx
  232.         pop {r4-r5, pc}
  233. .endfunc
  234. .pool

  235. .func DeleteTaskAndFreeWindow
  236.         push {r4-r5, lr}
  237.         mov r5, r1
  238.         ldr r4, =(0x080A909C|1)
  239.         bl call_bx
  240.         mov r0, r5
  241.         ldr r4, =(0x080E2A78|1)
  242.         bl call_bx
  243.         pop {r4-r5, pc}
  244. .endfunc
  245. .pool

  246. .func call_bx
  247.         bx r4
  248. .endfunc
  249. .pool

  250. gText_HignLight:
  251. .string "[文本色_红]"

  252. Script_ScriptRunner:
  253.         lock
  254.         faceplayer
  255.         preparemsg gText_PleaseInput
  256.         waitmsg
  257.         callasm (ScriptRunner|1)
  258.         waitkeypress
  259.         compare 0x800D, 1
  260.         if1 0x1, Script_RunScript
  261.         msgbox gText_Cancel, 0x6
  262.         release
  263.         end
  264. Script_RunScript:
  265.         release
  266.         callasm (RunScript|1)

  267. .org 0x089C0DFC
  268. .word Script_ScriptRunner

  269. gText_PleaseInput:
  270. .string "欢迎使用脚本执行器,\n请输入脚本地址:"

  271. gText_Cancel:
  272. .string "输入取消!"

  273. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-4 20:26:16 | 显示全部楼层
入门时候写的,使得所有野生精灵(包括赠送精灵)变成闪光
不过指定PID的精灵好像不会有效果,不过我也懒得去改了
  1. .gba
  2. .thumb
  3. .create "3.0.gba",0x8000000
  4. .close
  5. .open "test.gba","3.0.gba", 0x8000000

  6. .org 0x08F80000
  7. .func ShinyHack
  8.         push {r4-r6}
  9.         ldr r3, =(0x0806F5CC|1)
  10.         bl call_bx
  11.         mov r4, r0
  12.         ldr r3, =(0x0806F5CC|1)
  13.         bl call_bx       
  14.         mov r5, #7
  15.         and r5, r0
  16.         ldr r3, =(0x080F0020|1)
  17.         bl call_bx
  18.         lsl r6, r0, #16
  19.         lsr r6, #16       
  20.         lsr r0, #16       
  21.         eor r0, r6
  22.         eor r0, r4
  23.         eor r0, r5
  24.         lsl r0, #16
  25.         orr r0, r4
  26.         mov r1, r0
  27.         pop {r4-r6}
  28.         ldr r3, =(0x0806AF8C|1)
  29.         bx r3
  30. .endfunc
  31. .pool

  32. .func call_bx
  33.         bx r3
  34. .endfunc
  35. .pool

  36. .org 0x0806AF84
  37.         ldr r3, =(ShinyHack|1)
  38.         bx r3
  39. .pool

  40. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-5 20:26:35 | 显示全部楼层
显示觉醒力量属性(包括战斗中选择技能页面),威力
这一段代码还有很大的优化空间
  1. .gba
  2. .thumb
  3. .create "3.0.gba",0x8000000
  4. .close
  5. .open "test.gba","3.0.gba", 0x8000000

  6. .org 0x08F80000
  7. .func SetMoveTypeIconsHack
  8.         cmp r0, #237
  9.         bne NotHiddenPower1
  10.         mov r0, #0
  11.         bl GetType
  12.         ldr r3, =(0x081C4448|1)
  13.         bx r3
  14. NotHiddenPower1:
  15.         mov r1, r0
  16.         lsl r0, r1, #1
  17.         add r0, r1
  18.         lsl r0, #2
  19.         ldr r3, =(0x081C4444|1)
  20.         bx r3
  21. .endfunc
  22. .pool
  23.        
  24. .func MoveSelectionDisplayMoveTypeHack
  25.         cmp r2, #237
  26.         bne NotHiddenPower2
  27.         mov r4, r0
  28.         mov r0, #1
  29.         bl GetType
  30.         mov r2, r0
  31.         mov r0, r4
  32.         b Back
  33. NotHiddenPower2:
  34.         lsl r1, r2, #1
  35.         add r1, r2
  36.         lsl r1, #2
  37.         add r1, r3
  38.         ldrb r2, [r1, #2]
  39. Back:       
  40.         ldr r3, =(0x08059BF2|1)
  41.         bx r3
  42. .endfunc
  43. .pool

  44. .func PrintMovePowerHack
  45.         cmp r4, #237
  46.         bne NotHiddenPower3
  47.         bl GetPower
  48.         mov r1, r0
  49.         ldr r4, =0x02021CC4
  50.         ldr r3, =(0x081C3CA0|1)
  51.         bx r3
  52. NotHiddenPower3:
  53.         add r2, r0, r2
  54.         ldrb r0, [r2, #1]
  55.         mov r6, r1
  56.         cmp r0, #1       
  57.         ldr r3, =(0x081C3C8C|1)       
  58.         bx r3
  59. .endfunc
  60. .pool

  61. .func GetType ;r0 = isinbattle
  62.         push {r4-r5, lr}
  63.         add sp, #-12
  64.         cmp r0, #1
  65.         bne SummaryScreen
  66.         ldr r0, =0x02024064
  67.         ldrb r0, [r0]
  68.         ldr r3, =(0x08E1833C|1)
  69.         bl call_bx
  70.         b GetIvs1
  71. SummaryScreen:
  72.         ldr r0, =0x0203CF1C
  73.         ldr r0, [r0]
  74.         add r0, #0xC
  75. GetIvs1:
  76.         mov r1, sp
  77.         bl GetIvs
  78.         mov r4, #0
  79.         mov r5, #0
  80. GetTypeLoop:
  81.         cmp r4, #6
  82.         bge GetTypeLoopEnd
  83.         mov r0, #1
  84.         lsl r1, r4, #1
  85.         mov r2, sp
  86.         ldrh r1, [r2, r1]
  87.         and r0, r1
  88.         lsl r0, r4
  89.         orr r5, r0
  90.         add r4, #1
  91.         b GetTypeLoop
  92. GetTypeLoopEnd:
  93.         mov r0, #15
  94.         mul r0, r5
  95.         mov r1, #63
  96.         ldr r3, =(0x082E7B68|1)
  97.         bl call_bx
  98.         add r0, #1
  99.         cmp r0, #9
  100.         blt LessThanMy
  101.         add r0, #1
  102. LessThanMy:       
  103.         add sp, #12
  104.         pop {r4-r5, pc}
  105. .endfunc
  106. .pool

  107. .func GetPower
  108.         push {r4-r5, lr}
  109.         add sp, #-12
  110.         ldr r0, =0x0203CF1C
  111.         ldr r0, [r0]
  112.         add r0, #0xC
  113.         mov r1, sp
  114.         bl GetIvs
  115.         mov r0, sp
  116.         ldrh r0, [r0]
  117.         mov r1, #2
  118.         and r0, r1
  119.         lsr r5, r0, #1
  120.         mov r4, #1
  121. GetPowerLoop:
  122.         cmp r4, #6
  123.         bge GetPowerLoopEnd
  124.         mov r0, #2
  125.         lsl r1, r4, #1
  126.         mov r2, sp
  127.         ldrh r1, [r2, r1]
  128.         and r0, r1
  129.         sub r1, r4, #1
  130.         lsl r0, r1
  131.         orr r5, r0
  132.         add r4, #1
  133.         b GetPowerLoop
  134. GetPowerLoopEnd:
  135.         mov r0, #40
  136.         mul r0, r5
  137.         mov r1, #63
  138.         ldr r3, =(0x082E7B68|1)
  139.         bl call_bx
  140.         add r0, #30
  141.         add sp, #12
  142.         pop {r4-r5, pc}
  143. .endfunc
  144. .pool


  145. .func GetIvs
  146.         push {r4-r6, lr}
  147.         mov r5, r0
  148.         mov r6, r1
  149.         mov r4, #0
  150. GetIvsLoop:
  151.         cmp r4, #6
  152.         bge GetIvsLoopEnd
  153.         mov r0, r5
  154.         mov r1, #0x27
  155.         add r1, r4
  156.         mov r2, #0
  157.         ldr r3, =(0x0806A518|1)
  158.         bl call_bx
  159.         lsl r1, r4, #1
  160.         strh r0, [r1, r6]
  161.         add r4, #1
  162.         b GetIvsLoop
  163. GetIvsLoopEnd:
  164.         pop {r4-r6, pc}
  165. .endfunc
  166. .pool

  167. .func call_bx
  168.         bx r3
  169. .endfunc
  170. .pool

  171. .org 0x081C443C
  172.         ldr r3, =(SetMoveTypeIconsHack|1)
  173.         bx r3
  174. .pool       

  175. .org 0x081C3C84
  176.         ldr r3, =(PrintMovePowerHack|1)
  177.         bx r3
  178. .pool

  179. .org 0x08059BE8
  180.         ldr r1, =(MoveSelectionDisplayMoveTypeHack|1)
  181.         bx r1
  182. .pool

  183. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

28

帖子

121

现金

0

勋章券

新伙伴的欢笑

Rank: 3

积分
69
发表于 2020-5-6 00:11:18 来自手机 | 显示全部楼层
本站第一萌新 发表于 2020-5-2 21:14
模仿jzw聚聚早期做的一个滚动式多选框(虽说是模仿其实我根本没看他的是怎么实现的,也没看效果,只是觉得 ...

请问,原版绿宝石多选对话框在哪里呢
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-6 07:26:03 | 显示全部楼层
1696774136 发表于 2020-5-6 00:11
请问,原版绿宝石多选对话框在哪里呢

0x0858B760
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-6 14:43:50 | 显示全部楼层
本帖最后由 本站第一萌新 于 2020-5-6 14:47 编辑

昼夜使用不同调色板
注意:本代码仅为研究,我看了下和某绿的实现方式不同(那个暂且不懂,只是大概看了下是每帧都在判断),安全性和实用性暂且未知,只是发出来做个记录
  1. .gba
  2. .thumb
  3. .create "3.0.gba",0x8000000
  4. .close
  5. .open "test.gba","3.0.gba", 0x8000000

  6. .org 0x08F80000
  7. .func DayNight
  8.         ldr r0, =0x083DF704
  9.         cmp r0, r4
  10.         bne Normal
  11.         ldr r0, =0x03005CF8
  12.         ldrb r0, [r0, #2]
  13.         cmp r0, #6
  14.         bge Normal
  15. UseNightPal:
  16.         ldr r0, =(NightPal + 2)
  17.         b Back
  18. Normal:
  19.         cmp r0, #18 ;6-18点使用原调色板(白天),其余使用自定义调色板(夜晚)
  20.         bge UseNightPal
  21.         ldr r0, [r4, #8]
  22.         add r0, #2
  23. Back:
  24.         add r5, #1
  25.         ldr r3, =(0x08088CFE|1)
  26.         bx r3
  27. .endfunc
  28. .pool

  29. .align 2
  30. NightPal:
  31.         ;请在此处书写你的调色板 请仿照08DD4E10写至少5个(多了不会用到,但原版有不止5个)

  32. .org 0x08088CF4
  33.         ldr r3, =(DayNight|1)
  34.         bx r3
  35. .pool

  36. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-6 17:21:42 | 显示全部楼层
本帖最后由 本站第一萌新 于 2020-5-7 15:56 编辑

之前做过的一个比较有意思的程序,随机在自定义的精灵库中抽取精灵构成双方队伍来进行对战。并且在战斗中禁用背包。之前是用C写的,我用ASM重写了一遍并删去了一些功能
以使其方便新手使用
此代码存在很大的修改空间,如可用r8储存目前的精灵数据地址。我由于是随便抽了一点时间写的所以没有进行修改。有兴趣的可以自己改进一下。
  1. .gba
  2. .thumb
  3. .create "3.0.gba",0x8000000
  4. .close
  5. .open "test.gba","3.0.gba", 0x8000000

  6. .macro RandomPoke, species, helditem, move1, move2, move3, move4, nature, abilityNum
  7. .halfword species
  8. .halfword helditem
  9. .byte HPIV, attIV, defIV, speIV, spaIV, spdIV
  10. .byte HPEV, attEV, defEV, speEV, spaEV, spdEV
  11. .halfword move1, move2, move3, move4
  12. .byte nature
  13. .byte abilityNum
  14. .endmacro

  15. .macro RandomPokeEnd
  16. .halfword 0x0
  17. .halfword 0x0
  18. .byte 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
  19. .byte 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
  20. .halfword 0x0, 0x0, 0x0, 0x0
  21. .byte 0x0
  22. .byte 0x0
  23. .endmacro

  24. .org 0x08F80000
  25. .func CheckIsRandom
  26.         ldr r3, =(0x0806EA68|1)
  27.         bl call_bx
  28.         mov r0, #128
  29.         lsl r0, #7
  30.         add r0, #18        ;0x4012
  31.         ldr r3, =(0x0809D790|1)
  32.         bl call_bx
  33.         cmp r0, #0
  34.         beq CheckEnd
  35.         bl LoadParties
  36. CheckEnd:
  37.         ldr r1, =0x030022C0
  38.         mov r2, #33
  39.         lsl r2, #5
  40.         add r2, #25        ;0x439
  41.         ldr r3, =(0x080369EC|1)
  42.         bx r3
  43. .endfunc
  44. .pool

  45. .func LoadParties
  46.         push {lr}
  47.         ldr r3, =(0x08067B0C|1)
  48.         bl call_bx
  49.         ldr r3, =(0x08067B2C|1)
  50.         bl call_bx
  51.         ldr r0, =0x020244EC
  52.         bl LoadParty
  53.         ldr r0, =0x02024744
  54.         bl LoadParty
  55.         pop {pc}
  56. .endfunc
  57. .pool

  58. .func LoadParty
  59.         push {r4-r7, lr}
  60.         add sp, #-4
  61.         mov r4, r0
  62.         mov r5, #0
  63.         b GetMaxIdLoop
  64. GetSpecieLoopEnd: ;out of range
  65.         add sp, #4
  66.         pop {r4-r7, pc}       
  67. GetMaxIdLoop:
  68.         ldr r0, =gRandomPokes
  69.         mov r1, #26
  70.         mul r1, r5
  71.         add r0, r1
  72.         ldrh r0, [r0]
  73.         cmp r0, #0
  74.         beq GetMaxIdLoopEnd
  75.         add r5, #1
  76.         b GetMaxIdLoop
  77. GetMaxIdLoopEnd:
  78.         mov r6, #0
  79. GetSpecieLoop:
  80.         cmp r6, #6
  81.         bge GetSpecieLoopEnd
  82. GetRandomSpecie:
  83.         ldr r3, =(0x0806F5CC|1)
  84.         bl call_bx
  85.         mov r1, r5
  86.         ldr r3, =(0x082E7BE0|1)
  87.         bl call_bx
  88.         add r1, r0, #1
  89.         mov r7, #0
  90. CheckRepeatLoop:
  91.         cmp r7, r6
  92.         bge CheckRepeatLoopEnd
  93.         mov r3, #100
  94.         mul r3, r7
  95.         add r3, r4
  96.         ldrh r2, [r3, #30]
  97.         cmp r1, r2
  98.         beq CheckRepeatLoopEnd
  99.         add r7, #1
  100.         b CheckRepeatLoop
  101. CheckRepeatLoopEnd:
  102.         cmp r6, r7
  103.         bne GetRandomSpecie
  104.         mov r7, r0
  105.         ldr r1, =gRandomPokes
  106.         mov r2, #26
  107.         mul r0, r2
  108.         add r0, r1
  109.         ldrb r1, [r0, #24]
  110.         str r1, [sp]
  111.         ldrh r1, [r0]
  112.         mov r0, #100
  113.         mul r0, r6
  114.         add r0, r4
  115.         mov r2, #100
  116.         mov r3, #0
  117.         mov r5, r4
  118.         ldr r4, =(0x08067E90|1)
  119.         bl call_bx2
  120.         mov r4, r5
  121.         add r0, r7, #1
  122.         mov r3, #100
  123.         mul r3, r6
  124.         add r3, r4
  125.         strh r0, [r3, #30]
  126.         mov r0, #0xFF
  127.         str r0, [sp]
  128.         mov r0, #100
  129.         mul r0, r6
  130.         add r0, r4
  131.         mov r1, #0x15
  132.         mov r2, sp
  133.         ldr r3, =(0x0806ACAC|1)
  134.         bl call_bx
  135.         mov r0, #100
  136.         mul r0, r6
  137.         add r0, r4
  138.         mov r1, #0x20
  139.         mov r2, sp
  140.         ldr r3, =(0x0806ACAC|1)
  141.         bl call_bx
  142.         ldr r2, =gRandomPokes
  143.         add r2, #2
  144.         mov r0, #26
  145.         mul r0, r7
  146.         add r2, r0
  147.         mov r1, #0xC
  148.         mov r0, #100
  149.         mul r0, r6
  150.         add r0, r4
  151.         ldr r3, =(0x0806ACAC|1)
  152.         bl call_bx
  153.         mov r5, #0
  154. SetMoveLoop:
  155.         cmp r5, #4
  156.         bge SetMoveLoopEnd
  157.         ldr r2, =gRandomPokes
  158.         add r2, #16
  159.         mov r0, #26
  160.         mul r0, r7
  161.         add r2, r0
  162.         lsl r0, r5, #1
  163.         add r2, r0
  164.         mov r1, #0xD
  165.         add r1, r5
  166.         mov r0, #100
  167.         mul r0, r6
  168.         add r0, r4
  169.         ldr r3, =(0x0806ACAC|1)
  170.         bl call_bx
  171.         ldr r2, =gRandomPokes
  172.         add r2, #16
  173.         mov r0, #26
  174.         mul r0, r7
  175.         add r2, r0
  176.         lsl r1, r5, #1
  177.         ldrh r0, [r2, r1]
  178.         mov r1, #0xFF
  179.         mov r2, r5
  180.         ldr r3, =(0x0806B960|1)
  181.         bl call_bx
  182.         str r0, [sp]
  183.         mov r2, sp
  184.         mov r0, #100
  185.         mul r0, r6
  186.         add r0, r4
  187.         mov r1, #0x11
  188.         add r1, r5
  189.         ldr r3, =(0x0806ACAC|1)
  190.         bl call_bx
  191.         add r5, #1
  192.         b SetMoveLoop
  193. SetMoveLoopEnd:
  194.         mov r5, #0
  195. SetIVEVLoop:
  196.         cmp r5, #6
  197.         bge SetIVEVLoopEnd
  198.         mov r1, #0x27
  199.         add r1, r5
  200.         ldr r2, =gRandomPokes
  201.         add r2, #4
  202.         mov r0, #26
  203.         mul r0, r7
  204.         add r2, r0
  205.         add r2, r5
  206.         mov r0, #100
  207.         mul r0, r6
  208.         add r0, r4
  209.         ldr r3, =(0x0806ACAC|1)
  210.         bl call_bx
  211.         mov r1, #0x1A
  212.         add r1, r5
  213.         ldr r2, =gRandomPokes
  214.         add r2, #10
  215.         mov r0, #26
  216.         mul r0, r7
  217.         add r2, r0
  218.         add r2, r5
  219.         mov r0, #100
  220.         mul r0, r6
  221.         add r0, r4
  222.         ldr r3, =(0x0806ACAC|1)
  223.         bl call_bx
  224.         add r5, #1
  225.         b SetIVEVLoop
  226. SetIVEVLoopEnd:
  227.         ldr r2, =gRandomPokes
  228.         add r2, #25
  229.         mov r0, #26
  230.         mul r0, r7
  231.         add r2, r0
  232.         mov r1, #0x2E
  233.         mov r0, #100
  234.         mul r0, r6
  235.         add r0, r4
  236.         ldr r3, =(0x0806ACAC|1)
  237.         bl call_bx
  238.         mov r0, #100
  239.         mul r0, r6
  240.         add r0, r4
  241.         ldr r3, =(0x08068D0C|1)
  242.         bl call_bx
  243.         add r6, #1
  244.         b GetSpecieLoop
  245. .endfunc
  246. .pool

  247. .func CantUseBagHack
  248.         ldr r1, =0x021F0902
  249.         and r0, r1
  250.         cmp r0, #0
  251.         bne CantUseBag
  252.         mov r0, #128
  253.         lsl r0, #7
  254.         add r0, #18        ;0x4012
  255.         ldr r3, =(0x0809D790|1)
  256.         bl call_bx
  257.         cmp r0, #0
  258.         bne CantUseBag
  259.         ldr r3, =(0x0803C48C|1)
  260.         bx r3
  261. CantUseBag:
  262.         ldr r3, =(0x0803C23E|1)
  263.         bx r3
  264. .endfunc
  265. .pool
  266.        
  267. .func call_bx
  268.         bx r3
  269. .endfunc
  270. .pool
  271.        
  272. .func call_bx2
  273.         bx r4
  274. .endfunc
  275. .pool

  276. .align 2
  277. gRandomPokes:
  278. RandomPoke 0x71, 0x22C, 0x1F, 0x0, 0x1F, 0x1F, 0x0, 0x1F, 0xFC, 0x0, 0x4, 0x0, 0x0, 0xFC, 0x45, 0x5C, 0x87, 0x138, 0x14, 0x0
  279. RandomPoke 0x321, 0x220, 0x1F, 0x0, 0x1F, 0x1F, 0x1F, 0x1F, 0xFC, 0x0, 0x4, 0x0, 0x0, 0xFC, 0x1F7, 0x186, 0x69, 0x72, 0x14, 0x1
  280. RandomPoke 0x142, 0x149, 0x1F, 0x1F, 0x1F, 0x1F, 0x0, 0x1F, 0xFC, 0x0, 0xFC, 0x0, 0x0, 0x4, 0x11A, 0x105, 0x69, 0xB6, 0x8, 0x1
  281. RandomPoke 0xE3, 0x22E, 0x1F, 0x1F, 0x1F, 0x1F, 0x0, 0x1F, 0xFC, 0x0, 0xFC, 0x0, 0x0, 0x4, 0x19D, 0x1BE, 0x1B0, 0x163, 0x8, 0x1
  282. RandomPoke 0x28B, 0xC8, 0x1F, 0x1F, 0x1F, 0x0, 0x0, 0x1F, 0xFC, 0x0, 0xFC, 0x0, 0x0, 0x4, 0x168, 0x1B6, 0x49, 0xB6, 0x7, 0x0
  283. RandomPoke 0x278, 0xC8, 0x1F, 0x0, 0x1F, 0x1F, 0x1F, 0x1F, 0xFC, 0x0, 0xFC, 0x0, 0x0, 0x4, 0x1D9, 0x19B, 0x15B, 0x69, 0x14, 0x1
  284. RandomPokeEnd

  285. .org 0x080369E4
  286.         ldr r3, =(CheckIsRandom|1)
  287.         bx r3
  288. .pool

  289. .org 0x0803C234
  290.         ldr r3, =(CantUseBagHack|1)
  291.         bx r3
  292. .pool

  293. .close
复制代码
如果你要新增精灵,请在gRandomPokes的末尾(RandomPokeEnd之前)以
  1. RandomPoke 种类, 道具, HPIV, attIV, defIV, speIV, spaIV, spdIV,  HPEV, attEV, defEV, speEV, spaEV, spdEV, 技能1, 技能2, 技能3, 技能4, 性格, 特性ID
复制代码
的方式书写。(性格可以去看金手指找,特性ID就是精灵种族对应的两种特性)
我已经添加了6只精灵,不过这是适用于绿宝石802的。如果你用的是绿宝石原版或者不想保留我的设定,删掉他们,但请保证至少有6只精灵
示例脚本:
#freespace 0xFF
#dynamic 0xF85000
#org @RandomBattle
setflag 0x273                        //开启允许战败
setflag 0x4012                        //开启随机对战
special 0x28                        //储存队伍
trainerbattle 1 [训练师ID] 0 @msg1 @msg2 @ScriptAfterBattle
end

#org @ScriptAfterBattle
msgbox @msg3 2
settrainerflag [训练师ID]         //设置训练师可再次对战
special 0x29                        //恢复队伍
clearflag 0x4012                        //禁用随机对战
clearflag 0x273                        //禁用允许战败
end

#org @msg1
= ...

#org @msg2
= ...

#org @msg3
= ...
0x273这个flag在802中用于控制是否能够战败,不过我不确定绿宝石原版有没有这个flag。如果没有的话你可以自己研究或者找我,我有时间的话会帮你看看
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-7 08:28:15 | 显示全部楼层
新增一个王者状态,拥有此状态的精灵的能力值将比同类多出1/4
在精灵页面和队伍中将会显示状态图标。当有其他状态存在时,将会显示其他状态的图标
战斗中遇到王者精灵将会有提示
这个也是很久前写的了,而且用的是蛇皮写法。所以逻辑性可能较差,勉强看看吧
  1. .gba
  2. .thumb
  3. .loadtable "header/CharTable.txt"
  4. .include "header/ArmipsBSMacros.asm"
  5. .create "3.0.gba",0x8000000
  6. .close
  7. .open "test.gba","3.0.gba", 0x8000000

  8. .org 0x08F80000
  9. .func CalculateMonStatsHack1
  10.         push {r2, lr}
  11.         ldr r3, =(0x0806D8D4|1)
  12.         bl call_bx
  13. CalculateMonStatsHack2:
  14.         ldrh r1, [r5, #30]
  15.         cmp r1, #0
  16.         beq Back
  17.         mov r1, #5
  18.         mul r0, r1
  19.         lsr r0, #2
  20. Back:
  21.         pop {r2, pc}
  22. .endfunc
  23. .pool       
  24.        
  25. .func HackType1
  26.         bl CalculateMonStatsHack1
  27.         mov r3, #70
  28.         mul r2, r3
  29.         ldr r3, =(0x08068E42|1)
  30.         add r3, r2
  31.         bx r3
  32. .endfunc
  33. .pool       
  34.        
  35. .func HackType2
  36.         bl CalculateMonStatsHack1
  37.         lsl r1, r2, #2
  38.         add r1, #4
  39.         add r1, sp
  40.         str r0, [r1]
  41.         mov r3, #70
  42.         mul r2, r3
  43.         ldr r3, =(0x08068E42|1)
  44.         add r3, #2
  45.         add r3, r2
  46.         bx r3
  47. .endfunc
  48. .pool       
  49.        
  50. .func HackHP
  51.         ldr r3, =(0x082E7540|1)
  52.         bl call_bx
  53.         add r0, r4
  54.         add r0, #0xA
  55.         mov r1, pc        ;蛇皮操作,请勿学习
  56.         add r1, #9
  57.         push {r1}
  58.         push {r2}
  59.         bl CalculateMonStatsHack2
  60.         ldr r3, =(0x08068E24|1)
  61.         bx r3
  62. .endfunc
  63. .pool

  64. .func RandomToBeKing
  65.         mov r1, #0x38
  66.         mov r2, sp
  67.         add r2, #10
  68.         ldr r3, =(0x0806ACAC|1)
  69.         bl call_bx
  70.         ldr r3, =(0x0806F5CC|1)
  71.         bl call_bx
  72.         ldr r1, =6666 ;概率分之一,最大0xFFFF
  73.         ldr r3, =(0x082E7BE0|1)
  74.         bl call_bx
  75.         cmp r0, #0
  76.         bne RandomEnd
  77.         mov r0, #1
  78.         mov r1, r8
  79.         strb r0, [r1, #30]
  80. RandomEnd:       
  81.         ldr r3, =(0x08067B9C|1)
  82.         bx r3
  83. .endfunc
  84. .pool

  85. .func DoKingBS
  86.         mov r0, r7
  87.         ldr r3, =(0x08E1833C|1)
  88.         bl call_bx
  89.         ldrb r0, [r0, #30]
  90.         cmp r0, #0
  91.         beq BSCheckEnd
  92.         ldr r0, =0x0202420B
  93.         strb r7, [r0]
  94.         ldr r0, =BS_KINGSTATU
  95.         ldr r3, =(0x08E073E4|1)
  96.         bl call_bx
  97.         mov r4, #1
  98. BSCheckEnd:
  99.         ldr r2, [sp, #0x10]
  100.         lsl r3, r7, #2
  101.         add r3, r2, r3
  102.         mov r2, #0x7F
  103.         ldr r0, =(0x08E051D4|1)
  104.         bx r0
  105. .endfunc
  106. .pool

  107. .func MoreBattlestring
  108.         mov r3, #147
  109.         lsl r3, #2
  110.         add r1 ,r3, #1
  111.         cmp r0, r3
  112.         bgt More
  113.         mov r3, #0x7C
  114.         add r3, #0xFF
  115.         cmp r0, r3
  116.         bls Normal
  117.         ldr r3, =(0x08E0664C|1)
  118.         bx r3
  119. Normal:
  120.         ldr r3, =(0x08E06654|1)
  121.         bx r3
  122. More:
  123.         ldr r3, =NewBattleStringsTable
  124.         sub r0, r1
  125.         ldr r1, =(0x08E06658|1)
  126.         bx r1
  127. .endfunc
  128. .pool

  129. .func CheckSpriteHack
  130.         ldr r3, =(0x081B2014|1)
  131.         bl call_bx
  132.         cmp r0, #0
  133.         bne CheckBack
  134.         ldrb r0, [r4, #30]
  135.         cmp r0, #0
  136.         beq CheckBack
  137.         mov r0, #8
  138. CheckBack:
  139.         cmp r0, #0
  140.         ldr r3, =(0x081B2080|1)
  141.         bx r3
  142. .endfunc
  143. .pool

  144. .func call_bx
  145.         bx r3
  146. .endfunc
  147. .pool

  148. BS_KingStatu:
  149.         printstring 0x24D
  150.         waitmessage 0x40
  151.         end3

  152. .align 4
  153. NewBattleStringsTable:
  154. .word gText_KingStatu

  155. gText_KingStatu:
  156. .string "王者的威压从", 0xFD, 0x0F, "身上溢出!"

  157. .align 2
  158. NewStatuIcons:
  159. .word 0x00040010, 0x0000000A, 0x45030050, 0xC1440700, 0x131003C0, 0x44244450, 0x01031044, 0x42222222
  160. .word 0x20442442, 0x0B10F203, 0x1B501750, 0x24222340, 0xD7221F30, 0x33002A20, 0x54600005, 0x13205CF0
  161. .word 0x00AB1B10, 0x8300707F, 0x66870067, 0x131003C0, 0x26662004, 0x7B006666, 0x62206262, 0x22074062
  162. .word 0x22226266, 0x11106650, 0x66130066, 0x4F666266, 0x26781026, 0x40010026, 0x000E1007, 0x0062571C
  163. .word 0xE0000704, 0x205CF076, 0xD61B1013, 0x03016310, 0x28070129, 0x131003C0, 0x28220090, 0x88288822
  164. .word 0x00848882, 0x282882FF, 0x22074028, 0x00226888, 0x82140013, 0x82220100, 0x28823A82, 0x0F500740
  165. .word 0x10821700, 0x09572820, 0x01986001, 0x03C08864, 0x1B101310, 0xAB7F40AA, 0x80AA8701, 0x97012A03
  166. .word 0x9B01802B, 0xAA2AAAB0, 0xA42AA2AA, 0x00220200, 0x00A22204, 0x63AA2A03, 0x000F002A, 0x22AAA217
  167. .word 0x0A101B00, 0x109C01D7, 0x18002A09, 0x200C002A, 0x570C001C, 0x0B2C00A2, 0xC0BAE001, 0x1068105C
  168. .word 0x1B10D513, 0x02D0FF01, 0x0702CD03, 0x5203402C, 0x2D0340CC, 0xCCC27F11, 0x06220100, 0xCC22C222
  169. .word 0x10070022, 0xC2452C0D, 0x2C2C0F10, 0x2C09002C, 0x00A41E00, 0x1D02CC11, 0x0F10CC2C, 0x2C722CCC
  170. .word 0x1D100A10, 0x0D222220, 0xFADC6002, 0x5C505480, 0x1B101310, 0x02507B32, 0x10B3407B, 0x07702403
  171. .word 0x25001310, 0x86027B62, 0x228342E7, 0x2460128B, 0xF2160042, 0xCF7FA27F, 0x84027B22, 0x03C00444
  172. .word 0x97129802, 0xEF56FF41, 0x032E0703, 0x0340EE0B, 0x802F0B10, 0xEE2E7F12, 0x222EE222, 0x10EE402E
  173. .word 0xE2222207, 0x2F2E22E2, 0x0200E2E2, 0x101110E2, 0x10731008, 0x2300B31D, 0x0001002E, 0x00EE2E1F
  174. .word 0x2B031018, 0x1500222E, 0xFE60030F, 0x60505880, 0x101310F7, 0xA2FFF21B, 0xE00270FF, 0xFF12E602
  175. .word 0x2266261F, 0x03100C03, 0x1300D822, 0x10FD1B10, 0x430D031F, 0x2003200E, 0x2227032C, 0xF2C03B10
  176. .word 0x00FFB2FF

  177. .align 4
  178. NewAnimCmdTable:
  179. .incbin "test.gba", 0x61D0DC, 0x1C
  180. .word NewAnim

  181. .align 4
  182. NewAnim:
  183. .halfword 28, 0, 0xFFFF, 0

  184. .org 0x08068E80
  185.         ldr r3, =(HackType1|1)
  186.         bx r3
  187. .pool

  188. .org 0x08068EC6
  189.         ldr r3, =(HackType2|1)
  190.         bx r3
  191. .pool       

  192. .org 0x08068F0C
  193.         ldr r3, =(HackType1|1)
  194.         bx r3
  195. .pool

  196. .org 0x08068F52
  197.         ldr r3, =(HackType2|1)
  198.         bx r3
  199. .pool       

  200. .org 0x08068F98
  201.         ldr r3, =(HackType1|1)
  202.         bx r3
  203. .pool

  204. .org 0x08068E1C
  205.         ldr r3, =(HackHP|1)
  206.         bx r3
  207. .pool

  208. .org 0x08067B94
  209.         ldr r3, =(RandomToBeKing|1)
  210.         bx r3
  211. .pool

  212. .org 0x08E051CC
  213.         ldr r3, =(DoKingBS|1)
  214.         bx r3
  215. .pool

  216. .org 0x08E06644
  217.         ldr r3, =(MoreBattlestring|1)
  218.         bx r3
  219. .pool

  220. .org 0x081B2076
  221.         ldr r3, =(CheckSpriteHack|1)
  222.         bx r3
  223. .pool

  224. .org 0x08615FF8
  225. .word NewStatuIcons

  226. .org 0x0861D0F8
  227. .word NewStatuIcons
  228. .halfword 0x400

  229. .org 0x0861D110
  230. .word NewAnimCmdTable

  231. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-7 20:46:57 | 显示全部楼层
本帖最后由 本站第一萌新 于 2020-5-26 22:13 编辑

在宝可梦能力界面点击A可以依次查看精灵个体,努力,再按一次回到能力。个体和努力都根据大小分为三个阶层,每个阶层用不同的颜色显示(色板里居然没有绿色,只能用蓝色代替了
有的地方逻辑可以修改以最大限度的节省空间和效率,比如r9那个地方,还有switch可以换成pc(之前写错了)和地址的差跳转。我一样懒得搞了
(话说这个论坛好冷啊,连发了20条左右也只有两个人回复  )
  1. .gba
  2. .thumb
  3. .loadtable "header/CharTable.txt"
  4. .create "3.0.gba",0x8000000
  5. .close
  6. .open "test.gba","3.0.gba", 0x8000000

  7. .org 0x08F80000
  8. .func CheckIsAPressedHack
  9.         mov r1, #129
  10.         lsl r1, #7
  11.         add r1, #64        ;0x40C0
  12.         ldrb r0, [r0, r1]
  13.         cmp r0, #1
  14.         bne CheckIsAPressedBack
  15.         bl ShowStates
  16.         pop {r4-r5, pc}
  17. CheckIsAPressedBack:
  18.         ldr r3, =(0x081C05BA|1)
  19.         bx r3
  20. .endfunc
  21. .pool

  22. .func ClearStatuWhenChangePage
  23.         ldr r3, =0x0203F000 ;现在看来用一个变量应该会更好?但懒得改了
  24.         mov r2, #0
  25.         strb r2, [r3]
  26.         push {r4-r7, lr}
  27.         mov r7, r10
  28.         mov r6, r9
  29.         mov r5, r8
  30.         ldr r3, =(0x081C0A94|1)
  31.         bx r3
  32. .endfunc
  33. .pool
  34.        
  35. .func ClearStatuWhenChangeMon
  36.         ldr r3, =0x0203F000
  37.         mov r2, #0
  38.         strb r2, [r3]
  39.         push {r4-r7, lr}
  40.         mov r7, r0
  41.         mov r5, r1
  42.         ldr r3, =(0x081C060E|1)
  43.         bx r3       
  44. .endfunc
  45. .pool

  46. .func ShowStates
  47.         push {lr}
  48.         ldr r0, =0x0203F000
  49.         ldrb r1, [r0]
  50.         add r1, #1
  51.         strb r1, [r0]
  52.         ldr r0, =(Task_ShowStates|1)
  53.         ldr r3, =(0x080A8FB0|1)
  54.         bl call_bx
  55.         ldr r1, =0x03005E00
  56.         mov r2, #40
  57.         mul r0, r2
  58.         add r0, r1
  59.         mov r1, #0
  60.         strh r1, [r0, #8] ;tstate
  61.         pop {pc}
  62. .endfunc
  63. .pool

  64. .func Task_ShowStates
  65.         push {r4-r7, lr}
  66.         mov r4, r0
  67.         ldr r5, =0x03005E00
  68.         mov r2, #40
  69.         mul r0, r2
  70.         add r5, r0
  71.         ldrh r0, [r5, #8] ;tstate
  72.         ldr r6, =0x0203F000
  73.         ldrb r7, [r6]
  74.         ldr r1, =Switch
  75.         lsl r0, #1
  76.         ldrh r0, [r0, r1]
  77.         ldr r1, =(Task_ShowStates|1)
  78.         add r0, r1
  79.         bx r0
  80. ClearPageWindowTilemaps:
  81.         mov r0, #1
  82.         ldr r3, =(0x081C2C38|1)
  83.         bl call_bx
  84.         b AddState
  85. PrintHeldItemName:
  86.         ldr r3, =(0x081C35E4|1)
  87.         bl call_bx
  88.         b AddState
  89. PrintRibbonCount:
  90.         ldr r3, =(0x081C3690|1)
  91.         bl call_bx
  92.         b AddState
  93. BufferLeftStatsIVsEVs:
  94.         cmp r7, #0
  95.         beq BufferLeftStats
  96.         mov r0, #1
  97.         bl BufferIVsAndEVs
  98.         b AddState
  99. BufferLeftStats:
  100.         ldr r3, =(0x081C3710|1)
  101.         bl call_bx
  102.         b AddState
  103. PrintLeftStatsIVsEVs:
  104.         cmp r7, #0
  105.         beq PrintLeftStats
  106.         mov r0, #1
  107.         bl PrintIVsAndEVs
  108.         b AddState
  109. PrintLeftStats:
  110.         ldr r3, =(0x081C37D8|1)
  111.         bl call_bx
  112.         b AddState
  113. BufferRightStatsIVsEVs:
  114.         cmp r7, #0
  115.         beq BufferRightStats
  116.         mov r0, #0
  117.         bl BufferIVsAndEVs
  118.         b AddState
  119. BufferRightStats:
  120.         ldr r3, =(0x081C3808|1)
  121.         bl call_bx
  122.         b AddState
  123. PrintRightStatsIVsEVs:
  124.         cmp r7, #0
  125.         beq PrintRightStats
  126.         mov r0, #0
  127.         bl PrintIVsAndEVs
  128.         b AddState
  129. PrintRightStats:
  130.         ldr r3, =(0x081C3890|1)
  131.         bl call_bx
  132.         b AddState
  133. PrintExpPointsNextLevel:
  134.         ldr r3, =(0x081C38C0|1)
  135.         bl call_bx
  136.         b AddState
  137. CreatePageWindowTilemaps:
  138.         mov r0, #1
  139.         ldr r3, =(0x081C2AFC|1)
  140.         bl call_bx
  141.         b AddState
  142. DestroyTask:
  143.         cmp r7, #2
  144.         bne Destroy
  145.         mov r7, #0xFF
  146.         strb r7, [r6]
  147. Destroy:
  148.         mov r0, r4
  149.         ldr r3, =(0x080A909C|1)
  150.         bl call_bx
  151. AddState:
  152.         ldrh r0, [r5, #8]
  153.         add r0, #1
  154.         strh r0, [r5, #8]
  155.         pop {r4-r7, pc}
  156. .endfunc
  157. .pool

  158. .func BufferIVsAndEVs
  159.         push {r4-r7, lr}
  160.         mov r4, r8
  161.         mov r5, r9
  162.         mov r6, r10
  163.         push {r4-r6}
  164.         mov r10, r0
  165.         ldr r1, =0x0203F000
  166.         ldrb r1, [r1]
  167.         cmp r0, #0
  168.         bne BufferRight
  169.         mov r0, #7
  170.         mov r9, r0
  171.         cmp r1, #1
  172.         beq HPIV
  173.         mov r4, #0x1A
  174.         b IntToString
  175. HPIV:
  176.         mov r4, #0x27
  177.         b IntToString
  178. BufferRight:
  179.         mov r0, #3
  180.         mov r9, r0
  181.         cmp r1, #1
  182.         beq SpeIV
  183.         mov r4, #0x1D
  184.         b IntToString
  185. SpeIV:
  186.         mov r4, #0x2A
  187. IntToString:
  188.         mov r5, #0
  189.         ldr r6, =0x02021CC4
  190.         ldr r7, =0x0203CF1C
  191.         ldr r7, [r7]
  192.         add r7, #0xC
  193. IntToStringLoop:
  194.         cmp r5, #3
  195.         bge IntToStringLoopEnd
  196.         mov r0, r7
  197.         add r1, r4, r5
  198.         mov r2, #0
  199.         ldr r3, =(0x0806A518|1)
  200.         bl call_bx
  201.         mov r8, r0
  202.         bl GetLevelColour
  203.         mov r1, r0
  204.         mov r0, #0xFF
  205.         add r0, #1 ;0x100
  206.         mul r0, r5
  207.         add r0, r6
  208.         ldr r3, =(0x08008EE0|1)
  209.         bl call_bx
  210.         mov r0, #24
  211.         lsl r0, #5 ;0x300
  212.         add r0, r6
  213.         mov r1, r8
  214.         mov r2, #1
  215.         mov r3, r9
  216.         mov r8, r4
  217.         ldr r4, =(0x08008CC0|1)
  218.         bl call_bx2
  219.         mov r4, r8
  220.         mov r0, #0xFF
  221.         add r0, #1 ;0x100
  222.         mul r0, r5
  223.         add r0, r6
  224.         mov r1, #24
  225.         lsl r1, #5 ;0x300
  226.         add r1, r6
  227.         ldr r3, =(0x08008BC0|1)
  228.         bl call_bx
  229.         add r5, #1
  230.         b IntToStringLoop
  231. IntToStringLoopEnd:
  232.         ldr r3, =(0x081AFBF0|1)
  233.         bl call_bx
  234.         mov r5, #0
  235. SetPlaceholderPtrLoop:
  236.         cmp r5, #3
  237.         bge SetPlaceholderPtrLoopEnd
  238.         mov r1, #0xFF
  239.         add r1, #1 ;0x100
  240.         mul r1, r5
  241.         add r1, r6
  242.         mov r0, r5
  243.         ldr r3, =(0x081AFC0C|1)
  244.         bl call_bx
  245.         add r5, #1
  246.         b SetPlaceholderPtrLoop
  247. SetPlaceholderPtrLoopEnd:
  248.         mov r0, r10
  249.         cmp r0, #0
  250.         bne LayoutRight
  251.         ldr r1, =gText_LayoutRight
  252.         b ExpandPlaceholders
  253. LayoutRight:
  254.         ldr r1, =gText_LayoutLeft
  255. ExpandPlaceholders:
  256.         mov r0, #24
  257.         lsl r0, #5 ;0x300
  258.         add r0, r6
  259.         ldr r3, =(0x081AFC28|1)
  260.         bl call_bx
  261.         pop {r4-r6}
  262.         mov r8, r4
  263.         mov r9, r5
  264.         mov r10, r6
  265.         pop {r4-r7, pc}
  266. .endfunc
  267. .pool

  268. .func PrintIVsAndEVs
  269.         push {r4-r5, lr}
  270.         add sp, #-8
  271.         cmp r0, #0
  272.         bne PrintRight
  273.         mov r4, #4
  274.         mov r5, #2
  275.         b AddWindow
  276. PrintRight:
  277.         mov r4, #2
  278.         mov r5, #3
  279. AddWindow:
  280.         ldr r0, =0x0861CCEC
  281.         mov r1, r5
  282.         ldr r3, =(0x081C2D2C|1)
  283.         bl call_bx
  284.         mov r2, r4
  285.         ldr r1, =0x02021CC4
  286.         mov r3, #24
  287.         lsl r3, #5 ;0x300
  288.         add r1, r3
  289.         mov r3, #0
  290.         str r3, [sp]
  291.         str r3, [sp, #4]
  292.         mov r3, #1
  293.         ldr r4, =(0x081C25A4|1)
  294.         bl call_bx2
  295.         add sp, #8
  296.         pop {r4-r5, pc}
  297. .endfunc
  298. .pool

  299. .func GetLevelColour
  300.         push {lr}
  301.         ldr r1, =0x0203F000
  302.         ldrb r1, [r1]
  303.         cmp r1, #1
  304.         bne IsEV
  305.         cmp r0, #10
  306.         ble BadColour
  307.         cmp r0, #20
  308.         ble NormalColour
  309.         b GoodColour
  310. IsEV:
  311.         cmp r0, #85
  312.         ble BadColour
  313.         cmp r0, #170
  314.         ble NormalColour
  315. GoodColour:
  316.         ldr r0, =gText_GoodColour
  317.         b GetLevelColourBack
  318. BadColour:
  319.         ldr r0, =gText_BadColour
  320.         b GetLevelColourBack
  321. NormalColour:
  322.         ldr r0, =gText_NormalColour
  323. GetLevelColourBack:
  324.         pop {pc}
  325. .endfunc
  326. .pool

  327. .func call_bx
  328.         bx r3
  329. .endfunc
  330. .pool

  331. .func call_bx2
  332.         bx r4
  333. .endfunc
  334. .pool

  335. .align 2
  336. Switch:
  337. .halfword (ClearPageWindowTilemaps - Task_ShowStates)
  338. .halfword (PrintHeldItemName - Task_ShowStates)
  339. .halfword (PrintRibbonCount - Task_ShowStates)
  340. .halfword (BufferLeftStatsIVsEVs - Task_ShowStates)
  341. .halfword (PrintLeftStatsIVsEVs - Task_ShowStates)
  342. .halfword (BufferRightStatsIVsEVs - Task_ShowStates)
  343. .halfword (PrintRightStatsIVsEVs - Task_ShowStates)
  344. .halfword (PrintExpPointsNextLevel - Task_ShowStates)
  345. .halfword (CreatePageWindowTilemaps - Task_ShowStates)
  346. .halfword (DestroyTask - Task_ShowStates)

  347. gText_LayoutRight:
  348. .string 0xF7, 0x00, "\n", 0xF7, 0x01, "\n", 0xF7, 0x02

  349. gText_LayoutLeft:
  350. .string 0xF7, 0x01, "\n", 0xF7, 0x02, "\n", 0xF7, 0x00

  351. gText_BadColour:
  352. .string 0xFC, 0x01, 0x05

  353. gText_NormalColour:
  354. .string 0xFC, 0x01, 0x06

  355. gText_GoodColour:
  356. .string 0xFC, 0x01, 0x07

  357. .org 0x081C05B0
  358.         ldr r3, =(CheckIsAPressedHack|1)
  359.         bx r3
  360. .pool

  361. .org 0x081C0A8C
  362.         ldr r3, =(ClearStatuWhenChangePage|1)
  363.         bx r3
  364. .pool

  365. .org 0x081C0604
  366.         ldr r3, =(ClearStatuWhenChangeMon|1)
  367.         bx r3
  368. .pool

  369. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

3927

帖子

382

现金

390

勋章券

超级版主

Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26

积分
20078
QQ

时光印记Lv.3挥金如土勋章水中王者勋章Lv3Omega红宝石发售确认纪念章Alpha蓝宝石发售确认纪念章金银好CP-Ho-oh/LUGIA【里】金银好CP-Ho-oh/LUGIA【真·正常向】异化型LUGIA【M超梦版】

发表于 2020-5-8 06:24:18 | 显示全部楼层
本站第一萌新 发表于 2020-5-7 20:46
在宝可梦能力界面点击A可以依次查看精灵个体,努力,再按一次回到能力。个体和努力都根据大小分为三个阶层 ...


在这里不设回复可见的话基本是不会有人回帖的

而且考虑到pokeemerald的存在,现在用ASM意义真的不大
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-8 07:56:36 | 显示全部楼层
jiangzhengwenjz 发表于 2020-5-8 06:24
在这里不设回复可见的话基本是不会有人回帖的

而且考虑到pokeemerald的存在,现在用ASM意义真的不大

确实是。看到pokeemerald工程的那一刻我就感觉hook大限将至了
发这个帖子主要是考虑到论坛低端教程和高端教程之间没什么过渡,所以发一些稍微复杂一点。不过现在看起来也就是在自娱自乐了
但是感觉没有编程经验的新手凭借个人努力是很难完全搞懂pokeemerald的,不可能要求每个改版者都是专业程序员吧,就像我当初入门C的时候看聚聚发的那个个体努力显示器差点没看自闭了各种系统完全搞不懂(其实现在也不是很懂,毕竟我是个闭门造车的典范,平时也就自己或和朋友一起瞎捉摸)(虽然说抄抄补补也能写出一些东西)
不过话说在国内我还没看到过几个用pokeemerald工程的改版,可能国内还是hook用的多一点吧
业余改版爱好者
回复 支持 反对

使用道具 举报

3927

帖子

382

现金

390

勋章券

超级版主

Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26

积分
20078
QQ

时光印记Lv.3挥金如土勋章水中王者勋章Lv3Omega红宝石发售确认纪念章Alpha蓝宝石发售确认纪念章金银好CP-Ho-oh/LUGIA【里】金银好CP-Ho-oh/LUGIA【真·正常向】异化型LUGIA【M超梦版】

发表于 2020-5-8 11:33:47 | 显示全部楼层
本帖最后由 jiangzhengwenjz 于 2020-5-8 11:39 编辑
本站第一萌新 发表于 2020-5-8 07:56
确实是。看到pokeemerald工程的那一刻我就感觉hook大限将至了
发这个帖子主要是考虑到论坛低 ...


额,pokeemerald只有更简单吧,因为只是用它改版你也并不需要懂他的build system,不需要懂怎么反编译,改改改就完事了,还有Egg现成的蓝本可以用,还可以用gdb调试

至于国内改版界,你如果不发这个贴我都要以为国内没人改版了(除了究绿那些人我算是知道),以前一起改版的人基本也都退了

我现在也不怎么搞改版,业余时间都在搞各种反编译项目,偶尔别人要帮忙的时候才写一下汇编
主要是现在那些函数和数据在pokeemerald/pokefirered里都命名得差不多了,再写功能就不会有太多感觉

以前,反编译还没出来,自己水平也不行,在那里调调调反而还挺有意思的
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-8 12:00:38 | 显示全部楼层
jiangzhengwenjz 发表于 2020-5-8 11:33
额,pokeemerald只有更简单吧,因为只是用它改版你也并不需要懂他的build system,不需要懂怎么反编译, ...

确实感觉国内都没什么人研究GBA改版了。不过绿宝石802(应该会被最近国人在做的绿宝石890替代,毕竟有Z石梦特8代精灵等)这个蓝本已经足够满足大部分改版者的需求了,剩下的也就是写写脚本,剧情,导入素材的事了
业余改版爱好者
回复 支持 反对

使用道具 举报

118

帖子

1221

现金

0

勋章券

与恶势力的交锋

Rank: 7Rank: 7Rank: 7

积分
457

时光印记Lv.1

 楼主| 发表于 2020-5-8 12:05:36 | 显示全部楼层
仅适用于绿宝石802
删除战死的精灵,并且如果主角战败则重置游戏(理论上能够抹除存档?但是这对模拟器而言并没有意义)
  1. .gba
  2. .thumb
  3. .loadtable "header/CharTable.txt"
  4. .include "header/ArmipsBSMacros.asm"
  5. .create "3.0.gba",0x8000000
  6. .close
  7. .open "test.gba","3.0.gba", 0x8000000

  8. .org 0x08F80000
  9. .func DeleteFaintMon
  10.         push {lr}
  11.         bl 0x08E1833C
  12.         ldr r3, =(0x08067A8C|1)
  13.         bl call_bx
  14.         pop {pc}
  15. .endfunc
  16. .pool

  17. .func DeleteAttacker
  18.         push {lr}
  19.         ldr r0, =0x0202420B
  20.         ldrb r0, [r0]
  21.         bl DeleteFaintMon
  22.         pop {pc}
  23. .endfunc
  24. .pool

  25. .func DeleteTarget
  26.         push {lr}
  27.         ldr r0, =0x0202420B
  28.         ldrb r0, [r0, #1]
  29.         bl DeleteFaintMon
  30.         pop {pc}
  31. .endfunc
  32. .pool

  33. .func CallasmHack
  34.         str r1, [r0]
  35.         ldr r1, =0x08E1FDFC
  36.         cmp r3, #166
  37.         blt CallasmHackBack
  38.         ldr r1, =(NewCallasmTable - 0x28)
  39.         sub r3, #166
  40. CallasmHackBack:
  41.         lsl r2, r3, #2
  42.         add r3, r1, r2
  43.         ldr r1, =(0x08E193AC|1)
  44.         bx r1
  45. .endfunc
  46. .pool

  47. .func call_bx
  48.         bx r3
  49. .endfunc
  50. .pool

  51. BS_FaintAttacker:
  52.         playfaintingcry bank_attacker
  53.         pause_cmd 0x40
  54.         cmd1a bank_attacker
  55.         cmd1b bank_attacker
  56.         printstring 28
  57.         callasm_cmd 23
  58.         callasm_cmd 142
  59.         callasm_cmd 166
  60.         return_cmd

  61. BS_FaintTarget:
  62.         playfaintingcry bank_target
  63.         pause_cmd 0x40
  64.         cmd1a bank_target
  65.         cmd1b bank_target
  66.         printstring 28
  67.         callasm_cmd 23
  68.         callasm_cmd 142
  69.         callasm_cmd 167
  70.         return_cmd
  71.        
  72. BS_CompactParty:
  73.         callasm_cmd 168
  74.         end2
  75.        
  76. BS_GotoCompactParty:
  77.         jumpifword 4, 0x02022FEC, 1, BS_CompactParty
  78.         goto_cmd BS_CompactParty

  79. .align 4       
  80. NewCallasmTable:
  81. .word (DeleteAttacker|1)       
  82. .word (DeleteTarget|1)       
  83. .word (0x080CE90C|1)

  84. .org 0x08085F58
  85.         swi 0x0
  86. .pool

  87. .org 0x08E193A4
  88.         ldr r2, =(CallasmHack|1)
  89.         bx r2
  90. .pool

  91. .org 0x08049C04
  92. .word BS_FaintAttacker

  93. .org 0x08049C8C
  94. .word BS_FaintTarget

  95. .org 0x082DA7D9
  96. .word BS_CompactParty

  97. .org 0x082DA80F
  98. .word BS_CompactParty

  99. .org 0x082DA818
  100. .word BS_CompactParty

  101. .org 0x082DA8F0
  102. .word BS_CompactParty

  103. .org 0x082DA8E6
  104.         goto_cmd BS_GotoCompactParty

  105. .close
复制代码
业余改版爱好者
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入口袋中心

本版积分规则

手机版|Archiver|Pokemon Center

GMT+8, 2023-1-29 14:55 , Processed in 0.133561 second(s), 46 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表