Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .arm.little
- .thumb
- .macro trainer, id, messages
- .word id, messages
- .endmacro
- .macro trainer_jump, target
- .word 0, target
- .endmacro
- .macro trainer_end
- .word 0, 0
- .endmacro
- .loadtable "charmap.tbl"
- ; Make sure to this filename matches your ROM's!
- .open "firered.patched.gba", 0x08000000
- ; This pointer points to the trainer table.
- ; If you ever want to move the table somewhere else, this'll help.
- .org 0x0871A6D0 ; Don't modify this!
- .word trainers
- .org 0x0871A7E4 ; This can be any free location in the ROM.
- ; Example 1: The simple case.
- trainers:
- ; This sets trainer 0x66 to use the messages in msg_trainer1 as their sliding messages.
- trainer 0x66, msg_trainer
- ; Armips (this assembler) accepts both hexadecimal (prefixed with 0x) and
- ; decimal numbers, as well as some (for this use) less-relevant bases.
- ; You can have as many as you want:
- ;trainer 0xAAA, msg_trainer2
- ;trainer 0xDAB, msg_trainer3
- ; Make sure this list always ends with this:
- trainer_end
- ; These are the messages a trainer will use.
- ; There should _always_ be two `.string` here.
- msg_trainer:
- .string "Last." ; This message is used when the trainer is sending in their last mon.
- .string "Low HP." ; This message is used when the trainer's last mon has low health.
- ; If the trainer shouldn't slide (and display a message) in either or both of the cases,
- ; simply leave the `.string` empty, like this:
- ;msg_trainer:
- ; .string ""
- ; .string ""
- ; This example will cause the trainer to do nothing at all.
- ; Example 2: Jumps
- ; Let's say, we've already inserted some messages at the fictional location of 0xDEADBEEF:
- ;.org 0xDEADBEEF
- ;trainers:
- ; trainer 1, msg
- ; trainer 2, msg
- ; trainer_end
- ;msg:
- ; .string "AAAAA"
- ; .string "AAAAA"
- ; Now, somewhere along the way, we've inserted more things and repointed some tables,
- ; so after some inspection with a hex editor, we find there's no room to continue this list.
- ; You _could_ repoint the entire table, but that's no fun.
- ; Instead, you can make the table continue somewhere else.
- ; Replace `trainer_end` at the end of the previous table with `trainer_jump trainers2`,
- ; and create the trainers2 table somewhere else:
- ;.org 0xCAFED00D
- ;trainers2:
- ; trainer 3, msg
- ; trainer 4, ....
- ; ...
- ; trainer_end
- ; This can be done as many times as you want.
- .close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement