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

 找回密码
 加入口袋中心
搜索
查看: 3789|回复: 2

野生双战

[复制链接]

3369

回帖

552

现金

485

勋章券

超级版主

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

积分
22136
QQ

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

发表于 2015-10-13 20:42:35 | 显示全部楼层 |阅读模式
本帖最后由 jiangzhengwenjz 于 2015-10-14 12:16 编辑

字节变更均在源码注释中
效果见下图(仍有小bug 但我实在没动力了。。)部分是jambo51的源码
  1. .thumb
  2. /*0x82a26 -  04 49 08 47
  3. 0x82a38 - XX+1 XX XX 08
  4. 0x7F760 - 00 00*/

  5. str r0, [sp]
  6. ldr r0, .opponent_slot
  7. add r1, r4, #0
  8. add r2, r6, #0
  9. mov r3, #0x20
  10. ldr r4, .pokemon_make_3
  11. bl linker_4
  12. mov r1, #0
  13. mov r2, #0

  14. loop_1:
  15. mov r4, #0x64
  16. ldr r0, .party_slot
  17. add r0, #0x56
  18. mul r4, r1
  19. add r0, r0, r4
  20. ldrh r0, [r0]
  21. cmp r0, #0
  22. bne add_1

  23. increment:
  24. add r1, #1
  25. cmp r1, #6
  26. bne loop_1
  27. cmp r2, #2
  28. blt back_1
  29. ldr r1, .offset
  30. ldr r2, .save_block_1
  31. ldr r2, [r2]
  32. ldrb r3, [r2, #4] @bank
  33. lsl r3, r3, #2
  34. add r1, r1, r3
  35. ldr r1, [r1]
  36. ldrb r3, [r2, #5] @map
  37. lsl r3, r3, #2
  38. add r1, r1, r3
  39. ldr r1, [r1]
  40. ldr r1, [r1]
  41. ldr r3, [r1, #0x10]
  42. ldr r2, .tileset_table
  43. cmp r3, r2
  44. bne back_1
  45. bl get_block_id
  46. mov r2, #0

  47. loop_2:
  48. mov r1, pc
  49. add r1, #0x92
  50. lsl r3, r2, #2
  51. add r1, r1, r3
  52. ldrh r3, [r1]
  53. cmp r0, r3
  54. beq calculation
  55. ldr r1, .end
  56. cmp r1, r3
  57. beq back_1
  58. add r2, #1
  59. b loop_2

  60. add_1:
  61. add r2, #1
  62. b increment

  63. back_1:
  64. mov r0, #0
  65. ldr r1, .battle_flag
  66. str r0, [r1]

  67. back_2:
  68. add sp, sp, #0x10
  69. pop {r4-r6, pc}

  70. get_block_id:
  71. push {lr}
  72. ldr r0, .npc_state
  73. ldrh r1, [r0, #0x12] @Y
  74. ldrh r0, [r0, #0x10] @X
  75. ldr r4, .getter
  76. bl linker_4
  77. pop {pc}

  78. calculation:
  79. ldrb r4, [r1, #2]
  80. cmp r4, #0x63
  81. bhi doubletwo
  82. bl random
  83. mov r1, #0x64
  84. bl mod_func

  85. doublethree:
  86. add r1, r4, #0
  87. cmp r0, r1
  88. bge back_1

  89. double:
  90. mov r0, #1
  91. ldr r1, .battle_flag
  92. str r0, [r1]
  93. ldr r4, .rand_grass
  94. bl linker_4
  95. ldr r1, [r7, #4]
  96. lsl r0, r0, #2
  97. add r0, r0, r1
  98. ldrh r4, [r0, #2]
  99. ldr r1, .generate
  100. bl linker_1
  101. add r6, r0, #0
  102. bl random
  103. mov r1, #0x19
  104. bl mod_func
  105. str r0, [sp]
  106. ldr r0, .opponent_slot
  107. add r0, #0x64
  108. add r1, r4, #0
  109. add r2, r6, #0
  110. mov r3, #0x20
  111. ldr r4, .pokemon_make_3
  112. bl linker_4
  113. b back_2

  114. doubletwo:
  115. mov r0, #0
  116. b doublethree

  117. mod_func:
  118. ldr r3, .mod_addr
  119. bx r3

  120. random:
  121. ldr r2, .rand
  122. bx r2

  123. linker_1:
  124. bx r1

  125. linker_4:
  126. bx r4

  127. .word 0x0005000A
  128. .word 0x0005000B
  129. .word 0x0005000C
  130. .word 0x0005000D
  131. .hword 0xFEFE

  132. .align 2
  133. .opponent_slot: .word 0x0202402C
  134. .pokemon_make_3: .word 0x0803DD99
  135. .party_slot: .word 0x02024284
  136. .battle_flag: .word 0x02022B4C
  137. .offset: .word 0x083526A8
  138. .save_block_1: .word 0x03005008
  139. .tileset_table: .word 0x082D4A94
  140. .npc_state: .word 0x02036E38
  141. .getter: .word 0x08058E49
  142. .end: .word 0x0000FEFE
  143. .mod_addr: .word 0x081E4685
  144. .rand: .word 0x08044EC9
  145. .rand_grass: .word 0x0808274D
  146. .generate: .word 0x080828F9
复制代码
  1. .thumb
  2. .align 2
  3. /*0x16824 - 00 48 00 47 JJ+1 JJ JJ 08*/
  4. cmp r3, #5
  5. beq .L_1
  6. mov r0, #1
  7. and r3, r0
  8. cmp r3, #0
  9. bne .L_0

  10. .L_1:
  11. ldr r0, =0x801682D
  12. bx r0

  13. .L_0:
  14. ldr r0, =0x801682D
  15. add r0, #0x42
  16. bx r0
复制代码
  1. .thumb
  2. /*替换ROM中所有的1D 1E 0A 08为下面代码的指针(+1),注意先替换,再写入本源码!!!!!!*/
  3. ldr r1, .battle_flag
  4. ldr r1, [r1]
  5. cmp r1, #5
  6. bne normal
  7. ldr r1, .struct
  8. mov r2, #0x58
  9. lsl r2, r2, #1
  10. add r2, r1, r2
  11. ldrh r1, [r1, #0x28]
  12. ldrh r2, [r2, #0x28]
  13. mul r1, r2
  14. cmp r1, #0
  15. bne two_mon
  16. normal:
  17. ldr r1, .pokeball
  18. bx r1
  19. two_mon:
  20. push {r4, lr}
  21. mov r0, #0
  22. mov r1, #2
  23. mov r2, pc
  24. add r2, #0xC
  25. ldr r3, .bag_print
  26. ldr r4, .texter
  27. bl jump
  28. pop {r4, pc}
  29. jump:
  30. bx r4
  31. .word 0xAD0B2302
  32. .word 0x90087E0F
  33. .word 0x5B078C10
  34. .word 0x0D3BBC08
  35. .word 0x0BAB03A4
  36. .word 0x094D0337
  37. .word 0x3CA701B5
  38. .hword 0x00FF

  39. .align 2
  40. .battle_flag: .word 0x2022B4C
  41. .pokeball:  .word 0x80A1E1D
  42. .struct: .word 0x2023C3C
  43. .bag_print: .word 0x810a1f9
  44. .texter: .word 0x08108E71
复制代码
  1. .thumb
  2. .align 2
  3. /*21d46 - 00 47
  4. 21d94 - ZZ+1 ZZ ZZ 08*/
  5. ldr r0, =0x2022b4c
  6. ldr r0, [r0]
  7. cmp r0, #5
  8. beq double

  9. audio:
  10. ldr r0, =0x137
  11. ldr r1, =0x80722A1
  12. bl jump
  13. ldr r1, =0x8021D4B

  14. jump:
  15. bx r1

  16. double:
  17. ldr r0, =0x2023C3C
  18. mov r1, #0x58
  19. lsl r1, r1, #1
  20. add r1, r0, r1
  21. ldrh r0, [r0, #0x28]
  22. ldrh r1, [r1, #0x28]
  23. add r0, r0, r1
  24. cmp r0, #0
  25. beq audio
  26. ldr r1, =0x8021D4B
  27. add r1, #8
  28. bx r1
复制代码
  1. .thumb
  2. .align 2
  3. /*0x2D44C - 30 47
  4. 0x2D480 - MM+1 MM MM 08
  5. 0x2D812 - 00 00
  6. 0x2D858 - 00 00
  7. 0x2D8A6 - 00 00
  8. 0x2D8F4 - 01 1C
  9. 0x2DF36 - 08 1C
  10. 0x2DE58 - 00 00
  11. 0x2DE84 - 00 00
  12. 0x2DEA4 - 00 00
  13. 0x2DEC2 - 04 1C
  14. 0x2D874 - 6C 3D 02 02
  15. 0x2D94C - 6C 3D 02 02
  16. 0x2DF64 - 6C 3D 02 02
  17. 0x2DF04 - 6C 3D 02 02*/
  18. ldr r6, =0x2022b4c
  19. ldr r6, [r6]
  20. cmp r6, #5
  21. bne normal
  22. ldr r6, =0x2023C3C
  23. ldrh r6, [r6, #0x28]
  24. cmp r6, #0
  25. bne case_1

  26. case_2:
  27. mov r0, #3
  28. b back

  29. case_1:
  30. mov r0, #1
  31. b back

  32. normal:
  33. mov r1, #1
  34. eor r0, r1

  35. back:
  36. ldr r6, =0x2023D6C
  37. ldr r1, =0x802d451
  38. bx r1
复制代码
  1. .thumb
  2. .align 2
  3. /*0x2d95c - 00 48 00 47 NN+1 NN NN 08*/
  4. push {r4, r5, lr}
  5. ldr r4, =0x0202402C
  6. ldr r0, =0x02023D6C
  7. ldrb r0, [r0]
  8. lsr r0, r0, #1
  9. mov r1, #0x64
  10. mul r0, r1
  11. add r0, r0, r4
  12. add r4, r0, #0
  13. mov r1, #0xb
  14. ldr r2, =0x0802D965
  15. bx r2
复制代码
  1. .thumb
  2. .align 2
  3. /*0x2d9de - 00 47
  4. 0x2da00 - UU+1 UU UU 08*/
  5. ldr r0, =0x0202402C
  6. ldr r1, =0x02023D6C
  7. ldrb r1, [r1]
  8. lsr r1, r1, #1
  9. mov r2, #0x64
  10. mul r1, r2
  11. add r0, r1, r0
  12. mov r1, #0xb
  13. ldr r2, =0x0802D9E1
  14. bx r2
复制代码
  1. .thumb
  2. .align 2
  3. /*0xEF5F8 - 10 47
  4. 0xEF680 - QQ+1 QQ QQ 08*/
  5. ldr r2, =0x02037F1B
  6. ldr r0, =0x02022B4C
  7. ldr r0, [r0]
  8. cmp r0, #5
  9. bne normal
  10. ldr r0, =0x02023C3C
  11. mov r1, #0x58
  12. lsl r1, r1, #1
  13. add r1, r0, r1
  14. ldrh r1, [r1, #0x28]
  15. cmp r1, #0
  16. beq normal
  17. mov r1, #3
  18. strb r1, [r2]

  19. normal:
  20. mov r8, r2
  21. ldr r0, =0x080EF5FB
  22. bx r0
复制代码
第一个源码写入后会出现1表格,是0A 00 05 00 0B 00 05 00 0C 00 05 00..... 05即概率
回复

使用道具 举报

43

回帖

396

现金

0

勋章券

繁华都市的喧闹

Rank: 5Rank: 5Rank: 5

积分
188

时光印记Lv.1

发表于 2015-10-13 20:57:44 | 显示全部楼层
没宝石差评
回复 支持 反对

使用道具 举报

139

回帖

171

现金

2

勋章券

繁华都市的喧闹

Rank: 5Rank: 5Rank: 5

积分
280
发表于 2015-10-17 22:03:43 | 显示全部楼层
感觉不错,支持
回复 支持 反对

使用道具 举报

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

本版积分规则

手机版|Archiver|Pokemon Center

GMT+8, 2024-11-22 02:29 , Processed in 0.107511 second(s), 49 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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