summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--berry_fix/payload/asm/crt0.s5
-rw-r--r--berry_fix/payload/asm/libagbsyscall.s2
-rw-r--r--berry_fix/payload/asm/macros.inc155
-rw-r--r--berry_fix/payload/asm/macros/asm.inc17
-rw-r--r--berry_fix/payload/asm/macros/battle_ai_script.inc554
-rw-r--r--berry_fix/payload/asm/macros/battle_anim.inc266
-rw-r--r--berry_fix/payload/asm/macros/battle_script.inc1228
-rw-r--r--berry_fix/payload/asm/macros/contest_ai_script.inc506
-rw-r--r--berry_fix/payload/asm/macros/ec.inc8
-rw-r--r--berry_fix/payload/asm/macros/event.inc1433
-rw-r--r--berry_fix/payload/asm/macros/field_effect_script.inc42
-rw-r--r--berry_fix/payload/asm/macros/m4a.inc13
-rw-r--r--berry_fix/payload/asm/macros/map.inc84
-rw-r--r--berry_fix/payload/asm/macros/movement.inc120
-rw-r--r--berry_fix/payload/asm/macros/music_voice.inc125
-rw-r--r--berry_fix/payload/asm/macros/pokemon_data.inc57
-rw-r--r--include/libgcnmultiboot.h2
-rw-r--r--include/menu.h4
-rw-r--r--include/text.h7
-rw-r--r--src/bag.c6
-rw-r--r--src/battle_records.c14
-rw-r--r--src/buy_menu_helpers.c22
-rw-r--r--src/daycare.c344
-rw-r--r--src/diploma.c8
-rw-r--r--src/fame_checker.c20
-rw-r--r--src/help_system.c14
-rw-r--r--src/item_pc.c4
-rw-r--r--src/list_menu.c18
-rw-r--r--src/map_preview_screen.c8
-rw-r--r--src/menu.c27
-rw-r--r--src/menu2.c16
-rw-r--r--src/mevent_8145654.c24
-rw-r--r--src/mystery_gift_menu.c20
-rw-r--r--src/oak_speech.c30
-rw-r--r--src/quest_log.c10
-rw-r--r--src/slot_machine.c10
-rw-r--r--src/tm_case.c6
-rw-r--r--src/trainer_tower.c8
-rw-r--r--src/wireless_communication_status_screen.c34
39 files changed, 319 insertions, 4952 deletions
diff --git a/berry_fix/payload/asm/crt0.s b/berry_fix/payload/asm/crt0.s
index 73da8a38f..edbb83328 100644
--- a/berry_fix/payload/asm/crt0.s
+++ b/berry_fix/payload/asm/crt0.s
@@ -1,6 +1,5 @@
- .include "../../asm/macros/asm.inc"
- .include "../../asm/macros/function.inc"
- .include "../../constants/gba_constants.inc"
+ .include "asm/macros/function.inc"
+ .include "constants/gba_constants.inc"
.syntax unified
diff --git a/berry_fix/payload/asm/libagbsyscall.s b/berry_fix/payload/asm/libagbsyscall.s
index 0368c7e70..ea8ef3e89 100644
--- a/berry_fix/payload/asm/libagbsyscall.s
+++ b/berry_fix/payload/asm/libagbsyscall.s
@@ -1,5 +1,5 @@
+ .include "asm/macros/function.inc"
.include "constants/gba_constants.inc"
- .include "asm/macros.inc"
.syntax unified
diff --git a/berry_fix/payload/asm/macros.inc b/berry_fix/payload/asm/macros.inc
deleted file mode 100644
index e6813d319..000000000
--- a/berry_fix/payload/asm/macros.inc
+++ /dev/null
@@ -1,155 +0,0 @@
- .include "asm/macros/asm.inc"
- .include "asm/macros/function.inc"
- .include "asm/macros/movement.inc"
- .include "asm/macros/pokemon_data.inc"
- .include "asm/macros/ec.inc"
- .include "asm/macros/map.inc"
- .include "asm/macros/m4a.inc"
-
- .macro region_map_location x, y, width, height, name
- .byte \x
- .byte \y
- .byte \width
- .byte \height
- .4byte gMapName_\name
- .endm
-
- .macro obj_tiles address, uncompressed_size, tag
- .4byte \address
- .2byte \uncompressed_size
- .2byte \tag
- .endm
-
- .macro null_obj_tiles
- obj_tiles 0, 0, 0
- .endm
-
- .macro obj_pal address, tag
- .4byte \address
- .2byte \tag
- .2byte 0 @ padding
- .endm
-
- .macro null_obj_pal
- obj_pal 0, 0
- .endm
-
- .macro paired_pals tag, address
- .2byte \tag
- .2byte 0 @ padding
- .4byte \address
- .endm
-
-@ For object animation frames.
- .macro obj_frame_tiles address, uncompressed_size
- .4byte \address
- .2byte \uncompressed_size
- .2byte 0 @ padding
- .endm
-
- .macro spr_template tile_tag, pal_tag, oam, anims, images, affine_anims, callback
- .2byte \tile_tag
- .2byte \pal_tag
- .4byte \oam
- .4byte \anims
- .4byte \images
- .4byte \affine_anims
- .4byte \callback
- .endm
-
-@ Berry trees have a table defining the palette slot used for each of their 5
-@ stages. However, the first 2 stages always use the same slots regardless of
-@ the type of tree and the slots of the last 3 stages always equal each other.
- .macro berry_tree_palette_slot_table slot
- .byte 3, 4, \slot, \slot, \slot
- .endm
-
- .macro subsprite x, y, priority, tile_num_offset, size
- .2byte \x
- .2byte \y
- .2byte ((\priority) << 14) | ((\tile_num_offset) << 4) | SPRITE_SIZE_\size
- .2byte 0 @ padding
- .endm
-
- .macro obj_image_anim_frame pic_id, duration, flags = 0
- .2byte \pic_id
- .byte (\flags) | (\duration)
- .byte 0 @ padding
- .endm
-
- .macro obj_image_anim_loop count
- .2byte 0xfffd
- .byte \count
- .byte 0 @ padding
- .endm
-
- .macro obj_image_anim_jump target_index
- .2byte 0xfffe
- .byte \target_index
- .byte 0 @ padding
- .endm
-
- .macro obj_image_anim_end
- .2byte 0xffff
- .2byte 0 @ padding
- .endm
-
- .macro obj_rot_scal_anim_frame delta_x_scale, delta_y_scale, delta_angle, duration
- .2byte \delta_x_scale
- .2byte \delta_y_scale
- .byte \delta_angle
- .byte \duration
- .2byte 0 @ padding
- .endm
-
- .macro obj_rot_scal_anim_loop count
- .2byte 0x7ffd
- .2byte \count
- .4byte 0 @ padding
- .endm
-
- .macro obj_rot_scal_anim_jump target_index
- .2byte 0x7ffe
- .2byte \target_index
- .4byte 0 @ padding
- .endm
-
- .macro obj_rot_scal_anim_end unknown=0
- .2byte 0x7fff
- .2byte \unknown
- .fill 4 @ padding
- .endm
-
- .macro credits_entry number, text
- .4byte \number
- .4byte \text
- .endm
-
- .macro door_anim_frame unknown, offset
- .byte \unknown
- .byte 0 @ padding
- .2byte \offset
- .endm
-
- .macro door_anim_gfx metatile_num, unknown, tile_addr, palette_addr
- .2byte \metatile_num
- .2byte \unknown
- .4byte \tile_addr
- .4byte \palette_addr
- .endm
-
- .macro trainer_eye_trainer opp_1, opp_2, opp_3, opp_4, opp_5, map_name
- .2byte OPPONENT_\opp_1
- .2byte OPPONENT_\opp_2
- .2byte OPPONENT_\opp_3
- .2byte OPPONENT_\opp_4
- .2byte OPPONENT_\opp_5
- .2byte GROUP_\map_name
- .2byte MAP_\map_name
- .space 2
- .endm
-
- .macro window_template bg, top, left, height, width, palno, baseBlock
- .byte \bg, \top, \left, \height, \width, \palno
- .2byte \baseBlock
- .endm
diff --git a/berry_fix/payload/asm/macros/asm.inc b/berry_fix/payload/asm/macros/asm.inc
deleted file mode 100644
index 26b2707ca..000000000
--- a/berry_fix/payload/asm/macros/asm.inc
+++ /dev/null
@@ -1,17 +0,0 @@
- .ifndef GUARD_ASM_MACROS_ASM_INC
- .set GUARD_ASM_MACROS_ASM_INC, 1
-
- .macro inc x
- .set \x, \x + 1
- .endm
-
- .macro enum_start x=0
- .set __enum__, \x
- .endm
-
- .macro enum constant
- .equiv \constant, __enum__
- inc __enum__
- .endm
-
- .endif @ GUARD_ASM_MACROS_ASM_INC
diff --git a/berry_fix/payload/asm/macros/battle_ai_script.inc b/berry_fix/payload/asm/macros/battle_ai_script.inc
deleted file mode 100644
index 679e30340..000000000
--- a/berry_fix/payload/asm/macros/battle_ai_script.inc
+++ /dev/null
@@ -1,554 +0,0 @@
- .macro if_random_less_than percent, address
- .byte 0x00
- .byte \percent
- .4byte \address
- .endm
-
- @ unused
- .macro if_random_greater_than percent, address
- .byte 0x01
- .byte \percent
- .4byte \address
- .endm
-
- @ unused
- .macro if_random_equal address
- .byte 0x02
- .4byte \address
- .endm
-
- @ unused
- .macro if_random_not_equal address
- .byte 0x03
- .4byte \address
- .endm
-
- .macro score score
- .byte 0x04
- .byte \score
- .endm
-
- .macro if_hp_less_than target, percent, address
- .byte 0x05
- .byte \target
- .byte \percent
- .4byte \address
- .endm
-
- .macro if_hp_more_than target, percent, address
- .byte 0x06
- .byte \target
- .byte \percent
- .4byte \address
- .endm
-
- .macro if_hp_equal target, percent, address
- .byte 0x07
- .byte \target
- .byte \percent
- .4byte \address
- .endm
-
- .macro if_hp_not_equal target, percent, address
- .byte 0x08
- .byte \target
- .byte \percent
- .4byte \address
- .endm
-
- .macro if_status target, status, address
- .byte 0x09
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_not_status target, status, address
- .byte 0x0a
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_status2 target, status, address
- .byte 0x0b
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_not_status2 target, status, address
- .byte 0x0c
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_status3 target, status, address
- .byte 0x0d
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_not_status3 target, status, address
- .byte 0x0e
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_status4 target, status, address
- .byte 0x0f
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_not_status4 target, status, address
- .byte 0x10
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro if_less_than value, address
- .byte 0x11
- .byte \value
- .4byte \address
- .endm
-
- .macro if_more_than value, address
- .byte 0x12
- .byte \value
- .4byte \address
- .endm
-
- .macro if_equal value, address
- .byte 0x13
- .byte \value
- .4byte \address
- .endm
-
- .macro if_not_equal value, address
- .byte 0x14
- .byte \value
- .4byte \address
- .endm
-
- .macro if_less_than_32 value, address
- .byte 0x15
- .4byte \value
- .4byte \address
- .endm
-
- .macro if_more_than_32 value, address
- .byte 0x16
- .4byte \value
- .4byte \address
- .endm
-
- .macro if_equal_32 value, address
- .byte 0x17
- .4byte \value
- .4byte \address
- .endm
-
- .macro if_not_equal_32 value, address
- .byte 0x18
- .4byte \value
- .4byte \address
- .endm
-
- .macro if_move move, address
- .byte 0x19
- .2byte \move
- .4byte \address
- .endm
-
- .macro if_not_move move, address
- .byte 0x1a
- .2byte \move
- .4byte \address
- .endm
-
- .macro if_in_bytes list, address
- .byte 0x1b
- .4byte \list
- .4byte \address
- .endm
-
- .macro if_not_in_bytes list, address
- .byte 0x1c
- .4byte \list
- .4byte \address
- .endm
-
- .macro if_in_words list, address
- .byte 0x1d
- .4byte \list
- .4byte \address
- .endm
-
- .macro if_not_in_words list, address
- .byte 0x1e
- .4byte \list
- .4byte \address
- .endm
-
- .macro if_user_can_damage address
- .byte 0x1f
- .4byte \address
- .endm
-
- .macro if_user_cant_damage address
- .byte 0x20
- .4byte \address
- .endm
-
- .macro get_turn_count
- .byte 0x21
- .endm
-
- .macro get_type byte
- .byte 0x22
- .byte \byte
- .endm
-
- @ unused
- .macro get_move_power
- .byte 0x23
- .endm
-
- .macro is_most_powerful_move
- .byte 0x24
- .endm
-
- .macro get_move target
- .byte 0x25
- .byte \target
- .endm
-
- .macro if_arg_equal type, address
- .byte 0x26
- .byte \type
- .4byte \address
- .endm
-
- @ unused
- .macro if_arg_not_equal type, address
- .byte 0x27
- .byte \type
- .4byte \address
- .endm
-
- .macro if_would_go_first target, address
- .byte 0x28
- .byte \target
- .4byte \address
- .endm
-
- .macro if_would_not_go_first target, address
- .byte 0x29
- .byte \target
- .4byte \address
- .endm
-
- @ nullsub
- .macro ai_2a
- .byte 0x2a
- .endm
-
- @ nullsub
- .macro ai_2b
- .byte 0x2b
- .endm
-
- .macro count_alive_pokemon target
- .byte 0x2c
- .byte \target
- .endm
-
- @ unused
- .macro get_considered_move
- .byte 0x2d
- .endm
-
- .macro get_effect
- .byte 0x2e
- .endm
-
- .macro get_ability target
- .byte 0x2f
- .byte \target
- .endm
-
- @ unused
- .macro get_highest_possible_damage
- .byte 0x30
- .endm
-
- .macro if_damage_bonus value, address
- .byte 0x31
- .byte \value
- .4byte \address
- .endm
-
- @ nullsub
- .macro ai_32
- .byte 0x32
- .endm
-
- @ nullsub
- .macro ai_33
- .byte 0x33
- .endm
-
- .macro if_status_in_party target, status, address
- .byte 0x34
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- @ bugged
- .macro if_status_not_in_party target, status, address
- .byte 0x35
- .byte \target
- .4byte \status
- .4byte \address
- .endm
-
- .macro get_weather
- .byte 0x36
- .endm
-
- .macro if_effect byte, address
- .byte 0x37
- .byte \byte
- .4byte \address
- .endm
-
- .macro if_not_effect byte, address
- .byte 0x38
- .byte \byte
- .4byte \address
- .endm
-
- .macro if_stat_level_less_than target, stat, level, address
- .byte 0x39
- .byte \target
- .byte \stat
- .byte \level
- .4byte \address
- .endm
-
- .macro if_stat_level_more_than target, stat, level, address
- .byte 0x3a
- .byte \target
- .byte \stat
- .byte \level
- .4byte \address
- .endm
-
- .macro if_stat_level_equal target, stat, level, address
- .byte 0x3b
- .byte \target
- .byte \stat
- .byte \level
- .4byte \address
- .endm
-
- .macro if_stat_level_not_equal target, stat, level, address
- .byte 0x3c
- .byte \target
- .byte \stat
- .byte \level
- .4byte \address
- .endm
-
- .macro if_can_faint address
- .byte 0x3d
- .4byte \address
- .endm
-
- .macro if_cant_faint address
- .byte 0x3e
- .4byte \address
- .endm
-
- @ unused
- .macro if_has_move, target, move, address
- .byte 0x3f
- .byte \target
- .2byte \move
- .4byte \address
- .endm
-
- @ unused
- .macro if_dont_have_move, target, move, address
- .byte 0x40
- .byte \target
- .2byte \move
- .4byte \address
- .endm
-
- .macro if_move_effect target, effect, address
- .byte 0x41
- .byte \target
- .byte \effect
- .4byte \address
- .endm
-
- .macro if_not_move_effect target, effect, address
- .byte 0x42
- .byte \target
- .byte \effect
- .4byte \address
- .endm
-
- .macro if_last_move_did_damage target, byte, address
- .byte 0x43
- .byte \target
- .byte \byte
- .4byte \address
- .endm
-
- .macro if_encored target, address
- .byte 0x44
- .byte \target
- .4byte \address
- .endm
-
- .macro flee
- .byte 0x45
- .endm
-
- .macro if_random_100 address
- .byte 0x46
- .4byte \address
- .endm
-
- .macro watch
- .byte 0x47
- .endm
-
- .macro get_hold_effect target
- .byte 0x48
- .byte \target
- .endm
-
- .macro get_gender target
- .byte 0x49
- .byte \target
- .endm
-
- .macro is_first_turn target
- .byte 0x4a
- .byte \target
- .endm
-
- .macro get_stockpile_count target
- .byte 0x4b
- .byte \target
- .endm
-
- .macro is_double_battle
- .byte 0x4c
- .endm
-
- .macro get_item target
- .byte 0x4d
- .byte \target
- .endm
-
- .macro get_move_type_from_result
- .byte 0x4e
- .endm
-
- .macro get_move_power_from_result
- .byte 0x4f
- .endm
-
- .macro get_move_effect_from_result
- .byte 0x50
- .endm
-
- .macro get_protect_count target
- .byte 0x51
- .byte \target
- .endm
-
- @ nullsub
- .macro ai_52
- .byte 0x52
- .endm
-
- @ nullsub
- .macro ai_53
- .byte 0x53
- .endm
-
- @ nullsub
- .macro ai_54
- .byte 0x54
- .endm
-
- @ nullsub
- .macro ai_55
- .byte 0x55
- .endm
-
- @ nullsub
- .macro ai_56
- .byte 0x56
- .endm
-
- @ nullsub
- .macro ai_57
- .byte 0x57
- .endm
-
- @ unused
- .macro call address
- .byte 0x58
- .4byte \address
- .endm
-
- .macro jump address
- .byte 0x59
- .4byte \address
- .endm
-
- .macro end
- .byte 0x5a
- .endm
-
- .macro if_level_cond cond, address
- .byte 0x5b
- .byte \cond
- .4byte \address
- .endm
-
- .macro if_user_higher_level address
- if_level_cond 0, \address
- .endm
-
- .macro if_target_higher_level address
- if_level_cond 1, \address
- .endm
-
- .macro if_equal_levels address
- if_level_cond 2, \address
- .endm
-
- @ unused
- .macro if_taunted address
- .byte 0x5c
- .4byte \address
- .endm
-
- .macro if_not_taunted address
- .byte 0x5d
- .4byte \address
- .endm
diff --git a/berry_fix/payload/asm/macros/battle_anim.inc b/berry_fix/payload/asm/macros/battle_anim.inc
deleted file mode 100644
index 4ff845032..000000000
--- a/berry_fix/payload/asm/macros/battle_anim.inc
+++ /dev/null
@@ -1,266 +0,0 @@
- .macro loadsprite id
- .byte 0x00
- .2byte \id
- .endm
-
- .macro unloadsprite id
- .byte 0x01
- .2byte \id
- .endm
-
- .macro sprite template, priority, argv:vararg
- .byte 0x02
- .4byte \template
- .byte \priority
- .byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2
-.Lsprite_\@_1:
- .2byte \argv
-.Lsprite_\@_2:
- .endm
-
- .macro createtask addr, priority, argv:vararg
- .byte 0x03
- .4byte \addr
- .byte \priority
- .byte (.Lcreatetask_\@_2 - .Lcreatetask_\@_1) / 2
-.Lcreatetask_\@_1:
- .2byte \argv
-.Lcreatetask_\@_2:
- .endm
-
- .macro pause delay
- .byte 0x04
- .byte \delay
- .endm
-
- .macro wait
- .byte 0x05
- .endm
-
- .macro hang1
- .byte 0x06
- .endm
-
- .macro hang2
- .byte 0x07
- .endm
-
- .macro end
- .byte 0x08
- .endm
-
- .macro playse id
- .byte 0x09
- .2byte \id
- .endm
-
- .macro monbg which
- .byte 0x0A
- .byte \which
- .endm
-
- .macro clearmonbg which
- .byte 0x0B
- .byte \which
- .endm
-
- .macro setalpha eva, evb
- .byte 0x0C
- .2byte ((\evb) << 8) | (\eva)
- .endm
-
- .macro blendoff
- .byte 0x0D
- .endm
-
- .macro call addr
- .byte 0x0E
- .4byte \addr
- .endm
-
- .macro ret
- .byte 0x0F
- .endm
-
- .macro setvar var_num, value
- .byte 0x10
- .byte \var_num
- .2byte \value
- .endm
-
- .macro ifelse addr1, addr2
- .byte 0x11
- .4byte \addr1
- .4byte \addr2
- .endm
-
- .macro jumpif cond, addr
- .byte 0x12
- .byte \cond
- .4byte \addr
- .endm
-
- .macro jump addr
- .byte 0x13
- .4byte \addr
- .endm
-
- .macro fadetobg id
- .byte 0x14
- .byte \id
- .endm
-
- .macro restorebg
- .byte 0x15
- .endm
-
- .macro waitbgfadeout
- .byte 0x16
- .endm
-
- .macro waitbgfadein
- .byte 0x17
- .endm
-
- .macro changebg id
- .byte 0x18
- .byte \id
- .endm
-
- .macro panse_19 id, pan
- .byte 0x19
- .2byte \id
- .byte \pan
- .endm
-
- .macro setpan pan
- .byte 0x1A
- .byte \pan
- .endm
-
- .macro panse_1B id, pan_start, pan_end, step, delay
- .byte 0x1B
- .2byte \id
- .byte \pan_start
- .byte \pan_end
- .byte \step
- .byte \delay
- .endm
-
- .macro panse_1C id, pan, delay, count
- .byte 0x1C
- .2byte \id
- .byte \pan
- .byte \delay
- .byte \count
- .endm
-
- .macro panse_1D id, pan, count
- .byte 0x1D
- .2byte \id
- .byte \pan
- .byte \count
- .endm
-
- .macro setbldcnt bldcnt
- .byte 0x1E
- .2byte \bldcnt
- .endm
-
- .macro createtask_1F addr, argv:vararg
- .byte 0x1F
- .4byte \addr
- .byte (.Lcreatetask_1F_\@_2 - .Lcreatetask_1F_\@_1) / 2
-.Lcreatetask_1F_\@_1:
- .2byte \argv
-.Lcreatetask_1F_\@_2:
- .endm
-
- .macro waitsound
- .byte 0x20
- .endm
-
- .macro jumpvareq var_num, value, addr
- .byte 0x21
- .byte \var_num
- .2byte \value
- .4byte \addr
- .endm
-
- .macro monbg_22 unk
- .byte 0x22
- .byte \unk
- .endm
-
- .macro clearmonbg_23 unk
- .byte 0x23
- .byte \unk
- .endm
-
- .macro jumpunkcond addr
- .byte 0x24
- .4byte \addr
- .endm
-
- .macro fadetobg_25 a, b, c
- .byte 0x25
- .byte \a
- .byte \b
- .byte \c
- .endm
-
- .macro panse_26 id, pan_start, pan_end, step, delay
- .byte 0x26
- .2byte \id
- .byte \pan_start
- .byte \pan_end
- .byte \step
- .byte \delay
- .endm
-
- .macro panse_27 id, pan_start, pan_end, step, delay
- .byte 0x27
- .2byte \id
- .byte \pan_start
- .byte \pan_end
- .byte \step
- .byte \delay
- .endm
-
- .macro monbgprio_28 unk
- .byte 0x28
- .byte \unk
- .endm
-
- .macro monbgprio_29
- .byte 0x29
- .endm
-
- .macro monbgprio_2A unk
- .byte 0x2A
- .byte \unk
- .endm
-
- .macro invisible side
- .byte 0x2B
- .byte \side
- .endm
-
- .macro visible side
- .byte 0x2C
- .byte \side
- .endm
-
- .macro doublebattle_2D unk
- .byte 0x2D
- .byte \unk
- .endm
-
- .macro doublebattle_2E unk
- .byte 0x2E
- .byte \unk
- .endm
-
- .macro stopsound
- .byte 0x2F
- .endm
diff --git a/berry_fix/payload/asm/macros/battle_script.inc b/berry_fix/payload/asm/macros/battle_script.inc
deleted file mode 100644
index 223f191c5..000000000
--- a/berry_fix/payload/asm/macros/battle_script.inc
+++ /dev/null
@@ -1,1228 +0,0 @@
-@ 0 ==
-@ 1 !=
-@ 2 <
-@ 3 >
-@ 4 &=
-
- .macro calculatedamage
- critical
- atk5
- atk6
- atk7
- .endm
-
-
- .macro attackcanceler
- .byte 0x00
- .endm
-
- .macro accuracycheck address, param1
- .byte 0x01
- .4byte \address
- .2byte \param1
- .endm
-
- .macro attackstring
- .byte 0x02
- .endm
-
- .macro ppreduce
- .byte 0x03
- .endm
-
- .macro critcalc
- .byte 0x04
- .endm
-
- .macro atk5
- .byte 0x05
- .endm
-
- .macro atk6
- .byte 0x06
- .endm
-
- .macro atk7
- .byte 0x07
- .endm
-
- .macro atk8
- .byte 0x08
- .endm
-
- .macro attackanimation
- .byte 0x09
- .endm
-
- .macro waitanimation
- .byte 0x0a
- .endm
-
- .macro graphicalhpupdate bank
- .byte 0x0b
- .byte \bank
- .endm
-
- .macro datahpupdate bank
- .byte 0x0c
- .byte \bank
- .endm
-
- .macro critmessage
- .byte 0x0d
- .endm
-
- .macro missmessage
- .byte 0x0e
- .endm
-
- .macro resultmessage
- .byte 0x0f
- .endm
-
- .macro printstring string
- .byte 0x10
- .2byte \string
- .endm
-
- .macro printstring2 string
- .byte 0x11
- .2byte \string
- .endm
-
- .macro waitmessage delay
- .byte 0x12
- .2byte \delay
- .endm
-
- .macro printfromtable table
- .byte 0x13
- .4byte \table
- .endm
-
- .macro printfromtable2 table
- .byte 0x14
- .4byte \table
- .endm
-
- .macro seteffectwithchancetarget
- .byte 0x15
- .endm
-
- .macro seteffecttarget
- .byte 0x16
- .endm
-
- .macro seteffectuser
- .byte 0x17
- .endm
-
- .macro clearstatus bank
- .byte 0x18
- .byte \bank
- .endm
-
- .macro faintpokemon bank, param2, param3
- .byte 0x19
- .byte \bank
- .byte \param2
- .4byte \param3
- .endm
-
- .macro atk1a param1
- .byte 0x1a
- .byte \param1
- .endm
-
- .macro atk1b bank
- .byte 0x1b
- .byte \bank
- .endm
-
- .macro jumpifstatus bank, status, address
- .byte 0x1c
- .byte \bank
- .4byte \status
- .4byte \address
- .endm
-
- .macro jumpifsecondarytstatus bank, status, address
- .byte 0x1d
- .byte \bank
- .4byte \status
- .4byte \address
- .endm
-
- .macro jumpifability bank, ability, address
- .byte 0x1e
- .byte \bank
- .byte \ability
- .4byte \address
- .endm
-
- .macro jumpifhalverset bank, status, address
- .byte 0x1f
- .byte \bank
- .2byte \status
- .4byte \address
- .endm
-
- .macro jumpifstat bank, flag, quantity, statid, address
- .byte 0x20
- .byte \bank
- .byte \flag
- .byte \quantity
- .byte \statid
- .4byte \address
- .endm
-
- .macro jumpifspecialstatusflag bank, mask, status, address
- .byte 0x21
- .byte \bank
- .4byte \mask
- .byte \status
- .4byte \address
- .endm
-
- .macro jumpiftype bank, type, address
- .byte 0x22
- .byte \bank
- .byte \type
- .4byte \address
- .endm
-
- .macro atk23 bank
- .byte 0x23
- .byte \bank
- .endm
-
- .macro atk24 address
- .byte 0x24
- .4byte \address
- .endm
-
- .macro atk25
- .byte 0x25
- .endm
-
- .macro atk26 param1
- .byte 0x26
- .byte \param1
- .endm
-
- .macro atk27 address
- .byte 0x27
- .4byte \address
- .endm
-
- .macro jump address
- .byte 0x28
- .4byte \address
- .endm
-
- .macro jumpifbyte ifflag, checkaddr, compare, address
- .byte 0x29
- .byte \ifflag
- .4byte \checkaddr
- .byte \compare
- .4byte \address
- .endm
-
- .macro jumpifhalfword ifflag, checkaddr, compare, address
- .byte 0x2a
- .byte \ifflag
- .4byte \checkaddr
- .2byte \compare
- .4byte \address
- .endm
-
- .macro jumpifword ifflag, checkaddr, compare, address
- .byte 0x2b
- .byte \ifflag
- .4byte \checkaddr
- .4byte \compare
- .4byte \address
- .endm
-
- .macro jumpifarrayequal mem1, mem2, size, address
- .byte 0x2c
- .4byte \mem1
- .4byte \mem2
- .byte \size
- .4byte \address
- .endm
-
- .macro jumpifarraynotequal mem1, mem2, size, address
- .byte 0x2d
- .4byte \mem1
- .4byte \mem2
- .byte \size
- .4byte \address
- .endm
-
- .macro setbyte pointer, value
- .byte 0x2e
- .4byte \pointer
- .byte \value
- .endm
-
- .macro addbyte pointer, value
- .byte 0x2f
- .4byte \pointer
- .byte \value
- .endm
-
- .macro subtractbyte pointer, value
- .byte 0x30
- .4byte \pointer
- .byte \value
- .endm
-
- .macro copyarray destination, source, size
- .byte 0x31
- .4byte \destination
- .4byte \source
- .byte \size
- .endm
-
- .macro atk32 param1, param2, param3, byte
- .byte 0x32
- .4byte \param1
- .4byte \param2
- .4byte \param3
- .byte \byte
- .endm
-
- .macro orbyte pointer, value
- .byte 0x33
- .4byte \pointer
- .byte \value
- .endm
-
- .macro orhalfword pointer, value
- .byte 0x34
- .4byte \pointer
- .2byte \value
- .endm
-
- .macro orword pointer, value
- .byte 0x35
- .4byte \pointer
- .4byte \value
- .endm
-
- .macro bicbyte pointer, value
- .byte 0x36
- .4byte \pointer
- .byte \value
- .endm
-
- .macro bichalfword pointer, value
- .byte 0x37
- .4byte \pointer
- .2byte \value
- .endm
-
- .macro bicword pointer, value
- .byte 0x38
- .4byte \pointer
- .4byte \value
- .endm
-
- .macro pause pause_duration
- .byte 0x39
- .2byte \pause_duration
- .endm
-
- .macro waitstateatk
- .byte 0x3a
- .endm
-
- .macro somethinghealatk3b bank
- .byte 0x3b
- .byte \bank
- .endm
-
- .macro return
- .byte 0x3c
- .endm
-
- .macro end
- .byte 0x3d
- .endm
-
- .macro end2
- .byte 0x3e
- .endm
-
- .macro end3
- .byte 0x3f
- .endm
-
- .macro atk40 address
- .byte 0x40
- .4byte \address
- .endm
-
- .macro callatk address
- .byte 0x41
- .4byte \address
- .endm
-
- .macro jumpiftype2 bank, type, address
- .byte 0x42
- .byte \bank
- .byte \type
- .4byte \address
- .endm
-
- .macro jumpifabilitypresent ability, address
- .byte 0x43
- .byte \ability
- .4byte \address
- .endm
-
- .macro atk44
- .byte 0x44
- .endm
-
- .macro playanimation bank, animation, var_address
- .byte 0x45
- .byte \bank
- .byte \animation
- .4byte \var_address
- .endm
-
- .macro atk46 bank, address, int
- .byte 0x46
- .byte \bank
- .4byte \address
- .4byte \int
- .endm
-
- .macro atk47
- .byte 0x47
- .endm
-
- .macro playstatchangeanimation bank, color, byte
- .byte 0x48
- .byte \bank
- .byte \color
- .byte \byte
- .endm
-
- .macro atk49 byte1, byte2
- .byte 0x49
- .byte \byte1
- .byte \byte2
- .endm
-
- .macro damagecalc2
- .byte 0x4a
- .endm
-
- .macro atk4b
- .byte 0x4b
- .endm
-
- .macro switch1 bank
- .byte 0x4c
- .byte \bank
- .endm
-
- .macro switch2 bank
- .byte 0x4d
- .byte \bank
- .endm
-
- .macro switch3 bank, byte
- .byte 0x4e
- .byte \bank
- .byte \byte
- .endm
-
- .macro jumpifcannotswitch bank, address
- .byte 0x4f
- .byte \bank
- .4byte \address
- .endm
-
- .macro openpartyscreen bank, address
- .byte 0x50
- .byte \bank
- .4byte \address
- .endm
-
- .macro atk51 bank, param2
- .byte 0x51
- .byte \bank
- .byte \param2
- .endm
-
- .macro atk52 bank
- .byte 0x52
- .byte \bank
- .endm
-
- .macro atk53 bank
- .byte 0x53
- .byte \bank
- .endm
-
- .macro atk54 word
- .byte 0x54
- .2byte \word
- .endm
-
- .macro atk55 int
- .byte 0x55
- .4byte \int
- .endm
-
- .macro atk56 bank_or_side
- .byte 0x56
- .byte \bank_or_side
- .endm
-
- .macro atk57
- .byte 0x57
- .endm
-
- .macro atk58 bank
- .byte 0x58
- .byte \bank
- .endm
-
- .macro checkiflearnmoveinbattle param1, param2, bank_maybe
- .byte 0x59
- .4byte \param1
- .4byte \param2
- .byte \bank_maybe
- .endm
-
- .macro atk5a address
- .byte 0x5a
- .4byte \address
- .endm
-
- .macro atk5b address
- .byte 0x5b
- .4byte \address
- .endm
-
- .macro atk5c bank
- .byte 0x5c
- .byte \bank
- .endm
-
- .macro atk5d
- .byte 0x5d
- .endm
-
- .macro atk5e bank
- .byte 0x5e
- .byte \bank
- .endm
-
- .macro atk5f
- .byte 0x5f
- .endm
-
- .macro atk60 byte
- .byte 0x60
- .byte \byte
- .endm
-
- .macro atk61 bank_or_side
- .byte 0x61
- .byte \bank_or_side
- .endm
-
- .macro atk62_hidepartystatussummary bank_or_side
- .byte 0x62
- .byte \bank_or_side
- .endm
-
- .macro jumptoattack bank
- .byte 0x63
- .byte \bank
- .endm
-
- .macro statusanimation bank
- .byte 0x64
- .byte \bank
- .endm
-
- .macro atk65 bank_or_side, address
- .byte 0x65
- .byte \bank_or_side
- .4byte \address
- .endm
-
- .macro atk66 bank_or_side, bank_or_side2, address
- .byte 0x66
- .byte \bank_or_side
- .byte \bank_or_side2
- .4byte \address
- .endm
-
- .macro atk67
- .byte 0x67
- .endm
-
- .macro atk68
- .byte 0x68
- .endm
-
- .macro atk69
- .byte 0x69
- .endm
-
- .macro removeitem bank
- .byte 0x6a
- .byte \bank
- .endm
-
- .macro atk6b
- .byte 0x6b
- .endm
-
- .macro atk6c
- .byte 0x6c
- .endm
-
- .macro atk6d
- .byte 0x6d
- .endm
-
- .macro atk6e
- .byte 0x6e
- .endm
-
- .macro atk6f bank
- .byte 0x6f
- .byte \bank
- .endm
-
- .macro atk70 bank
- .byte 0x70
- .byte \bank
- .endm
-
- .macro atk71
- .byte 0x71
- .endm
-
- .macro atk72 address
- .byte 0x72
- .4byte \address
- .endm
-
- .macro atk73 bank
- .byte 0x73
- .byte \bank
- .endm
-
- .macro atk74 bank
- .byte 0x74
- .byte \bank
- .endm
-
- .macro atk75
- .byte 0x75
- .endm
-
- .macro atk76 bank, byte
- .byte 0x76
- .byte \bank
- .byte \byte
- .endm
-
- .macro setprotect
- .byte 0x77
- .endm
-
- .macro faintifabilitynotdamp
- .byte 0x78
- .endm
-
- .macro setuserhptozero
- .byte 0x79
- .endm
-
- .macro jumpwhiletargetvalid address
- .byte 0x7a
- .4byte \address
- .endm
-
- .macro setdamageasrestorehalfmaxhp address, byte
- .byte 0x7b
- .4byte \address
- .byte \byte
- .endm
-
- .macro jumptolastusedattack
- .byte 0x7c
- .endm
-
- .macro setrain
- .byte 0x7d
- .endm
-
- .macro setreflect
- .byte 0x7e
- .endm
-
- .macro setleechseed
- .byte 0x7f
- .endm
-
- .macro manipulatedamage id
- .byte 0x80
- .byte \id
- .endm
-
- .macro setrest address
- .byte 0x81
- .4byte \address
- .endm
-
- .macro jumpifnotfirstturn address
- .byte 0x82
- .4byte \address
- .endm
-
- .macro nop3
- .byte 0x83
- .endm
-
- .macro jumpifcannotsleep address
- .byte 0x84
- .4byte \address
- .endm
-
- .macro stockpile
- .byte 0x85
- .endm
-
- .macro stockpiletobasedamage address
- .byte 0x86
- .4byte \address
- .endm
-
- .macro stockpiletohprecovery address
- .byte 0x87
- .4byte \address
- .endm
-
- .macro negativedamage
- .byte 0x88
- .endm
-
- .macro statbuffchange target, address
- .byte 0x89
- .byte \target
- .4byte \address
- .endm
-
- .macro normalisebuffs
- .byte 0x8a
- .endm
-
- .macro setbide
- .byte 0x8b
- .endm
-
- .macro confuseifrepeatingattackends
- .byte 0x8c
- .endm
-
- .macro setloopcounter count
- .byte 0x8d
- .byte \count
- .endm
-
- .macro atk8e
- .byte 0x8e
- .endm
-
- .macro forcerandomswitch address
- .byte 0x8f
- .4byte \address
- .endm
-
- .macro changetypestoenemyattacktype address
- .byte 0x90
- .4byte \address
- .endm
-
- .macro givemoney
- .byte 0x91
- .endm
-
- .macro setlightscreen
- .byte 0x92
- .endm
-
- .macro koplussomethings address
- .byte 0x93
- .4byte \address
- .endm
-
- .macro gethalfcurrentenemyhp
- .byte 0x94
- .endm
-
- .macro setsandstorm
- .byte 0x95
- .endm
-
- .macro weatherdamage
- .byte 0x96
- .endm
-
- .macro tryinfatuatetarget address
- .byte 0x97
- .4byte \address
- .endm
-
- .macro atk98 byte
- .byte 0x98
- .byte \byte
- .endm
-
- .macro setmisteffect
- .byte 0x99
- .endm
-
- .macro setincreasedcriticalchance
- .byte 0x9a
- .endm
-
- .macro transformdataexecution
- .byte 0x9b
- .endm
-
- .macro setsubstituteeffect
- .byte 0x9c
- .endm
-
- .macro copyattack address
- .byte 0x9d
- .4byte \address
- .endm
-
- .macro metronomeeffect
- .byte 0x9e
- .endm
-
- .macro nightshadedamageeffect
- .byte 0x9f
- .endm
-
- .macro psywavedamageeffect
- .byte 0xa0
- .endm
-
- .macro counterdamagecalculator address
- .byte 0xa1
- .4byte \address
- .endm
-
- .macro mirrorcoatdamagecalculator address
- .byte 0xa2
- .4byte \address
- .endm
-
- .macro disablelastusedattack address
- .byte 0xa3
- .4byte \address
- .endm
-
- .macro setencore address
- .byte 0xa4
- .4byte \address
- .endm
-
- .macro painsplitdamagecalculator address
- .byte 0xa5
- .4byte \address
- .endm
-
- .macro settypetorandomresistance address
- .byte 0xa6
- .4byte \address
- .endm
-
- .macro setalwayshitflag
- .byte 0xa7
- .endm
-
- .macro copymovepermanently address
- .byte 0xa8
- .4byte \address
- .endm
-
- .macro selectrandommovefromusermoves address
- .byte 0xa9
- .4byte \address
- .endm
-
- .macro destinybondeffect
- .byte 0xaa
- .endm
-
- .macro atkab
- .byte 0xab
- .endm
-
- .macro remaininghptopower
- .byte 0xac
- .endm
-
- .macro reducepprandom address
- .byte 0xad
- .4byte \address
- .endm
-
- .macro clearstatusifnotsoundproofed
- .byte 0xae
- .endm
-
- .macro cursetarget address
- .byte 0xaf
- .4byte \address
- .endm
-
- .macro setspikes address
- .byte 0xb0
- .4byte \address
- .endm
-
- .macro setforesight
- .byte 0xb1
- .endm
-
- .macro setperishsong address
- .byte 0xb2
- .4byte \address
- .endm
-
- .macro rolloutdamagecalculation
- .byte 0xb3
- .endm
-
- .macro jumpifconfusedandattackmaxed bank, address
- .byte 0xb4
- .byte \bank
- .4byte \address
- .endm
-
- .macro furycutterdamagecalculation
- .byte 0xb5
- .endm
-
- .macro happinesstodamagecalculation
- .byte 0xb6
- .endm
-
- .macro presentdamagecalculation
- .byte 0xb7
- .endm
-
- .macro setsafeguard
- .byte 0xb8
- .endm
-
- .macro magnitudedamagecalculation
- .byte 0xb9
- .endm
-
- .macro atkba address
- .byte 0xba
- .4byte \address
- .endm
-
- .macro setsunny
- .byte 0xbb
- .endm
-
- .macro maxattackhalvehp address
- .byte 0xbc
- .4byte \address
- .endm
-
- .macro copyfoestats address
- .byte 0xbd
- .4byte \address
- .endm
-
- .macro breakfree
- .byte 0xbe
- .endm
-
- .macro setcurled
- .byte 0xbf
- .endm
-
- .macro recoverbasedonsunlight address
- .byte 0xc0
- .4byte \address
- .endm
-
- .macro hiddenpowerdamagecalculation
- .byte 0xc1
- .endm
-
- .macro selectnexttarget
- .byte 0xc2
- .endm
-
- .macro setfutureattack address
- .byte 0xc3
- .4byte \address
- .endm
-
- .macro beatupcalculation address1, address2
- .byte 0xc4
- .4byte \address1
- .4byte \address2
- .endm
-
- .macro hidepreattack
- .byte 0xc5
- .endm
-
- .macro unhidepostattack
- .byte 0xc6
- .endm
-
- .macro setminimize
- .byte 0xc7
- .endm
-
- .macro sethail
- .byte 0xc8
- .endm
-
- .macro jumpifattackandspecialattackcannotfall address
- .byte 0xc9
- .4byte \address
- .endm
-
- .macro setforcedtarget
- .byte 0xca
- .endm
-
- .macro setcharge
- .byte 0xcb
- .endm
-
- .macro callterrainattack
- .byte 0xcc
- .endm
-
- .macro cureifburnedparalysedorpoisoned address
- .byte 0xcd
- .4byte \address
- .endm
-
- .macro settorment address
- .byte 0xce
- .4byte \address
- .endm
-
- .macro jumpifnodamage address
- .byte 0xcf
- .4byte \address
- .endm
-
- .macro settaunt address
- .byte 0xd0
- .4byte \address
- .endm
-
- .macro sethelpinghand address
- .byte 0xd1
- .4byte \address
- .endm
-
- .macro itemswap address
- .byte 0xd2
- .4byte \address
- .endm
-
- .macro copyability address
- .byte 0xd3
- .4byte \address
- .endm
-
- .macro atkd4 byte, address
- .byte 0xd4
- .byte \byte
- .4byte \address
- .endm
-
- .macro setroots address
- .byte 0xd5
- .4byte \address
- .endm
-
- .macro doubledamagedealtifdamaged
- .byte 0xd6
- .endm
-
- .macro setyawn address
- .byte 0xd7
- .4byte \address
- .endm
-
- .macro setdamagetohealthdifference address
- .byte 0xd8
- .4byte \address
- .endm
-
- .macro scaledamagebyhealthratio
- .byte 0xd9
- .endm
-
- .macro abilityswap address
- .byte 0xda
- .4byte \address
- .endm
-
- .macro imprisoneffect address
- .byte 0xdb
- .4byte \address
- .endm
-
- .macro setgrudge address
- .byte 0xdc
- .4byte \address
- .endm
-
- .macro weightdamagecalculation
- .byte 0xdd
- .endm
-
- .macro assistattackselect address
- .byte 0xde
- .4byte \address
- .endm
-
- .macro setmagiccoat address
- .byte 0xdf
- .4byte \address
- .endm
-
- .macro setstealstatchange address
- .byte 0xe0
- .4byte \address
- .endm
-
- .macro atke1 address
- .byte 0xe1
- .4byte \address
- .endm
-
- .macro atke2 bank
- .byte 0xe2
- .byte \bank
- .endm
-
- .macro jumpiffainted bank, address
- .byte 0xe3
- .byte \bank
- .4byte \address
- .endm
-
- .macro naturepowereffect
- .byte 0xe4
- .endm
-
- .macro pickupitemcalculation
- .byte 0xe5
- .endm
-
- .macro actualcastformswitch
- .byte 0xe6
- .endm
-
- .macro castformswitch
- .byte 0xe7
- .endm
-
- .macro settypebasedhalvers address
- .byte 0xe8
- .4byte \address
- .endm
-
- .macro seteffectbyweather
- .byte 0xe9
- .endm
-
- .macro recycleitem address
- .byte 0xea
- .4byte \address
- .endm
-
- .macro settypetoterrain address
- .byte 0xeb
- .4byte \address
- .endm
-
- .macro pursuitwhenswitched address
- .byte 0xec
- .4byte \address
- .endm
-
- .macro snatchmove
- .byte 0xed
- .endm
-
- .macro removereflectlightscreen
- .byte 0xee
- .endm
-
- .macro pokemoncatchfunction
- .byte 0xef
- .endm
-
- .macro catchpoke
- .byte 0xf0
- .endm
-
- .macro capturesomethingf1 address
- .byte 0xf1
- .4byte \address
- .endm
-
- .macro capturesomethingf2
- .byte 0xf2
- .endm
-
- .macro capturesomethingf3 address
- .byte 0xf3
- .4byte \address
- .endm
-
- .macro removehp
- .byte 0xf4
- .endm
-
- .macro curestatusfirstword
- .byte 0xf5
- .endm
-
- .macro atkf6
- .byte 0xf6
- .endm
-
- .macro activesidesomething
- .byte 0xf7
- .endm
-
- .macro atkf8 bank
- .byte 0xf8
- .byte \bank
- .endm
diff --git a/berry_fix/payload/asm/macros/contest_ai_script.inc b/berry_fix/payload/asm/macros/contest_ai_script.inc
deleted file mode 100644
index 05d70e351..000000000
--- a/berry_fix/payload/asm/macros/contest_ai_script.inc
+++ /dev/null
@@ -1,506 +0,0 @@
-@ Add a positive/negative value to the score of the move being evaluated.
-
- .macro score score
- .byte 0x00
- .byte \score
- .endm
-
-@ turn (AKA "Appeal No.")
-
- .macro get_turn
- .byte 0x01
- .endm
-
- .macro if_turn_less_than param, addr
- .byte 0x02
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_turn_more_than param, addr
- .byte 0x03
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_turn_eq param, addr
- .byte 0x04
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_turn_not_eq param, addr
- .byte 0x05
- .byte \param
- .4byte \addr
- .endm
-
-@ audience excitement
-
- .macro get_excitement
- .byte 0x06
- .endm
-
- .macro if_excitement_less_than param, addr
- .byte 0x07
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_excitement_more_than param, addr
- .byte 0x08
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_excitement_eq param, addr
- .byte 0x09
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_excitement_not_eq param, addr
- .byte 0x0A
- .byte \param
- .4byte \addr
- .endm
-
-@ the order that the user goes in the current turn
-
- .macro get_user_order
- .byte 0x0B
- .endm
-
- .macro if_user_order_less_than param addr
- .byte 0x0C
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_user_order_more_than param addr
- .byte 0x0D
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_user_order_eq param addr
- .byte 0x0E
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_user_order_not_eq param addr
- .byte 0x0F
- .byte \param
- .4byte \addr
- .endm
-
-@ user condition
-
- .macro get_user_condition
- .byte 0x10
- .endm
-
- .macro if_user_condition_less_than param, addr
- .byte 0x11
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_user_condition_more_than param, addr
- .byte 0x12
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_user_condition_eq param, addr
- .byte 0x13
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_user_condition_not_eq param, addr
- .byte 0x14
- .byte \param
- .4byte \addr
- .endm
-
-@ 15
-@ 16
-@ 17
-@ 18
-@ 19
-@ 1A
-@ 1B
-@ 1C
-@ 1D
-@ 1E
-
-@ contest type
-
- .macro get_contest_type
- .byte 0x1F
- .endm
-
- .macro if_contest_type_eq param, addr
- .byte 0x20
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_contest_type_not_eq param, addr
- .byte 0x21
- .byte \param
- .4byte \addr
- .endm
-
-@ move excitement (change in excitement due to move)
-
- .macro get_move_excitement
- .byte 0x22
- .endm
-
- .macro if_move_excitement_less_than param, addr
- .byte 0x23
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_move_excitement_more_than param, addr
- .byte 0x24
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_move_excitement_eq param, addr
- .byte 0x25
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_move_excitement_not_eq param, addr
- .byte 0x26
- .byte \param
- .4byte \addr
- .endm
-
-@ move effect
-
- .macro get_effect
- .byte 0x27
- .endm
-
- .macro if_effect_eq param, addr
- .byte 0x28
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_effect_not_eq param, addr
- .byte 0x29
- .byte \param
- .4byte \addr
- .endm
-
-@ move effect type
-
- .macro get_effect_type
- .byte 0x2A
- .endm
-
- .macro if_effect_type_eq param, addr
- .byte 0x2B
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_effect_type_not_eq param, addr
- .byte 0x2C
- .byte \param
- .4byte \addr
- .endm
-
-@ whether the current move is the most appealing in the user's moveset
-
- .macro check_most_appealing_move
- .byte 0x2D
- .endm
-
- .macro if_most_appealing_move addr
- .byte 0x2E
- .4byte \addr
- .endm
-
-@ 2F
-@ 30
-@ 31
-@ 32
-@ 33
-@ 34
-@ 35
-@ 36
-@ 37
-@ 38
-@ 39
-@ 3A
-
-@ number of times current move has been used
-
- .macro get_move_used_count
- .byte 0x3B
- .endm
-
- .macro if_move_used_count_less_than param, addr
- .byte 0x3C
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_move_used_count_more_than param, addr
- .byte 0x3D
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_move_used_count_eq param, addr
- .byte 0x3E
- .byte \param
- .4byte \addr
- .endm
-
- .macro if_move_used_count_not_eq param, addr
- .byte 0x3F
- .byte \param
- .4byte \addr
- .endm
-
-@ whether the current move is a combo starter (with another move in the moveset)
-
- .macro check_combo_starter
- .byte 0x40
- .endm
-
- .macro if_combo_starter addr
- .byte 0x41
- .4byte \addr
- .endm
-
- .macro if_not_combo_starter addr
- .byte 0x42
- .4byte \addr
- .endm
-
-@ whether the current move is a combo finisher (with another move in the moveset)
-
- .macro check_combo_finisher
- .byte 0x43
- .endm
-
- .macro if_combo_finisher addr
- .byte 0x44
- .4byte \addr
- .endm
-
- .macro if_not_combo_finisher addr
- .byte 0x45
- .4byte \addr
- .endm
-
-@ whether the current move would finish a combo
-
- .macro check_would_finish_combo
- .byte 0x46
- .endm
-
- .macro if_would_finish_combo addr
- .byte 0x47
- .4byte \addr
- .endm
-
- .macro if_would_not_finish_combo addr
- .byte 0x48
- .4byte \addr
- .endm
-
-@ condition of mon (indexed by order)
-
- .macro get_condition mon
- .byte 0x49
- .byte \mon
- .endm
-
- .macro if_condition_less_than mon, value, addr
- .byte 0x4A
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
- .macro if_condition_more_than mon, value, addr
- .byte 0x4B
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
- .macro if_condition_eq mon, value, addr
- .byte 0x4C
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
- .macro if_condition_not_eq mon, value, addr
- .byte 0x4D
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
-@ whether the mon used a combo starter move
-@ Even though this value is always 1 or 0 (i.e. TRUE/FALSE),
-@ there are less-than and greater-than comparison operations for some reason.
-
- .macro get_used_combo_starter mon
- .byte 0x4E
- .byte \mon
- .endm
-
- .macro if_used_combo_starter_less_than mon, value, addr
- .byte 0x4F
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
- .macro if_used_combo_starter_more_than mon, value, addr
- .byte 0x50
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
-
- .macro if_used_combo_starter_eq mon, value, addr
- .byte 0x51
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
- .macro if_used_combo_starter_not_eq mon, value, addr
- .byte 0x52
- .byte \mon
- .byte \value
- .4byte \addr
- .endm
-
-@ whether the mon can make an appeal
-
- .macro check_can_participate mon
- .byte 0x53
- .byte \mon
- .endm
-
- .macro if_can_participate mon, addr
- .byte 0x54
- .byte \mon
- .4byte \addr
- .endm
-
- .macro if_cannot_participate mon, addr
- .byte 0x55
- .byte \mon
- .4byte \addr
- .endm
-
-@ 56
-@ 57
-
- .macro contest_58 param addr
- .byte 0x58
- .byte \param
- .4byte \addr
- .endm
-
-@ 59
-@ 5A
-@ 5B
-@ 5C
-@ 5D
-@ 5E
-@ 5F
-@ 60
-@ 61
-@ 62
-@ 63
-@ 64
-@ 65
-@ 66
-@ 67
-@ 68
-@ 69
-@ 6A
-@ 6B
-@ 6C
-@ 6D
-@ 6E
-@ 6F
-@ 70
-@ 71
-@ 72
-@ 73
-@ 74
-@ 75
-@ 76
-@ 77
-@ 78
-@ 79
-@ 7A
-@ 7B
-@ 7C
-
- .macro if_random param addr
- .byte 0x7D
- .byte \param
- .4byte \addr
- .endm
-
-@ 7E
-
- .macro jump addr
- .byte 0x7F
- .4byte \addr
- .endm
-
- .macro call addr
- .byte 0x80
- .4byte \addr
- .endm
-
- .macro end
- .byte 0x81
- .endm
-
- .macro check_user_has_exciting_move
- .byte 0x82
- .endm
-
- .macro if_user_has_exciting_move addr
- .byte 0x83
- .4byte \addr
- .endm
-
- .macro if_user_doesnt_have_exciting_move addr
- .byte 0x84
- .4byte \addr
- .endm
-
-@ 85
-@ 86
-
- .macro if_effect_in_user_moveset param addr
- .byte 0x87
- .2byte \param
- .4byte \addr
- .endm
diff --git a/berry_fix/payload/asm/macros/ec.inc b/berry_fix/payload/asm/macros/ec.inc
deleted file mode 100644
index d3fd45c2f..000000000
--- a/berry_fix/payload/asm/macros/ec.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-
- .macro ec_duplicates count
- .2byte 0xff00 + \count
- .endm
-
- .macro ec_words_by_letter label
- .2byte (gEasyChatWordsByLetter_\label - gEasyChatWordsAlphabetized) / 2
- .endm
diff --git a/berry_fix/payload/asm/macros/event.inc b/berry_fix/payload/asm/macros/event.inc
deleted file mode 100644
index d805aecb5..000000000
--- a/berry_fix/payload/asm/macros/event.inc
+++ /dev/null
@@ -1,1433 +0,0 @@
- @ Does nothing.
- .macro nop
- .byte 0x00
- .endm
-
- @ Does nothing.
- .macro nop1
- .byte 0x01
- .endm
-
- @ Terminates script execution.
- .macro end
- .byte 0x02
- .endm
-
- @ Jumps back to after the last-executed call statement, and continues script execution from there.
- .macro return
- .byte 0x03
- .endm
-
- @ Jumps to destination and continues script execution from there. The location of the calling script is remembered and can be returned to later.
- .macro call destination
- .byte 0x04
- .4byte \destination
- .endm
-
- @ Jumps to destination and continues script execution from there.
- .macro goto destination
- .byte 0x05
- .4byte \destination
- .endm
-
- @ If the result of the last comparison matches condition (see Comparison operators), jumps to destination and continues script execution from there.
- .macro goto_if condition, destination
- .byte 0x06
- .byte \condition
- .4byte \destination
- .endm
-
- @ If the result of the last comparison matches condition (see Comparison operators), calls destination.
- .macro call_if condition, destination
- .byte 0x07
- .byte \condition
- .4byte \destination
- .endm
-
- @ Jumps to the standard function at index function.
- .macro gotostd function
- .byte 0x08
- .byte \function
- .endm
-
- @ Calls the standard function at index function.
- .macro callstd function
- .byte 0x09
- .byte \function
- .endm
-
- @ If the result of the last comparison matches condition (see Comparison operators), jumps to the standard function at index function.
- .macro gotostd_if condition, function
- .byte 0x0a
- .byte \condition
- .byte \function
- .endm
-
- @ If the result of the last comparison matches condition (see Comparison operators), calls the standard function at index function.
- .macro callstd_if condition, function
- .byte 0x0b
- .byte \condition
- .byte \function
- .endm
-
- @ Executes a script stored in a default RAM location.
- .macro gotoram
- .byte 0x0c
- .endm
-
- @ Terminates script execution and "resets the script RAM".
- .macro killscript
- .byte 0x0d
- .endm
-
- @ Sets mystery event status
- .macro setmysteryeventstatus value
- .byte 0x0e
- .byte \value
- .endm
-
- @ Sets the specified script bank to immediate value.
- .macro loadword destination, value
- .byte 0x0f
- .byte \destination
- .4byte \value
- .endm
-
- @ Sets the specified script bank to immediate value.
- .macro loadbyte destination, value
- .byte 0x10
- .byte \destination
- .byte \value
- .endm
-
- @ Sets the byte at offset to value.
- .macro writebytetoaddr value, offset
- .byte 0x11
- .byte \value
- .4byte \offset
- .endm
-
- @ Copies the byte value at source into the specified script bank.
- .macro loadbytefromaddr destination, source
- .byte 0x12
- .byte \destination
- .4byte \source
- .endm
-
- @ Not sure. Judging from XSE's description I think it takes the least-significant byte in bank source and writes it to destination.
- .macro setptrbyte source, destination
- .byte 0x13
- .byte \source
- .4byte \destination
- .endm
-
- @ Copies the contents of bank source into bank destination.
- .macro copylocal destination, source
- .byte 0x14
- .byte \destination
- .byte \source
- .endm
-
- @ Copies the byte at source to destination, replacing whatever byte was previously there.
- .macro copybyte destination, source
- .byte 0x15
- .4byte \destination
- .4byte \source
- .endm
-
- @ Changes the value of destination to value.
- .macro setvar destination, value
- .byte 0x16
- .2byte \destination
- .2byte \value
- .endm
-
- @ Changes the value of destination by adding value to it. Overflow is not prevented (0xFFFF + 1 = 0x0000).
- .macro addvar destination, value
- .byte 0x17
- .2byte \destination
- .2byte \value
- .endm
-
- @ Changes the value of destination by subtracting value to it. Overflow is not prevented (0x0000 - 1 = 0xFFFF).
- .macro subvar destination, value
- .byte 0x18
- .2byte \destination
- .2byte \value
- .endm
-
- @ Copies the value of source into destination.
- .macro copyvar destination, source
- .byte 0x19
- .2byte \destination
- .2byte \source
- .endm
-
- @ If source is not a variable, then this function acts like setvar. Otherwise, it acts like copyvar.
- .macro setorcopyvar destination, source
- .byte 0x1a
- .2byte \destination
- .2byte \source
- .endm
-
- @ Compares the values of script banks a and b, after forcing the values to bytes.
- .macro compare_local_to_local byte1, byte2
- .byte 0x1b
- .byte \byte1
- .byte \byte2
- .endm
-
- @ Compares the least-significant byte of the value of script bank a to a fixed byte value (b).
- .macro compare_local_to_value a, b
- .byte 0x1c
- .byte \a
- .byte \b
- .endm
-
- @ Compares the least-significant byte of the value of script bank a to the byte located at offset b.
- .macro compare_local_to_addr a, b
- .byte 0x1d
- .byte \a
- .4byte \b
- .endm
-
- @ Compares the byte located at offset a to the least-significant byte of the value of script bank b.
- .macro compare_addr_to_local a, b
- .byte 0x1e
- .4byte \a
- .byte \b
- .endm
-
- @ Compares the byte located at offset a to a fixed byte value (b).
- .macro compare_addr_to_value a, b
- .byte 0x1f
- .4byte \a
- .byte \b
- .endm
-
- @ Compares the byte located at offset a to the byte located at offset b.
- .macro compare_addr_to_addr a, b
- .byte 0x20
- .4byte \a
- .4byte \b
- .endm
-
- @ Compares the value of `var` to a fixed word value (b).
- .macro compare_var_to_value var, value
- .byte 0x21
- .2byte \var
- .2byte \value
- .endm
-
- @ Compares the value of `var` to the value of `var2`.
- .macro compare_var_to_var var1, var2
- .byte 0x22
- .2byte \var1
- .2byte \var2
- .endm
-
- @ Generic compare macro which attempts to deduce argument types based on their values
- @ Any values between 0x4000 to 0x4FFF and 0x8000 to 0x8FFF are considered event variable identifiers
- .macro compare arg1, arg2
- .if ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && ((\arg2 >> 12) == 4 || (\arg2 >> 12) == 8)
- compare_var_to_var \arg1, \arg2
- .elseif ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && (\arg2 >= 0 && \arg2 <= 0xFFFF)
- compare_var_to_value \arg1, \arg2
- .else
- .error "Invalid arguments for 'compare'"
- .endif
- .endm
-
- @ Calls the native C function stored at `func`.
- .macro callnative func
- .byte 0x23
- .4byte \func
- .endm
-
- @ Replaces the script with the function stored at `func`. Execution returns to the bytecode script when func returns TRUE.
- .macro gotonative func
- .byte 0x24
- .4byte \func
- .endm
-
- @ Calls a special function; that is, a piece of ASM code designed for use by scripts and listed in a table of pointers.
- .macro special function
- .byte 0x25
- .2byte SPECIAL_\function
- .endm
-
- @ Calls a special function. That function's output (if any) will be written to the variable you specify.
- .macro specialvar output, function
- .byte 0x26
- .2byte \output
- .2byte SPECIAL_\function
- .endm
-
- @ Blocks script execution until a command or ASM code manually unblocks it. Generally used with specific commands and specials. If this command runs, and a subsequent command or piece of ASM does not unblock state, the script will remain blocked indefinitely (essentially a hang).
- .macro waitstate
- .byte 0x27
- .endm
-
- @ Blocks script execution for time (frames? milliseconds?).
- .macro delay time
- .byte 0x28
- .2byte \time
- .endm
-
- @ Sets a to 1.
- .macro setflag a
- .byte 0x29
- .2byte \a
- .endm
-
- @ Sets a to 0.
- .macro clearflag a
- .byte 0x2a
- .2byte \a
- .endm
-
- @ Compares a to 1.
- .macro checkflag a
- .byte 0x2b
- .2byte \a
- .endm
-
- @ In FireRed, this command is a nop.
- .macro initclock hour minute
- .byte 0x2c
- .endm
-
- @ In FireRed, this command is a nop.
- .macro dodailyevents
- .byte 0x2d
- .endm
-
- @ Resets the values of variables 0x8000, 0x8001, and 0x8002.
- .macro gettime
- .byte 0x2e
- .endm
-
- @ Plays the specified (sound_number) sound. Only one sound may play at a time, with newer ones interrupting older ones.
- .macro playse sound_number
- .byte 0x2f
- .2byte \sound_number
- .endm
-
- @ Blocks script execution until the currently-playing sound (triggered by sound) finishes playing.
- .macro waitse
- .byte 0x30
- .endm
-
- @ Plays the specified (fanfare_number) fanfare.
- .macro playfanfare fanfare_number
- .byte 0x31
- .2byte \fanfare_number
- .endm
-
- @ Blocks script execution until all currently-playing fanfares finish.
- .macro waitfanfare
- .byte 0x32
- .endm
-
- @ Plays the specified (song_number) song. The byte is apparently supposed to be 0x00.
- .macro playbgm song_number, unknown
- .byte 0x33
- .2byte \song_number
- .byte \unknown
- .endm
-
- @ Plays the specified (song_number) song.
- .macro savebgm song_number
- .byte 0x34
- .2byte \song_number
- .endm
-
- @ Crossfades the currently-playing song into the map's default song.
- .macro fadedefaultbgm
- .byte 0x35
- .endm
-
- @ Crossfades the currently-playng song into the specified (song_number) song.
- .macro fadenewbgm song_number
- .byte 0x36
- .2byte \song_number
- .endm
-
- @ Fades out the currently-playing song.
- .macro fadeoutbgm speed
- .byte 0x37
- .byte \speed
- .endm
-
- @ Fades the currently-playing song back in.
- .macro fadeinbgm speed
- .byte 0x38
- .byte \speed
- .endm
-
- @ Sends the player to Warp warp on Map bank.map. If the specified warp is 0xFF, then the player will instead be sent to (X, Y) on the map.
- .macro warp map, warp, X, Y
- .byte 0x39
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Clone of warp that does not play a sound effect.
- .macro warpsilent map, warp, X, Y
- .byte 0x3a
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Clone of warp that uses "a walking effect".
- .macro warpdoor map, warp, X, Y
- .byte 0x3b
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Warps the player to another map using a hole animation.
- .macro warphole map
- .byte 0x3c
- map \map
- .endm
-
- @ Clone of warp that uses a teleport effect. It is apparently only used in R/S/E.[source]
- .macro warpteleport map, warp, X, Y
- .byte 0x3d
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Clone of warp. Used by an (unused?) Safari Zone script to return the player to the gatehouse and end the Safari Game.
- .macro setwarp map, warp, X, Y
- .byte 0x3e
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Sets a default warp place. If a warp tries to send the player to Warp 127 on Map 127.127, they will instead be sent here. Useful when a map has warps that need to go to script-controlled locations (i.e. elevators).
- .macro setdynamicwarp map, warp, X, Y
- .byte 0x3f
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Clone of warp3, except that this writes data to different offsets...
- .macro setdivewarp map, warp, X, Y
- .byte 0x40
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Clone of warp3, except that this writes data to different offsets...
- .macro setholewarp map, warp, X, Y
- .byte 0x41
- map \map
- .byte \warp
- .2byte \X
- .2byte \Y
- .endm
-
- @ Retrieves the player's zero-indexed X- and Y-coordinates in the map, and stores them in the specified variables.
- .macro getplayerxy X, Y
- .byte 0x42
- .2byte \X
- .2byte \Y
- .endm
-
- @ Retrieves the number of Pokmon in the player's party, and stores that number in variable 0x800D (LASTRESULT).
- .macro countpokemon
- .byte 0x43
- .endm
-
- @ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and variable 0x800D (LASTRESULT) will be set to 0x0001; otherwise, LASTRESULT is set to 0x0000.
- .macro additem index, quantity
- .byte 0x44
- .2byte \index
- .2byte \quantity
- .endm
-
- @ Removes quantity of item index from the player's Bag.
- .macro removeitem index, quantity
- .byte 0x45
- .2byte \index
- .2byte \quantity
- .endm
-
- @ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets variable 0x800D (LASTRESULT) to 0x0001 if there is room, or 0x0000 is there is no room.
- .macro checkitemspace index, quantity
- .byte 0x46
- .2byte \index
- .2byte \quantity
- .endm
-
- @ Checks if the player has quantity or more of item index in their Bag. Sets variable 0x800D (LASTRESULT) to 0x0001 if the player has enough of the item, or 0x0000 if they have fewer than quantity of the item.
- .macro checkitem index, quantity
- .byte 0x47
- .2byte \index
- .2byte \quantity
- .endm
-
- @ Checks which Bag pocket the specified (index) item belongs in, and writes the value to variable 0x800D (LASTRESULT). This script is used to show the name of the proper Bag pocket when the player receives an item via callstd (simplified to giveitem in XSE).
- .macro checkitemtype index
- .byte 0x48
- .2byte \index
- .endm
-
- @ Adds a quantity amount of item index to the player's PC. Both arguments can be variables.
- .macro givepcitem index, quantity
- .byte 0x49
- .2byte \index
- .2byte \quantity
- .endm
-
- @ Checks for quantity amount of item index in the player's PC. Both arguments can be variables.
- .macro checkpcitem index, quantity
- .byte 0x4a
- .2byte \index
- .2byte \quantity
- .endm
-
- @ In FireRed, this command is a nop. (The argument is read, but not used for anything.)
- .macro adddecor decoration
- .byte 0x4b
- .2byte \decoration
- .endm
-
- @ In FireRed, this command is a nop. (The argument is read, but not used for anything.)
- .macro removedecor decoration
- .byte 0x4c
- .2byte \decoration
- .endm
-
- @ In FireRed, this command is a nop. (The argument is read, but not used for anything.)
- .macro hasdecor decoration
- .byte 0x4d
- .2byte \decoration
- .endm
-
- @ In FireRed, this command is a nop. (The argument is read, but not used for anything.)
- .macro checkdecor decoration
- .byte 0x4e
- .2byte \decoration
- .endm
-
- @ Applies the movement data at movements to the specified (index) Person event. Also closes any standard message boxes that are still open.
- @ This command in fact uses variables to access the Person event ID. So, for example, if you setvar 0x8000 to 0x3, and then use applymovementpos 0x8000 @move1, Person event 3 will have the movements at @move1 applied to them. Thank you Shiny Quagsire for bringing this to my attention.
- .macro applymovement index, movements, mapGroup, mapNum
- .ifb \mapGroup
- .byte 0x4f
- .2byte \index
- .4byte \movements
- .else
- .byte 0x50
- .2byte \index
- .4byte \movements
- .byte \mapGroup
- .byte \mapNum
- .endif
- .endm
-
- @ Blocks script execution until the movements being applied to the specified (index) Person event finish. If the specified Person event is 0x0000, then the command will block script execution until all Person events affected by applymovement finish their movements. If the specified Person event is not currently being manipulated with applymovement, then this command does nothing.
- .macro waitmovement index, mapBank, mapNum
- .ifb \mapBank
- .byte 0x51
- .2byte \index
- .else
- .byte 0x52
- .2byte \index
- .byte \mapBank
- .byte \mapNum
- .endif
- .endm
-
- @ Attempts to hide the specified (local_ID, a local ID) Person event on the specified map, by setting its visibility flag if it has a valid one. If the Person does not have a valid visibility flag, this command does nothing.
- @ If no map is specified, then the current map is used
- .macro removeobject localId, mapGroup, mapNum
- .ifb \mapGroup
- .byte 0x53
- .2byte \localId
- .else
- .byte 0x54
- .2byte \localId
- .byte \mapGroup
- .byte \mapNum
- .endif
- .endm
-
- .macro addobject localId, mapGroup, mapNum
- .ifb \mapGroup
- .byte 0x55
- .2byte \localId
- .else
- .byte 0x56
- .2byte \localId
- .byte \mapGroup
- .byte \mapNum
- .endif
- .endm
-
- @ Sets the specified (index) Object's position on the current map.
- .macro setobjectxy index, x, y
- .byte 0x57
- .2byte \index
- .2byte \x
- .2byte \y
- .endm
-
- .macro showobject index, map
- .byte 0x58
- .2byte \index
- map \map
- .endm
-
- .macro hideobject index, map
- .byte 0x59
- .2byte \index
- map \map
- .endm
-
- @ If the script was called by an Object, then that Object will turn to face toward the metatile that the player is standing on.
- .macro faceplayer
- .byte 0x5a
- .endm
-
- .macro turnobject index, direction
- .byte 0x5b
- .2byte \index
- .byte \direction
- .endm
-
- @ If the Trainer flag for Trainer index is not set, this command does absolutely nothing.
- .macro trainerbattle type, trainer, word, pointer1, pointer2, pointer3, pointer4
- .byte 0x5c
- .byte \type
- .2byte \trainer
- .2byte \word
- .if \type == 0
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .elseif \type == 1
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .4byte \pointer3 @ event script
- .elseif \type == 2
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .4byte \pointer3 @ event script
- .elseif \type == 3
- .4byte \pointer1 @ text
- .elseif \type == 4
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .4byte \pointer3 @ text
- .elseif \type == 5
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .elseif \type == 6
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .4byte \pointer3 @ text
- .4byte \pointer4 @ event script
- .elseif \type == 7
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .4byte \pointer3 @ text
- .elseif \type == 8
- .4byte \pointer1 @ text
- .4byte \pointer2 @ text
- .4byte \pointer3 @ text
- .4byte \pointer4 @ event script
- .endif
- .endm
-
-
- @ Starts a trainer battle using the battle information stored in RAM (usually by trainerbattle, which actually calls this command behind-the-scenes), and blocks script execution until the battle finishes.
- .macro battlebegin
- .byte 0x5d
- .endm
-
- .macro ontrainerbattleend
- .byte 0x5e
- .endm
-
- .macro ontrainerbattleendgoto
- .byte 0x5f
- .endm
-
- @ Compares Flag (trainer + 0x500) to 1. (If the flag is set, then the trainer has been defeated by the player.)
- .macro checktrainerflag trainer
- .byte 0x60
- .2byte \trainer
- .endm
-
- @ Sets Flag (trainer + 0x500). (I didn't make a mistake. The command names actually are backwards.)
- .macro settrainerflag trainer
- .byte 0x61
- .2byte \trainer
- .endm
-
- @ Clears Flag (trainer + 0x500). (I didn't make a mistake. The command names actually are backwards.)
- .macro cleartrainerflag trainer
- .byte 0x62
- .2byte \trainer
- .endm
-
- .macro setobjectxyperm index, x, y
- .byte 0x63
- .2byte \index
- .2byte \x
- .2byte \y
- .endm
-
- .macro moveobjectoffscreen index
- .byte 0x64
- .2byte \index
- .endm
-
- .macro setobjectmovementtype word, byte
- .byte 0x65
- .2byte \word
- .byte \byte
- .endm
-
- @ If a standard message box (or its text) is being drawn on-screen, this command blocks script execution until the box and its text have been fully drawn.
- .macro waitmessage
- .byte 0x66
- .endm
-
- @ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at that offset will be loaded and used. If text is script bank 0, then the value of script bank 0 will be treated as a pointer to the text. (You can use loadpointer to place a string pointer in a script bank.)
- .macro message text
- .byte 0x67
- .4byte \text
- .endm
-
- @ Holds the current message box open until the player presses a key. The message box is then closed.
- .macro closemessage
- .byte 0x68
- .endm
-
- @ Ceases movement for all Objects on-screen.
- .macro lockall
- .byte 0x69
- .endm
-
- @ If the script was called by an Object, then that Object's movement will cease.
- .macro lock
- .byte 0x6a
- .endm
-
- @ Resumes normal movement for all Objects on-screen, and closes any standard message boxes that are still open.
- .macro releaseall
- .byte 0x6b
- .endm
-
- @ If the script was called by an Object, then that Object's movement will resume. This command also closes any standard message boxes that are still open.
- .macro release
- .byte 0x6c
- .endm
-
- @ Blocks script execution until the player presses any key.
- .macro waitbuttonpress
- .byte 0x6d
- .endm
-
- @ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection. Their selection is stored in variable 0x800D (LASTRESULT); 0x0000 for "NO" or if the user pressed B, and 0x0001 for "YES".
- .macro yesnobox x, y
- .byte 0x6e
- .byte \x
- .byte \y
- .endm
-
- @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
- .macro multichoice x, y, list, b
- .byte 0x6f
- .byte \x
- .byte \y
- .byte \list
- .byte \b
- .endm
-
- @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
- .macro multichoicedefault x, y, list, default, b
- .byte 0x70
- .byte \x
- .byte \y
- .byte \list
- .byte \default
- .byte \b
- .endm
-
- @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The per_row argument determines how many list items will be shown on a single row of the box.
- .macro multichoicegrid x, y, list, per_row, B
- .byte 0x71
- .byte \x
- .byte \y
- .byte \list
- .byte \per_row
- .byte \B
- .endm
-
- .macro drawbox
- .byte 0x72
- .endm
-
- .macro erasebox byte1, byte2, byte3, byte4
- .byte 0x73
- .byte \byte1
- .byte \byte2
- .byte \byte3
- .byte \byte4
- .endm
-
- .macro drawboxtext
- .byte 0x74
- .endm
-
- @ Displays a box containing the front sprite for the specified (species) Pokemon species.
- .macro drawmonpic species, x, y
- .byte 0x75
- .2byte \species
- .byte \x
- .byte \y
- .endm
-
- @ Hides all boxes displayed with drawmonpic.
- .macro erasemonpic
- .byte 0x76
- .endm
-
- @ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.)
- .macro drawcontestwinner a
- .byte 0x77
- .byte \a
- .endm
-
- @ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille characters.
- .macro braillemessage text
- .byte 0x78
- .4byte \text
- .endm
-
- @ Gives the player one of the specified (species) Pokmon at level level holding item. The unknown arguments should all be zeroes.
- .macro givepoke species, level, item, unknown1, unknown2, unknown3
- .byte 0x79
- .2byte \species
- .byte \level
- .2byte \item
- .4byte \unknown1
- .4byte \unknown2
- .byte \unknown3
- .endm
-
- .macro giveegg species
- .byte 0x7a
- .2byte \species
- .endm
-
- .macro setpokemove byte1, byte2, word
- .byte 0x7b
- .byte \byte1
- .byte \byte2
- .2byte \word
- .endm
-
- @ Checks if at least one Pokémon in the player's party knows the specified (index) attack. If so, variable 0x800D (LASTRESULT) is set to the (zero-indexed) slot number of the first Pokémon that knows the move. If not, LASTRESULT is set to 0x0006. Variable 0x8004 is also set to this Pokémon's species.
- .macro checkpartymove index
- .byte 0x7c
- .2byte \index
- .endm
-
- @ Writes the name of the Pokemon at index species to the specified buffer.
- .macro getspeciesname out, species
- .byte 0x7d
- .byte \out
- .2byte \species
- .endm
-
- @ Writes the name of the species of the first Pokémon in the player's party to the specified buffer.
- .macro getfirstpartypokename out
- .byte 0x7e
- .byte \out
- .endm
-
- @ Writes the nickname of the Pokemon in slot slot (zero-indexed) of the player's party to the specified buffer. If an empty or invalid slot is specified, ten spaces ("") are written to the buffer.
- .macro getpartypokename out, slot
- .byte 0x7f
- .byte \out
- .2byte \slot
- .endm
-
- @ Writes the name of the item at index item to the specified buffer. If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead.
- .macro getitemname out, item
- .byte 0x80
- .byte \out
- .2byte \item
- .endm
-
- @ Writes the name of the decoration at index decoration to the specified buffer. In FireRed, this command is a nop.
- .macro getdecorname out, decoration
- .byte 0x81
- .byte \out
- .2byte \decoration
- .endm
-
- @ Writes the name of the move at index move to the specified buffer.
- .macro getmovename out, move
- .byte 0x82
- .byte \out
- .2byte \move
- .endm
-
- @ Converts the value of input to a decimal string, and writes that string to the specified buffer.
- .macro getnumberstring out, input
- .byte 0x83
- .byte \out
- .2byte \input
- .endm
-
- @ Writes the standard string identified by index to the specified buffer. This command has no protections in place at all, so specifying an invalid standard string (e.x. 0x2B) can and usually will cause data corruption.
- .macro getstdstring out, index
- .byte 0x84
- .byte \out
- .2byte \index
- .endm
-
- @ Copies the string at offset to the specified buffer.
- .macro getstring out, offset
- .byte 0x85
- .byte \out
- .4byte \offset
- .endm
-
- @ Opens the Pokemart system, offering the specified products for sale.
- .macro pokemart products
- .byte 0x86
- .4byte \products
- .endm
-
- @ Apparent clone of pokemart.
- .macro pokemartdecor products
- .byte 0x87
- .4byte \products
- .endm
-
- @ Apparent clone of pokemart.
- .macro pokemartbp products
- .byte 0x88
- .4byte \products
- .endm
-
- @ Starts up the slot machine minigame.
- .macro playslotmachine word
- .byte 0x89
- .2byte \word
- .endm
-
- @ In FireRed, this command is a nop.
- .macro plantberrytree
- .byte 0x8a
- .endm
-
- @ In FireRed, this command sets the byte at 0x03000EA8 to 0x01. I do not know what that means.
- .macro choosecontestpkmn
- .byte 0x8b
- .endm
-
- @ In FireRed, this command is a nop.
- .macro startcontest
- .byte 0x8c
- .endm
-
- @ In FireRed, this command is a nop.
- .macro showcontestresults
- .byte 0x8d
- .endm
-
- @ In FireRed, this command is a nop.
- .macro contestlinktransfer
- .byte 0x8e
- .endm
-
- @ Stores a random integer between 0 and limit in variable 0x800D (LASTRESULT).
- .macro random limit
- .byte 0x8f
- .2byte \limit
- .endm
-
- @ If check is 0x00, this command adds value to the player's money.
- .macro givemoney value, check
- .byte 0x90
- .4byte \value
- .byte \check
- .endm
-
- @ If check is 0x00, this command subtracts value from the player's money.
- .macro takemoney value, check
- .byte 0x91
- .4byte \value
- .byte \check
- .endm
-
- @ If check is 0x00, this command will check if the player has value or more money; script variable 0x800D (LASTRESULT) is set to 0x0001 if the player has enough money, or 0x0000 if the do not.
- .macro checkmoney value, check
- .byte 0x92
- .4byte \value
- .byte \check
- .endm
-
- @ Spawns a secondary box showing how much money the player has.
- .macro showmoneybox x, y, check
- .byte 0x93
- .byte \x
- .byte \y
- .byte \check
- .endm
-
- @ Hides the secondary box spawned by showmoney.
- .macro hidemoneybox
- .byte 0x94
- .endm
-
- @ Updates the secondary box spawned by showmoney. Consumes but does not use arguments.
- .macro updatemoneybox x, y, check
- .byte 0x95
- .byte \x
- .byte \y
- .byte \check
- .endm
-
- @ In FireRed, this command is a nop.
- .macro getpricereduction
- .byte 0x96
- .endm
-
- @ Fades the screen to black or back, using the specified effect. Effect 0x00 fades in, and effect 0x01 fades out. I don't know if other effects exist.
- .macro fadescreen effect
- .byte 0x97
- .byte \effect
- .endm
-
- @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. Other modes may exist.
- .macro fadescreenspeed effect, speed
- .byte 0x98
- .byte \effect
- .byte \speed
- .endm
-
- .macro setflashradius word
- .byte 0x99
- .2byte \word
- .endm
-
- .macro animateflash byte
- .byte 0x9a
- .byte \byte
- .endm
-
- .macro messageautoscroll pointer
- .byte 0x9b
- .4byte \pointer
- .endm
-
- @ Executes the specified field move animation.
- .macro dofieldeffect animation
- .byte 0x9c
- .2byte \animation
- .endm
-
- @ Sets up the field effect argument argument with the value value.
- .macro setfieldeffectarg argument, param
- .byte 0x9d
- .byte \argument
- .2byte \param
- .endm
-
- @ Blocks script execution until all playing field move animations complete.
- .macro waitfieldeffect animation
- .byte 0x9e
- .2byte \animation
- .endm
-
- @ Sets which healing place the player will return to if all of the Pokemon in their party faint.
- .macro setrespawn flightspot
- .byte 0x9f
- .2byte \flightspot
- .endm
-
- @ Checks the player's gender. If male, then 0x0000 is stored in variable 0x800D (LASTRESULT). If female, then 0x0001 is stored in LASTRESULT.
- .macro checkplayergender
- .byte 0xa0
- .endm
-
- @ Plays the specified (species) Pokemon's cry. You can use waitcry to block script execution until the sound finishes.
- .macro playmoncry species, effect
- .byte 0xa1
- .2byte \species
- .2byte \effect
- .endm
-
- @ Changes the metatile at (x, y) on the current map.
- .macro setmetatile x, y, metatile_number, tile_attrib
- .byte 0xa2
- .2byte \x
- .2byte \y
- .2byte \metatile_number
- .2byte \tile_attrib
- .endm
-
- @ Queues a weather change to the default weather for the map.
- .macro resetweather
- .byte 0xa3
- .endm
-
- @ Queues a weather change to type weather.
- .macro setweather type
- .byte 0xa4
- .2byte \type
- .endm
-
- @ Executes the weather change queued with resetweather or setweather. The current weather will smoothly fade into the queued weather.
- .macro doweather
- .byte 0xa5
- .endm
-
- @ This command manages cases in which maps have tiles that change state when stepped on (specifically, cracked/breakable floors).
- .macro setstepcallback subroutine
- .byte 0xa6
- .byte \subroutine
- .endm
-
- .macro setmaplayoutindex index
- .byte 0xa7
- .2byte \index
- .endm
-
- .macro setobjectpriority index, map, priority
- .byte 0xa8
- .2byte \index
- map \map
- .byte \priority
- .endm
-
- .macro resetobjectpriority index, map
- .byte 0xa9
- .2byte \index
- map \map
- .endm
-
- .macro createvobject sprite, byte2, x, y, elevation, direction
- .byte 0xaa
- .byte \sprite
- .byte \byte2
- .2byte \x
- .2byte \y
- .byte \elevation
- .byte \direction
- .endm
-
- .macro turnvobject index, direction
- .byte 0xab
- .byte \index
- .byte \direction
- .endm
-
- @ Opens the door metatile at (X, Y) with an animation.
- .macro opendoor x, y
- .byte 0xac
- .2byte \x
- .2byte \y
- .endm
-
- @ Closes the door metatile at (X, Y) with an animation.
- .macro closedoor x, y
- .byte 0xad
- .2byte \x
- .2byte \y
- .endm
-
- @ Waits for the door animation started with opendoor or closedoor to finish.
- .macro waitdooranim
- .byte 0xae
- .endm
-
- @ Sets the door tile at (x, y) to be open without an animation.
- .macro setdooropen x, y
- .byte 0xaf
- .2byte \x
- .2byte \y
- .endm
-
- @ Sets the door tile at (x, y) to be closed without an animation.
- .macro setdoorclosed2 x, y
- .byte 0xb0
- .2byte \x
- .2byte \y
- .endm
-
- @ In Emerald, this command consumes its parameters and does nothing. In FireRed, this command is a nop.
- .macro addelevmenuitem a, b, c, d
- .byte 0xb1
- .byte \a
- .2byte \b
- .2byte \c
- .2byte \d
- .endm
-
- @ In FireRed and Emerald, this command is a nop.
- .macro showelevmenu
- .byte 0xb2
- .endm
-
- .macro checkcoins out
- .byte 0xb3
- .2byte \out
- .endm
-
- .macro givecoins count
- .byte 0xb4
- .2byte \count
- .endm
-
- .macro takecoins word
- .byte 0xb5
- .2byte \word
- .endm
-
- @ Prepares to start a wild battle against a species at Level level holding item. Running this command will not affect normal wild battles. You start the prepared battle with dowildbattle.
- .macro setwildbattle species, level, item
- .byte 0xb6
- .2byte \species
- .byte \level
- .2byte \item
- .endm
-
- @ Starts a wild battle against the Pokemon generated by setwildbattle. Blocks script execution until the battle finishes.
- .macro dowildbattle
- .byte 0xb7
- .endm
-
- .macro setvaddress long, word
- .byte 0xb8
- .4byte \long
- .2byte \word
- .endm
-
- .macro vgoto pointer
- .byte 0xb9
- .4byte \pointer
- .endm
-
- .macro vcall pointer
- .byte 0xba
- .4byte \pointer
- .endm
-
- .macro vgoto_if byte, pointer
- .byte 0xbb
- .byte \byte
- .4byte \pointer
- .endm
-
- .macro vcall_if byte, pointer
- .byte 0xbc
- .byte \byte
- .4byte \pointer
- .endm
-
- .macro vmessage pointer
- .byte 0xbd
- .4byte \pointer
- .endm
-
- .macro vloadptr pointer
- .byte 0xbe
- .4byte \pointer
- .endm
-
- .macro vbufferstring byte, pointer
- .byte 0xbf
- .byte \byte
- .4byte \pointer
- .endm
-
- @ Spawns a secondary box showing how many Coins the player has.
- .macro showcoinsbox x, y
- .byte 0xc0
- .byte \x
- .byte \y
- .endm
-
- @ Hides the secondary box spawned by showcoins. It consumes its arguments but doesn't use them.
- .macro hidecoinsbox x, y
- .byte 0xc1
- .byte \x
- .byte \y
- .endm
-
- @ Updates the secondary box spawned by showcoins. It consumes its arguments but doesn't use them.
- .macro updatecoinsbox x, y
- .byte 0xc2
- .byte \x
- .byte \y
- .endm
-
- @ Increases the value of the specified game stat by 1. The stat's value will not be allowed to exceed 0x00FFFFFF.
- .macro incrementgamestat stat
- .byte 0xc3
- .byte \stat
- .endm
-
- @ Sets the destination that using an Escape Rope or Dig will take the player to.
- .macro setescapewarp map, warp, x, y
- .byte 0xc4
- map \map
- .byte \warp
- .2byte \x
- .2byte \y
- .endm
-
- @ Blocks script execution until cry finishes.
- .macro waitmoncry
- .byte 0xc5
- .endm
-
- @ Writes the name of the specified (box) PC box to the specified buffer.
- .macro bufferboxname out, box
- .byte 0xc6
- .byte \out
- .2byte \box
- .endm
-
- @ Sets the color of the text in standard message boxes. 0x00 produces blue (male) text, 0x01 produces red (female) text, 0xFF resets the color to the default for the current OW's gender, and all other values produce black text.
- .macro textcolor color
- .byte 0xc7
- .byte \color
- .endm
-
- @ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom of the screen when the Main Menu is opened.
- .macro loadhelp pointer
- .byte 0xc8
- .4byte \pointer
- .endm
-
- @ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom of the screen when the Main Menu is opened.
- .macro unloadhelp
- .byte 0xc9
- .endm
-
- @ After using this command, all standard message boxes will use the signpost frame.
- .macro signmsg
- .byte 0xca
- .endm
-
- @ Ends the effects of signmsg, returning message box frames to normal.
- .macro normalmsg
- .byte 0xcb
- .endm
-
- @ Compares the value of a hidden variable to a dword.
- .macro comparehiddenvar a, value
- .byte 0xcc
- .byte \a
- .4byte \value
- .endm
-
- @ Makes the Pokemon in the specified slot of the player's party obedient. It will not randomly disobey orders in battle.
- .macro setmonobedient slot
- .byte 0xcd
- .2byte \slot
- .endm
-
- @ Checks if the Pokemon in the specified slot of the player's party is obedient. If the Pokemon is disobedient, 0x0001 is written to script variable 0x800D (LASTRESULT). If the Pokemon is obedient (or if the specified slot is empty or invalid), 0x0000 is written.
- .macro checkmonobedience slot
- .byte 0xce
- .2byte \slot
- .endm
-
- @ Depending on factors I haven't managed to understand yet, this command may cause script execution to jump to the offset specified by the pointer at 0x020375C0.
- .macro execram
- .byte 0xcf
- .endm
-
- @ Sets worldmapflag to 1. This allows the player to Fly to the corresponding map, if that map has a flightspot.
- .macro setworldmapflag worldmapflag
- .byte 0xd0
- .2byte \worldmapflag
- .endm
-
- @ Clone of warpteleport? It is apparently only used in FR/LG, and only with specials.[source]
- .macro warpteleport2 map, warp, x, y
- .byte 0xd1
- map \map
- .byte \warp
- .2byte \x
- .2byte \y
- .endm
-
- @ Changes the location where the player caught the Pokemon in the specified slot of their party.
- .macro setmonmetlocation slot, location
- .byte 0xd2
- .2byte \slot
- .byte \location
- .endm
-
- .macro getbraillestringwidth pointer
- .byte 0xd3
- .4byte \pointer
- .endm
-
- .macro bufferitemnameplural out, item, quantity
- .byte 0xd4
- .byte \out
- .2byte \item
- .2byte \quantity
- .endm
-
-
-@ Supplementary
-
- .macro goto_if_eq dest
- goto_if 1, \dest
- .endm
-
- .macro switch var
- copyvar 0x8000, \var
- .endm
-
- .macro case condition, dest
- compare_var_to_value 0x8000, \condition
- goto_if_eq \dest
- .endm
-
- .macro msgbox text, type=4
- loadword 0, \text
- callstd \type
- .endm
-
- @ Message box types
- MSGBOX_YESNO = 5
-
- YES = 1
- NO = 0
-
- .macro giveitem item, amount=1, function=0
- setorcopyvar 0x8000, \item
- setorcopyvar 0x8001, \amount
- callstd \function
- .endm
diff --git a/berry_fix/payload/asm/macros/field_effect_script.inc b/berry_fix/payload/asm/macros/field_effect_script.inc
deleted file mode 100644
index d5895b0ef..000000000
--- a/berry_fix/payload/asm/macros/field_effect_script.inc
+++ /dev/null
@@ -1,42 +0,0 @@
- .macro loadtiles address
- .byte 0
- .4byte \address
- .endm
-
- .macro loadfadedpal address
- .byte 1
- .4byte \address
- .endm
-
- .macro loadpal address
- .byte 2
- .4byte \address
- .endm
-
- .macro callnative address
- .byte 3
- .4byte \address
- .endm
-
- .macro end
- .byte 4
- .endm
-
- .macro loadgfx_callnative tiles_address, palette_address, function_address
- .byte 5
- .4byte \tiles_address
- .4byte \palette_address
- .4byte \function_address
- .endm
-
- .macro loadtiles_callnative tiles_address, function_address
- .byte 6
- .4byte \tiles_address
- .4byte \function_address
- .endm
-
- .macro loadfadedpal_callnative palette_address, function_address
- .byte 7
- .4byte \palette_address
- .4byte \function_address
- .endm
diff --git a/berry_fix/payload/asm/macros/m4a.inc b/berry_fix/payload/asm/macros/m4a.inc
deleted file mode 100644
index 6c5abc09b..000000000
--- a/berry_fix/payload/asm/macros/m4a.inc
+++ /dev/null
@@ -1,13 +0,0 @@
- .macro song label, music_player, unknown
- .4byte \label
- .2byte \music_player
- .2byte \unknown
- .endm
-
- .macro music_player info_struct, track_struct, unknown_1, unknown_2
- .4byte \info_struct
- .4byte \track_struct
- .byte \unknown_1
- .space 1
- .2byte \unknown_2
- .endm
diff --git a/berry_fix/payload/asm/macros/map.inc b/berry_fix/payload/asm/macros/map.inc
deleted file mode 100644
index 9c68e8414..000000000
--- a/berry_fix/payload/asm/macros/map.inc
+++ /dev/null
@@ -1,84 +0,0 @@
- .macro map map_id
- .byte \map_id >> 8 @ map group
- .byte \map_id & 0xFF @ map num
- .endm
-
- .macro map_script type, address
- .byte \type
- .4byte \address
- .endm
-
- .macro map_script_2 word1, word2, address
- .2byte \word1
- .2byte \word2
- .4byte \address
- .endm
-
- .macro object_event byte1, word1, byte2, byte3, byte4, byte5, byte6, byte7, byte8, byte9, byte10, byte11, byte12, byte13, byte14, script, word2, byte15, byte16
- .byte \byte1
- .2byte \word1
- .byte \byte2, \byte3, \byte4, \byte5, \byte6, \byte7, \byte8, \byte9, \byte10, \byte11, \byte12, \byte13, \byte14
- .4byte \script
- .2byte \word2
- .byte \byte15, \byte16
- inc _num_npcs
- .endm
-
- .macro warp_def x, y, byte, warp, map_id
- .2byte \x, \y
- .byte \byte, \warp
- .byte \map_id & 0xFF @ map num
- .byte \map_id >> 8 @ map group
- inc _num_warps
- .endm
-
- .macro coord_event x, y, byte1, byte2, word1, word2, word3, script
- .2byte \x, \y
- .byte \byte1, \byte2
- .2byte \word1, \word2, \word3
- .4byte \script
- inc _num_traps
- .endm
-
- .macro bg_event x, y, byte, kind, word, arg6, arg7, arg8
- .2byte \x, \y
- .byte \byte, \kind
- .2byte \word
- .if \kind < 5
- .4byte \arg6
- .else
- .2byte \arg6
- .byte \arg7, \arg8
- .endif
- inc _num_signs
- .endm
-
- .macro map_events npcs, warps, traps, signs
- .byte _num_npcs, _num_warps, _num_traps, _num_signs
- .4byte \npcs, \warps, \traps, \signs
- reset_map_events
- .endm
-
- .macro reset_map_events
- .set _num_npcs, 0
- .set _num_warps, 0
- .set _num_traps, 0
- .set _num_signs, 0
- .endm
-
- reset_map_events
-
-
- .equiv connection_down, 1
- .equiv connection_up, 2
- .equiv connection_left, 3
- .equiv connection_right, 4
- .equiv connection_dive, 5
- .equiv connection_emerge, 6
-
- .macro connection direction, offset, map, filler
- .4byte connection_\direction
- .4byte \offset
- map \map
- .space 2
- .endm
diff --git a/berry_fix/payload/asm/macros/movement.inc b/berry_fix/payload/asm/macros/movement.inc
deleted file mode 100644
index 909b24916..000000000
--- a/berry_fix/payload/asm/macros/movement.inc
+++ /dev/null
@@ -1,120 +0,0 @@
- .macro create_movement name
- enum _\name
- .macro \name
- .byte _\name
- .endm
- .endm
-
- enum_start
- create_movement step_00
- create_movement step_01
- create_movement step_02
- create_movement step_03
- create_movement slow_step_down
- create_movement slow_step_up
- create_movement slow_step_left
- create_movement slow_step_right
- create_movement step_down
- create_movement step_up
- create_movement step_left
- create_movement step_right
- create_movement fast_step_down
- create_movement fast_step_up
- create_movement fast_step_left
- create_movement fast_step_right
- create_movement step_10
- create_movement step_11
- create_movement step_12
- create_movement step_13
- create_movement step_14
- create_movement step_15
- create_movement step_16
- create_movement step_17
- create_movement step_18
- create_movement step_19
- create_movement step_1a
- create_movement step_1b
- create_movement step_1c
- create_movement step_1d
- create_movement step_1e
- create_movement step_1f
- create_movement step_20
- create_movement step_21
- create_movement step_22
- create_movement step_23
- create_movement step_24
- create_movement step_25
- create_movement step_26
- create_movement step_27
- create_movement step_28
- create_movement step_29
- create_movement step_2a
- create_movement step_2b
- create_movement step_2c
- create_movement step_2d
- create_movement step_2e
- create_movement step_2f
- create_movement step_30
- create_movement step_31
- create_movement step_32
- create_movement step_33
- create_movement step_34
- create_movement step_35
- create_movement step_36
- create_movement step_37
- create_movement step_38
- create_movement step_39
- create_movement step_3a
- create_movement step_3b
- create_movement step_3c
- create_movement step_3d
- create_movement step_3e
- create_movement step_3f
- create_movement step_40
- create_movement step_41
- create_movement step_42
- create_movement step_43
- create_movement step_44
- create_movement step_45
- create_movement step_46
- create_movement step_47
- create_movement step_48
- create_movement step_49
- create_movement step_4a
- create_movement step_4b
- create_movement step_4c
- create_movement step_4d
- create_movement step_4e
- create_movement step_4f
- create_movement step_50
- create_movement step_51
- create_movement step_52
- create_movement step_53
- create_movement step_54
- create_movement step_55
- create_movement step_56
- create_movement step_57
- create_movement step_58
- create_movement step_59
- create_movement step_5a
- create_movement step_5b
- create_movement step_5c
- create_movement step_5d
- create_movement step_5e
- create_movement step_5f
- create_movement step_60
- create_movement step_61
- create_movement step_62
- create_movement step_63
- create_movement step_64
- create_movement step_65
-
- enum_start 0x91
- create_movement step_91
- create_movement step_92
-
- enum_start 0x96
- create_movement step_96
-
- enum_start 0xfe
- create_movement step_end
diff --git a/berry_fix/payload/asm/macros/music_voice.inc b/berry_fix/payload/asm/macros/music_voice.inc
deleted file mode 100644
index b7a9e7f8d..000000000
--- a/berry_fix/payload/asm/macros/music_voice.inc
+++ /dev/null
@@ -1,125 +0,0 @@
- .macro voice_directsound base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
- .byte 0
- _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
- .endm
-
- .macro voice_directsound_no_resample base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
- .byte 8
- _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
- .endm
-
- .macro voice_directsound_alt base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
- .byte 16
- _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
- .endm
-
- .macro _voice_directsound base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
- .byte \base_midi_key
- .byte 0
- .if \pan != 0
- .byte (0x80 | \pan)
- .else
- .byte 0
- .endif
- .4byte \sample_data_pointer
- .byte \attack
- .byte \decay
- .byte \sustain
- .byte \release
- .endm
-
- .macro voice_square_1 sweep, duty_cycle, attack, decay, sustain, release
- _voice_square_1 1, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
- .endm
-
- .macro voice_square_1_alt sweep, duty_cycle, attack, decay, sustain, release
- _voice_square_1 9, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
- .endm
-
- .macro _voice_square_1 type, sweep, duty_cycle, attack, decay, sustain, release
- .byte \type, 60, 0
- .byte \sweep
- .byte (\duty_cycle & 0x3)
- .byte 0, 0, 0
- .byte (\attack & 0x7)
- .byte (\decay & 0x7)
- .byte (\sustain & 0xF)
- .byte (\release & 0x7)
- .endm
-
- .macro voice_square_2 duty_cycle, attack, decay, sustain, release
- _voice_square_2 2, \duty_cycle, \attack, \decay, \sustain, \release
- .endm
-
- .macro voice_square_2_alt duty_cycle, attack, decay, sustain, release
- _voice_square_2 10, \duty_cycle, \attack, \decay, \sustain, \release
- .endm
-
- .macro _voice_square_2 type, duty_cycle, attack, decay, sustain, release
- .byte \type, 60, 0, 0
- .byte (\duty_cycle & 0x3)
- .byte 0, 0, 0
- .byte (\attack & 0x7)
- .byte (\decay & 0x7)
- .byte (\sustain & 0xF)
- .byte (\release & 0x7)
- .endm
-
- .macro voice_programmable_wave wave_samples_pointer, attack, decay, sustain, release
- _voice_programmable_wave 3, \wave_samples_pointer, \attack, \decay, \sustain, \release
- .endm
-
- .macro voice_programmable_wave_alt wave_samples_pointer, attack, decay, sustain, release
- _voice_programmable_wave 11, \wave_samples_pointer, \attack, \decay, \sustain, \release
- .endm
-
- .macro _voice_programmable_wave type, wave_samples_pointer, attack, decay, sustain, release
- .byte \type, 60, 0, 0
- .4byte \wave_samples_pointer
- .byte (\attack & 0x7)
- .byte (\decay & 0x7)
- .byte (\sustain & 0xF)
- .byte (\release & 0x7)
- .endm
-
- .macro voice_noise period, attack, decay, sustain, release
- _voice_noise 4, \period, \attack, \decay, \sustain, \release
- .endm
-
- .macro voice_noise_alt period, attack, decay, sustain, release
- _voice_noise 12, \period, \attack, \decay, \sustain, \release
- .endm
-
- .macro _voice_noise type, period, attack, decay, sustain, release
- .byte \type, 60, 0, 0
- .byte (\period & 0x1)
- .byte 0, 0, 0
- .byte (\attack & 0x7)
- .byte (\decay & 0x7)
- .byte (\sustain & 0xF)
- .byte (\release & 0x7)
- .endm
-
- .macro voice_keysplit voice_group_pointer, keysplit_table_pointer
- .byte 0x40, 0, 0, 0
- .4byte \voice_group_pointer
- .4byte \keysplit_table_pointer
- .endm
-
- .macro voice_keysplit_all voice_group_pointer
- .byte 0x80, 0, 0, 0
- .4byte \voice_group_pointer
- .4byte 0
- .endm
-
- .macro cry sample
- .byte 0x20, 60, 0, 0
- .4byte \sample
- .byte 0xff, 0, 0xff, 0
- .endm
-
- .macro cry2 sample
- .byte 0x30, 60, 0, 0
- .4byte \sample
- .byte 0xff, 0, 0xff, 0
- .endm
diff --git a/berry_fix/payload/asm/macros/pokemon_data.inc b/berry_fix/payload/asm/macros/pokemon_data.inc
deleted file mode 100644
index b0a5f22e3..000000000
--- a/berry_fix/payload/asm/macros/pokemon_data.inc
+++ /dev/null
@@ -1,57 +0,0 @@
- .macro pokedex_entry pokemon_name, height, weight, pokemon_scale, pokemon_offset, trainer_scale, trainer_offset
- .2byte \height @ in decimeters
- .2byte \weight @ in hectograms
- .4byte DexDescription_\pokemon_name\()_1
- .4byte DexDescription_\pokemon_name\()_2
- .2byte 0 @ unused
- .2byte \pokemon_scale
- .2byte \pokemon_offset
- .2byte \trainer_scale
- .2byte \trainer_offset
- .2byte 0 @ padding
- .endm
-
- .macro base_stats hp, attack, defense, speed, sp_attack, sp_defense
- .byte \hp
- .byte \attack
- .byte \defense
- .byte \speed
- .byte \sp_attack
- .byte \sp_defense
- .endm
-
- .macro ev_yield hp, attack, defense, speed, sp_attack, sp_defense
- .2byte (\sp_defense << 10) | (\sp_attack << 8) | (\speed << 6) | (\defense << 4) | (\attack << 2) | \hp
- .endm
-
- .macro level_up_move level, move
- .2byte (\level << 9) | \move
- .endm
-
- .macro evo_entry method, parameter, target_species
- .2byte \method
- .2byte \parameter
- .2byte \target_species
- .2byte 0 @ padding
- .endm
-
- .macro empty_evo_entries count
- .fill 8 * \count, 1, 0
- .endm
-
- .macro egg_moves_begin species
- .2byte 20000 + \species
- .endm
-
-@ If the min level equals the max level, only one level argument is needed.
- .macro wild_mon species, min_level, max_level
- .byte \min_level
-
- .ifb \max_level
- .byte \min_level
- .else
- .byte \max_level
- .endif
-
- .2byte SPECIES_\species
- .endm
diff --git a/include/libgcnmultiboot.h b/include/libgcnmultiboot.h
index 7d347df05..4a6262d8f 100644
--- a/include/libgcnmultiboot.h
+++ b/include/libgcnmultiboot.h
@@ -1,4 +1,4 @@
-#ifndef GUARD_LIBGCMMULTIBOOT_H
+#ifndef GUARD_LIBGCNMULTIBOOT_H
#define GUARD_LIBGCNMULTIBOOT_H
struct GcmbStruct
diff --git a/include/menu.h b/include/menu.h
index 6d8de3274..6f358d34e 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -18,8 +18,8 @@ struct MenuAction
};
// menu2
-void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 x, u8 y, const struct TextColor * color, s8 speed, const u8 * str);
-void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str);
+void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 x, u8 y, const u8 * color, s8 speed, const u8 * str);
+void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str);
void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing);
void sub_812E6DC(u8 windowId, const u8 * src, u16 x, u16 y);
void StartBlendTask(u8 eva_start, u8 evb_start, u8 eva_end, u8 evb_end, u8 ev_step, u8 priority);
diff --git a/include/text.h b/include/text.h
index 07f6b29c2..0fd586ddd 100644
--- a/include/text.h
+++ b/include/text.h
@@ -193,13 +193,6 @@ typedef struct {
extern TextFlags gTextFlags;
-struct __attribute__((packed)) TextColor
-{
- u8 fgColor;
- u8 bgColor;
- u8 shadowColor;
-};
-
extern u8 gStringVar1[];
extern u8 gStringVar2[];
extern u8 gStringVar3[];
diff --git a/src/bag.c b/src/bag.c
index a63f57702..c30bc626d 100644
--- a/src/bag.c
+++ b/src/bag.c
@@ -14,7 +14,7 @@
extern const u8 gText_DepositItem[];
const u16 gUnknown_8453098[] = INCBIN_U16("data/bag/bag_window_pal.gbapal");
-const struct TextColor gUnknown_84530B8[] = {
+const u8 gUnknown_84530B8[][3] = {
{0, 1, 2},
{0, 2, 3},
{0, 3, 2},
@@ -229,13 +229,13 @@ void sub_810B858(void)
void sub_810B8F0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, s8 speed, u8 colorIdx)
{
- AddTextPrinterParameterized4(windowId, fontId, x, y, letterSpacing, lineSpacing, &gUnknown_84530B8[colorIdx], speed, str);
+ AddTextPrinterParameterized4(windowId, fontId, x, y, letterSpacing, lineSpacing, gUnknown_84530B8[colorIdx], speed, str);
}
void sub_810B958(const u8 * str)
{
u32 x = 0x48 - GetStringWidth(1, str, 0);
- AddTextPrinterParameterized3(2, 1, x / 2, 1, &gUnknown_84530B8[0], 0, str);
+ AddTextPrinterParameterized3(2, 1, x / 2, 1, gUnknown_84530B8[0], 0, str);
}
void sub_810B994(void)
diff --git a/src/battle_records.c b/src/battle_records.c
index 79f29eb8a..3c2032641 100644
--- a/src/battle_records.c
+++ b/src/battle_records.c
@@ -58,7 +58,7 @@ static const struct WindowTemplate sWindowTemplates[] = {
}, DUMMY_WIN_TEMPLATE
};
-static const struct TextColor sTextColor = {
+static const u8 sTextColor[3] = {
0, 2, 3
};
@@ -494,7 +494,7 @@ static void PrintTotalRecord(struct LinkBattleRecords * records)
}
StringExpandPlaceholders(gStringVar4, gString_BattleRecords_TotalRecord);
- AddTextPrinterParameterized4(0, 2, 12, 24, 0, 2, &sTextColor, 0, gStringVar4);
+ AddTextPrinterParameterized4(0, 2, 12, 24, 0, 2, sTextColor, 0, gStringVar4);
}
static void PrintOpponentBattleRecord(struct LinkBattleRecord * record, u8 y)
@@ -504,7 +504,7 @@ static void PrintOpponentBattleRecord(struct LinkBattleRecord * record, u8 y)
if (record->wins == 0 && record->losses == 0 && record->draws == 0)
{
- AddTextPrinterParameterized4(0, 2, 0, y, 0, 2, &sTextColor, 0, gString_BattleRecords_7Dashes);
+ AddTextPrinterParameterized4(0, 2, 0, y, 0, 2, sTextColor, 0, gString_BattleRecords_7Dashes);
for (i = 0; i < 3; i++)
{
if (i == 0)
@@ -513,7 +513,7 @@ static void PrintOpponentBattleRecord(struct LinkBattleRecord * record, u8 y)
x = 0x84;
else
x = 0xB4;
- AddTextPrinterParameterized4(0, 2, x, y, 0, 2, &sTextColor, 0, gString_BattleRecords_4Dashes);
+ AddTextPrinterParameterized4(0, 2, x, y, 0, 2, sTextColor, 0, gString_BattleRecords_4Dashes);
}
}
else
@@ -541,7 +541,7 @@ static void PrintOpponentBattleRecord(struct LinkBattleRecord * record, u8 y)
x = 0xB4;
ConvertIntToDecimalStringN(gStringVar1, record->draws, STR_CONV_MODE_RIGHT_ALIGN, 4);
}
- AddTextPrinterParameterized4(0, 2, x, y, 0, 2, &sTextColor, 0, gStringVar1);
+ AddTextPrinterParameterized4(0, 2, x, y, 0, 2, sTextColor, 0, gStringVar1);
}
}
}
@@ -554,9 +554,9 @@ static void PrintBattleRecords(void)
FillWindowPixelRect(0, PIXEL_FILL(0), 0, 0, 0xD8, 0x90);
StringExpandPlaceholders(gStringVar4, gString_BattleRecords_PlayersBattleResults);
left = 0xD0 - GetStringWidth(2, gStringVar4, -1);
- AddTextPrinterParameterized4(0, 2, left / 2, 4, 0, 2, &sTextColor, 0, gStringVar4);
+ AddTextPrinterParameterized4(0, 2, left / 2, 4, 0, 2, sTextColor, 0, gStringVar4);
PrintTotalRecord(&gSaveBlock2Ptr->linkBattleRecords);
- AddTextPrinterParameterized4(0, 2, 0x54, 0x30, 0, 2, &sTextColor, 0, gString_BattleRecords_ColumnHeaders);
+ AddTextPrinterParameterized4(0, 2, 0x54, 0x30, 0, 2, sTextColor, 0, gString_BattleRecords_ColumnHeaders);
for (i = 0; i < LINK_B_RECORDS_COUNT; i++)
PrintOpponentBattleRecord(&gSaveBlock2Ptr->linkBattleRecords.entries[i], 0x3D + 14 * i);
CommitWindow(0);
diff --git a/src/buy_menu_helpers.c b/src/buy_menu_helpers.c
index 4cdf90e4e..cf8072977 100644
--- a/src/buy_menu_helpers.c
+++ b/src/buy_menu_helpers.c
@@ -148,23 +148,11 @@ static const struct WindowTemplate sShopBuyMenuYesNoWindowTemplate =
.baseBlock = 0xC1,
};
-static const struct TextColor sShopBuyMenuTextColors[] =
+static const u8 sShopBuyMenuTextColors[][3] =
{
- {
- .fgColor = 0,
- .bgColor = 1,
- .shadowColor = 2,
- },
- {
- .fgColor = 0,
- .bgColor = 2,
- .shadowColor = 3,
- },
- {
- .fgColor = 0,
- .bgColor = 3,
- .shadowColor = 2,
- },
+ {0, 1, 2},
+ {0, 2, 3},
+ {0, 3, 2}
};
void BuyMenuInitWindows(bool32 isSellingTM)
@@ -191,7 +179,7 @@ void BuyMenuDrawMoneyBox(void)
void BuyMenuPrint(u8 windowId, u8 font, const u8 *text, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, s8 speed, u8 color)
{
- AddTextPrinterParameterized4(windowId, font, x, y, letterSpacing, lineSpacing, &sShopBuyMenuTextColors[color], speed, text);
+ AddTextPrinterParameterized4(windowId, font, x, y, letterSpacing, lineSpacing, sShopBuyMenuTextColors[color], speed, text);
}
void BuyMenuDisplayMessage(u8 taskId, const u8 *text, TaskFunc callback)
diff --git a/src/daycare.c b/src/daycare.c
index abc3b23ca..c082b4298 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -63,7 +63,7 @@ struct EggHatchData
u8 unused_9;
u8 unused_A;
u16 species;
- struct TextColor textColor;
+ u8 textColor[3];
};
extern const u8 gText_MaleSymbol4[];
@@ -168,215 +168,215 @@ static const u8 sEggHatchTiles[] = INCBIN_U8("graphics/misc/egg_hatch.4bpp");
static const u8 sEggShardTiles[] = INCBIN_U8("graphics/misc/egg_shard.4bpp");
static const struct OamData sOamData_EggHatch =
- {
- .y = 0,
- .affineMode = 0,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
- .shape = SPRITE_SHAPE(32x32),
- .x = 0,
- .matrixNum = 0,
- .size = SPRITE_SIZE(32x32),
- .tileNum = 0,
- .priority = 1,
- .paletteNum = 0,
- .affineParam = 0,
- };
+{
+ .y = 0,
+ .affineMode = 0,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = SPRITE_SHAPE(32x32),
+ .x = 0,
+ .matrixNum = 0,
+ .size = SPRITE_SIZE(32x32),
+ .tileNum = 0,
+ .priority = 1,
+ .paletteNum = 0,
+ .affineParam = 0,
+};
static const union AnimCmd sSpriteAnim_EggHatch0[] =
- {
- ANIMCMD_FRAME(0, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(0, 5),
+ ANIMCMD_END
+};
static const union AnimCmd sSpriteAnim_EggHatch1[] =
- {
- ANIMCMD_FRAME(16, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(16, 5),
+ ANIMCMD_END
+};
static const union AnimCmd sSpriteAnim_EggHatch2[] =
- {
- ANIMCMD_FRAME(32, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(32, 5),
+ ANIMCMD_END
+};
static const union AnimCmd sSpriteAnim_EggHatch3[] =
- {
- ANIMCMD_FRAME(48, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(48, 5),
+ ANIMCMD_END
+};
static const union AnimCmd *const sSpriteAnimTable_EggHatch[] =
- {
- sSpriteAnim_EggHatch0,
- sSpriteAnim_EggHatch1,
- sSpriteAnim_EggHatch2,
- sSpriteAnim_EggHatch3,
- };
+{
+ sSpriteAnim_EggHatch0,
+ sSpriteAnim_EggHatch1,
+ sSpriteAnim_EggHatch2,
+ sSpriteAnim_EggHatch3,
+};
static const struct SpriteSheet sEggHatch_Sheet =
- {
- .data = sEggHatchTiles,
- .size = 2048,
- .tag = 12345,
- };
+{
+ .data = sEggHatchTiles,
+ .size = 2048,
+ .tag = 12345,
+};
static const struct SpriteSheet sEggShards_Sheet =
- {
- .data = sEggShardTiles,
- .size = 128,
- .tag = 23456,
- };
+{
+ .data = sEggShardTiles,
+ .size = 128,
+ .tag = 23456,
+};
static const struct SpritePalette sEgg_SpritePalette =
- {
- .data = sEggPalette,
- .tag = 54321
- };
+{
+ .data = sEggPalette,
+ .tag = 54321
+};
static const struct SpriteTemplate sSpriteTemplate_EggHatch =
- {
- .tileTag = 12345,
- .paletteTag = 54321,
- .oam = &sOamData_EggHatch,
- .anims = sSpriteAnimTable_EggHatch,
- .images = NULL,
- .affineAnims = gDummySpriteAffineAnimTable,
- .callback = SpriteCallbackDummy
- };
+{
+ .tileTag = 12345,
+ .paletteTag = 54321,
+ .oam = &sOamData_EggHatch,
+ .anims = sSpriteAnimTable_EggHatch,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCallbackDummy
+};
static const struct OamData sOamData_EggShard =
- {
- .y = 0,
- .affineMode = 0,
- .objMode = 0,
- .mosaic = 0,
- .bpp = 0,
- .shape = SPRITE_SHAPE(8x8),
- .x = 0,
- .matrixNum = 0,
- .size = SPRITE_SIZE(8x8),
- .tileNum = 0,
- .priority = 2,
- .paletteNum = 0,
- .affineParam = 0,
- };
+{
+ .y = 0,
+ .affineMode = 0,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = SPRITE_SHAPE(8x8),
+ .x = 0,
+ .matrixNum = 0,
+ .size = SPRITE_SIZE(8x8),
+ .tileNum = 0,
+ .priority = 2,
+ .paletteNum = 0,
+ .affineParam = 0,
+};
static const union AnimCmd sSpriteAnim_EggShard0[] =
- {
- ANIMCMD_FRAME(0, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(0, 5),
+ ANIMCMD_END
+};
static const union AnimCmd sSpriteAnim_EggShard1[] =
- {
- ANIMCMD_FRAME(1, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(1, 5),
+ ANIMCMD_END
+};
static const union AnimCmd sSpriteAnim_EggShard2[] =
- {
- ANIMCMD_FRAME(2, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(2, 5),
+ ANIMCMD_END
+};
static const union AnimCmd sSpriteAnim_EggShard3[] =
- {
- ANIMCMD_FRAME(3, 5),
- ANIMCMD_END
- };
+{
+ ANIMCMD_FRAME(3, 5),
+ ANIMCMD_END
+};
static const union AnimCmd *const sSpriteAnimTable_EggShard[] =
- {
- sSpriteAnim_EggShard0,
- sSpriteAnim_EggShard1,
- sSpriteAnim_EggShard2,
- sSpriteAnim_EggShard3,
- };
+{
+ sSpriteAnim_EggShard0,
+ sSpriteAnim_EggShard1,
+ sSpriteAnim_EggShard2,
+ sSpriteAnim_EggShard3,
+};
static const struct SpriteTemplate sSpriteTemplate_EggShard =
- {
- .tileTag = 23456,
- .paletteTag = 54321,
- .oam = &sOamData_EggShard,
- .anims = sSpriteAnimTable_EggShard,
- .images = NULL,
- .affineAnims = gDummySpriteAffineAnimTable,
- .callback = SpriteCB_EggShard
- };
+{
+ .tileTag = 23456,
+ .paletteTag = 54321,
+ .oam = &sOamData_EggShard,
+ .anims = sSpriteAnimTable_EggShard,
+ .images = NULL,
+ .affineAnims = gDummySpriteAffineAnimTable,
+ .callback = SpriteCB_EggShard
+};
static const struct BgTemplate sBgTemplates_EggHatch[2] =
+{
{
- {
- .bg = 0,
- .charBaseIndex = 2,
- .mapBaseIndex = 24,
- .screenSize = 3,
- .paletteMode = 0,
- .priority = 0,
- .baseTile = 0
- },
-
- {
- .bg = 1,
- .charBaseIndex = 0,
- .mapBaseIndex = 8,
- .screenSize = 1,
- .paletteMode = 0,
- .priority = 2,
- .baseTile = 0
- },
- };
+ .bg = 0,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 24,
+ .screenSize = 3,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0
+ },
+
+ {
+ .bg = 1,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 8,
+ .screenSize = 1,
+ .paletteMode = 0,
+ .priority = 2,
+ .baseTile = 0
+ },
+};
static const struct WindowTemplate sWinTemplates_EggHatch[2] =
- {
- {
- .bg = 0,
- .tilemapLeft = 2,
- .tilemapTop = 15,
- .width = 26,
- .height = 4,
- .paletteNum = 0,
- .baseBlock = 64
- },
- DUMMY_WIN_TEMPLATE
- };
-
-static const struct WindowTemplate sYesNoWinTemplate =
+{
{
.bg = 0,
- .tilemapLeft = 21,
- .tilemapTop = 9,
- .width = 6,
+ .tilemapLeft = 2,
+ .tilemapTop = 15,
+ .width = 26,
.height = 4,
- .paletteNum = 15,
- .baseBlock = 424
- };
+ .paletteNum = 0,
+ .baseBlock = 64
+ },
+ DUMMY_WIN_TEMPLATE
+};
+
+static const struct WindowTemplate sYesNoWinTemplate =
+{
+ .bg = 0,
+ .tilemapLeft = 21,
+ .tilemapTop = 9,
+ .width = 6,
+ .height = 4,
+ .paletteNum = 15,
+ .baseBlock = 424
+};
static const s16 sEggShardVelocities[][2] =
- {
- {Q_8_8(-1.5), Q_8_8(-3.75)},
- {Q_8_8(-5), Q_8_8(-3)},
- {Q_8_8(3.5), Q_8_8(-3)},
- {Q_8_8(-4), Q_8_8(-3.75)},
- {Q_8_8(2), Q_8_8(-1.5)},
- {Q_8_8(-0.5), Q_8_8(-6.75)},
- {Q_8_8(5), Q_8_8(-2.25)},
- {Q_8_8(-1.5), Q_8_8(-3.75)},
- {Q_8_8(4.5), Q_8_8(-1.5)},
- {Q_8_8(-1), Q_8_8(-6.75)},
- {Q_8_8(4), Q_8_8(-2.25)},
- {Q_8_8(-3.5), Q_8_8(-3.75)},
- {Q_8_8(1), Q_8_8(-1.5)},
- {Q_8_8(-3.515625), Q_8_8(-6.75)},
- {Q_8_8(4.5), Q_8_8(-2.25)},
- {Q_8_8(-0.5), Q_8_8(-7.5)},
- {Q_8_8(1), Q_8_8(-4.5)},
- {Q_8_8(-2.5), Q_8_8(-2.25)},
- {Q_8_8(2.5), Q_8_8(-7.5)},
- };
+{
+ {Q_8_8(-1.5), Q_8_8(-3.75)},
+ {Q_8_8(-5), Q_8_8(-3)},
+ {Q_8_8(3.5), Q_8_8(-3)},
+ {Q_8_8(-4), Q_8_8(-3.75)},
+ {Q_8_8(2), Q_8_8(-1.5)},
+ {Q_8_8(-0.5), Q_8_8(-6.75)},
+ {Q_8_8(5), Q_8_8(-2.25)},
+ {Q_8_8(-1.5), Q_8_8(-3.75)},
+ {Q_8_8(4.5), Q_8_8(-1.5)},
+ {Q_8_8(-1), Q_8_8(-6.75)},
+ {Q_8_8(4), Q_8_8(-2.25)},
+ {Q_8_8(-3.5), Q_8_8(-3.75)},
+ {Q_8_8(1), Q_8_8(-1.5)},
+ {Q_8_8(-3.515625), Q_8_8(-6.75)},
+ {Q_8_8(4.5), Q_8_8(-2.25)},
+ {Q_8_8(-0.5), Q_8_8(-7.5)},
+ {Q_8_8(1), Q_8_8(-4.5)},
+ {Q_8_8(-2.5), Q_8_8(-2.25)},
+ {Q_8_8(2.5), Q_8_8(-7.5)},
+};
// code
@@ -2202,8 +2202,8 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8
static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed)
{
FillWindowPixelBuffer(windowId, 0xFF);
- sEggHatchData->textColor.fgColor = 0;
- sEggHatchData->textColor.bgColor = 5;
- sEggHatchData->textColor.shadowColor = 6;
- AddTextPrinterParameterized4(windowId, 3, x, y, 1, 1, &sEggHatchData->textColor, speed, string);
+ sEggHatchData->textColor[0] = 0;
+ sEggHatchData->textColor[1] = 5;
+ sEggHatchData->textColor[2] = 6;
+ AddTextPrinterParameterized4(windowId, 3, x, y, 1, 1, sEggHatchData->textColor, speed, string);
}
diff --git a/src/diploma.c b/src/diploma.c
index 7fa140430..afb22400b 100644
--- a/src/diploma.c
+++ b/src/diploma.c
@@ -52,7 +52,7 @@ static const u8 gUnknown_84159B3[] = _("{HIGHLIGHT TRANSPARENT}     
static const u8 gUnknown_84159ED[] = _("{COLOR RED}{HIGHLIGHT TRANSPARENT}ゲームフリーク");
static const u8 gUnknown_84159FB[] = _("{COLOR RED}{HIGHLIGHT TRANSPARENT}");
-static const ALIGNED(4) struct TextColor gUnknown_8415A04 = {0, 2, 3};
+static const ALIGNED(4) u8 gUnknown_8415A04[3] = {0, 2, 3};
static const struct BgTemplate gUnknown_8415A08[] = {
{
@@ -276,10 +276,10 @@ static void DiplomaPrintText(void)
FillWindowPixelBuffer(0, 0);
DynamicPlaceholderTextUtil_ExpandPlaceholders(arr, gUnknown_841B60E);
width = GetStringWidth(2, arr, -1);
- AddTextPrinterParameterized3(0, 2, 0x78 - (width / 2), 4, &gUnknown_8415A04, -1, arr);
+ AddTextPrinterParameterized3(0, 2, 0x78 - (width / 2), 4, gUnknown_8415A04, -1, arr);
DynamicPlaceholderTextUtil_ExpandPlaceholders(arr, gUnknown_841B619);
width = GetStringWidth(2, arr, -1);
- AddTextPrinterParameterized3(0, 0x2, 0x78 - (width / 2), 0x1E, &gUnknown_8415A04, -1, arr);
- AddTextPrinterParameterized3(0, 0x2, 0x78, 0x69, &gUnknown_8415A04, 0, gUnknown_841B684);
+ AddTextPrinterParameterized3(0, 0x2, 0x78 - (width / 2), 0x1E, gUnknown_8415A04, -1, arr);
+ AddTextPrinterParameterized3(0, 0x2, 0x78, 0x69, gUnknown_8415A04, 0, gUnknown_841B684);
PutWindowTilemap(0);
}
diff --git a/src/fame_checker.c b/src/fame_checker.c
index aa1684981..31bd11b55 100644
--- a/src/fame_checker.c
+++ b/src/fame_checker.c
@@ -152,9 +152,9 @@ static const u16 sOakSpritePalette[] = INCBIN_U16("data/fame_checker/pal_845f580
static const u16 gUnknown_845F5A0[] = INCBIN_U16("data/fame_checker/pal_845f5a0.gbapal"); // unused?
static const u16 sSilhouettePalette[] = INCBIN_U16("data/fame_checker/pal_845f5c0.gbapal");
-static const struct TextColor sTextColor_White = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY};
-static const struct TextColor sTextColor_DkGrey = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, 0x03};
-static const struct TextColor sTextColor_Green = {TEXT_COLOR_TRANSPARENT, 0x06, 0x07};
+static const u8 sTextColor_White[3] = {0, 1, 2};
+static const u8 sTextColor_DkGrey[3] = {0, 2, 3};
+static const u8 sTextColor_Green[3] = {0, 6, 7};
static const u16 sTrainerIdxs[] = {
FC_NONTRAINER_START + 0, // OAK
@@ -900,7 +900,7 @@ static void PrintUIHelp(u8 state)
}
width = GetStringWidth(0, src, 0);
FillWindowPixelRect(FCWINDOWID_UIHELP, 0x00, 0, 0, 0xc0, 0x10);
- AddTextPrinterParameterized4(FCWINDOWID_UIHELP, 0, 188 - width, 0, 0, 2, &sTextColor_White, -1, src);
+ AddTextPrinterParameterized4(FCWINDOWID_UIHELP, 0, 188 - width, 0, 0, 2, sTextColor_White, -1, src);
FC_PutWindowTilemapAndCopyWindowToVramMode3(FCWINDOWID_UIHELP);
}
@@ -1213,10 +1213,10 @@ static void UpdateIconDescriptionBox(u8 whichText)
gIconDescriptionBoxIsOpen = 1;
FillWindowPixelRect(FCWINDOWID_ICONDESC, 0x00, 0, 0, 0x58, 0x20);
width = (0x54 - GetStringWidth(0, sFlavorTextOriginLocationTexts[idx], 0)) / 2;
- AddTextPrinterParameterized4(FCWINDOWID_ICONDESC, 0, width, 0, 0, 2, &sTextColor_DkGrey, -1, sFlavorTextOriginLocationTexts[idx]);
+ AddTextPrinterParameterized4(FCWINDOWID_ICONDESC, 0, width, 0, 0, 2, sTextColor_DkGrey, -1, sFlavorTextOriginLocationTexts[idx]);
StringExpandPlaceholders(gStringVar1, sFlavorTextOriginObjectNameTexts[idx]);
width = (0x54 - GetStringWidth(0, gStringVar1, 0)) / 2;
- AddTextPrinterParameterized4(FCWINDOWID_ICONDESC, 0, width, 10, 0, 2, &sTextColor_DkGrey, -1, gStringVar1);
+ AddTextPrinterParameterized4(FCWINDOWID_ICONDESC, 0, width, 10, 0, 2, sTextColor_DkGrey, -1, gStringVar1);
FC_PutWindowTilemapAndCopyWindowToVramMode3(FCWINDOWID_ICONDESC);
}
@@ -1341,14 +1341,14 @@ static void FC_DoMoveCursor(s32 itemIndex, bool8 onInit)
u16 who;
ListMenuGetScrollAndRow(sFameCheckerData->listMenuTaskId, &listY, &cursorY);
who = listY + cursorY;
- AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 8, 14 * cursorY + 4, 0, 0, &sTextColor_Green, 0, sListMenuItems[itemIndex].label);
+ AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 8, 14 * cursorY + 4, 0, 0, sTextColor_Green, 0, sListMenuItems[itemIndex].label);
if (!onInit)
{
if (listY < sFameCheckerData->listMenuTopIdx2)
sFameCheckerData->listMenuDrawnSelIdx++;
else if (listY > sFameCheckerData->listMenuTopIdx2 && who != sFameCheckerData->numUnlockedPersons - 1)
sFameCheckerData->listMenuDrawnSelIdx--;
- AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 8, 14 * sFameCheckerData->listMenuDrawnSelIdx + 4, 0, 0, &sTextColor_DkGrey, 0, sListMenuItems[sFameCheckerData->listMenuCurIdx].label);
+ AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 8, 14 * sFameCheckerData->listMenuDrawnSelIdx + 4, 0, 0, sTextColor_DkGrey, 0, sListMenuItems[sFameCheckerData->listMenuCurIdx].label);
}
sFameCheckerData->listMenuCurIdx = itemIndex;
@@ -1546,7 +1546,7 @@ static void PlaceListMenuCursor(bool8 isActive)
{
u16 cursorY = ListMenuGetYCoordForPrintingArrowCursor(sFameCheckerData->listMenuTaskId);
if (isActive == TRUE)
- AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 0, cursorY, 0, 0, &sTextColor_DkGrey, 0, gFameCheckerText_ListMenuCursor);
+ AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 0, cursorY, 0, 0, sTextColor_DkGrey, 0, gFameCheckerText_ListMenuCursor);
else
- AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 0, cursorY, 0, 0, &sTextColor_White, 0, gFameCheckerText_ListMenuCursor);
+ AddTextPrinterParameterized4(FCWINDOWID_LIST, 2, 0, cursorY, 0, 0, sTextColor_White, 0, gFameCheckerText_ListMenuCursor);
}
diff --git a/src/help_system.c b/src/help_system.c
index 1fd43fffa..2d96ae9d6 100644
--- a/src/help_system.c
+++ b/src/help_system.c
@@ -25,7 +25,7 @@ struct HelpSystemVideoState
/*0x0c*/ u16 savedBg0Hofs;
/*0x0e*/ u16 savedBg0Vofs;
/*0x10*/ u16 savedBldCnt;
- /*0x12*/ struct TextColor savedTextColor;
+ /*0x12*/ u8 savedTextColor[3];
/*0x15*/ u8 state;
};
@@ -171,9 +171,9 @@ void SaveMapTiles(void)
void SaveMapTextColors(void)
{
SaveTextColors(
- &sVideoState.savedTextColor.fgColor,
- &sVideoState.savedTextColor.bgColor,
- &sVideoState.savedTextColor.shadowColor
+ &sVideoState.savedTextColor[0],
+ &sVideoState.savedTextColor[1],
+ &sVideoState.savedTextColor[2]
);
}
@@ -200,9 +200,9 @@ void RestoreMapTiles(void)
void RestoreMapTextColors(void)
{
RestoreTextColors(
- &sVideoState.savedTextColor.fgColor,
- &sVideoState.savedTextColor.bgColor,
- &sVideoState.savedTextColor.shadowColor
+ &sVideoState.savedTextColor[0],
+ &sVideoState.savedTextColor[1],
+ &sVideoState.savedTextColor[2]
);
}
diff --git a/src/item_pc.c b/src/item_pc.c
index ca8c5bb8c..24f6afed2 100644
--- a/src/item_pc.c
+++ b/src/item_pc.c
@@ -125,7 +125,7 @@ static const struct MenuAction sItemPcSubmenuOptions[] = {
{gFameCheckerText_Cancel, {.void_u8 = Task_ItemPcCancel}}
};
-static const struct TextColor gUnknown_8453F8C[] = {
+static const u8 gUnknown_8453F8C[][3] = {
{0, 1, 2},
{0, 2, 3},
{0, 3, 2},
@@ -1111,7 +1111,7 @@ static void unused_ItemPc_AddTextPrinterParameterized(u8 windowId, const u8 * st
static void ItemPc_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 colorIdx)
{
- AddTextPrinterParameterized4(windowId, fontId, x, y, letterSpacing, lineSpacing, &gUnknown_8453F8C[colorIdx], speed, str);
+ AddTextPrinterParameterized4(windowId, fontId, x, y, letterSpacing, lineSpacing, gUnknown_8453F8C[colorIdx], speed, str);
}
static void ItemPc_SetBorderStyleOnWindow(u8 windowId)
diff --git a/src/list_menu.c b/src/list_menu.c
index 5f2bd02b3..d25eb3faf 100644
--- a/src/list_menu.c
+++ b/src/list_menu.c
@@ -368,21 +368,21 @@ static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 sc
static void ListMenuPrint(struct ListMenu *list, const u8 *str, u8 x, u8 y)
{
- struct TextColor colors;
+ u8 colors[3];
if (gListMenuOverride.enabled)
{
- colors.fgColor = gListMenuOverride.fillValue;
- colors.bgColor = gListMenuOverride.cursorPal;
- colors.shadowColor = gListMenuOverride.cursorShadowPal;
- AddTextPrinterParameterized4(list->template.windowId, gListMenuOverride.fontId, x, y, gListMenuOverride.lettersSpacing, 0, &colors, TEXT_SPEED_FF, str);
+ colors[0] = gListMenuOverride.fillValue;
+ colors[1] = gListMenuOverride.cursorPal;
+ colors[2] = gListMenuOverride.cursorShadowPal;
+ AddTextPrinterParameterized4(list->template.windowId, gListMenuOverride.fontId, x, y, gListMenuOverride.lettersSpacing, 0, colors, TEXT_SPEED_FF, str);
gListMenuOverride.enabled = FALSE;
}
else
{
- colors.fgColor = list->template.fillValue;
- colors.bgColor = list->template.cursorPal;
- colors.shadowColor = list->template.cursorShadowPal;
- AddTextPrinterParameterized4(list->template.windowId, list->template.fontId, x, y, list->template.lettersSpacing, 0, &colors, TEXT_SPEED_FF, str);
+ colors[0] = list->template.fillValue;
+ colors[1] = list->template.cursorPal;
+ colors[2] = list->template.cursorShadowPal;
+ AddTextPrinterParameterized4(list->template.windowId, list->template.fontId, x, y, list->template.lettersSpacing, 0, colors, TEXT_SPEED_FF, str);
}
}
diff --git a/src/map_preview_screen.c b/src/map_preview_screen.c
index b913d5fe8..a17f37802 100644
--- a/src/map_preview_screen.c
+++ b/src/map_preview_screen.c
@@ -447,14 +447,14 @@ u16 sub_80F8318(u8 mapsec)
{
u16 windowId;
u32 xctr;
- struct TextColor color[0];
+ u8 color[0];
windowId = AddWindow(&sMapNameWindow);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
PutWindowTilemap(windowId);
- color->fgColor = 1; // Access violation
- color->bgColor = 4; // Access violation
- color->shadowColor = 3; // Access violation
+ color[0] = 1; // Access violation
+ color[1] = 4; // Access violation
+ color[2] = 3; // Access violation
GetMapName(gStringVar4, mapsec, 0);
xctr = 104 - GetStringWidth(2, gStringVar4, 0);
AddTextPrinterParameterized4(windowId, 2, xctr / 2, 2, 0, 0, color/* Access violation */, -1, gStringVar4);
diff --git a/src/menu.c b/src/menu.c
index bef442d84..b8a68145c 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -41,12 +41,7 @@ static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLef
static void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum);
static u8 MultichoiceGrid_MoveCursor(s8 deltaX, s8 deltaY);
-static const struct TextColor gUnknown_8456618 =
-{
- .fgColor = 15,
- .bgColor = 1,
- .shadowColor = 2,
-};
+static const u8 gUnknown_8456618[3] = {15, 1, 2};
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum)
{
@@ -205,7 +200,7 @@ void TopBarWindowPrintString(const u8 *string, u8 unused, bool8 copyToVram)
PutWindowTilemap(sTopBarWindowId);
FillWindowPixelBuffer(sTopBarWindowId, PIXEL_FILL(15));
width = GetStringWidth(0, string, 0);
- AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, &gUnknown_8456618, 0, string);
+ AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, gUnknown_8456618, 0, string);
if (copyToVram)
CopyWindowToVram(sTopBarWindowId, 3);
}
@@ -213,22 +208,22 @@ void TopBarWindowPrintString(const u8 *string, u8 unused, bool8 copyToVram)
void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgColorChooser, u8 unused, bool8 copyToVram)
{
- struct TextColor color;
+ u8 color[3];
s32 fgColor, width;
if ( sTopBarWindowId != 0xFF )
{
if (fgColorChooser)
{
- color.fgColor = 0;
- color.bgColor = 1;
- color.shadowColor = 2;
+ color[0] = 0;
+ color[1] = 1;
+ color[2] = 2;
}
else
{
- color.fgColor = 15;
- color.bgColor = 1;
- color.shadowColor = 2;
+ color[0] = 15;
+ color[1] = 1;
+ color[2] = 2;
}
PutWindowTilemap(sTopBarWindowId);
@@ -236,9 +231,9 @@ void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgCo
if (string2)
{
width = GetStringWidth(0, string2, 0);
- AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, &color, 0, string2);
+ AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, color, 0, string2);
}
- AddTextPrinterParameterized4(sTopBarWindowId, 1, 4, 1, 0, 0, &color, 0, string);
+ AddTextPrinterParameterized4(sTopBarWindowId, 1, 4, 1, 0, 0, color, 0, string);
if (copyToVram)
CopyWindowToVram(sTopBarWindowId, 3);
}
diff --git a/src/menu2.c b/src/menu2.c
index 6a3668cfa..6ee1488b1 100644
--- a/src/menu2.c
+++ b/src/menu2.c
@@ -424,7 +424,7 @@ static const u8 gUnknown_845FD54[][5] = {
[SPECIES_OLD_UNOWN_QMARK - 1] = {0x20, 0x23, 0x08, 0x20, 0x2d}
};
-void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 x, u8 y, const struct TextColor * color, s8 speed, const u8 * str)
+void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 x, u8 y, const u8 * color, s8 speed, const u8 * str)
{
struct TextPrinterTemplate printer;
@@ -438,13 +438,13 @@ void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 x, u8 y, const stru
printer.letterSpacing = GetFontAttribute(fontId, 2);
printer.lineSpacing = GetFontAttribute(fontId, 3);
printer.unk = 0;
- printer.fgColor = color->bgColor;
- printer.bgColor = color->fgColor;
- printer.shadowColor = color->shadowColor;
+ printer.fgColor = color[1];
+ printer.bgColor = color[0];
+ printer.shadowColor = color[2];
AddTextPrinter(&printer, speed, NULL);
}
-void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str)
+void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str)
{
struct TextPrinterTemplate printer;
@@ -458,9 +458,9 @@ void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterS
printer.letterSpacing = letterSpacing;
printer.lineSpacing = lineSpacing;
printer.unk = 0;
- printer.fgColor = color->bgColor;
- printer.bgColor = color->fgColor;
- printer.shadowColor = color->shadowColor;
+ printer.fgColor = color[1];
+ printer.bgColor = color[0];
+ printer.shadowColor = color[2];
AddTextPrinter(&printer, speed, NULL);
}
diff --git a/src/mevent_8145654.c b/src/mevent_8145654.c
index c67cd1358..85c1dfccb 100644
--- a/src/mevent_8145654.c
+++ b/src/mevent_8145654.c
@@ -61,7 +61,7 @@ void sub_81461D8(void);
extern const struct OamData gOamData_83AC9F8;
-const struct TextColor gUnknown_8467068[] = {
+const u8 gUnknown_8467068[][3] = {
{0, 2, 3},
{0, 1, 2}
};
@@ -348,28 +348,28 @@ void sub_8145D18(u8 whichWindow)
case 0:
{
s32 x;
- AddTextPrinterParameterized3(windowId, 3, 0, 1, &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal1], 0, gUnknown_203F3C8->unk_018B);
+ AddTextPrinterParameterized3(windowId, 3, 0, 1, gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal1], 0, gUnknown_203F3C8->unk_018B);
x = 160 - GetStringWidth(3, gUnknown_203F3C8->unk_01B4, GetFontAttribute(3, 2));
if (x < 0)
x = 0;
- AddTextPrinterParameterized3(windowId, 3, x, 17, &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal1], 0, gUnknown_203F3C8->unk_01B4);
+ AddTextPrinterParameterized3(windowId, 3, x, 17, gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal1], 0, gUnknown_203F3C8->unk_01B4);
if (gUnknown_203F3C8->unk_0000.unk_04 != 0)
{
- AddTextPrinterParameterized3(windowId, 2, 166, 17, &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal1], 0, gUnknown_203F3C8->unk_01DD);
+ AddTextPrinterParameterized3(windowId, 2, 166, 17, gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal1], 0, gUnknown_203F3C8->unk_01DD);
}
break;
}
case 1:
for (; sp0C < 4; sp0C++)
{
- AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal2], 0, gUnknown_203F3C8->unk_01E4[sp0C]);
+ AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal2], 0, gUnknown_203F3C8->unk_01E4[sp0C]);
}
break;
case 2:
- AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_8467070[gUnknown_203F3C8->unk_0000.unk_08_0], &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_0288);
+ AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_8467070[gUnknown_203F3C8->unk_0000.unk_08_0], gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_0288);
if (gUnknown_203F3C8->unk_0000.unk_08_0 != 2)
{
- AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_8467070[gUnknown_203F3C8->unk_0000.unk_08_0], &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_02B1);
+ AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_8467070[gUnknown_203F3C8->unk_0000.unk_08_0], gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_02B1);
}
else
{
@@ -378,11 +378,11 @@ void sub_8145D18(u8 whichWindow)
s32 spacing = GetFontAttribute(3, 2);
for (; sp0C < gUnknown_203F3C8->unk_0175; sp0C++)
{
- AddTextPrinterParameterized3(windowId, 3, x, y, &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_02DC[sp0C].unk_01);
+ AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_02DC[sp0C].unk_01);
if (gUnknown_203F3C8->unk_02DC[sp0C].unk_42[0] != EOS)
{
x += GetStringWidth(3, gUnknown_203F3C8->unk_02DC[sp0C].unk_01, spacing);
- AddTextPrinterParameterized3(windowId, 2, x, y, &gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_02DC[sp0C].unk_42);
+ AddTextPrinterParameterized3(windowId, 2, x, y, gUnknown_8467068[gUnknown_203F3C8->unk_0170->textPal3], 0, gUnknown_203F3C8->unk_02DC[sp0C].unk_42);
x += GetStringWidth(3, gUnknown_203F3C8->unk_02DC[sp0C].unk_42, spacing) + gUnknown_203F3C8->unk_02DC[sp0C].unk_00;
}
}
@@ -471,7 +471,7 @@ void sub_8146980(void);
void sub_8146A30(void);
void sub_8146B58(void);
-const struct TextColor gUnknown_8468038[] = {
+const u8 gUnknown_8468038[][3] = {
{0, 2, 3},
{0, 1, 2}
};
@@ -758,10 +758,10 @@ void sub_8146A30(void)
x = (0xe0 - GetStringWidth(3, gUnknown_203F3CC->unk_01CE, GetFontAttribute(3, 2))) / 2;
if (x < 0)
x = 0;
- AddTextPrinterParameterized3(gUnknown_203F3CC->unk_01C8[0], 3, x, 6, &gUnknown_8468038[gUnknown_203F3CC->unk_01BC->textPal1], 0, gUnknown_203F3CC->unk_01CE);
+ AddTextPrinterParameterized3(gUnknown_203F3CC->unk_01C8[0], 3, x, 6, gUnknown_8468038[gUnknown_203F3CC->unk_01BC->textPal1], 0, gUnknown_203F3CC->unk_01CE);
for (; i < 10; ++i)
{
- AddTextPrinterParameterized3(gUnknown_203F3CC->unk_01C8[1], 3, 0, 16 * i + 2, &gUnknown_8468038[gUnknown_203F3CC->unk_01BC->textPal2], 0, gUnknown_203F3CC->unk_01F7[i]);
+ AddTextPrinterParameterized3(gUnknown_203F3CC->unk_01C8[1], 3, 0, 16 * i + 2, gUnknown_8468038[gUnknown_203F3CC->unk_01BC->textPal2], 0, gUnknown_203F3CC->unk_01F7[i]);
}
CopyWindowToVram(gUnknown_203F3CC->unk_01C8[0], 3);
CopyWindowToVram(gUnknown_203F3CC->unk_01C8[1], 3);
diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c
index 9ff96eb23..57bc07f33 100644
--- a/src/mystery_gift_menu.c
+++ b/src/mystery_gift_menu.c
@@ -409,9 +409,9 @@ const u8 *const Unref_08366ED8[] = {
gText_ReturnToTitle
};
-ALIGNED(4) const struct TextColor sMG_Ereader_TextColor_1 = { 0, 1, 2 };
-ALIGNED(4) const struct TextColor sMG_Ereader_TextColor_1_Copy = { 0, 1, 2 };
-ALIGNED(4) const struct TextColor sMG_Ereader_TextColor_2 = { 1, 2, 3 };
+ALIGNED(4) const u8 sMG_Ereader_TextColor_1[3] = { 0, 1, 2 };
+ALIGNED(4) const u8 sMG_Ereader_TextColor_1_Copy[3] = { 0, 1, 2 };
+ALIGNED(4) const u8 sMG_Ereader_TextColor_2[3] = { 1, 2, 3 };
const u8 gUnknown_8466EF3[] = _("テスト");
const u8 gUnknown_8466EF7[] = _("むげんのチケット");
@@ -538,14 +538,14 @@ void PrintMysteryGiftOrEReaderTopMenu(bool8 mg_or_ereader, bool32 usePickOkCance
if (!mg_or_ereader)
{
src = usePickOkCancel == TRUE ? gText_PickOKExit : gText_PickOKCancel;
- AddTextPrinterParameterized4(0, 2, 2, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gText_MysteryGift);
+ AddTextPrinterParameterized4(0, 2, 2, 2, 0, 0, sMG_Ereader_TextColor_1, 0, gText_MysteryGift);
width = 222 - GetStringWidth(0, src, 0);
- AddTextPrinterParameterized4(0, 0, width, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, src);
+ AddTextPrinterParameterized4(0, 0, width, 2, 0, 0, sMG_Ereader_TextColor_1, 0, src);
}
else
{
- AddTextPrinterParameterized4(0, 2, 2, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gJPText_MysteryGift);
- AddTextPrinterParameterized4(0, 0, 0x78, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gJPText_DecideStop);
+ AddTextPrinterParameterized4(0, 2, 2, 2, 0, 0, sMG_Ereader_TextColor_1, 0, gJPText_MysteryGift);
+ AddTextPrinterParameterized4(0, 0, 0x78, 2, 0, 0, sMG_Ereader_TextColor_1, 0, gJPText_DecideStop);
}
CopyWindowToVram(0, 2);
PutWindowTilemap(0);
@@ -596,7 +596,7 @@ void AddTextPrinterToWindow1(const u8 *str)
{
StringExpandPlaceholders(gStringVar4, str);
FillWindowPixelBuffer(1, 0x11);
- AddTextPrinterParameterized4(1, 2, 0, 2, 0, 2, &sMG_Ereader_TextColor_2, 0, gStringVar4);
+ AddTextPrinterParameterized4(1, 2, 0, 2, 0, 2, sMG_Ereader_TextColor_2, 0, gStringVar4);
DrawTextBorderOuter(1, 0x001, 0xF);
PutWindowTilemap(1);
CopyWindowToVram(1, 3);
@@ -737,7 +737,7 @@ s8 mevent_message_print_and_prompt_yes_no(u8 * textState, u16 * windowId, bool8
*windowId = AddWindow(&sWindowTemplate_PromptYesOrNo_Width20);
}
FillWindowPixelBuffer(*windowId, 0x11);
- AddTextPrinterParameterized4(*windowId, 2, 0, 2, 0, 2, &sMG_Ereader_TextColor_2, 0, gStringVar4);
+ AddTextPrinterParameterized4(*windowId, 2, 0, 2, 0, 2, sMG_Ereader_TextColor_2, 0, gStringVar4);
DrawTextBorderOuter(*windowId, 0x001, 0x0F);
CopyWindowToVram(*windowId, 2);
PutWindowTilemap(*windowId);
@@ -798,7 +798,7 @@ s32 HandleMysteryGiftListMenu(u8 * textState, u16 * windowId, bool32 cannotToss,
}
*windowId = AddWindow(&sMysteryGiftMenuWindowTemplate);
FillWindowPixelBuffer(*windowId, 0x11);
- AddTextPrinterParameterized4(*windowId, 2, 0, 2, 0, 2, &sMG_Ereader_TextColor_2, 0, gStringVar4);
+ AddTextPrinterParameterized4(*windowId, 2, 0, 2, 0, 2, sMG_Ereader_TextColor_2, 0, gStringVar4);
DrawTextBorderOuter(*windowId, 0x001, 0x0F);
CopyWindowToVram(*windowId, 2);
PutWindowTilemap(*windowId);
diff --git a/src/oak_speech.c b/src/oak_speech.c
index c00335136..04b66f528 100644
--- a/src/oak_speech.c
+++ b/src/oak_speech.c
@@ -37,7 +37,7 @@ struct OakSpeechResources
u16 unk_0010;
u16 unk_0012;
u16 unk_0014[4];
- struct TextColor textColor;
+ u8 textColor[3];
u8 textSpeed;
u8 filler_0020[0x1800];
u8 bg2TilemapBuffer[0x400];
@@ -273,11 +273,11 @@ static const struct WindowTemplate sNewGameAdventureIntroWindowTemplates[] = {
}, DUMMY_WIN_TEMPLATE
};
-ALIGNED(4) const struct TextColor sTextColor_HelpSystem = {
+const u8 sTextColor_HelpSystem[4] = {
0x00, 0x01, 0x02
};
-ALIGNED(4) const struct TextColor sTextColor_OakSpeech = {
+const u8 sTextColor_OakSpeech[4] = {
0x00, 0x02, 0x03
};
@@ -576,7 +576,7 @@ static void CreateHelpDocsPage1(void)
sOakSpeechResources->unk_0014[0] = AddWindow(sHelpDocsWindowTemplatePtrs[sOakSpeechResources->unk_0012]);
PutWindowTilemap(sOakSpeechResources->unk_0014[0]);
FillWindowPixelBuffer(sOakSpeechResources->unk_0014[0], 0x00);
- AddTextPrinterParameterized4(sOakSpeechResources->unk_0014[0], 2, 2, 0, 1, 1, &sTextColor_HelpSystem, 0, gNewGame_HelpDocs1);
+ AddTextPrinterParameterized4(sOakSpeechResources->unk_0014[0], 2, 2, 0, 1, 1, sTextColor_HelpSystem, 0, gNewGame_HelpDocs1);
CopyWindowToVram(sOakSpeechResources->unk_0014[0], 3);
FillBgTilemapBufferRect_Palette0(1, 0x3000, 1, 3, 5, 16);
CopyBgTilemapBufferToVram(1);
@@ -598,7 +598,7 @@ static void Task_OakSpeech4(u8 taskId)
sOakSpeechResources->unk_0014[i] = AddWindow(&sHelpDocsWindowTemplatePtrs[sOakSpeechResources->unk_0012][i]);
PutWindowTilemap(sOakSpeechResources->unk_0014[i]);
FillWindowPixelBuffer(sOakSpeechResources->unk_0014[i], 0x00);
- AddTextPrinterParameterized4(sOakSpeechResources->unk_0014[i], 2, 6, 0, 1, 1, &sTextColor_HelpSystem, 0, sHelpDocsPtrs[i + r7 * 3]);
+ AddTextPrinterParameterized4(sOakSpeechResources->unk_0014[i], 2, 6, 0, 1, 1, sTextColor_HelpSystem, 0, sHelpDocsPtrs[i + r7 * 3]);
CopyWindowToVram(sOakSpeechResources->unk_0014[i], 3);
}
@@ -730,7 +730,7 @@ static void Task_OakSpeech6(u8 taskId)
sOakSpeechResources->unk_0012 = 0;
gMain.state = 0;
data[15] = 16;
- AddTextPrinterParameterized4(data[14], 2, 3, 5, 1, 0, &sTextColor_OakSpeech, 0, sNewGameAdventureIntroTextPointers[0]);
+ AddTextPrinterParameterized4(data[14], 2, 3, 5, 1, 0, sTextColor_OakSpeech, 0, sNewGameAdventureIntroTextPointers[0]);
data[5] = CreateTextCursorSpriteForOakSpeech(0, 0xe2, 0x91, 0, 0);
gSprites[data[5]].oam.objMode = ST_OAM_OBJ_BLEND;
gSprites[data[5]].oam.priority = 0;
@@ -790,7 +790,7 @@ static void Task_OakSpeech7(u8 taskId)
if (data[15] <= 0)
{
FillWindowPixelBuffer(data[14], 0x00);
- AddTextPrinterParameterized4(data[14], 2, 3, 5, 1, 0, &sTextColor_OakSpeech, 0, sNewGameAdventureIntroTextPointers[sOakSpeechResources->unk_0012]);
+ AddTextPrinterParameterized4(data[14], 2, 3, 5, 1, 0, sTextColor_OakSpeech, 0, sNewGameAdventureIntroTextPointers[sOakSpeechResources->unk_0012]);
if (sOakSpeechResources->unk_0012 == 0)
{
ClearTopBarWindow();
@@ -1056,14 +1056,14 @@ static void Task_OakSpeech19(u8 taskId)
PutWindowTilemap(gTasks[taskId].data[13]);
DrawStdFrameWithCustomTileAndPalette(gTasks[taskId].data[13], 1, GetStdWindowBaseTileNum(), 14);
FillWindowPixelBuffer(gTasks[taskId].data[13], 0x11);
- sOakSpeechResources->textColor.fgColor = 1;
- sOakSpeechResources->textColor.bgColor = 2;
- sOakSpeechResources->textColor.shadowColor = 3;
- AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 1, &sOakSpeechResources->textColor, 0, gText_Boy);
- sOakSpeechResources->textColor.fgColor = 1;
- sOakSpeechResources->textColor.bgColor = 2;
- sOakSpeechResources->textColor.shadowColor = 3;
- AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 17, &sOakSpeechResources->textColor, 0, gText_Girl);
+ sOakSpeechResources->textColor[0] = 1;
+ sOakSpeechResources->textColor[1] = 2;
+ sOakSpeechResources->textColor[2] = 3;
+ AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 1, sOakSpeechResources->textColor, 0, gText_Boy);
+ sOakSpeechResources->textColor[0] = 1;
+ sOakSpeechResources->textColor[1] = 2;
+ sOakSpeechResources->textColor[2] = 3;
+ AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 17, sOakSpeechResources->textColor, 0, gText_Girl);
Menu_InitCursor(gTasks[taskId].data[13], 2, 0, 1, GetFontAttribute(2, 1) + 2, 2, 0);
CopyWindowToVram(gTasks[taskId].data[13], 3);
gTasks[taskId].func = Task_OakSpeech20;
diff --git a/src/quest_log.c b/src/quest_log.c
index e88285995..6083e9348 100644
--- a/src/quest_log.c
+++ b/src/quest_log.c
@@ -410,7 +410,7 @@ const struct WindowTemplate gUnknown_845661C[3] = {
{ 0, 0, 14, 30, 6, 15, 0x14c }
};
-const struct TextColor gUnknown_8456634 = {15, 1, 12};
+const u8 gUnknown_8456634[3] = {15, 1, 12};
const u16 gUnknown_8456638[] = INCBIN_U16("data/graphics/unknown_8456638.bin");
@@ -923,7 +923,7 @@ void sub_8111070(u8 a0)
StringAppend(gStringVar4, gStringVar1);
}
- AddTextPrinterParameterized4(gUnknown_203ADFE[0], 2, 2, 2, 1, 2, &gUnknown_8456634, 0, gStringVar4);
+ AddTextPrinterParameterized4(gUnknown_203ADFE[0], 2, 2, 2, 1, 2, gUnknown_8456634, 0, gStringVar4);
PutWindowTilemap(gUnknown_203ADFE[0]);
PutWindowTilemap(gUnknown_203ADFE[1]);
CopyWindowToVram(gUnknown_203ADFE[0], 2);
@@ -1418,7 +1418,7 @@ void sub_8111D10(void)
PutWindowTilemap(gUnknown_203ADFE[2]);
sub_8111D90(gUnknown_203ADFE[2]);
- AddTextPrinterParameterized4(gUnknown_203ADFE[2], 2, 2, gUnknown_8456698[count], 1, 0, &gUnknown_8456634, 0, gStringVar4);
+ AddTextPrinterParameterized4(gUnknown_203ADFE[2], 2, 2, gUnknown_8456698[count], 1, 0, gUnknown_8456634, 0, gStringVar4);
ScheduleBgCopyTilemapToVram(0);
}
@@ -2463,13 +2463,13 @@ void sub_8112FD0(void)
sub_8112F18(gUnknown_203B020);
}
-const struct TextColor gUnknown_8456930 = {
+const u8 gUnknown_8456930[3] = {
0, 10, 2
};
void sub_8112FE4(const u8 * a0)
{
- AddTextPrinterParameterized4(gUnknown_203B020, 0x02, 2, 5, 1, 1, &gUnknown_8456930, -1, a0);
+ AddTextPrinterParameterized4(gUnknown_203B020, 0x02, 2, 5, 1, 1, gUnknown_8456930, -1, a0);
}
void sub_8113018(const u8 * text, u8 mode)
diff --git a/src/slot_machine.c b/src/slot_machine.c
index 740234d95..28292902f 100644
--- a/src/slot_machine.c
+++ b/src/slot_machine.c
@@ -2074,7 +2074,7 @@ static bool32 sub_8141180(u8 a0)
static bool8 sub_8141198(u8 * state, struct SlotMachineSetupTaskData * ptr)
{
u16 pal;
- struct TextColor textColor;
+ u8 textColor[3];
u32 x;
switch (*state)
@@ -2125,10 +2125,10 @@ static bool8 sub_8141198(u8 * state, struct SlotMachineSetupTaskData * ptr)
PutWindowTilemap(1);
x = 0xEC - GetStringWidth(0, gString_SlotMachineControls, 0);
- textColor.fgColor = 15;
- textColor.bgColor = 1;
- textColor.shadowColor = 2;
- AddTextPrinterParameterized3(1, 0, x, 0, &textColor, 0, gString_SlotMachineControls);
+ textColor[0] = 15;
+ textColor[1] = 1;
+ textColor[2] = 2;
+ AddTextPrinterParameterized3(1, 0, x, 0, textColor, 0, gString_SlotMachineControls);
CopyBgTilemapBufferToVram(0);
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | 0x20 | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON);
diff --git a/src/tm_case.c b/src/tm_case.c
index ac737af5d..b9c89b6b3 100644
--- a/src/tm_case.c
+++ b/src/tm_case.c
@@ -185,7 +185,7 @@ static const u8 sText_SingleSpace[] = _(" ");
static ALIGNED(4) const u16 sPal3Override[] = {RGB(8, 8, 8), RGB(30, 16, 6)};
-static const struct TextColor sTextColors[] = {
+static const u8 sTextColors[][3] = {
{0, 1, 2},
{0, 2, 3},
{0, 3, 6},
@@ -1317,7 +1317,7 @@ static void InitWindowTemplatesAndPals(void)
static void AddTextPrinterParameterized_ColorByIndex(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 colorIdx)
{
- AddTextPrinterParameterized4(windowId, fontId, x, y, letterSpacing, lineSpacing, &sTextColors[colorIdx], speed, str);
+ AddTextPrinterParameterized4(windowId, fontId, x, y, letterSpacing, lineSpacing, sTextColors[colorIdx], speed, str);
}
static void TMCase_SetWindowBorder1(u8 windowId)
@@ -1339,7 +1339,7 @@ static void TMCase_PrintMessageWithFollowupTask(u8 taskId, u8 windowId, const u8
static void PrintStringTMCaseOnWindow3(void)
{
u32 distance = 72 - GetStringWidth(1, gText_TMCase, 0);
- AddTextPrinterParameterized3(3, 1, distance / 2, 1, &sTextColors[0], 0, gText_TMCase);
+ AddTextPrinterParameterized3(3, 1, distance / 2, 1, sTextColors[0], 0, gText_TMCase);
}
static void DrawMoveInfoUIMarkers(void)
diff --git a/src/trainer_tower.c b/src/trainer_tower.c
index 054a0da2f..da3cf6dda 100644
--- a/src/trainer_tower.c
+++ b/src/trainer_tower.c
@@ -423,7 +423,7 @@ const struct WindowTemplate gUnknown_847A218[] = {
const u32 gUnknown_847A228 = 0x70; // unused
-const struct TextColor gUnknown_847A22C = {0, 2, 3};
+const u8 gUnknown_847A22C[3] = {0, 2, 3};
void (*const gUnknown_847A230[])(void) = {
sub_815DD44,
@@ -1433,14 +1433,14 @@ void PrintTrainerTowerRecords(void)
sub_815DC8C();
FillWindowPixelRect(0, 0, 0, 0, 0xd8, 0x90);
sub_815EC0C();
- AddTextPrinterParameterized3(0, 2, 0x4a, 0, &gUnknown_847A22C, 0, gUnknown_83FE982);
+ AddTextPrinterParameterized3(0, 2, 0x4a, 0, gUnknown_847A22C, 0, gUnknown_83FE982);
for (i = 0; i < 4; i++)
{
PRINT_TOWER_TIME(sub_815EDDC(&gSaveBlock1Ptr->unkArray[i].unk4));
StringExpandPlaceholders(gStringVar4, gUnknown_83FE998);
- AddTextPrinterParameterized3(windowId, 2, 0x18, 0x24 + 0x14 * i, &gUnknown_847A22C, 0, gUnknown_83FE9C4[i]);
- AddTextPrinterParameterized3(windowId, 2, 0x60, 0x24 + 0x14 * i, &gUnknown_847A22C, 0, gStringVar4);
+ AddTextPrinterParameterized3(windowId, 2, 0x18, 0x24 + 0x14 * i, gUnknown_847A22C, 0, gUnknown_83FE9C4[i]);
+ AddTextPrinterParameterized3(windowId, 2, 0x60, 0x24 + 0x14 * i, gUnknown_847A22C, 0, gStringVar4);
}
PutWindowTilemap(windowId);
diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c
index cc80d37b6..1c355c3ba 100644
--- a/src/wireless_communication_status_screen.c
+++ b/src/wireless_communication_status_screen.c
@@ -329,37 +329,37 @@ void sub_814F46C(u8 taskId)
void sub_814F65C(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 palIdx)
{
- struct TextColor textColor;
+ u8 textColor[3];
switch (palIdx)
{
case 0:
- textColor.fgColor = 0;
- textColor.bgColor = 2;
- textColor.shadowColor = 3;
+ textColor[0] = 0;
+ textColor[1] = 2;
+ textColor[2] = 3;
break;
case 1:
- textColor.fgColor = 0;
- textColor.bgColor = 1;
- textColor.shadowColor = 3;
+ textColor[0] = 0;
+ textColor[1] = 1;
+ textColor[2] = 3;
break;
case 2:
- textColor.fgColor = 0;
- textColor.bgColor = 4;
- textColor.shadowColor = 5;
+ textColor[0] = 0;
+ textColor[1] = 4;
+ textColor[2] = 5;
break;
case 3:
- textColor.fgColor = 0;
- textColor.bgColor = 7;
- textColor.shadowColor = 6;
+ textColor[0] = 0;
+ textColor[1] = 7;
+ textColor[2] = 6;
break;
case 4:
- textColor.fgColor = 0;
- textColor.bgColor = 1;
- textColor.shadowColor = 2;
+ textColor[0] = 0;
+ textColor[1] = 1;
+ textColor[2] = 2;
break;
// default: UB
}
- AddTextPrinterParameterized4(windowId, fontId,x, y, fontId == 0 ? 0 : 1, 0, &textColor, -1, str);
+ AddTextPrinterParameterized4(windowId, fontId,x, y, fontId == 0 ? 0 : 1, 0, textColor, -1, str);
}
u32 sub_814F714(struct UnkStruct_x20 * unk20, u32 * arg1)