Advertisement
Guest User

Untitled

a guest
Sep 4th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 2.40 KB | None | 0 0
  1. .arm.little
  2. .thumb
  3.  
  4. .macro trainer, id, messages
  5. .word id, messages
  6. .endmacro
  7.  
  8. .macro trainer_jump, target
  9. .word 0, target
  10. .endmacro
  11.  
  12. .macro trainer_end
  13. .word 0, 0
  14. .endmacro
  15.  
  16. .loadtable "charmap.tbl"
  17.  
  18. ; Make sure to this filename matches your ROM's!
  19. .open "firered.patched.gba", 0x08000000
  20.  
  21. ; This pointer points to the trainer table.
  22. ; If you ever want to move the table somewhere else, this'll help.
  23. .org 0x0871A6D0  ; Don't modify this!
  24. .word trainers
  25.  
  26.  
  27. .org 0x0871A7E4  ; This can be any free location in the ROM.
  28.  
  29. ; Example 1: The simple case.
  30. trainers:
  31.     ; This sets trainer 0x66 to use the messages in msg_trainer1 as their sliding messages.
  32.     trainer 0x66, msg_trainer
  33.     ; Armips (this assembler) accepts both hexadecimal (prefixed with 0x) and
  34.     ;  decimal numbers, as well as some (for this use) less-relevant bases.
  35.  
  36.     ; You can have as many as you want:
  37.     ;trainer 0xAAA, msg_trainer2
  38.     ;trainer 0xDAB, msg_trainer3
  39.  
  40.     ; Make sure this list always ends with this:
  41.     trainer_end
  42.  
  43. ; These are the messages a trainer will use.
  44. ; There should _always_ be two `.string` here.
  45. msg_trainer:
  46.     .string "Last."  ; This message is used when the trainer is sending in their last mon.
  47.     .string "Low HP."  ; This message is used when the trainer's last mon has low health.
  48.  
  49. ; If the trainer shouldn't slide (and display a message) in either or both of the cases,
  50. ;  simply leave the `.string` empty, like this:
  51. ;msg_trainer:
  52. ;    .string ""
  53. ;    .string ""
  54. ; This example will cause the trainer to do nothing at all.
  55.  
  56.  
  57. ; Example 2: Jumps
  58.  
  59. ; Let's say, we've already inserted some messages at the fictional location of 0xDEADBEEF:
  60.  
  61. ;.org 0xDEADBEEF
  62. ;trainers:
  63. ;    trainer 1, msg
  64. ;    trainer 2, msg
  65. ;    trainer_end
  66. ;msg:
  67. ;    .string "AAAAA"
  68. ;    .string "AAAAA"
  69.  
  70. ; Now, somewhere along the way, we've inserted more things and repointed some tables,
  71. ;  so after some inspection with a hex editor, we find there's no room to continue this list.
  72. ; You _could_ repoint the entire table, but that's no fun.
  73. ; Instead, you can make the table continue somewhere else.
  74. ; Replace `trainer_end` at the end of the previous table with `trainer_jump trainers2`,
  75. ;  and create the trainers2 table somewhere else:
  76.  
  77. ;.org 0xCAFED00D
  78. ;trainers2:
  79. ;    trainer 3, msg
  80. ;    trainer 4, ....
  81. ;    ...
  82. ;    trainer_end
  83.  
  84. ; This can be done as many times as you want.
  85.  
  86. .close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement