diff --git a/Makefile b/Makefile index 63feed5..f3f3e73 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ LIBTONC := $(DEVKITPRO)/libtonc #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR))_mb BUILD := build -SOURCES := source -INCLUDES := include +SOURCES := source source/pccs +INCLUDES := include include/pccs DATA := data MUSIC := audio GRAPHICS := graphics diff --git a/Poke_Transporter_GB_mb.sym b/Poke_Transporter_GB_mb.sym index 92cfc11..b52dc3b 100644 --- a/Poke_Transporter_GB_mb.sym +++ b/Poke_Transporter_GB_mb.sym @@ -6,41 +6,50 @@ SYMBOL TABLE: 02000210 l d .init 00000000 .init 0200021c l d .plt 00000000 .plt 0200021c l d .text 00000000 .text -0200d7f8 l d .fini 00000000 .fini -0200d804 l d .rodata 00000000 .rodata -0201b780 l d .init_array 00000000 .init_array -0201b798 l d .fini_array 00000000 .fini_array -0201b7a4 l d .ctors 00000000 .ctors -0201b7a4 l d .dtors 00000000 .dtors -0201b7a4 l d .eh_frame 00000000 .eh_frame -0201b7a8 l d .gcc_except_table 00000000 .gcc_except_table +0200dd90 l d .fini 00000000 .fini +0200dd9c l d .rodata 00000000 .rodata +0201c9ec l d .init_array 00000000 .init_array +0201ca04 l d .fini_array 00000000 .fini_array +0201ca10 l d .ctors 00000000 .ctors +0201ca10 l d .dtors 00000000 .dtors +0201ca10 l d .eh_frame 00000000 .eh_frame +0201ca14 l d .gcc_except_table 00000000 .gcc_except_table 03000000 l d .iwram 00000000 .iwram -030006b0 l d .bss 00000000 .bss -03003058 l d .data 00000000 .data -030032ac l d .iwram0 00000000 .iwram0 -030032ac l d .iwram1 00000000 .iwram1 -030032ac l d .iwram2 00000000 .iwram2 -030032ac l d .iwram3 00000000 .iwram3 -030032ac l d .iwram4 00000000 .iwram4 -030032ac l d .iwram5 00000000 .iwram5 -030032ac l d .iwram6 00000000 .iwram6 -030032ac l d .iwram7 00000000 .iwram7 -030032ac l d .iwram8 00000000 .iwram8 -030032ac l d .iwram9 00000000 .iwram9 -0201c0ac l d .ewram 00000000 .ewram -0201c208 l d .sbss 00000000 .sbss -0201c208 l d .ewram0 00000000 .ewram0 -0201c208 l d .ewram1 00000000 .ewram1 -0201c208 l d .ewram2 00000000 .ewram2 -0201c208 l d .ewram3 00000000 .ewram3 -0201c208 l d .ewram4 00000000 .ewram4 -0201c208 l d .ewram5 00000000 .ewram5 -0201c208 l d .ewram6 00000000 .ewram6 -0201c208 l d .ewram7 00000000 .ewram7 -0201c208 l d .ewram8 00000000 .ewram8 -0201c208 l d .ewram9 00000000 .ewram9 +03000520 l d .bss 00000000 .bss +030035a8 l d .data 00000000 .data +03004574 l d .iwram0 00000000 .iwram0 +03004574 l d .iwram1 00000000 .iwram1 +03004574 l d .iwram2 00000000 .iwram2 +03004574 l d .iwram3 00000000 .iwram3 +03004574 l d .iwram4 00000000 .iwram4 +03004574 l d .iwram5 00000000 .iwram5 +03004574 l d .iwram6 00000000 .iwram6 +03004574 l d .iwram7 00000000 .iwram7 +03004574 l d .iwram8 00000000 .iwram8 +03004574 l d .iwram9 00000000 .iwram9 +0201df00 l d .ewram 00000000 .ewram +0201e05c l d .sbss 00000000 .sbss +0201e05c l d .ewram0 00000000 .ewram0 +0201e05c l d .ewram1 00000000 .ewram1 +0201e05c l d .ewram2 00000000 .ewram2 +0201e05c l d .ewram3 00000000 .ewram3 +0201e05c l d .ewram4 00000000 .ewram4 +0201e05c l d .ewram5 00000000 .ewram5 +0201e05c l d .ewram6 00000000 .ewram6 +0201e05c l d .ewram7 00000000 .ewram7 +0201e05c l d .ewram8 00000000 .ewram8 +0201e05c l d .ewram9 00000000 .ewram9 00000000 l d .comment 00000000 .comment 00000000 l d .ARM.attributes 00000000 .ARM.attributes +00000000 l d .debug_aranges 00000000 .debug_aranges +00000000 l d .debug_info 00000000 .debug_info +00000000 l d .debug_abbrev 00000000 .debug_abbrev +00000000 l d .debug_line 00000000 .debug_line +00000000 l d .debug_frame 00000000 .debug_frame +00000000 l d .debug_str 00000000 .debug_str +00000000 l d .debug_loclists 00000000 .debug_loclists +00000000 l d .debug_rnglists 00000000 .debug_rnglists +00000000 l d .debug_line_str 00000000 .debug_line_str 00000000 l df *ABS* 00000000 gba_crt0.o 02000000 l .crt0 00000000 $a 020000c0 l .crt0 00000000 rom_header_end @@ -64,26 +73,26 @@ SYMBOL TABLE: 020001b0 l .crt0 00000000 $d 00000000 l df *ABS* 00000000 crti.o 02000210 l .init 00000000 $t -0200d7f8 l .fini 00000000 $t +0200dd90 l .fini 00000000 $t 00000000 l df *ABS* 00000000 crtn.o 02000214 l .init 00000000 $t -0200d7fc l .fini 00000000 $t +0200dd94 l .fini 00000000 $t 00000000 l df *ABS* 00000000 crtstuff.c -0201b7a4 l O .eh_frame 00000000 __EH_FRAME_BEGIN__ +0201ca10 l O .eh_frame 00000000 __EH_FRAME_BEGIN__ 0200021c l .text 00000000 $t 0200021d l F .text 00000000 __do_global_dtors_aux 0200023c l .text 00000000 $d -030006b0 l O .bss 00000000 completed.1 -0201b798 l .fini_array 00000000 $d -0201b798 l O .fini_array 00000000 __do_global_dtors_aux_fini_array_entry +03000520 l O .bss 00000000 completed.1 +0201ca04 l .fini_array 00000000 $d +0201ca04 l O .fini_array 00000000 __do_global_dtors_aux_fini_array_entry 02000248 l .text 00000000 $t 02000249 l F .text 00000000 frame_dummy 02000260 l .text 00000000 $d -030006b4 l O .bss 00000000 object.0 -0201b780 l .init_array 00000000 $d -0201b780 l O .init_array 00000000 __frame_dummy_init_array_entry -030006b0 l .bss 00000000 $d -030006b4 l .bss 00000000 $d +03000524 l O .bss 00000000 object.0 +0201c9ec l .init_array 00000000 $d +0201c9ec l O .init_array 00000000 __frame_dummy_init_array_entry +03000520 l .bss 00000000 $d +03000524 l .bss 00000000 $d 00000000 l df *ABS* 00000000 background_engine.cpp 0200026c l .text 00000000 $t 0200029c l .text 00000000 $d @@ -91,1123 +100,1349 @@ SYMBOL TABLE: 02000300 l .text 00000000 $d 02000304 l .text 00000000 $t 02000330 l .text 00000000 $d -030006cc l .bss 00000000 $d -030006d0 l .bss 00000000 $d +0300053c l .bss 00000000 $d +03000540 l .bss 00000000 $d 00000000 l df *ABS* 00000000 box_menu.cpp 02000339 l F .text 00000018 key_hit 02000338 l .text 00000000 $t 02000348 l .text 00000000 $d 02000350 l .text 00000000 $t 02000354 l .text 00000000 $t -02000688 l .text 00000000 $d +020006a8 l .text 00000000 $d +020006f8 l .text 00000000 $t 00000000 l df *ABS* 00000000 button_handler.cpp -020006e0 l .text 00000000 $t -020006e2 l .text 00000000 $t -02000700 l .text 00000000 $t -0200074a l .text 00000000 $t -02000770 l .text 00000000 $t -02000798 l .text 00000000 $d -0200079c l .text 00000000 $t -020007b4 l .text 00000000 $t -020007d8 l .text 00000000 $d +020006fc l .text 00000000 $t +020006fe l .text 00000000 $t +0200071c l .text 00000000 $t +02000766 l .text 00000000 $t +0200078c l .text 00000000 $t +020007b4 l .text 00000000 $d +020007b8 l .text 00000000 $t +020007d0 l .text 00000000 $t +020007f4 l .text 00000000 $d 00000000 l df *ABS* 00000000 button_menu.cpp -020007dd l F .text 00000018 key_hit -020007dc l .text 00000000 $t -020007ec l .text 00000000 $d -020007f4 l .text 00000000 $t -02000854 l .text 00000000 $t -02000878 l .text 00000000 $t -0200089c l .text 00000000 $t -02000934 l .text 00000000 $t -02000aa8 l .text 00000000 $d -02000aac l .text 00000000 $t -02000b00 l .text 00000000 $t -02000b82 l .text 00000000 $t -00000000 l df *ABS* 00000000 dex_handler.cpp -02000bb2 l .text 00000000 $t -02000bb4 l .text 00000000 $t +020007f9 l F .text 00000018 key_hit +020007f8 l .text 00000000 $t +02000808 l .text 00000000 $d +02000810 l .text 00000000 $t +02000870 l .text 00000000 $t +02000894 l .text 00000000 $t +020008b8 l .text 00000000 $t +02000950 l .text 00000000 $t +02000ac0 l .text 00000000 $d +02000ac4 l .text 00000000 $t +02000b18 l .text 00000000 $t +02000b9a l .text 00000000 $t +00000000 l df *ABS* 00000000 custom_malloc.cpp +0201df00 l O .ewram 00000100 _ZL11g_alloc_map +02000bcc l .text 00000000 $t 02000be0 l .text 00000000 $d +0201df00 l .ewram 00000000 $d +00000000 l df *ABS* 00000000 dex_handler.cpp 02000be4 l .text 00000000 $t -02000c00 l .text 00000000 $d +02000be8 l .text 00000000 $t +02000c14 l .text 00000000 $d +02000c18 l .text 00000000 $t +02000c34 l .text 00000000 $d 00000000 l df *ABS* 00000000 flash_mem.cpp -02000c04 l .text 00000000 $t -02000c24 l .text 00000000 $t -02000cac l .text 00000000 $d -02000cc8 l .text 00000000 $t -02000d4c l .text 00000000 $d -02000d60 l .text 00000000 $t -02000da8 l .text 00000000 $d -02000db4 l .text 00000000 $t -02000df0 l .text 00000000 $d -030006d4 l .bss 00000000 $d -030006d5 l .bss 00000000 $d -030016d8 l .bss 00000000 $d -030016ec l .bss 00000000 $d -00000000 l df *ABS* 00000000 gameboy_colour.cpp -02000dfc l .text 00000000 $t -02000e2c l .text 00000000 $d -02000e3c l .text 00000000 $t -02000ef0 l .text 00000000 $d -02000f4c l .text 00000000 $t -02000f58 l .text 00000000 $d -02000f5c l .text 00000000 $t +02000c38 l .text 00000000 $t +02000c58 l .text 00000000 $t +02000ce0 l .text 00000000 $d +02000cfc l .text 00000000 $t +02000d80 l .text 00000000 $d +02000d94 l .text 00000000 $t +02000ddc l .text 00000000 $d +02000de8 l .text 00000000 $t +02000e24 l .text 00000000 $d +03000544 l .bss 00000000 $d +03000545 l .bss 00000000 $d +03001548 l .bss 00000000 $d +0300155c l .bss 00000000 $d +00000000 l df *ABS* 00000000 global_frame_controller.cpp +02000e31 l F .text 00000022 obj_set_pos +02000e30 l .text 00000000 $t +02000e54 l .text 00000000 $t +02000e55 l F .text 0000003c _ZL22show_pulled_cart_errorv +02000e88 l .text 00000000 $d +02000e90 l .text 00000000 $t +02000e98 l .text 00000000 $d +02000e9c l .text 00000000 $t +02000f44 l .text 00000000 $d +0201834c l O .rodata 00000060 _ZL4path +02000f64 l .text 00000000 $t 02001090 l .text 00000000 $d -020010b4 l .text 00000000 $t -020010e0 l .text 00000000 $t -020010f8 l .text 00000000 $d +020010b8 l .text 00000000 $t +0200110c l .text 00000000 $d +02001118 l .text 00000000 $t +020011f8 l .text 00000000 $d +0200122c l .text 00000000 $t +02001230 l .text 00000000 $t +02001250 l .text 00000000 $d +0200125c l .text 00000000 $t 02001264 l .text 00000000 $d +02001268 l .text 00000000 $t +02001274 l .text 00000000 $d +02001278 l .text 00000000 $t +02001284 l .text 00000000 $d 02001288 l .text 00000000 $t -020013a0 l .text 00000000 $d +02001298 l .text 00000000 $t +02001310 l .text 00000000 $t +0201834c l .rodata 00000000 $d +03001560 l .bss 00000000 $d +03001561 l .bss 00000000 $d +03001564 l .bss 00000000 $d +03001568 l .bss 00000000 $d +0300156c l .bss 00000000 $d +03001570 l .bss 00000000 $d +03001574 l .bss 00000000 $d +00000000 l df *ABS* 00000000 libstd_replacements.cpp +0200131f l F .text 00000038 _ZL12npf_utoa_revmPcjc +0200131e l .text 00000000 $t +02001356 l .text 00000000 $t +02001357 l F .text 00000018 _ZL11npf_bufputciPv +0200136e l .text 00000000 $t +0200136f l F .text 00000002 _ZL15npf_bufputc_nopiPv +02001370 l .text 00000000 $t +02001371 l F .text 00000018 _ZL12npf_putc_cntiPv +02001388 l .text 00000000 $t +02001434 l .text 00000000 $d +0200144a l .text 00000000 $t +02001464 l .text 00000000 $d +020014d6 l .text 00000000 $d +020014da l .text 00000000 $t +02001518 l .text 00000000 $d +0200151c l .text 00000000 $t +020015a4 l .text 00000000 $t +020015e8 l .text 00000000 $d +020015f0 l .text 00000000 $t +020015f4 l .text 00000000 $t +0200160c l .text 00000000 $t +02001624 l .text 00000000 $d +03001578 l O .bss 00000021 _ZL17conversion_buffer +0200162c l .text 00000000 $t +02001638 l .text 00000000 $t +02001644 l .text 00000000 $t +03001578 l .bss 00000000 $d +0200146b l .text 00000000 $d +0200146c l .text 00000000 $t +00000000 l df *ABS* 00000000 linker_optimizations.cpp +02001650 l .text 00000000 $t +02001670 l .text 00000000 $d +02001674 l .text 00000000 $t +02001675 l F .text 0000001a eatwhite +0200168e l .text 00000000 $t +020016fc l .text 00000000 $t +0200170c l .text 00000000 $d +020183ac l O .rodata 0000000c _ZL7handles +02001710 l .text 00000000 $t +02001714 l .text 00000000 $t +02001764 l .text 00000000 $d +02001778 l .text 00000000 $t +0200181c l .text 00000000 $d +02001830 l .text 00000000 $t +020018d2 l .text 00000000 $t +02001900 l .text 00000000 $t +02001918 l .text 00000000 $d +0200191c l .text 00000000 $t +02001920 l .text 00000000 $t +02001940 l .text 00000000 $d +02001944 l .text 00000000 $t +02001948 l .text 00000000 $t +0200196c l .text 00000000 $d +02001970 l .text 00000000 $t +02001974 l .text 00000000 $t +020019be l .text 00000000 $d +020019d8 l .text 00000000 $t +020019e0 l .text 00000000 $d +020019fe l .text 00000000 $t +02001bec l .text 00000000 $d +02001bfe l .text 00000000 $t +02001c34 l .text 00000000 $d +02001c3c l .text 00000000 $t +02001ce4 l .text 00000000 $t +02001db0 l .text 00000000 $d +02001db4 l .text 00000000 $t +02001db8 l .text 00000000 $t +02001dcc l .text 00000000 $d +030035c0 l .data 00000000 $d +0300159c l .bss 00000000 $d +020183ac l .rodata 00000000 $d +030035dc l O .data 0000000c _ZL14__stdin_handle +030035d0 l O .data 0000000c _ZL15__stdout_handle +030035c4 l O .data 0000000c _ZL15__stderr_handle +030035c4 l .data 00000000 $d +030035d0 l .data 00000000 $d +030035dc l .data 00000000 $d +0200dd9c l .rodata 00000000 $d +00000000 l df *ABS* 00000000 main.cpp +02001dd1 l F .text 00000018 key_hit +02001dd0 l .text 00000000 $t +02001de0 l .text 00000000 $d +02001de8 l .text 00000000 $t +02001de9 l F .text 0000019c _ZL10show_introv +02001f54 l .text 00000000 $d +02001f84 l .text 00000000 $t +02002004 l .text 00000000 $d +02002010 l .text 00000000 $t +02002074 l .text 00000000 $d +02002084 l .text 00000000 $t +02002120 l .text 00000000 $d +0200212c l .text 00000000 $t +020023e0 l .text 00000000 $d +02002444 l .text 00000000 $t +02002530 l .text 00000000 $d +0200254c l .text 00000000 $t +02002608 l .text 00000000 $d +0200260c l .text 00000000 $t +020026d4 l .text 00000000 $d +020026f0 l .text 00000000 $t +020026f1 l F .text 0000002c _GLOBAL__sub_I_delay_counter +02002714 l .text 00000000 $d +0201c9f0 l .init_array 00000000 $d +0200271c l .text 00000000 $t +0200271d l F .text 00000074 _GLOBAL__sub_D_delay_counter +0200278c l .text 00000000 $d +0201ca08 l .fini_array 00000000 $d +030035e8 l .data 00000000 $d +030015e4 l .bss 00000000 $d +03001624 l .bss 00000000 $d +030016c8 l .bss 00000000 $d +030016cc l .bss 00000000 $d +0200ddb0 l .rodata 00000000 $d +00000000 l df *ABS* 00000000 multiboot_upload.cpp +02002791 l F .text 00000022 _ZL22multiboot_show_textboxv +02002790 l .text 00000000 $t +020027b4 l .text 00000000 $t +020027b5 l F .text 000000a8 _ZN12LinkRawCable8transferIZ23multiboot_upload_screenvEUlvE_EENS_8ResponseEtT_b.constprop.0 +02002838 l .text 00000000 $d +0200285c l .text 00000000 $t +0200285d l F .text 00000050 _ZN18LinkCableMultiboot7compareIZ23multiboot_upload_screenvEUlvE_EENS_13PartialResultER14MultiBootParamttT_.isra.0 +020028a4 l .text 00000000 $d +020183b8 l O .rodata 00000003 _ZL31LINK_CABLE_MULTIBOOT_CLIENT_IDS +020028ac l .text 00000000 $t +020028d4 l .text 00000000 $d +020028dc l .text 00000000 $t +02002b7c l .text 00000000 $d +0200ddbc l .rodata 00000000 $d +00000000 l df *ABS* 00000000 mystery_gift_builder.cpp +02002bb0 l .text 00000000 $t +02002c34 l .text 00000000 $d +02002c6c l .text 00000000 $t +02002c70 l .text 00000000 $t +02002c74 l .text 00000000 $t +02002c9c l .text 00000000 $d +02002ca0 l .text 00000000 $t +02002cb8 l .text 00000000 $t +02002d58 l .text 00000000 $d +02002d78 l .text 00000000 $t +02002dac l .text 00000000 $d +02002db0 l .text 00000000 $t +02002ddc l .text 00000000 $d +02002de8 l .text 00000000 $t +02002dfe l .text 00000000 $t +02002e14 l .text 00000000 $t +02002e3c l .text 00000000 $d +02002e44 l .text 00000000 $t +02002e60 l .text 00000000 $t +02002e8c l .text 00000000 $d +02002e98 l .text 00000000 $t +02002eae l .text 00000000 $t +02002ec4 l .text 00000000 $t +02002ef0 l .text 00000000 $d +02002efc l .text 00000000 $t +02002f28 l .text 00000000 $d +02002f34 l .text 00000000 $t +02002f60 l .text 00000000 $d +02002f6c l .text 00000000 $t +02002f98 l .text 00000000 $d +02002fa4 l .text 00000000 $t +02002fc4 l .text 00000000 $d +02002fcc l .text 00000000 $t +02002fec l .text 00000000 $d +02002ff4 l .text 00000000 $t +0200300c l .text 00000000 $t +0200302c l .text 00000000 $d +02003034 l .text 00000000 $t +02003050 l .text 00000000 $d +02003054 l .text 00000000 $t +0200306a l .text 00000000 $t +02003080 l .text 00000000 $t +02003098 l .text 00000000 $t +020030b8 l .text 00000000 $d +020030c0 l .text 00000000 $t +020030f8 l .text 00000000 $d +0200310c l .text 00000000 $t +02003138 l .text 00000000 $d +02003144 l .text 00000000 $t +02003160 l .text 00000000 $d +02003164 l .text 00000000 $t +020031a8 l .text 00000000 $d +020031c0 l .text 00000000 $t +020031e0 l .text 00000000 $d +020031e8 l .text 00000000 $t +02003200 l .text 00000000 $t +0200322c l .text 00000000 $d +02003238 l .text 00000000 $t +02003254 l .text 00000000 $t +020032a8 l .text 00000000 $d +020032ac l .text 00000000 $t +020032d0 l .text 00000000 $d +020032d4 l .text 00000000 $t +020032f0 l .text 00000000 $t +0200331e l .text 00000000 $t +0200334c l .text 00000000 $t +02003384 l .text 00000000 $t +020033ae l .text 00000000 $t +020033dc l .text 00000000 $t +02003424 l .text 00000000 $t +02003824 l .text 00000000 $d +02003894 l .text 00000000 $t +02003c2c l .text 00000000 $d +02003cc8 l .text 00000000 $t +0200404c l .text 00000000 $d +020040b8 l .text 00000000 $t +02004438 l .text 00000000 $d +020044b0 l .text 00000000 $t +02004920 l .text 00000000 $d +02004964 l .text 00000000 $t +02004d7c l .text 00000000 $d +02004dbc l .text 00000000 $t +02005198 l .text 00000000 $d +02005200 l .text 00000000 $t +020055c4 l .text 00000000 $d +02005608 l .text 00000000 $t +02005970 l .text 00000000 $d +02005a08 l .text 00000000 $t +030016d0 l .bss 00000000 $d +030016d4 l .bss 00000000 $d +030016d8 l .bss 00000000 $d +030016dc l .bss 00000000 $d +030016e0 l .bss 00000000 $d +030016e4 l .bss 00000000 $d +030016e8 l .bss 00000000 $d +030016ec l .bss 00000000 $d 030016f0 l .bss 00000000 $d -03001705 l .bss 00000000 $d -03001706 l .bss 00000000 $d -03001707 l .bss 00000000 $d +030016f4 l .bss 00000000 $d +030016f8 l .bss 00000000 $d +030016fc l .bss 00000000 $d +030035ec l .data 00000000 $d +030035f0 l .data 00000000 $d +030035f4 l .data 00000000 $d +030035f8 l .data 00000000 $d +030035fc l .data 00000000 $d +03003600 l .data 00000000 $d +03001700 l .bss 00000000 $d +0200ddc8 l .rodata 00000000 $d +00000000 l df *ABS* 00000000 mystery_gift_injector.cpp +02005a0c l .text 00000000 $t +02005bd0 l .text 00000000 $d +02018509 l O .rodata 0000014e _ZL14em_wonder_card +020183bb l O .rodata 0000014e _ZL16frlg_wonder_card +00000000 l df *ABS* 00000000 pokedex.cpp +02005c01 l F .text 00000024 _ZL27load_text_entry_into_bufferR15text_data_tablePhh +02005c00 l .text 00000000 $t +02005c24 l .text 00000000 $t +02005c9c l .text 00000000 $d +02005cc0 l .text 00000000 $t +02005d00 l .text 00000000 $d +02005d0c l .text 00000000 $t +02005d6c l .text 00000000 $d +02005d88 l .text 00000000 $t +0200608c l .text 00000000 $d +020060ec l .text 00000000 $t +020060ed l F .text 00000030 _GLOBAL__sub_I_dex_array +02006110 l .text 00000000 $d +0201c9f4 l .init_array 00000000 $d +03001701 l .bss 00000000 $d +03001702 l .bss 00000000 $d +03001703 l .bss 00000000 $d +03001704 l .bss 00000000 $d 03001708 l .bss 00000000 $d 0300170c l .bss 00000000 $d 03001710 l .bss 00000000 $d 03001714 l .bss 00000000 $d -03003074 l .data 00000000 $d -03001718 l .bss 00000000 $d -0300171c l .bss 00000000 $d -03001720 l .bss 00000000 $d -03001724 l .bss 00000000 $d -03001728 l .bss 00000000 $d -0300172c l .bss 00000000 $d 03001730 l .bss 00000000 $d -03001734 l .bss 00000000 $d -03001738 l .bss 00000000 $d -0300173c l .bss 00000000 $d -0300173d l .bss 00000000 $d -03003078 l .data 00000000 $d -0300173e l .bss 00000000 $d -02001107 l .text 00000000 $d -02001108 l .text 00000000 $t -00000000 l df *ABS* 00000000 global_frame_controller.cpp -020013d5 l F .text 00000022 obj_set_pos -020013d4 l .text 00000000 $t -020013f8 l .text 00000000 $t -020013f9 l F .text 0000003c _ZL22show_pulled_cart_errorv -0200142c l .text 00000000 $d -02001434 l .text 00000000 $t -0200143c l .text 00000000 $d -02001440 l .text 00000000 $t -02001448 l .text 00000000 $d -0200144c l .text 00000000 $t -02001454 l .text 00000000 $d -02001458 l .text 00000000 $t -02001500 l .text 00000000 $d -02018b14 l O .rodata 00000060 _ZL4path -02001520 l .text 00000000 $t -0200164c l .text 00000000 $d -02001674 l .text 00000000 $t -020016c8 l .text 00000000 $d -020016d4 l .text 00000000 $t -020017b4 l .text 00000000 $d -020017e8 l .text 00000000 $t -020017ec l .text 00000000 $t -0200180c l .text 00000000 $d -02001818 l .text 00000000 $t -02001820 l .text 00000000 $d -02001824 l .text 00000000 $t -02001830 l .text 00000000 $d -02001834 l .text 00000000 $t -02001840 l .text 00000000 $d -02001844 l .text 00000000 $t -02001864 l .text 00000000 $d -0200186c l .text 00000000 $t -0200187c l .text 00000000 $t -020018f4 l .text 00000000 $t -02018b14 l .rodata 00000000 $d -03001743 l .bss 00000000 $d -03001744 l .bss 00000000 $d -03001748 l .bss 00000000 $d 0300174c l .bss 00000000 $d 03001750 l .bss 00000000 $d 03001754 l .bss 00000000 $d +03003604 l .data 00000000 $d 03001758 l .bss 00000000 $d -00000000 l df *ABS* 00000000 interrupt.cpp -02001902 l .text 00000000 $t -0200190e l .text 00000000 $t -0200191a l .text 00000000 $t -00000000 l df *ABS* 00000000 libstd_replacements.cpp -02001927 l F .text 00000038 _ZL12npf_utoa_revmPcjc -02001926 l .text 00000000 $t -0200195e l .text 00000000 $t -0200195f l F .text 00000018 _ZL11npf_bufputciPv -02001976 l .text 00000000 $t -02001977 l F .text 00000002 _ZL15npf_bufputc_nopiPv -02001978 l .text 00000000 $t -02001979 l F .text 00000018 _ZL12npf_putc_cntiPv -02001990 l .text 00000000 $t -02001a3c l .text 00000000 $d -02001a52 l .text 00000000 $t -02001a6c l .text 00000000 $d -02001ade l .text 00000000 $d -02001ae2 l .text 00000000 $t -02001b20 l .text 00000000 $d -02001b24 l .text 00000000 $t -02001bac l .text 00000000 $t -02001bf0 l .text 00000000 $d -02001bf8 l .text 00000000 $t -02001bfc l .text 00000000 $t -02001c14 l .text 00000000 $t -02001c2c l .text 00000000 $d -0300175c l O .bss 00000021 _ZL17conversion_buffer -02001c34 l .text 00000000 $t -02001c40 l .text 00000000 $t -02001c4c l .text 00000000 $t 0300175c l .bss 00000000 $d -02001a73 l .text 00000000 $d -02001a74 l .text 00000000 $t -00000000 l df *ABS* 00000000 linker_optimizations.cpp -02001c58 l .text 00000000 $t -02001c78 l .text 00000000 $d -02001c7c l .text 00000000 $t -02001c7d l F .text 0000001a eatwhite -02001c96 l .text 00000000 $t -02001d04 l .text 00000000 $t -02001d14 l .text 00000000 $d -02018b74 l O .rodata 0000000c _ZL7handles -02001d18 l .text 00000000 $t -02001d1c l .text 00000000 $t -02001d6c l .text 00000000 $d -02001d80 l .text 00000000 $t -02001e24 l .text 00000000 $d -02001e38 l .text 00000000 $t -02001eda l .text 00000000 $t -02001f08 l .text 00000000 $t -02001f20 l .text 00000000 $d -02001f24 l .text 00000000 $t -02001f28 l .text 00000000 $t -02001f48 l .text 00000000 $d -02001f4c l .text 00000000 $t -02001f50 l .text 00000000 $t -02001f74 l .text 00000000 $d -02001f78 l .text 00000000 $t -02001f7c l .text 00000000 $t -02001fc6 l .text 00000000 $d -02001fe0 l .text 00000000 $t -02001fe8 l .text 00000000 $d -02002006 l .text 00000000 $t -020021f4 l .text 00000000 $d -02002206 l .text 00000000 $t -0200223c l .text 00000000 $d -02002244 l .text 00000000 $t -020022ec l .text 00000000 $t -020023b8 l .text 00000000 $d -020023bc l .text 00000000 $t -020023c0 l .text 00000000 $t -020023d4 l .text 00000000 $d -03003080 l .data 00000000 $d -03001780 l .bss 00000000 $d -02018b74 l .rodata 00000000 $d -0300309c l O .data 0000000c _ZL14__stdin_handle -03003090 l O .data 0000000c _ZL15__stdout_handle -03003084 l O .data 0000000c _ZL15__stderr_handle -03003084 l .data 00000000 $d -03003090 l .data 00000000 $d -0300309c l .data 00000000 $d -0200d804 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 main.cpp -020023d9 l F .text 00000018 key_hit -020023d8 l .text 00000000 $t -020023e8 l .text 00000000 $d -020023f0 l .text 00000000 $t -020023f1 l F .text 0000019c _ZL10show_introv -0200255c l .text 00000000 $d -0200258c l .text 00000000 $t -0200260c l .text 00000000 $d -02002618 l .text 00000000 $t -0200267c l .text 00000000 $d -0200268c l .text 00000000 $t -02002728 l .text 00000000 $d -02002734 l .text 00000000 $t -020029e8 l .text 00000000 $d -02002a4c l .text 00000000 $t -02002b38 l .text 00000000 $d -02002b54 l .text 00000000 $t -02002c10 l .text 00000000 $d -02002c14 l .text 00000000 $t -02002cdc l .text 00000000 $d -02002cf8 l .text 00000000 $t -02002cf9 l F .text 0000002c _GLOBAL__sub_I_delay_counter -02002d1c l .text 00000000 $d -0201b784 l .init_array 00000000 $d -02002d24 l .text 00000000 $t -02002d25 l F .text 00000074 _GLOBAL__sub_D_delay_counter -02002d94 l .text 00000000 $d -0201b79c l .fini_array 00000000 $d -030030a8 l .data 00000000 $d -030030ac l .data 00000000 $d -030017c8 l .bss 00000000 $d -03001808 l .bss 00000000 $d -030018ac l .bss 00000000 $d -030018b0 l .bss 00000000 $d -0200d818 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 multiboot_upload.cpp -02002d99 l F .text 00000022 _ZL22multiboot_show_textboxv -02002d98 l .text 00000000 $t -02002dbc l .text 00000000 $t -02002dbd l F .text 000000a8 _ZN12LinkRawCable8transferIZ23multiboot_upload_screenvEUlvE_EENS_8ResponseEtT_b.constprop.0 -02002e40 l .text 00000000 $d -02002e64 l .text 00000000 $t -02002e65 l F .text 00000050 _ZN18LinkCableMultiboot7compareIZ23multiboot_upload_screenvEUlvE_EENS_13PartialResultER14MultiBootParamttT_.isra.0 -02002eac l .text 00000000 $d -02018b80 l O .rodata 00000003 _ZL31LINK_CABLE_MULTIBOOT_CLIENT_IDS -02002eb4 l .text 00000000 $t -02002edc l .text 00000000 $d -02002ee4 l .text 00000000 $t -02003184 l .text 00000000 $d -0200d824 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 mystery_gift_builder.cpp -020031b8 l .text 00000000 $t -0200323c l .text 00000000 $d -02003274 l .text 00000000 $t -02003278 l .text 00000000 $t -0200327c l .text 00000000 $t -020032a4 l .text 00000000 $d -020032a8 l .text 00000000 $t -020032c0 l .text 00000000 $t -02003360 l .text 00000000 $d -02003380 l .text 00000000 $t -020033b4 l .text 00000000 $d -020033b8 l .text 00000000 $t -020033e4 l .text 00000000 $d -020033f0 l .text 00000000 $t -02003406 l .text 00000000 $t -0200341c l .text 00000000 $t -02003444 l .text 00000000 $d -0200344c l .text 00000000 $t -02003468 l .text 00000000 $t -02003494 l .text 00000000 $d -020034a0 l .text 00000000 $t -020034b6 l .text 00000000 $t -020034cc l .text 00000000 $t -020034f8 l .text 00000000 $d -02003504 l .text 00000000 $t -02003530 l .text 00000000 $d -0200353c l .text 00000000 $t -02003568 l .text 00000000 $d -02003574 l .text 00000000 $t -020035a0 l .text 00000000 $d -020035ac l .text 00000000 $t -020035cc l .text 00000000 $d -020035d4 l .text 00000000 $t -020035f4 l .text 00000000 $d -020035fc l .text 00000000 $t -02003614 l .text 00000000 $t -02003634 l .text 00000000 $d -0200363c l .text 00000000 $t -02003658 l .text 00000000 $d -0200365c l .text 00000000 $t -02003672 l .text 00000000 $t -02003688 l .text 00000000 $t -020036a0 l .text 00000000 $t -020036c0 l .text 00000000 $d -020036c8 l .text 00000000 $t -02003700 l .text 00000000 $d -02003714 l .text 00000000 $t -02003740 l .text 00000000 $d -0200374c l .text 00000000 $t -02003768 l .text 00000000 $d -0200376c l .text 00000000 $t -020037b0 l .text 00000000 $d -020037c8 l .text 00000000 $t -020037e8 l .text 00000000 $d -020037f0 l .text 00000000 $t -02003808 l .text 00000000 $t -02003834 l .text 00000000 $d -02003840 l .text 00000000 $t -0200385c l .text 00000000 $t -020038b0 l .text 00000000 $d -020038b4 l .text 00000000 $t -020038d8 l .text 00000000 $d -020038dc l .text 00000000 $t -020038f8 l .text 00000000 $t -02003926 l .text 00000000 $t -02003954 l .text 00000000 $t -0200398c l .text 00000000 $t -020039b6 l .text 00000000 $t -020039e4 l .text 00000000 $t -02003a2c l .text 00000000 $t -02003e2c l .text 00000000 $d -02003ea0 l .text 00000000 $t -02004238 l .text 00000000 $d -020042d4 l .text 00000000 $t -020046d0 l .text 00000000 $d -0200473c l .text 00000000 $t -02004b40 l .text 00000000 $d -02004bc8 l .text 00000000 $t -02004fc8 l .text 00000000 $d -02004ffc l .text 00000000 $t -020053e0 l .text 00000000 $d -0200542c l .text 00000000 $t -020057e4 l .text 00000000 $d -02005848 l .text 00000000 $t -02005bec l .text 00000000 $d -02005c3c l .text 00000000 $t -02005fbc l .text 00000000 $d -02006054 l .text 00000000 $t -030018b4 l .bss 00000000 $d -030018b8 l .bss 00000000 $d -030018bc l .bss 00000000 $d -030018c0 l .bss 00000000 $d -030018c4 l .bss 00000000 $d -030018c8 l .bss 00000000 $d -030018cc l .bss 00000000 $d -030018d0 l .bss 00000000 $d -030018d4 l .bss 00000000 $d -030018d8 l .bss 00000000 $d -030018dc l .bss 00000000 $d -030018e0 l .bss 00000000 $d -030030b0 l .data 00000000 $d -030030b4 l .data 00000000 $d -030030b8 l .data 00000000 $d -030030bc l .data 00000000 $d -030030c0 l .data 00000000 $d -030030c4 l .data 00000000 $d -030018e4 l .bss 00000000 $d -0200d830 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 mystery_gift_injector.cpp -02006058 l .text 00000000 $t -02006220 l .text 00000000 $d -02018cd1 l O .rodata 0000014e _ZL14em_wonder_card -02018b83 l O .rodata 0000014e _ZL16frlg_wonder_card -00000000 l df *ABS* 00000000 payload_file_reader.cpp -02006250 l .text 00000000 $t -02006258 l .text 00000000 $t -02006358 l .text 00000000 $d -00000000 l df *ABS* 00000000 pokedex.cpp -0200635d l F .text 00000024 _ZL27load_text_entry_into_bufferR15text_data_tablePhh -0200635c l .text 00000000 $t -02006380 l .text 00000000 $t -020063f8 l .text 00000000 $d -0200641c l .text 00000000 $t -0200645c l .text 00000000 $d -02006468 l .text 00000000 $t -020064c8 l .text 00000000 $d -020064e4 l .text 00000000 $t -020067e8 l .text 00000000 $d -02006848 l .text 00000000 $t -02006849 l F .text 00000030 _GLOBAL__sub_I_dex_array -0200686c l .text 00000000 $d -0201b788 l .init_array 00000000 $d -030018e5 l .bss 00000000 $d -030018e6 l .bss 00000000 $d -030018e7 l .bss 00000000 $d -030018e8 l .bss 00000000 $d -030018ec l .bss 00000000 $d -030018f0 l .bss 00000000 $d -030018f4 l .bss 00000000 $d -030018f8 l .bss 00000000 $d -03001914 l .bss 00000000 $d -03001930 l .bss 00000000 $d -03001934 l .bss 00000000 $d -03001938 l .bss 00000000 $d -030030c8 l .data 00000000 $d -0300193c l .bss 00000000 $d -03001940 l .bss 00000000 $d -00000000 l df *ABS* 00000000 pokemon.cpp -02006878 l .text 00000000 $t -020068ca l .text 00000000 $t -02006ad0 l .text 00000000 $t -02006b0a l .text 00000000 $t -02006b42 l .text 00000000 $d -02006c20 l .text 00000000 $t -02006c24 l .text 00000000 $t -02006c54 l .text 00000000 $t -02006c82 l .text 00000000 $t -02006d08 l .text 00000000 $t -02006d1c l .text 00000000 $t -02006d28 l .text 00000000 $t -02006d3c l .text 00000000 $t -02006d88 l .text 00000000 $t -02006dac l .text 00000000 $d -02006db8 l .text 00000000 $t -020070a0 l .text 00000000 $d -020070a8 l .text 00000000 $t -020070b8 l .text 00000000 $d -020070c0 l .text 00000000 $t -02007202 l .text 00000000 $d -02007208 l .text 00000000 $t -020073a0 l .text 00000000 $d -020073b8 l .text 00000000 $t -02007770 l .text 00000000 $d -0200777c l .text 00000000 $t -020077de l .text 00000000 $d -02007806 l .text 00000000 $d -02007816 l .text 00000000 $t -02006b59 l .text 00000000 $d -02006b5a l .text 00000000 $t -020077e5 l .text 00000000 $d -020077e6 l .text 00000000 $t -00000000 l df *ABS* 00000000 pokemon_data.cpp -0200795d l F .text 0000001e _ZL10load_tablePhPKhRb -0200795c l .text 00000000 $t -0200797a l .text 00000000 $t -02007988 l .text 00000000 $t -0200799c l .text 00000000 $d -020079a0 l .text 00000000 $t -020079b4 l .text 00000000 $d -020079b8 l .text 00000000 $t -020079cc l .text 00000000 $d -020079d4 l .text 00000000 $t -020079ec l .text 00000000 $d -020079f0 l .text 00000000 $t -02007a04 l .text 00000000 $d -02007a0c l .text 00000000 $t -02007a20 l .text 00000000 $d -02007a28 l .text 00000000 $t -02007a40 l .text 00000000 $d -02007a44 l .text 00000000 $t -02007a64 l .text 00000000 $d -02007a68 l .text 00000000 $t -02007a80 l .text 00000000 $d -02007a84 l .text 00000000 $t -02007ad4 l .text 00000000 $d -02007ae0 l .text 00000000 $t -02007af8 l .text 00000000 $t -02007b40 l .text 00000000 $d -02018e2c l O .rodata 00000015 _ZL28localization_charset_indices -02018e20 l O .rodata 0000000c CSWTCH.17 -02007b4c l .text 00000000 $t -02007b70 l .text 00000000 $d -02007b74 l .text 00000000 $t -02007ba0 l .text 00000000 $d -02007ba4 l .text 00000000 $t -02007bc8 l .text 00000000 $t -02007bd8 l .text 00000000 $d -02018e20 l .rodata 00000000 $d -0201aee0 l .rodata 00000000 $d -0201af20 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 pokemon_party.cpp -02007bdc l .text 00000000 $t -02007bec l .text 00000000 $d -02007bf0 l .text 00000000 $t -02007c28 l .text 00000000 $d -02007c30 l .text 00000000 $t -02007c38 l .text 00000000 $d -02007c3c l .text 00000000 $t -02007cac l .text 00000000 $d -02007cbc l .text 00000000 $t -02007cc8 l .text 00000000 $d -02007ccc l .text 00000000 $t -02007cd8 l .text 00000000 $d -02007cdc l .text 00000000 $t -02007ce4 l .text 00000000 $d -02007ce8 l .text 00000000 $t -02007cf0 l .text 00000000 $t -02007d04 l .text 00000000 $t -02007d0c l .text 00000000 $d -02007d10 l .text 00000000 $t -02007d18 l .text 00000000 $d -02007d1c l .text 00000000 $t -02007d84 l .text 00000000 $d -02007d94 l .text 00000000 $t -02007db0 l .text 00000000 $t -02007e90 l .text 00000000 $d -02007eac l .text 00000000 $t -02007eb8 l .text 00000000 $d -02007ebc l .text 00000000 $t -02007ec8 l .text 00000000 $d -02007ecc l .text 00000000 $t -02007f28 l .text 00000000 $d -02007f3c l .text 00000000 $t -02007f8c l .text 00000000 $d +0200611c l .text 00000000 $t +02006144 l .text 00000000 $d +0200614c l .text 00000000 $t +0200617c l .text 00000000 $d +03003a56 l O .data 00000462 _ZL22gen1_rb_debug_box_data +03003608 l O .data 0000044e _ZL19gen2_debug_box_data +02006190 l .text 00000000 $t +02006194 l .text 00000000 $t +0200619c l .text 00000000 $d +020061a0 l .text 00000000 $t +020061e4 l .text 00000000 $d +020061e8 l .text 00000000 $t +020061ec l .text 00000000 $t +02006240 l .text 00000000 $d +02006244 l .text 00000000 $t +02006248 l .text 00000000 $t +02006250 l .text 00000000 $d +02006254 l .text 00000000 $t +0200625c l .text 00000000 $d +02006260 l .text 00000000 $t +02006270 l .text 00000000 $d +02006274 l .text 00000000 $t +0200627c l .text 00000000 $d +02006280 l .text 00000000 $t +02006288 l .text 00000000 $d +0200628c l .text 00000000 $t +020062f4 l .text 00000000 $d +0200630c l .text 00000000 $t +02006348 l .text 00000000 $d +0200634c l .text 00000000 $t +02006388 l .text 00000000 $d +0200638c l .text 00000000 $t 00000000 l df *ABS* 00000000 random.cpp -02007f94 l .text 00000000 $a -02007f94 l F .text 00000008 _ZL13multiply_highjj -02007f9c l .text 00000000 $t -02007fa4 l .text 00000000 $d -02007fa8 l .text 00000000 $t -02007fb0 l .text 00000000 $d -02007fb4 l .text 00000000 $t -02007fc4 l .text 00000000 $d -02007fd0 l .text 00000000 $t -02007fe4 l .text 00000000 $d -02007fe8 l .text 00000000 $t -02008004 l .text 00000000 $d -030019e8 l .bss 00000000 $d +02006390 l .text 00000000 $a +02006390 l F .text 00000008 _ZL13multiply_highjj +02006398 l .text 00000000 $t +020063a0 l .text 00000000 $d +020063a4 l .text 00000000 $t +020063b4 l .text 00000000 $d +020063c0 l .text 00000000 $t +020063d0 l .text 00000000 $d +020063d4 l .text 00000000 $t +020063f0 l .text 00000000 $d +03001804 l .bss 00000000 $d 00000000 l df *ABS* 00000000 rom_data.cpp -02008008 l .text 00000000 $t -0200800e l .text 00000000 $t -020080f4 l .text 00000000 $t -02008158 l .text 00000000 $d -02008168 l .text 00000000 $t -02008188 l .text 00000000 $d -02008194 l .text 00000000 $t -020081ac l .text 00000000 $d -020081b4 l .text 00000000 $t +020063f4 l .text 00000000 $t +020063fa l .text 00000000 $t +020064e0 l .text 00000000 $t +02006544 l .text 00000000 $d +02006554 l .text 00000000 $t +02006574 l .text 00000000 $d +02006580 l .text 00000000 $t +02006598 l .text 00000000 $d +020065a0 l .text 00000000 $t 00000000 l df *ABS* 00000000 save_data_manager.cpp -020081b8 l .text 00000000 $t -020081e0 l .text 00000000 $d -020081e8 l .text 00000000 $t -0200822c l .text 00000000 $d -02008234 l .text 00000000 $t -02008250 l .text 00000000 $d -02008254 l .text 00000000 $t -02008270 l .text 00000000 $d -02008274 l .text 00000000 $t -0200827c l .text 00000000 $d -02008280 l .text 00000000 $t -02008288 l .text 00000000 $d -0200828c l .text 00000000 $t -02008298 l .text 00000000 $d -0200829c l .text 00000000 $t -030019ee l .bss 00000000 $d +020065a4 l .text 00000000 $t +020065cc l .text 00000000 $d +020065d4 l .text 00000000 $t +02006618 l .text 00000000 $d +02006620 l .text 00000000 $t +0200663c l .text 00000000 $d +02006640 l .text 00000000 $t +0200665c l .text 00000000 $d +02006660 l .text 00000000 $t +02006668 l .text 00000000 $d +0200666c l .text 00000000 $t +02006674 l .text 00000000 $d +02006678 l .text 00000000 $t +02006684 l .text 00000000 $d +02006688 l .text 00000000 $t +0300180a l .bss 00000000 $d 00000000 l df *ABS* 00000000 script_array.cpp -020082c9 l F .text 0000002c _ZL22load_simple_party_datav -020082c8 l .text 00000000 $t -020082e8 l .text 00000000 $d -020082f4 l .text 00000000 $t -0200834c l .text 00000000 $d -02008350 l .text 00000000 $t -020083c8 l .text 00000000 $d -020083cc l .text 00000000 $t -020083de l .text 00000000 $d -02008428 l .text 00000000 $t -0200867c l .text 00000000 $d -020086c4 l .text 00000000 $t -020086c5 l F .text 00000044 _GLOBAL__sub_I_last_error -020086f8 l .text 00000000 $d -0201b78c l .init_array 00000000 $d -02008708 l .text 00000000 $t -02008709 l F .text 00000030 _GLOBAL__sub_D_last_error -02008728 l .text 00000000 $d -0201b7a0 l .fini_array 00000000 $d -0201aff8 l .rodata 00000000 $d -0201b250 l .rodata 00000000 $d -03001a10 l .bss 00000000 $d -03001a1c l .bss 00000000 $d -03001a3c l .bss 00000000 $d -03001a5c l .bss 00000000 $d +020066b4 l .text 00000000 $t +02006704 l .text 00000000 $d +02006708 l .text 00000000 $t +02006780 l .text 00000000 $d +02006784 l .text 00000000 $t +02006792 l .text 00000000 $d +020067dc l .text 00000000 $t +02006a1c l .text 00000000 $d +02006a58 l .text 00000000 $t +02006a59 l F .text 00000044 _GLOBAL__sub_I_last_error +02006a8c l .text 00000000 $d +0201c9f8 l .init_array 00000000 $d +02006a9c l .text 00000000 $t +02006a9d l F .text 00000030 _GLOBAL__sub_D_last_error +02006abc l .text 00000000 $d +0201ca0c l .fini_array 00000000 $d +02018658 l .rodata 00000000 $d +020188b0 l .rodata 00000000 $d +0300182c l .bss 00000000 $d +03001838 l .bss 00000000 $d +03001858 l .bss 00000000 $d +03001878 l .bss 00000000 $d 00000000 l df *ABS* 00000000 script_obj.cpp -02008738 l .text 00000000 $t -0200874c l .text 00000000 $t -0200875e l .text 00000000 $t -02008766 l .text 00000000 $t -0200876e l .text 00000000 $t -02008776 l .text 00000000 $t -0200877e l .text 00000000 $t +02006acc l .text 00000000 $t +02006ae0 l .text 00000000 $t +02006af2 l .text 00000000 $t +02006afa l .text 00000000 $t +02006b02 l .text 00000000 $t +02006b0a l .text 00000000 $t +02006b12 l .text 00000000 $t 00000000 l df *ABS* 00000000 script_var.cpp -02008786 l .text 00000000 $t -02008794 l .text 00000000 $t -020087f4 l .text 00000000 $d +02006b1a l .text 00000000 $t +02006b28 l .text 00000000 $t +02006b88 l .text 00000000 $d +02006b8c l .text 00000000 $t +02006b96 l .text 00000000 $t +02006bdc l .text 00000000 $t +02006be4 l .text 00000000 $t +02006bec l .text 00000000 $t +02006bf4 l .text 00000000 $t +02006bfc l .text 00000000 $t +02006c08 l .text 00000000 $d +02006c0c l .text 00000000 $t +02006c18 l .text 00000000 $d +02006c1c l .text 00000000 $t +02006c32 l .text 00000000 $t +02006c40 l .text 00000000 $t +02006c4c l .text 00000000 $d +02006c50 l .text 00000000 $t +02006c5c l .text 00000000 $d +02006c60 l .text 00000000 $t +02006c74 l .text 00000000 $t +02006c80 l .text 00000000 $t +02006cf4 l .text 00000000 $d +02006cf8 l .text 00000000 $t +02006cfc l .text 00000000 $t +02006d02 l .text 00000000 $t +02006d48 l .text 00000000 $t +02006dcc l .text 00000000 $d +02006dd0 l .text 00000000 $t +02006dd4 l .text 00000000 $t +02006e24 l .text 00000000 $t +02006e58 l .text 00000000 $d +02006e5c l .text 00000000 $t +02006e8c l .text 00000000 $d +02006e90 l .text 00000000 $t +02006ede l .text 00000000 $t +02006ef8 l .text 00000000 $t +02006f08 l .text 00000000 $t +02006f30 l .text 00000000 $t +0200703c l .text 00000000 $d +02007040 l .text 00000000 $t +02007044 l .text 00000000 $t +02018b08 l .rodata 00000000 $d +02018b18 l .rodata 00000000 $d +02018b28 l .rodata 00000000 $d +02018b38 l .rodata 00000000 $d +02018b48 l .rodata 00000000 $d +02018b58 l .rodata 00000000 $d +02018b68 l .rodata 00000000 $d +00000000 l df *ABS* 00000000 select_menu.cpp +020070e9 l F .text 00000014 obj_hide +020070e8 l .text 00000000 $t +020070f8 l .text 00000000 $d +020070fc l .text 00000000 $t +02007138 l .text 00000000 $t +020071ac l .text 00000000 $d +020071c0 l .text 00000000 $t +020071c4 l .text 00000000 $t +020071e6 l .text 00000000 $t +0200723e l .text 00000000 $t +02007258 l .text 00000000 $t +020072b4 l .text 00000000 $d +020072c4 l .text 00000000 $t +020073ec l .text 00000000 $d +00000000 l df *ABS* 00000000 sprite_data.cpp +02007409 l F .text 0000001e obj_set_pos +02007408 l .text 00000000 $t +02007428 l .text 00000000 $t +02007454 l .text 00000000 $d +02007470 l .text 00000000 $t +0200761c l .text 00000000 $d +0200771c l .text 00000000 $t +0200773a l .text 00000000 $d +020077f0 l .text 00000000 $d +02007844 l .text 00000000 $t +0200786c l .text 00000000 $d +02007874 l .text 00000000 $t +020078a0 l .text 00000000 $d +020078bc l .text 00000000 $t +020079b0 l .text 00000000 $d +02018be8 l O .rodata 00000010 _ZL13TILE_SW_U_ARR +02018bb8 l O .rodata 00000010 _ZL13TILE_SW_L_ARR +02018c08 l O .rodata 00000010 _ZL13TILE_SE_U_ARR +02018bd8 l O .rodata 00000010 _ZL13TILE_SE_L_ARR +02018bf8 l O .rodata 00000010 _ZL12TILE_S_U_ARR +02018bc8 l O .rodata 00000010 _ZL12TILE_S_L_ARR +020079e8 l .text 00000000 $t +02007a04 l .text 00000000 $t +02007a30 l .text 00000000 $d +02007a38 l .text 00000000 $t +02007a84 l .text 00000000 $d +02007a8c l .text 00000000 $t +02007b64 l .text 00000000 $d +02007b74 l .text 00000000 $t +02007bb8 l .text 00000000 $d +02007bc0 l .text 00000000 $t +02007d7c l .text 00000000 $d +02007e10 l .text 00000000 $t +02007ea4 l .text 00000000 $d +02007ecc l .text 00000000 $t +02007f52 l .text 00000000 $d +020080d4 l .text 00000000 $d +02018b98 l O .rodata 00000020 CSWTCH.334 +02018b78 l O .rodata 00000020 CSWTCH.335 +020081e4 l .text 00000000 $t +02008202 l .text 00000000 $d +02008206 l .text 00000000 $t +0200825c l .text 00000000 $d +020082a4 l .text 00000000 $t +020082c2 l .text 00000000 $d +02008314 l .text 00000000 $d +02008348 l .text 00000000 $t +02008350 l .text 00000000 $d +02008354 l .text 00000000 $t +020083cc l .text 00000000 $d +020083e4 l .text 00000000 $t +020083e6 l .text 00000000 $t +020083e8 l .text 00000000 $t +020083e9 l F .text 0000038c _GLOBAL__sub_I_obj_buffer +020086e8 l .text 00000000 $d +0201c9fc l .init_array 00000000 $d +02018b78 l .rodata 00000000 $d +02018b98 l .rodata 00000000 $d +03002e0c l .bss 00000000 $d +03002e10 l .bss 00000000 $d +03002e14 l .bss 00000000 $d +03002e18 l .bss 00000000 $d +03002e1c l .bss 00000000 $d +03002e20 l .bss 00000000 $d +03002e24 l .bss 00000000 $d +03002e28 l .bss 00000000 $d +03002e2c l .bss 00000000 $d +03002e30 l .bss 00000000 $d +03002e34 l .bss 00000000 $d +03002e38 l .bss 00000000 $d +03002e3c l .bss 00000000 $d +03002e40 l .bss 00000000 $d +03002eb8 l .bss 00000000 $d +03002ebc l .bss 00000000 $d +03002ec0 l .bss 00000000 $d +03002ec4 l .bss 00000000 $d +03002ec8 l .bss 00000000 $d +03002f00 l .bss 00000000 $d +03002f04 l .bss 00000000 $d +03002f08 l .bss 00000000 $d +03002f0c l .bss 00000000 $d +03002f10 l .bss 00000000 $d +03002f14 l .bss 00000000 $d +03002f18 l .bss 00000000 $d +03002f1c l .bss 00000000 $d +03002f20 l .bss 00000000 $d +03002f24 l .bss 00000000 $d +03002f28 l .bss 00000000 $d +03002f2c l .bss 00000000 $d +03002f30 l .bss 00000000 $d +03002f34 l .bss 00000000 $d +03002f38 l .bss 00000000 $d +03002f3c l .bss 00000000 $d +02018bb8 l .rodata 00000000 $d +02018bc8 l .rodata 00000000 $d +02018bd8 l .rodata 00000000 $d +02018be8 l .rodata 00000000 $d +02018bf8 l .rodata 00000000 $d +02018c08 l .rodata 00000000 $d +03003eb8 l .data 00000000 $d +03002f40 l .bss 00000000 $d +03002f44 l .bss 00000000 $d +03002f48 l .bss 00000000 $d +03002f4c l .bss 00000000 $d +0200773f l .text 00000000 $d +02007740 l .text 00000000 $t +02007f59 l .text 00000000 $d +02007f5a l .text 00000000 $t +020082c7 l .text 00000000 $d +020082c8 l .text 00000000 $t +00000000 l df *ABS* 00000000 text_data_table.cpp +02008774 l .text 00000000 $t +0200877c l .text 00000000 $t +0200879e l .text 00000000 $t +020087a8 l .text 00000000 $t +020087c0 l .text 00000000 $t +00000000 l df *ABS* 00000000 text_engine.cpp +020087f9 l F .text 00000050 _ZL24read_dialogue_text_entryhPh 020087f8 l .text 00000000 $t -02008802 l .text 00000000 $t +02008840 l .text 00000000 $d 02008848 l .text 00000000 $t -02008850 l .text 00000000 $t -02008858 l .text 00000000 $t -02008860 l .text 00000000 $t -02008868 l .text 00000000 $t -02008874 l .text 00000000 $d -02008878 l .text 00000000 $t -02008884 l .text 00000000 $d -02008888 l .text 00000000 $t -0200889e l .text 00000000 $t -020088ac l .text 00000000 $t -020088b8 l .text 00000000 $d -020088bc l .text 00000000 $t -020088c8 l .text 00000000 $d -020088cc l .text 00000000 $t -020088e0 l .text 00000000 $t -020088ec l .text 00000000 $t -02008960 l .text 00000000 $d -02008964 l .text 00000000 $t -02008968 l .text 00000000 $t -0200896e l .text 00000000 $t -020089b4 l .text 00000000 $t -02008a38 l .text 00000000 $d -02008a3c l .text 00000000 $t -02008a40 l .text 00000000 $t -02008a90 l .text 00000000 $t -02008ac4 l .text 00000000 $d -02008ac8 l .text 00000000 $t -02008af8 l .text 00000000 $d -02008afc l .text 00000000 $t -02008b4a l .text 00000000 $t -02008b64 l .text 00000000 $t -02008b74 l .text 00000000 $t -02008b9c l .text 00000000 $t -02008ca8 l .text 00000000 $d +02008888 l .text 00000000 $d +020088a4 l .text 00000000 $t +020088dc l .text 00000000 $t +020088ec l .text 00000000 $d +020088f0 l .text 00000000 $t +020088fc l .text 00000000 $d +02008900 l .text 00000000 $t +02008914 l .text 00000000 $d +02008918 l .text 00000000 $t +0200891c l .text 00000000 $t +02008980 l .text 00000000 $d +02008994 l .text 00000000 $t +02008a44 l .text 00000000 $d +02008a50 l .text 00000000 $t +02008a54 l .text 00000000 $t +02008a64 l .text 00000000 $d +02008a68 l .text 00000000 $t +02008ab0 l .text 00000000 $d +02008ab4 l .text 00000000 $t +02008be4 l .text 00000000 $d +02008c1c l .text 00000000 $t +02008c1d l F .text 00000014 _GLOBAL__sub_I_curr_line +02008c2c l .text 00000000 $d +0201ca00 l .init_array 00000000 $d +0300334c l .bss 00000000 $d +03003350 l .bss 00000000 $d +03003354 l .bss 00000000 $d +03003358 l .bss 00000000 $d +0300335c l .bss 00000000 $d +00000000 l df *ABS* 00000000 translated_text.cpp +02008c30 l .text 00000000 $t +02008c34 l .text 00000000 $d +02008c38 l .text 00000000 $t +02008c3c l .text 00000000 $d +02008c40 l .text 00000000 $t +02008c44 l .text 00000000 $d +02008c48 l .text 00000000 $t +02008c4c l .text 00000000 $d +02008c50 l .text 00000000 $t +02008c54 l .text 00000000 $d +00000000 l df *ABS* 00000000 GBPokemon.cpp +02008c58 l .text 00000000 $t +02008c5c l .text 00000000 $t +02008c60 l .text 00000000 $t +02008c64 l .text 00000000 $t +02008c68 l .text 00000000 $t +02008c6c l .text 00000000 $t +02008c70 l .text 00000000 $t +02008c74 l .text 00000000 $t +02008c78 l .text 00000000 $t +02008c7c l .text 00000000 $t +02008c80 l .text 00000000 $t +02008c84 l .text 00000000 $t +02008c88 l .text 00000000 $t +02008c8c l .text 00000000 $t +02008c90 l .text 00000000 $t +02008c94 l .text 00000000 $t +02008c98 l .text 00000000 $t +02008c9c l .text 00000000 $t +02008ca0 l .text 00000000 $t +02008ca4 l .text 00000000 $t +02008ca8 l .text 00000000 $t 02008cac l .text 00000000 $t 02008cb0 l .text 00000000 $t -0201b4a8 l .rodata 00000000 $d -0201b4b8 l .rodata 00000000 $d -0201b4c8 l .rodata 00000000 $d -0201b4d8 l .rodata 00000000 $d -0201b4e8 l .rodata 00000000 $d -0201b4f8 l .rodata 00000000 $d -0201b508 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 select_menu.cpp -02008d55 l F .text 00000014 obj_hide -02008d54 l .text 00000000 $t +02008cb4 l .text 00000000 $t +02008cb8 l .text 00000000 $t +02008cbc l .text 00000000 $t +02008ccc l .text 00000000 $d +02008cd0 l .text 00000000 $t +02008ce4 l .text 00000000 $d +02008ce8 l .text 00000000 $t +02008cfc l .text 00000000 $t +02008cfd l F .text 00000024 _ZN11Gen3Pokemon5setIVE4Statm.isra.0 +02008d1c l .text 00000000 $d +02008d20 l .text 00000000 $t +02008d21 l F .text 00000024 _ZN11Gen3Pokemon7setMoveEim.isra.0 +02008d40 l .text 00000000 $d +02008d44 l .text 00000000 $t +02008d45 l F .text 00000024 _ZN11Gen3Pokemon10setPPUpNumEim.isra.0 02008d64 l .text 00000000 $d 02008d68 l .text 00000000 $t -02008da4 l .text 00000000 $t -02008e18 l .text 00000000 $d -02008e2c l .text 00000000 $t -02008e30 l .text 00000000 $t -02008e52 l .text 00000000 $t -02008eaa l .text 00000000 $t -02008ec4 l .text 00000000 $t -02008f20 l .text 00000000 $d -02008f30 l .text 00000000 $t -02009058 l .text 00000000 $d -00000000 l df *ABS* 00000000 sprite_data.cpp -02009075 l F .text 0000001e obj_set_pos -02009074 l .text 00000000 $t -02009094 l .text 00000000 $t -020090c0 l .text 00000000 $d -020090dc l .text 00000000 $t -02009288 l .text 00000000 $d -02009388 l .text 00000000 $t -020093a6 l .text 00000000 $d -0200945c l .text 00000000 $d -020094b0 l .text 00000000 $t -020094d8 l .text 00000000 $d -020094e0 l .text 00000000 $t -0200950c l .text 00000000 $d -02009528 l .text 00000000 $t -0200961c l .text 00000000 $d -0201b588 l O .rodata 00000010 _ZL13TILE_SW_U_ARR -0201b558 l O .rodata 00000010 _ZL13TILE_SW_L_ARR -0201b5a8 l O .rodata 00000010 _ZL13TILE_SE_U_ARR -0201b578 l O .rodata 00000010 _ZL13TILE_SE_L_ARR -0201b598 l O .rodata 00000010 _ZL12TILE_S_U_ARR -0201b568 l O .rodata 00000010 _ZL12TILE_S_L_ARR -02009654 l .text 00000000 $t -02009670 l .text 00000000 $t -0200969c l .text 00000000 $d -020096a4 l .text 00000000 $t -020096f0 l .text 00000000 $d -020096f8 l .text 00000000 $t -020097d0 l .text 00000000 $d -020097e0 l .text 00000000 $t -02009824 l .text 00000000 $d -0200982c l .text 00000000 $t -020099e8 l .text 00000000 $d -02009a7c l .text 00000000 $t -02009b10 l .text 00000000 $d -02009b38 l .text 00000000 $t -02009bbe l .text 00000000 $d +02008d69 l F .text 00000020 _ZN11Gen3Pokemon28setFatefulEncounterObedienceEm.isra.0 +02008d84 l .text 00000000 $d +02008d88 l .text 00000000 $t +02008d89 l F .text 00000020 _ZN11Gen3Pokemon19setPokeballCaughtInEm.isra.0 +02008da4 l .text 00000000 $d +02008da8 l .text 00000000 $t +02008da9 l F .text 00000020 _ZN11Gen3Pokemon15setGameOfOriginE4Game.isra.0 +02008dc4 l .text 00000000 $d +02008dc8 l .text 00000000 $t +02008dc9 l F .text 00000020 _ZN11Gen3Pokemon11setLevelMetEm.isra.0 +02008de4 l .text 00000000 $d +02008de8 l .text 00000000 $t +02008de9 l F .text 00000020 _ZN11Gen3Pokemon14setMetLocationEm.isra.0 +02008e04 l .text 00000000 $d +02008e08 l .text 00000000 $t +02008e09 l F .text 00000020 _ZN11Gen3Pokemon12setExpPointsEm.isra.0 +02008e24 l .text 00000000 $d +02008e28 l .text 00000000 $t +02008e29 l F .text 00000020 _ZN11Gen3Pokemon11setHeldItemE4Item.isra.0 +02008e44 l .text 00000000 $d +02008e48 l .text 00000000 $t +02008e49 l F .text 00000020 _ZN11Gen3Pokemon21setSpeciesIndexNumberEm.isra.0 +02008e64 l .text 00000000 $d +02008e68 l .text 00000000 $t +02008e69 l F .text 00000018 _ZN11Gen3Pokemon11setSecretIDEm.isra.0 +02008e7c l .text 00000000 $d +02008e80 l .text 00000000 $t +02008e81 l F .text 00000018 _ZN11Gen3Pokemon12setTrainerIDEm.isra.0 +02008e94 l .text 00000000 $d +02008e98 l .text 00000000 $t +02008eb8 l .text 00000000 $d +02008ec0 l .text 00000000 $t +02008ed8 l .text 00000000 $d +02008edc l .text 00000000 $t +02008ef8 l .text 00000000 $d +02008efc l .text 00000000 $t +02008f18 l .text 00000000 $d +02008f1c l .text 00000000 $t +02008f3c l .text 00000000 $d +02008f40 l .text 00000000 $t +02008f60 l .text 00000000 $d +02008f64 l .text 00000000 $t +02008f88 l .text 00000000 $d +02008f8c l .text 00000000 $t +02008fc8 l .text 00000000 $d +02008fcc l .text 00000000 $t +02009068 l .text 00000000 $d +0200906c l .text 00000000 $t +02009150 l .text 00000000 $d +02009154 l .text 00000000 $t +020091b8 l .text 00000000 $t +020091f0 l .text 00000000 $t +02009206 l .text 00000000 $t +02009244 l .text 00000000 $t +02009284 l .text 00000000 $t +020092e8 l .text 00000000 $d +020092ec l .text 00000000 $t +02009378 l .text 00000000 $t +020093d0 l .text 00000000 $d +020093d4 l .text 00000000 $t +02009420 l .text 00000000 $t +02009498 l .text 00000000 $d +020094a0 l .text 00000000 $t +020094f2 l .text 00000000 $d +020094f8 l .text 00000000 $t +02009558 l .text 00000000 $t +02009644 l .text 00000000 $d +02009664 l .text 00000000 $t +02009668 l .text 00000000 $t +020097f8 l .text 00000000 $d +02009808 l .text 00000000 $t +0200980c l .text 00000000 $t +0200987c l .text 00000000 $d +02009880 l .text 00000000 $t +02009884 l .text 00000000 $t +020098ae l .text 00000000 $t +02009914 l .text 00000000 $t +02009a88 l .text 00000000 $d +02009ab0 l .text 00000000 $t +02009ab4 l .text 00000000 $t +02009b8c l .text 00000000 $d +02009ba0 l .text 00000000 $t +02009ba4 l .text 00000000 $t +02018c18 l .rodata 00000000 $d +03003ebc l .data 00000000 $d +03003ecc l .data 00000000 $d +03003ee0 l .data 00000000 $d +02018c94 l .rodata 00000000 $d +02018cac l .rodata 00000000 $d +02018cc4 l .rodata 00000000 $d +02018cdc l .rodata 00000000 $d +02018cf4 l .rodata 00000000 $d +02018d0c l .rodata 00000000 $d +02018d24 l .rodata 00000000 $d +02018d3c l .rodata 00000000 $d +02018d54 l .rodata 00000000 $d +02018d6c l .rodata 00000000 $d +02018d84 l .rodata 00000000 $d +02018d9c l .rodata 00000000 $d +02018db4 l .rodata 00000000 $d +02018dcc l .rodata 00000000 $d +02018de4 l .rodata 00000000 $d +02018dfc l .rodata 00000000 $d +00000000 l df *ABS* 00000000 Gen1Pokemon.cpp +02009c3c l .text 00000000 $t +02009c40 l .text 00000000 $t +02009c58 l .text 00000000 $d +02009c60 l .text 00000000 $t +02009c74 l .text 00000000 $d +02009c78 l .text 00000000 $t +02009c88 l .text 00000000 $d +02009c8c l .text 00000000 $t +02009c9c l .text 00000000 $d +02009ca0 l .text 00000000 $t +02009cb0 l .text 00000000 $d +02009cb4 l .text 00000000 $t +02009ccc l .text 00000000 $d +02009cd0 l .text 00000000 $t +02009ce4 l .text 00000000 $d +02009ce8 l .text 00000000 $t +02009cfc l .text 00000000 $d +02009d00 l .text 00000000 $t +02009d14 l .text 00000000 $d +02009d18 l .text 00000000 $t +02009d2c l .text 00000000 $t 02009d40 l .text 00000000 $d -0201b538 l O .rodata 00000020 CSWTCH.328 -0201b518 l O .rodata 00000020 CSWTCH.329 -02009e50 l .text 00000000 $t -02009e6e l .text 00000000 $d -02009e72 l .text 00000000 $t -02009ec8 l .text 00000000 $d -02009f10 l .text 00000000 $t -02009f2e l .text 00000000 $d -02009f80 l .text 00000000 $d -02009fb4 l .text 00000000 $t -02009fbc l .text 00000000 $d -02009fc0 l .text 00000000 $t -0200a038 l .text 00000000 $d -0200a050 l .text 00000000 $t -0200a052 l .text 00000000 $t -0200a054 l .text 00000000 $t -0200a055 l F .text 0000038c _GLOBAL__sub_I_obj_buffer -0200a354 l .text 00000000 $d -0201b790 l .init_array 00000000 $d -0201b518 l .rodata 00000000 $d -0201b538 l .rodata 00000000 $d -030024c4 l .bss 00000000 $d -030024c8 l .bss 00000000 $d -030024cc l .bss 00000000 $d -030024d0 l .bss 00000000 $d -030024d4 l .bss 00000000 $d -030024d8 l .bss 00000000 $d -030024dc l .bss 00000000 $d -030024e0 l .bss 00000000 $d -030024e4 l .bss 00000000 $d -030024e8 l .bss 00000000 $d -030024ec l .bss 00000000 $d -030024f0 l .bss 00000000 $d -030024f4 l .bss 00000000 $d -030024f8 l .bss 00000000 $d -03002570 l .bss 00000000 $d -03002574 l .bss 00000000 $d -03002578 l .bss 00000000 $d -0300257c l .bss 00000000 $d -03002580 l .bss 00000000 $d -030025b8 l .bss 00000000 $d -030025bc l .bss 00000000 $d -030025c0 l .bss 00000000 $d -030025c4 l .bss 00000000 $d -030025c8 l .bss 00000000 $d -030025cc l .bss 00000000 $d -030025d0 l .bss 00000000 $d -030025d4 l .bss 00000000 $d -030025d8 l .bss 00000000 $d -030025dc l .bss 00000000 $d -030025e0 l .bss 00000000 $d -030025e4 l .bss 00000000 $d -030025e8 l .bss 00000000 $d -030025ec l .bss 00000000 $d -030025f0 l .bss 00000000 $d -030025f4 l .bss 00000000 $d -0201b558 l .rodata 00000000 $d -0201b568 l .rodata 00000000 $d -0201b578 l .rodata 00000000 $d -0201b588 l .rodata 00000000 $d -0201b598 l .rodata 00000000 $d -0201b5a8 l .rodata 00000000 $d -030030cc l .data 00000000 $d -030025f8 l .bss 00000000 $d -030025fc l .bss 00000000 $d -03002600 l .bss 00000000 $d -03002604 l .bss 00000000 $d -020093ab l .text 00000000 $d -020093ac l .text 00000000 $t -02009bc5 l .text 00000000 $d -02009bc6 l .text 00000000 $t -02009f33 l .text 00000000 $d +02009d44 l .text 00000000 $t +02009d6c l .text 00000000 $d +02018e14 l .rodata 00000000 $d +03003ef0 l .data 00000000 $d +02018e90 l .rodata 00000000 $d +02018e9c l .rodata 00000000 $d +02018ea8 l .rodata 00000000 $d +02018eb4 l .rodata 00000000 $d +02018ec0 l .rodata 00000000 $d +00000000 l df *ABS* 00000000 Gen2Pokemon.cpp +02009d70 l .text 00000000 $t +02009d74 l .text 00000000 $t +02009d88 l .text 00000000 $d +02009d8c l .text 00000000 $t +02009da0 l .text 00000000 $d +02009da4 l .text 00000000 $t +02009db8 l .text 00000000 $d +02009dbc l .text 00000000 $t +02009dd0 l .text 00000000 $d +02009dd4 l .text 00000000 $t +02009de8 l .text 00000000 $d +02009dec l .text 00000000 $t +02009e00 l .text 00000000 $d +02009e04 l .text 00000000 $t +02009e18 l .text 00000000 $d +02009e1c l .text 00000000 $t +02009e30 l .text 00000000 $d +02009e34 l .text 00000000 $t +02009e44 l .text 00000000 $d +02009e48 l .text 00000000 $t +02009e58 l .text 00000000 $d +02009e5c l .text 00000000 $t +02009e6c l .text 00000000 $d +02009e70 l .text 00000000 $t +02009e80 l .text 00000000 $d +02009e84 l .text 00000000 $t +02009e94 l .text 00000000 $d +02009e98 l .text 00000000 $t +02009ea8 l .text 00000000 $d +02009eac l .text 00000000 $t +02009ebc l .text 00000000 $d +02009ec0 l .text 00000000 $t +02009ed0 l .text 00000000 $d +02009ed4 l .text 00000000 $t +02009ee8 l .text 00000000 $t +02009f10 l .text 00000000 $d +02018ecc l .rodata 00000000 $d +02018f48 l .rodata 00000000 $d +02018f54 l .rodata 00000000 $d +02018f60 l .rodata 00000000 $d +02018f6c l .rodata 00000000 $d +02018f78 l .rodata 00000000 $d +02018f84 l .rodata 00000000 $d +02018f90 l .rodata 00000000 $d +02018f9c l .rodata 00000000 $d +00000000 l df *ABS* 00000000 Gen3Pokemon.cpp +02009f14 l .text 00000000 $t +02009f18 l .text 00000000 $t +02009f30 l .text 00000000 $d 02009f34 l .text 00000000 $t -00000000 l df *ABS* 00000000 text_data_table.cpp -0200a3e0 l .text 00000000 $t -0200a3e8 l .text 00000000 $t -0200a40a l .text 00000000 $t -0200a414 l .text 00000000 $t -0200a42c l .text 00000000 $t -00000000 l df *ABS* 00000000 text_engine.cpp -0200a465 l F .text 00000050 _ZL24read_dialogue_text_entryhPh -0200a464 l .text 00000000 $t -0200a4ac l .text 00000000 $d -0200a4b4 l .text 00000000 $t -0200a4f4 l .text 00000000 $d -0200a510 l .text 00000000 $t -0200a548 l .text 00000000 $t -0200a558 l .text 00000000 $d -0200a55c l .text 00000000 $t -0200a568 l .text 00000000 $d -0200a56c l .text 00000000 $t -0200a580 l .text 00000000 $d -0200a584 l .text 00000000 $t -0200a588 l .text 00000000 $t -0200a5ec l .text 00000000 $d -0200a600 l .text 00000000 $t -0200a6b0 l .text 00000000 $d -0200a6bc l .text 00000000 $t -0200a6c0 l .text 00000000 $t -0200a6d0 l .text 00000000 $d -0200a6d4 l .text 00000000 $t -0200a71c l .text 00000000 $d -0200a720 l .text 00000000 $t +02009f48 l .text 00000000 $t +02009f58 l .text 00000000 $d +02009f5c l .text 00000000 $t +02009f5d l F .text 00000058 _ZN11Gen3Pokemon20decryptSubstructuresEv.part.0 +02009fac l .text 00000000 $d +02009f5d l F .text 00000058 _ZN11Gen3Pokemon20encryptSubstructuresEv.part.0 +02009fb4 l .text 00000000 $t +0200a00c l .text 00000000 $d +0200a014 l .text 00000000 $t +0200a024 l .text 00000000 $d +0200a02c l .text 00000000 $t +0200a068 l .text 00000000 $d +0200a06c l .text 00000000 $t +0200a070 l .text 00000000 $t +0200a098 l .text 00000000 $d +0200a09c l .text 00000000 $t +0200a0b2 l .text 00000000 $t +0200a0c8 l .text 00000000 $t +0200a10c l .text 00000000 $d +0200a110 l .text 00000000 $t +0200a182 l .text 00000000 $t +0200a1b8 l .text 00000000 $t +0200a21a l .text 00000000 $t +0200a234 l .text 00000000 $t +0200a27c l .text 00000000 $t +0200a292 l .text 00000000 $t +0200a2dc l .text 00000000 $t +0200a308 l .text 00000000 $d +02018fa8 l .rodata 00000000 $d +03003ef8 l .data 00000000 $d +02018fbc l .rodata 00000000 $d +02018fc8 l .rodata 00000000 $d +02018fd4 l .rodata 00000000 $d +02018fe0 l .rodata 00000000 $d +02018fec l .rodata 00000000 $d +02018ff8 l .rodata 00000000 $d +02019004 l .rodata 00000000 $d +02019010 l .rodata 00000000 $d +0201901c l .rodata 00000000 $d +02019028 l .rodata 00000000 $d +02019034 l .rodata 00000000 $d +02019040 l .rodata 00000000 $d +0201904c l .rodata 00000000 $d +02019058 l .rodata 00000000 $d +02019064 l .rodata 00000000 $d +03003f10 l .data 00000000 $d +03003f20 l .data 00000000 $d +02019070 l .rodata 00000000 $d +0201907c l .rodata 00000000 $d +02019088 l .rodata 00000000 $d +02019094 l .rodata 00000000 $d +020190a0 l .rodata 00000000 $d +020190ac l .rodata 00000000 $d +020190b8 l .rodata 00000000 $d +020190c4 l .rodata 00000000 $d +03003f30 l .data 00000000 $d +020190d0 l .rodata 00000000 $d +020190dc l .rodata 00000000 $d +020190e8 l .rodata 00000000 $d +020190f4 l .rodata 00000000 $d +02019100 l .rodata 00000000 $d +0201910c l .rodata 00000000 $d +02019118 l .rodata 00000000 $d +02019124 l .rodata 00000000 $d +03003f40 l .data 00000000 $d +03003f5c l .data 00000000 $d +02019130 l .rodata 00000000 $d +0201913c l .rodata 00000000 $d +02019148 l .rodata 00000000 $d +02019154 l .rodata 00000000 $d +02019160 l .rodata 00000000 $d +0201916c l .rodata 00000000 $d +02019178 l .rodata 00000000 $d +02019184 l .rodata 00000000 $d +02019190 l .rodata 00000000 $d +0201919c l .rodata 00000000 $d +020191a8 l .rodata 00000000 $d +020191b4 l .rodata 00000000 $d +020191c0 l .rodata 00000000 $d +020191cc l .rodata 00000000 $d +020191d8 l .rodata 00000000 $d +020191e4 l .rodata 00000000 $d +020191f0 l .rodata 00000000 $d +020191fc l .rodata 00000000 $d +02019208 l .rodata 00000000 $d +02019214 l .rodata 00000000 $d +02019220 l .rodata 00000000 $d +0201922c l .rodata 00000000 $d +02019238 l .rodata 00000000 $d +0200e05c l .rodata 00000000 $d +00000000 l df *ABS* 00000000 PokeBox.cpp +0200a30c l .text 00000000 $t +0200a32c l .text 00000000 $t +0200a330 l .text 00000000 $t +0200a350 l .text 00000000 $t +0200a364 l .text 00000000 $t +0200a370 l .text 00000000 $t +0200a384 l .text 00000000 $t +0200a424 l .text 00000000 $t +0200a466 l .text 00000000 $t +0200a48a l .text 00000000 $t +00000000 l df *ABS* 00000000 Pokemon.cpp +0200a490 l .text 00000000 $t +0200a492 l .text 00000000 $t +0200a496 l .text 00000000 $t +0200a4a8 l .text 00000000 $t +0200a4bc l .text 00000000 $t +0200a4cc l .text 00000000 $d +0200a4d0 l .text 00000000 $t +0200a560 l .text 00000000 $t +0200a574 l .text 00000000 $t +0200a652 l .text 00000000 $t +02019244 l .rodata 00000000 $d +00000000 l df *ABS* 00000000 pokemon_data.cpp +0200a66c l .text 00000000 $t +0200a6dc l .text 00000000 $d +0200a708 l .text 00000000 $t +0200a70a l .text 00000000 $t +0200a70c l .text 00000000 $t +0200a718 l .text 00000000 $d +0200a71c l .text 00000000 $t +0200a734 l .text 00000000 $d +0200a738 l .text 00000000 $t +0200a74c l .text 00000000 $d +0200a750 l .text 00000000 $t +0200a7a4 l .text 00000000 $d +0200a7b0 l .text 00000000 $t +0200a7c0 l .text 00000000 $t +0200a814 l .text 00000000 $d +02019258 l O .rodata 00000015 _ZL28localization_charset_indices +02019e6e l O .rodata 00000800 _ZL14gen_1_charsets +0201966e l O .rodata 00000800 _ZL14gen_2_charsets +0201926e l O .rodata 00000400 _ZL14gen_3_charsets +0200a82c l .text 00000000 $t 0200a850 l .text 00000000 $d -0200a888 l .text 00000000 $t -0200a889 l F .text 00000014 _GLOBAL__sub_I_curr_line -0200a898 l .text 00000000 $d -0201b794 l .init_array 00000000 $d -03002a04 l .bss 00000000 $d -03002a08 l .bss 00000000 $d -03002a0c l .bss 00000000 $d -03002a10 l .bss 00000000 $d -03002a14 l .bss 00000000 $d -00000000 l df *ABS* 00000000 translated_text.cpp -0200a89c l .text 00000000 $t -0200a8a0 l .text 00000000 $d -0200a8a4 l .text 00000000 $t -0200a8a8 l .text 00000000 $d -0200a8ac l .text 00000000 $t -0200a8b0 l .text 00000000 $d -0200a8b4 l .text 00000000 $t +0200a854 l .text 00000000 $t +0200a880 l .text 00000000 $d +0200a884 l .text 00000000 $t +0200a8a8 l .text 00000000 $t 0200a8b8 l .text 00000000 $d -0200a8bc l .text 00000000 $t -0200a8c0 l .text 00000000 $d -00000000 l df *ABS* 00000000 -0200a8c5 l F .text 0000003c advance_alloc_map_bit -0200a8c4 l .text 00000000 $t -0200a8f8 l .text 00000000 $d -0201c0ac l O .ewram 00000100 g_alloc_map -0200a900 l .text 00000000 $t -0200a901 l F .text 00000054 check_block_free -0200a950 l .text 00000000 $d -0200a954 l .text 00000000 $t -0200a955 l F .text 0000002a mark_block_allocated -0200a97f l F .text 0000002a mark_block_free -0200a9bc l .text 00000000 $d -0200a9c0 l .text 00000000 $t -0200aa7c l .text 00000000 $d -0200aa8c l .text 00000000 $t -0200aab8 l .text 00000000 $d -0200aac0 l .text 00000000 $t -0200ab7c l .text 00000000 $d -0200ab84 l .text 00000000 $t -0200abf4 l .text 00000000 $d -03002a58 l O .bss 00000400 internal_io -0200ac10 l .text 00000000 $t -0200ac1c l .text 00000000 $d -0200ac20 l .text 00000000 $t -0200ac6c l .text 00000000 $d -0200ac74 l .text 00000000 $t -0200acbc l .text 00000000 $d -0200dab0 l .rodata 00000000 $d -03003058 l .data 00000000 $d -03003058 l O .data 00000004 g_alloc_map_ptr -0300305c l O .data 00000004 g_alloc_map_bit -03002a20 l .bss 00000000 $d -0201c0ac l .ewram 00000000 $d +0201926e l .rodata 00000000 $d +0201966e l .rodata 00000000 $d +02019e6e l .rodata 00000000 $d +0201c70c l .rodata 00000000 $d +0201c74c l .rodata 00000000 $d 00000000 l df *ABS* 00000000 tonc_core.c -0200acc4 l .text 00000000 $t -0200ae58 l .text 00000000 $d -0200ae5c l .text 00000000 $t -03003060 l .data 00000000 $d +0200a8bc l .text 00000000 $t +0200aa50 l .text 00000000 $d +0200aa54 l .text 00000000 $t +030035a8 l .data 00000000 $d 00000000 l df *ABS* 00000000 tonc_input.c -0200aed0 l .text 00000000 $t -0200af1c l .text 00000000 $d -0200af28 l .text 00000000 $t -0200af48 l .text 00000000 $d -0200af4c l .text 00000000 $t -0200af54 l .text 00000000 $d -0200af58 l .text 00000000 $t -0200af64 l .text 00000000 $d -0200af68 l .text 00000000 $t -0200af78 l .text 00000000 $d -03003068 l .data 00000000 $d -03002e58 l .bss 00000000 $d +0200aac8 l .text 00000000 $t +0200ab14 l .text 00000000 $d +0200ab20 l .text 00000000 $t +0200ab40 l .text 00000000 $d +0200ab44 l .text 00000000 $t +0200ab4c l .text 00000000 $d +0200ab50 l .text 00000000 $t +0200ab5c l .text 00000000 $d +0200ab60 l .text 00000000 $t +0200ab70 l .text 00000000 $d +030035b0 l .data 00000000 $d +03003364 l .bss 00000000 $d 00000000 l df *ABS* 00000000 tonc_irq.c -0200af7c l .text 00000000 $t -0200afac l .text 00000000 $d -0200afc0 l .text 00000000 $t -0200afe0 l .text 00000000 $d -0200afec l .text 00000000 $t -0200b0f0 l .text 00000000 $d -0200b100 l .text 00000000 $t -0200b164 l .text 00000000 $d -0200b174 l .text 00000000 $t -0200b20c l .text 00000000 $d -0200b21c l .text 00000000 $t -0200b264 l .text 00000000 $d -0200b270 l .text 00000000 $t -0200b2b8 l .text 00000000 $d -020142ac l .rodata 00000000 $d -020142ac l O .rodata 00000038 __irq_senders -03002e5c l .bss 00000000 $d -0200b2c4 l .text 00000000 $t +0200ab74 l .text 00000000 $t +0200aba4 l .text 00000000 $d +0200abb8 l .text 00000000 $t +0200abd8 l .text 00000000 $d +0200abe4 l .text 00000000 $t +0200ace8 l .text 00000000 $d +0200acf8 l .text 00000000 $t +0200ad5c l .text 00000000 $d +0200ad6c l .text 00000000 $t +0200ae04 l .text 00000000 $d +0200ae14 l .text 00000000 $t +0200ae5c l .text 00000000 $d +0200ae68 l .text 00000000 $t +0200aeb0 l .text 00000000 $d +020151bc l .rodata 00000000 $d +020151bc l O .rodata 00000038 __irq_senders +03003368 l .bss 00000000 $d +0200aebc l .text 00000000 $t 00000000 l df *ABS* 00000000 tonc_oam.c -0200b2c8 l .text 00000000 $t -0200b310 l .text 00000000 $d -0200b314 l .text 00000000 $t -0200b358 l .text 00000000 $d -0200b35c l .text 00000000 $t -0200b380 l .text 00000000 $d -0200b384 l .text 00000000 $t +0200aec0 l .text 00000000 $t +0200af08 l .text 00000000 $d +0200af0c l .text 00000000 $t +0200af50 l .text 00000000 $d +0200af54 l .text 00000000 $t +0200af78 l .text 00000000 $d +0200af7c l .text 00000000 $t 00000000 l df *ABS* 00000000 tonc_schr4c.c -0200b388 l .text 00000000 $t -0200b81c l .text 00000000 $d -0200b820 l .text 00000000 $t +0200af80 l .text 00000000 $t +0200b414 l .text 00000000 $d +0200b418 l .text 00000000 $t +0200b608 l .text 00000000 $d +0200b60c l .text 00000000 $t +00000000 l df *ABS* 00000000 tonc_surface.c +0200b954 l .text 00000000 $t +020151f4 l .rodata 00000000 $d 0200ba10 l .text 00000000 $d 0200ba14 l .text 00000000 $t -00000000 l df *ABS* 00000000 tonc_surface.c -0200bd5c l .text 00000000 $t -020142e4 l .rodata 00000000 $d -0200be18 l .text 00000000 $d -0200be1c l .text 00000000 $t 00000000 l df *ABS* 00000000 chr4c_drawg_b1cts.c -0200beb0 l .text 00000000 $t -0200bff8 l .text 00000000 $d +0200baa8 l .text 00000000 $t +0200bbf0 l .text 00000000 $d 00000000 l df *ABS* 00000000 tte_iohook.c -0200c004 l .text 00000000 $t -0200c070 l .text 00000000 $d -0200c078 l .text 00000000 $t -0200c0b0 l .text 00000000 $d -0201b5b8 l .rodata 00000000 $d -0200c0c0 l .text 00000000 $t -02014300 l .rodata 00000000 $d -0200c200 l .text 00000000 $d -0200c21c l .text 00000000 $t -0200c360 l .text 00000000 $d -03002ed4 l .bss 00000000 $d -03002ed4 l O .bss 00000004 sConInitialized -0200c368 l .text 00000000 $t +0200bbfc l .text 00000000 $t +0200bc68 l .text 00000000 $d +0200bc70 l .text 00000000 $t +0200bca8 l .text 00000000 $d +0201c824 l .rodata 00000000 $d +0200bcb8 l .text 00000000 $t +02015210 l .rodata 00000000 $d +0200bdf8 l .text 00000000 $d +0200be14 l .text 00000000 $t +0200bf58 l .text 00000000 $d +030033e0 l .bss 00000000 $d +030033e0 l O .bss 00000004 sConInitialized +0200bf60 l .text 00000000 $t 00000000 l df *ABS* 00000000 tonc_bios_ex.s -0200c36c l .text 00000000 $t +0200bf64 l .text 00000000 $t 00000000 l df *ABS* 00000000 tonc_bios.o -0200c3c0 l .text 00000000 $t +0200bfb8 l .text 00000000 $t 00000000 l df *ABS* 00000000 tonc_memcpy.s -0300061c l .iwram 00000000 $a -0200c44c l .text 00000000 $t -0200c48a l .text 00000000 $d -0200c48c l .text 00000000 $d +03000488 l .iwram 00000000 $a +0200c044 l .text 00000000 $t +0200c082 l .text 00000000 $d +0200c084 l .text 00000000 $d 00000000 l df *ABS* 00000000 libc_a-strchr.o -0200c490 l .text 00000000 $t -0200c544 l .text 00000000 $d +0200c088 l .text 00000000 $t +0200c13c l .text 00000000 $d 00000000 l df *ABS* 00000000 libc_a-memmove.o -0200c54c l .text 00000000 $t +0200c144 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-strlen.o -0200c618 l .text 00000000 $t -0200c670 l .text 00000000 $d +0200c210 l .text 00000000 $t +0200c268 l .text 00000000 $d 00000000 l df *ABS* 00000000 libc_a-init.o -0200c678 l .text 00000000 $t -0200c6b8 l .text 00000000 $d -0200c6c8 l .text 00000000 $t +0200c270 l .text 00000000 $t +0200c2b0 l .text 00000000 $d +0200c2c0 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-strtol.o -0200c6cd l F .text 0000025c _strtol_l.part.0 -0200c6cc l .text 00000000 $t -0200c918 l .text 00000000 $d -0200c928 l .text 00000000 $t +0200c2c5 l F .text 0000025c _strtol_l.part.0 +0200c2c4 l .text 00000000 $t +0200c510 l .text 00000000 $d +0200c520 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-isspace.o -0200c960 l .text 00000000 $t -0200c96c l .text 00000000 $d +0200c558 l .text 00000000 $t +0200c564 l .text 00000000 $d +00000000 l df *ABS* 00000000 libc_a-malloc.o +0200c568 l .text 00000000 $t +0200c590 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-memset.o -0200c970 l .text 00000000 $t +0200c5a4 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-setvbuf.o -0200c9fc l .text 00000000 $t -0200cba4 l .text 00000000 $d +0200c630 l .text 00000000 $t +0200c7d8 l .text 00000000 $d 00000000 l df *ABS* 00000000 libc_a-strncpy.o -0200cba8 l .text 00000000 $t -0200cc08 l .text 00000000 $d +0200c7dc l .text 00000000 $t +0200c83c l .text 00000000 $d 00000000 l df *ABS* 00000000 libc_a-memcpy-stub.o -0200cc10 l .text 00000000 $t +0200c844 l .text 00000000 $t +00000000 l df *ABS* 00000000 libc_a-malignr.o +0200c8f4 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-findfp.o -0200ccc1 l F .text 00000020 stdio_exit_handler -0200ccc0 l .text 00000000 $t -0200ccd4 l .text 00000000 $d -0200cce0 l .text 00000000 $t -0200cce1 l F .text 00000040 cleanup_stdio -0200cd14 l .text 00000000 $d -0200cd20 l .text 00000000 $t -0200cd21 l F .text 00000120 global_stdio_init.part.0 -0200ce1c l .text 00000000 $d -03002ed8 l O .bss 0000000c __sfp_recursive_mutex -0200ce40 l .text 00000000 $t -0200ce70 l .text 00000000 $d -0200ce7c l .text 00000000 $t -0200ce8c l .text 00000000 $d -0200ce90 l .text 00000000 $t -0200cea0 l .text 00000000 $d -03002ed8 l .bss 00000000 $d -030030d0 l .data 00000000 $d -03002ee8 l .bss 00000000 $d -03003050 l .bss 00000000 $d +0200ca0d l F .text 00000020 stdio_exit_handler +0200ca0c l .text 00000000 $t +0200ca20 l .text 00000000 $d +0200ca2c l .text 00000000 $t +0200ca2d l F .text 00000040 cleanup_stdio +0200ca60 l .text 00000000 $d +0200ca6c l .text 00000000 $t +0200ca6d l F .text 00000120 global_stdio_init.part.0 +0200cb68 l .text 00000000 $d +030033e4 l O .bss 0000000c __sfp_recursive_mutex +0200cb8c l .text 00000000 $t +0200cbbc l .text 00000000 $d +0200cbc8 l .text 00000000 $t +0200cbd8 l .text 00000000 $d +0200cbdc l .text 00000000 $t +0200cbec l .text 00000000 $d +030033e4 l .bss 00000000 $d +03003f84 l .data 00000000 $d +030033f0 l .bss 00000000 $d +03003558 l .bss 00000000 $d 00000000 l df *ABS* 00000000 libc_a-fwalk.o -0200cea4 l .text 00000000 $t +0200cbf0 l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-errno.o -0200cef0 l .text 00000000 $t +0200cc3c l .text 00000000 $t +00000000 l df *ABS* 00000000 libc_a-mallocr.o +0200cc48 l .text 00000000 $t +0200cf98 l .text 00000000 $d +0200cfb8 l .text 00000000 $t +0200d190 l .text 00000000 $d +0300355c l .bss 00000000 $d +03003584 l .bss 00000000 $d +03003588 l .bss 00000000 $d +03003f90 l .data 00000000 $d +0300358c l .bss 00000000 $d +03003f94 l .data 00000000 $d +03003f98 l .data 00000000 $d +00000000 l df *ABS* 00000000 libc_a-freer.o +0200d198 l .text 00000000 $t +0200d234 l .text 00000000 $d +0200d244 l .text 00000000 $t +0200d408 l .text 00000000 $d 00000000 l df *ABS* 00000000 libc_a-fflush.o -0200cefc l .text 00000000 $t -0200d070 l .text 00000000 $d -0200d078 l .text 00000000 $t -0200d07c l .text 00000000 $t +0200d41c l .text 00000000 $t +0200d590 l .text 00000000 $d +0200d598 l .text 00000000 $t +0200d59c l .text 00000000 $t 00000000 l df *ABS* 00000000 libc_a-makebuf.o -0200d0ec l .text 00000000 $t -0200d144 l .text 00000000 $d -00000000 l df *ABS* 00000000 libc_a-stdio.o -0200d148 l .text 00000000 $t -0200d178 l .text 00000000 $d -0200d17c l .text 00000000 $t -0200d1c4 l .text 00000000 $d -0200d1c8 l .text 00000000 $t -0200d200 l .text 00000000 $d -0200d204 l .text 00000000 $t -00000000 l df *ABS* 00000000 libc_a-fclose.o -0200d214 l .text 00000000 $t -00000000 l df *ABS* 00000000 _thumb1_case_sqi.o -0200d2f0 l .text 00000000 $t -00000000 l df *ABS* 00000000 _thumb1_case_uqi.o -0200d304 l .text 00000000 $t -00000000 l df *ABS* 00000000 _thumb1_case_shi.o -0200d318 l .text 00000000 $t -00000000 l df *ABS* 00000000 _thumb1_case_uhi.o -0200d32c l .text 00000000 $t -00000000 l df *ABS* 00000000 _udivsi3.o -0200d340 l .text 00000000 $a -0200d340 l .text 00000000 .udivsi3_skip_div0_test -0200d43c l .text 00000000 $a -00000000 l df *ABS* 00000000 _divsi3.o -0200d45c l .text 00000000 $a -0200d464 l .text 00000000 .divsi3_skip_div0_test -0200d58c l .text 00000000 $a -00000000 l df *ABS* 00000000 _dvmd_tls.o -0200d5ac l .text 00000000 $t -00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-fstat.o -0200d5b0 l .text 00000000 $t -0200d604 l .text 00000000 $d -0200d608 l .text 00000000 $t -00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-getreent.o 0200d60c l .text 00000000 $t -0200d624 l .text 00000000 $d -00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-iosupport.o -0200d62d l F .text 00000004 null_write -0200d62c l .text 00000000 $t -0201b5f4 l .rodata 00000000 $d -03003220 l .data 00000000 $d -0201b700 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-lseek.o -0200d630 l .text 00000000 $t +0200d664 l .text 00000000 $d +00000000 l df *ABS* 00000000 libc_a-mlock.o +0200d668 l .text 00000000 $t +0200d678 l .text 00000000 $d +03003590 l O .bss 0000000c __malloc_recursive_mutex +0200d67c l .text 00000000 $t 0200d68c l .text 00000000 $d +03003590 l .bss 00000000 $d +00000000 l df *ABS* 00000000 libc_a-stdio.o 0200d690 l .text 00000000 $t +0200d6c0 l .text 00000000 $d +0200d6c4 l .text 00000000 $t +0200d70c l .text 00000000 $d +0200d710 l .text 00000000 $t +0200d748 l .text 00000000 $d +0200d74c l .text 00000000 $t +00000000 l df *ABS* 00000000 libc_a-fclose.o +0200d75c l .text 00000000 $t +00000000 l df *ABS* 00000000 _thumb1_case_sqi.o +0200d838 l .text 00000000 $t +00000000 l df *ABS* 00000000 _thumb1_case_uqi.o +0200d84c l .text 00000000 $t +00000000 l df *ABS* 00000000 _thumb1_case_shi.o +0200d860 l .text 00000000 $t +00000000 l df *ABS* 00000000 _thumb1_case_uhi.o +0200d874 l .text 00000000 $t +00000000 l df *ABS* 00000000 _udivsi3.o +0200d888 l .text 00000000 $a +0200d888 l .text 00000000 .udivsi3_skip_div0_test +0200d984 l .text 00000000 $a +00000000 l df *ABS* 00000000 _divsi3.o +0200d9a4 l .text 00000000 $a +0200d9ac l .text 00000000 .divsi3_skip_div0_test +0200dad4 l .text 00000000 $a +00000000 l df *ABS* 00000000 _dvmd_tls.o +0200daf4 l .text 00000000 $t +00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-fstat.o +0200daf8 l .text 00000000 $t +0200db4c l .text 00000000 $d +0200db50 l .text 00000000 $t +00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-getreent.o +0200db54 l .text 00000000 $t +0200db6c l .text 00000000 $d +00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-iosupport.o +0200db75 l F .text 00000004 null_write +0200db74 l .text 00000000 $t +0201c860 l .rodata 00000000 $d +030044e8 l .data 00000000 $d +0201c96c l .rodata 00000000 $d +00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-lseek.o +0200db78 l .text 00000000 $t +0200dbd4 l .text 00000000 $d +0200dbd8 l .text 00000000 $t 00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-read.o -0200d694 l .text 00000000 $t -0200d6e8 l .text 00000000 $d -0200d6ec l .text 00000000 $t +0200dbdc l .text 00000000 $t +0200dc30 l .text 00000000 $d +0200dc34 l .text 00000000 $t +00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-sbrk.o +0200dc38 l .text 00000000 $t +0200dc78 l .text 00000000 $d +030035a4 l O .bss 00000004 heap_start.0 +030035a4 l .bss 00000000 $d 00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-syscall_support.o -0200d6f0 l .text 00000000 $t -0200d704 l .text 00000000 $d -0200d708 l .text 00000000 $t -0200d71c l .text 00000000 $d +0200dc88 l .text 00000000 $t +0200dc9c l .text 00000000 $d +0200dca0 l .text 00000000 $t +0200dcb4 l .text 00000000 $d 00000000 l df *ABS* 00000000 libsysbase_libsysbase_a-write.o -0200d720 l .text 00000000 $t -0200d774 l .text 00000000 $d -0200d778 l .text 00000000 $t +0200dcb8 l .text 00000000 $t +0200dd0c l .text 00000000 $d +0200dd10 l .text 00000000 $t +00000000 l df *ABS* 00000000 +0200e9d8 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 latin_short.o -02013294 l .rodata 00000000 $d +020141a4 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 CREDITS_english_lz10.bin.o -020144d4 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 EVENT_PKMN_lz10.bin.o -020149cc l .rodata 00000000 $d -00000000 l df *ABS* 00000000 EXP_GROUPS_lz10.bin.o -02014ab8 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 FIRST_MOVES_lz10.bin.o -02014b18 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 gb_gen1_payloads_RB_lz10.bin.o -02014c08 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 gb_gen1_payloads_Y_lz10.bin.o -02014ddc l .rodata 00000000 $d -00000000 l df *ABS* 00000000 gb_gen2_payloads_lz10.bin.o -02014f74 l .rodata 00000000 $d +020153e4 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 gb_rom_values_eng_lz10.bin.o -02015198 l .rodata 00000000 $d +020158dc l .rodata 00000000 $d 00000000 l df *ABS* 00000000 gb_rom_values_fre_lz10.bin.o -0201533c l .rodata 00000000 $d +02015a88 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 gba_rom_values_eng_lz10.bin.o -020154e0 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 gen_1_charsets_lz10.bin.o -02015824 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 gen_2_charsets_lz10.bin.o -02015bb8 l .rodata 00000000 $d +02015c2c l .rodata 00000000 $d 00000000 l df *ABS* 00000000 gen_3_charsets_lz10.bin.o -02015f68 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 GENDER_RATIO_lz10.bin.o -0201628c l .rodata 00000000 $d +02015f70 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 GENERAL_english_lz10.bin.o -020162ec l .rodata 00000000 $d -00000000 l df *ABS* 00000000 JPN_NAMES_lz10.bin.o -02016780 l .rodata 00000000 $d -00000000 l df *ABS* 00000000 NUM_ABILITIES_lz10.bin.o -02016dac l .rodata 00000000 $d +02016294 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 PKMN_NAMES_english_lz10.bin.o -02016dec l .rodata 00000000 $d -00000000 l df *ABS* 00000000 POWER_POINTS_lz10.bin.o -020176e0 l .rodata 00000000 $d +020167a0 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 PTGB_english_lz10.bin.o -020177c0 l .rodata 00000000 $d +02017094 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 RSEFRLG_english_lz10.bin.o -020183ac l .rodata 00000000 $d +02017c80 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 TYPES_lz10.bin.o -02018834 l .rodata 00000000 $d +02018108 l .rodata 00000000 $d +00000000 l df *ABS* 00000000 gameboy_colour.cpp +030035bc l .data 00000000 $d 00000000 l df *ABS* 00000000 libc_a-ctype_.o -0201b5fc l .rodata 00000000 $d +0201c868 l .rodata 00000000 $d 00000000 l df *ABS* 00000000 crtstuff.c -0201b7a4 l .eh_frame 00000000 $d -0201b7a4 l O .eh_frame 00000000 __FRAME_END__ +0201ca10 l .eh_frame 00000000 $d +0201ca10 l O .eh_frame 00000000 __FRAME_END__ 00000000 l df *ABS* 00000000 delays.cpp 03000000 l .iwram 00000000 $t -03000004 l .iwram 00000000 L18 -03000022 l .iwram 00000000 L132 -0300002c l .iwram 00000000 L232 +03000004 l .iwram 00000000 L114 +03000022 l .iwram 00000000 L158 +0300002c l .iwram 00000000 L258 00000000 l df *ABS* 00000000 save.cpp 03000035 l F .iwram 0000003c _ZL10bank_checkj 03000034 l .iwram 00000000 $t @@ -1225,889 +1460,2099 @@ SYMBOL TABLE: 0300032c l .iwram 00000000 $d 03000330 l .iwram 00000000 $t 030003e0 l .iwram 00000000 $d -030019ec l .bss 00000000 $d -030019ed l .bss 00000000 $d -00000000 l df *ABS* 00000000 irq_handler.o -04000000 l *ABS* 00000000 MEM_IO_ADDR -00000200 l *ABS* 00000000 OFFSET_IE -00000202 l *ABS* 00000000 OFFSET_IF -00000208 l *ABS* 00000000 OFFSET_IME -030003e4 l .iwram 00000000 $a -030004f0 l .iwram 00000000 interrupt_found -00000012 l *ABS* 00000000 MODE_IRQ -0000001f l *ABS* 00000000 MODE_SYSTEM -0000001f l *ABS* 00000000 MODE_MASK -00000080 l *ABS* 00000000 FLAG_IRQ_DISABLE -03000574 l .iwram 00000000 $d +03001808 l .bss 00000000 $d +03001809 l .bss 00000000 $d 00000000 l df *ABS* 00000000 tonc_isr_master.s -03000578 l .iwram 00000000 $a -03000618 l .iwram 00000000 $d +030003e4 l .iwram 00000000 $a +03000484 l .iwram 00000000 $d 00000000 l df *ABS* 00000000 tonc_memset.s -03000654 l .iwram 00000000 $a +030004c0 l .iwram 00000000 $a 00000000 l df *ABS* 00000000 libc_a-impure.o -030030dc l .data 00000000 $d -030030e0 l .data 00000000 $d +030043a0 l .data 00000000 $d +030043a8 l .data 00000000 $d 00000000 l df *ABS* 00000000 tonc_nocash.o -0201c1ac l .ewram 00000000 $t -0201c1b0 l .ewram 00000000 $d -0201c206 l .ewram 00000000 $t -03003070 l .data 00000000 $d -02018988 l .rodata 00000000 $d -0300307c l .data 00000000 $d -02018b80 l .rodata 00000000 $d -02018b83 l .rodata 00000000 $d -02018cd1 l .rodata 00000000 $d -02018e2c l .rodata 00000000 $d -02018e41 l .rodata 00000000 $d -0201ade1 l .rodata 00000000 $d -0201af38 l .rodata 00000000 $d -0200d781 l F .text 00000008 ____aeabi_uidivmod_from_thumb -0200d780 l .text 00000000 $t -0200d784 l .text 00000000 $a -0200d788 l F .text 0000000c ____aeabi_idiv0_from_arm -0200d788 l .text 00000000 $a -0200d790 l .text 00000000 $d -0200d795 l F .text 00000010 ___Z16copy_ram_to_savePhjj_veneer -0200d794 l .text 00000000 $t -0200d798 l .text 00000000 $a -0200d7a0 l .text 00000000 $d -0200d7a5 l F .text 00000010 ___Z12erase_sectorj_veneer -0200d7a4 l .text 00000000 $t -0200d7a8 l .text 00000000 $a -0200d7b0 l .text 00000000 $d -0200d7b5 l F .text 00000008 ____aeabi_idiv_from_thumb -0200d7b4 l .text 00000000 $t -0200d7b8 l .text 00000000 $a -0200d7bd l F .text 00000010 ___Z9init_bankv_veneer -0200d7bc l .text 00000000 $t -0200d7c0 l .text 00000000 $a -0200d7c8 l .text 00000000 $d -0200d7cd l F .text 00000008 ____aeabi_idivmod_from_thumb -0200d7cc l .text 00000000 $t -0200d7d0 l .text 00000000 $a -0200d7d5 l F .text 00000008 ____aeabi_uidiv_from_thumb -0200d7d4 l .text 00000000 $t -0200d7d8 l .text 00000000 $a -0200d7dd l F .text 00000008 ___ZL13multiply_highjj_from_thumb -0200d7dc l .text 00000000 $t -0200d7e0 l .text 00000000 $a -0200d7e5 l F .text 00000010 ___Z16copy_save_to_ramjPhj_veneer -0200d7e4 l .text 00000000 $t -0200d7e8 l .text 00000000 $a -0200d7f0 l .text 00000000 $d -030006a1 l F .iwram 0000000c ____aeabi_uidiv_from_thumb -030006a0 l .iwram 00000000 $t -030006a4 l .iwram 00000000 $a -030006a8 l .iwram 00000000 $d -02016dec g .rodata 00000000 NUM_ABILITIES_lz10_bin_end -02009529 g F .text 0000012c _Z12add_menu_boxiiii -03000578 g F .iwram 000000a0 isr_master +0201e000 l .ewram 00000000 $t +0201e004 l .ewram 00000000 $d +0201e05a l .ewram 00000000 $t +00000000 l df *ABS* 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +0005bee3 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +0005c0b2 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +0005c174 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +0005c1c6 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +0005c260 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +0005c2da l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +0005c376 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +0005c3f0 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +0005c46a l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +0005c4e4 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +0005c55e l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +0005c5d8 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +0005c672 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +0005c6ec l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +0005c788 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +0005c802 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +0005c87c l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +0005c8f6 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +0005c970 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +0005c9ea l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +0005ca64 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +0005cade l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +0005cb58 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +0005cbd2 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +0005cc4c l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +0005ccc6 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +0005cd40 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +0005cdba l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +0005ce34 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +0005ceae l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +0005cf28 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +0005cfa2 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +0005d01c l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +0005d096 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +0005d110 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +0005d18a l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +0005d204 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +0005d27e l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +0005d2f8 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +0005d372 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +0005d3ec l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +0005d486 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +0005d520 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +0005d59a l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +0005d614 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +0005d68e l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +0005d708 l .debug_info 00000000 +00000000 l df *ABS* 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +0005d7a2 l .debug_info 00000000 +030035b8 l .data 00000000 $d +0201825c l .rodata 00000000 $d +020183b8 l .rodata 00000000 $d +020183bb l .rodata 00000000 $d +02018509 l .rodata 00000000 $d +03003608 l .data 00000000 $d +03003a56 l .data 00000000 $d +0200e045 l .rodata 00000000 $d +02019258 l .rodata 00000000 $d +0201a66e l .rodata 00000000 $d +0201c60e l .rodata 00000000 $d +0201c764 l .rodata 00000000 $d +0200e06c l .rodata 00000000 $d +0200dd19 l F .text 00000008 ___ZL13multiply_highjj_from_thumb +0200dd18 l .text 00000000 $t +0200dd1c l .text 00000000 $a +0200dd21 l F .text 00000008 ____aeabi_uidivmod_from_thumb +0200dd20 l .text 00000000 $t +0200dd24 l .text 00000000 $a +0200dd28 l F .text 0000000c ____aeabi_idiv0_from_arm +0200dd28 l .text 00000000 $a +0200dd30 l .text 00000000 $d +0200dd35 l F .text 00000008 ____aeabi_uidiv_from_thumb +0200dd34 l .text 00000000 $t +0200dd38 l .text 00000000 $a +0200dd3d l F .text 00000010 ___Z16copy_save_to_ramjPhj_veneer +0200dd3c l .text 00000000 $t +0200dd40 l .text 00000000 $a +0200dd48 l .text 00000000 $d +0200dd4d l F .text 00000010 ___Z12erase_sectorj_veneer +0200dd4c l .text 00000000 $t +0200dd50 l .text 00000000 $a +0200dd58 l .text 00000000 $d +0200dd5d l F .text 00000010 ___Z9init_bankv_veneer +0200dd5c l .text 00000000 $t +0200dd60 l .text 00000000 $a +0200dd68 l .text 00000000 $d +0200dd6d l F .text 00000008 ____aeabi_idivmod_from_thumb +0200dd6c l .text 00000000 $t +0200dd70 l .text 00000000 $a +0200dd75 l F .text 00000010 ___Z16copy_ram_to_savePhjj_veneer +0200dd74 l .text 00000000 $t +0200dd78 l .text 00000000 $a +0200dd80 l .text 00000000 $d +0200dd85 l F .text 00000008 ____aeabi_idiv_from_thumb +0200dd84 l .text 00000000 $t +0200dd88 l .text 00000000 $a +03000511 l F .iwram 0000000c ____aeabi_uidiv_from_thumb +03000510 l .iwram 00000000 $t +03000514 l .iwram 00000000 $a +03000518 l .iwram 00000000 $d +020078bd g F .text 0000012c _Z12add_menu_boxiiii +03003ee0 g O .data 00000010 _ZN9GBPokemon5movesE +030003e4 g F .iwram 000000a0 isr_master 03000001 g F .iwram 0000000a _Z12delay_cyclesm -0200b4bd g F .text 00000046 schr4c_vline -0200e338 g O .rodata 00000214 .hidden boxBGMap -0200c401 g F .text 00000004 BitUnPack -02001d19 g F .text 00000004 __wrap__close_r -03001750 g O .bss 00000004 curr_link_animation_state -020034cd g F .text 00000038 _ZN19mystery_gift_script6setvarEtt -020031b9 g F .text 000000bc _ZN19mystery_gift_scriptC1EPh -0200c3e9 g F .text 00000004 ArcTan2 -02000355 g F .text 0000038c _ZN8Box_Menu8box_mainE13Pokemon_Party -02013294 g .rodata 00000000 latin_shortFont -02011108 g O .rodata 00000020 .hidden Label_GreenPal -0200ece8 g O .rodata 00000020 .hidden dexBGPal -0201c208 g *ABS* 00000000 __rom_end__ -0200d631 g F .text 00000062 _lseek_r -030018d8 g O .bss 00000004 ptr_box_return -03001724 g O .bss 00000004 trade_pokemon -030025e0 g O .bss 00000004 btn_p_l -02002ee5 g F .text 000002d4 _Z23multiboot_upload_screenv -020149cc g .rodata 00000000 CREDITS_english_lz10_bin_end -0200144d g F .text 0000000c _Z19disable_auto_randomv -0200fe94 g O .rodata 000000b4 .hidden flag_itaTiles -02003279 g F .text 00000004 _ZNK19mystery_gift_script13get_section30Ev -0200641d g F .text 0000004c _Z12pokedex_showv -0201628c g .rodata 00000000 GENDER_RATIO_lz10_bin -02008eab g F .text 0000001a _ZN11Select_Menu13clear_optionsEv +02009ce9 w F .text 00000018 _ZN11Gen1Pokemon18setStatusConditionEh +0005ceae w .debug_info 00000000 .hidden Label_Green.c.5c6eeaaf +0200b0b5 g F .text 00000046 schr4c_vline +0200f240 g O .rodata 0000021c .hidden boxBGMap +0200bff9 g F .text 00000004 BitUnPack +02001711 g F .text 00000004 __wrap__close_r +02009ba5 g F .text 00000098 _ZN9GBPokemon13convertToGen3EP11Gen3Pokemonb +0200a1b9 g F .text 00000062 _ZN11Gen3Pokemon23updateSubstructureShiftEv +02018f60 g O .rodata 0000000c _ZN11Gen2Pokemon18g2_caughtDataLevelE +0300156c g O .bss 00000004 curr_link_animation_state +02002ec5 g F .text 00000038 _ZN19mystery_gift_script6setvarEtt +02002bb1 g F .text 000000bc _ZN19mystery_gift_scriptC1EPh +02008ec1 w F .text 0000001c _ZN11Gen3Pokemon12getExpPointsEv +020191c0 g O .rodata 0000000c _ZN11Gen3Pokemon19nicknameLetterEightE +0200bfe1 g F .text 00000004 ArcTan2 +020141a4 g .rodata 00000000 latin_shortFont +02012018 g O .rodata 00000020 .hidden Label_GreenPal +0200fbf8 g O .rodata 00000020 .hidden dexBGPal +0201e05c g *ABS* 00000000 __rom_end__ +0200db79 g F .text 00000062 _lseek_r +030016f4 g O .bss 00000004 ptr_box_return +03002f28 g O .bss 00000004 btn_p_l +020091f1 g F .text 00000016 _ZN9GBPokemon23getVirtualConsoleNatureEv +02009f49 w F .text 00000014 _ZN11Gen3Pokemon19getPersonalityValueEv +020028dd g F .text 000002d4 _Z23multiboot_upload_screenv +02009fb5 g F .text 00000060 _ZN11Gen3PokemonC1EP13PokemonTables +020158dc g .rodata 00000000 CREDITS_english_lz10_bin_end +02009e35 w F .text 00000014 _ZN11Gen2Pokemon21getCaughtDataLocationEv +02010da4 g O .rodata 000000b4 .hidden flag_itaTiles +02002c71 g F .text 00000004 _ZNK19mystery_gift_script13get_section30Ev +02005cc1 g F .text 0000004c _Z12pokedex_showv +0200723f g F .text 0000001a _ZN11Select_Menu13clear_optionsEv 020000c4 g .crt0 00000000 __boot_method -0200bb75 g F .text 0000004c schr4c_prep_map -0200268d g F .text 000000a8 _Z15game_load_errorv -03001744 g O .bss 00000001 missingno_enabled -02000879 g F .text 00000024 _ZN11Button_Menu12hide_buttonsEv -0200fd04 g O .rodata 00000010 .hidden flag_engPal -02012954 g O .rodata 00000900 .hidden typesTiles -0201b4d8 g O .rodata 00000010 _ZTV11textbox_var -0200258d g F .text 0000008c _Z13load_graphicsv -02001845 g F .text 00000028 _Z10fnv1a_hashPhj -02008889 g F .text 00000016 _ZN10script_var10place_wordEv -03003058 g *ABS* 00000000 __data_start__ +0200b76d g F .text 0000004c schr4c_prep_map +02002085 g F .text 000000a8 _Z15game_load_errorv +02019160 g O .rodata 0000000c _ZN11Gen3Pokemon29originalTrainerNameLetterFourE +03001561 g O .bss 00000001 missingno_enabled +02000895 g F .text 00000024 _ZN11Button_Menu12hide_buttonsEv +02010c14 g O .rodata 00000010 .hidden flag_engPal +02013864 g O .rodata 00000900 .hidden typesTiles +0200a4a9 w F .text 00000012 _Z10sizeToMaski +02018b38 g O .rodata 00000010 _ZTV11textbox_var +02001f85 g F .text 0000008c _Z13load_graphicsv +0005d3ec w .debug_info 00000000 .hidden menu_bars.c.72426802 +02008e99 w F .text 00000028 _Z10fnv1a_hashPhj +02006c1d g F .text 00000016 _ZN10script_var10place_wordEv +030035a8 g *ABS* 00000000 __data_start__ +02019208 g O .rodata 0000000c _ZN11Gen3Pokemon17nicknameLetterTwoE 020002ad g F .text 00000058 _Z14create_textboxiiiib -020031b9 g F .text 000000bc _ZN19mystery_gift_scriptC2EPh -02010270 g O .rodata 000001b4 .hidden fr_cartTiles -0200c419 g F .text 00000004 Diff8bitUnFilterWram +02002bb1 g F .text 000000bc _ZN19mystery_gift_scriptC2EPh +02011180 g O .rodata 000001b4 .hidden fr_cartTiles +0200c011 g F .text 00000004 Diff8bitUnFilterWram 02000351 g F .text 00000002 _ZN8Box_MenuC2Ev -020033b9 g F .text 00000038 _ZN19mystery_gift_script17setvirtualaddressEm -020094e1 g F .text 00000048 _Z23load_textbox_backgroundv -0201c0ac g *ABS* 00000000 __iwram_overlay_end -0200876f g F .text 00000008 _ZNK10script_obj14get_true_indexEv -03003078 g O .data 00000004 linkSPI -0200a42d g F .text 00000038 _ZNK15text_data_table19get_text_entry_sizeEt -020090dd g F .text 000002ac _Z18set_background_palibb -02012774 g O .rodata 00000090 .hidden textBoxBGTiles -0200d1c9 g F .text 0000003c __sseek -0200ce41 g F .text 0000003c __sinit -02011398 g O .rodata 00000020 .hidden Label_SilverPal -0200896f g F .text 00000044 _ZN12movement_var15insert_movementEPh -03003060 g O .data 00000004 __qran_seed -02009095 g F .text 00000048 _Z15load_backgroundv -030018d0 g O .bss 00000004 ptr_index -03002e58 g O .bss 00000002 __key_curr -0200af4d g F .text 0000000c key_repeat -02011980 g O .rodata 00000050 .hidden menu_barsTiles -02007b75 g F .text 00000030 _ZN13PokemonTables17load_gen3_charsetEh -03001808 g O .bss 000000a4 curr_rom -02014f74 g .rodata 00000000 gb_gen1_payloads_Y_lz10_bin_end -02001d81 g F .text 000000b8 tte_init_chr4c -02000b01 g F .text 00000082 _ZN11Button_Menu10add_buttonE6Buttoni -020022ed g F .text 000000d2 tte_write -030030b4 g O .data 00000004 var_index -020087f9 g F .text 0000000a _ZN7xse_var9set_startEv -0200c391 g F .text 00000006 Mod -020006e1 g F .text 00000002 _ZN6ButtonC1Ev -03003070 g O .data 00000001 mem_name -02011260 g O .rodata 00000020 .hidden Label_RedPal -0200f960 g O .rodata 0000024c .hidden fennelBGMap -030025d0 g O .bss 00000004 btn_d_l -030024f4 g O .bss 00000004 button_cancel_left -030025cc g O .bss 00000004 btn_d_r -02009b39 g F .text 00000318 _Z19load_select_spriteshh -030006d0 g O .bss 00000004 x -0200c21d g F .text 0000014c tte_con_write -02015824 g .rodata 00000000 gba_rom_values_eng_lz10_bin_end -0200c54d g F .text 000000cc memmove -02016dac g .rodata 00000000 JPN_NAMES_lz10_bin_end -02016dac g .rodata 00000000 NUM_ABILITIES_lz10_bin -0200c37d g F .text 00000012 DivSafe -030025f4 g O .bss 00000004 num_sprites -0200b3e1 g F .text 000000dc schr4c_hline -0200a8bd g F .text 00000008 _Z31get_compressed_pkmn_names_tablev -0201b780 g .rodata 00000000 __exidx_end -0200a9a9 g F .text 00000018 malloc_init_default_pool -030025c4 g O .bss 00000004 button_no -02014ab8 g .rodata 00000000 EVENT_PKMN_lz10_bin_end -02008b75 g F .text 00000026 _ZN7xse_var13add_referenceEi -03001714 g O .bss 00000004 received_offset -020097e1 g F .text 0000004c _Z22load_sprite_compressedP8OBJ_ATTRPKjRmmiim -02007d05 g F .text 0000000c _ZN13Pokemon_Party8set_langEi -020038f9 w F .text 0000002e _ZN4ptgb6vectorIP10script_varED1Ev -02007a85 g F .text 0000005c _ZN13PokemonTables14can_learn_moveEii -020116e8 g O .rodata 00000068 .hidden link_frame1Tiles -0200abc1 g F .text 00000050 IRQ_Init -0200cef1 g F .text 0000000c __errno -02008795 g F .text 00000064 _ZN7asm_var14fill_refrencesEPh -020036c9 g F .text 0000004c _ZN19mystery_gift_script13applymovementEtm -0200ea24 g O .rodata 00000010 .hidden button_yesPal -02003927 w F .text 0000002e _ZN4ptgb6vectorImED1Ev -030018c8 g O .bss 00000004 ptr_callASM -02011750 g O .rodata 00000010 .hidden link_frame1Pal -0200fbcc g O .rodata 00000138 .hidden flag_engTiles -0200a589 g F .text 00000078 _Z25wait_for_user_to_continueb -02001f7d g F .text 00000370 tte_cmd_default -020035fd g F .text 00000016 _ZN19mystery_gift_script11waitfanfareEv -0200afed g F .text 00000114 irq_set -0200a601 g F .text 000000be _Z10ptgb_writePKhbi -02008255 g F .text 00000020 _Z10set_caughti -03003050 g O .bss 00000004 __stdio_exit_handler -030018c4 g O .bss 00000004 ptr_script_ptr_low -020176e0 g .rodata 00000000 POWER_POINTS_lz10_bin -02001f51 g F .text 0000002a tte_erase_line -02016780 g .rodata 00000000 GENERAL_english_lz10_bin_end -0200c44d g F .text 0000003e memcpy16 -020079f1 g F .text 0000001c _ZN13PokemonTables17load_power_pointsEv -02007ead g F .text 00000010 _ZN13Pokemon_Party20get_contains_invalidEv -0200d5b1 g F .text 0000005a _fstat_r -020080f5 g F .text 00000074 _ZN8rom_data8load_romEv -0200ae4d g F .text 00000010 sqran -02001d1d g F .text 00000064 tte_init_base -03002574 g O .bss 00000004 point_arrow -02008b4b g F .text 0000001a _ZN7asm_var13add_referenceEi -02010fb4 g O .rodata 00000154 .hidden Label_GreenTiles -0201ade1 g O .rodata 000000fd EVOLUTIONS -02009fc1 g F .text 00000090 _Z15update_y_offsetv -02014ab8 g .rodata 00000000 EXP_GROUPS_lz10_bin -030024cc g O .bss 00000004 link_blob3 -0200ac21 g F .text 00000054 IRQ_Enable -03001914 g O .bss 0000001c kanto_count -03002e5c g O .bss 00000078 __isr_table -02008281 g F .text 0000000c _Z17set_tutorial_flagb -030016d8 g O .bss 00000014 memory_section_array -02008351 g F .text 0000007c _Z18populate_game_menui -02000cc9 g F .text 00000098 _Z29update_memory_buffer_checksumb +02002db1 g F .text 00000038 _ZN19mystery_gift_script17setvirtualaddressEm +02007875 g F .text 00000048 _Z23load_textbox_backgroundv +0201df00 g *ABS* 00000000 __iwram_overlay_end +02006b03 g F .text 00000008 _ZNK10script_obj14get_true_indexEv +020087c1 g F .text 00000038 _ZNK15text_data_table19get_text_entry_sizeEt +02007471 g F .text 000002ac _Z18set_background_palibb +02013684 g O .rodata 00000090 .hidden textBoxBGTiles +02009cb5 w F .text 0000001c _ZN11Gen1Pokemon7setTypeEi9Gen1Types +0200d711 g F .text 0000003c __sseek +02018dcc g O .rodata 00000018 _ZN9GBPokemon7moveOneE +0200cb8d g F .text 0000003c __sinit +020122a8 g O .rodata 00000020 .hidden Label_SilverPal +02006d03 g F .text 00000044 _ZN12movement_var15insert_movementEPh +030035a8 g O .data 00000004 __qran_seed +02007429 g F .text 00000048 _Z15load_backgroundv +030016ec g O .bss 00000004 ptr_index +03003364 g O .bss 00000002 __key_curr +0200ab45 g F .text 0000000c key_repeat +02008ca5 w F .text 00000004 _ZN9GBPokemon23setPokerusDaysRemainingEh +02012890 g O .rodata 00000050 .hidden menu_barsTiles +0005d68e w .debug_info 00000000 .hidden sapphire_cart.c.1653544e +0200d67d g F .text 00000014 __malloc_unlock +02001779 g F .text 000000b8 tte_init_chr4c +02000b19 g F .text 00000082 _ZN11Button_Menu10add_buttonE6Buttoni +0005c8f6 w .debug_info 00000000 .hidden flag_ita.c.9b264cbc +02001ce5 g F .text 000000d2 tte_write +030035f0 g O .data 00000004 var_index +02006b8d g F .text 0000000a _ZN7xse_var9set_startEv +0200bf89 g F .text 00000006 Mod +020006fd g F .text 00000002 _ZN6ButtonC1Ev +02009d8d w F .text 00000018 _ZN11Gen2Pokemon19setCaughtDataGenderEh +030035b8 g O .data 00000001 mem_name +02009285 g F .text 00000068 _ZN9GBPokemon8loadDataE8LanguagePhS1_S1_h +02012170 g O .rodata 00000020 .hidden Label_RedPal +02010870 g O .rodata 0000024c .hidden fennelBGMap +03002f18 g O .bss 00000004 btn_d_l +03002e3c g O .bss 00000004 button_cancel_left +03002f14 g O .bss 00000004 btn_d_r +02007ecd g F .text 00000318 _Z19load_select_spriteshh +03000540 g O .bss 00000004 x +0200be15 g F .text 0000014c tte_con_write +02009cd1 w F .text 00000018 _ZN11Gen1Pokemon12setCatchRateEh +02015f70 g .rodata 00000000 gba_rom_values_eng_lz10_bin_end +02018dfc g O .rodata 00000018 _ZN9GBPokemon18speciesIndexNumberE +0200a32d g F .text 00000004 _ZN7PokeBox8setTableEP13PokemonTables +0200c145 g F .text 000000cc memmove +02007e11 g F .text 000000bc _Z21load_temp_box_spritesP7PokeBox +02009fb5 g F .text 00000060 _ZN11Gen3PokemonC2EP13PokemonTables +0200bf75 g F .text 00000012 DivSafe +0005cdba w .debug_info 00000000 .hidden Label_Crystal.c.7d71abba +03002f3c g O .bss 00000004 num_sprites +0200afd9 g F .text 000000dc schr4c_hline +02008c51 g F .text 00000008 _Z31get_compressed_pkmn_names_tablev +0201c9ec g .rodata 00000000 __exidx_end +02018f78 g O .rodata 0000000c _ZN11Gen2Pokemon23g2_pokerusDaysRemainingE +02000bcd g F .text 00000018 malloc_init_default_pool +03002f0c g O .bss 00000004 button_no +02006f09 g F .text 00000026 _ZN7xse_var13add_referenceEi +02007b75 g F .text 0000004c _Z22load_sprite_compressedP8OBJ_ATTRPKjRmmiim +02006275 g F .text 0000000c _ZN13Pokemon_Party8set_langEi +020032f1 w F .text 0000002e _ZN4ptgb6vectorIP10script_varED1Ev +0200a751 g F .text 00000060 _ZN13PokemonTables14can_learn_moveEii +020125f8 g O .rodata 00000068 .hidden link_frame1Tiles +0200cc3d g F .text 0000000c __errno +02006b29 g F .text 00000064 _ZN7asm_var14fill_refrencesEPh +020030c1 g F .text 0000004c _ZN19mystery_gift_script13applymovementEtm +0200f934 g O .rodata 00000010 .hidden button_yesPal +0200331f w F .text 0000002e _ZN4ptgb6vectorImED1Ev +030016e4 g O .bss 00000004 ptr_callASM +02018ec0 g O .rodata 0000000c _ZN11Gen1Pokemon12g1_currentHPE +02018fd4 g O .rodata 0000000c _ZN11Gen3Pokemon17specialDefenseIVsE +02012660 g O .rodata 00000010 .hidden link_frame1Pal +02010adc g O .rodata 00000138 .hidden flag_engTiles +0200891d g F .text 00000078 _Z25wait_for_user_to_continueb +02001975 g F .text 00000370 tte_cmd_default +02002ff5 g F .text 00000016 _ZN19mystery_gift_script11waitfanfareEv +0200abe5 g F .text 00000114 irq_set +02008995 g F .text 000000be _Z10ptgb_writePKhbi +02019238 g O .rodata 0000000c _ZN11Gen3Pokemon16personalityValueE +02006641 g F .text 00000020 _Z10set_caughti +03003558 g O .bss 00000004 __stdio_exit_handler +0200a561 g F .text 00000014 _ZN7Pokemon6getVarE11DataVarInfo +0005d096 w .debug_info 00000000 .hidden lg_cart.c.e0f34e26 +030016e0 g O .bss 00000004 ptr_script_ptr_low +02001949 g F .text 0000002a tte_erase_line +020167a0 g .rodata 00000000 GENERAL_english_lz10_bin_end +0200c045 g F .text 0000003e memcpy16 +0200a70b g F .text 00000002 _ZN13PokemonTables17load_power_pointsEv +0005d110 w .debug_info 00000000 .hidden link_blobs.c.8f2ee93d +02018d84 g O .rodata 00000018 _ZN9GBPokemon8moveFourE +0200630d g F .text 00000040 _ZN13Pokemon_Party20get_contains_invalidEv +02008f65 w F .text 00000028 _ZN9GBPokemon7getMoveEi +0200daf9 g F .text 0000005a _fstat_r +020064e1 g F .text 00000074 _ZN8rom_data8load_romEv +020063c1 g F .text 00000014 _Z12get_rand_u32v +0200aa45 g F .text 00000010 sqran +02001715 g F .text 00000064 tte_init_base +03002ebc g O .bss 00000004 point_arrow +02019124 g O .rodata 0000000c _ZN11Gen3Pokemon18speciesIndexNumberE +02006edf g F .text 0000001a _ZN7asm_var13add_referenceEi +02011ec4 g O .rodata 00000154 .hidden Label_GreenTiles +0201c60e g O .rodata 000000fd EVOLUTIONS +02008355 g F .text 00000090 _Z15update_y_offsetv +03002e14 g O .bss 00000004 link_blob3 +03001730 g O .bss 0000001c kanto_count +0200a30d g F .text 00000020 _ZN7PokeBoxC2Ev +03003368 g O .bss 00000078 __isr_table +0200666d g F .text 0000000c _Z17set_tutorial_flagb +03001548 g O .bss 00000014 memory_section_array +02006709 g F .text 0000007c _Z18populate_game_menui +02000cfd g F .text 00000098 _Z29update_memory_buffer_checksumb 0200026d g F .text 00000040 _Z16background_framei 02000000 g .crt0 00000000 __text_start -02007fb5 g F .text 0000001c _Z15rand_next_framev -020007b5 g F .text 00000028 _ZN6Button4showEv -020079d5 g F .text 0000001c _ZN13PokemonTables16load_first_movesEv -0201b4e8 g O .rodata 00000010 _ZTV12movement_var -0200c005 g F .text 00000074 tte_con_nocash -0200b21d g F .text 00000054 irq_enable -02001825 g F .text 00000010 _Z21get_missingno_enabledv -02008009 g F .text 00000006 _ZN8rom_dataC2Ev -02008849 g F .text 00000008 _ZN11textbox_var9set_startEv -02000bb3 g F .text 00000002 _ZN3DexC1Ev -02006d09 g F .text 00000014 _ZN7Pokemon14get_dex_numberEv -0200c425 g F .text 00000004 SoundBias -0200398d w F .text 0000002a _ZN4ptgb6vectorIhE9push_backERKh -02003689 g F .text 00000016 _ZN19mystery_gift_script10killscriptEv -020034a1 g F .text 00000016 _ZN19mystery_gift_script7waitmsgEv -02012804 g O .rodata 00000130 .hidden textBoxBGMap -02003505 g F .text 00000038 _ZN19mystery_gift_script6addvarEtt -030006d5 g O .bss 00001000 global_memory_buffer -02008859 g F .text 00000008 _ZN10sprite_var9set_startEv -02001819 g F .text 0000000c _Z11set_treeckob -0200cc11 g F .text 000000b0 memcpy -020125ac g O .rodata 00000020 .hidden ruby_cartPal -0200bd25 g F .text 00000034 schr4c_floodfill -02008afd w F .text 0000004e _ZN4ptgb6vectorImE9push_backERKm -02001289 g F .text 0000014c _Z4loopPhS_P6GB_ROMP18Simplified_PokemonPKtb -0200c9fd g F .text 000001ac setvbuf -0200982d g F .text 00000250 _Z20load_eternal_spritesv -0300307c g O .data 00000001 rand_enabled -020068cb g F .text 00000206 _ZN7Pokemon9load_dataEiPKhii -0200fdd8 g O .rodata 000000ac .hidden flag_gerTiles -030024d8 g O .bss 00000004 link_frame3 -0200a549 g F .text 00000014 _Z13show_text_boxv -02003407 g F .text 00000016 _ZN19mystery_gift_script10faceplayerEv +020063a5 g F .text 0000001c _Z15rand_next_framev +020007d1 g F .text 00000028 _ZN6Button4showEv +0200906d g F .text 000000e8 _ZN9GBPokemon5setDVE4Stath +02018b48 g O .rodata 00000010 _ZTV12movement_var +0200bbfd g F .text 00000074 tte_con_nocash +0200ae15 g F .text 00000054 irq_enable +020191cc g O .rodata 0000000c _ZN11Gen3Pokemon19nicknameLetterSevenE +02001269 g F .text 00000010 _Z21get_missingno_enabledv +0005c376 w .debug_info 00000000 .hidden button_cancel_left.c.bd2a9739 +02009ead w F .text 00000014 _ZN11Gen2Pokemon13getFriendshipEv +020063f5 g F .text 00000006 _ZN8rom_dataC2Ev +02006bdd g F .text 00000008 _ZN11textbox_var9set_startEv +02000be5 g F .text 00000002 _ZN3DexC1Ev +02008c75 w F .text 00000004 _ZN9GBPokemon7setTypeEi9Gen1Types +02018c18 g O .rodata 0000007c _ZTV9GBPokemon +0005cf28 w .debug_info 00000000 .hidden Label_Red.c.4d53bc64 +0200c01d g F .text 00000004 SoundBias +02003385 w F .text 0000002a _ZN4ptgb6vectorIhE9push_backERKh +02018ff8 g O .rodata 0000000c _ZN11Gen3Pokemon10defenseIVsE +02003081 g F .text 00000016 _ZN19mystery_gift_script10killscriptEv +02002e99 g F .text 00000016 _ZN19mystery_gift_script7waitmsgEv +02019070 g O .rodata 0000000c _ZN11Gen3Pokemon10moveFourPPE +02013714 g O .rodata 00000130 .hidden textBoxBGMap +02002efd g F .text 00000038 _ZN19mystery_gift_script6addvarEtt +03000545 g O .bss 00001000 global_memory_buffer +02006bed g F .text 00000008 _ZN10sprite_var9set_startEv +0200125d g F .text 0000000c _Z11set_treeckob +0200a48b g F .text 00000006 _ZN7PokeBox11getNumInBoxEv +0200c845 g F .text 000000b0 memcpy +020134bc g O .rodata 00000020 .hidden ruby_cartPal +0200b91d g F .text 00000034 schr4c_floodfill +02006e91 w F .text 0000004e _ZN4ptgb6vectorImE9push_backERKm +0200c631 g F .text 000001ac setvbuf +02018eb4 g O .rodata 0000000c _ZN11Gen1Pokemon18g1_statusConditionE +02007bc1 g F .text 00000250 _Z20load_eternal_spritesv +02010ce8 g O .rodata 000000ac .hidden flag_gerTiles +02018ea8 g O .rodata 0000000c _ZN11Gen1Pokemon10g1_typeOneE +03002e20 g O .bss 00000004 link_frame3 +020088dd g F .text 00000014 _Z13show_text_boxv +02002dff g F .text 00000016 _ZN19mystery_gift_script10faceplayerEv 02000305 g F .text 00000034 _Z13reset_textboxv -0200327d g F .text 0000002c _ZN19mystery_gift_script11add_commandEi -0200af29 g F .text 00000024 key_wait_till_hit -02000f4d g F .text 00000010 _Z16exchange_partieshPh -0200c3a1 g F .text 00000006 DivArmMod -03003220 g O .data 0000008c devoptab_list -02008739 g F .text 00000014 _ZN10script_objC2Ev -030030ac w O .data 00000004 _ZZ8n2hexstrImEvPcT_jE6digits -0200a40b g F .text 0000000a _ZNK15text_data_table26get_number_of_text_entriesEv -0201b508 g O .rodata 00000010 _ZTV9music_var -02006c55 g F .text 0000002e _ZN7Pokemon19get_letter_from_pidEm -02001903 g F .text 0000000c _Z14interrupt_initv -020162ec g .rodata 00000000 GENDER_RATIO_lz10_bin_end -03002a14 g O .bss 00000008 curr_line -030024f8 g O .bss 00000078 party_sprites -03003068 g O .data 00000008 __key_rpt -0200c421 g F .text 00000004 Diff16bitUnFilter -0201c0ac g *ABS* 00000000 __ewram_start -03002570 g O .bss 00000004 box_select -02003381 g F .text 00000038 _ZN19mystery_gift_script7add_asmEt -0200a9c1 g F .text 000000cc malloc -0200b101 g F .text 00000074 irq_add -02003955 w F .text 00000038 _ZN4ptgb6vectorIhE7reserveEt -02010970 g O .rodata 00000210 .hidden GBS_ShellTiles -0200d340 g F .text 000000fc .hidden __udivsi3 -0200a8ad g F .text 00000008 _Z28get_compressed_general_tablev -02010188 g O .rodata 000000d8 .hidden flag_spaTiles -0200d60d g F .text 00000020 __getreent -0200c445 g F .text 00000004 SoundDriverVSyncOff -02001835 g F .text 00000010 _Z19get_treecko_enabledv -02006251 g F .text 00000008 _ZN19payload_file_readerC1EPKht -0200c42d g F .text 00000004 SoundDriverMode -030018cc g O .bss 00000004 ptr_pkmn_offset -0200e56c g O .rodata 0000010c .hidden button_cancel_leftTiles -030018bc g O .bss 00000004 ptr_call_return_1 -03002580 g O .bss 00000038 type_sprites -02007ccd g F .text 00000010 _ZN13Pokemon_Party21get_contains_mythicalEv +0200a2dd g F .text 00000030 _ZN11Gen3Pokemon10setOTArrayEPhi +02008fcd g F .text 000000a0 _ZN9GBPokemon5getDVE4Stat +020098af g F .text 00000066 _ZN9GBPokemon12setEVsAndIVsEP11Gen3Pokemon +02002c75 g F .text 0000002c _ZN19mystery_gift_script11add_commandEi +0200ab21 g F .text 00000024 key_wait_till_hit +0200bf99 g F .text 00000006 DivArmMod +030044e8 g O .data 0000008c devoptab_list +02006acd g F .text 00000014 _ZN10script_objC2Ev +030035e8 w O .data 00000004 _ZZ8n2hexstrImEvPcT_jE6digits +0200879f g F .text 0000000a _ZNK15text_data_table26get_number_of_text_entriesEv +02019178 g O .rodata 0000000c _ZN11Gen3Pokemon28originalTrainerNameLetterTwoE +0200a183 g F .text 00000036 _ZN11Gen3Pokemon22resetSubstructureShiftEv +02018f54 g O .rodata 0000000c _ZN11Gen2Pokemon19g2_caughtDataGenderE +02018b68 g O .rodata 00000010 _ZTV9music_var +0300335c g O .bss 00000008 curr_line +03002e40 g O .bss 00000078 party_sprites +02019244 g O .rodata 00000014 _ZTV7Pokemon +030035b0 g O .data 00000008 __key_rpt +0200c019 g F .text 00000004 Diff16bitUnFilter +020190c4 g O .rodata 0000000c _ZN11Gen3Pokemon7moveOneE +0201df00 g *ABS* 00000000 __ewram_start +02019130 g O .rodata 0000000c _ZN11Gen3Pokemon8checksumE +0005ca64 w .debug_info 00000000 .hidden flag_spa.c.41c222d0 +020093d5 g F .text 0000004a _ZN9GBPokemon23externalConvertNicknameEPh +03002eb8 g O .bss 00000004 box_select +02002d79 g F .text 00000038 _ZN19mystery_gift_script7add_asmEt +0200c569 g F .text 00000026 malloc +0200acf9 g F .text 00000074 irq_add +0200334d w F .text 00000038 _ZN4ptgb6vectorIhE7reserveEt +0005ce34 w .debug_info 00000000 .hidden Label_Gold.c.d7ca7ee9 +02011880 g O .rodata 00000210 .hidden GBS_ShellTiles +0200d888 g F .text 000000fc .hidden __udivsi3 +02008c41 g F .text 00000008 _Z28get_compressed_general_tablev +02011098 g O .rodata 000000d8 .hidden flag_spaTiles +0200db55 g F .text 00000020 __getreent +0200c03d g F .text 00000004 SoundDriverVSyncOff +02001279 g F .text 00000010 _Z19get_treecko_enabledv +0200c025 g F .text 00000004 SoundDriverMode +030016e8 g O .bss 00000004 ptr_pkmn_offset +0200f47c g O .rodata 0000010c .hidden button_cancel_leftTiles +02019004 g O .rodata 0000000c _ZN11Gen3Pokemon9attackIVsE +030016d8 g O .bss 00000004 ptr_call_return_1 +0005d18a w .debug_info 00000000 .hidden link_frame1.c.6185e936 +03002ec8 g O .bss 00000038 type_sprites +020061ed g F .text 0000005a _ZN13Pokemon_Party21get_contains_mythicalEv 030000d5 g F .iwram 0000007c _Z9init_bankv -020088bd g F .text 00000010 _ZN7xse_var16get_loc_in_sec30Ev -02001459 g F .text 000000c8 _Z24run_link_cable_animationi -020119d0 g O .rodata 0000011c .hidden menu_barsMap -0201c0ac g *ABS* 00000000 __load_stop_iwram0 -02007ba5 g F .text 00000024 _Z21get_char_from_charsetPKtt -030025b8 g O .bss 00000004 flag +0200a331 g F .text 00000020 _ZN7PokeBox10addPokemonEP7Pokemon +02008ce9 w F .text 00000012 _ZN9GBPokemonD0Ev +020091b9 g F .text 00000038 _ZN9GBPokemon9getGenderEv +0200a09d g F .text 00000016 _ZN11Gen3Pokemon20decryptSubstructuresEv +02006c51 g F .text 00000010 _ZN7xse_var16get_loc_in_sec30Ev +02000e9d g F .text 000000c8 _Z24run_link_cable_animationi +020128e0 g O .rodata 0000011c .hidden menu_barsMap +0201df00 g *ABS* 00000000 __load_stop_iwram0 +0200a885 g F .text 00000024 _Z21get_char_from_charsetPKtt +0300358c g O .bss 00000004 __malloc_top_pad +03002f00 g O .bss 00000004 flag 03000347 g F .iwram 00000014 _Z14write_int_savejm -030025f0 g O .bss 00000004 ptgb_logo_l -030018e7 g O .bss 00000001 mew_caught -030006b0 g *ABS* 00000000 __bss_start__ -02015198 g .rodata 00000000 gb_rom_values_eng_lz10_bin +03002f38 g O .bss 00000004 ptgb_logo_l +03001703 g O .bss 00000001 mew_caught +03000520 g *ABS* 00000000 __bss_start__ +020158dc g .rodata 00000000 gb_rom_values_eng_lz10_bin 03000000 g *ABS* 00000000 __iwram_start__ -030025c0 g O .bss 00000004 cart_shell -02000b83 g F .text 00000030 _ZN11Button_Menu12clear_vectorEv -030019ec g O .bss 00000001 is_macronix -0200e790 g O .rodata 0000003c .hidden button_edgeTiles -0200797b g F .text 0000000e _ZN13PokemonTablesC1Ev -02008a91 g F .text 00000038 _ZN10script_varC1EmRN4ptgb6vectorIPS_EEPi -0200e54c g O .rodata 00000020 .hidden boxBGPal -0200c3c1 g F .text 00000004 SoftReset -0200191b g F .text 0000000c _Z16interrupt_enable15interrupt_index -0201c0ac g *ABS* 00000000 __load_start_iwram0 -02014f74 g .rodata 00000000 gb_gen2_payloads_lz10_bin -0200ee9c g O .rodata 00000020 .hidden emerald_cartPal -02001edb g F .text 0000002e tte_cmd_next -02007a45 g F .text 00000024 _ZN13PokemonTables20get_gender_thresholdEib -0200fbac g O .rodata 00000020 .hidden fennelBGPal -030024e8 g O .bss 00000004 button_confirm_right -0200c41d g F .text 00000004 Diff8bitUnFilterVram -020039e5 w F .text 00000046 _ZN4ptgb6vectorIhEC1ERKS1_ -0201c208 g *ABS* 00000000 __ewram_overlay_lma -020096a5 g F .text 00000054 _Z11load_spriteP8OBJ_ATTRPKjiRmmiim -0200d6f1 g F .text 00000018 __libc_lock_acquire_recursive -020081b9 g F .text 00000030 _Z21load_custom_save_datav -02006d29 g F .text 00000014 _ZN7Pokemon10get_is_newEv -0200ae7d g F .text 00000052 octant_rot -02008869 g F .text 00000010 _ZN10script_var9set_startEv -0200c429 g F .text 00000004 SoundDriverInit -02007cf1 g F .text 00000012 _ZN13Pokemon_Party12get_game_genEv -030006b0 g *ABS* 00000000 __iwram_end__ -020032c1 g F .text 000000c0 _ZN19mystery_gift_script10calc_crc16Ev -0200d695 g F .text 0000005a _read_r -02001f09 g F .text 0000001e tte_erase_rect -0200d305 g F .text 00000012 .hidden __gnu_thumb1_case_uqi -0200ae5d g F .text 00000020 octant -02000bb3 g F .text 00000002 _ZN3DexC2Ev -0200c961 g F .text 00000010 isspace -030018b0 g O .bss 00000004 delay_counter -02014b18 g .rodata 00000000 EXP_GROUPS_lz10_bin_end -0200d215 g F .text 000000da _fclose_r -02000855 g F .text 00000024 _ZN11Button_Menu12show_buttonsEv -0200a3e1 g F .text 00000008 _ZN15text_data_tableC1EPh -020162ec g .rodata 00000000 GENERAL_english_lz10_bin -030018c0 g O .bss 00000004 ptr_script_ptr_high -020032a9 g F .text 00000018 _ZN19mystery_gift_script15calc_checksum32Ev -02015f68 g .rodata 00000000 gen_2_charsets_lz10_bin_end -02012258 g O .rodata 000001cc .hidden ptgb_logo_rTiles -02008851 g F .text 00000008 _ZN12movement_var9set_startEv -02006c25 g F .text 00000030 _ZN7Pokemon12convert_textER13PokemonTablesPhi -0201b780 g .rodata 00000000 __exidx_start -02001c41 g F .text 0000000c _ZdlPv -02009389 g F .text 00000128 _Z20load_flex_backgroundii -0200c679 g F .text 00000052 __libc_init_array -0200a6d5 g F .text 0000004c _Z16ptgb_write_debugPKtPKcb -02010e48 g O .rodata 0000014c .hidden Label_GoldTiles -02008e53 w F .text 00000058 _ZN4ptgb6vectorIhE6resizeEt -02008777 g F .text 00000008 _ZNK10script_obj15get_false_indexEv -02008e31 g F .text 00000022 _ZN11Select_Menu10add_optionEhh -02007fe9 g F .text 00000020 _Z14get_rand_rangejj -0201b4b8 g O .rodata 00000010 _ZTV7asm_var -0200c3d5 g F .text 00000004 VBlankIntrWait -020035ad g F .text 00000028 _ZN19mystery_gift_script7setflagEt -030032ac g .data 00000000 __iwram_overlay_start -02006c83 g F .text 00000086 _ZN7Pokemon21generate_pid_iv_matchER13PokemonTableshhPh -030025bc g O .bss 00000004 cart_label -020154e0 g .rodata 00000000 gba_rom_values_eng_lz10_bin -03001a5c g O .bss 00000a68 party_data -02007ce9 g F .text 00000008 _ZN13Pokemon_Party8set_gameEi -0200c415 g F .text 00000004 RLUnCompVram -03002a08 g O .bss 00000004 curr_text +03002f08 g O .bss 00000004 cart_shell +02000b9b g F .text 00000030 _ZN11Button_Menu12clear_vectorEv +03001808 g O .bss 00000001 is_macronix +0200f6a0 g O .rodata 0000003c .hidden button_edgeTiles +0200a66d g F .text 0000009c _ZN13PokemonTablesC1Ev +02006e25 g F .text 00000038 _ZN10script_varC1EmRN4ptgb6vectorIPS_EEPi +0200f45c g O .rodata 00000020 .hidden boxBGPal +0200bfb9 g F .text 00000004 SoftReset +0201df00 g *ABS* 00000000 __load_start_iwram0 +02018e9c g O .rodata 0000000c _ZN11Gen1Pokemon10g1_typeTwoE +0200fdac g O .rodata 00000020 .hidden emerald_cartPal +020018d3 g F .text 0000002e tte_cmd_next +0200a71d g F .text 0000001c _ZN13PokemonTables20get_gender_thresholdEib +02010abc g O .rodata 00000020 .hidden fennelBGPal +0200a425 g F .text 00000042 _ZN7PokeBox11convertPkmnEib +020190a0 g O .rodata 0000000c _ZN11Gen3Pokemon8moveFourE +02019100 g O .rodata 0000000c _ZN11Gen3Pokemon14ppUpNumMoveOneE +03002e30 g O .bss 00000004 button_confirm_right +0200dc39 w F .text 00000050 _sbrk_r +0200c015 g F .text 00000004 Diff8bitUnFilterVram +0200a21b g F .text 0000001a _ZN11Gen3Pokemon18updateSecurityDataEv +020033dd w F .text 00000046 _ZN4ptgb6vectorIhEC1ERKS1_ +0201e05c g *ABS* 00000000 __ewram_overlay_lma +02009e85 w F .text 00000014 _ZN11Gen2Pokemon23getPokerusDaysRemainingEv +02007a39 g F .text 00000054 _Z11load_spriteP8OBJ_ATTRPKjiRmmiim +0200a385 g F .text 000000a0 _ZN7PokeBox8loadDataEi8LanguagePh +0200dc89 g F .text 00000018 __libc_lock_acquire_recursive +0005c6ec w .debug_info 00000000 .hidden fennelBG.c.76b20724 +020065a5 g F .text 00000030 _Z21load_custom_save_datav +0200aa75 g F .text 00000052 octant_rot +0005c802 w .debug_info 00000000 .hidden flag_fre.c.3f5546f2 +02006bfd g F .text 00000010 _ZN10script_var9set_startEv +0200c021 g F .text 00000004 SoundDriverInit +02006261 g F .text 00000014 _ZN13Pokemon_Party12get_game_genEv +03000520 g *ABS* 00000000 __iwram_end__ +02002cb9 g F .text 000000c0 _ZN19mystery_gift_script10calc_crc16Ev +02009ee9 g F .text 0000002c _ZN11Gen2PokemonC2EP13PokemonTables +0200dbdd g F .text 0000005a _read_r +02009c3d w F .text 00000002 _ZN11Gen1PokemonD1Ev +02001901 g F .text 0000001e tte_erase_rect +03003f5c g O .data 00000028 _ZN11Gen3Pokemon8nicknameE +0200d84d g F .text 00000012 .hidden __gnu_thumb1_case_uqi +0200aa55 g F .text 00000020 octant +02000be5 g F .text 00000002 _ZN3DexC2Ev +0200c559 g F .text 00000010 isspace +030016cc g O .bss 00000004 delay_counter +0200d75d g F .text 000000da _fclose_r +02008f8d g F .text 00000040 _ZN9GBPokemonC1Ev +02000871 g F .text 00000024 _ZN11Button_Menu12show_buttonsEv +02018ecc w O .rodata 0000007c _ZTV11Gen2Pokemon +02008775 g F .text 00000008 _ZN15text_data_tableC1EPh +02019220 g O .rodata 0000000c _ZN11Gen3Pokemon8secretIDE +03003588 g O .bss 00000004 __malloc_max_sbrked_mem +02009ee9 g F .text 0000002c _ZN11Gen2PokemonC1EP13PokemonTables +02016294 g .rodata 00000000 GENERAL_english_lz10_bin +0200a111 g F .text 00000072 _ZN11Gen3Pokemon17swapSubstructuresEii +030016dc g O .bss 00000004 ptr_script_ptr_high +02002ca1 g F .text 00000018 _ZN19mystery_gift_script15calc_checksum32Ev +03003f30 g O .data 00000010 _ZN11Gen3Pokemon8ppUpNumsE +03003ef8 g O .data 00000018 _ZN11Gen3Pokemon3IVsE +0200a4d1 g F .text 00000090 _ZN7Pokemon6getVarE11DataVarInfoi +02013168 g O .rodata 000001cc .hidden ptgb_logo_rTiles +02006be5 g F .text 00000008 _ZN12movement_var9set_startEv +0200a293 g F .text 00000048 _ZN11Gen3Pokemon9getGenderEv +0200a0c9 g F .text 00000048 _ZN11Gen3Pokemon14updateChecksumEv +0005c3f0 w .debug_info 00000000 .hidden button_confirm_left.c.8687b4dd +02009c8d w F .text 00000014 _ZN11Gen1Pokemon18getStatusConditionEv +0201c9ec g .rodata 00000000 __exidx_start +02001639 g F .text 0000000c _ZdlPv +020190dc g O .rodata 0000000c _ZN11Gen3Pokemon15ppUpNumMoveFourE +0200a371 g F .text 00000014 _ZN7PokeBox14getGen3PokemonEi +0200a493 g F .text 00000004 _ZN7Pokemon21getSpeciesIndexNumberEv +0200771d g F .text 00000128 _Z20load_flex_backgroundii +02018fbc g O .rodata 0000000c _ZN11Gen3Pokemon25fatefulEncounterObedienceE +0200c271 g F .text 00000052 __libc_init_array +0200a497 w F .text 00000012 _ZN7PokemonD0Ev +02008a69 g F .text 0000004c _Z16ptgb_write_debugPKtPKcb +02011d58 g O .rodata 0000014c .hidden Label_GoldTiles +020071e7 w F .text 00000058 _ZN4ptgb6vectorIhE6resizeEt +02009421 g F .text 00000080 _ZN9GBPokemon18convertTrainerInfoEP11Gen3Pokemon +02009dbd w F .text 00000018 _ZN11Gen2Pokemon17setCaughtDataTimeEh +02006b0b g F .text 00000008 _ZNK10script_obj15get_false_indexEv +02009ec1 w F .text 00000014 _ZN11Gen2Pokemon11getHeldItemEv +020071c5 g F .text 00000022 _ZN11Select_Menu10add_optionEhh +020063d5 g F .text 00000020 _Z14get_rand_rangejj +02018b18 g O .rodata 00000010 _ZTV7asm_var +0200bfcd g F .text 00000004 VBlankIntrWait +02002fa5 g F .text 00000028 _ZN19mystery_gift_script7setflagEt +03004574 g .data 00000000 __iwram_overlay_start +03002f04 g O .bss 00000004 cart_label +02015c2c g .rodata 00000000 gba_rom_values_eng_lz10_bin +03001878 g O .bss 00001594 party_data +020190b8 g O .rodata 0000000c _ZN11Gen3Pokemon7moveTwoE +02006255 g F .text 0000000c _ZN13Pokemon_Party8set_gameEi +020092ed g F .text 0000008a _ZN9GBPokemon24generatePersonalityValueEP11Gen3Pokemon9RNGMethod +0005bee3 w .debug_info 00000000 .hidden interrupts_gba.c.596b6bbf +0200c00d g F .text 00000004 RLUnCompVram +03003350 g O .bss 00000004 curr_text 02000211 g F .init 00000000 _init -0300061c g F .iwram 00000038 memcpy32 -020082f5 g F .text 0000005c _Z18populate_lang_menuv -03001718 g O .bss 00000004 state -02010ccc g O .rodata 00000020 .hidden Label_BluePal -02007ebd g F .text 00000010 _ZN13Pokemon_Party22get_contains_missingnoEv -0200c929 g F .text 00000038 strtol -020036a1 g F .text 00000028 _ZN19mystery_gift_script12waitmovementEt -0201b4a8 g O .rodata 00000010 _ZTV10script_var -02006ad1 g F .text 0000003a _ZN7Pokemon11insert_dataEPhS0_S0_S0_ -0200ac11 g F .text 00000010 IRQ_SetHandler -0200a051 g F .text 00000002 _Z23update_front_box_spriteP18Simplified_Pokemon -0201aee0 g O .rodata 00000040 GENDER_THRESHOLDS -03001720 g O .bss 00000004 FF_count -030018ac g O .bss 00000004 curr_selection -02014ddc g .rodata 00000000 gb_gen1_payloads_Y_lz10_bin -02001f29 g F .text 00000026 tte_erase_screen -02007d95 g F .text 0000001a _ZN13Pokemon_Party15get_simple_pkmnEi -02001bad g F .text 0000004e npf_vsnprintf -02001c15 g F .text 00000020 _ZN4ptgb9to_stringEi +02008c61 w F .text 00000004 _ZN9GBPokemon12getCatchRateEv +03000488 g F .iwram 00000038 memcpy32 +020066b5 g F .text 00000054 _Z18populate_lang_menuv +02011bdc g O .rodata 00000020 .hidden Label_BluePal +0200634d g F .text 00000042 _ZN13Pokemon_Party22get_contains_missingnoEv +0200c521 g F .text 00000038 strtol +02003099 g F .text 00000028 _ZN19mystery_gift_script12waitmovementEt +02018b08 g O .rodata 00000010 _ZTV10script_var +02018d54 g O .rodata 00000018 _ZN9GBPokemon9expPointsE +0201c70c g O .rodata 00000040 GENDER_THRESHOLDS +020094a1 g F .text 000000b8 _ZN9GBPokemon8checkEXPEP11Gen3Pokemon +030016c8 g O .bss 00000004 curr_selection +0005cade w .debug_info 00000000 .hidden fr_cart.c.b455af32 +02001921 g F .text 00000026 tte_erase_screen +0200a27d g F .text 00000016 _ZN11Gen3Pokemon9getNatureEv +020015a5 g F .text 0000004e npf_vsnprintf +0200160d g F .text 00000020 _ZN4ptgb9to_stringEi 030001d9 g F .iwram 00000014 _Z14read_byte_savej -03002a04 g O .bss 00000001 text_exit -02001675 g F .text 00000060 _Z22determine_fennel_blinkv -03000654 g F .iwram 0000004c memset32 -0200ac75 g F .text 00000050 IRQ_Disable -02011880 g O .rodata 00000020 .hidden lookerFRLGPal -02014c08 g .rodata 00000000 gb_gen1_payloads_RB_lz10_bin +02008c71 w F .text 00000004 _ZN9GBPokemon12setCatchRateEh +0300334c g O .bss 00000001 text_exit +020010b9 g F .text 00000060 _Z22determine_fennel_blinkv +030004c0 g F .iwram 0000004c memset32 +02012790 g O .rodata 00000020 .hidden lookerFRLGPal +0200a491 w F .text 00000002 _ZN7PokemonD2Ev 030002a5 g F .iwram 0000008c _Z16copy_ram_to_savePhjj -020017ed g F .text 0000002c _Z13set_missingnob -02008b65 g F .text 00000010 _ZN7asm_var13add_referenceEv -0200ff48 g O .rodata 00000010 .hidden flag_itaPal -0200ab85 g F .text 00000020 calloc -02000db5 g F .text 00000048 _Z24compare_map_and_npc_dataiii -02006381 g F .text 0000009c _Z12pokedex_initv -03002e5a g O .bss 00000002 __key_prev -02010444 g O .rodata 000001b0 .hidden GB_ShellTiles -030030bc g O .data 00000004 var_box_return -020114fc g O .rodata 000001b4 .hidden lg_cartTiles -0200de4c g O .rodata 00000020 .hidden backgroundPal -030003e4 g .iwram 00000000 IRQ_GlobalInterruptHandler -0200beb1 g F .text 00000154 chr4c_drawg_b1cts -030025f8 g O .bss 00000004 y_offset_timer -02008da5 g F .text 00000088 _ZN11Select_Menu9show_menuEv -02006469 g F .text 0000007c _Z12pokedex_hidev -0200797b g F .text 0000000e _ZN13PokemonTablesC2Ev -0200365d g F .text 00000016 _ZN19mystery_gift_script7releaseEv -0200dd04 g O .rodata 00000148 .hidden backgroundMap -03002ee8 g O .bss 00000168 __sf -02009f11 g F .text 000000a4 _Z12fennel_speaki -02006b0b g F .text 00000116 _ZN7Pokemon19alocate_data_chunksEPhS0_S0_S0_ -03001728 g O .bss 00000004 gen -0200353d g F .text 00000038 _ZN19mystery_gift_script4callEm -03001a10 g O .bss 0000000c box_viewer -03001a3c g O .bss 00000020 langs -02007c31 g F .text 0000000c _ZN13Pokemon_Party14get_last_errorEv -02001c4d g F .text 0000000c _ZdlPvj -0201c0ac g *ABS* 00000000 __iwram_overlay_lma -02008f31 g F .text 00000144 _ZN11Select_Menu16select_menu_mainEv -0201b250 g O .rodata 00000258 transfer_script_params -0200c3fd g F .text 00000004 ObjAffineSet -0200079d g F .text 00000016 _ZN6ButtonC2EP8OBJ_ATTR -0200b821 g F .text 00000092 schr4c_frame -02016780 g .rodata 00000000 JPN_NAMES_lz10_bin -02009e51 g F .text 000000c0 _Z12fennel_blinki -0200c36d g F .text 00000010 VBlankIntrDelay -0200c3f1 g F .text 00000004 CpuFastSet -0200a6c1 g F .text 00000014 _Z10ptgb_writePKhb +02001231 g F .text 0000002c _Z13set_missingnob +02006ef9 g F .text 00000010 _ZN7asm_var13add_referenceEv +02010e58 g O .rodata 00000010 .hidden flag_itaPal +02000de9 g F .text 00000048 _Z24compare_map_and_npc_dataiii +0005d01c w .debug_info 00000000 .hidden Label_Yellow.c.13a84e3f +02005c25 g F .text 0000009c _Z12pokedex_initv +03003366 g O .bss 00000002 __key_prev +02018fec g O .rodata 0000000c _ZN11Gen3Pokemon8speedIVsE +02011354 g O .rodata 000001b0 .hidden GB_ShellTiles +030035f8 g O .data 00000004 var_box_return +0201240c g O .rodata 000001b4 .hidden lg_cartTiles +0200ed74 g O .rodata 00000020 .hidden backgroundPal +0200baa9 g F .text 00000154 chr4c_drawg_b1cts +03002f40 g O .bss 00000004 y_offset_timer +02007139 g F .text 00000088 _ZN11Select_Menu9show_menuEv +02005d0d g F .text 0000007c _Z12pokedex_hidev +0200a66d g F .text 0000009c _ZN13PokemonTablesC2Ev +02019190 g O .rodata 0000000c _ZN11Gen3Pokemon10hasSpeciesE +02003055 g F .text 00000016 _ZN19mystery_gift_script7releaseEv +0200ec2c g O .rodata 00000148 .hidden backgroundMap +030033f0 g O .bss 00000168 __sf +02018fa8 w O .rodata 00000014 _ZTV11Gen3Pokemon +020082a5 g F .text 000000a4 _Z12fennel_speaki +02009e1d w F .text 00000018 _ZN11Gen2Pokemon11setHeldItemEh +02002f35 g F .text 00000038 _ZN19mystery_gift_script4callEm +0005d486 w .debug_info 00000000 .hidden openingBG.c.3f7ffebd +0300182c g O .bss 0000000c box_viewer +03001858 g O .bss 00000020 langs +02006195 g F .text 0000000c _ZN13Pokemon_Party14get_last_errorEv +02001645 g F .text 0000000c _ZdlPvj +02008c79 w F .text 00000004 _ZN9GBPokemon11getHeldItemEv +0201df00 g *ABS* 00000000 __iwram_overlay_lma +020072c5 g F .text 00000144 _ZN11Select_Menu16select_menu_mainEv +020188b0 g O .rodata 00000258 transfer_script_params +0200bff5 g F .text 00000004 ObjAffineSet +020007b9 g F .text 00000016 _ZN6ButtonC2EP8OBJ_ATTR +0200b419 g F .text 00000092 schr4c_frame +02009ab5 g F .text 000000ee _ZN9GBPokemon7setMiscEP11Gen3Pokemon +020081e5 g F .text 000000c0 _Z12fennel_blinki +0200bf65 g F .text 00000010 VBlankIntrDelay +0200bfe9 g F .text 00000004 CpuFastSet +02008a55 g F .text 00000014 _Z10ptgb_writePKhb 03007fa0 g *ABS* 00000000 __sp_irq -0200c43d g F .text 00000004 MidiKey2Freq -0300174c g O .bss 00000004 fennel_blink_timer -0200186d g F .text 00000010 _Z17get_string_lengthPKh -02008787 g F .text 0000000e _ZN7asm_var9set_startEv -02006259 g F .text 00000104 _ZN19payload_file_reader12read_payloadEPhhh -02012238 g O .rodata 00000020 .hidden ptgb_logo_lPal -0200eebc g O .rodata 00000aa4 .hidden fennelBGTiles -0200e7cc g O .rodata 00000118 .hidden button_noTiles -02009fb5 g F .text 0000000c _Z24get_curr_flex_backgroundv -020088ad g F .text 00000010 _ZN7asm_var16get_loc_in_sec30Ev -0200fd14 g O .rodata 000000b4 .hidden flag_freTiles -0200d45c g F .text 00000000 .hidden __aeabi_idiv +02003425 g F .text 000025e6 _ZN19mystery_gift_script12build_scriptEP7PokeBox +02018d24 g O .rodata 00000018 _ZN9GBPokemon5defDVE +0200c035 g F .text 00000004 MidiKey2Freq +03001568 g O .bss 00000004 fennel_blink_timer +03003ecc g O .data 00000014 _ZN9GBPokemon3DVsE +02001289 g F .text 00000010 _Z17get_string_lengthPKh +02009ded w F .text 00000018 _ZN11Gen2Pokemon16setPokerusStrainEh +0005d204 w .debug_info 00000000 .hidden link_frame2.c.225a3e13 +02008c7d w F .text 00000004 _ZN9GBPokemon13getFriendshipEv +02006b1b g F .text 0000000e _ZN7asm_var9set_startEv +02013148 g O .rodata 00000020 .hidden ptgb_logo_lPal +0200fdcc g O .rodata 00000aa4 .hidden fennelBGTiles +0200f6dc g O .rodata 00000118 .hidden button_noTiles +02008349 g F .text 0000000c _Z24get_curr_flex_backgroundv +02006c41 g F .text 00000010 _ZN7asm_var16get_loc_in_sec30Ev +02010c24 g O .rodata 000000b4 .hidden flag_freTiles +0200d9a4 g F .text 00000000 .hidden __aeabi_idiv 03008000 g .crt0 00000000 __iwram_top -02000d61 g F .text 00000054 _Z9read_flagt -020116d0 g O .rodata 00000018 .hidden link_blobsTiles -030016f0 g O .bss 00000015 data_packet -02010038 g O .rodata 00000140 .hidden flag_korTiles +0005c970 w .debug_info 00000000 .hidden flag_jpn.c.0467da7a +02000d95 g F .text 00000054 _Z9read_flagt +0201910c g O .rodata 0000000c _ZN11Gen3Pokemon9expPointsE +020125e0 g O .rodata 00000018 .hidden link_blobsTiles +02010f48 g O .rodata 00000140 .hidden flag_korTiles 020000c5 g .crt0 00000000 __slave_number -0200bd5d g F .text 000000c0 srf_init -030032ac g *ABS* 00000000 __data_end__ -02010178 g O .rodata 00000010 .hidden flag_korPal -0200190f g F .text 0000000c _Z21interrupt_set_handler15interrupt_indexPFvvE -020176e0 g .rodata 00000000 PKMN_NAMES_english_lz10_bin_end -0200bbd1 g F .text 00000152 schr4c_floodfill_internal -02007fa9 g F .text 0000000c _Z13rand_get_seedv -02008009 g F .text 00000006 _ZN8rom_dataC1Ev -0200074b g F .text 00000024 _ZN6Button13set_highlightEb -02011760 g O .rodata 0000001c .hidden link_frame2Tiles -030019ed g O .bss 00000001 current_bank +02009f19 w F .text 0000001c _ZN11Gen3Pokemon21getSpeciesIndexNumberEv +0005c87c w .debug_info 00000000 .hidden flag_ger.c.e696bd83 +0200b955 g F .text 000000c0 srf_init +0005cb58 w .debug_info 00000000 .hidden GB_Shell.c.e4651881 +03004574 g *ABS* 00000000 __data_end__ +020191e4 g O .rodata 0000000c _ZN11Gen3Pokemon18nicknameLetterFiveE +02009ca1 w F .text 00000014 _ZN11Gen1Pokemon12getCurrentHPEv +02011088 g O .rodata 00000010 .hidden flag_korPal +02000355 g F .text 000003a6 _ZN8Box_Menu8box_mainEP7PokeBox +02017094 g .rodata 00000000 PKMN_NAMES_english_lz10_bin_end +0200b7c9 g F .text 00000152 schr4c_floodfill_internal +020063f5 g F .text 00000006 _ZN8rom_dataC1Ev +02000767 g F .text 00000024 _ZN6Button13set_highlightEb +02012670 g O .rodata 0000001c .hidden link_frame2Tiles +03001809 g O .bss 00000001 current_bank +0200a351 g F .text 00000014 _ZN7PokeBox10getPokemonEi 02040000 g .crt0 00000000 __eheap_end -0200af69 g F .text 00000014 key_repeat_limits -0300171c g O .bss 00000004 zero_count -0201b4c8 g O .rodata 00000010 _ZTV7xse_var -02002619 g F .text 00000074 _Z20initalization_scriptv -0200a053 g F .text 00000002 _Z18update_menu_spriteP13Pokemon_Partyii -0200ce7d g F .text 00000014 __sfp_lock_acquire -02007ae1 g F .text 00000018 _ZN13PokemonTables17get_earliest_moveEi -02006d3d g F .text 0000004c _ZN7Pokemon15get_simple_pkmnEv -03003058 g *ABS* 00000000 __bss_end__ -0200de6c g O .rodata 00000070 .hidden box_selectTiles -02007d11 g F .text 0000000c _ZN13Pokemon_Party8get_langEv -0200abb3 g F .text 0000000e _free_r -020183ac g .rodata 00000000 PTGB_english_lz10_bin_end -02010cec g O .rodata 0000013c .hidden Label_CrystalTiles -0200d319 g F .text 00000014 .hidden __gnu_thumb1_case_shi -0200ada9 g F .text 000000a4 __toncset -03001708 g O .bss 00000001 failed_packet -020116b0 g O .rodata 00000020 .hidden lg_cartPal -020007f5 g F .text 00000060 _ZN11Button_MenuC1Eiiiib -0200a3e1 g F .text 00000008 _ZN15text_data_tableC2EPh -03002578 g O .bss 00000004 down_arrow -020038b5 g F .text 00000028 _ZN19mystery_gift_script18changePaletteMacroEhh +02018cc4 g O .rodata 00000018 _ZN9GBPokemon14ppUpNumMoveTwoE +0200ab61 g F .text 00000014 key_repeat_limits +02018b28 g O .rodata 00000010 _ZTV7xse_var +02002011 g F .text 00000074 _Z20initalization_scriptv +03001624 g O .bss 000000a4 curr_GBA_rom +02008c89 w F .text 00000004 _ZN9GBPokemon17getCaughtDataTimeEv +020190ac g O .rodata 0000000c _ZN11Gen3Pokemon9moveThreeE +0200cbc9 g F .text 00000014 __sfp_lock_acquire +0200a7b1 g F .text 0000000e _ZN13PokemonTables17get_earliest_moveEi +030035a8 g *ABS* 00000000 __bss_end__ +0200ed94 g O .rodata 00000070 .hidden box_selectTiles +02006281 g F .text 0000000c _ZN13Pokemon_Party8get_langEv +0200d245 g F .text 000001d8 _free_r +02017c80 g .rodata 00000000 PTGB_english_lz10_bin_end +02011bfc g O .rodata 0000013c .hidden Label_CrystalTiles +02008c91 w F .text 00000004 _ZN9GBPokemon19getCaughtDataGenderEv +02008c59 w F .text 00000004 _ZN9GBPokemon12getCurrentHPEv +0200d861 g F .text 00000014 .hidden __gnu_thumb1_case_shi +02009f35 w F .text 00000012 _ZN11Gen3PokemonD0Ev +0200a365 g F .text 0000000c _ZN7PokeBox12getGBPokemonEi +0200a9a1 g F .text 000000a4 __toncset +020125c0 g O .rodata 00000020 .hidden lg_cartPal +02000811 g F .text 00000060 _ZN11Button_MenuC1Eiiiib +02008c85 w F .text 00000004 _ZN9GBPokemon23getPokerusDaysRemainingEv +02008775 g F .text 00000008 _ZN15text_data_tableC2EPh +03002ec0 g O .bss 00000004 down_arrow +02008ca9 w F .text 00000004 _ZN9GBPokemon17setCaughtDataTimeEh +020032ad g F .text 00000028 _ZN19mystery_gift_script18changePaletteMacroEhh +02019148 g O .rodata 0000000c _ZN11Gen3Pokemon28originalTrainerNameLetterSixE 03000201 g F .iwram 00000074 _Z16copy_save_to_ramjPhj -02013254 g O .rodata 00000040 .hidden typesPal +02014164 g O .rodata 00000040 .hidden typesPal +03003f90 g O .data 00000004 __malloc_sbrk_base 02000000 g .crt0 00000000 _start -0200c3d1 g F .text 00000004 IntrWait -030024e4 g O .bss 00000004 gba_cart -0200c399 g F .text 00000006 DivAbs -02007b4d g F .text 00000028 _ZN13PokemonTables18load_input_charsetEhh -0200875f g F .text 00000008 _ZNK10script_obj8has_textEv -02018988 g .rodata 00000000 TYPES_lz10_bin_end +0201904c g O .rodata 0000000c _ZN11Gen3Pokemon11metLocationE +0200bfc9 g F .text 00000004 IntrWait +03002e2c g O .bss 00000004 gba_cart +0200bf91 g F .text 00000006 DivAbs +02006af3 g F .text 00000008 _ZNK10script_obj8has_textEv +0201825c g .rodata 00000000 TYPES_lz10_bin_end +0200a015 g F .text 00000018 _ZN11Gen3Pokemon15getNextRand_u16Ev 03007f00 g *ABS* 00000000 __sp_usr -03002600 g O .bss 00000004 curr_flex_background -02001521 g F .text 00000154 _Z20link_animation_statei -0200d709 g F .text 00000018 __libc_lock_release_recursive -0200ed08 g O .rodata 00000194 .hidden emerald_cartTiles -02014c08 g .rodata 00000000 FIRST_MOVES_lz10_bin_end -02001441 g F .text 0000000c _Z18enable_auto_randomv -02006d89 g F .text 00000338 _ZN7Pokemon12set_to_eventER13PokemonTablesh -0200ff58 g O .rodata 000000d0 .hidden flag_jpnTiles -0200afc1 g F .text 0000002c irq_set_master -0200aed1 g F .text 00000058 key_poll -0200a4b5 g F .text 0000005c _Z16init_text_enginev -020094b1 g F .text 00000030 _Z25reload_textbox_backgroundv -0200874d g F .text 00000012 _ZN10script_objC1ERK17script_obj_params -030030cc g O .data 00000004 y_offset_direction +03002f48 g O .bss 00000004 curr_flex_background +02008c81 w F .text 00000004 _ZN9GBPokemon16getPokerusStrainEv +02009e05 w F .text 00000018 _ZN11Gen2Pokemon13setFriendshipEh +02000f65 g F .text 00000154 _Z20link_animation_statei +0200dca1 g F .text 00000018 __libc_lock_release_recursive +0200fc18 g O .rodata 00000194 .hidden emerald_cartTiles +0201922c g O .rodata 0000000c _ZN11Gen3Pokemon9trainerIDE +02010e68 g O .rodata 000000d0 .hidden flag_jpnTiles +0200abb9 g F .text 0000002c irq_set_master +0200aac9 g F .text 00000058 key_poll +02008849 g F .text 0000005c _Z16init_text_enginev +02007845 g F .text 00000030 _Z25reload_textbox_backgroundv +02006ae1 g F .text 00000012 _ZN10script_objC1ERK17script_obj_params +0005cc4c w .debug_info 00000000 .hidden GBCS_Shell.c.b7c5799b +03003eb8 g O .data 00000004 y_offset_direction +02008c9d w F .text 00000004 _ZN9GBPokemon13setFriendshipEh 02000351 g F .text 00000002 _ZN8Box_MenuC1Ev -0200c411 g F .text 00000004 RLUnCompWram -02000935 g F .text 00000178 _ZN11Button_Menu11button_mainEv -02011960 g O .rodata 00000020 .hidden lookerRSEPal -030030c0 g O .data 00000004 var_call_return_2 -0200829d g F .text 0000002a _Z18get_dex_completionib -02012424 g O .rodata 00000188 .hidden ruby_cartTiles -0200b389 g F .text 00000024 schr4c_get_pixel -02007a69 g F .text 0000001c _ZN13PokemonTables17get_num_abilitiesEi -0200b505 g F .text 0000031c schr4c_blit -02007bdd g F .text 00000014 _ZN13Pokemon_PartyC1Ev -020079a1 g F .text 00000018 _ZN13PokemonTables18load_gender_ratiosEv -02011fe4 g O .rodata 00000254 .hidden ptgb_logo_lTiles -03003064 g O .data 00000004 vid_page -0200cba9 g F .text 00000068 strncpy -020081e9 g F .text 0000004c _Z22write_custom_save_datav -02014ddc g .rodata 00000000 gb_gen1_payloads_RB_lz10_bin_end -030018e0 g O .bss 00000004 ptr_call_check_flag -03001780 g O .bss 00000048 __tte_main_context -02002eb5 w F .text 00000030 _ZN12LinkRawCable10deactivateEv -02001991 g F .text 0000021a npf_vpprintf -03002604 g O .bss 00000400 obj_buffer -0200e8e4 g O .rodata 00000020 .hidden button_noPal -020006e1 g F .text 00000002 _ZN6ButtonC2Ev -0200aac1 g F .text 000000c4 realloc -0200ea34 g O .rodata 00000168 .hidden dexBGTiles -0200889f g F .text 0000000c _ZN7asm_var9set_startEb -0200344d g F .text 0000001c _ZN19mystery_gift_script13virtualmsgboxEm -020033f1 g F .text 00000016 _ZN19mystery_gift_script4lockEv -020023c1 g F .text 00000018 tte_set_margins -03002a0c g O .bss 00000004 line_char_index -02012754 g O .rodata 00000020 .hidden sapphire_cartPal -0200b2c9 g F .text 0000004c oam_init -0200bbc1 g F .text 00000010 schr4c_get_ptr -02018834 g .rodata 00000000 RSEFRLG_english_lz10_bin_end -02011aec g O .rodata 00000384 .hidden openingBGTiles -02007c3d g F .text 00000080 _ZN13Pokemon_Party18get_converted_pkmnER13PokemonTablesi -02000701 g F .text 0000004a _ZN6Button12set_locationEii -030025d4 g O .bss 00000004 btn_c_r -02006059 g F .text 000001f8 _Z14inject_mysteryR13Pokemon_Party -02006d1d g F .text 0000000c _ZN7Pokemon12get_validityEv -02008861 g F .text 00000008 _ZN9music_var9set_startEv -030018b8 g O .bss 00000004 ptr_block_ptr_low -0201c1b4 g .ewram 00000000 nocash_buffer -02007ecd g F .text 00000070 _ZN13Pokemon_Party12init_payloadEv -03001707 g O .bss 00000001 init_packet -0200b8b5 g F .text 00000160 schr4c_rect +0200c009 g F .text 00000004 RLUnCompWram +02009c79 w F .text 00000014 _ZN11Gen1Pokemon12getCatchRateEv +02000951 g F .text 00000174 _ZN11Button_Menu11button_mainEv +02012870 g O .rodata 00000020 .hidden lookerRSEPal +030035fc g O .data 00000004 var_call_return_2 +02006689 g F .text 0000002a _Z18get_dex_completionib +02018cac g O .rodata 00000018 _ZN9GBPokemon16ppUpNumMoveThreeE +0201907c g O .rodata 0000000c _ZN11Gen3Pokemon11moveThreePPE +02013334 g O .rodata 00000188 .hidden ruby_cartTiles +0200af81 g F .text 00000024 schr4c_get_pixel +0200a739 g F .text 00000018 _ZN13PokemonTables17get_num_abilitiesEi +02019184 g O .rodata 0000000c _ZN11Gen3Pokemon28originalTrainerNameLetterOneE +0200b0fd g F .text 0000031c schr4c_blit +0200a02d g F .text 00000042 _ZN11Gen3Pokemon10setAbilityEm +02008cb1 w F .text 00000004 _ZN9GBPokemon19setCaughtDataGenderEh +0200611d g F .text 00000030 _ZN13Pokemon_PartyC1Ev +02012ef4 g O .rodata 00000254 .hidden ptgb_logo_lTiles +030035ac g O .data 00000004 vid_page +0200c7dd g F .text 00000068 strncpy +020065d5 g F .text 0000004c _Z22write_custom_save_datav +0300355c g O .bss 00000028 __malloc_current_mallinfo +030016fc g O .bss 00000004 ptr_call_check_flag +0300159c g O .bss 00000048 __tte_main_context +020028ad w F .text 00000030 _ZN12LinkRawCable10deactivateEv +02009d19 w F .text 00000012 _ZN11Gen1PokemonD0Ev +02001389 g F .text 0000021a npf_vpprintf +03002f4c g O .bss 00000400 obj_buffer +0200f7f4 g O .rodata 00000020 .hidden button_noPal +020006fd g F .text 00000002 _ZN6ButtonC2Ev +0200f944 g O .rodata 00000168 .hidden dexBGTiles +02006c33 g F .text 0000000c _ZN7asm_var9set_startEb +02002e45 g F .text 0000001c _ZN19mystery_gift_script13virtualmsgboxEm +02008efd w F .text 00000020 _ZN11Gen3Pokemon7getMoveEi +02002de9 g F .text 00000016 _ZN19mystery_gift_script4lockEv +02001db9 g F .text 00000018 tte_set_margins +03003354 g O .bss 00000004 line_char_index +02013664 g O .rodata 00000020 .hidden sapphire_cartPal +0200aec1 g F .text 0000004c oam_init +0200b7b9 g F .text 00000010 schr4c_get_ptr +02018108 g .rodata 00000000 RSEFRLG_english_lz10_bin_end +020129fc g O .rodata 00000384 .hidden openingBGTiles +0200071d g F .text 0000004a _ZN6Button12set_locationEii +02019028 g O .rodata 0000000c _ZN11Gen3Pokemon16pokeballCaughtInE +03002f1c g O .bss 00000004 btn_c_r +02006bf5 g F .text 00000008 _ZN9music_var9set_startEv +030016d4 g O .bss 00000004 ptr_block_ptr_low +0005c5d8 w .debug_info 00000000 .hidden dexBG.c.371b9180 +0201901c g O .rodata 0000000c _ZN11Gen3Pokemon21originalTrainerGenderE +0201e008 g .ewram 00000000 nocash_buffer +02018cf4 g O .rodata 00000018 _ZN9GBPokemon5spcDVE +02019118 g O .rodata 0000000c _ZN11Gen3Pokemon8heldItemE +0200b4ad g F .text 00000160 schr4c_rect 020000e0 g .crt0 00000000 start_vector -0200c3e5 g F .text 00000004 ArcTan -02003927 w F .text 0000002e _ZN4ptgb6vectorImED2Ev -0200b3ad g F .text 00000034 schr4c_plot -020039b7 w F .text 0000002e _ZN4ptgb6vectorIhED2Ev +0200bfdd g F .text 00000004 ArcTan +0200331f w F .text 0000002e _ZN4ptgb6vectorImED2Ev +0200afa5 g F .text 00000034 schr4c_plot +020033af w F .text 0000002e _ZN4ptgb6vectorIhED2Ev 03000000 g .crt0 00000000 __iwram_start -030025ec g O .bss 00000004 ptgb_logo_r -02015198 g .rodata 00000000 gb_gen2_payloads_lz10_bin_end -020079b9 g F .text 0000001c _ZN13PokemonTables18load_num_abilitiesEv -030024c4 g O .bss 00000004 global_tile_id_end -0200d5ad w F .text 00000002 .hidden __aeabi_ldiv0 -0200c3c9 g F .text 00000004 Halt -02000771 g F .text 0000002c _ZN6Button4hideEv -0200d7f8 g .text 00000000 __text_end -0201af20 g O .rodata 00000018 EXP_MAXIMUMS -0300172c g O .bss 00000004 data_counter -02010788 g O .rodata 000001e8 .hidden GBCS_ShellTiles -030019e8 g O .bss 00000004 u32_rand -02008195 g F .text 00000020 _ZN8rom_data16is_ruby_sapphireEv -02010028 g O .rodata 00000010 .hidden flag_jpnPal -0200d149 g F .text 00000034 __sread -0200b271 g F .text 00000054 irq_disable -03001730 g O .bss 00000004 counter -0200c3c5 g F .text 00000004 RegisterRamReset -030016ec g O .bss 00000004 newest_save_offset -02007d1d g F .text 00000078 _ZN13Pokemon_Party11load_gb_romEv -020088ed g F .text 0000007a _ZN11textbox_var11insert_textEPKtPhb -0200089d g F .text 00000098 _ZN11Button_Menu16organize_buttonsEv -02012934 g O .rodata 00000020 .hidden textBoxBGPal +03002f34 g O .bss 00000004 ptgb_logo_r +03002e0c g O .bss 00000004 global_tile_id_end +0200daf5 w F .text 00000002 .hidden __aeabi_ldiv0 +0200a0b3 g F .text 00000016 _ZN11Gen3Pokemon20encryptSubstructuresEv +0200bfc1 g F .text 00000004 Halt +0200980d g F .text 00000076 _ZN9GBPokemon13setOriginInfoEP11Gen3Pokemon +0200078d g F .text 0000002c _ZN6Button4hideEv +03003f98 g O .data 00000408 __malloc_av_ +02009c3d w F .text 00000002 _ZN11Gen1PokemonD2Ev +0200dd90 g .text 00000000 __text_end +0201c74c g O .rodata 00000018 EXP_MAXIMUMS +02011698 g O .rodata 000001e8 .hidden GBCS_ShellTiles +02018db4 g O .rodata 00000018 _ZN9GBPokemon7moveTwoE +03001804 g O .bss 00000004 u32_rand +02006581 g F .text 00000020 _ZN8rom_data16is_ruby_sapphireEv +0005c174 w .debug_info 00000000 .hidden arrows.c.18a066c9 +02010f38 g O .rodata 00000010 .hidden flag_jpnPal +0200d691 g F .text 00000034 __sread +0200ae69 g F .text 00000054 irq_disable +02009d71 w F .text 00000002 _ZN11Gen2PokemonD2Ev +02009d2d g F .text 00000018 _ZN11Gen1Pokemon21setSpeciesIndexNumberEh +02009d01 w F .text 00000018 _ZN11Gen1Pokemon12setCurrentHPEh +0200bfbd g F .text 00000004 RegisterRamReset +02008cb9 w F .text 00000002 _ZN9GBPokemonD1Ev +0300155c g O .bss 00000004 newest_save_offset +0200628d g F .text 00000080 _ZN13Pokemon_Party11load_gb_romEv +02006c81 g F .text 0000007a _ZN11textbox_var11insert_textEPKtPhb +0201919c g O .rodata 0000000c _ZN11Gen3Pokemon8languageE +020008b9 g F .text 00000098 _ZN11Button_Menu16organize_buttonsEv +0200d669 g F .text 00000014 __malloc_lock +02013844 g O .rodata 00000020 .hidden textBoxBGPal +02008cad w F .text 00000004 _ZN9GBPokemon18setCaughtDataLevelEh 0300028f g F .iwram 00000016 _Z13read_int_savej -0200be49 g F .text 00000066 srf_get_ptr -030025e8 g O .bss 00000004 btn_t_l -0200d07d g F .text 0000006e _fflush_r +0005d7a2 w .debug_info 00000000 .hidden types.c.d34fda0f +0200ba41 g F .text 00000066 srf_get_ptr +020083e5 g F .text 00000002 _Z23update_front_box_spriteP9GBPokemon +03002f30 g O .bss 00000004 btn_t_l +0200d59d g F .text 0000006e _fflush_r +0005cd40 w .debug_info 00000000 .hidden Label_Blue.c.92e2e89b +02008c5d w F .text 00000004 _ZN9GBPokemon18getStatusConditionEv 03000151 g F .iwram 00000088 _Z12erase_sectorj -02003275 g F .text 00000004 _ZNK19mystery_gift_script10get_scriptEv -030030c4 g O .data 00000004 var_call_check_flag +02002c6d g F .text 00000004 _ZNK19mystery_gift_script10get_scriptEv +03003600 g O .data 00000004 var_call_check_flag 0300000b g F .iwram 00000028 _Z18delay_cycles_untilmPVhhh -02006251 g F .text 00000008 _ZN19payload_file_readerC2EPKht -020105f4 g O .rodata 00000194 .hidden GBC_ShellTiles -030025dc g O .bss 00000004 btn_p_r -020088cd g F .text 00000014 _ZN11textbox_var8set_textEPKh -02010e28 g O .rodata 00000020 .hidden Label_CrystalPal -0200c971 g F .text 0000008c memset -0200a8a5 g F .text 00000008 _Z28get_compressed_rsefrlg_tablev -02002b55 g F .text 000001a4 main -020016d5 g F .text 00000116 _Z17global_next_framev -0200385d g F .text 00000058 _ZN19mystery_gift_script17changeSpriteMacroEhm -02007bc9 g F .text 00000014 _ZN13PokemonTables14get_gen_3_charEt -02008a41 w F .text 0000004e _ZN4ptgb6vectorIP10script_varE9push_backERKS2_ -02009a7d g F .text 000000bc _Z21load_temp_box_spritesP13Pokemon_Party -020070c1 g F .text 0000089c _ZN7Pokemon20convert_to_gen_threeER13PokemonTables16Conversion_Typesbb -02006879 g F .text 00000052 _ZN7PokemonC1Ev -0200d340 g F .text 00000000 .hidden __aeabi_uidiv -030030a8 w O .data 00000004 _ZZ8n2hexstrIiEvPcT_jE6digits -02000bb5 g F .text 00000030 _ZN3Dex4hideEv -02014b18 g .rodata 00000000 FIRST_MOVES_lz10_bin -0200c3f9 g F .text 00000004 BgAffineSet -0200d205 g F .text 00000010 __sclose -0200363d g F .text 00000020 _ZN19mystery_gift_script7callstdEh -0200a8b5 g F .text 00000008 _Z28get_compressed_credits_tablev -0201b798 g .init_array 00000000 __init_array_end -0200aba5 g F .text 0000000e _malloc_r -0201c208 g *ABS* 00000000 __ewram_end -030025e4 g O .bss 00000004 btn_t_r -030006cc g O .bss 00000004 y -02008ec5 g F .text 0000006c _ZN11Select_Menu9hide_menuEv -0200be1d g F .text 0000002a srf_pal_copy -0200c439 g F .text 00000004 SoundChannelClear -02007db1 g F .text 000000fc _ZN13Pokemon_Party22fill_simple_pkmn_arrayER13PokemonTables +02008f41 w F .text 00000024 _ZN9GBPokemon12getExpPointsEv +03003f40 g O .data 0000001c _ZN11Gen3Pokemon19originalTrainerNameE +02011504 g O .rodata 00000194 .hidden GBC_ShellTiles +03002f24 g O .bss 00000004 btn_p_r +02019058 g O .rodata 0000000c _ZN11Gen3Pokemon20pokerusDaysRemainingE +02006c61 g F .text 00000014 _ZN11textbox_var8set_textEPKh +02009e99 w F .text 00000014 _ZN11Gen2Pokemon16getPokerusStrainEv +02008c69 w F .text 00000004 _ZN9GBPokemon12setCurrentHPEh +02011d38 g O .rodata 00000020 .hidden Label_CrystalPal +0200c5a5 g F .text 0000008c memset +02008c39 g F .text 00000008 _Z28get_compressed_rsefrlg_tablev +02018f9c g O .rodata 0000000c _ZN11Gen2Pokemon11g2_heldItemE +0200254d g F .text 000001a4 main +03003584 g O .bss 00000004 __malloc_max_total_mem +02001119 g F .text 00000116 _Z17global_next_framev +0005d708 w .debug_info 00000000 .hidden textBoxBG.c.357acc7f +02003255 g F .text 00000058 _ZN19mystery_gift_script17changeSpriteMacroEhm +02018d9c g O .rodata 00000018 _ZN9GBPokemon9moveThreeE +0005c55e w .debug_info 00000000 .hidden button_yes.c.f6ecc8db +0200a8a9 g F .text 00000014 _ZN13PokemonTables14get_gen_3_charEt +02006dd5 w F .text 0000004e _ZN4ptgb6vectorIP10script_varE9push_backERKS2_ +02008ca1 w F .text 00000004 _ZN9GBPokemon16setPokerusStrainEh +0200a4bd g F .text 00000014 _ZN7PokemonC1Ev +0200d888 g F .text 00000000 .hidden __aeabi_uidiv +030035bc w O .data 00000004 _ZZ8n2hexstrIiEvPcT_jE6digits +02000be9 g F .text 00000030 _ZN3Dex4hideEv +0200bff1 g F .text 00000004 BgAffineSet +0200d74d g F .text 00000010 __sclose +02009da5 w F .text 00000018 _ZN11Gen2Pokemon18setCaughtDataLevelEh +02009d71 w F .text 00000002 _ZN11Gen2PokemonD1Ev +02019034 g O .rodata 0000000c _ZN11Gen3Pokemon12gameOfOriginE +02003035 g F .text 00000020 _ZN19mystery_gift_script7callstdEh +02008c49 g F .text 00000008 _Z28get_compressed_credits_tablev +0201ca04 g .init_array 00000000 __init_array_end +02009e71 w F .text 00000014 _ZN11Gen2Pokemon17getCaughtDataTimeEv +0200cc49 g F .text 00000550 _malloc_r +0201e05c g *ABS* 00000000 __ewram_end +03002f2c g O .bss 00000004 btn_t_r +0300053c g O .bss 00000004 y +02007259 g F .text 0000006c _ZN11Select_Menu9hide_menuEv +0200ba15 g F .text 0000002a srf_pal_copy +0200c031 g F .text 00000004 SoundChannelClear +02008f8d g F .text 00000040 _ZN9GBPokemonC2Ev +02018e90 g O .rodata 0000000c _ZN11Gen1Pokemon12g1_catchRateE +02018cdc g O .rodata 00000018 _ZN9GBPokemon14ppUpNumMoveOneE 03007ff8 g *ABS* 00000000 __irq_flags +02009c61 w F .text 00000018 _ZN11Gen1Pokemon7getTypeEi +02008c99 w F .text 00000004 _ZN9GBPokemon11setHeldItemEh 00000001 g F *ABS* 00000000 .hidden __sync_synchronize -0200a3e9 g F .text 00000022 _ZN15text_data_table10decompressEPKh -02007bf1 g F .text 00000040 _ZN13Pokemon_Party13continue_linkEb -0201c208 g *ABS* 00000000 __end__ -02008d69 g F .text 0000003c _ZN11Select_MenuC2Ebhii -0201c208 g *ABS* 00000000 __sbss_start__ -020007f5 g F .text 00000060 _ZN11Button_MenuC2Eiiiib -0200d45c g F .text 00000130 .hidden __divsi3 -02007f9d g F .text 0000000c _Z13rand_set_seedj -030024e0 g O .bss 00000004 link_frame1 -02015bb8 g .rodata 00000000 gen_2_charsets_lz10_bin -0200877f g F .text 00000008 _ZNK10script_obj11get_cond_idEv +0200877d g F .text 00000022 _ZN15text_data_table10decompressEPKh +0005d614 w .debug_info 00000000 .hidden ruby_cart.c.9ac6fc39 +020191d8 g O .rodata 0000000c _ZN11Gen3Pokemon17nicknameLetterSixE +02009e5d w F .text 00000014 _ZN11Gen2Pokemon18getCaughtDataLevelEv +02006191 g F .text 00000002 _ZN13Pokemon_Party13continue_linkEb +0201e05c g *ABS* 00000000 __end__ +020190d0 g O .rodata 0000000c _ZN11Gen3Pokemon10friendshipE +020070fd g F .text 0000003c _ZN11Select_MenuC2Ebhii +0201e05c g *ABS* 00000000 __sbss_start__ +02000811 g F .text 00000060 _ZN11Button_MenuC2Eiiiib +0201916c g O .rodata 0000000c _ZN11Gen3Pokemon30originalTrainerNameLetterThreeE +0200d9a4 g F .text 00000130 .hidden __divsi3 +02008f1d w F .text 00000024 _ZN9GBPokemon8getLevelEv +02006399 g F .text 0000000c _Z13rand_set_seedj +03002e28 g O .bss 00000004 link_frame1 +0200d199 g F .text 000000ac _malloc_trim_r +02006b13 g F .text 00000008 _ZNK10script_obj11get_cond_idEv +02018c94 g O .rodata 00000018 _ZN9GBPokemon15ppUpNumMoveFourE 03000331 g F .iwram 00000016 _Z16write_short_savejt -030030c8 g O .data 00000004 dex_x_cord -03001743 g O .bss 00000001 treecko_enabled -02003809 g F .text 00000038 _ZN19mystery_gift_script17writebytetooffsetEhm -020037f1 g F .text 00000016 _ZN19mystery_gift_script6waitseEv -020117c8 g O .rodata 000000b8 .hidden lookerFRLGTiles -020177c0 g .rodata 00000000 POWER_POINTS_lz10_bin_end -02001c97 g F .text 0000006e siscanf -020039e5 w F .text 00000046 _ZN4ptgb6vectorIhEC2ERKS1_ -020081b5 g F .text 00000004 _ZN8rom_data10verify_romEv -020006e3 g F .text 0000001e _ZN6ButtonC1EP8OBJ_ATTRS1_i -0300170c g O .bss 00000004 packet_index -0201628c g .rodata 00000000 gen_3_charsets_lz10_bin_end -0200dedc g O .rodata 0000045c .hidden boxBGTiles -02008a91 g F .text 00000038 _ZN10script_varC2EmRN4ptgb6vectorIPS_EEPi -020177c0 g .rodata 00000000 PTGB_english_lz10_bin -03001754 g O .bss 00000004 cable_frame -03001930 g O .bss 00000004 count -0200e904 g O .rodata 00000120 .hidden button_yesTiles -03001934 g O .bss 00000004 delay -02008275 g F .text 0000000c _Z16get_def_lang_numv -02016dec g .rodata 00000000 PKMN_NAMES_english_lz10_bin -0200d7f9 g F .fini 00000000 _fini -030019ee g O .bss 00000022 save_data_array -02008969 g F .text 00000006 _ZN12movement_var12set_movementEPKij -020037c9 g F .text 00000028 _ZN19mystery_gift_script6playseEt -02010424 g O .rodata 00000020 .hidden fr_cartPal -02001435 g F .text 0000000c _Z15get_frame_countv -0200b175 g F .text 000000a8 irq_delete -02014454 g O .rodata 00000080 tte_dotab_stdout -020039b7 w F .text 0000002e _ZN4ptgb6vectorIhED1Ev -02007af9 g F .text 00000054 _Z22load_localized_charsetPthh -020132ac g .rodata 00000000 latin_shortGlyphs -02000c25 g F .text 000000a4 _Z26initalize_memory_locationsv -020125cc g O .rodata 00000188 .hidden sapphire_cartTiles -0200dab0 g O .rodata 00000030 .hidden arrowsTiles -02008767 g F .text 00000008 _ZNK10script_obj20get_text_entry_indexEv -02008879 g F .text 00000010 _ZN10script_var14fill_refrencesEPh -0200d721 g F .text 0000005a _write_r -0200e678 g O .rodata 00000118 .hidden button_confirm_leftTiles -02008cb1 g F .text 000000a4 _ZN9music_var9add_trackEPKhj -0200c449 g F .text 00000004 SoundDriverVSyncOn -020034b7 g F .text 00000016 _ZN19mystery_gift_script12waitkeypressEv -03001738 g O .bss 00000004 frame -0200a56d g F .text 00000018 _Z13set_text_exitv -0200eb9c g O .rodata 0000014c .hidden dexBGMap -0200c3d9 g F .text 00000004 Div -030030dc g O .data 00000004 _impure_ptr -03003054 g O .bss 00000004 fake_heap_end -0200af7d g F .text 00000044 irq_init -030018f8 g O .bss 0000001c johto_count -0200cefd g F .text 00000180 __sflush_r -02007cbd g F .text 00000010 _ZN13Pokemon_Party16get_has_new_pkmnEv -02000aad w F .text 00000054 _ZN4ptgb6vectorI6ButtonE7reserveEt -020018f5 g F .text 0000000e _Z23convert_int_to_ptgb_striPh -0200cea5 g F .text 0000004c _fwalk_sglue -02015bb8 g .rodata 00000000 gen_1_charsets_lz10_bin_end -0201b780 g .init_array 00000000 __preinit_array_end -0200c3b1 g F .text 00000010 CpuFastFill -02000e3d g F .text 00000110 _Z5setupPKt -030025d8 g O .bss 00000004 btn_c_l -02008235 g F .text 00000020 _Z9is_caughti -0200079d g F .text 00000016 _ZN6ButtonC1EP8OBJ_ATTR -0200af59 g F .text 00000010 key_repeat_mask -0300173d g O .bss 00000001 in_data -0200a511 g F .text 00000038 _Z16text_next_obj_id10script_obj -03001938 g O .bss 00000004 speed -030018d4 g O .bss 00000004 ptr_dex_seen_caught -02009655 g F .text 0000001a _Z12add_menu_boxiii -0200c435 g F .text 00000004 SoundDriverVSync -030018ec g O .bss 00000004 kanto_offset -030018f4 g O .bss 00000004 kanto_dex_num -02010260 g O .rodata 00000010 .hidden flag_spaPal -02008e2d g F .text 00000004 _ZN11Select_Menu8set_langEh -02007a0d g F .text 0000001c _ZN13PokemonTables15load_event_pkmnEv -02008b9d g F .text 00000112 _ZN9music_var17insert_music_dataEPhhhhm -0200dae0 g O .rodata 00000224 .hidden backgroundTiles -02009671 g F .text 00000034 _Z19erase_textbox_tilesv -0200376d g F .text 0000005c _ZN19mystery_gift_script11setMetaTileEtttt -02008803 g F .text 00000046 _ZN7xse_var14fill_refrencesEPh +03003604 g O .data 00000004 dex_x_cord +03001560 g O .bss 00000001 treecko_enabled +02003201 g F .text 00000038 _ZN19mystery_gift_script17writebytetooffsetEhm +02019040 g O .rodata 0000000c _ZN11Gen3Pokemon8levelMetE +020031e9 g F .text 00000016 _ZN19mystery_gift_script6waitseEv +02019154 g O .rodata 0000000c _ZN11Gen3Pokemon29originalTrainerNameLetterFiveE +0005c2da w .debug_info 00000000 .hidden boxBG.c.28ff206d +020126d8 g O .rodata 000000b8 .hidden lookerFRLGTiles +02018f6c g O .rodata 0000000c _ZN11Gen2Pokemon17g2_caughtDataTimeE +0200168f g F .text 0000006e siscanf +020033dd w F .text 00000046 _ZN4ptgb6vectorIhEC2ERKS1_ +020065a1 g F .text 00000004 _ZN8rom_data10verify_romEv +020006ff g F .text 0000001e _ZN6ButtonC1EP8OBJ_ATTRS1_i +02008c95 w F .text 00000004 _ZN9GBPokemon21getCaughtDataLocationEv +0300359c g O .bss 00000004 fake_heap_start +02016294 g .rodata 00000000 gen_3_charsets_lz10_bin_end +0200ee04 g O .rodata 0000043c .hidden boxBGTiles +02006e25 g F .text 00000038 _ZN10script_varC2EmRN4ptgb6vectorIPS_EEPi +02017094 g .rodata 00000000 PTGB_english_lz10_bin +03001570 g O .bss 00000004 cable_frame +0300174c g O .bss 00000004 count +0200f814 g O .rodata 00000120 .hidden button_yesTiles +03001750 g O .bss 00000004 delay +02009c41 g F .text 00000020 _ZN11Gen1Pokemon21getSpeciesIndexNumberEv +02006661 g F .text 0000000c _Z16get_def_lang_numv +020167a0 g .rodata 00000000 PKMN_NAMES_english_lz10_bin +0005cfa2 w .debug_info 00000000 .hidden Label_Silver.c.ff4dd734 +020191f0 g O .rodata 0000000c _ZN11Gen3Pokemon18nicknameLetterFourE +0200dd91 g F .fini 00000000 _fini +0005d59a w .debug_info 00000000 .hidden ptgb_logo_r.c.72aa92a6 +0300180a g O .bss 00000022 save_data_array +02006cfd g F .text 00000006 _ZN12movement_var12set_movementEPKij +020031c1 g F .text 00000028 _ZN19mystery_gift_script6playseEt +02011334 g O .rodata 00000020 .hidden fr_cartPal +02000e91 g F .text 0000000c _Z15get_frame_countv +0200ad6d g F .text 000000a8 irq_delete +02015364 g O .rodata 00000080 tte_dotab_stdout +020033af w F .text 0000002e _ZN4ptgb6vectorIhED1Ev +02019214 g O .rodata 0000000c _ZN11Gen3Pokemon17nicknameLetterOneE +020141bc g .rodata 00000000 latin_shortGlyphs +02000c59 g F .text 000000a4 _Z26initalize_memory_locationsv +02008c8d w F .text 00000004 _ZN9GBPokemon18getCaughtDataLevelEv +020134dc g O .rodata 00000188 .hidden sapphire_cartTiles +0200e9d8 g O .rodata 00000030 .hidden arrowsTiles +02006afb g F .text 00000008 _ZNK10script_obj20get_text_entry_indexEv +02006c0d g F .text 00000010 _ZN10script_var14fill_refrencesEPh +0200dcb9 g F .text 0000005a _write_r +0200f588 g O .rodata 00000118 .hidden button_confirm_leftTiles +02007045 g F .text 000000a4 _ZN9music_var9add_trackEPKhj +0200c041 g F .text 00000004 SoundDriverVSyncOn +0005c788 w .debug_info 00000000 .hidden flag_eng.c.40fc661d +02002eaf g F .text 00000016 _ZN19mystery_gift_script12waitkeypressEv +02005a0d g F .text 000001f4 _Z14inject_mysteryP7PokeBox +02008901 g F .text 00000018 _Z13set_text_exitv +02019088 g O .rodata 0000000c _ZN11Gen3Pokemon9moveTwoPPE +0200faac g O .rodata 0000014c .hidden dexBGMap +0200bfd1 g F .text 00000004 Div +02019064 g O .rodata 0000000c _ZN11Gen3Pokemon13pokerusStrainE +030043a0 g O .data 00000004 _impure_ptr +030035a0 g O .bss 00000004 fake_heap_end +0200ab75 g F .text 00000044 irq_init +03001714 g O .bss 0000001c johto_count +0200d41d g F .text 00000180 __sflush_r +020061a1 g F .text 0000004a _ZN13Pokemon_Party16get_has_new_pkmnEv +02000ac5 w F .text 00000054 _ZN4ptgb6vectorI6ButtonE7reserveEt +02009915 g F .text 0000019e _ZN9GBPokemon9loadEventEP11Gen3Pokemon +02009245 g F .text 00000040 _ZN9GBPokemon14updateValidityEv +02001311 g F .text 0000000e _Z23convert_int_to_ptgb_striPh +0200cbf1 g F .text 0000004c _fwalk_sglue +020191b4 g O .rodata 0000000c _ZN11Gen3Pokemon18nicknameLetterNineE +0201c9ec g .init_array 00000000 __preinit_array_end +0200bfa9 g F .text 00000010 CpuFastFill +03002f20 g O .bss 00000004 btn_c_l +0200a467 g F .text 00000024 _ZN7PokeBox10convertAllEb +02018e14 g O .rodata 0000007c _ZTV11Gen1Pokemon +02006621 g F .text 00000020 _Z9is_caughti +020007b9 g F .text 00000016 _ZN6ButtonC1EP8OBJ_ATTR +0200ab51 g F .text 00000010 key_repeat_mask +020088a5 g F .text 00000038 _Z16text_next_obj_id10script_obj +03001754 g O .bss 00000004 speed +0200a82d g F .text 00000028 _ZN13PokemonTables18load_input_charsetEh8Language +030016f0 g O .bss 00000004 ptr_dex_seen_caught +020079e9 g F .text 0000001a _Z12add_menu_boxiii +0200c02d g F .text 00000004 SoundDriverVSync +03001708 g O .bss 00000004 kanto_offset +0005d372 w .debug_info 00000000 .hidden lookerRSE.c.1370e413 +03001710 g O .bss 00000004 kanto_dex_num +02009379 g F .text 0000005c _ZN9GBPokemon15convertNicknameEP11Gen3Pokemon +02011170 g O .rodata 00000010 .hidden flag_spaPal +020071c1 g F .text 00000004 _ZN11Select_Menu8set_langEh +02008cb5 w F .text 00000004 _ZN9GBPokemon21setCaughtDataLocationEh +02006f31 g F .text 00000112 _ZN9music_var17insert_music_dataEPhhhhm +0200ea08 g O .rodata 00000224 .hidden backgroundTiles +02007a05 g F .text 00000034 _Z19erase_textbox_tilesv +02009669 g F .text 000001a2 _ZN9GBPokemon11updateMovesEP11Gen3Pokemon +02003165 g F .text 0000005c _ZN19mystery_gift_script11setMetaTileEtttt +02006b97 g F .text 00000046 _ZN7xse_var14fill_refrencesEPh 03000275 g F .iwram 0000001a _Z15read_short_savej -0200b315 g F .text 0000001e obj_copy -03001710 g O .bss 00000004 next_offset -02003615 g F .text 00000028 _ZN19mystery_gift_script7specialEt -02006879 g F .text 00000052 _ZN7PokemonC2Ev -0201c0ac g *ABS* 00000000 __ewram_lma -02011128 g O .rodata 00000138 .hidden Label_RedTiles -020010e1 g F .text 000001a8 _Z18handleIncomingBytehPhS_P6GB_ROMP18Simplified_PokemonPKtb -02001c59 g F .text 00000024 chr4c_erase -0200d0ed g F .text 0000005c __swhatbuf_r -0200b35d g F .text 00000028 obj_unhide_multi -02015f68 g .rodata 00000000 gen_3_charsets_lz10_bin -02003469 g F .text 00000038 _ZN19mystery_gift_script11loadpointerEhm -0200d43c g F .text 00000020 .hidden __aeabi_uidivmod -0201b4f8 g O .rodata 00000010 _ZTV10sprite_var -030024d0 g O .bss 00000004 link_blob2 -0200c405 g F .text 00000004 LZ77UnCompWram -030030d0 g O .data 0000000c __sglue -02003841 g F .text 0000001a _ZN19mystery_gift_script11msgboxMacroEm -02000c05 g F .text 00000020 _Z14reverse_endianPhj -030006d4 g O .bss 00000001 mem_id -020088e1 g F .text 0000000a _ZN11textbox_var17set_virtual_startEv -0200d2f1 g F .text 00000012 .hidden __gnu_thumb1_case_sqi -020096f9 g F .text 000000e8 _Z17load_type_spritesPKhiib -02003715 g F .text 00000038 _ZN19mystery_gift_script7callASMEm -0200a89d g F .text 00000008 _Z25get_compressed_PTGB_tablev -0200c3cd g F .text 00000004 Stop -0201c208 g *ABS* 00000000 _end -020144d4 g .rodata 00000000 CREDITS_english_lz10_bin -0201af38 g O .rodata 000000bf gen_1_index_array -030018f0 g O .bss 00000004 johto_dex_num -020010b5 g F .text 0000002c _Z21exchange_remove_arrayhP18Simplified_Pokemonb -0201b7a8 g .eh_frame 00000000 __iwram_lma -0200828d g F .text 00000010 _Z17get_tutorial_flagv -02008ac9 g F .text 00000034 _ZN10script_varC2ERN4ptgb6vectorIPS_EEPi -02007bdd g F .text 00000014 _ZN13Pokemon_PartyC2Ev -0200c079 g F .text 00000048 tte_init_con -0200874d g F .text 00000012 _ZN10script_objC2ERK17script_obj_params -020064e5 g F .text 00000364 _Z12pokedex_loopv -02001e39 g F .text 000000a2 utf8_decode_char -0200d17d g F .text 0000004c __swrite -02001c35 g F .text 0000000c _Znwj -030030b0 g O .data 00000004 var_pkmn_offset -030017c8 g O .bss 00000040 yes_no_menu -03001734 g O .bss 00000001 connection_state -0201533c g .rodata 00000000 gb_rom_values_eng_lz10_bin_end -0200a415 g F .text 00000018 _ZNK15text_data_table14get_text_entryEt -0201177c g O .rodata 0000004c .hidden link_frame3Tiles -0300173c g O .bss 00000001 out_data -02007fd1 g F .text 00000018 _Z12get_rand_u16v -02002735 g F .text 00000318 _Z7creditsv -0300173e g O .bss 00000005 linkSPIInstance -02011280 g O .rodata 00000118 .hidden Label_SilverTiles -03001758 g O .bss 00000004 global_frame_count -020035d5 g F .text 00000028 _ZN19mystery_gift_script7fanfareEt -0201aff8 g O .rodata 00000258 event_script_params -030025fc g O .bss 00000004 y_offset -0201b700 g O .rodata 00000080 dotab_stdnull -0200c431 g F .text 00000004 SoundDriverMain -0200341d g F .text 00000030 _ZN19mystery_gift_script13virtualgotoifEhm -030030b8 g O .data 00000004 var_dex_seen_caught -030030e0 g O .data 00000140 _impure_data -0200c441 g F .text 00000004 MultiBoot -030024f0 g O .bss 00000004 button_cancel_right -030024d4 g O .bss 00000004 link_blob1 -020118a0 g O .rodata 000000c0 .hidden lookerRSETiles -0200ce91 g F .text 00000014 __sfp_lock_release -0200c3ed g F .text 00000004 CpuSet -02011e70 g O .rodata 00000154 .hidden openingBGMap -02002a4d g F .text 00000108 _Z14main_menu_loopv -020143d4 g O .rodata 00000080 tte_dotab_nocash -0200c3dd g F .text 00000004 DivArm -02018e41 g O .rodata 00001fa0 MOVESETS -020089b5 g F .text 0000008a _ZN10sprite_var18insert_sprite_dataEPhPKjjPKt -02003575 g F .text 00000038 _ZN19mystery_gift_script7compareEtt -0200acc5 g F .text 000000e4 tonccpy -030018e6 g O .bss 00000001 celebi_caught -02018834 g .rodata 00000000 TYPES_lz10_bin -02007a29 g F .text 0000001c _ZN13PokemonTables11get_max_expEi -02003a2d g F .text 0000262a _ZN19mystery_gift_script12build_scriptER13Pokemon_Party -02001bfd g F .text 00000016 npf_snprintf -0201b5fc g O .rodata 00000101 _ctype_ -02008739 g F .text 00000014 _ZN10script_objC1Ev -03002a20 g O .bss 00000038 IRQ_VectorTable -0200d5ad w F .text 00000002 .hidden __aeabi_idiv0 -0201b780 g .init_array 00000000 __init_array_start -020114dc g O .rodata 00000020 .hidden Label_YellowPal -02000dfd w F .text 00000040 _Z19LINK_SPI_ISR_SERIALv -03003080 g O .data 00000004 gp_tte_context -03001705 g O .bss 00000001 end_of_data -02010f94 g O .rodata 00000020 .hidden Label_GoldPal -030018e8 g O .bss 00000004 johto_offset -0200c40d g F .text 00000004 HuffUnComp -030018e4 g O .bss 00000001 asm_payload_location -02000f5d g F .text 00000158 _Z14exchange_boxeshPhP6GB_ROM -0200c619 g F .text 00000060 strlen -0200fdc8 g O .rodata 00000010 .hidden flag_frePal -0200b335 g F .text 00000028 obj_hide_multi -03001a1c g O .bss 00000020 games -02010b80 g O .rodata 0000014c .hidden Label_BlueTiles -020006e3 g F .text 0000001e _ZN6ButtonC2EP8OBJ_ATTRS1_i -00080000 g .ARM.attributes 00000000 _stack -0201533c g .rodata 00000000 gb_rom_values_fre_lz10_bin -030025c8 g O .bss 00000004 button_yes -02001d05 g F .text 00000014 __wrap___get_handle -0200a55d g F .text 00000010 _Z13hide_text_boxv -0200fe84 g O .rodata 00000010 .hidden flag_gerPal -0201be58 g *ABS* 00000000 __data_lma -020149cc g .rodata 00000000 EVENT_PKMN_lz10_bin -0200c3e1 g F .text 00000004 Sqrt -0200187d g F .text 00000078 _Z23convert_int_to_ptgb_striPhi -03001748 g O .bss 00000004 fennel_blink_state -02007cdd g F .text 0000000c _ZN13Pokemon_Party24set_mythic_stabilizationEb -0300193c g O .bss 00000004 dex_shift -0200c491 g F .text 000000bc strchr -030024dc g O .bss 00000004 link_frame2 -0200ba15 g F .text 0000015e schr4c_line -0200c3f5 g F .text 00000004 BiosCheckSum -02011fc4 g O .rodata 00000020 .hidden openingBGPal -02007989 g F .text 00000018 _ZN13PokemonTables15load_exp_groupsEv +0200af0d g F .text 0000001e obj_copy +0200300d g F .text 00000028 _ZN19mystery_gift_script7specialEt +02009e49 w F .text 00000014 _ZN11Gen2Pokemon19getCaughtDataGenderEv +0200a4bd g F .text 00000014 _ZN7PokemonC2Ev +0201df00 g *ABS* 00000000 __ewram_lma +0005ccc6 w .debug_info 00000000 .hidden GBS_Shell.c.144b4b37 +0200a235 g F .text 00000048 _ZN11Gen3Pokemon14getUnownLetterEv +02012038 g O .rodata 00000138 .hidden Label_RedTiles +02001651 g F .text 00000024 chr4c_erase +0200d60d g F .text 0000005c __swhatbuf_r +02019010 g O .rodata 0000000c _ZN11Gen3Pokemon5hpIVsE +0200af55 g F .text 00000028 obj_unhide_multi +02015f70 g .rodata 00000000 gen_3_charsets_lz10_bin +02002e61 g F .text 00000038 _ZN19mystery_gift_script11loadpointerEhm +0200a575 g F .text 000000de _ZN7Pokemon6setVarE11DataVarInfoim +0200d984 g F .text 00000020 .hidden __aeabi_uidivmod +02018b58 g O .rodata 00000010 _ZTV10sprite_var +03002e18 g O .bss 00000004 link_blob2 +02018d6c g O .rodata 00000018 _ZN9GBPokemon9trainerIDE +0200a653 g F .text 0000001a _ZN7Pokemon6setVarE11DataVarInfom +0200bffd g F .text 00000004 LZ77UnCompWram +03003f84 g O .data 0000000c __sglue +02003239 g F .text 0000001a _ZN19mystery_gift_script11msgboxMacroEm +02000c39 g F .text 00000020 _Z14reverse_endianPhj +03000544 g O .bss 00000001 mem_id +0005d27e w .debug_info 00000000 .hidden link_frame3.c.8a5cce55 +02006c75 g F .text 0000000a _ZN11textbox_var17set_virtual_startEv +0200d839 g F .text 00000012 .hidden __gnu_thumb1_case_sqi +02007a8d g F .text 000000e8 _Z17load_type_spritesPKhiib +0200310d g F .text 00000038 _ZN19mystery_gift_script7callASMEm +02008c31 g F .text 00000008 _Z25get_compressed_PTGB_tablev +0200bfc5 g F .text 00000004 Stop +0201e05c g *ABS* 00000000 _end +02009207 g F .text 0000003e _ZN9GBPokemon10getIsShinyEv +020153e4 g .rodata 00000000 CREDITS_english_lz10_bin +0201c764 g O .rodata 000000bf gen_1_index_array +02009885 g F .text 0000002a _ZN9GBPokemon22setRibbonsAndObedienceEP11Gen3Pokemon +0300170c g O .bss 00000004 johto_dex_num +0201ca14 g .eh_frame 00000000 __iwram_lma +02006679 g F .text 00000010 _Z17get_tutorial_flagv +0200a491 w F .text 00000002 _ZN7PokemonD1Ev +02006e5d g F .text 00000034 _ZN10script_varC2ERN4ptgb6vectorIPS_EEPi +02019094 g O .rodata 0000000c _ZN11Gen3Pokemon9moveOnePPE +0200a071 g F .text 0000002c _ZN11Gen3Pokemon19setPersonalityValueEm +0200611d g F .text 00000030 _ZN13Pokemon_PartyC2Ev +02008cbd w F .text 00000014 _ZN9GBPokemon21getSpeciesIndexNumberEv +0200bc71 g F .text 00000048 tte_init_con +0005cbd2 w .debug_info 00000000 .hidden GBC_Shell.c.023f9003 +02006ae1 g F .text 00000012 _ZN10script_objC2ERK17script_obj_params +02008edd w F .text 00000020 _ZN11Gen3Pokemon10getPPUpNumEi +02005d89 g F .text 00000364 _Z12pokedex_loopv +02009ed5 w F .text 00000012 _ZN11Gen2PokemonD0Ev +02018d3c g O .rodata 00000018 _ZN9GBPokemon5atkDVE +02001831 g F .text 000000a2 utf8_decode_char +0200d6c5 g F .text 0000004c __swrite +0200162d g F .text 0000000c _Znwj +03003f94 g O .data 00000004 __malloc_trim_threshold +030035ec g O .data 00000004 var_pkmn_offset +030015e4 g O .bss 00000040 yes_no_menu +02015a88 g .rodata 00000000 gb_rom_values_eng_lz10_bin_end +02018fe0 g O .rodata 0000000c _ZN11Gen3Pokemon16specialAttackIVsE +020087a9 g F .text 00000018 _ZNK15text_data_table14get_text_entryEt +0201268c g O .rodata 0000004c .hidden link_frame3Tiles +0200212d g F .text 00000318 _Z7creditsv +02012190 g O .rodata 00000118 .hidden Label_SilverTiles +03001574 g O .bss 00000004 global_frame_count +02002fcd g F .text 00000028 _ZN19mystery_gift_script7fanfareEt +02018658 g O .rodata 00000258 event_script_params +0005c1c6 w .debug_info 00000000 .hidden background.c.d9858edb +03002f44 g O .bss 00000004 y_offset +0201c96c g O .rodata 00000080 dotab_stdnull +0200c029 g F .text 00000004 SoundDriverMain +02002e15 g F .text 00000030 _ZN19mystery_gift_script13virtualgotoifEhm +0200c8f5 g F .text 00000118 _memalign_r +030035f4 g O .data 00000004 var_dex_seen_caught +030043a8 g O .data 00000140 _impure_data +0200c039 g F .text 00000004 MultiBoot +03002e38 g O .bss 00000004 button_cancel_right +03002e1c g O .bss 00000004 link_blob1 +020127b0 g O .rodata 000000c0 .hidden lookerRSETiles +0200cbdd g F .text 00000014 __sfp_lock_release +0200bfe5 g F .text 00000004 CpuSet +02012d80 g O .rodata 00000154 .hidden openingBGMap +02002445 g F .text 00000108 _Z14main_menu_loopv +02018f90 g O .rodata 0000000c _ZN11Gen2Pokemon13g2_friendshipE +020152e4 g O .rodata 00000080 tte_dotab_nocash +0200bfd5 g F .text 00000004 DivArm +0201a66e g O .rodata 00001fa0 MOVESETS +02006d49 g F .text 0000008a _ZN10sprite_var18insert_sprite_dataEPhPKjjPKt +02002f6d g F .text 00000038 _ZN19mystery_gift_script7compareEtt +020083e7 g F .text 00000002 _Z18update_menu_spriteP7PokeBoxii +0200a8bd g F .text 000000e4 tonccpy +03001702 g O .bss 00000001 celebi_caught +02018108 g .rodata 00000000 TYPES_lz10_bin +0200a70d g F .text 00000010 _ZN13PokemonTables11get_max_expEi +020015f5 g F .text 00000016 npf_snprintf +0201c868 g O .rodata 00000101 _ctype_ +02006acd g F .text 00000014 _ZN10script_objC1Ev +0200daf5 w F .text 00000002 .hidden __aeabi_idiv0 +0201c9ec g .init_array 00000000 __init_array_start +020123ec g O .rodata 00000020 .hidden Label_YellowPal +02008c6d w F .text 00000004 _ZN9GBPokemon18setStatusConditionEh +02008c65 w F .text 00000004 _ZN9GBPokemon7getTypeEi +030035c0 g O .data 00000004 gp_tte_context +02009d45 g F .text 0000002c _ZN11Gen1PokemonC1EP13PokemonTables +02011ea4 g O .rodata 00000020 .hidden Label_GoldPal +03001704 g O .bss 00000004 johto_offset +0200c005 g F .text 00000004 HuffUnComp +03003ebc g O .data 00000010 _ZN9GBPokemon8PPUpNumsE +03001700 g O .bss 00000001 asm_payload_location +0005d2f8 w .debug_info 00000000 .hidden lookerFRLG.c.b9d8bf9f +020191a8 g O .rodata 0000000c _ZN11Gen3Pokemon17nicknameLetterTenE +0200c211 g F .text 00000060 strlen +02010cd8 g O .rodata 00000010 .hidden flag_frePal +0200af2d g F .text 00000028 obj_hide_multi +03001838 g O .bss 00000020 games +020191fc g O .rodata 0000000c _ZN11Gen3Pokemon19nicknameLetterThreeE +02011a90 g O .rodata 0000014c .hidden Label_BlueTiles +020006ff g F .text 0000001e _ZN6ButtonC2EP8OBJ_ATTRS1_i +00080000 g .debug_loclists 00000000 _stack +02015a88 g .rodata 00000000 gb_rom_values_fre_lz10_bin +03002f10 g O .bss 00000004 button_yes +020016fd g F .text 00000014 __wrap___get_handle +020088f1 g F .text 00000010 _Z13hide_text_boxv +020190e8 g O .rodata 0000000c _ZN11Gen3Pokemon16ppUpNumMoveThreeE +02010d94 g O .rodata 00000010 .hidden flag_gerPal +0201cf34 g *ABS* 00000000 __data_lma +0201913c g O .rodata 0000000c _ZN11Gen3Pokemon30originalTrainerNameLetterSevenE +0200bfd9 g F .text 00000004 Sqrt +02001299 g F .text 00000078 _Z23convert_int_to_ptgb_striPhi +03001564 g O .bss 00000004 fennel_blink_state +02006249 g F .text 0000000c _ZN13Pokemon_Party24set_mythic_stabilizationEb +03001758 g O .bss 00000004 dex_shift +02018d0c g O .rodata 00000018 _ZN9GBPokemon5speDVE +0200c089 g F .text 000000bc strchr +03002e24 g O .bss 00000004 link_frame2 +02009559 g F .text 0000010e _ZN9GBPokemon12checkIsShinyEP11Gen3Pokemon +0200b60d g F .text 0000015e schr4c_line +0005c46a w .debug_info 00000000 .hidden button_edge.c.1b40d229 +0200bfed g F .text 00000004 BiosCheckSum +02008cd1 w F .text 00000018 _ZN9GBPokemon21setSpeciesIndexNumberEh +02012ed4 g O .rodata 00000020 .hidden openingBGPal +02009155 g F .text 00000064 _ZN9GBPokemon14getUnownLetterEv +03003f10 g O .data 00000010 _ZN11Gen3Pokemon10ppUpTotalsE +0200a709 g F .text 00000002 _ZN13PokemonTables15load_exp_groupsEv 030001ed g F .iwram 00000014 _Z15write_byte_savejh -020038dd g F .text 0000001c _ZN19mystery_gift_script8add_wordEm -02008ac9 g F .text 00000034 _ZN10script_varC1ERN4ptgb6vectorIPS_EEPi -02000be5 g F .text 00000020 _ZN3Dex4showEv -03001940 g O .bss 000000a8 dex_array -0201c1ad g F .ewram 0000005c nocash_message -0200374d g F .text 00000020 _ZN19mystery_gift_script10fadeScreenEh -030024c8 g O .bss 00000004 grabbed_front_sprite -0201b780 g .init_array 00000000 __preinit_array_start -0201c208 g *ABS* 00000000 __ewram_overlay_end +0005c4e4 w .debug_info 00000000 .hidden button_no.c.4342cbd1 +0200a855 g F .text 00000030 _ZN13PokemonTables17load_gen3_charsetE8Language +02018f84 g O .rodata 0000000c _ZN11Gen2Pokemon16g2_pokerusStrainE +0005c260 w .debug_info 00000000 .hidden box_select.c.9a60bd0a +020032d5 g F .text 0000001c _ZN19mystery_gift_script8add_wordEm +02018f48 g O .rodata 0000000c _ZN11Gen2Pokemon21g2_caughtDataLocationE +02009d75 w F .text 00000018 _ZN11Gen2Pokemon21setCaughtDataLocationEh +02006e5d g F .text 00000034 _ZN10script_varC1ERN4ptgb6vectorIPS_EEPi +02000c19 g F .text 00000020 _ZN3Dex4showEv +0300175c g O .bss 000000a8 dex_array +0201e001 g F .ewram 0000005c nocash_message +02003145 g F .text 00000020 _ZN19mystery_gift_script10fadeScreenEh +03002e10 g O .bss 00000004 grabbed_front_sprite +0200a30d g F .text 00000020 _ZN7PokeBoxC1Ev +0201c9ec g .init_array 00000000 __preinit_array_start +0201e05c g *ABS* 00000000 __ewram_overlay_end 0300035b g F .iwram 0000008a _Z15is_save_correctPhjj -030018e5 g O .bss 00000001 missingno_caught -030018b4 g O .bss 00000004 ptr_block_ptr_high -030024ec g O .bss 00000004 button_confirm_left -02008d69 g F .text 0000003c _ZN11Select_MenuC1Ebhii -020038f9 w F .text 0000002e _ZN4ptgb6vectorIP10script_varED2Ev -03002a10 g O .bss 00000004 char_index -02008169 g F .text 0000002c _ZN8rom_data8is_hoennEv -0200d32d g F .text 00000014 .hidden __gnu_thumb1_case_uhi -020083cd g F .text 000002f8 _Z15run_conditionali -03003074 g O .data 00000004 mosi_delay -0200a585 g F .text 00000004 _Z10ptgb_writePKc -0200d58c g F .text 00000020 .hidden __aeabi_idivmod -0200c0c1 g F .text 0000015c tte_cmd_vt100 -020183ac g .rodata 00000000 RSEFRLG_english_lz10_bin -020154e0 g .rodata 00000000 gb_rom_values_fre_lz10_bin_end -0201c208 g *ABS* 00000000 __eheap_start -02006c21 g F .text 00000004 _ZN7Pokemon20get_full_gen_3_arrayEv -0201c208 g *ABS* 00000000 __sbss_end__ -03001706 g O .bss 00000001 test_packet_fail -030018dc g O .bss 00000004 ptr_call_return_2 -02003673 g F .text 00000016 _ZN19mystery_gift_script3endEv -020113b8 g O .rodata 00000124 .hidden Label_YellowTiles -0200c3a9 g F .text 00000006 DivArmAbs -02007f3d g F .text 00000058 _ZN13Pokemon_Party10start_linkEv -0200a721 g F .text 00000168 _Z9text_loopi -0200aa8d g F .text 00000034 free -02015824 g .rodata 00000000 gen_1_charsets_lz10_bin -0200c409 g F .text 00000004 LZ77UnCompVram -0300257c g O .bss 00000004 up_arrow -0200800f g F .text 000000e4 _ZN8rom_data11fill_valuesEPK8ROM_DATA +03001701 g O .bss 00000001 missingno_caught +030016d0 g O .bss 00000004 ptr_block_ptr_high +03002e34 g O .bss 00000004 button_confirm_left +020070fd g F .text 0000003c _ZN11Select_MenuC1Ebhii +020032f1 w F .text 0000002e _ZN4ptgb6vectorIP10script_varED2Ev +03003358 g O .bss 00000004 char_index +02006555 g F .text 0000002c _ZN8rom_data8is_hoennEv +0200d875 g F .text 00000014 .hidden __gnu_thumb1_case_uhi +02009f15 w F .text 00000002 _ZN11Gen3PokemonD2Ev +02009d45 g F .text 0000002c _ZN11Gen1PokemonC2EP13PokemonTables +0200a7c1 g F .text 0000006c _Z22load_localized_charsetPth8Language +02006785 g F .text 000002d4 _Z15run_conditionali +02008919 g F .text 00000004 _Z10ptgb_writePKc +0200dad4 g F .text 00000020 .hidden __aeabi_idivmod +0200bcb9 g F .text 0000015c tte_cmd_vt100 +020190f4 g O .rodata 0000000c _ZN11Gen3Pokemon14ppUpNumMoveTwoE +02017c80 g .rodata 00000000 RSEFRLG_english_lz10_bin +02015c2c g .rodata 00000000 gb_rom_values_fre_lz10_bin_end +02008cb9 w F .text 00000002 _ZN9GBPokemonD2Ev +02018fc8 g O .rodata 0000000c _ZN11Gen3Pokemon7abilityE +0201e05c g *ABS* 00000000 __eheap_start +02009dd5 w F .text 00000018 _ZN11Gen2Pokemon23setPokerusDaysRemainingEh +0201e05c g *ABS* 00000000 __sbss_end__ +03003ef0 g O .data 00000008 _ZN11Gen1Pokemon8g1_typesE +02009f15 w F .text 00000002 _ZN11Gen3PokemonD1Ev +030016f8 g O .bss 00000004 ptr_call_return_2 +0200306b g F .text 00000016 _ZN19mystery_gift_script3endEv +0005c9ea w .debug_info 00000000 .hidden flag_kor.c.20bf23d0 +0005d520 w .debug_info 00000000 .hidden ptgb_logo_l.c.cd9d7dfa +020122c8 g O .rodata 00000124 .hidden Label_YellowTiles +0005c672 w .debug_info 00000000 .hidden emerald_cart.c.40410221 +0200bfa1 g F .text 00000006 DivArmAbs +0200614d g F .text 00000044 _ZN13Pokemon_Party10start_linkEv +02008ab5 g F .text 00000168 _Z9text_loopi +0005c0b2 w .debug_info 00000000 .hidden memory.c.0271b7ec +0200c591 g F .text 00000014 free +02018de4 g O .rodata 00000018 _ZN9GBPokemon5levelE +0200c001 g F .text 00000004 LZ77UnCompVram +03002ec4 g O .bss 00000004 up_arrow +020063fb g F .text 000000e4 _ZN8rom_data11fill_valuesEPK8ROM_DATA +03003f20 g O .data 00000010 _ZN11Gen3Pokemon5movesE diff --git a/include/background_engine.h b/include/background_engine.h index 4c836ab..6831edc 100644 --- a/include/background_engine.h +++ b/include/background_engine.h @@ -1,6 +1,10 @@ #ifndef BACKGROUND_ENGINE_H #define BACKGROUND_ENGINE_H +#include "sprite_data.h" +#include "text_engine.h" +#include "global_frame_controller.h" + void background_frame(int global_frame_count); void create_textbox(int startTileX, int startTileY, int text_space_width, int text_space_height, bool eraseMainBox); void reset_textbox(); diff --git a/include/box_menu.h b/include/box_menu.h index 08ff89c..fbe2990 100644 --- a/include/box_menu.h +++ b/include/box_menu.h @@ -4,7 +4,6 @@ #include #include "string.h" #include "button_handler.h" -#include "pokemon.h" #include "string_view" #include "pokemon_party.h" #include "button_handler.h" @@ -27,7 +26,7 @@ class Box_Menu { public: Box_Menu(); - int box_main(Pokemon_Party party_data); + int box_main(PokeBox* box); private: int curr_button; int x; diff --git a/include/debug_mode.h b/include/debug_mode.h index f5137b0..bfdcb7a 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -2,19 +2,19 @@ #define DEBUG_MODE_H #define VERSION "v1.2.0b" -#define PTGB_BUILD_LANGUAGE ENG_ID +#define PTGB_BUILD_LANGUAGE 2 #define DEBUG_MODE true -#define PRINT_LINK_DATA (false && DEBUG_MODE) // This is currently broken... not sure why +#define PRINT_LINK_DATA (true && DEBUG_MODE) #define INSTANT_TEXT_SPEED (false && DEBUG_MODE) -#define IGNORE_GAME_PAK (false && DEBUG_MODE) -#define IGNORE_GAME_PAK_SPRITES (false && DEBUG_MODE) +#define IGNORE_GAME_PAK (true && DEBUG_MODE) +#define IGNORE_GAME_PAK_SPRITES (true && DEBUG_MODE) #define IGNORE_LINK_CABLE (true && DEBUG_MODE) #define IGNORE_MG_E4_FLAGS (true && DEBUG_MODE) #define IGNORE_UNRECEIVED_PKMN (true && DEBUG_MODE) #define FORCE_TUTORIAL (false && DEBUG_MODE) -#define DONT_REMOVE_PKMN (true && DEBUG_MODE) +#define DONT_REMOVE_PKMN (false && DEBUG_MODE) #define DONT_HIDE_INVALID_PKMN (false && DEBUG_MODE) #define IGNORE_DEX_COMPLETION (false && DEBUG_MODE) #define FORCE_ALL_CAUGHT (false && DEBUG_MODE) @@ -28,7 +28,6 @@ #define DEBUG_LANG LANG_ENG #define ENABLE_MATCH_PID true -#define ENABLE_OLD_EVENT false #define ENABLE_DEBUG_SCREEN true #define USE_CUSTOM_MALLOC 1 diff --git a/include/flash_mem.h b/include/flash_mem.h index 028e62d..bb1797a 100644 --- a/include/flash_mem.h +++ b/include/flash_mem.h @@ -1,7 +1,6 @@ #ifndef MIRROR_H #define MIRROR_H #include -#include "pokemon.h" #include "rom_data.h" #define SAVE_A_OFFSET 0x00000000 // Offset of Game Save A @@ -14,7 +13,7 @@ extern vu32 newest_save_offset; extern vu32 memory_section_array[]; extern char mem_name; extern u8 global_memory_buffer[0x1000]; -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; void initalize_memory_locations(); void print_mem_section(); diff --git a/include/gameboy_colour.h b/include/gameboy_colour.h index 652856b..df8369c 100644 --- a/include/gameboy_colour.h +++ b/include/gameboy_colour.h @@ -31,10 +31,10 @@ #define SLOW_SPEED 1000 void setup(const u16 *debug_charset); -byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, Simplified_Pokemon *curr_simple_array, const u16 *debug_charset, bool cancel_connection); -int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_rom, Simplified_Pokemon *curr_simple_array, const u16 *debug_charset, bool cancel_connection); +byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, PokeBox* box, const u16 *debug_charset, bool cancel_connection); +int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_rom, PokeBox* box, const u16 *debug_charset, bool cancel_connection); byte exchange_parties(byte curr_in, byte *curr_payload); byte exchange_boxes(byte curr_in, byte *party_data, GB_ROM *curr_gb_rom); -byte exchange_remove_array(byte curr_in, Simplified_Pokemon *curr_simple_array, bool cancel_connection); +byte exchange_remove_array(byte curr_in, PokeBox* box, bool cancel_connection); #endif /* GAMEBOY_COLOUR_H_ */ diff --git a/include/global_frame_controller.h b/include/global_frame_controller.h index 8abfed1..8ab0b7a 100644 --- a/include/global_frame_controller.h +++ b/include/global_frame_controller.h @@ -1,10 +1,24 @@ #ifndef GLOBAL_FRAME_CONTROLLER_H #define GLOBAL_FRAME_CONTROLLER_H +#include + #define STATE_CONNECTION 1 #define STATE_TRANSFER 2 #define STATE_NO_ANIM 3 +// TODO: This is kinda a silly spot for this +// make sure outBuffer is large enough! Should be at least hex_len + 1 +template +void n2hexstr(char *outBuffer, I w, size_t hex_len = sizeof(I) << 1) +{ + static const char *digits = "0123456789ABCDEF"; + memset(outBuffer, '0', hex_len); + outBuffer[hex_len] = '\0'; // we must make sure to terminate the string + + for (size_t i = 0, j = (hex_len - 1) * 4; i < hex_len; ++i, j -= 4) + outBuffer[i] = digits[(w >> j) & 0x0f]; +} void global_next_frame(); int get_frame_count(); void set_menu_sprite_pal(int frame); @@ -15,7 +29,7 @@ void set_missingno(bool val); bool get_missingno_enabled(); void set_treecko(bool val); bool get_treecko_enabled(); -u32 fnv1a_hash(unsigned char* data, size_t length); +u32 fnv1a_hash(unsigned char *data, size_t length); int get_string_length(const byte *str); void convert_int_to_ptgb_str(int val, byte str[]); void convert_int_to_ptgb_str(int val, byte str[], int min_length); diff --git a/include/mystery_gift_builder.h b/include/mystery_gift_builder.h index 96800a7..65f051d 100644 --- a/include/mystery_gift_builder.h +++ b/include/mystery_gift_builder.h @@ -55,199 +55,199 @@ #define rlist_r7 0b010000001 #define rlist_lr 0b100000000 -#define MOVEMENT_ACTION_FACE_DOWN curr_rom.is_hoenn() ? 0x0 : 0x0 -#define MOVEMENT_ACTION_FACE_UP curr_rom.is_hoenn() ? 0x1 : 0x1 -#define MOVEMENT_ACTION_FACE_LEFT curr_rom.is_hoenn() ? 0x2 : 0x2 -#define MOVEMENT_ACTION_FACE_RIGHT curr_rom.is_hoenn() ? 0x3 : 0x3 -#define MOVEMENT_ACTION_WALK_SLOW_DOWN curr_rom.is_hoenn() ? 0x4 : 0xC -#define MOVEMENT_ACTION_WALK_SLOW_UP curr_rom.is_hoenn() ? 0x5 : 0xD -#define MOVEMENT_ACTION_WALK_SLOW_LEFT curr_rom.is_hoenn() ? 0x6 : 0xE -#define MOVEMENT_ACTION_WALK_SLOW_RIGHT curr_rom.is_hoenn() ? 0x7 : 0xF -#define MOVEMENT_ACTION_WALK_NORMAL_DOWN curr_rom.is_hoenn() ? 0x8 : 0x10 -#define MOVEMENT_ACTION_WALK_NORMAL_UP curr_rom.is_hoenn() ? 0x9 : 0x11 -#define MOVEMENT_ACTION_WALK_NORMAL_LEFT curr_rom.is_hoenn() ? 0xA : 0x12 -#define MOVEMENT_ACTION_WALK_NORMAL_RIGHT curr_rom.is_hoenn() ? 0xB : 0x13 -#define MOVEMENT_ACTION_JUMP_2_DOWN curr_rom.is_hoenn() ? 0xC : 0x14 -#define MOVEMENT_ACTION_JUMP_2_UP curr_rom.is_hoenn() ? 0xD : 0x15 -#define MOVEMENT_ACTION_JUMP_2_LEFT curr_rom.is_hoenn() ? 0xE : 0x16 -#define MOVEMENT_ACTION_JUMP_2_RIGHT curr_rom.is_hoenn() ? 0xF : 0x17 -#define MOVEMENT_ACTION_DELAY_1 curr_rom.is_hoenn() ? 0x10 : 0x18 -#define MOVEMENT_ACTION_DELAY_2 curr_rom.is_hoenn() ? 0x11 : 0x19 -#define MOVEMENT_ACTION_DELAY_4 curr_rom.is_hoenn() ? 0x12 : 0x1A -#define MOVEMENT_ACTION_DELAY_8 curr_rom.is_hoenn() ? 0x13 : 0x1B -#define MOVEMENT_ACTION_DELAY_16 curr_rom.is_hoenn() ? 0x14 : 0x1C -#define MOVEMENT_ACTION_WALK_FAST_DOWN curr_rom.is_hoenn() ? 0x15 : 0x1D -#define MOVEMENT_ACTION_WALK_FAST_UP curr_rom.is_hoenn() ? 0x16 : 0x1E -#define MOVEMENT_ACTION_WALK_FAST_LEFT curr_rom.is_hoenn() ? 0x17 : 0x1F -#define MOVEMENT_ACTION_WALK_FAST_RIGHT curr_rom.is_hoenn() ? 0x18 : 0x20 -#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN curr_rom.is_hoenn() ? 0x19 : 0x21 -#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP curr_rom.is_hoenn() ? 0x1A : 0x22 -#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT curr_rom.is_hoenn() ? 0x1B : 0x23 -#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT curr_rom.is_hoenn() ? 0x1C : 0x24 -#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN curr_rom.is_hoenn() ? 0x1D : 0x25 -#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP curr_rom.is_hoenn() ? 0x1E : 0x26 -#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT curr_rom.is_hoenn() ? 0x1F : 0x27 -#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT curr_rom.is_hoenn() ? 0x20 : 0x28 -#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN curr_rom.is_hoenn() ? 0x21 : 0x29 -#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP curr_rom.is_hoenn() ? 0x22 : 0x2A -#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT curr_rom.is_hoenn() ? 0x23 : 0x2B -#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT curr_rom.is_hoenn() ? 0x24 : 0x2C -#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN curr_rom.is_hoenn() ? 0x25 : 0x2D -#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_UP curr_rom.is_hoenn() ? 0x26 : 0x2E -#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT curr_rom.is_hoenn() ? 0x27 : 0x2F -#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT curr_rom.is_hoenn() ? 0x28 : 0x30 -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN curr_rom.is_hoenn() ? 0x29 : 0x31 -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP curr_rom.is_hoenn() ? 0x2A : 0x32 -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT curr_rom.is_hoenn() ? 0x2B : 0x33 -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT curr_rom.is_hoenn() ? 0x2C : 0x34 -#define MOVEMENT_ACTION_WALK_FASTER_DOWN curr_rom.is_hoenn() ? 0x2D : 0x35 -#define MOVEMENT_ACTION_WALK_FASTER_UP curr_rom.is_hoenn() ? 0x2E : 0x36 -#define MOVEMENT_ACTION_WALK_FASTER_LEFT curr_rom.is_hoenn() ? 0x2F : 0x37 -#define MOVEMENT_ACTION_WALK_FASTER_RIGHT curr_rom.is_hoenn() ? 0x30 : 0x38 -#define MOVEMENT_ACTION_SLIDE_DOWN curr_rom.is_hoenn() ? 0x31 : 0x39 -#define MOVEMENT_ACTION_SLIDE_UP curr_rom.is_hoenn() ? 0x32 : 0x3A -#define MOVEMENT_ACTION_SLIDE_LEFT curr_rom.is_hoenn() ? 0x33 : 0x3B -#define MOVEMENT_ACTION_SLIDE_RIGHT curr_rom.is_hoenn() ? 0x34 : 0x3C -#define MOVEMENT_ACTION_PLAYER_RUN_DOWN curr_rom.is_hoenn() ? 0x35 : 0x3D -#define MOVEMENT_ACTION_PLAYER_RUN_UP curr_rom.is_hoenn() ? 0x36 : 0x3E -#define MOVEMENT_ACTION_PLAYER_RUN_LEFT curr_rom.is_hoenn() ? 0x37 : 0x3F -#define MOVEMENT_ACTION_PLAYER_RUN_RIGHT curr_rom.is_hoenn() ? 0x38 : 0x40 -#define MOVEMENT_ACTION_START_ANIM_IN_DIRECTION curr_rom.is_hoenn() ? 0x39 : 0x45 -#define MOVEMENT_ACTION_JUMP_SPECIAL_DOWN curr_rom.is_hoenn() ? 0x3A : 0x46 -#define MOVEMENT_ACTION_JUMP_SPECIAL_UP curr_rom.is_hoenn() ? 0x3B : 0x47 -#define MOVEMENT_ACTION_JUMP_SPECIAL_LEFT curr_rom.is_hoenn() ? 0x3C : 0x48 -#define MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT curr_rom.is_hoenn() ? 0x3D : 0x49 -#define MOVEMENT_ACTION_FACE_PLAYER curr_rom.is_hoenn() ? 0x3E : 0x4A -#define MOVEMENT_ACTION_FACE_AWAY_PLAYER curr_rom.is_hoenn() ? 0x3F : 0x4B -#define MOVEMENT_ACTION_LOCK_FACING_DIRECTION curr_rom.is_hoenn() ? 0x40 : 0x4C -#define MOVEMENT_ACTION_UNLOCK_FACING_DIRECTION curr_rom.is_hoenn() ? 0x41 : 0x4D -#define MOVEMENT_ACTION_JUMP_DOWN curr_rom.is_hoenn() ? 0x42 : 0x4E -#define MOVEMENT_ACTION_JUMP_UP curr_rom.is_hoenn() ? 0x43 : 0x4F -#define MOVEMENT_ACTION_JUMP_LEFT curr_rom.is_hoenn() ? 0x44 : 0x50 -#define MOVEMENT_ACTION_JUMP_RIGHT curr_rom.is_hoenn() ? 0x45 : 0x51 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN curr_rom.is_hoenn() ? 0x46 : 0x52 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_UP curr_rom.is_hoenn() ? 0x47 : 0x53 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT curr_rom.is_hoenn() ? 0x48 : 0x54 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT curr_rom.is_hoenn() ? 0x49 : 0x55 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN_UP curr_rom.is_hoenn() ? 0x4A : 0x56 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN curr_rom.is_hoenn() ? 0x4B : 0x57 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT_RIGHT curr_rom.is_hoenn() ? 0x4C : 0x58 -#define MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT_LEFT curr_rom.is_hoenn() ? 0x4D : 0x59 -#define MOVEMENT_ACTION_FACE_ORIGINAL_DIRECTION curr_rom.is_hoenn() ? 0x4E : 0x5A -#define MOVEMENT_ACTION_NURSE_JOY_BOW_DOWN curr_rom.is_hoenn() ? 0x4F : 0x5B -#define MOVEMENT_ACTION_ENABLE_JUMP_LANDING_GROUND_EFFECT curr_rom.is_hoenn() ? 0x50 : 0x5C -#define MOVEMENT_ACTION_DISABLE_JUMP_LANDING_GROUND_EFFECT curr_rom.is_hoenn() ? 0x51 : 0x5D -#define MOVEMENT_ACTION_DISABLE_ANIMATION curr_rom.is_hoenn() ? 0x52 : 0x5E -#define MOVEMENT_ACTION_RESTORE_ANIMATION curr_rom.is_hoenn() ? 0x53 : 0x5F -#define MOVEMENT_ACTION_SET_INVISIBLE curr_rom.is_hoenn() ? 0x54 : 0x60 -#define MOVEMENT_ACTION_SET_VISIBLE curr_rom.is_hoenn() ? 0x55 : 0x61 -#define MOVEMENT_ACTION_EMOTE_EXCLAMATION_MARK curr_rom.is_hoenn() ? 0x56 : 0x62 -#define MOVEMENT_ACTION_EMOTE_QUESTION_MARK curr_rom.is_hoenn() ? 0x57 : 0x63 -#define MOVEMENT_ACTION_EMOTE_HEART curr_rom.is_hoenn() ? 0x58 : 0xFF -#define MOVEMENT_ACTION_REVEAL_TRAINER curr_rom.is_hoenn() ? 0x59 : 0x67 -#define MOVEMENT_ACTION_ROCK_SMASH_BREAK curr_rom.is_hoenn() ? 0x5A : 0x68 -#define MOVEMENT_ACTION_CUT_TREE curr_rom.is_hoenn() ? 0x5B : 0x69 -#define MOVEMENT_ACTION_SET_FIXED_PRIORITY curr_rom.is_hoenn() ? 0x5C : 0x6A -#define MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY curr_rom.is_hoenn() ? 0x5D : 0x6B -#define MOVEMENT_ACTION_INIT_AFFINE_ANIM curr_rom.is_hoenn() ? 0x5E : 0x6C -#define MOVEMENT_ACTION_CLEAR_AFFINE_ANIM curr_rom.is_hoenn() ? 0x5F : 0x6D -#define MOVEMENT_ACTION_HIDE_REFLECTION curr_rom.is_hoenn() ? 0x60 : 0xFF -#define MOVEMENT_ACTION_SHOW_REFLECTION curr_rom.is_hoenn() ? 0x61 : 0xFF -#define MOVEMENT_ACTION_WALK_DOWN_START_AFFINE curr_rom.is_hoenn() ? 0x62 : 0x6E -#define MOVEMENT_ACTION_WALK_DOWN_AFFINE curr_rom.is_hoenn() ? 0x63 : 0x6F -#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN curr_rom.is_hoenn() ? 0x64 : 0x70 -#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP curr_rom.is_hoenn() ? 0x65 : 0x71 -#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT curr_rom.is_hoenn() ? 0x66 : 0x72 -#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT curr_rom.is_hoenn() ? 0x67 : 0x73 -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN curr_rom.is_hoenn() ? 0x68 : 0x74 -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP curr_rom.is_hoenn() ? 0x69 : 0x75 -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT curr_rom.is_hoenn() ? 0x6A : 0x76 -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT curr_rom.is_hoenn() ? 0x6B : 0x77 -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN curr_rom.is_hoenn() ? 0x6C : 0x78 -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP curr_rom.is_hoenn() ? 0x6D : 0x79 -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT curr_rom.is_hoenn() ? 0x6E : 0x7A -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT curr_rom.is_hoenn() ? 0x6F : 0x7B -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN curr_rom.is_hoenn() ? 0x70 : 0x7C -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP curr_rom.is_hoenn() ? 0x71 : 0x7D -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT curr_rom.is_hoenn() ? 0x72 : 0x7E -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT curr_rom.is_hoenn() ? 0x73 : 0x7F -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN curr_rom.is_hoenn() ? 0x74 : 0x80 -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP curr_rom.is_hoenn() ? 0x75 : 0x81 -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT curr_rom.is_hoenn() ? 0x76 : 0x82 -#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT curr_rom.is_hoenn() ? 0x77 : 0x83 -#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN curr_rom.is_hoenn() ? 0x78 : 0x84 -#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP curr_rom.is_hoenn() ? 0x79 : 0x85 -#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT curr_rom.is_hoenn() ? 0x7A : 0x86 -#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT curr_rom.is_hoenn() ? 0x7B : 0x87 -#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN curr_rom.is_hoenn() ? 0x7C : 0x88 -#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP curr_rom.is_hoenn() ? 0x7D : 0x89 -#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT curr_rom.is_hoenn() ? 0x7E : 0x8A -#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT curr_rom.is_hoenn() ? 0x7F : 0x8B -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN curr_rom.is_hoenn() ? 0x80 : 0x8C -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP curr_rom.is_hoenn() ? 0x81 : 0x8D -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT curr_rom.is_hoenn() ? 0x82 : 0x8E -#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT curr_rom.is_hoenn() ? 0x83 : 0x8F -#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN curr_rom.is_hoenn() ? 0x84 : 0x90 -#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP curr_rom.is_hoenn() ? 0x85 : 0x91 -#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT curr_rom.is_hoenn() ? 0x86 : 0x92 -#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT curr_rom.is_hoenn() ? 0x87 : 0x93 -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN curr_rom.is_hoenn() ? 0x88 : 0xFF -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP curr_rom.is_hoenn() ? 0x89 : 0xFF -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT curr_rom.is_hoenn() ? 0x8A : 0xFF -#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT curr_rom.is_hoenn() ? 0x8B : 0xFF -#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_LEFT curr_rom.is_hoenn() ? 0x8C : 0xFF -#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_RIGHT curr_rom.is_hoenn() ? 0x8D : 0xFF -#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_LEFT curr_rom.is_hoenn() ? 0x8E : 0xFF -#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_RIGHT curr_rom.is_hoenn() ? 0x8F : 0xFF -#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT curr_rom.is_hoenn() ? 0x90 : 0xFF -#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT curr_rom.is_hoenn() ? 0x91 : 0xFF -#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT curr_rom.is_hoenn() ? 0x92 : 0xFF -#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT curr_rom.is_hoenn() ? 0x93 : 0xFF -#define MOVEMENT_ACTION_LOCK_ANIM curr_rom.is_hoenn() ? 0x94 : 0xFF -#define MOVEMENT_ACTION_UNLOCK_ANIM curr_rom.is_hoenn() ? 0x95 : 0xFF -#define MOVEMENT_ACTION_WALK_LEFT_AFFINE curr_rom.is_hoenn() ? 0x96 : 0xFF -#define MOVEMENT_ACTION_WALK_RIGHT_AFFINE curr_rom.is_hoenn() ? 0x97 : 0xFF -#define MOVEMENT_ACTION_LEVITATE curr_rom.is_hoenn() ? 0x98 : 0xFF -#define MOVEMENT_ACTION_STOP_LEVITATE curr_rom.is_hoenn() ? 0x99 : 0xFF -#define MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP curr_rom.is_hoenn() ? 0x9A : 0xFF -#define MOVEMENT_ACTION_FIGURE_8 curr_rom.is_hoenn() ? 0x9B : 0xFF -#define MOVEMENT_ACTION_FLY_UP curr_rom.is_hoenn() ? 0x9C : 0xA4 -#define MOVEMENT_ACTION_FLY_DOWN curr_rom.is_hoenn() ? 0x9D : 0xA5 -#define MOVEMENT_ACTION_FACE_DOWN_FAST curr_rom.is_hoenn() ? 0xFF : 0x4 -#define MOVEMENT_ACTION_FACE_UP_FAST curr_rom.is_hoenn() ? 0xFF : 0x5 -#define MOVEMENT_ACTION_FACE_LEFT_FAST curr_rom.is_hoenn() ? 0xFF : 0x6 -#define MOVEMENT_ACTION_FACE_RIGHT_FAST curr_rom.is_hoenn() ? 0xFF : 0x7 -#define MOVEMENT_ACTION_WALK_SLOWER_DOWN curr_rom.is_hoenn() ? 0xFF : 0x8 -#define MOVEMENT_ACTION_WALK_SLOWER_UP curr_rom.is_hoenn() ? 0xFF : 0x9 -#define MOVEMENT_ACTION_WALK_SLOWER_LEFT curr_rom.is_hoenn() ? 0xFF : 0xA -#define MOVEMENT_ACTION_WALK_SLOWER_RIGHT curr_rom.is_hoenn() ? 0xFF : 0xB -#define MOVEMENT_ACTION_PLAYER_RUN_DOWN_SLOW curr_rom.is_hoenn() ? 0xFF : 0x41 -#define MOVEMENT_ACTION_PLAYER_RUN_UP_SLOW curr_rom.is_hoenn() ? 0xFF : 0x42 -#define MOVEMENT_ACTION_PLAYER_RUN_LEFT_SLOW curr_rom.is_hoenn() ? 0xFF : 0x43 -#define MOVEMENT_ACTION_PLAYER_RUN_RIGHT_SLOW curr_rom.is_hoenn() ? 0xFF : 0x44 -#define MOVEMENT_ACTION_EMOTE_X curr_rom.is_hoenn() ? 0xFF : 0x64 -#define MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK curr_rom.is_hoenn() ? 0xFF : 0x65 -#define MOVEMENT_ACTION_EMOTE_SMILE curr_rom.is_hoenn() ? 0xFF : 0x66 -#define MOVEMENT_ACTION_SPIN_DOWN curr_rom.is_hoenn() ? 0xFF : 0x94 -#define MOVEMENT_ACTION_SPIN_UP curr_rom.is_hoenn() ? 0xFF : 0x95 -#define MOVEMENT_ACTION_SPIN_LEFT curr_rom.is_hoenn() ? 0xFF : 0x96 -#define MOVEMENT_ACTION_SPIN_RIGHT curr_rom.is_hoenn() ? 0xFF : 0x97 -#define MOVEMENT_ACTION_RAISE_HAND_AND_STOP curr_rom.is_hoenn() ? 0xFF : 0x98 -#define MOVEMENT_ACTION_RAISE_HAND_AND_JUMP curr_rom.is_hoenn() ? 0xFF : 0x99 -#define MOVEMENT_ACTION_RAISE_HAND_AND_SWIM curr_rom.is_hoenn() ? 0xFF : 0x9A -#define MOVEMENT_ACTION_WALK_SLOWEST_DOWN curr_rom.is_hoenn() ? 0xFF : 0x9B -#define MOVEMENT_ACTION_WALK_SLOWEST_UP curr_rom.is_hoenn() ? 0xFF : 0x9C -#define MOVEMENT_ACTION_WALK_SLOWEST_LEFT curr_rom.is_hoenn() ? 0xFF : 0x9D -#define MOVEMENT_ACTION_WALK_SLOWEST_RIGHT curr_rom.is_hoenn() ? 0xFF : 0x9E -#define MOVEMENT_ACTION_SHAKE_HEAD_OR_WALK_IN_PLACE curr_rom.is_hoenn() ? 0xFF : 0x9F -#define MOVEMENT_ACTION_GLIDE_DOWN curr_rom.is_hoenn() ? 0xFF : 0xA0 -#define MOVEMENT_ACTION_GLIDE_UP curr_rom.is_hoenn() ? 0xFF : 0xA1 -#define MOVEMENT_ACTION_GLIDE_LEFT curr_rom.is_hoenn() ? 0xFF : 0xA2 -#define MOVEMENT_ACTION_GLIDE_RIGHT curr_rom.is_hoenn() ? 0xFF : 0xA3 -#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_DOWN curr_rom.is_hoenn() ? 0xFF : 0xA6 -#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_UP curr_rom.is_hoenn() ? 0xFF : 0xA7 -#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_LEFT curr_rom.is_hoenn() ? 0xFF : 0xA8 -#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_RIGHT curr_rom.is_hoenn() ? 0xFF : 0xA9 +#define MOVEMENT_ACTION_FACE_DOWN curr_GBA_rom.is_hoenn() ? 0x0 : 0x0 +#define MOVEMENT_ACTION_FACE_UP curr_GBA_rom.is_hoenn() ? 0x1 : 0x1 +#define MOVEMENT_ACTION_FACE_LEFT curr_GBA_rom.is_hoenn() ? 0x2 : 0x2 +#define MOVEMENT_ACTION_FACE_RIGHT curr_GBA_rom.is_hoenn() ? 0x3 : 0x3 +#define MOVEMENT_ACTION_WALK_SLOW_DOWN curr_GBA_rom.is_hoenn() ? 0x4 : 0xC +#define MOVEMENT_ACTION_WALK_SLOW_UP curr_GBA_rom.is_hoenn() ? 0x5 : 0xD +#define MOVEMENT_ACTION_WALK_SLOW_LEFT curr_GBA_rom.is_hoenn() ? 0x6 : 0xE +#define MOVEMENT_ACTION_WALK_SLOW_RIGHT curr_GBA_rom.is_hoenn() ? 0x7 : 0xF +#define MOVEMENT_ACTION_WALK_NORMAL_DOWN curr_GBA_rom.is_hoenn() ? 0x8 : 0x10 +#define MOVEMENT_ACTION_WALK_NORMAL_UP curr_GBA_rom.is_hoenn() ? 0x9 : 0x11 +#define MOVEMENT_ACTION_WALK_NORMAL_LEFT curr_GBA_rom.is_hoenn() ? 0xA : 0x12 +#define MOVEMENT_ACTION_WALK_NORMAL_RIGHT curr_GBA_rom.is_hoenn() ? 0xB : 0x13 +#define MOVEMENT_ACTION_JUMP_2_DOWN curr_GBA_rom.is_hoenn() ? 0xC : 0x14 +#define MOVEMENT_ACTION_JUMP_2_UP curr_GBA_rom.is_hoenn() ? 0xD : 0x15 +#define MOVEMENT_ACTION_JUMP_2_LEFT curr_GBA_rom.is_hoenn() ? 0xE : 0x16 +#define MOVEMENT_ACTION_JUMP_2_RIGHT curr_GBA_rom.is_hoenn() ? 0xF : 0x17 +#define MOVEMENT_ACTION_DELAY_1 curr_GBA_rom.is_hoenn() ? 0x10 : 0x18 +#define MOVEMENT_ACTION_DELAY_2 curr_GBA_rom.is_hoenn() ? 0x11 : 0x19 +#define MOVEMENT_ACTION_DELAY_4 curr_GBA_rom.is_hoenn() ? 0x12 : 0x1A +#define MOVEMENT_ACTION_DELAY_8 curr_GBA_rom.is_hoenn() ? 0x13 : 0x1B +#define MOVEMENT_ACTION_DELAY_16 curr_GBA_rom.is_hoenn() ? 0x14 : 0x1C +#define MOVEMENT_ACTION_WALK_FAST_DOWN curr_GBA_rom.is_hoenn() ? 0x15 : 0x1D +#define MOVEMENT_ACTION_WALK_FAST_UP curr_GBA_rom.is_hoenn() ? 0x16 : 0x1E +#define MOVEMENT_ACTION_WALK_FAST_LEFT curr_GBA_rom.is_hoenn() ? 0x17 : 0x1F +#define MOVEMENT_ACTION_WALK_FAST_RIGHT curr_GBA_rom.is_hoenn() ? 0x18 : 0x20 +#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN curr_GBA_rom.is_hoenn() ? 0x19 : 0x21 +#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP curr_GBA_rom.is_hoenn() ? 0x1A : 0x22 +#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT curr_GBA_rom.is_hoenn() ? 0x1B : 0x23 +#define MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT curr_GBA_rom.is_hoenn() ? 0x1C : 0x24 +#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN curr_GBA_rom.is_hoenn() ? 0x1D : 0x25 +#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP curr_GBA_rom.is_hoenn() ? 0x1E : 0x26 +#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT curr_GBA_rom.is_hoenn() ? 0x1F : 0x27 +#define MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT curr_GBA_rom.is_hoenn() ? 0x20 : 0x28 +#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN curr_GBA_rom.is_hoenn() ? 0x21 : 0x29 +#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP curr_GBA_rom.is_hoenn() ? 0x22 : 0x2A +#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT curr_GBA_rom.is_hoenn() ? 0x23 : 0x2B +#define MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT curr_GBA_rom.is_hoenn() ? 0x24 : 0x2C +#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN curr_GBA_rom.is_hoenn() ? 0x25 : 0x2D +#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_UP curr_GBA_rom.is_hoenn() ? 0x26 : 0x2E +#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT curr_GBA_rom.is_hoenn() ? 0x27 : 0x2F +#define MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT curr_GBA_rom.is_hoenn() ? 0x28 : 0x30 +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN curr_GBA_rom.is_hoenn() ? 0x29 : 0x31 +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP curr_GBA_rom.is_hoenn() ? 0x2A : 0x32 +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT curr_GBA_rom.is_hoenn() ? 0x2B : 0x33 +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT curr_GBA_rom.is_hoenn() ? 0x2C : 0x34 +#define MOVEMENT_ACTION_WALK_FASTER_DOWN curr_GBA_rom.is_hoenn() ? 0x2D : 0x35 +#define MOVEMENT_ACTION_WALK_FASTER_UP curr_GBA_rom.is_hoenn() ? 0x2E : 0x36 +#define MOVEMENT_ACTION_WALK_FASTER_LEFT curr_GBA_rom.is_hoenn() ? 0x2F : 0x37 +#define MOVEMENT_ACTION_WALK_FASTER_RIGHT curr_GBA_rom.is_hoenn() ? 0x30 : 0x38 +#define MOVEMENT_ACTION_SLIDE_DOWN curr_GBA_rom.is_hoenn() ? 0x31 : 0x39 +#define MOVEMENT_ACTION_SLIDE_UP curr_GBA_rom.is_hoenn() ? 0x32 : 0x3A +#define MOVEMENT_ACTION_SLIDE_LEFT curr_GBA_rom.is_hoenn() ? 0x33 : 0x3B +#define MOVEMENT_ACTION_SLIDE_RIGHT curr_GBA_rom.is_hoenn() ? 0x34 : 0x3C +#define MOVEMENT_ACTION_PLAYER_RUN_DOWN curr_GBA_rom.is_hoenn() ? 0x35 : 0x3D +#define MOVEMENT_ACTION_PLAYER_RUN_UP curr_GBA_rom.is_hoenn() ? 0x36 : 0x3E +#define MOVEMENT_ACTION_PLAYER_RUN_LEFT curr_GBA_rom.is_hoenn() ? 0x37 : 0x3F +#define MOVEMENT_ACTION_PLAYER_RUN_RIGHT curr_GBA_rom.is_hoenn() ? 0x38 : 0x40 +#define MOVEMENT_ACTION_START_ANIM_IN_DIRECTION curr_GBA_rom.is_hoenn() ? 0x39 : 0x45 +#define MOVEMENT_ACTION_JUMP_SPECIAL_DOWN curr_GBA_rom.is_hoenn() ? 0x3A : 0x46 +#define MOVEMENT_ACTION_JUMP_SPECIAL_UP curr_GBA_rom.is_hoenn() ? 0x3B : 0x47 +#define MOVEMENT_ACTION_JUMP_SPECIAL_LEFT curr_GBA_rom.is_hoenn() ? 0x3C : 0x48 +#define MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT curr_GBA_rom.is_hoenn() ? 0x3D : 0x49 +#define MOVEMENT_ACTION_FACE_PLAYER curr_GBA_rom.is_hoenn() ? 0x3E : 0x4A +#define MOVEMENT_ACTION_FACE_AWAY_PLAYER curr_GBA_rom.is_hoenn() ? 0x3F : 0x4B +#define MOVEMENT_ACTION_LOCK_FACING_DIRECTION curr_GBA_rom.is_hoenn() ? 0x40 : 0x4C +#define MOVEMENT_ACTION_UNLOCK_FACING_DIRECTION curr_GBA_rom.is_hoenn() ? 0x41 : 0x4D +#define MOVEMENT_ACTION_JUMP_DOWN curr_GBA_rom.is_hoenn() ? 0x42 : 0x4E +#define MOVEMENT_ACTION_JUMP_UP curr_GBA_rom.is_hoenn() ? 0x43 : 0x4F +#define MOVEMENT_ACTION_JUMP_LEFT curr_GBA_rom.is_hoenn() ? 0x44 : 0x50 +#define MOVEMENT_ACTION_JUMP_RIGHT curr_GBA_rom.is_hoenn() ? 0x45 : 0x51 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN curr_GBA_rom.is_hoenn() ? 0x46 : 0x52 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_UP curr_GBA_rom.is_hoenn() ? 0x47 : 0x53 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT curr_GBA_rom.is_hoenn() ? 0x48 : 0x54 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT curr_GBA_rom.is_hoenn() ? 0x49 : 0x55 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN_UP curr_GBA_rom.is_hoenn() ? 0x4A : 0x56 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN curr_GBA_rom.is_hoenn() ? 0x4B : 0x57 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT_RIGHT curr_GBA_rom.is_hoenn() ? 0x4C : 0x58 +#define MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT_LEFT curr_GBA_rom.is_hoenn() ? 0x4D : 0x59 +#define MOVEMENT_ACTION_FACE_ORIGINAL_DIRECTION curr_GBA_rom.is_hoenn() ? 0x4E : 0x5A +#define MOVEMENT_ACTION_NURSE_JOY_BOW_DOWN curr_GBA_rom.is_hoenn() ? 0x4F : 0x5B +#define MOVEMENT_ACTION_ENABLE_JUMP_LANDING_GROUND_EFFECT curr_GBA_rom.is_hoenn() ? 0x50 : 0x5C +#define MOVEMENT_ACTION_DISABLE_JUMP_LANDING_GROUND_EFFECT curr_GBA_rom.is_hoenn() ? 0x51 : 0x5D +#define MOVEMENT_ACTION_DISABLE_ANIMATION curr_GBA_rom.is_hoenn() ? 0x52 : 0x5E +#define MOVEMENT_ACTION_RESTORE_ANIMATION curr_GBA_rom.is_hoenn() ? 0x53 : 0x5F +#define MOVEMENT_ACTION_SET_INVISIBLE curr_GBA_rom.is_hoenn() ? 0x54 : 0x60 +#define MOVEMENT_ACTION_SET_VISIBLE curr_GBA_rom.is_hoenn() ? 0x55 : 0x61 +#define MOVEMENT_ACTION_EMOTE_EXCLAMATION_MARK curr_GBA_rom.is_hoenn() ? 0x56 : 0x62 +#define MOVEMENT_ACTION_EMOTE_QUESTION_MARK curr_GBA_rom.is_hoenn() ? 0x57 : 0x63 +#define MOVEMENT_ACTION_EMOTE_HEART curr_GBA_rom.is_hoenn() ? 0x58 : 0xFF +#define MOVEMENT_ACTION_REVEAL_TRAINER curr_GBA_rom.is_hoenn() ? 0x59 : 0x67 +#define MOVEMENT_ACTION_ROCK_SMASH_BREAK curr_GBA_rom.is_hoenn() ? 0x5A : 0x68 +#define MOVEMENT_ACTION_CUT_TREE curr_GBA_rom.is_hoenn() ? 0x5B : 0x69 +#define MOVEMENT_ACTION_SET_FIXED_PRIORITY curr_GBA_rom.is_hoenn() ? 0x5C : 0x6A +#define MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY curr_GBA_rom.is_hoenn() ? 0x5D : 0x6B +#define MOVEMENT_ACTION_INIT_AFFINE_ANIM curr_GBA_rom.is_hoenn() ? 0x5E : 0x6C +#define MOVEMENT_ACTION_CLEAR_AFFINE_ANIM curr_GBA_rom.is_hoenn() ? 0x5F : 0x6D +#define MOVEMENT_ACTION_HIDE_REFLECTION curr_GBA_rom.is_hoenn() ? 0x60 : 0xFF +#define MOVEMENT_ACTION_SHOW_REFLECTION curr_GBA_rom.is_hoenn() ? 0x61 : 0xFF +#define MOVEMENT_ACTION_WALK_DOWN_START_AFFINE curr_GBA_rom.is_hoenn() ? 0x62 : 0x6E +#define MOVEMENT_ACTION_WALK_DOWN_AFFINE curr_GBA_rom.is_hoenn() ? 0x63 : 0x6F +#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN curr_GBA_rom.is_hoenn() ? 0x64 : 0x70 +#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP curr_GBA_rom.is_hoenn() ? 0x65 : 0x71 +#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT curr_GBA_rom.is_hoenn() ? 0x66 : 0x72 +#define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT curr_GBA_rom.is_hoenn() ? 0x67 : 0x73 +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN curr_GBA_rom.is_hoenn() ? 0x68 : 0x74 +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP curr_GBA_rom.is_hoenn() ? 0x69 : 0x75 +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT curr_GBA_rom.is_hoenn() ? 0x6A : 0x76 +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT curr_GBA_rom.is_hoenn() ? 0x6B : 0x77 +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN curr_GBA_rom.is_hoenn() ? 0x6C : 0x78 +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP curr_GBA_rom.is_hoenn() ? 0x6D : 0x79 +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT curr_GBA_rom.is_hoenn() ? 0x6E : 0x7A +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT curr_GBA_rom.is_hoenn() ? 0x6F : 0x7B +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN curr_GBA_rom.is_hoenn() ? 0x70 : 0x7C +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP curr_GBA_rom.is_hoenn() ? 0x71 : 0x7D +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT curr_GBA_rom.is_hoenn() ? 0x72 : 0x7E +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT curr_GBA_rom.is_hoenn() ? 0x73 : 0x7F +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN curr_GBA_rom.is_hoenn() ? 0x74 : 0x80 +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP curr_GBA_rom.is_hoenn() ? 0x75 : 0x81 +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT curr_GBA_rom.is_hoenn() ? 0x76 : 0x82 +#define MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT curr_GBA_rom.is_hoenn() ? 0x77 : 0x83 +#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN curr_GBA_rom.is_hoenn() ? 0x78 : 0x84 +#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP curr_GBA_rom.is_hoenn() ? 0x79 : 0x85 +#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT curr_GBA_rom.is_hoenn() ? 0x7A : 0x86 +#define MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT curr_GBA_rom.is_hoenn() ? 0x7B : 0x87 +#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN curr_GBA_rom.is_hoenn() ? 0x7C : 0x88 +#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP curr_GBA_rom.is_hoenn() ? 0x7D : 0x89 +#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT curr_GBA_rom.is_hoenn() ? 0x7E : 0x8A +#define MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT curr_GBA_rom.is_hoenn() ? 0x7F : 0x8B +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN curr_GBA_rom.is_hoenn() ? 0x80 : 0x8C +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP curr_GBA_rom.is_hoenn() ? 0x81 : 0x8D +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT curr_GBA_rom.is_hoenn() ? 0x82 : 0x8E +#define MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT curr_GBA_rom.is_hoenn() ? 0x83 : 0x8F +#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN curr_GBA_rom.is_hoenn() ? 0x84 : 0x90 +#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP curr_GBA_rom.is_hoenn() ? 0x85 : 0x91 +#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT curr_GBA_rom.is_hoenn() ? 0x86 : 0x92 +#define MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT curr_GBA_rom.is_hoenn() ? 0x87 : 0x93 +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN curr_GBA_rom.is_hoenn() ? 0x88 : 0xFF +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP curr_GBA_rom.is_hoenn() ? 0x89 : 0xFF +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT curr_GBA_rom.is_hoenn() ? 0x8A : 0xFF +#define MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT curr_GBA_rom.is_hoenn() ? 0x8B : 0xFF +#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_LEFT curr_GBA_rom.is_hoenn() ? 0x8C : 0xFF +#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_RIGHT curr_GBA_rom.is_hoenn() ? 0x8D : 0xFF +#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_LEFT curr_GBA_rom.is_hoenn() ? 0x8E : 0xFF +#define MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_RIGHT curr_GBA_rom.is_hoenn() ? 0x8F : 0xFF +#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT curr_GBA_rom.is_hoenn() ? 0x90 : 0xFF +#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT curr_GBA_rom.is_hoenn() ? 0x91 : 0xFF +#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT curr_GBA_rom.is_hoenn() ? 0x92 : 0xFF +#define MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT curr_GBA_rom.is_hoenn() ? 0x93 : 0xFF +#define MOVEMENT_ACTION_LOCK_ANIM curr_GBA_rom.is_hoenn() ? 0x94 : 0xFF +#define MOVEMENT_ACTION_UNLOCK_ANIM curr_GBA_rom.is_hoenn() ? 0x95 : 0xFF +#define MOVEMENT_ACTION_WALK_LEFT_AFFINE curr_GBA_rom.is_hoenn() ? 0x96 : 0xFF +#define MOVEMENT_ACTION_WALK_RIGHT_AFFINE curr_GBA_rom.is_hoenn() ? 0x97 : 0xFF +#define MOVEMENT_ACTION_LEVITATE curr_GBA_rom.is_hoenn() ? 0x98 : 0xFF +#define MOVEMENT_ACTION_STOP_LEVITATE curr_GBA_rom.is_hoenn() ? 0x99 : 0xFF +#define MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP curr_GBA_rom.is_hoenn() ? 0x9A : 0xFF +#define MOVEMENT_ACTION_FIGURE_8 curr_GBA_rom.is_hoenn() ? 0x9B : 0xFF +#define MOVEMENT_ACTION_FLY_UP curr_GBA_rom.is_hoenn() ? 0x9C : 0xA4 +#define MOVEMENT_ACTION_FLY_DOWN curr_GBA_rom.is_hoenn() ? 0x9D : 0xA5 +#define MOVEMENT_ACTION_FACE_DOWN_FAST curr_GBA_rom.is_hoenn() ? 0xFF : 0x4 +#define MOVEMENT_ACTION_FACE_UP_FAST curr_GBA_rom.is_hoenn() ? 0xFF : 0x5 +#define MOVEMENT_ACTION_FACE_LEFT_FAST curr_GBA_rom.is_hoenn() ? 0xFF : 0x6 +#define MOVEMENT_ACTION_FACE_RIGHT_FAST curr_GBA_rom.is_hoenn() ? 0xFF : 0x7 +#define MOVEMENT_ACTION_WALK_SLOWER_DOWN curr_GBA_rom.is_hoenn() ? 0xFF : 0x8 +#define MOVEMENT_ACTION_WALK_SLOWER_UP curr_GBA_rom.is_hoenn() ? 0xFF : 0x9 +#define MOVEMENT_ACTION_WALK_SLOWER_LEFT curr_GBA_rom.is_hoenn() ? 0xFF : 0xA +#define MOVEMENT_ACTION_WALK_SLOWER_RIGHT curr_GBA_rom.is_hoenn() ? 0xFF : 0xB +#define MOVEMENT_ACTION_PLAYER_RUN_DOWN_SLOW curr_GBA_rom.is_hoenn() ? 0xFF : 0x41 +#define MOVEMENT_ACTION_PLAYER_RUN_UP_SLOW curr_GBA_rom.is_hoenn() ? 0xFF : 0x42 +#define MOVEMENT_ACTION_PLAYER_RUN_LEFT_SLOW curr_GBA_rom.is_hoenn() ? 0xFF : 0x43 +#define MOVEMENT_ACTION_PLAYER_RUN_RIGHT_SLOW curr_GBA_rom.is_hoenn() ? 0xFF : 0x44 +#define MOVEMENT_ACTION_EMOTE_X curr_GBA_rom.is_hoenn() ? 0xFF : 0x64 +#define MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK curr_GBA_rom.is_hoenn() ? 0xFF : 0x65 +#define MOVEMENT_ACTION_EMOTE_SMILE curr_GBA_rom.is_hoenn() ? 0xFF : 0x66 +#define MOVEMENT_ACTION_SPIN_DOWN curr_GBA_rom.is_hoenn() ? 0xFF : 0x94 +#define MOVEMENT_ACTION_SPIN_UP curr_GBA_rom.is_hoenn() ? 0xFF : 0x95 +#define MOVEMENT_ACTION_SPIN_LEFT curr_GBA_rom.is_hoenn() ? 0xFF : 0x96 +#define MOVEMENT_ACTION_SPIN_RIGHT curr_GBA_rom.is_hoenn() ? 0xFF : 0x97 +#define MOVEMENT_ACTION_RAISE_HAND_AND_STOP curr_GBA_rom.is_hoenn() ? 0xFF : 0x98 +#define MOVEMENT_ACTION_RAISE_HAND_AND_JUMP curr_GBA_rom.is_hoenn() ? 0xFF : 0x99 +#define MOVEMENT_ACTION_RAISE_HAND_AND_SWIM curr_GBA_rom.is_hoenn() ? 0xFF : 0x9A +#define MOVEMENT_ACTION_WALK_SLOWEST_DOWN curr_GBA_rom.is_hoenn() ? 0xFF : 0x9B +#define MOVEMENT_ACTION_WALK_SLOWEST_UP curr_GBA_rom.is_hoenn() ? 0xFF : 0x9C +#define MOVEMENT_ACTION_WALK_SLOWEST_LEFT curr_GBA_rom.is_hoenn() ? 0xFF : 0x9D +#define MOVEMENT_ACTION_WALK_SLOWEST_RIGHT curr_GBA_rom.is_hoenn() ? 0xFF : 0x9E +#define MOVEMENT_ACTION_SHAKE_HEAD_OR_WALK_IN_PLACE curr_GBA_rom.is_hoenn() ? 0xFF : 0x9F +#define MOVEMENT_ACTION_GLIDE_DOWN curr_GBA_rom.is_hoenn() ? 0xFF : 0xA0 +#define MOVEMENT_ACTION_GLIDE_UP curr_GBA_rom.is_hoenn() ? 0xFF : 0xA1 +#define MOVEMENT_ACTION_GLIDE_LEFT curr_GBA_rom.is_hoenn() ? 0xFF : 0xA2 +#define MOVEMENT_ACTION_GLIDE_RIGHT curr_GBA_rom.is_hoenn() ? 0xFF : 0xA3 +#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_DOWN curr_GBA_rom.is_hoenn() ? 0xFF : 0xA6 +#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_UP curr_GBA_rom.is_hoenn() ? 0xFF : 0xA7 +#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_LEFT curr_GBA_rom.is_hoenn() ? 0xFF : 0xA8 +#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_RIGHT curr_GBA_rom.is_hoenn() ? 0xFF : 0xA9 #define CPU_SET_16BIT 0x00000000 #define CPU_SET_32BIT 0x04000000 @@ -272,7 +272,7 @@ public: * You're in control! */ mystery_gift_script(u8 *save_section_30_buffer); - void build_script(Pokemon_Party &incoming_box_data); + void build_script(PokeBox *box); //void build_script_old(Pokemon_Party &incoming_box_data); const u8 *get_script() const; const u8 * get_section30() const; diff --git a/include/mystery_gift_injector.h b/include/mystery_gift_injector.h index 24cdcdd..7203534 100644 --- a/include/mystery_gift_injector.h +++ b/include/mystery_gift_injector.h @@ -4,6 +4,6 @@ #include "pokemon_party.h" #include "pokemon_data.h" -bool inject_mystery(Pokemon_Party &incoming_box_data); +bool inject_mystery(PokeBox* box); #endif \ No newline at end of file diff --git a/include/pccs/GBPokemon.h b/include/pccs/GBPokemon.h new file mode 100644 index 0000000..4b1d627 --- /dev/null +++ b/include/pccs/GBPokemon.h @@ -0,0 +1,152 @@ +#ifndef GBPOKEMON_H +#define GBPOKEMON_H + +#include "Pokemon.h" +#include "Gen3Pokemon.h" + +class GBPokemon : public Pokemon // The class for gen 1 and 2 Pokemon, since they share some conversion functions +{ +protected: + GBPokemon(); + void updateValidity(); + // These store the data bytes + byte nicknameArray[11]; + byte OTArray[11]; + byte externalIndexNumber; + Language lang = (Language)0; + + static const DataVarInfo + // All of the data info variables + speciesIndexNumber[2], + level[2], + moveOne[2], moveTwo[2], moveThree[2], moveFour[2], + trainerID[2], + expPoints[2], + hpStatExp[2], atkStatExp[2], defStatExp[2], speStatExp[2], spcStatExp[2], + atkDV[2], defDV[2], speDV[2], spcDV[2], + ppUpNumMoveOne[2], ppUpNumMoveTwo[2], ppUpNumMoveThree[2], ppUpNumMoveFour[2], + ppNumTotalMoveOne[2], ppNumTotalMoveTwo[2], ppNumTotalMoveThree[2], ppNumTotalMoveFour[2]; + + static const DataVarInfo + // and the convenient arrays of some of the variable groups: + *moves[4], + *statExps[5], + *DVs[5], + *PPUpNums[4], + *PPUpTotals[4]; + +// This is used to easily print out a Pokemon, when using a standard C++ terminal +#if ON_GBA +#else + std::string parentPrint(); +#endif + +public: + virtual void loadData(Language nLang, byte nDataArray[], byte nNicknameArray[], byte nOTArray[], byte nExternalIndexNum); + + // All of the simple getters and setters are defined here + u32 getLevel() { return getVar(level[generation - 1]); } + u32 getTrainerID() { return getVar(trainerID[generation - 1]); } + u32 getExpPoints() { return getVar(expPoints[generation - 1]); } + + bool setLevel(byte newVal) { return setVar(level[generation - 1], newVal); } + bool setOriginalTrainerID(byte newVal) { return setVar(trainerID[generation - 1], newVal); } + bool setExpPoints(u32 newVal) { return setVar(expPoints[generation - 1], newVal); } + + // The ones that access arrays are defined here: + u32 getMove(int moveIndex) { return getVar(moves[moveIndex][generation - 1]); } + u32 getStatExp(Stat currStat) { return getVar(statExps[currStat][generation - 1]); } + u32 getPPUpNum(int moveIndex) { return getVar(PPUpNums[moveIndex][generation - 1]); } + u32 getPPTotal(int moveIndex) { return getVar(PPUpTotals[moveIndex][generation - 1]); } + + bool setMove(int moveIndex, byte newVal) { return setVar(moves[moveIndex][generation - 1], newVal); } + bool setStatExp(Stat currStat, byte newVal) { return setVar(statExps[currStat][generation - 1], newVal); } + bool setPPUpNum(int moveIndex, byte newVal) { return setVar(PPUpNums[moveIndex][generation - 1], newVal); } + bool setPPTotal(int moveIndex, byte newVal) { return setVar(PPUpTotals[moveIndex][generation - 1], newVal); } + + // These are all replaced in the child classes, but give a default value or do nothing here + + // ---- Gen 1 + virtual u32 getSpeciesIndexNumber() { return getVar(*speciesIndexNumber); } + virtual u32 getCurrentHP() { return 0; } + virtual u32 getStatusCondition() { return 0; } + virtual u32 getCatchRate() { return 0; } + virtual u32 getType(int typeIndex) { return NORMAL; } + + virtual bool setSpeciesIndexNumber(byte newVal) { return setVar(*speciesIndexNumber, newVal); } + virtual bool setCurrentHP(byte newVal) { return false; } + virtual bool setStatusCondition(byte newVal) { return false; } + virtual bool setCatchRate(byte newVal) { return false; } + virtual bool setType(int typeIndex, Gen1Types newVal) { return false; } + + // ---- Gen 2 + virtual u32 getHeldItem() { return 0; } // no item + virtual u32 getFriendship() { return 70; } // default friendship - make this different for Pikachu in Yellow??? + virtual u32 getPokerusStrain() { return 0; } + virtual u32 getPokerusDaysRemaining() { return 0; } + virtual u32 getCaughtDataTime() { return 0; } + virtual u32 getCaughtDataLevel() { return 0; } + virtual u32 getCaughtDataGender() { return 0; } + virtual u32 getCaughtDataLocation() { return 0; } + + virtual bool setHeldItem(byte newVal) { return false; } // This could *technically* be seen as setting the catch rate but... + virtual bool setFriendship(byte newVal) { return false; } + virtual bool setPokerusStrain(byte newVal) { return false; } + virtual bool setPokerusDaysRemaining(byte newVal) { return false; } + virtual bool setCaughtDataTime(byte newVal) { return false; } + virtual bool setCaughtDataLevel(byte newVal) { return false; } + virtual bool setCaughtDataGender(byte newVal) { return false; } + virtual bool setCaughtDataLocation(byte newVal) { return false; } + + // These all have special implementations + u32 getDV(Stat currStat); + bool setDV(Stat currStat, byte newVal); + + // These is virtual so it can be overwitten in Gen 1 + + // These aren't direct variables, but they're useful to have + Language getLanguage() { return lang; }; + byte getUnownLetter(); + Gender getGender(); + Nature getVirtualConsoleNature(); + bool getIsShiny(); + bool externalConvertNickname(byte outputArray[]); + + // And this is for all the conversion stuff + bool convertToGen3(Gen3Pokemon *newPkmn, bool sanitizeMythicals); + bool loadEvent(Gen3Pokemon *newPkmn); + + bool generatePersonalityValue(Gen3Pokemon *newPkmn, RNGMethod rng); + bool convertTrainerID(Gen3Pokemon *newPkmn); + bool convertNickname(Gen3Pokemon *newPkmn); + bool convertLanguage(Gen3Pokemon *newPkmn); + bool convertMiscFlags(Gen3Pokemon *newPkmn); + bool convertTrainerNickname(Gen3Pokemon *newPkmn); + bool convertMarkings(Gen3Pokemon *newPkmn); + // Data + bool convertSpeciesIndexNumber(Gen3Pokemon *newPkmn); + bool convertItem(Gen3Pokemon *newPkmn); + bool convertEXP(Gen3Pokemon *newPkmn); + bool convertFriendship(Gen3Pokemon *newPkmn); + bool convertMoves(Gen3Pokemon *newPkmn); + bool convertEVs(Gen3Pokemon *newPkmn); + bool convertContestConditions(Gen3Pokemon *newPkmn); + bool convertPokerus(Gen3Pokemon *newPkmn); + bool convertMetLocation(Gen3Pokemon *newPkmn); + bool convertMetLevel(Gen3Pokemon *newPkmn); + bool convertGameOfOrigin(Gen3Pokemon *newPkmn); + bool convertPokeball(Gen3Pokemon *newPkmn); + bool convertTrainerGender(Gen3Pokemon *newPkmn); + bool convertIVs(Gen3Pokemon *newPkmn); + bool convertAbilityFlag(Gen3Pokemon *newPkmn); + bool convertRibbonsAndObedience(Gen3Pokemon *newPkmn); + bool convertShininess(Gen3Pokemon *newPkmn); + // Extra + bool setRequestedLetter(Gen3Pokemon *newPkmn); + bool setRequestedNature(Gen3Pokemon *newPkmn); + bool setRequestedGender(Gen3Pokemon *newPkmn); + bool setRequestedAbility(Gen3Pokemon *newPkmn); + bool setRequestedSize(Gen3Pokemon *newPkmn); +}; + +#endif \ No newline at end of file diff --git a/include/pccs/Gen1Pokemon.h b/include/pccs/Gen1Pokemon.h new file mode 100644 index 0000000..aed7556 --- /dev/null +++ b/include/pccs/Gen1Pokemon.h @@ -0,0 +1,39 @@ +#ifndef GEN1POKEMON_H +#define GEN1POKEMON_H + +#include "GBPokemon.h" + +class Gen1Pokemon : public GBPokemon // The class for gen 1 Pokemon +{ +public: + Gen1Pokemon(PokemonTables *table); + byte dataArray[33]; + + u32 getSpeciesIndexNumber(); + u32 getCurrentHP() { return getVar(g1_currentHP); } + u32 getStatusCondition() { return getVar(g1_statusCondition); } + u32 getCatchRate() { return getVar(g1_catchRate); } + u32 getType(int typeIndex) { return getVar(*g1_types[typeIndex]); } + + bool setSpeciesIndexNumber(byte newVal); + bool setCurrentHP(byte newVal) { return setVar(g1_currentHP, newVal); } + bool setStatusCondition(byte newVal) { return setVar(g1_statusCondition, newVal); } + bool setCatchRate(byte newVal) { return setVar(g1_catchRate, newVal); } + bool setType(int typeIndex, Gen1Types newVal) { return setVar(*g1_types[typeIndex], newVal); } + +protected: + static const DataVarInfo + // Gen 1 specific data + g1_currentHP, + g1_statusCondition, + g1_typeOne, g1_typeTwo, + g1_catchRate, + *g1_types[2]; + +#if ON_GBA +#else + void print(std::ostream &os); +#endif +}; + +#endif \ No newline at end of file diff --git a/include/pccs/Gen2Pokemon.h b/include/pccs/Gen2Pokemon.h new file mode 100644 index 0000000..1e35405 --- /dev/null +++ b/include/pccs/Gen2Pokemon.h @@ -0,0 +1,47 @@ +#ifndef GEN2POKEMON_H +#define GEN2POKEMON_H + +#include "GBPokemon.h" + +class Gen2Pokemon : public GBPokemon // The class for gen 2 Pokemon +{ +public: + Gen2Pokemon(PokemonTables *table); + byte dataArray[32]; + + u32 getHeldItem() { return getVar(g2_heldItem); } + u32 getFriendship() { return getVar(g2_friendship); } + u32 getPokerusStrain() { return getVar(g2_pokerusStrain); } + u32 getPokerusDaysRemaining() { return getVar(g2_pokerusDaysRemaining); } + u32 getCaughtDataTime() { return getVar(g2_caughtDataTime); } + u32 getCaughtDataLevel() { return getVar(g2_caughtDataLevel); } + u32 getCaughtDataGender() { return getVar(g2_caughtDataGender); } + u32 getCaughtDataLocation() { return getVar(g2_caughtDataLocation); } + + bool setHeldItem(byte newVal) { return setVar(g2_heldItem, newVal); } + bool setFriendship(byte newVal) { return setVar(g2_friendship, newVal); } + bool setPokerusStrain(byte newVal) { return setVar(g2_pokerusStrain, newVal); } + bool setPokerusDaysRemaining(byte newVal) { return setVar(g2_pokerusDaysRemaining, newVal); } + bool setCaughtDataTime(byte newVal) { return setVar(g2_caughtDataTime, newVal); } + bool setCaughtDataLevel(byte newVal) { return setVar(g2_caughtDataLevel, newVal); } + bool setCaughtDataGender(byte newVal) { return setVar(g2_caughtDataGender, newVal); } + bool setCaughtDataLocation(byte newVal) { return setVar(g2_caughtDataLocation, newVal); } + +protected: + static const DataVarInfo + g2_heldItem, + g2_friendship, + g2_pokerusStrain, + g2_pokerusDaysRemaining, + g2_caughtDataTime, + g2_caughtDataLevel, + g2_caughtDataGender, + g2_caughtDataLocation; + +#if ON_GBA +#else + void print(std::ostream &os); +#endif +}; + +#endif \ No newline at end of file diff --git a/include/pccs/Gen3Pokemon.h b/include/pccs/Gen3Pokemon.h new file mode 100644 index 0000000..a3afd29 --- /dev/null +++ b/include/pccs/Gen3Pokemon.h @@ -0,0 +1,295 @@ +#ifndef GEN3POKEMON_H +#define GEN3POKEMON_H + +#include "Pokemon.h" + +class Gen3Pokemon : public Pokemon // The class for gen 3 Pokemon + +{ +public: + Gen3Pokemon(PokemonTables *table); + + bool convertToGen3(Gen3Pokemon *g3p); + + u32 currRand; + u32 getNextRand_u32(); + u32 getPrevRand_u32(); + u16 getNextRand_u16(); + u16 getPrevRand_u16(); + + // These are stored internally so that they can be set by different functions + byte internalUnownLetter; + Nature internalNature; + Gender internalGender; + int internalSize; + u32 internalAbility; + +protected: + // These store the data bytes + byte dataArray[80] = {0}; + + // This stores if the data is current encrypted or not + bool isEncrypted; + + // These store the offsets of the various data substructures: + int substructOffsets[4] = {0, 12, 24, 36}; + int currSubstructureShift = 0; + + void swapSubstructures(int indexOne, int indexTwo); + +#pragma region + // Since there is only the Pokemon parent class, we can directly define these directly + static const DataVarInfo + // All of the data info variables + personalityValue, + trainerID, + secretID, + nicknameLetterOne, // This is silly. Change this. + nicknameLetterTwo, + nicknameLetterThree, + nicknameLetterFour, + nicknameLetterFive, + nicknameLetterSix, + nicknameLetterSeven, + nicknameLetterEight, + nicknameLetterNine, + nicknameLetterTen, + language, + isBadEgg, + hasSpecies, + useEggName, + blockBoxRS, + // unusedFlags, + originalTrainerNameLetterOne, // This is also silly. Change this. + originalTrainerNameLetterTwo, + originalTrainerNameLetterThree, + originalTrainerNameLetterFour, + originalTrainerNameLetterFive, + originalTrainerNameLetterSix, + originalTrainerNameLetterSeven, + markings, + checksum; + // unknown; + + static const DataVarInfo + *nickname[10], + *originalTrainerName[7]; + + // data section G + static const DataVarInfo + speciesIndexNumber, + heldItem, + expPoints, + ppUpNumMoveOne, + ppUpNumMoveTwo, + ppUpNumMoveThree, + ppUpNumMoveFour, + friendship; + // unused; + + static const DataVarInfo + *ppUpNums[4]; + + // data section A + static const DataVarInfo + moveOne, + moveTwo, + moveThree, + moveFour, + moveOnePP, + moveTwoPP, + moveThreePP, + moveFourPP; + static const DataVarInfo + *moves[4], + *ppUpTotals[4]; + + // data section E + static const DataVarInfo + hpEVs, + attackEVs, + defenseEVs, + speedEVs, + specialAttackEVs, + specialDefenseEVs, + coolnessCondition, + beautyCondition, + cutenessCondition, + smartnessCondition, + toughnessCondition, + sheen; + + static const DataVarInfo + *EVs[6], + *contestConditions[5]; + + static const DataVarInfo + + // data section M + pokerusStrain, + pokerusDaysRemaining, + metLocation, + levelMet, + gameOfOrigin, + pokeballCaughtIn, + originalTrainerGender, + hpIVs, + attackIVs, + defenseIVs, + speedIVs, + specialAttackIVs, + specialDefenseIVs, + isEgg, + ability, + coolNormalContestRibbon, // This is also very silly. Change it. + coolSuperContestRibbon, + coolHyperContestRibbon, + coolMasterContestRibbon, + beautyNormalContestRibbon, + beautySuperContestRibbon, + beautyHyperContestRibbon, + beautyMasterContestRibbon, + cuteNormalContestRibbon, + cuteSuperContestRibbon, + cuteHyperContestRibbon, + cuteMasterContestRibbon, + smartNormalContestRibbon, + smartSuperContestRibbon, + smartHyperContestRibbon, + smartMasterContestRibbon, + toughNormalContestRibbon, + toughSuperContestRibbon, + toughHyperContestRibbon, + toughMasterContestRibbon, + championRibbon, + winningRibbon, + victoryRibbon, + artistRibbon, + effortRibbon, + battleChampionRibbon, + regionalChampionRibbon, + nationalChampionRibbon, + countryRibbon, + nationalRibbon, + earthRibbon, + unusedRibbons, + fatefulEncounterObedience; + + static const DataVarInfo + *IVs[6], + *ribbons[31]; +#pragma endregion + + // This is used to easily print out a Pokemon, when using a standard C++ terminal +#if ON_GBA +#else +public: + void print(std::ostream &os); + std::string printDataArray(bool encrypedData); +#endif + +public: + // All of the simple getters and setters are defined here + u32 getPersonalityValue() { return getVar(personalityValue); } + u32 getTrainerID() { return getVar(trainerID); } + u32 getSecretID() { return getVar(secretID); } + u32 getLanguage() { return getVar(language); } + u32 getIsBadEgg() { return getVar(isBadEgg); } + u32 getHasSpecies() { return getVar(hasSpecies); } + u32 getUseEggName() { return getVar(useEggName); } + u32 getBlockBoxRS() { return getVar(blockBoxRS); } + u32 getMarkings() { return getVar(markings); } + u32 getChecksum() { return getVar(checksum); } + u32 getSpeciesIndexNumber() { return getVar(speciesIndexNumber, substructOffsets[SUB_G]); } + u32 getHeldItem() { return getVar(heldItem, substructOffsets[SUB_G]); } + u32 getExpPoints() { return getVar(expPoints, substructOffsets[SUB_G]); } + u32 getFriendship() { return getVar(friendship, substructOffsets[SUB_G]); } + u32 getSheen() { return getVar(sheen, substructOffsets[SUB_E]); } + u32 getPokerusStrain() { return getVar(pokerusStrain, substructOffsets[SUB_M]); } + u32 getPokerusDaysRemaining() { return getVar(pokerusDaysRemaining, substructOffsets[SUB_M]); } + u32 getMetLocation() { return getVar(metLocation, substructOffsets[SUB_M]); } + u32 getLevelMet() { return getVar(levelMet, substructOffsets[SUB_M]); } + u32 getGameOfOrigin() { return getVar(gameOfOrigin, substructOffsets[SUB_M]); } + u32 getPokeballCaughtIn() { return getVar(pokeballCaughtIn, substructOffsets[SUB_M]); } + u32 getOriginalTrainerGender() { return getVar(originalTrainerGender, substructOffsets[SUB_M]); } + u32 getIsEgg() { return getVar(isEgg, substructOffsets[SUB_M]); } + u32 getAbility() { return getVar(ability, substructOffsets[SUB_M]); } + u32 getFatefulEncounterObedience() { return getVar(fatefulEncounterObedience, substructOffsets[SUB_M]); } + + bool setTrainerID(u32 newVal) { return setVar(trainerID, newVal); } + bool setSecretID(u32 newVal) { return setVar(secretID, newVal); } + bool setLanguage(u32 newVal) { return setVar(language, newVal); } + bool setIsBadEgg(u32 newVal) { return setVar(isBadEgg, newVal); } + bool setHasSpecies(u32 newVal) { return setVar(hasSpecies, newVal); } + bool setUseEggName(u32 newVal) { return setVar(useEggName, newVal); } + bool setBlockBoxRS(u32 newVal) { return setVar(blockBoxRS, newVal); } + bool setMarkings(u32 newVal) { return setVar(markings, newVal); } + bool setChecksum(u32 newVal) { return setVar(checksum, newVal); } + bool setSpeciesIndexNumber(u32 newVal) { return setVar(speciesIndexNumber, substructOffsets[SUB_G], newVal); } + bool setHeldItem(Item newVal) { return setVar(heldItem, substructOffsets[SUB_G], newVal); } + bool setExpPoints(u32 newVal) { return setVar(expPoints, substructOffsets[SUB_G], newVal); } + bool setFriendship(u32 newVal) { return setVar(friendship, substructOffsets[SUB_G], newVal); } + bool setSheen(u32 newVal) { return setVar(sheen, substructOffsets[SUB_E], newVal); } + bool setPokerusStrain(u32 newVal) { return setVar(pokerusStrain, substructOffsets[SUB_M], newVal); } + bool setPokerusDaysRemaining(u32 newVal) { return setVar(pokerusDaysRemaining, substructOffsets[SUB_M], newVal); } + bool setMetLocation(u32 newVal) { return setVar(metLocation, substructOffsets[SUB_M], newVal); } + bool setLevelMet(u32 newVal) { return setVar(levelMet, substructOffsets[SUB_M], newVal); } + bool setGameOfOrigin(Game newVal) { return setVar(gameOfOrigin, substructOffsets[SUB_M], newVal); } + bool setPokeballCaughtIn(u32 newVal) { return setVar(pokeballCaughtIn, substructOffsets[SUB_M], newVal); } + bool setOriginalTrainerGender(u32 newVal) { return setVar(originalTrainerGender, substructOffsets[SUB_M], newVal); } + bool setIsEgg(u32 newVal) { return setVar(isEgg, substructOffsets[SUB_M], newVal); } + bool setFatefulEncounterObedience(u32 newVal) { return setVar(fatefulEncounterObedience, substructOffsets[SUB_M], newVal); } + + // The ones that access arrays are defined here: + u32 getPPUpNum(int moveIndex) { return getVar(*ppUpNums[moveIndex], substructOffsets[SUB_G]); } + u32 getMove(int moveIndex) { return getVar(*moves[moveIndex], substructOffsets[SUB_A]); } + u32 getPPTotal(int moveIndex) { return getVar(*ppUpTotals[moveIndex], substructOffsets[SUB_A]); } + u32 getEV(Stat currStat) { return getVar(*EVs[currStat], substructOffsets[SUB_E]); } + u32 getContestCondition(Condition currCondition) { return getVar(*contestConditions[currCondition], substructOffsets[SUB_E]); } + u32 getIV(Stat currStat) { return getVar(*IVs[currStat], substructOffsets[SUB_M]); } + u32 getRibbons(Ribbon currRibbon) { return getVar(*ribbons[currRibbon], substructOffsets[SUB_M]); } + u32 getNicknameLetter(int index) { return getVar(*nickname[index]); }; + u32 getOTLetter(int index) { return getVar(*originalTrainerName[index]); }; + + bool setPPUpNum(int moveIndex, u32 newVal) { return setVar(*ppUpNums[moveIndex], substructOffsets[SUB_G], newVal); } + bool setMove(int moveIndex, u32 newVal) { return setVar(*moves[moveIndex], substructOffsets[SUB_A], newVal); } + bool setPPTotal(int moveIndex, u32 newVal) { return setVar(*ppUpTotals[moveIndex], substructOffsets[SUB_A], newVal); } + bool setEV(Stat currStat, u32 newVal) { return setVar(*EVs[currStat], substructOffsets[SUB_E], newVal); } + bool setContestCondition(Condition currCondition, u32 newVal) { return setVar(*contestConditions[currCondition], substructOffsets[SUB_E], newVal); } + bool setIV(Stat currStat, u32 newVal) { return setVar(*IVs[currStat], substructOffsets[SUB_M], newVal); } + bool setRibbons(Ribbon currRibbon, u32 newVal) { return setVar(*ribbons[currRibbon], substructOffsets[SUB_M], newVal); } + bool setNicknameLetter(int index, u32 newVal) { return setVar(*nickname[index], newVal); }; + bool setOTLetter(int index, u32 newVal) { return setVar(*originalTrainerName[index], newVal); }; + + bool setPersonalityValue(u32 newVal); + bool setAbility(u32 newVal); + + // This is used to load our data in from an array and decrypt it + void loadData(byte incomingArray[]); + + // And then some general functions + void decryptSubstructures(); + + void encryptSubstructures(); + + void updateChecksum(); + + void updateSubstructureShift(); + + void resetSubstructureShift(); + + void updateSecurityData(); + + byte getUnownLetter(); + Nature getNature(); + Gender getGender(); + int getAbilityFromPersonalityValue(); + int getSize(); + + bool getIsShiny(); + + bool setNicknameArray(byte nameArr[], int nameArrSize); + bool setOTArray(byte nameArr[], int nameArrSize); +}; + +#endif \ No newline at end of file diff --git a/include/pccs/PokeBox.h b/include/pccs/PokeBox.h new file mode 100644 index 0000000..74dce4a --- /dev/null +++ b/include/pccs/PokeBox.h @@ -0,0 +1,49 @@ +#ifndef POKEBOX_H +#define POKEBOX_H + +#include "Gen1Pokemon.h" +#include "Gen2Pokemon.h" +#include "Gen3Pokemon.h" + +class PokeBox // Stores up to 30 Pokemon in a box +{ +private: + void convertPkmn(int index); + PokemonTables *table; + Pokemon *boxStorage[30]; + Pokemon *nullMon; + int currIndex = 0; + +public: + PokeBox(); + PokeBox(PokemonTables *nTable); + void setTable(PokemonTables *nTable); + bool addPokemon(Pokemon *currPkmn); + Pokemon *getPokemon(int index); + GBPokemon *getGBPokemon(int index); + Gen3Pokemon *getGen3Pokemon(int index); + bool removePokemon(int index); + void loadData(int generation, Language nLang, byte nDataArray[]); + void convertAll(); + int getNumInBox(); + int getNumValid(); + bool stabilize_mythical = false; + +#if ON_GBA +#else + friend std::ostream &operator<<(std::ostream &os, PokeBox &pc) + { + for (int i = 0; i < pc.currIndex; i++) + { + os << "\n" + << "---------------- " << "POKEMON #" << i << " ----------------" << "\n" + << *pc.boxStorage[i] << "\n"; + } + + return os; + } + std::string printDataArray(); +#endif +}; + +#endif \ No newline at end of file diff --git a/include/pccs/Pokemon.h b/include/pccs/Pokemon.h new file mode 100644 index 0000000..a86309f --- /dev/null +++ b/include/pccs/Pokemon.h @@ -0,0 +1,105 @@ +#ifndef POKEMON_H +#define POKEMON_H + +#include "pokemon_data.h" + +#if ON_GBA +#else +#include +#include +#include +#endif + +#if !USE_EXTERNALDATA +// #include "pokemonData.h" +#endif + +#if USE_CPP_RAND +#else +#include "random.h" +#endif + +// Avoid having to import math +inline u32 sizeToMask(int len) +{ + u32 out = 1; + for (int i = 0; i < len; i++) + { + out *= 2; + } + return (out - 1); +} + +inline u32 getPureRand() // Gets a random number from the device itself +{ +#if USE_CPP_RAND + srand(time(0)); + return rand() << 16 | rand(); +#else + return get_rand_u32(); +#endif +} + +// FNV-1a 32-bit hash function for byte arrays +inline u32 fnv1a_hash(unsigned char *data, size_t length) +{ + const uint32_t fnv_prime = 0x01000193; + const uint32_t fnv_offset_basis = 0x811C9DC5; + uint32_t hash = fnv_offset_basis; + + for (size_t i = 0; i < length; ++i) + { + hash ^= data[i]; + hash *= fnv_prime; + } + return hash; +} + +class Pokemon // The base Pokemon class +{ +public: + Pokemon(); + virtual ~Pokemon() {}; + virtual u32 getSpeciesIndexNumber(); + +#if ON_GBA +#else + virtual void print(std::ostream &os) + { + os << "This is a base Pokemon, it has no info!"; + }; + + friend std::ostream &operator<<(std::ostream &os, Pokemon &p) + { + p.print(os); + return os; + } +#endif + + int dataArraySize; + int nicknameArraySize; + int OTArraySize; + + // Will be set by child classes + byte *dataArrayPtr; + byte *nicknameArrayPtr; + byte *OTArrayPtr; + byte *externalIndexNumberPtr; + + // This is extra information that's nice to hold on to + int generation = 0; + bool isValid; + +protected: + PokemonTables *pokeTable; + + bool isBigEndian; + + u32 getVar(DataVarInfo dataVar); + u32 getVar(DataVarInfo dataVar, int extraByteOffset); + + bool setVar(DataVarInfo dataVar, u32 newValue); + bool setVar(DataVarInfo dataVar, int extraByteOffset, u32 newValue); +}; + +#endif diff --git a/include/pccs/pccs_settings.h b/include/pccs/pccs_settings.h new file mode 100644 index 0000000..5248e63 --- /dev/null +++ b/include/pccs/pccs_settings.h @@ -0,0 +1,9 @@ +#ifndef PCCS_SETTINGS_H +#define PCCS_SETTINGS_H + +#define ON_GBA true +#define USE_COMPRESSED_DATA true +#define USE_CPP_RAND false +#define ACCESS_POKEDEX true + +#endif \ No newline at end of file diff --git a/include/pccs/pokemon_data.h b/include/pccs/pokemon_data.h new file mode 100644 index 0000000..337bb96 --- /dev/null +++ b/include/pccs/pokemon_data.h @@ -0,0 +1,1703 @@ +#ifndef POKEMON_DATA_H +#define POKEMON_DATA_H + +#include "typeDefs.h" +#include "pccs_settings.h" + +#define med_fast_max (u32)1000000 +// Slightly Fast goes unused +// Slightly Slow goes unused +#define med_slow_max (u32)1059860 +#define fast_max (u32)800000 +#define slow_max (u32)1250000 +// Erractic is Gen 3+ +// Fluctuating is Gen 3+ + +#define EXP_MED_FAST 0 +// Slightly Fast goes unused +// Slightly Slow goes unused +#define EXP_MED_SLOW 3 +#define EXP_FAST 4 +#define EXP_SLOW 5 +// Erractic is Gen 3+ +// Fluctuating is Gen 3+ + +/* +#define JPN_ID 1 +#define ENG_ID 2 +#define FRE_ID 3 +#define ITA_ID 4 +#define GER_ID 5 +#define SPA_ID 7 +#define KOR_ID 8 + +#define GREEN_ID 0 +#define RED_ID 1 +#define BLUE_ID 2 +#define YELLOW_ID 3 +#define GOLD_ID 4 +#define SILVER_ID 5 +#define CRYSTAL_ID 6 + +#define EVENT_MEW_JPN 0 +#define EVENT_MEW_ENG 1 +#define EVENT_MEW_FRE 2 +#define EVENT_MEW_ITA 3 +#define EVENT_MEW_GER 4 +#define EVENT_MEW_SPA 5 +#define EVENT_CELEBI 6 +*/ + +#define MAX_PKMN_IN_BOX 30 +#define NUM_POKEMON 252 +#define POKEMON_ARRAY_SIZE NUM_POKEMON + 1 +#define POKEMON_SIZE 80 + +// these arrays are too small to compress +extern const u32 EXP_MAXIMUMS[6]; +extern const int GENDER_THRESHOLDS[2][8]; +// the next arrays don't compress well at all. Not worth the decompression overhead. +extern const byte gen_1_index_array[191]; +extern const u8 EVOLUTIONS[POKEMON_ARRAY_SIZE]; + +// Unfortunately we can't compress this 8 KB MOVESETS array. +// I mean, we physically can, but decompressing it means storing it in IWRAM, +// at a moment (during convert_to_gen_three()) at which we are using a LOT of IWRAM already. +// By keeping it uncompressed, it gets stored in EWRAM, where it won't hinder us. +// But it does mean that it still takes up 8 KB in the rom. +// Just for reference: when compressing it with ZX0 AND only storing the "changed" bits for PKMN +// evolutions in relation to their base forms, we could bring the size down to 4641 bytes. +// But alas, the IWRAM consumption at a critical point in time made this approach unviable. +// TODO: we might be able to load similar data from the game cartridges. +// However, it turns out the data is different between the R/S/E and FR/LG games. +// So we would have to store "patches"/differences if we go this route. +// It also means we'd have to figure out rom offsets for every single gen III game variant/localization. +extern const byte MOVESETS[POKEMON_ARRAY_SIZE][32]; + +/** + * Okay, here's the thing: to reduce the rom size, we compressed a bunch of data with ZX0 + * Among this data are various data tables that were previously just stored as const arrays. + * + * But, during the mystery_gift_builder/mystery_gift_injector execution, + * these data tables are used intensely, because you're not using them for single pokémon, but rather for boxes of pokémon. + * + * Decompression is not cheap, so we can't afford to decompress the tables again and again for every pokémon we deal with + * during this flow. + * + * This is where this class comes in. It is basically a holder of these tables. The idea is to pass it along with the mystery_gift_builder + * and have it lazy decompress the tables AND charsets it needs. This way when we are dealing with multiple pokémon, we are not decompressing + * the same data every time and thereby make performance suffer. + * + * It DOES have a significant IWRAM cost though. The intention is to just allocate this struct on the stack. + * As far as I can tell, our stack is not really restricted at all. It just fills up the IWRAM as needed. So we need to be careful not to + * overwrite/corrupt any code or data we specifically tagged to be stored in IWRAM. + */ +class PokemonTables +{ +public: + bool exp_groups_loaded; + bool gender_ratios_loaded; + bool num_abilities_loaded; + bool first_moves_loaded; + bool power_points_loaded; + bool event_pkmn_loaded; + bool types_loaded; + // a number representing the unique combination of gen 1/2 and the specific language + // 0 means not loaded + u8 input_charset_type; + // 0 means not loaded, 1=JPN, 2=Intern + u8 gen3_charset_type; + +#if USE_COMPRESSED_DATA + u8 EXP_GROUPS[POKEMON_ARRAY_SIZE]; + u8 GENDER_RATIO[POKEMON_ARRAY_SIZE]; + bool NUM_ABILITIES[POKEMON_ARRAY_SIZE]; + byte FIRST_MOVES[POKEMON_ARRAY_SIZE]; + u8 POWER_POINTS[252]; + byte EVENT_PKMN[8][80]; + u8 TYPES[POKEMON_ARRAY_SIZE][2]; +#else + + const u8 EXP_GROUPS[POKEMON_ARRAY_SIZE] = { + 0, // Offset the list to remove "off by one" errors + 3, // Bulbasaur + 3, // Ivysaur + 3, // Venusaur + 3, // Charmander + 3, // Charmeleon + 3, // Charizard + 3, // Squirtle + 3, // Wartortle + 3, // Blastoise + 0, // Caterpie + 0, // Metapod + 0, // Butterfree + 0, // Weedle + 0, // Kakuna + 0, // Beedrill + 3, // Pidgey + 3, // Pidgeotto + 3, // Pidgeot + 0, // Rattata + 0, // Raticate + 0, // Spearow + 0, // Fearow + 0, // Ekans + 0, // Arbok + 0, // Pikachu + 0, // Raichu + 0, // Sandshrew + 0, // Sandslash + 3, // Nidoran♀ + 3, // Nidorina + 3, // Nidoqueen + 3, // Nidoran♂ + 3, // Nidorino + 3, // Nidoking + 4, // Clefairy + 4, // Clefable + 0, // Vulpix + 0, // Ninetales + 4, // Jigglypuff + 4, // Wigglytuff + 0, // Zubat + 0, // Golbat + 3, // Oddish + 3, // Gloom + 3, // Vileplume + 0, // Paras + 0, // Parasect + 0, // Venonat + 0, // Venomoth + 0, // Diglett + 0, // Dugtrio + 0, // Meowth + 0, // Persian + 0, // Psyduck + 0, // Golduck + 0, // Mankey + 0, // Primeape + 5, // Growlithe + 5, // Arcanine + 3, // Poliwag + 3, // Poliwhirl + 3, // Poliwrath + 3, // Abra + 3, // Kadabra + 3, // Alakazam + 3, // Machop + 3, // Machoke + 3, // Machamp + 3, // Bellsprout + 3, // Weepinbell + 3, // Victreebel + 5, // Tentacool + 5, // Tentacruel + 3, // Geodude + 3, // Graveler + 3, // Golem + 0, // Ponyta + 0, // Rapidash + 0, // Slowpoke + 0, // Slowbro + 0, // Magnemite + 0, // Magneton + 0, // Farfetch'd + 0, // Doduo + 0, // Dodrio + 0, // Seel + 0, // Dewgong + 0, // Grimer + 0, // Muk + 5, // Shellder + 5, // Cloyster + 3, // Gastly + 3, // Haunter + 3, // Gengar + 0, // Onix + 0, // Drowzee + 0, // Hypno + 0, // Krabby + 0, // Kingler + 0, // Voltorb + 0, // Electrode + 5, // Exeggcute + 5, // Exeggutor + 0, // Cubone + 0, // Marowak + 0, // Hitmonlee + 0, // Hitmonchan + 0, // Lickitung + 0, // Koffing + 0, // Weezing + 5, // Rhyhorn + 5, // Rhydon + 4, // Chansey + 0, // Tangela + 0, // Kangaskhan + 0, // Horsea + 0, // Seadra + 0, // Goldeen + 0, // Seaking + 5, // Staryu + 5, // Starmie + 0, // Mr. Mime + 0, // Scyther + 0, // Jynx + 0, // Electabuzz + 0, // Magmar + 5, // Pinsir + 5, // Tauros + 5, // Magikarp + 5, // Gyarados + 5, // Lapras + 0, // Ditto + 0, // Eevee + 0, // Vaporeon + 0, // Jolteon + 0, // Flareon + 0, // Porygon + 0, // Omanyte + 0, // Omastar + 0, // Kabuto + 0, // Kabutops + 5, // Aerodactyl + 5, // Snorlax + 5, // Articuno + 5, // Zapdos + 5, // Moltres + 5, // Dratini + 5, // Dragonair + 5, // Dragonite + 5, // Mewtwo + 3, // Mew + 3, // Chikorita + 3, // Bayleef + 3, // Meganium + 3, // Cyndaquil + 3, // Quilava + 3, // Typhlosion + 3, // Totodile + 3, // Croconaw + 3, // Feraligatr + 0, // Sentret + 0, // Furret + 0, // Hoothoot + 0, // Noctowl + 4, // Ledyba + 4, // Ledian + 4, // Spinarak + 4, // Ariados + 0, // Crobat + 5, // Chinchou + 5, // Lanturn + 0, // Pichu + 4, // Cleffa + 4, // Igglybuff + 4, // Togepi + 4, // Togetic + 0, // Natu + 0, // Xatu + 3, // Mareep + 3, // Flaaffy + 3, // Ampharos + 3, // Bellossom + 4, // Marill + 4, // Azumarill + 0, // Sudowoodo + 3, // Politoed + 3, // Hoppip + 3, // Skiploom + 3, // Jumpluff + 4, // Aipom + 3, // Sunkern + 3, // Sunflora + 0, // Yanma + 0, // Wooper + 0, // Quagsire + 0, // Espeon + 0, // Umbreon + 3, // Murkrow + 0, // Slowking + 4, // Misdreavus + 0, // Unown + 0, // Wobbuffet + 0, // Girafarig + 0, // Pineco + 0, // Forretress + 0, // Dunsparce + 3, // Gligar + 0, // Steelix + 4, // Snubbull + 4, // Granbull + 0, // Qwilfish + 0, // Scizor + 3, // Shuckle + 5, // Heracross + 3, // Sneasel + 0, // Teddiursa + 0, // Ursaring + 0, // Slugma + 0, // Magcargo + 5, // Swinub + 5, // Piloswine + 4, // Corsola + 0, // Remoraid + 0, // Octillery + 4, // Delibird + 5, // Mantine + 5, // Skarmory + 5, // Houndour + 5, // Houndoom + 0, // Kingdra + 0, // Phanpy + 0, // Donphan + 0, // Porygon2 + 5, // Stantler + 4, // Smeargle + 0, // Tyrogue + 0, // Hitmontop + 0, // Smoochum + 0, // Elekid + 0, // Magby + 5, // Miltank + 4, // Blissey + 5, // Raikou + 5, // Entei + 5, // Suicune + 5, // Larvitar + 5, // Pupitar + 5, // Tyranitar + 5, // Lugia + 5, // Ho-Oh + 3, // Celebi + 3, // Treecko + }; + const u8 GENDER_RATIO[POKEMON_ARRAY_SIZE] = { + 0, // Offset the list to remove "off by one" errors + 1, // Bulbasaur [1♀:7♂] + 1, // Ivysaur [1♀:7♂] + 1, // Venusaur [1♀:7♂] + 1, // Charmander [1♀:7♂] + 1, // Charmeleon [1♀:7♂] + 1, // Charizard [1♀:7♂] + 1, // Squirtle [1♀:7♂] + 1, // Wartortle [1♀:7♂] + 1, // Blastoise [1♀:7♂] + 3, // Caterpie [1♀:1♂] + 3, // Metapod [1♀:1♂] + 3, // Butterfree [1♀:1♂] + 3, // Weedle [1♀:1♂] + 3, // Kakuna [1♀:1♂] + 3, // Beedrill [1♀:1♂] + 3, // Pidgey [1♀:1♂] + 3, // Pidgeotto [1♀:1♂] + 3, // Pidgeot [1♀:1♂] + 3, // Rattata [1♀:1♂] + 3, // Raticate [1♀:1♂] + 3, // Spearow [1♀:1♂] + 3, // Fearow [1♀:1♂] + 3, // Ekans [1♀:1♂] + 3, // Arbok [1♀:1♂] + 3, // Pikachu [1♀:1♂] + 3, // Raichu [1♀:1♂] + 3, // Sandshrew [1♀:1♂] + 3, // Sandslash [1♀:1♂] + 6, // Nidoran♀ [Female Only] + 6, // Nidorina [Female Only] + 6, // Nidoqueen [Female Only] + 0, // Nidoran♂ [Male Only] + 0, // Nidorino [Male Only] + 0, // Nidoking [Male Only] + 4, // Clefairy [3♀:1♂] + 4, // Clefable [3♀:1♂] + 4, // Vulpix [3♀:1♂] + 4, // Ninetales [3♀:1♂] + 4, // Jigglypuff [3♀:1♂] + 4, // Wigglytuff [3♀:1♂] + 3, // Zubat [1♀:1♂] + 3, // Golbat [1♀:1♂] + 3, // Oddish [1♀:1♂] + 3, // Gloom [1♀:1♂] + 3, // Vileplume [1♀:1♂] + 3, // Paras [1♀:1♂] + 3, // Parasect [1♀:1♂] + 3, // Venonat [1♀:1♂] + 3, // Venomoth [1♀:1♂] + 3, // Diglett [1♀:1♂] + 3, // Dugtrio [1♀:1♂] + 3, // Meowth [1♀:1♂] + 3, // Persian [1♀:1♂] + 3, // Psyduck [1♀:1♂] + 3, // Golduck [1♀:1♂] + 3, // Mankey [1♀:1♂] + 3, // Primeape [1♀:1♂] + 2, // Growlithe [1♀:3♂] + 2, // Arcanine [1♀:3♂] + 3, // Poliwag [1♀:1♂] + 3, // Poliwhirl [1♀:1♂] + 3, // Poliwrath [1♀:1♂] + 2, // Abra [1♀:3♂] + 2, // Kadabra [1♀:3♂] + 2, // Alakazam [1♀:3♂] + 2, // Machop [1♀:3♂] + 2, // Machoke [1♀:3♂] + 2, // Machamp [1♀:3♂] + 3, // Bellsprout [1♀:1♂] + 3, // Weepinbell [1♀:1♂] + 3, // Victreebel [1♀:1♂] + 3, // Tentacool [1♀:1♂] + 3, // Tentacruel [1♀:1♂] + 3, // Geodude [1♀:1♂] + 3, // Graveler [1♀:1♂] + 3, // Golem [1♀:1♂] + 3, // Ponyta [1♀:1♂] + 3, // Rapidash [1♀:1♂] + 3, // Slowpoke [1♀:1♂] + 3, // Slowbro [1♀:1♂] + 7, // Magnemite [Gender Unknown] + 7, // Magneton [Gender Unknown] + 3, // Farfetch'd [1♀:1♂] + 3, // Doduo [1♀:1♂] + 3, // Dodrio [1♀:1♂] + 3, // Seel [1♀:1♂] + 3, // Dewgong [1♀:1♂] + 3, // Grimer [1♀:1♂] + 3, // Muk [1♀:1♂] + 3, // Shellder [1♀:1♂] + 3, // Cloyster [1♀:1♂] + 3, // Gastly [1♀:1♂] + 3, // Haunter [1♀:1♂] + 3, // Gengar [1♀:1♂] + 3, // Onix [1♀:1♂] + 3, // Drowzee [1♀:1♂] + 3, // Hypno [1♀:1♂] + 3, // Krabby [1♀:1♂] + 3, // Kingler [1♀:1♂] + 7, // Voltorb [Gender Unknown] + 7, // Electrode [Gender Unknown] + 3, // Exeggcute [1♀:1♂] + 3, // Exeggutor [1♀:1♂] + 3, // Cubone [1♀:1♂] + 3, // Marowak [1♀:1♂] + 0, // Hitmonlee [Male Only] + 0, // Hitmonchan [Male Only] + 3, // Lickitung [1♀:1♂] + 3, // Koffing [1♀:1♂] + 3, // Weezing [1♀:1♂] + 3, // Rhyhorn [1♀:1♂] + 3, // Rhydon [1♀:1♂] + 6, // Chansey [Female Only] + 3, // Tangela [1♀:1♂] + 6, // Kangaskhan [Female Only] + 3, // Horsea [1♀:1♂] + 3, // Seadra [1♀:1♂] + 3, // Goldeen [1♀:1♂] + 3, // Seaking [1♀:1♂] + 7, // Staryu [Gender Unknown] + 7, // Starmie [Gender Unknown] + 3, // Mr. Mime [1♀:1♂] + 3, // Scyther [1♀:1♂] + 6, // Jynx [Female Only] + 2, // Electabuzz [1♀:3♂] + 2, // Magmar [1♀:3♂] + 3, // Pinsir [1♀:1♂] + 0, // Tauros [Male Only] + 3, // Magikarp [1♀:1♂] + 3, // Gyarados [1♀:1♂] + 3, // Lapras [1♀:1♂] + 7, // Ditto [Gender Unknown] + 1, // Eevee [1♀:7♂] + 1, // Vaporeon [1♀:7♂] + 1, // Jolteon [1♀:7♂] + 1, // Flareon [1♀:7♂] + 7, // Porygon [Gender Unknown] + 1, // Omanyte [1♀:7♂] + 1, // Omastar [1♀:7♂] + 1, // Kabuto [1♀:7♂] + 1, // Kabutops [1♀:7♂] + 1, // Aerodactyl [1♀:7♂] + 1, // Snorlax [1♀:7♂] + 7, // Articuno [Gender Unknown] + 7, // Zapdos [Gender Unknown] + 7, // Moltres [Gender Unknown] + 3, // Dratini [1♀:1♂] + 3, // Dragonair [1♀:1♂] + 3, // Dragonite [1♀:1♂] + 7, // Mewtwo [Gender Unknown] + 7, // Mew [Gender Unknown] + 1, // Chikorita [1♀:7♂] + 1, // Bayleef [1♀:7♂] + 1, // Meganium [1♀:7♂] + 1, // Cyndaquil [1♀:7♂] + 1, // Quilava [1♀:7♂] + 1, // Typhlosion [1♀:7♂] + 1, // Totodile [1♀:7♂] + 1, // Croconaw [1♀:7♂] + 1, // Feraligatr [1♀:7♂] + 3, // Sentret [1♀:1♂] + 3, // Furret [1♀:1♂] + 3, // Hoothoot [1♀:1♂] + 3, // Noctowl [1♀:1♂] + 3, // Ledyba [1♀:1♂] + 3, // Ledian [1♀:1♂] + 3, // Spinarak [1♀:1♂] + 3, // Ariados [1♀:1♂] + 3, // Crobat [1♀:1♂] + 3, // Chinchou [1♀:1♂] + 3, // Lanturn [1♀:1♂] + 3, // Pichu [1♀:1♂] + 4, // Cleffa [3♀:1♂] + 4, // Igglybuff [3♀:1♂] + 1, // Togepi [1♀:7♂] + 1, // Togetic [1♀:7♂] + 3, // Natu [1♀:1♂] + 3, // Xatu [1♀:1♂] + 3, // Mareep [1♀:1♂] + 3, // Flaaffy [1♀:1♂] + 3, // Ampharos [1♀:1♂] + 3, // Bellossom [1♀:1♂] + 3, // Marill [1♀:1♂] + 3, // Azumarill [1♀:1♂] + 3, // Sudowoodo [1♀:1♂] + 3, // Politoed [1♀:1♂] + 3, // Hoppip [1♀:1♂] + 3, // Skiploom [1♀:1♂] + 3, // Jumpluff [1♀:1♂] + 3, // Aipom [1♀:1♂] + 3, // Sunkern [1♀:1♂] + 3, // Sunflora [1♀:1♂] + 3, // Yanma [1♀:1♂] + 3, // Wooper [1♀:1♂] + 3, // Quagsire [1♀:1♂] + 1, // Espeon [1♀:7♂] + 1, // Umbreon [1♀:7♂] + 3, // Murkrow [1♀:1♂] + 3, // Slowking [1♀:1♂] + 3, // Misdreavus [1♀:1♂] + 7, // Unown [Gender Unknown] + 3, // Wobbuffet [1♀:1♂] + 3, // Girafarig [1♀:1♂] + 3, // Pineco [1♀:1♂] + 3, // Forretress [1♀:1♂] + 3, // Dunsparce [1♀:1♂] + 3, // Gligar [1♀:1♂] + 3, // Steelix [1♀:1♂] + 4, // Snubbull [3♀:1♂] + 4, // Granbull [3♀:1♂] + 3, // Qwilfish [1♀:1♂] + 3, // Scizor [1♀:1♂] + 3, // Shuckle [1♀:1♂] + 3, // Heracross [1♀:1♂] + 3, // Sneasel [1♀:1♂] + 3, // Teddiursa [1♀:1♂] + 3, // Ursaring [1♀:1♂] + 3, // Slugma [1♀:1♂] + 3, // Magcargo [1♀:1♂] + 3, // Swinub [1♀:1♂] + 3, // Piloswine [1♀:1♂] + 4, // Corsola [3♀:1♂] + 3, // Remoraid [1♀:1♂] + 3, // Octillery [1♀:1♂] + 3, // Delibird [1♀:1♂] + 3, // Mantine [1♀:1♂] + 3, // Skarmory [1♀:1♂] + 3, // Houndour [1♀:1♂] + 3, // Houndoom [1♀:1♂] + 3, // Kingdra [1♀:1♂] + 3, // Phanpy [1♀:1♂] + 3, // Donphan [1♀:1♂] + 7, // Porygon2 [Gender Unknown] + 3, // Stantler [1♀:1♂] + 3, // Smeargle [1♀:1♂] + 0, // Tyrogue [Male Only] + 0, // Hitmontop [Male Only] + 6, // Smoochum [Female Only] + 2, // Elekid [1♀:3♂] + 2, // Magby [1♀:3♂] + 6, // Miltank [Female Only] + 6, // Blissey [Female Only] + 7, // Raikou [Gender Unknown] + 7, // Entei [Gender Unknown] + 7, // Suicune [Gender Unknown] + 3, // Larvitar [1♀:1♂] + 3, // Pupitar [1♀:1♂] + 3, // Tyranitar [1♀:1♂] + 7, // Lugia [Gender Unknown] + 7, // Ho-Oh [Gender Unknown] + 7, // Celebi [Gender Unknown] + 1, // Treecko [1♀:7♂] + + }; + const bool NUM_ABILITIES[POKEMON_ARRAY_SIZE] = { + 0, // Offset the list to remove "off by one" errors + 0, // Bulbasaur Overgrow + 0, // Ivysaur Overgrow + 0, // Venusaur Overgrow + 0, // Charmander Blaze + 0, // Charmeleon Blaze + 0, // Charizard Blaze + 0, // Squirtle Torrent + 0, // Wartortle Torrent + 0, // Blastoise Torrent + 0, // Caterpie Shield Dust + 0, // Metapod Shed Skin + 0, // Butterfree Compound Eyes + 0, // Weedle Shield Dust + 0, // Kakuna Shed Skin + 0, // Beedrill Swarm + 0, // Pidgey Keen Eye + 0, // Pidgeotto Keen Eye + 0, // Pidgeot Keen Eye + 1, // Rattata Run Away/Guts + 1, // Raticate Run Away/Guts + 0, // Spearow Keen Eye + 0, // Fearow Keen Eye + 1, // Ekans Intimidate/Shed Skin + 1, // Arbok Intimidate/Shed Skin + 0, // Pikachu Static + 0, // Raichu Static + 0, // Sandshrew Sand Veil + 0, // Sandslash Sand Veil + 0, // Nidoran♀ Poison Point + 0, // Nidorina Poison Point + 0, // Nidoqueen Poison Point + 0, // Nidoran♂ Poison Point + 0, // Nidorino Poison Point + 0, // Nidoking Poison Point + 0, // Clefairy Cute Charm + 0, // Clefable Cute Charm + 0, // Vulpix Flash Fire + 0, // Ninetales Flash Fire + 0, // Jigglypuff Cute Charm + 0, // Wigglytuff Cute Charm + 0, // Zubat Inner Focus + 0, // Golbat Inner Focus + 0, // Oddish Chlorophyll + 0, // Gloom Chlorophyll + 0, // Vileplume Chlorophyll + 0, // Paras Effect Spore + 0, // Parasect Effect Spore + 0, // Venonat Compound Eyes + 0, // Venomoth Shield Dust + 1, // Diglett Sand Veil/Arena Trap + 1, // Dugtrio Sand Veil/Arena Trap + 0, // Meowth Pickup + 0, // Persian Limber + 1, // Psyduck Damp/Cloud Nine + 1, // Golduck Damp/Cloud Nine + 0, // Mankey Vital Spirit + 0, // Primeape Vital Spirit + 1, // Growlithe Intimidate/Flash Fire + 1, // Arcanine Intimidate/Flash Fire + 1, // Poliwag Water Absorb/Damp + 1, // Poliwhirl Water Absorb/Damp + 1, // Poliwrath Water Absorb/Damp + 1, // Abra Synchronize/Inner Focus + 1, // Kadabra Synchronize/Inner Focus + 1, // Alakazam Synchronize/Inner Focus + 0, // Machop Guts + 0, // Machoke Guts + 0, // Machamp Guts + 0, // Bellsprout Chlorophyll + 0, // Weepinbell Chlorophyll + 0, // Victreebel Chlorophyll + 1, // Tentacool Clear Body/Liquid Ooze + 1, // Tentacruel Clear Body/Liquid Ooze + 1, // Geodude Rock Head/Sturdy + 1, // Graveler Rock Head/Sturdy + 1, // Golem Rock Head/Sturdy + 1, // Ponyta Run Away/Flash Fire + 1, // Rapidash Run Away/Flash Fire + 1, // Slowpoke Oblivious/Own Tempo + 1, // Slowbro Oblivious/Own Tempo + 1, // Magnemite Magnet Pull/Sturdy + 1, // Magneton Magnet Pull/Sturdy + 1, // Farfetch'd Keen Eye/Inner Focus + 1, // Doduo Run Away/Early Bird + 1, // Dodrio Run Away/Early Bird + 0, // Seel Thick Fat + 0, // Dewgong Thick Fat + 1, // Grimer Stench/Sticky Hold + 1, // Muk Stench/Sticky Hold + 0, // Shellder Shell Armor + 0, // Cloyster Shell Armor + 0, // Gastly Levitate + 0, // Haunter Levitate + 0, // Gengar Cursed Body + 1, // Onix Rock Head/Sturdy + 0, // Drowzee Insomnia + 0, // Hypno Insomnia + 1, // Krabby Hyper Cutter/Shell Armor + 1, // Kingler Hyper Cutter/Shell Armor + 1, // Voltorb Soundproof/Static + 1, // Electrode Soundproof/Static + 0, // Exeggcute Chlorophyll + 0, // Exeggutor Chlorophyll + 1, // Cubone Rock Head/Lightning Rod + 1, // Marowak Rock Head/Lightning Rod + 0, // Hitmonlee Limber + 0, // Hitmonchan Keen Eye + 1, // Lickitung Own Tempo/Oblivious + 0, // Koffing Levitate + 0, // Weezing Levitate + 1, // Rhyhorn Lightning Rod/Rock Head + 1, // Rhydon Lightning Rod/Rock Head + 1, // Chansey Natural Cure/Serene Grace + 0, // Tangela Chlorophyll + 0, // Kangaskhan Early Bird + 0, // Horsea Swift Swim + 0, // Seadra Poison Point + 1, // Goldeen Swift Swim/Water Veil + 1, // Seaking Swift Swim/Water Veil + 1, // Staryu Illuminate/Natural Cure + 1, // Starmie Illuminate/Natural Cure + 0, // Mr. Mime Soundproof + 0, // Scyther Swarm + 0, // Jynx Oblivious + 0, // Electabuzz Static + 0, // Magmar Flame Body + 0, // Pinsir Hyper Cutter + 0, // Tauros Intimidate + 0, // Magikarp Swift Swim + 0, // Gyarados Intimidate + 1, // Lapras Water Absorb/Shell Armor + 0, // Ditto Limber + 0, // Eevee Run Away + 0, // Vaporeon Water Absorb + 0, // Jolteon Volt Absorb + 0, // Flareon Flash Fire + 0, // Porygon Trace + 1, // Omanyte Swift Swim/Shell Armor + 1, // Omastar Swift Swim/Shell Armor + 1, // Kabuto Swift Swim/Battle Armor + 1, // Kabutops Swift Swim/Battle Armor + 1, // Aerodactyl Rock Head/Pressure + 1, // Snorlax Immunity/Thick Fat + 0, // Articuno Pressure + 0, // Zapdos Pressure + 0, // Moltres Pressure + 0, // Dratini Shed Skin + 0, // Dragonair Shed Skin + 0, // Dragonite Inner Focus + 0, // Mewtwo Pressure + 0, // Mew Synchronize + 0, // Chikorita Overgrow + 0, // Bayleef Overgrow + 0, // Meganium Overgrow + 0, // Cyndaquil Blaze + 0, // Quilava Blaze + 0, // Typhlosion Blaze + 0, // Totodile Torrent + 0, // Croconaw Torrent + 0, // Feraligatr Torrent + 1, // Sentret Run Away/Keen Eye + 1, // Furret Run Away/Keen Eye + 1, // Hoothoot Insomnia/Keen Eye + 1, // Noctowl Insomnia/Keen Eye + 1, // Ledyba Swarm/Early Bird + 1, // Ledian Swarm/Early Bird + 1, // Spinarak Swarm/Insomnia + 1, // Ariados Swarm/Insomnia + 0, // Crobat Inner Focus + 1, // Chinchou Volt Absorb/Illuminate + 1, // Lanturn Volt Absorb/Illuminate + 0, // Pichu Static + 0, // Cleffa Cute Charm + 0, // Igglybuff Cute Charm + 1, // Togepi Hustle/Serene Grace + 1, // Togetic Hustle/Serene Grace + 1, // Natu Synchronize/Early Bird + 1, // Xatu Synchronize/Early Bird + 0, // Mareep Static + 0, // Flaaffy Static + 0, // Ampharos Static + 0, // Bellossom Chlorophyll + 1, // Marill Thick Fat/Huge Power + 1, // Azumarill Thick Fat/Huge Power + 1, // Sudowoodo Sturdy/Rock Head + 1, // Politoed Water Absorb/Damp + 0, // Hoppip Chlorophyll + 0, // Skiploom Chlorophyll + 0, // Jumpluff Chlorophyll + 1, // Aipom Run Away/Pickup + 0, // Sunkern Chlorophyll + 0, // Sunflora Chlorophyll + 1, // Yanma Speed Boost/Compound Eyes + 1, // Wooper Damp/Water Absorb + 1, // Quagsire Damp/Water Absorb + 0, // Espeon Synchronize + 0, // Umbreon Synchronize + 0, // Murkrow Insomnia + 1, // Slowking Oblivious/Own Tempo + 0, // Misdreavus Levitate + 0, // Unown Levitate + 0, // Wobbuffet Shadow Tag + 1, // Girafarig Inner Focus/Early Bird + 0, // Pineco Sturdy + 0, // Forretress Sturdy + 1, // Dunsparce Serene Grace/Run Away + 1, // Gligar Hyper Cutter/Sand Veil + 1, // Steelix Rock Head/Sturdy + 1, // Snubbull Intimidate/Run Away + 0, // Granbull Intimidate + 1, // Qwilfish Poison Point/Swift Swim + 0, // Scizor Swarm + 0, // Shuckle Sturdy + 1, // Heracross Swarm/Guts + 1, // Sneasel Inner Focus/Keen Eye + 0, // Teddiursa Pickup + 0, // Ursaring Guts + 1, // Slugma Magma Armor/Flame Body + 1, // Magcargo Magma Armor/Flame Body + 0, // Swinub Oblivious + 0, // Piloswine Oblivious + 1, // Corsola Hustle/Natural Cure + 0, // Remoraid Hustle + 0, // Octillery Suction Cups + 1, // Delibird Vital Spirit/Hustle + 1, // Mantine Swift Swim/Water Absorb + 1, // Skarmory Keen Eye/Sturdy + 1, // Houndour Early Bird/Flash Fire + 1, // Houndoom Early Bird/Flash Fire + 0, // Kingdra Swift Swim + 0, // Phanpy Pickup + 0, // Donphan Sturdy + 0, // Porygon2 Trace + 0, // Stantler Intimidate + 0, // Smeargle Own Tempo + 0, // Tyrogue Guts + 0, // Hitmontop Intimidate + 0, // Smoochum Oblivious + 0, // Elekid Static + 0, // Magby Flame Body + 0, // Miltank Thick Fat + 1, // Blissey Natural Cure/Serene Grace + 0, // Raikou Pressure + 0, // Entei Pressure + 0, // Suicune Pressure + 0, // Larvitar Guts + 0, // Pupitar Shed Skin + 0, // Tyranitar Sand Stream + 0, // Lugia Pressure + 0, // Ho-Oh Pressure + 0, // Celebi Natural Cure + 0, // Treecko Overgrow + }; + const byte FIRST_MOVES[POKEMON_ARRAY_SIZE] = { + // Data obtained through PokeAPI + 0, // Offset the list to remove "off by one" errors + 0x21, // Bulbasaur (tackle) + 0x21, // Ivysaur (tackle) + 0x16, // Venusaur (vine-whip) + 0x0a, // Charmander (scratch) + 0x0a, // Charmeleon (scratch) + 0x0a, // Charizard (scratch) + 0x21, // Squirtle (tackle) + 0x21, // Wartortle (tackle) + 0x21, // Blastoise (tackle) + 0x21, // Caterpie (tackle) + 0x6a, // Metapod (harden) + 0x5d, // Butterfree (confusion) + 0x28, // Weedle (poison-sting) + 0x6a, // Kakuna (harden) + 0x1f, // Beedrill (fury-attack) + 0x21, // Pidgey (tackle) + 0x10, // Pidgeotto (gust) + 0x10, // Pidgeot (gust) + 0x21, // Rattata (tackle) + 0x21, // Raticate (tackle) + 0x2d, // Spearow (growl) + 0x1f, // Fearow (fury-attack) + 0x23, // Ekans (wrap) + 0x23, // Arbok (wrap) + 0x2d, // Pikachu (growl) + 0x27, // Raichu (tail-whip) + 0x0a, // Sandshrew (scratch) + 0x0a, // Sandslash (scratch) + 0x0a, // Nidoran-f (scratch) + 0x0a, // Nidorina (scratch) + 0x0a, // Nidoqueen (scratch) + 0x2b, // Nidoran-m (leer) + 0x2b, // Nidorino (leer) + 0x18, // Nidoking (double-kick) + 0x01, // Clefairy (pound) + 0x03, // Clefable (double-slap) + 0x34, // Vulpix (ember) + 0x34, // Ninetales (ember) + 0x2f, // Jigglypuff (sing) + 0x03, // Wigglytuff (double-slap) + 0x8d, // Zubat (leech-life) + 0x30, // Golbat (supersonic) + 0x47, // Oddish (absorb) + 0x47, // Gloom (absorb) + 0x47, // Vileplume (absorb) + 0x0a, // Paras (scratch) + 0x0a, // Parasect (scratch) + 0x21, // Venonat (tackle) + 0x21, // Venomoth (tackle) + 0x0a, // Diglett (scratch) + 0x0a, // Dugtrio (scratch) + 0x0a, // Meowth (scratch) + 0x0a, // Persian (scratch) + 0x0a, // Psyduck (scratch) + 0x0a, // Golduck (scratch) + 0x0a, // Mankey (scratch) + 0x0a, // Primeape (scratch) + 0x2c, // Growlithe (bite) + 0x2c, // Arcanine (bite) + 0x91, // Poliwag (bubble) + 0x37, // Poliwhirl (water-gun) + 0x03, // Poliwrath (double-slap) + 0x64, // Abra (teleport) + 0x5d, // Kadabra (confusion) + 0x5d, // Alakazam (confusion) + 0x2b, // Machop (leer) + 0x2b, // Machoke (leer) + 0x2b, // Machamp (leer) + 0x16, // Bellsprout (vine-whip) + 0x16, // Weepinbell (vine-whip) + 0x16, // Victreebel (vine-whip) + 0x28, // Tentacool (poison-sting) + 0x28, // Tentacruel (poison-sting) + 0x21, // Geodude (tackle) + 0x21, // Graveler (tackle) + 0x21, // Golem (tackle) + 0x21, // Ponyta (tackle) + 0x21, // Rapidash (tackle) + 0x21, // Slowpoke (tackle) + 0x21, // Slowbro (tackle) + 0x21, // Magnemite (tackle) + 0x21, // Magneton (tackle) + 0x40, // Farfetchd (peck) + 0x2d, // Doduo (growl) + 0x1f, // Dodrio (fury-attack) + 0x1d, // Seel (headbutt) + 0x1d, // Dewgong (headbutt) + 0x01, // Grimer (pound) + 0x01, // Muk (pound) + 0x21, // Shellder (tackle) + 0x30, // Cloyster (supersonic) + 0x5f, // Gastly (hypnosis) + 0x5f, // Haunter (hypnosis) + 0x5f, // Gengar (hypnosis) + 0x21, // Onix (tackle) + 0x01, // Drowzee (pound) + 0x01, // Hypno (pound) + 0x91, // Krabby (bubble) + 0x0b, // Kingler (vice-grip) + 0x21, // Voltorb (tackle) + 0x21, // Electrode (tackle) + 0x5f, // Exeggcute (hypnosis) + 0x5d, // Exeggutor (confusion) + 0x2d, // Cubone (growl) + 0x1d, // Marowak (headbutt) + 0x18, // Hitmonlee (double-kick) + 0x04, // Hitmonchan (comet-punch) + 0x7a, // Lickitung (lick) + 0x21, // Koffing (tackle) + 0x21, // Weezing (tackle) + 0x1e, // Rhyhorn (horn-attack) + 0x17, // Rhydon (stomp) + 0x01, // Chansey (pound) + 0x84, // Tangela (constrict) + 0x04, // Kangaskhan (comet-punch) + 0x91, // Horsea (bubble) + 0x2b, // Seadra (leer) + 0x27, // Goldeen (tail-whip) + 0x27, // Seaking (tail-whip) + 0x21, // Staryu (tackle) + 0x37, // Starmie (water-gun) + 0x70, // Mr-mime (barrier) + 0x2b, // Scyther (leer) + 0x01, // Jynx (pound) + 0x09, // Electabuzz (thunder-punch) + 0x07, // Magmar (fire-punch) + 0x0b, // Pinsir (vice-grip) + 0x21, // Tauros (tackle) + 0x96, // Magikarp (splash) + 0x25, // Gyarados (thrash) + 0x2d, // Lapras (growl) + 0x90, // Ditto (transform) + 0x21, // Eevee (tackle) + 0x21, // Vaporeon (tackle) + 0x21, // Jolteon (tackle) + 0x21, // Flareon (tackle) + 0x21, // Porygon (tackle) + 0x6e, // Omanyte (withdraw) + 0x2c, // Omastar (bite) + 0x0a, // Kabuto (scratch) + 0x0a, // Kabutops (scratch) + 0x11, // Aerodactyl (wing-attack) + 0x21, // Snorlax (tackle) + 0x10, // Articuno (gust) + 0x40, // Zapdos (peck) + 0x11, // Moltres (wing-attack) + 0x23, // Dratini (wrap) + 0x23, // Dragonair (wrap) + 0x23, // Dragonite (wrap) + 0x32, // Mewtwo (disable) + 0x01, // Mew (pound) + 0x21, // Chikorita (tackle) + 0x21, // Bayleef (tackle) + 0x21, // Meganium (tackle) + 0x21, // Cyndaquil (tackle) + 0x21, // Quilava (tackle) + 0x21, // Typhlosion (tackle) + 0x0a, // Totodile (scratch) + 0x0a, // Croconaw (scratch) + 0x0a, // Feraligatr (scratch) + 0x0a, // Sentret (scratch) + 0x0a, // Furret (scratch) + 0x21, // Hoothoot (tackle) + 0x21, // Noctowl (tackle) + 0x21, // Ledyba (tackle) + 0x21, // Ledian (tackle) + 0x28, // Spinarak (poison-sting) + 0x28, // Ariados (poison-sting) + 0x30, // Crobat (supersonic) + 0x56, // Chinchou (thunder-wave) + 0x30, // Lanturn (supersonic) + 0x54, // Pichu (thunder-shock) + 0x01, // Cleffa (pound) + 0x2f, // Igglybuff (sing) + 0x2d, // Togepi (growl) + 0x2d, // Togetic (growl) + 0x2b, // Natu (leer) + 0x2b, // Xatu (leer) + 0x21, // Mareep (tackle) + 0x21, // Flaaffy (tackle) + 0x21, // Ampharos (tackle) + 0x47, // Bellossom (absorb) + 0x21, // Marill (tackle) + 0x21, // Azumarill (tackle) + 0x58, // Sudowoodo (rock-throw) + 0x03, // Politoed (double-slap) + 0x96, // Hoppip (splash) + 0x21, // Skiploom (tackle) + 0x21, // Jumpluff (tackle) + 0x0a, // Aipom (scratch) + 0x47, // Sunkern (absorb) + 0x01, // Sunflora (pound) + 0x21, // Yanma (tackle) + 0x27, // Wooper (tail-whip) + 0x27, // Quagsire (tail-whip) + 0x21, // Espeon (tackle) + 0x21, // Umbreon (tackle) + 0x40, // Murkrow (peck) + 0x21, // Slowking (tackle) + 0x2d, // Misdreavus (growl) + 0xed, // Unown (hidden-power) + 0x44, // Wobbuffet (counter) + 0x21, // Girafarig (tackle) + 0x21, // Pineco (tackle) + 0x21, // Forretress (tackle) + 0x63, // Dunsparce (rage) + 0x28, // Gligar (poison-sting) + 0x21, // Steelix (tackle) + 0x21, // Snubbull (tackle) + 0x21, // Granbull (tackle) + 0x21, // Qwilfish (tackle) + 0x2b, // Scizor (leer) + 0x6e, // Shuckle (withdraw) + 0x21, // Heracross (tackle) + 0x0a, // Sneasel (scratch) + 0x0a, // Teddiursa (scratch) + 0x0a, // Ursaring (scratch) + 0x7b, // Slugma (smog) + 0x34, // Magcargo (ember) + 0x21, // Swinub (tackle) + 0x1e, // Piloswine (horn-attack) + 0x21, // Corsola (tackle) + 0x37, // Remoraid (water-gun) + 0x37, // Octillery (water-gun) + 0xd9, // Delibird (present) + 0x21, // Mantine (tackle) + 0x2b, // Skarmory (leer) + 0x2b, // Houndour (leer) + 0x2b, // Houndoom (leer) + 0x2b, // Kingdra (leer) + 0x21, // Phanpy (tackle) + 0x1e, // Donphan (horn-attack) + 0x21, // Porygon2 (tackle) + 0x21, // Stantler (tackle) + 0xa6, // Smeargle (sketch) + 0x21, // Tyrogue (tackle) + 0x1b, // Hitmontop (rolling-kick) + 0x01, // Smoochum (pound) + 0x2b, // Elekid (leer) + 0x34, // Magby (ember) + 0x21, // Miltank (tackle) + 0x01, // Blissey (pound) + 0x2b, // Raikou (leer) + 0x2b, // Entei (leer) + 0x2b, // Suicune (leer) + 0x2b, // Larvitar (leer) + 0x2b, // Pupitar (leer) + 0x2b, // Tyranitar (leer) + 0x12, // Lugia (whirlwind) + 0x12, // Ho-oh (whirlwind) + 0x49, // Celebi (leech-seed) + 0x01, // Treecko (pound) + }; + const u8 POWER_POINTS[252]{ + 0, // Offset the list to remove "off by one" errors + 35, // Pound + 25, // Karate-chop + 10, // Double-slap + 15, // Comet-punch + 20, // Mega-punch + 20, // Pay-day + 15, // Fire-punch + 15, // Ice-punch + 15, // Thunder-punch + 35, // Scratch + 30, // Vice-grip + 5, // Guillotine + 10, // Razor-wind + 20, // Swords-dance + 30, // Cut + 35, // Gust + 35, // Wing-attack + 20, // Whirlwind + 15, // Fly + 20, // Bind + 20, // Slam + 25, // Vine-whip + 20, // Stomp + 30, // Double-kick + 5, // Mega-kick + 10, // Jump-kick + 15, // Rolling-kick + 15, // Sand-attack + 15, // Headbutt + 25, // Horn-attack + 20, // Fury-attack + 5, // Horn-drill + 35, // Tackle + 15, // Body-slam + 20, // Wrap + 20, // Take-down + 10, // Thrash + 15, // Double-edge + 30, // Tail-whip + 35, // Poison-sting + 20, // Twineedle + 20, // Pin-missile + 30, // Leer + 25, // Bite + 40, // Growl + 20, // Roar + 15, // Sing + 20, // Supersonic + 20, // Sonic-boom + 20, // Disable + 30, // Acid + 25, // Ember + 15, // Flamethrower + 30, // Mist + 25, // Water-gun + 5, // Hydro-pump + 15, // Surf + 10, // Ice-beam + 5, // Blizzard + 20, // Psybeam + 20, // Bubble-beam + 20, // Aurora-beam + 5, // Hyper-beam + 35, // Peck + 20, // Drill-peck + 20, // Submission + 20, // Low-kick + 20, // Counter + 20, // Seismic-toss + 15, // Strength + 25, // Absorb + 15, // Mega-drain + 10, // Leech-seed + 20, // Growth + 25, // Razor-leaf + 10, // Solar-beam + 35, // Poison-powder + 30, // Stun-spore + 15, // Sleep-powder + 10, // Petal-dance + 40, // String-shot + 10, // Dragon-rage + 15, // Fire-spin + 30, // Thunder-shock + 15, // Thunderbolt + 20, // Thunder-wave + 10, // Thunder + 15, // Rock-throw + 10, // Earthquake + 5, // Fissure + 10, // Dig + 10, // Toxic + 25, // Confusion + 10, // Psychic + 20, // Hypnosis + 40, // Meditate + 30, // Agility + 30, // Quick-attack + 20, // Rage + 20, // Teleport + 15, // Night-shade + 10, // Mimic + 40, // Screech + 15, // Double-team + 10, // Recover + 30, // Harden + 10, // Minimize + 20, // Smokescreen + 10, // Confuse-ray + 40, // Withdraw + 40, // Defense-curl + 20, // Barrier + 30, // Light-screen + 30, // Haze + 20, // Reflect + 30, // Focus-energy + 10, // Bide + 10, // Metronome + 20, // Mirror-move + 5, // Self-destruct + 10, // Egg-bomb + 30, // Lick + 20, // Smog + 20, // Sludge + 20, // Bone-club + 5, // Fire-blast + 15, // Waterfall + 15, // Clamp + 20, // Swift + 10, // Skull-bash + 15, // Spike-cannon + 35, // Constrict + 20, // Amnesia + 15, // Kinesis + 10, // Soft-boiled + 10, // High-jump-kick + 30, // Glare + 15, // Dream-eater + 40, // Poison-gas + 20, // Barrage + 10, // Leech-life + 10, // Lovely-kiss + 5, // Sky-attack + 10, // Transform + 30, // Bubble + 10, // Dizzy-punch + 15, // Spore + 20, // Flash + 15, // Psywave + 40, // Splash + 20, // Acid-armor + 10, // Crabhammer + 5, // Explosion + 15, // Fury-swipes + 10, // Bonemerang + 10, // Rest + 10, // Rock-slide + 15, // Hyper-fang + 30, // Sharpen + 30, // Conversion + 10, // Tri-attack + 10, // Super-fang + 20, // Slash + 10, // Substitute + 1, // Struggle + 1, // Sketch + 10, // Triple-kick + 25, // Thief + 10, // Spider-web + 5, // Mind-reader + 15, // Nightmare + 25, // Flame-wheel + 15, // Snore + 10, // Curse + 15, // Flail + 30, // Conversion-2 + 5, // Aeroblast + 40, // Cotton-spore + 15, // Reversal + 10, // Spite + 25, // Powder-snow + 10, // Protect + 30, // Mach-punch + 10, // Scary-face + 20, // Feint-attack + 10, // Sweet-kiss + 10, // Belly-drum + 10, // Sludge-bomb + 10, // Mud-slap + 10, // Octazooka + 20, // Spikes + 5, // Zap-cannon + 40, // Foresight + 5, // Destiny-bond + 5, // Perish-song + 15, // Icy-wind + 5, // Detect + 10, // Bone-rush + 5, // Lock-on + 10, // Outrage + 10, // Sandstorm + 10, // Giga-drain + 10, // Endure + 20, // Charm + 20, // Rollout + 40, // False-swipe + 15, // Swagger + 10, // Milk-drink + 20, // Spark + 20, // Fury-cutter + 25, // Steel-wing + 5, // Mean-look + 15, // Attract + 10, // Sleep-talk + 5, // Heal-bell + 20, // Return + 15, // Present + 20, // Frustration + 25, // Safeguard + 20, // Pain-split + 5, // Sacred-fire + 30, // Magnitude + 5, // Dynamic-punch + 10, // Megahorn + 20, // Dragon-breath + 40, // Baton-pass + 5, // Encore + 20, // Pursuit + 40, // Rapid-spin + 20, // Sweet-scent + 15, // Iron-tail + 35, // Metal-claw + 10, // Vital-throw + 5, // Morning-sun + 5, // Synthesis + 5, // Moonlight + 15, // Hidden-power + 5, // Cross-chop + 20, // Twister + 5, // Rain-dance + 5, // Sunny-day + 15, // Crunch + 20, // Mirror-coat + 10, // Psych-up + 5, // Extreme-speed + 5, // Ancient-power + 15, // Shadow-ball + 10, // Future-sight + 15, // Rock-smash + 15, // Whirlpool + 10, // Beat-up + }; + const byte EVENT_PKMN[8][80]{ + // Events taken from the PKHeX Event Database. + // Sanitize 4 bytes at 0x00, 2 bytes at 0x1C, the highest bit at 0x46 and 4 bytes at 0x48 + + // Japanese Hadō (Aura) Mew + {0x00, 0x00, 0x00, 0x00, 0x1C, 0xC6, 0x00, 0x00, 0x70, 0x85, 0x53, 0xFF, 0x08, 0x70, 0x01, 0x34, 0x01, 0x31, 0x01, 0x02, 0x6A, 0x95, 0x53, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + // English Aura Mew + {0x00, 0x00, 0x00, 0x00, 0x6E, 0x4E, 0x00, 0x00, 0xC7, 0xBF, 0xD1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0xBB, 0xE9, 0xE6, 0xD5, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + // French Aura Mew + {0x00, 0x00, 0x00, 0x00, 0x6E, 0x4E, 0x00, 0x00, 0xC7, 0xBF, 0xD1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0xBB, 0xE9, 0xE6, 0xD5, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + // Italian Aura Mew + {0x00, 0x00, 0x00, 0x00, 0x6E, 0x4E, 0x00, 0x00, 0xC7, 0xBF, 0xD1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0xBB, 0xE9, 0xE6, 0xD5, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + // German Aura Mew + {0x00, 0x00, 0x00, 0x00, 0x6E, 0x4E, 0x00, 0x00, 0xC7, 0xBF, 0xD1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0xBB, 0xE9, 0xE6, 0xD5, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + // Spanish Aura Mew + {0x00, 0x00, 0x00, 0x00, 0x6E, 0x4E, 0x00, 0x00, 0xC7, 0xBF, 0xD1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02, 0xBB, 0xE9, 0xE6, 0xD5, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + // Mitsurin Celebi + {0x00, 0x00, 0x00, 0x00, 0x30, 0xED, 0x00, 0x00, 0x5E, 0x7A, 0x97, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x70, 0x62, 0x78, 0x7E, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x49, 0x00, 0x69, 0x00, 0xD7, 0x00, 0xDB, 0x00, 0x0A, 0x14, 0x05, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0A, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + // 10th Anniversary Celebi + {0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0xBD, 0xBF, 0xC6, 0xBF, 0xBC, 0xC3, 0xFF, 0x34, 0x01, 0x31, 0x02, 0x02, 0xA2, 0xA1, 0x00, 0xBB, 0xC8, 0xC3, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x00, 0x00, 0x80, 0x43, 0x05, 0x00, 0x00, 0x64, 0x00, 0x00, 0xF6, 0x00, 0xF8, 0x00, 0xE2, 0x00, 0xC3, 0x00, 0x05, 0x0F, 0x28, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x46, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + }; + const u8 TYPES[POKEMON_ARRAY_SIZE][2]{ + {0x0, 0x0}, // Missingno is ???/??? + {0xc, 0x3}, // Bulbasaur is grass/poison + {0xc, 0x3}, // Ivysaur is grass/poison + {0xc, 0x3}, // Venusaur is grass/poison + {0xa, 0xa}, // Charmander is fire/fire + {0xa, 0xa}, // Charmeleon is fire/fire + {0xa, 0x2}, // Charizard is fire/flying + {0xb, 0xb}, // Squirtle is water/water + {0xb, 0xb}, // Wartortle is water/water + {0xb, 0xb}, // Blastoise is water/water + {0x6, 0x6}, // Caterpie is bug/bug + {0x6, 0x6}, // Metapod is bug/bug + {0x6, 0x2}, // Butterfree is bug/flying + {0x6, 0x3}, // Weedle is bug/poison + {0x6, 0x3}, // Kakuna is bug/poison + {0x6, 0x3}, // Beedrill is bug/poison + {0x0, 0x2}, // Pidgey is normal/flying + {0x0, 0x2}, // Pidgeotto is normal/flying + {0x0, 0x2}, // Pidgeot is normal/flying + {0x0, 0x0}, // Rattata is normal/normal + {0x0, 0x0}, // Raticate is normal/normal + {0x0, 0x2}, // Spearow is normal/flying + {0x0, 0x2}, // Fearow is normal/flying + {0x3, 0x3}, // Ekans is poison/poison + {0x3, 0x3}, // Arbok is poison/poison + {0xd, 0xd}, // Pikachu is electric/electric + {0xd, 0xd}, // Raichu is electric/electric + {0x4, 0x4}, // Sandshrew is ground/ground + {0x4, 0x4}, // Sandslash is ground/ground + {0x3, 0x3}, // Nidoran-f is poison/poison + {0x3, 0x3}, // Nidorina is poison/poison + {0x3, 0x4}, // Nidoqueen is poison/ground + {0x3, 0x3}, // Nidoran-m is poison/poison + {0x3, 0x3}, // Nidorino is poison/poison + {0x3, 0x4}, // Nidoking is poison/ground + {0x0, 0x0}, // Clefairy is normal/normal + {0x0, 0x0}, // Clefable is normal/normal + {0xa, 0xa}, // Vulpix is fire/fire + {0xa, 0xa}, // Ninetales is fire/fire + {0x0, 0x0}, // Jigglypuff is normal/normal + {0x0, 0x0}, // Wigglytuff is normal/normal + {0x3, 0x2}, // Zubat is poison/flying + {0x3, 0x2}, // Golbat is poison/flying + {0xc, 0x3}, // Oddish is grass/poison + {0xc, 0x3}, // Gloom is grass/poison + {0xc, 0x3}, // Vileplume is grass/poison + {0x6, 0xc}, // Paras is bug/grass + {0x6, 0xc}, // Parasect is bug/grass + {0x6, 0x3}, // Venonat is bug/poison + {0x6, 0x3}, // Venomoth is bug/poison + {0x4, 0x4}, // Diglett is ground/ground + {0x4, 0x4}, // Dugtrio is ground/ground + {0x0, 0x0}, // Meowth is normal/normal + {0x0, 0x0}, // Persian is normal/normal + {0xb, 0xb}, // Psyduck is water/water + {0xb, 0xb}, // Golduck is water/water + {0x1, 0x1}, // Mankey is fighting/fighting + {0x1, 0x1}, // Primeape is fighting/fighting + {0xa, 0xa}, // Growlithe is fire/fire + {0xa, 0xa}, // Arcanine is fire/fire + {0xb, 0xb}, // Poliwag is water/water + {0xb, 0xb}, // Poliwhirl is water/water + {0xb, 0x1}, // Poliwrath is water/fighting + {0xe, 0xe}, // Abra is psychic/psychic + {0xe, 0xe}, // Kadabra is psychic/psychic + {0xe, 0xe}, // Alakazam is psychic/psychic + {0x1, 0x1}, // Machop is fighting/fighting + {0x1, 0x1}, // Machoke is fighting/fighting + {0x1, 0x1}, // Machamp is fighting/fighting + {0xc, 0x3}, // Bellsprout is grass/poison + {0xc, 0x3}, // Weepinbell is grass/poison + {0xc, 0x3}, // Victreebel is grass/poison + {0xb, 0x3}, // Tentacool is water/poison + {0xb, 0x3}, // Tentacruel is water/poison + {0x5, 0x4}, // Geodude is rock/ground + {0x5, 0x4}, // Graveler is rock/ground + {0x5, 0x4}, // Golem is rock/ground + {0xa, 0xa}, // Ponyta is fire/fire + {0xa, 0xa}, // Rapidash is fire/fire + {0xb, 0xe}, // Slowpoke is water/psychic + {0xb, 0xe}, // Slowbro is water/psychic + {0xd, 0x8}, // Magnemite is electric/steel + {0xd, 0x8}, // Magneton is electric/steel + {0x0, 0x2}, // Farfetchd is normal/flying + {0x0, 0x2}, // Doduo is normal/flying + {0x0, 0x2}, // Dodrio is normal/flying + {0xb, 0xb}, // Seel is water/water + {0xb, 0xf}, // Dewgong is water/ice + {0x3, 0x3}, // Grimer is poison/poison + {0x3, 0x3}, // Muk is poison/poison + {0xb, 0xb}, // Shellder is water/water + {0xb, 0xf}, // Cloyster is water/ice + {0x7, 0x3}, // Gastly is ghost/poison + {0x7, 0x3}, // Haunter is ghost/poison + {0x7, 0x3}, // Gengar is ghost/poison + {0x5, 0x4}, // Onix is rock/ground + {0xe, 0xe}, // Drowzee is psychic/psychic + {0xe, 0xe}, // Hypno is psychic/psychic + {0xb, 0xb}, // Krabby is water/water + {0xb, 0xb}, // Kingler is water/water + {0xd, 0xd}, // Voltorb is electric/electric + {0xd, 0xd}, // Electrode is electric/electric + {0xc, 0xe}, // Exeggcute is grass/psychic + {0xc, 0xe}, // Exeggutor is grass/psychic + {0x4, 0x4}, // Cubone is ground/ground + {0x4, 0x4}, // Marowak is ground/ground + {0x1, 0x1}, // Hitmonlee is fighting/fighting + {0x1, 0x1}, // Hitmonchan is fighting/fighting + {0x0, 0x0}, // Lickitung is normal/normal + {0x3, 0x3}, // Koffing is poison/poison + {0x3, 0x3}, // Weezing is poison/poison + {0x4, 0x5}, // Rhyhorn is ground/rock + {0x4, 0x5}, // Rhydon is ground/rock + {0x0, 0x0}, // Chansey is normal/normal + {0xc, 0xc}, // Tangela is grass/grass + {0x0, 0x0}, // Kangaskhan is normal/normal + {0xb, 0xb}, // Horsea is water/water + {0xb, 0xb}, // Seadra is water/water + {0xb, 0xb}, // Goldeen is water/water + {0xb, 0xb}, // Seaking is water/water + {0xb, 0xb}, // Staryu is water/water + {0xb, 0xe}, // Starmie is water/psychic + {0xe, 0xe}, // Mr-mime is psychic/psychic + {0x6, 0x2}, // Scyther is bug/flying + {0xf, 0xe}, // Jynx is ice/psychic + {0xd, 0xd}, // Electabuzz is electric/electric + {0xa, 0xa}, // Magmar is fire/fire + {0x6, 0x6}, // Pinsir is bug/bug + {0x0, 0x0}, // Tauros is normal/normal + {0xb, 0xb}, // Magikarp is water/water + {0xb, 0x2}, // Gyarados is water/flying + {0xb, 0xf}, // Lapras is water/ice + {0x0, 0x0}, // Ditto is normal/normal + {0x0, 0x0}, // Eevee is normal/normal + {0xb, 0xb}, // Vaporeon is water/water + {0xd, 0xd}, // Jolteon is electric/electric + {0xa, 0xa}, // Flareon is fire/fire + {0x0, 0x0}, // Porygon is normal/normal + {0x5, 0xb}, // Omanyte is rock/water + {0x5, 0xb}, // Omastar is rock/water + {0x5, 0xb}, // Kabuto is rock/water + {0x5, 0xb}, // Kabutops is rock/water + {0x5, 0x2}, // Aerodactyl is rock/flying + {0x0, 0x0}, // Snorlax is normal/normal + {0xf, 0x2}, // Articuno is ice/flying + {0xd, 0x2}, // Zapdos is electric/flying + {0xa, 0x2}, // Moltres is fire/flying + {0x10, 0x10}, // Dratini is dragon/dragon + {0x10, 0x10}, // Dragonair is dragon/dragon + {0x10, 0x2}, // Dragonite is dragon/flying + {0xe, 0xe}, // Mewtwo is psychic/psychic + {0xe, 0xe}, // Mew is psychic/psychic + {0xc, 0xc}, // Chikorita is grass/grass + {0xc, 0xc}, // Bayleef is grass/grass + {0xc, 0xc}, // Meganium is grass/grass + {0xa, 0xa}, // Cyndaquil is fire/fire + {0xa, 0xa}, // Quilava is fire/fire + {0xa, 0xa}, // Typhlosion is fire/fire + {0xb, 0xb}, // Totodile is water/water + {0xb, 0xb}, // Croconaw is water/water + {0xb, 0xb}, // Feraligatr is water/water + {0x0, 0x0}, // Sentret is normal/normal + {0x0, 0x0}, // Furret is normal/normal + {0x0, 0x2}, // Hoothoot is normal/flying + {0x0, 0x2}, // Noctowl is normal/flying + {0x6, 0x2}, // Ledyba is bug/flying + {0x6, 0x2}, // Ledian is bug/flying + {0x6, 0x3}, // Spinarak is bug/poison + {0x6, 0x3}, // Ariados is bug/poison + {0x3, 0x2}, // Crobat is poison/flying + {0xb, 0xd}, // Chinchou is water/electric + {0xb, 0xd}, // Lanturn is water/electric + {0xd, 0xd}, // Pichu is electric/electric + {0x0, 0x0}, // Cleffa is normal/normal + {0x0, 0x0}, // Igglybuff is normal/normal + {0x0, 0x0}, // Togepi is normal/normal + {0x0, 0x2}, // Togetic is normal/flying + {0xe, 0x2}, // Natu is psychic/flying + {0xe, 0x2}, // Xatu is psychic/flying + {0xd, 0xd}, // Mareep is electric/electric + {0xd, 0xd}, // Flaaffy is electric/electric + {0xd, 0xd}, // Ampharos is electric/electric + {0xc, 0xc}, // Bellossom is grass/grass + {0xb, 0xb}, // Marill is water/water + {0xb, 0xb}, // Azumarill is water/water + {0x5, 0x5}, // Sudowoodo is rock/rock + {0xb, 0xb}, // Politoed is water/water + {0xc, 0x2}, // Hoppip is grass/flying + {0xc, 0x2}, // Skiploom is grass/flying + {0xc, 0x2}, // Jumpluff is grass/flying + {0x0, 0x0}, // Aipom is normal/normal + {0xc, 0xc}, // Sunkern is grass/grass + {0xc, 0xc}, // Sunflora is grass/grass + {0x6, 0x2}, // Yanma is bug/flying + {0xb, 0x4}, // Wooper is water/ground + {0xb, 0x4}, // Quagsire is water/ground + {0xe, 0xe}, // Espeon is psychic/psychic + {0x10, 0x10}, // Umbreon is dark/dark + {0x10, 0x2}, // Murkrow is dark/flying + {0xb, 0xe}, // Slowking is water/psychic + {0x7, 0x7}, // Misdreavus is ghost/ghost + {0xe, 0xe}, // Unown is psychic/psychic + {0xe, 0xe}, // Wobbuffet is psychic/psychic + {0x0, 0xe}, // Girafarig is normal/psychic + {0x6, 0x6}, // Pineco is bug/bug + {0x6, 0x8}, // Forretress is bug/steel + {0x0, 0x0}, // Dunsparce is normal/normal + {0x4, 0x2}, // Gligar is ground/flying + {0x8, 0x4}, // Steelix is steel/ground + {0x0, 0x0}, // Snubbull is normal/normal + {0x0, 0x0}, // Granbull is normal/normal + {0xb, 0x3}, // Qwilfish is water/poison + {0x6, 0x8}, // Scizor is bug/steel + {0x6, 0x5}, // Shuckle is bug/rock + {0x6, 0x1}, // Heracross is bug/fighting + {0x10, 0xf}, // Sneasel is dark/ice + {0x0, 0x0}, // Teddiursa is normal/normal + {0x0, 0x0}, // Ursaring is normal/normal + {0xa, 0xa}, // Slugma is fire/fire + {0xa, 0x5}, // Magcargo is fire/rock + {0xf, 0x4}, // Swinub is ice/ground + {0xf, 0x4}, // Piloswine is ice/ground + {0xb, 0x5}, // Corsola is water/rock + {0xb, 0xb}, // Remoraid is water/water + {0xb, 0xb}, // Octillery is water/water + {0xf, 0x2}, // Delibird is ice/flying + {0xb, 0x2}, // Mantine is water/flying + {0x8, 0x2}, // Skarmory is steel/flying + {0x10, 0xa}, // Houndour is dark/fire + {0x10, 0xa}, // Houndoom is dark/fire + {0xb, 0x10}, // Kingdra is water/dragon + {0x4, 0x4}, // Phanpy is ground/ground + {0x4, 0x4}, // Donphan is ground/ground + {0x0, 0x0}, // Porygon2 is normal/normal + {0x0, 0x0}, // Stantler is normal/normal + {0x0, 0x0}, // Smeargle is normal/normal + {0x1, 0x1}, // Tyrogue is fighting/fighting + {0x1, 0x1}, // Hitmontop is fighting/fighting + {0xf, 0xe}, // Smoochum is ice/psychic + {0xd, 0xd}, // Elekid is electric/electric + {0xa, 0xa}, // Magby is fire/fire + {0x0, 0x0}, // Miltank is normal/normal + {0x0, 0x0}, // Blissey is normal/normal + {0xd, 0xd}, // Raikou is electric/electric + {0xa, 0xa}, // Entei is fire/fire + {0xb, 0xb}, // Suicune is water/water + {0x5, 0x4}, // Larvitar is rock/ground + {0x5, 0x4}, // Pupitar is rock/ground + {0x5, 0x10}, // Tyranitar is rock/dark + {0xe, 0x2}, // Lugia is psychic/flying + {0xa, 0x2}, // Ho-oh is fire/flying + {0xe, 0xc}, // Celebi is psychic/grass + {0xc, 0xc}, // Treecko is grass/grass + }; + +#endif + u16 input_charset[256]; + u16 gen3_charset[256]; + PokemonTables(); + + void load_exp_groups(); + void load_gender_ratios(); + void load_num_abilities(); + void load_first_moves(); + void load_power_points(); + void load_event_pkmn(); + void load_types(); + void load_input_charset(byte gen, Language lang); + void load_gen3_charset(Language lang); + + u32 get_max_exp(int index_num); + u8 get_gender_threshold(int index_num, bool is_gen_3); + bool get_num_abilities(int index_num); + bool can_learn_move(int pkmn_index, int move_index); + byte get_earliest_move(int index_num); + byte get_gen_3_char(u16 input_char); +}; + +/** + * Loads the charset for and into + */ +void load_localized_charset(u16 *output_char_array, byte gen, Language lang); +byte get_char_from_charset(const u16 *charset, u16 input_char); + +#endif \ No newline at end of file diff --git a/include/pccs/typeDefs.h b/include/pccs/typeDefs.h new file mode 100644 index 0000000..4b4c482 --- /dev/null +++ b/include/pccs/typeDefs.h @@ -0,0 +1,671 @@ +#ifndef TYPEDEFS_H +#define TYPEDEFS_H + +#include "pccs_settings.h" + +#if ON_GBA +#include +#else +typedef unsigned char u8, byte, uchar, echar; +typedef unsigned short u16, hword, ushort, eshort; +typedef unsigned int u32, word, uint, eint; +typedef unsigned long long u64; + +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +typedef signed long long s64; +#endif + +// byte offset, data length (in bits), and bit offset +struct DataVarInfo +{ + int byteOffset; // The offset of the value + int dataLength; // The length of the data in bits + int bitOffset; // The offset of where the bits are in the array +}; + +enum Stat +{ + HP, + ATTACK, + DEFENSE, + SPEED, + SPECIAL_ATTACK, + SPECIAL_DEFENSE, + SPECIAL = SPECIAL_ATTACK, +}; + +enum Condition +{ + COOLNESS, + BEAUTY, + CUTENESS, + SMARTNESS, + TOUGHNESS, +}; + +enum Gen1Types +{ + NORMAL, + FIGHTING, + FLYING, + POISON, + GROUND, + ROCK, + BIRD, + BUG, + GHOST, + NINE, + TEN, + ELEVEN, + TWELVE, + THIRTEEN, + FOURTEEN, + FIFTEEN, + SIXTEEN, + SEVENTEEN, + EIGHTEEN, + NINETEEN, + FIRE, + WATER, + GRASS, + ELECTRIC, + PSYCHIC, + ICE, + DRAGON, +}; + +enum Ribbon +{ + COOL_NORMAL_CONTEST, + COOL_SUPER_CONTEST, + COOL_HYPER_CONTEST, + COOL_MASTER_CONTEST, + BEAUTY_NORMAL_CONTEST, + BEAUTY_SUPER_CONTEST, + BEAUTY_HYPER_CONTEST, + BEAUTY_MASTER_CONTEST, + CUTE_NORMAL_CONTEST, + CUTE_SUPER_CONTEST, + CUTE_HYPER_CONTEST, + CUTE_MASTER_CONTEST, + SMART_NORMAL_CONTEST, + SMART_SUPER_CONTEST, + SMART_HYPER_CONTEST, + SMART_MASTER_CONTEST, + TOUGH_NORMAL_CONTEST, + TOUGH_SUPER_CONTEST, + TOUGH_HYPER_CONTEST, + TOUGH_MASTER_CONTEST, + CHAMPION, + WINNING, + VICTORY, + ARTIST, + EFFORT, + BATTLECHAMPION, + REGIONALCHAMPION, + NATIONALCHAMPION, + COUNTRY, + NATIONAL, + EARTH, +}; + +enum Gender +{ + MALE, + FEMALE, + GENDERLESS, +}; + +enum Nature +{ + HARDY, + LONELY, + BRAVE, + ADAMANT, + NAUGHTY, + BOLD, + DOCILE, + RELAXED, + IMPISH, + LAX, + TIMID, + HASTY, + SERIOUS, + JOLLY, + NAIVE, + MODEST, + MILD, + QUIET, + BASHFUL, + RASH, + CALM, + GENTLE, + SASSY, + CAREFUL, + QUIRKY, +}; + +enum Species +{ + BULBASAUR = 1, + IVYSAUR, + VENUSAUR, + CHARMANDER, + CHARMELEON, + CHARIZARD, + SQUIRTLE, + WARTORTLE, + BLASTOISE, + CATERPIE, + METAPOD, + BUTTERFREE, + WEEDLE, + KAKUNA, + BEEDRILL, + PIDGEY, + PIDGEOTTO, + PIDGEOT, + RATTATA, + RATICATE, + SPEAROW, + FEAROW, + EKANS, + ARBOK, + PIKACHU, + RAICHU, + SANDSHREW, + SANDSLASH, + NIDORAN_F, + NIDORINA, + NIDOQUEEN, + NIDORAN_M, + NIDORINO, + NIDOKING, + CLEFAIRY, + CLEFABLE, + VULPIX, + NINETALES, + JIGGLYPUFF, + WIGGLYTUFF, + ZUBAT, + GOLBAT, + ODDISH, + GLOOM, + VILEPLUME, + PARAS, + PARASECT, + VENONAT, + VENOMOTH, + DIGLETT, + DUGTRIO, + MEOWTH, + PERSIAN, + PSYDUCK, + GOLDUCK, + MANKEY, + PRIMEAPE, + GROWLITHE, + ARCANINE, + POLIWAG, + POLIWHIRL, + POLIWRATH, + ABRA, + KADABRA, + ALAKAZAM, + MACHOP, + MACHOKE, + MACHAMP, + BELLSPROUT, + WEEPINBELL, + VICTREEBEL, + TENTACOOL, + TENTACRUEL, + GEODUDE, + GRAVELER, + GOLEM, + PONYTA, + RAPIDASH, + SLOWPOKE, + SLOWBRO, + MAGNEMITE, + MAGNETON, + FARFETCHD, + DODUO, + DODRIO, + SEEL, + DEWGONG, + GRIMER, + MUK, + SHELLDER, + CLOYSTER, + GASTLY, + HAUNTER, + GENGAR, + ONIX, + DROWZEE, + HYPNO, + KRABBY, + KINGLER, + VOLTORB, + ELECTRODE, + EXEGGCUTE, + EXEGGUTOR, + CUBONE, + MAROWAK, + HITMONLEE, + HITMONCHAN, + LICKITUNG, + KOFFING, + WEEZING, + RHYHORN, + RHYDON, + CHANSEY, + TANGELA, + KANGASKHAN, + HORSEA, + SEADRA, + GOLDEEN, + SEAKING, + STARYU, + STARMIE, + MR_MIME, + SCYTHER, + JYNX, + ELECTABUZZ, + MAGMAR, + PINSIR, + TAUROS, + MAGIKARP, + GYARADOS, + LAPRAS, + DITTO, + EEVEE, + VAPOREON, + JOLTEON, + FLAREON, + PORYGON, + OMANYTE, + OMASTAR, + KABUTO, + KABUTOPS, + AERODACTYL, + SNORLAX, + ARTICUNO, + ZAPDOS, + MOLTRES, + DRATINI, + DRAGONAIR, + DRAGONITE, + MEWTWO, + MEW, + CHIKORITA, + BAYLEEF, + MEGANIUM, + CYNDAQUIL, + QUILAVA, + TYPHLOSION, + TOTODILE, + CROCONAW, + FERALIGATR, + SENTRET, + FURRET, + HOOTHOOT, + NOCTOWL, + LEDYBA, + LEDIAN, + SPINARAK, + ARIADOS, + CROBAT, + CHINCHOU, + LANTURN, + PICHU, + CLEFFA, + IGGLYBUFF, + TOGEPI, + TOGETIC, + NATU, + XATU, + MAREEP, + FLAAFFY, + AMPHAROS, + BELLOSSOM, + MARILL, + AZUMARILL, + SUDOWOODO, + POLITOED, + HOPPIP, + SKIPLOOM, + JUMPLUFF, + AIPOM, + SUNKERN, + SUNFLORA, + YANMA, + WOOPER, + QUAGSIRE, + ESPEON, + UMBREON, + MURKROW, + SLOWKING, + MISDREAVUS, + UNOWN, + WOBBUFFET, + GIRAFARIG, + PINECO, + FORRETRESS, + DUNSPARCE, + GLIGAR, + STEELIX, + SNUBBULL, + GRANBULL, + QWILFISH, + SCIZOR, + SHUCKLE, + HERACROSS, + SNEASEL, + TEDDIURSA, + URSARING, + SLUGMA, + MAGCARGO, + SWINUB, + PILOSWINE, + CORSOLA, + REMORAID, + OCTILLERY, + DELIBIRD, + MANTINE, + SKARMORY, + HOUNDOUR, + HOUNDOOM, + KINGDRA, + PHANPY, + DONPHAN, + PORYGON2, + STANTLER, + SMEARGLE, + TYROGUE, + HITMONTOP, + SMOOCHUM, + ELEKID, + MAGBY, + MILTANK, + BLISSEY, + RAIKOU, + ENTEI, + SUICUNE, + LARVITAR, + PUPITAR, + TYRANITAR, + LUGIA, + HO_OH, + CELEBI, + TREECKO, + MISSINGNO = 0xFF, +}; + +enum PokeBall +{ + MASTER = 1, + ULTRA, + GREAT, + POKE, + SAFARI, + NET, + DIVE, + NEST, + REPEAT, + TIMER, + LUXURY, + PREMIER, +}; + +enum Game +{ + SAPPHIRE = 1, + RUBY, + EMERALD, + FIRERED, + LEAFGREEN, + HEARTGOLD = 7, + SOULSILVER, + DIAMOND = 10, + PEARL, + PLATINUM, + COlOSSEUM_XD = 15, +}; + +enum Item +{ + NONE, + MASTER_BALL, + ULTRA_BALL, + GREAT_BALL, + POKE_BALL, + SAFARI_BALL, + NET_BALL, + DIVE_BALL, + NEST_BALL, + REPEAT_BALL, + TIMER_BALL, + LUXURY_BALL, + PREMIER_BALL, + POTION, + ANTIDOTE, + BURN_HEAL, + ICE_HEAL, + AWAKENING, + PARLYZ_HEAL, + FULL_RESTORE, + MAX_POTION, + HYPER_POTION, + SUPER_POTION, + FULL_HEAL, + REVIVE, + MAX_REVIVE, + FRESH_WATER, + SODA_POP, + LEMONADE, + MOOMOO_MILK, + ENERGYPOWDER, + ENERGY_ROOT, + HEAL_POWDER, + REVIVAL_HERB, + ETHER, + MAX_ETHER, + ELIXIR, + MAX_ELIXIR, + LAVA_COOKIE, + BLUE_FLUTE, + YELLOW_FLUTE, + RED_FLUTE, + BLACK_FLUTE, + WHITE_FLUTE, + BERRY_JUICE, + SACRED_ASH, + SHOAL_SALT, + SHOAL_SHELL, + RED_SHARD, + BLUE_SHARD, + YELLOW_SHARD, + GREEN_SHARD, + + HP_UP = 0x3F, + PROTEIN, + IRON, + CARBOS, + CALCIUM, + RARE_CANDY, + PP_UP, + ZINC, + PP_MAX, + + GUARD_SPEC = 0x49, + DIRE_HIT, + X_ATTACK, + X_DEFEND, + X_SPEED, + X_ACCURACY, + X_SPECIAL, + POKE_DOLL, + FLUFFY_TAIL, + + SUPER_REPEL = 0x53, + MAX_REPEL, + ESCAPE_ROPE, + REPEL, + + SUN_STONE = 0x5D, + MOON_STONE, + FIRE_STONE, + THUNDERSTONE, + WATER_STONE, + LEAF_STONE, + + TINYMUSHROOM = 0x67, + BIG_MUSHROOM, + + NORMAL_PEARL = 0x6A, + BIG_PEARL, + STARDUST, + STAR_PIECE, + NUGGET, + HEART_SCALE, + + ORANGE_MAIL = 0x79, + HARBOR_MAIL, + GLITTER_MAIL, + MECH_MAIL, + WOOD_MAIL, + WAVE_MAIL, + BEAD_MAIL, + SHADOW_MAIL, + TROPIC_MAIL, + DREAM_MAIL, + FAB_MAIL, + RETRO_MAIL, + CHERI_BERRY, + CHESTO_BERRY, + PECHA_BERRY, + RAWST_BERRY, + ASPEAR_BERRY, + LEPPA_BERRY, + ORAN_BERRY, + PERSIM_BERRY, + LUM_BERRY, + SITRUS_BERRY, + FIGY_BERRY, + WIKI_BERRY, + MAGO_BERRY, + AGUAV_BERRY, + IAPAPA_BERRY, + RAZZ_BERRY, + BLUK_BERRY, + NANAB_BERRY, + WEPEAR_BERRY, + PINAP_BERRY, + POMEG_BERRY, + KELPSY_BERRY, + QUALOT_BERRY, + HONDEW_BERRY, + GREPA_BERRY, + TAMATO_BERRY, + CORNN_BERRY, + MAGOST_BERRY, + RABUTA_BERRY, + NOMEL_BERRY, + SPELON_BERRY, + PAMTRE_BERRY, + WATMEL_BERRY, + DURIN_BERRY, + BELUE_BERRY, + LIECHI_BERRY, + GANLON_BERRY, + SALAC_BERRY, + PETAYA_BERRY, + APICOT_BERRY, + LANSAT_BERRY, + STARF_BERRY, + ENIGMA_BERRY, + + BRIGHTPOWDER = 0xB3, + WHITE_HERB, + MACHO_BRACE, + EXP_SHARE, + QUICK_CLAW, + SOOTHE_BELL, + MENTAL_HERB, + CHOICE_BAND, + KINGS_ROCK, + SILVERPOWDER, + AMULET_COIN, + CLEANSE_TAG, + SOUL_DEW, + DEEPSEATOOTH, + DEEPSEASCALE, + SMOKE_BALL, + EVERSTONE, + FOCUS_BAND, + LUCKY_EGG, + SCOPE_LENS, + METAL_COAT, + LEFTOVERS, + DRAGON_SCALE, + LIGHT_BALL, + SOFT_SAND, + HARD_STONE, + MIRACLE_SEED, + BLACKGLASSES, + BLACK_BELT, + MAGNET, + MYSTIC_WATER, + SHARP_BEAK, + POISON_BARB, + NEVERMELTICE, + SPELL_TAG, + TWISTEDSPOON, + CHARCOAL, + DRAGON_FANG, + SILK_SCARF, + UPGRADE, + SHELL_BELL, + SEA_INCENSE, + LAX_INCENSE, + LUCKY_PUNCH, + METAL_POWDER, + THICK_CLUB, + STICK, + + RED_SCARF = 0xFE, + BLUE_SCARF, + PINK_SCARF, + GREEN_SCARF, + YELLOW_SCARF +}; + +enum Substructure +{ + SUB_G, + SUB_A, + SUB_E, + SUB_M, +}; + +enum Language +{ + JAPANESE = 1, + ENGLISH, + FRENCH, + ITALIAN, + GERMAN, + SPANISH, + KOREAN, +}; + +enum RNGMethod +{ + ABCD_U, // Normal method + BACD_R, // Used for calculating events +}; + +#endif \ No newline at end of file diff --git a/include/pokemon.h b/include/pokemon.h deleted file mode 100644 index 96c042e..0000000 --- a/include/pokemon.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef POKEMON_H -#define POKEMON_H - -#include -#include "random.h" -#include "global_frame_controller.h" - -#define POKEMON_SIZE 80 - -// How much trade data is sent for each langauge and generation, -// sarts at OT name and ends after the 3 buffer bytes -#define GEN1_JPN_SIZE 353 -#define GEN1_INT_SIZE 418 -#define GEN2_JPN_SIZE 383 -#define GEN2_INT_SIZE 444 - -class PokemonTables; - -struct Simplified_Pokemon -{ - byte dex_number; - byte met_level; - byte nickname[10]; - bool is_valid; - bool is_transferred; - bool is_shiny; - int unown_letter; - bool is_missingno; -}; - -enum Conversion_Types -{ - Faithful, - Legal, - Virtual, -}; - -class Pokemon -{ -public: - int pkmn_size = 0; - int ot_and_party = 0; - int ot_size = 0; - int nickname_size = 0; - int nature_mod = 0; - int unown_letter = -1; - Pokemon(); - void load_data(int index, const byte *party_data, int game, int lang); - void convert_to_gen_three(PokemonTables& data_tables, Conversion_Types conv_type, bool simplified, bool stabilize_mythical); - void copy_from_to(const byte *source, byte *destination, int size, bool reverse_endian); - void alocate_data_chunks(byte *G, byte *A, byte *E, byte *M); - void insert_data(byte *first, byte *second, byte *third, byte *fourth); - byte get_gen_3_data(int index); - byte *get_full_gen_3_array(); - byte get_unencrypted_data(int index); - byte *convert_text(PokemonTables& data_tables, byte *text_array, int size); - u32 generate_pid_save_iv(PokemonTables& data_tables, byte pid_species_index, byte nature, byte *pid_dvs); - u32 generate_pid_iv_match(PokemonTables& data_tables, byte pid_species_index, byte nature, byte *pid_dvs); - u32 generate_pid_iv_legendary(byte pid_species_index, byte *pid_dvs, byte *out_ivs); - byte rand_reverse_mod(byte modulo_divisor, byte target_mod); - byte get_rand_gender_byte(PokemonTables &data_tables, byte index_num, byte attack_DVs); - byte get_dex_number(); - bool get_validity(); - bool get_is_new(); - bool get_is_shiny(); - Simplified_Pokemon get_simple_pkmn(); - u8 get_letter_from_pid(u32 pid); - u8 get_nature_from_pid(u32 pid); - u8 get_gender_from_pid(u32 pid); - void set_to_event(PokemonTables &data_tables, byte nature); - int num_in_box; - int index_in_box; - bool is_missingno = false; - -private: - byte gen = 2; - byte language; - byte species_index_party; // The species ID stored in the party. Really only used for egg detection - byte species_index_struct; // The species ID stored in the pkmn strucutre. The main one to use. - byte moves[4]; - byte trainer_id[2]; - byte secret_id[2]; - u32 exp; - byte nickname[10]; - byte trainer_name[7]; - byte pokerus; - byte caught_data[2]; - byte met_level; - byte item; - byte gen_3_pkmn[80]; - byte unencrypted_data[49]; // Contains the 48 GAEM bytes, along with the modulo int - byte pid[4] = {0, 0, 0, 0}; // Little Endian, reverse of Bulbapedia - byte blank_word[4] = {0}; - byte data_section_G[12]; - byte data_section_A[12]; - byte data_section_E[12]; - byte data_section_M[12]; - hword checksum; - byte encryption_key[4]; - hword origin_info = 0; - bool is_shiny = false; - byte pp_values[4]; - byte pp_bonus[4]; - byte pure_pp_values[4]; - byte dvs[2]; - byte ivs[6]; - byte ribbons[4] = {0, 0, 0, 0}; - u32 iv_egg_ability; - bool is_valid; - bool is_new = false; - int box_size; -}; - -#endif diff --git a/include/pokemon_data.h b/include/pokemon_data.h deleted file mode 100644 index 278d945..0000000 --- a/include/pokemon_data.h +++ /dev/null @@ -1,143 +0,0 @@ -#ifndef POKEMON_DATA_H -#define POKEMON_DATA_H - -#include - -#define med_fast_max (u32)1000000 -// Slightly Fast goes unused -// Slightly Slow goes unused -#define med_slow_max (u32)1059860 -#define fast_max (u32)800000 -#define slow_max (u32)1250000 -// Erractic is Gen 3+ -// Fluctuating is Gen 3+ - -#define EXP_FAST 0 -// Slightly Fast goes unused -// Slightly Slow goes unused -#define EXP_MED_SLOW 3 -#define EXP_MED_FAST 4 -#define EXP_SLOW 5 -// Erractic is Gen 3+ -// Fluctuating is Gen 3+ - -#define JPN_ID 1 -#define ENG_ID 2 -#define FRE_ID 3 -#define ITA_ID 4 -#define GER_ID 5 -#define SPA_ID 7 -#define KOR_ID 8 - -#define GREEN_ID 0 -#define RED_ID 1 -#define BLUE_ID 2 -#define YELLOW_ID 3 -#define GOLD_ID 4 -#define SILVER_ID 5 -#define CRYSTAL_ID 6 - -#define EVENT_MEW_JPN 0 -#define EVENT_MEW_ENG 1 -#define EVENT_MEW_FRE 2 -#define EVENT_MEW_ITA 3 -#define EVENT_MEW_GER 4 -#define EVENT_MEW_SPA 5 -#define EVENT_CELEBI 6 - - -#define MAX_PKMN_IN_BOX 30 -#define NUM_POKEMON 252 -#define POKEMON_ARRAY_SIZE NUM_POKEMON + 1 - -// these arrays are too small to compress -extern const u32 EXP_MAXIMUMS[6]; -extern const int GENDER_THRESHOLDS[2][8]; -// the next arrays don't compress well at all. Not worth the decompression overhead. -extern const byte gen_1_index_array[191]; -extern const u8 EVOLUTIONS[POKEMON_ARRAY_SIZE]; - -// Unfortunately we can't compress this 8 KB MOVESETS array. -// I mean, we physically can, but decompressing it means storing it in IWRAM, -// at a moment (during convert_to_gen_three()) at which we are using a LOT of IWRAM already. -// By keeping it uncompressed, it gets stored in EWRAM, where it won't hinder us. -// But it does mean that it still takes up 8 KB in the rom. -// Just for reference: when compressing it with ZX0 AND only storing the "changed" bits for PKMN -// evolutions in relation to their base forms, we could bring the size down to 4641 bytes. -// But alas, the IWRAM consumption at a critical point in time made this approach unviable. -// TODO: we might be able to load similar data from the game cartridges. -// However, it turns out the data is different between the R/S/E and FR/LG games. -// So we would have to store "patches"/differences if we go this route. -// It also means we'd have to figure out rom offsets for every single gen III game variant/localization. -extern const byte MOVESETS[POKEMON_ARRAY_SIZE][32]; - -/** - * Okay, here's the thing: to reduce the rom size, we compressed a bunch of data with ZX0 - * Among this data are various data tables that were previously just stored as const arrays. - * - * But, during the mystery_gift_builder/mystery_gift_injector execution, - * these data tables are used intensely, because you're not using them for single pokémon, but rather for boxes of pokémon. - * - * Decompression is not cheap, so we can't afford to decompress the tables again and again for every pokémon we deal with - * during this flow. - * - * This is where this class comes in. It is basically a holder of these tables. The idea is to pass it along with the mystery_gift_builder - * and have it lazy decompress the tables AND charsets it needs. This way when we are dealing with multiple pokémon, we are not decompressing - * the same data every time and thereby make performance suffer. - * - * It DOES have a significant IWRAM cost though. The intention is to just allocate this struct on the stack. - * As far as I can tell, our stack is not really restricted at all. It just fills up the IWRAM as needed. So we need to be careful not to - * overwrite/corrupt any code or data we specifically tagged to be stored in IWRAM. - */ -class PokemonTables -{ -public: - bool exp_groups_loaded; - bool gender_ratios_loaded; - bool num_abilities_loaded; - bool first_moves_loaded; - bool power_points_loaded; - bool event_pkmn_loaded; - bool types_loaded; - // a number representing the unique combination of gen 1/2 and the specific language - // 0 means not loaded - u8 input_charset_type; - // 0 means not loaded, 1=JPN, 2=Intern - u8 gen3_charset_type; - - u8 EXP_GROUPS[POKEMON_ARRAY_SIZE]; - u8 GENDER_RATIO[POKEMON_ARRAY_SIZE]; - bool NUM_ABILITIES[POKEMON_ARRAY_SIZE]; - byte FIRST_MOVES[POKEMON_ARRAY_SIZE]; - u8 POWER_POINTS[252]; - byte EVENT_PKMN[8][80]; - u8 TYPES[POKEMON_ARRAY_SIZE][2]; - u16 input_charset[256]; - u16 gen3_charset[256]; - - PokemonTables(); - - void load_exp_groups(); - void load_gender_ratios(); - void load_num_abilities(); - void load_first_moves(); - void load_power_points(); - void load_event_pkmn(); - void load_types(); - void load_input_charset(byte gen, byte lang); - void load_gen3_charset(byte lang); - - u32 get_max_exp(int index_num); - u8 get_gender_threshold(int index_num, bool is_gen_3); - bool get_num_abilities(int index_num); - bool can_learn_move(int pkmn_index, int move_index); - byte get_earliest_move(int index_num); - byte get_gen_3_char(u16 input_char); -}; - -/** - * Loads the charset for and into - */ -void load_localized_charset(u16 *output_char_array, byte gen, byte lang); -byte get_char_from_charset(const u16 *charset, u16 input_char); -#endif \ No newline at end of file diff --git a/include/pokemon_party.h b/include/pokemon_party.h index 50d0ef3..dd0b7e5 100644 --- a/include/pokemon_party.h +++ b/include/pokemon_party.h @@ -2,16 +2,17 @@ #define POKEMON_PARTY_H #include -#include "pokemon.h" +#include "pccs/PokeBox.h" #include "gb_rom_values/base_gb_rom_struct.h" class Pokemon_Party { public: Pokemon_Party(); + PokemonTables table; void start_link(); void continue_link(bool cancel_connection); int get_last_error(); - Pokemon get_converted_pkmn(PokemonTables &data_tables, int index); + bool load_gb_rom(Language lang, Game game); bool get_has_new_pkmn(); void set_game(int nGame); void set_lang(int nLang); @@ -19,17 +20,13 @@ public: bool load_gb_rom(); GB_ROM curr_gb_rom; void show_sprites(); - Simplified_Pokemon simple_pkmn_array[30]; - Simplified_Pokemon get_simple_pkmn(int index); - bool fill_simple_pkmn_array(PokemonTables &data_tables); bool get_contains_mythical(); void set_mythic_stabilization(bool stabilize); - bool contains_valid = false; - bool contains_invalid = false; int get_game_gen(); int get_num_pkmn(); bool get_contains_invalid(); bool get_contains_missingno(); + PokeBox box; byte box_data_array[0x462]; private: @@ -37,10 +34,7 @@ private: u8 current_payload[PAYLOAD_SIZE]; int last_error; - bool has_new_pkmn = false; - bool contains_mythical = false; bool stabilize_mythic = false; - bool contains_missingno = false; int game; char lang; }; diff --git a/include/save_data_manager.h b/include/save_data_manager.h index e493ab8..a94744e 100644 --- a/include/save_data_manager.h +++ b/include/save_data_manager.h @@ -17,7 +17,7 @@ #define DEFAULT_LANGUAGE 0x21 // | 0x22 | 1 | Default international language #define SAVE_DATA_SIZE 0x22 -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; void load_custom_save_data(); void write_custom_save_data(); diff --git a/include/script_array.h b/include/script_array.h index 3a30e83..6367cd4 100644 --- a/include/script_array.h +++ b/include/script_array.h @@ -23,7 +23,7 @@ #define CMD_CONTINUE_LINK DIA_END + 13 #define CMD_BOX_MENU DIA_END + 14 #define CMD_MYTHIC_MENU DIA_END + 15 -#define CMD_LOAD_SIMP DIA_END + 16 +#define CMD_IS_A_VALID_PKMN DIA_END + 16 #define CMD_CANCEL_LINK DIA_END + 17 #define CMD_END_MISSINGNO DIA_END + 18 @@ -61,7 +61,7 @@ extern const script_obj_params transfer_script_params[]; extern const script_obj_params event_script_params[]; -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; void populate_lang_menu(); void populate_game_menu(int lang); diff --git a/include/sprite_data.h b/include/sprite_data.h index 10f0fd5..b94f4ad 100644 --- a/include/sprite_data.h +++ b/include/sprite_data.h @@ -2,8 +2,6 @@ #define SPRITE_DATA_H #include -#include "pokemon.h" -#include "pokemon_data.h" #include "pokemon_party.h" #include "rom_data.h" #include "box_menu.h" @@ -112,7 +110,7 @@ extern OBJ_ATTR *grabbed_front_sprite; #define BG_MAIN_MENU 3 #define BG_BOX 4 -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; void load_sprite(OBJ_ATTR *sprite, const unsigned int objTiles[], int objTilesLen, u32 &tile_id, u32 pal_bank, int attr0, int attr1, u32 priority); @@ -124,7 +122,7 @@ void set_background_pal(int curr_rom_id, bool dark, bool fade); void load_textbox_background(); void load_flex_background(int background_id, int layer); void load_eternal_sprites(); -void load_temp_box_sprites(Pokemon_Party *party_data); +void load_temp_box_sprites(PokeBox* box); void load_type_sprites(const u8* pkmn_type_table, int pkmn_index, int dex_offset, bool is_caught); void add_menu_box(int options, int startTileX, int startTileY); void add_menu_box(int startTileX, int startTileY, int width, int height); @@ -135,6 +133,6 @@ void fennel_speak(int frame); int get_curr_flex_background(); void update_y_offset(); void erase_textbox_tiles(); -void update_front_box_sprite(Simplified_Pokemon *curr_pkmn); -void update_menu_sprite(Pokemon_Party *party_data, int index, int frame); +void update_front_box_sprite(GBPokemon *curr_pkmn); +void update_menu_sprite(PokeBox* box, int index, int frame); #endif \ No newline at end of file diff --git a/payload_builder copy.cpp b/payload_builder copy.cpp new file mode 100644 index 0000000..3cf5357 --- /dev/null +++ b/payload_builder copy.cpp @@ -0,0 +1,996 @@ +#include "payloads/payload_builder.h" +#include "gb_rom_values/base_gb_rom_struct.h" +#include "payloads/z80_asm.h" +#include "../../../include/debug_mode.h" +#include + +#define DATA_LOC (SHOW_DATA_PACKETS ? curr_rom.transferStringLocation : curr_rom.wEnemyMonSpecies) +#define DEBUG_PAYLOADS (false && DEBUG_MODE) + +void init_payload(byte *payload_buffer, const GB_ROM &curr_rom, int type, bool debug) +{ + if (DEBUG_PAYLOADS) + { + debug = true; + } + + (void)type; + /* 10 RNG bytes + 8 Preamble bytes + 418 / 441 Party bytes + 7 Preamble bytes + 194 Patch list bytes (last 2 are unused) + + 637 / 660 total bytes + */ + if ((curr_rom.generation == 1 && curr_rom.version != YELLOW_ID)) + { + std::vector jump_vector; + std::vector var_vector; + + z80_asm_handler z80_rng_seed(0x0A, curr_rom.wSerialOtherGameboyRandomNumberListBlock + 8); + z80_asm_handler z80_payload(0x1AA, curr_rom.wSerialEnemyDataBlock); + z80_asm_handler z80_patchlist(0xC9, curr_rom.wSerialEnemyMonsPatchList); + + z80_jump asm_start(&jump_vector); + z80_jump save_box(&jump_vector); + z80_jump remove_array_loop(&jump_vector); + z80_jump packet_loop(&jump_vector); + z80_jump fe_bypass(&jump_vector); + z80_jump send_packet_loop(&jump_vector); + + z80_variable array_counter(&var_vector, 1, 0x00); // 1 byte to store the current array counter + z80_variable removal_array(&var_vector); // 40 byte storage for list of Pokemon to remove, plus a permanent array terminator + + byte removal_array_data[41]; + for (int i = 0; i < 41; i++) + { + if (debug) + { + removal_array_data[i] = (i < 30 ? (29 - i) : 0xFF); + } + else + { + removal_array_data[i] = (i < 30 ? 0xFD : 0xFF); + } + } + removal_array.load_data(41, removal_array_data); + z80_variable transfer_wait_string(&var_vector, 13, // SENDING DATA + 0x92, 0x84, 0x8D, 0x83, 0x88, 0x8D, 0x86, 0x7F, 0x83, 0x80, 0x93, 0x80, 0x50); + z80_variable custom_name(&var_vector, 11, // FENNEL + 0x85, 0x84, 0x8D, 0x8D, 0x84, 0x8B, 0x50, 0x50, 0x50, 0x50, 0x50); + + // RNG Seed + // Location of the entrance vector + z80_rng_seed.index = 5; // Set the entrance vector + z80_rng_seed.JP(asm_start.place_direct_jump(&z80_rng_seed) | T_U16); + + // Preamble + // At 0x00, 0x07 in length + // Must be filled with 0xFD + for (int i = 0; i < 7; i++) + { + z80_payload.add_byte(0xFD); + } + + // Rival name + // At 0x07, 0x0B in length + // Set to stored name + z80_payload.index = 0x07; + custom_name.insert_variable(&z80_payload); + + // Number of Pokemon + // At 0x12, 0x01 in length + // Does not need to be set + z80_payload.index = 0x12; + z80_payload.add_byte(0x06); + + // Pokemon list + // At 0x13, can be up to 0x1A2 / 0x1B9 bytes in length. + // Calculate the number of Pokemon names that need to be printed, + // and add them to the list. Then terminate the list. + z80_payload.index = 0x13; + int distance = curr_rom.stack_overwrite_location - curr_rom.print_string_start; + distance /= 20; // Automatically truncated, so it won't overshoot + + for (int i = 0; i < distance; i++) + { + z80_payload.add_byte(curr_rom.short_pkmn_name); + } + z80_payload.add_byte(curr_rom.pointer_pkmn_name); + z80_payload.add_byte(0xFF); + + // Patchlist preamble + // At 0x1B4 / 0x1D7, 0x07 in length + // Set as five 0xFD and two 0xFF + + for (int i = 0; i < 7; i++) + { + z80_patchlist.add_byte(i < 5 ? 0xFD : 0xFF); + } + + // Patchlist + // At 0x1BB / 0x1DE, 0xC2 in length (0xC4, but the last 2 are unused) + // Fill with custom code + asm_start.set_start(&z80_patchlist); + + /* Write transferring message to screen: */ + // call ClearScreen + z80_patchlist.CALL(curr_rom.clearScreen | T_U16); + z80_patchlist.LD(HL, curr_rom.textBorderUppLeft | T_U16); + z80_patchlist.LD(C, curr_rom.textBorderWidth | T_U8); + z80_patchlist.LD(B, curr_rom.textBorderHeight | T_U8); + z80_patchlist.CALL(curr_rom.CableClub_TextBoxBorder | T_U16); + z80_patchlist.LD(HL, curr_rom.transferStringLocation | T_U16); + z80_patchlist.LD(DE, transfer_wait_string.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.CALL(curr_rom.placeString | T_U16); + + /* Build the packet */ + // HL is the current data pointer + // DE is the destination pointer + // A is the checksum + // B is the 0xFE flag byte + // C is the counter + send_packet_loop.set_start(&z80_patchlist); + + z80_patchlist.LD(HL, (DATA_LOC + PACKET_SIZE + 3) | T_U16); // Load the next data location into HL + z80_patchlist.LD(A, HLI_PTR); + z80_patchlist.LD(H, HL_PTR); + z80_patchlist.LD(L, A); + z80_patchlist.LD(DE, (DATA_LOC + 2) | T_U16); // Enemy Pokemon data, should be unused + z80_patchlist.XOR(A, A); // Clear the register + z80_patchlist.LD(B, A); // Clear B as well + z80_patchlist.LD(C, A); // Clear C as well + z80_patchlist.PUSH(AF); + packet_loop.set_start(&z80_patchlist); + z80_patchlist.LD(B, 0x00 | T_U8); // Reset the flag byte + z80_patchlist.POP(AF); + z80_patchlist.ADD(A, HL_PTR); // Add the current data to the checksum + z80_patchlist.PUSH(AF); + z80_patchlist.LD(A, 0xFE); + z80_patchlist.CP(A, HL_PTR); // Compare the current data to 0xFE + z80_patchlist.LD(A, HLI_PTR); // Load HL's data into A for modification (if need be) + + // If HL's data is 0xFE + z80_patchlist.JR(NZ_F, fe_bypass.place_relative_jump(&z80_patchlist) | T_I8); + z80_patchlist.DEC(A); + z80_patchlist.INC(B); // Set flag + + fe_bypass.set_start(&z80_patchlist); + z80_patchlist.LD(DE_PTR, A); // Place the data in + z80_patchlist.INC(DE); + z80_patchlist.PUSH(AF); + z80_patchlist.LD(A, B); + z80_patchlist.LD(DE_PTR, A); // Place the flag in as well + z80_patchlist.POP(AF); + z80_patchlist.INC(DE); + z80_patchlist.INC(C); + z80_patchlist.LD(A, DATA_PER_PACKET - 1); + z80_patchlist.CP(A, C); + z80_patchlist.JR(NC_F, packet_loop.place_relative_jump(&z80_patchlist) | T_I8); // If all the data has been set, send the rest of the data + z80_patchlist.POP(AF); + z80_patchlist.RES(7 | T_BIT, A); // Reset bit 7 of the checksum, guaranteeing that it will never be 0xFE + z80_patchlist.LD(DE_PTR, A); + z80_patchlist.INC(DE); + z80_patchlist.LD(A, H); + z80_patchlist.LD(DE_PTR, A); + z80_patchlist.INC(DE); + z80_patchlist.LD(A, L); + z80_patchlist.LD(DE_PTR, A); + + // z80_patchlist.LD(HL, curr_rom.garbageDataLocation | T_U16); + + /* Transfer box data packet: */ + z80_patchlist.LD(A, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_patchlist.LDH((curr_rom.hSerialConnectionStatus & 0xFF) | T_U8, A); // Since hSerialConnectionStatus is at 0xFFxx we can use this method instead + z80_patchlist.LD(HL, DATA_LOC | T_U16); + z80_patchlist.LD(HL_PTR, 0xFD | T_U8); // set the start of the data to 0xFD so Serial_ExchangeBytes is happy + z80_patchlist.INC(HL); + z80_patchlist.LD(HL_PTR, 0x00 | T_U8); // add a 0x00 after the 0xFD to prevent further 0xFDs from being interpreted as part of the preamble + z80_patchlist.DEC(HL); // Reset HL back so it points to 0xFD + z80_patchlist.LD(DE, (DATA_LOC + PACKET_SIZE) | T_U16); // location to put stored data + z80_patchlist.LD(BC, PACKET_SIZE | T_U16); + if (debug) // Don't call serialExchangeBytes if debug is enabled + { + z80_patchlist.index += 3; + } + else + { + z80_patchlist.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + z80_patchlist.LD(A, (DATA_LOC + PACKET_SIZE + 3 + 1) | T_U16); + z80_patchlist.CP(A, 0xFF); + z80_patchlist.JR(NZ_F, send_packet_loop.place_relative_jump(&z80_patchlist) | T_I8); + + /* Recieve the Pokemon to remove */ + z80_patchlist.LD(HL, curr_rom.hSerialConnectionStatus | T_U16); // This can also be shortened + z80_patchlist.LD(HL_PTR, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_patchlist.LD(HL, curr_rom.garbageDataLocation | T_U16); + z80_patchlist.LD(DE, removal_array.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.LD(BC, 0x001E | T_U16); // Preamble does *not* count + if (debug) // Don't add in the Serial_ExchangeBytes call if in debug + { + z80_patchlist.index += 3; + } + else + { + z80_patchlist.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + /* Remove the transfered Pokemon */ + z80_patchlist.LD(HL, curr_rom.wRemoveMonFromBox | T_U16); + z80_patchlist.LD(HL_PTR, 0x01 | T_U8); // != 0x00 specifies the current box + remove_array_loop.set_start(&z80_patchlist); + z80_patchlist.LD(A, array_counter.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.LD(E, A); + z80_patchlist.LD(D, 0x00 | T_U8); + z80_patchlist.LD(HL, removal_array.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.ADD(HL, DE); + z80_patchlist.INC(A); + z80_patchlist.LD(array_counter.place_ptr(&z80_patchlist) | T_U16, A); + z80_patchlist.LD(A, curr_rom.wBoxCount | T_U16); + z80_patchlist.LD(B, A); + z80_patchlist.LD(A, HL_PTR); + z80_patchlist.CP(A, 0xFF | T_U8); + z80_patchlist.JR(Z_F, save_box.place_relative_jump(&z80_patchlist) | T_I8); + z80_patchlist.CP(A, B); + z80_patchlist.JR(NC_F, remove_array_loop.place_relative_jump(&z80_patchlist) | T_I8); + z80_patchlist.LD(HL, curr_rom.wWhichPokemon | T_U16); + z80_patchlist.LD(HL_PTR, A); + if (DONT_REMOVE_PKMN) + { + z80_patchlist.index += 3; + } + else + { + z80_patchlist.CALL(curr_rom._RemovePokemon | T_U16); + } + z80_patchlist.JR((remove_array_loop.place_relative_jump(&z80_patchlist) & 0xFF) | T_I8); + + /* Save the current box */ + save_box.set_start(&z80_patchlist); + z80_patchlist.LD(B, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); // Load ROM Bank + z80_patchlist.LD(HL, curr_rom.SaveSAVtoSRAM1 | T_U16); + z80_patchlist.CALL(curr_rom.Bankswitch | T_U16); + z80_patchlist.LD(B, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); // Load ROM Bank + z80_patchlist.LD(HL, curr_rom.SaveSAVtoSRAM2 | T_U16); // TODO: We probably don't have to load the ROM bank twice + z80_patchlist.CALL(curr_rom.Bankswitch | T_U16); + z80_patchlist.JP(curr_rom.SoftReset | T_U16); + + // z80_patchlist.index += 5; + + array_counter.insert_variable(&z80_patchlist); + removal_array.insert_variable(&z80_payload); + transfer_wait_string.insert_variable(&z80_patchlist); + + // This payload works by placing Pokemon ID 0xFC's name in the stack, and causing a return to CD8E, + // which is part of the RNG seed. From there we can jump anywhere- and we choose to jump to D887, + // which is the rival's name. This code fixes the stack and jumps to the patchlist, which is where + // our final code is. + + // Update all the pointers + for (unsigned int i = 0; i < var_vector.size(); i++) + { + var_vector.at(i)->update_ptrs(); + } + for (unsigned int i = 0; i < jump_vector.size(); i++) + { + jump_vector.at(i)->update_jumps(); + } + + // Combine the vectors into the full payload + u8 *cur_out = payload_buffer; + memcpy(cur_out, z80_rng_seed.data_vector.data(), z80_rng_seed.data_vector.size()); + cur_out += z80_rng_seed.data_vector.size(); + memcpy(cur_out, z80_payload.data_vector.data(), z80_payload.data_vector.size()); + cur_out += z80_payload.data_vector.size(); + memcpy(cur_out, z80_patchlist.data_vector.data(), z80_patchlist.data_vector.size()); + cur_out += z80_patchlist.data_vector.size(); + + return; + } + + else if ((curr_rom.generation == 1 && curr_rom.version == YELLOW_ID)) + { + std::vector jump_vector; + std::vector var_vector; + + z80_asm_handler z80_rng_seed(0x0A, curr_rom.wSerialOtherGameboyRandomNumberListBlock + 8); + z80_asm_handler z80_payload(0x1AA, curr_rom.wSerialEnemyDataBlock - 8); // Subtracting 8 is because the data is shifted after patching, removing part of the enemy name. May change depending on language + z80_asm_handler z80_patchlist(0xC9, curr_rom.wSerialEnemyMonsPatchList); + + z80_jump asm_start(&jump_vector); + z80_jump save_box(&jump_vector); + z80_jump remove_array_loop(&jump_vector); + z80_jump packet_loop(&jump_vector); + z80_jump fe_bypass(&jump_vector); + z80_jump send_packet_loop(&jump_vector); + z80_jump skip_enemy_write(&jump_vector); + + z80_jump test_loop(&jump_vector); + + z80_variable array_counter(&var_vector, 1, 0x00); // 1 byte to store the current array counter + z80_variable removal_array(&var_vector); // 40 byte storage for list of Pokemon to remove, plus a permanent array terminator + + byte removal_array_data[41]; + for (int i = 0; i < 41; i++) + { + if (debug) + { + removal_array_data[i] = (i < 30 ? (29 - i) : 0xFF); + } + else + { + removal_array_data[i] = (i < 30 ? 0xFD : 0xFF); + } + } + removal_array.load_data(41, removal_array_data); + z80_variable transfer_wait_string(&var_vector, 13, // SENDING DATA + 0x92, 0x84, 0x8D, 0x83, 0x88, 0x8D, 0x86, 0x7F, 0x83, 0x80, 0x93, 0x80, 0x50); + z80_variable custom_name(&var_vector, 11, // FENNEL + 0x85, 0x84, 0x8D, 0x8D, 0x84, 0x8B, 0x50, 0x50, 0x50, 0x50, 0x50); + + // RNG Seed: + // at 0x00, 0x0A in length + // Can be empty + + // Preamble + // At 0x00, 0x07 in length + // Must be filled with 0xFD + for (int i = 0; i < 7; i++) + { + z80_payload.add_byte(0xFD); + } + + // Rival name + // At 0x07, 0x0B in length + // Set to stored name + z80_payload.index = 0x07; + custom_name.insert_variable(&z80_payload); + + // Number of Pokemon + // At 0x12, 0x01 in length + // 2 or higher, 0xE8 for JPN + z80_payload.index = 0x12; + z80_payload.add_byte(0x02); + + // Pokemon list + // At 0x13, is usually 6 bytes and 1 terminator + for (int i = 0; i < 7; i++) + { + z80_payload.add_byte(i < 6 ? i + 1 : 0xFF); + } + + // Pokemon data + // Specific for each language + + // Mon #1 HP + z80_payload.add_bytes(2, + 0x00, 0x00); + + // Mon #2 data + z80_payload.index = 0x46; + z80_payload.add_bytes(9, + 0x4E, 0x4E, 0x4E, 0x00, 0x01, 0x80, 0x80, 0xD4, 0xCF); + + z80_payload.add_bytes(2, asm_start.place_pointer(&z80_payload), 0x00); // These values must not have any control characters in them. + + z80_payload.add_bytes(33, + 0x4E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x4E, 0x50, 0x00, 0x00, + 0x00, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x59); + + // Mon #2 name + z80_payload.index = 0x16F; + for (int i = 0; i < 11; i++) + { + z80_payload.add_byte(0x4E); + } + + // Now that the ACE has been set up, we can use the space between Mon #2's data and Mon #2's name to put our code. + // Since this space is larger than the patchlist, we will be able to fit everything in it + + // Patchlist preamble + // At 0x1B4 0x07 in length + // Set as five 0xFD, the 0xFF will be added as part of the patch list. + for (int i = 0; i < 5; i++) + { + z80_patchlist.add_byte(0xFD); + } + + z80_payload.index = 0x72; + + array_counter.insert_variable(&z80_payload); + removal_array.insert_variable(&z80_payload); + transfer_wait_string.insert_variable(&z80_payload); + + asm_start.set_start(&z80_payload); + + z80_payload.CALL(0x2233 | T_U16); // Stop the battle music + + /* Write transferring message to screen: */ + // call ClearScreen + z80_payload.CALL(curr_rom.clearScreen | T_U16); + z80_payload.LD(HL, curr_rom.textBorderUppLeft | T_U16); + z80_payload.LD(C, curr_rom.textBorderWidth | T_U8); + z80_payload.LD(B, curr_rom.textBorderHeight | T_U8); + z80_payload.CALL(curr_rom.CableClub_TextBoxBorder | T_U16); + z80_payload.LD(HL, curr_rom.transferStringLocation | T_U16); + z80_payload.LD(DE, transfer_wait_string.place_ptr(&z80_payload) | T_U16); + z80_payload.CALL(curr_rom.placeString | T_U16); + z80_payload.JR(skip_enemy_write.place_relative_jump(&z80_payload) | T_I8); // This is a simple way to avoid the enemy name placement. Might have to modify for other languages + + z80_payload.index = 0xCA; + + skip_enemy_write.set_start(&z80_payload); + + // Reload the save data to remove any data that was overwritten during exploit entry + z80_payload.LD(B, (curr_rom.LoadCurrentBoxData >> 16) | T_U8); + z80_payload.LD(HL, curr_rom.LoadCurrentBoxData | T_U16); + z80_payload.CALL(curr_rom.Bankswitch | T_U16); + if (!debug) + { + /* Build the packet */ + // HL is the current data pointer + // DE is the destination pointer + // A is the checksum + // B is the 0xFE flag byte + // C is the counter + send_packet_loop.set_start(&z80_payload); + + z80_payload.LD(HL, (DATA_LOC + PACKET_SIZE + 3) | T_U16); // Load the next data location into HL + z80_payload.LD(A, HLI_PTR); + z80_payload.LD(H, HL_PTR); + z80_payload.LD(L, A); + z80_payload.LD(DE, (DATA_LOC + 2) | T_U16); // Enemy Pokemon data, should be unused + z80_payload.XOR(A, A); // Clear the register + z80_payload.LD(B, A); // Clear B as well + z80_payload.LD(C, A); // Clear C as well + z80_payload.PUSH(AF); + packet_loop.set_start(&z80_payload); + z80_payload.LD(B, 0x00 | T_U8); // Reset the flag byte + z80_payload.POP(AF); + z80_payload.ADD(A, HL_PTR); // Add the current data to the checksum + z80_payload.PUSH(AF); + z80_payload.LD(A, 0xFE); + z80_payload.CP(A, HL_PTR); // Compare the current data to 0xFE + z80_payload.LD(A, HLI_PTR); // Load HL's data into A for modification (if need be) + + // If HL's data is 0xFE + z80_payload.JR(NZ_F, fe_bypass.place_relative_jump(&z80_payload) | T_I8); + z80_payload.DEC(A); + z80_payload.INC(B); // Set flag + + fe_bypass.set_start(&z80_payload); + z80_payload.LD(DE_PTR, A); // Place the data in + z80_payload.INC(DE); + z80_payload.PUSH(AF); + z80_payload.LD(A, B); + z80_payload.LD(DE_PTR, A); // Place the flag in as well + z80_payload.POP(AF); + z80_payload.INC(DE); + z80_payload.INC(C); + z80_payload.LD(A, DATA_PER_PACKET - 1); + z80_payload.CP(A, C); + z80_payload.JR(NC_F, packet_loop.place_relative_jump(&z80_payload) | T_I8); // If all the data has been set, send the rest of the data + z80_payload.POP(AF); + z80_payload.RES(7 | T_BIT, A); // Reset bit 7 of the checksum, guaranteeing that it will never be 0xFE + z80_payload.LD(DE_PTR, A); + z80_payload.INC(DE); + z80_payload.LD(A, H); + + z80_payload.LD(DE_PTR, A); + z80_payload.INC(DE); + z80_payload.LD(A, L); + z80_payload.LD(DE_PTR, A); + + /* Transfer box data packet: */ + z80_payload.LD(A, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_payload.LDH((curr_rom.hSerialConnectionStatus & 0xFF) | T_U8, A); // Since hSerialConnectionStatus is at 0xFFxx we can use this method instead + z80_payload.LD(HL, DATA_LOC | T_U16); + z80_payload.LD(HL_PTR, 0xFD | T_U8); // set the start of the data to 0xFD so Serial_ExchangeBytes is happy + z80_payload.INC(HL); + z80_payload.LD(HL_PTR, 0x00 | T_U8); // add a 0x00 after the 0xFD to prevent further 0xFDs from being interpreted as part of the preamble + z80_payload.DEC(HL); // Reset HL back so it points to 0xFD + z80_payload.LD(DE, (DATA_LOC + PACKET_SIZE) | T_U16); // location to put stored data + z80_payload.LD(BC, PACKET_SIZE | T_U16); + if (debug) // Don't call serialExchangeBytes if debug is enabled + { + z80_payload.index += 3; + } + else + { + z80_payload.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + z80_payload.LD(A, (DATA_LOC + PACKET_SIZE + 3 + 1) | T_U16); + z80_payload.CP(A, 0xFF); + if (debug && false) // Don't compare the "recieved" data if in debug + { + z80_payload.index += 2; + } + else + { + z80_payload.JR(NZ_F, send_packet_loop.place_relative_jump(&z80_payload) | T_I8); + } + } + /* Recieve the Pokemon to remove */ + z80_payload.LD(HL, curr_rom.hSerialConnectionStatus | T_U16); // This can also be shortened + z80_payload.LD(HL_PTR, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_payload.LD(HL, curr_rom.garbageDataLocation | T_U16); + z80_payload.LD(DE, removal_array.place_ptr(&z80_payload) | T_U16); + z80_payload.LD(BC, 0x001E | T_U16); // Preamble does *not* count + if (debug) // Don't add in the Serial_ExchangeBytes call if in debug + { + z80_payload.index += 3; + } + else + { + z80_payload.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + /* Remove the transfered Pokemon */ + z80_payload.LD(HL, curr_rom.wRemoveMonFromBox | T_U16); + z80_payload.LD(HL_PTR, 0x01 | T_U8); // != 0x00 specifies the current box + remove_array_loop.set_start(&z80_payload); + z80_payload.LD(A, array_counter.place_ptr(&z80_payload) | T_U16); + z80_payload.LD(E, A); + z80_payload.LD(D, 0x00 | T_U8); + z80_payload.LD(HL, removal_array.place_ptr(&z80_payload) | T_U16); + z80_payload.ADD(HL, DE); + z80_payload.INC(A); + z80_payload.LD(array_counter.place_ptr(&z80_payload) | T_U16, A); + z80_payload.LD(A, curr_rom.wBoxCount | T_U16); + z80_payload.LD(B, A); + z80_payload.LD(A, HL_PTR); + z80_payload.CP(A, 0xFF | T_U8); + z80_payload.JR(Z_F, save_box.place_relative_jump(&z80_payload) | T_I8); + z80_payload.CP(A, B); + z80_payload.JR(NC_F, remove_array_loop.place_relative_jump(&z80_payload) | T_I8); + z80_payload.LD(HL, curr_rom.wWhichPokemon | T_U16); + z80_payload.LD(HL_PTR, A); + if (DONT_REMOVE_PKMN) + { + z80_payload.index += 3; + } + else + { + z80_payload.LD(B, (curr_rom._RemovePokemon >> 16) | T_U8); // Load ROM Bank + z80_payload.LD(HL, curr_rom._RemovePokemon | T_U16); + z80_payload.CALL(curr_rom.Bankswitch | T_U16); + } + z80_payload.JR((remove_array_loop.place_relative_jump(&z80_payload) & 0xFF) | T_I8); + + // We need to move this in order to not corrupt the 4E's + z80_payload.JR((save_box.place_relative_jump(&z80_payload) & 0xFF) | T_I8); + z80_payload.index = 0x17A; + + /* Save the current box */ + save_box.set_start(&z80_payload); + z80_payload.LD(B, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); // Load ROM Bank + z80_payload.LD(HL, curr_rom.SaveSAVtoSRAM1 | T_U16); + z80_payload.CALL(curr_rom.Bankswitch | T_U16); + z80_payload.CALL(curr_rom.SaveSAVtoSRAM2 | T_U16); // The bank is already loaded, we don't have to load it again + z80_payload.JP(curr_rom.SoftReset | T_U16); + + // z80_payload.index += 5; + + // Patchlist + // At 0x1BB / 0x1DE, 0xC2 in length (0xC4, but the last 2 are unused) + z80_patchlist.generate_patchlist(&z80_payload); + + // This payload works by placing Pokemon ID 0xFC's name in the stack, and causing a return to CD8E, + // which is part of the RNG seed. From there we can jump anywhere- and we choose to jump to D887, + // which is the rival's name. This code fixes the stack and jumps to the patchlist, which is where + // our final code is. + + // Update all the pointers + for (unsigned int i = 0; i < var_vector.size(); i++) + { + var_vector.at(i)->update_ptrs(); + } + for (unsigned int i = 0; i < jump_vector.size(); i++) + { + jump_vector.at(i)->update_jumps(); + } + + // Combine the vectors into the full payload + u8 *cur_out = payload_buffer; + memcpy(cur_out, z80_rng_seed.data_vector.data(), z80_rng_seed.data_vector.size()); + cur_out += z80_rng_seed.data_vector.size(); + memcpy(cur_out, z80_payload.data_vector.data(), z80_payload.data_vector.size()); + cur_out += z80_payload.data_vector.size(); + memcpy(cur_out, z80_patchlist.data_vector.data(), z80_patchlist.data_vector.size()); + cur_out += z80_patchlist.data_vector.size(); + + return; + + /* + else if (type == EVENT) + { + // ld a, $03 + payload_storage[offset++] = 0x3A; + payload_storage[offset++] = 0x03; + + // call OpenSRAM + payload_storage[offset++] = 0xC3; + payload_storage[offset++] = (curr_rom.OpenSRAM >> 0) & 0xFF; + payload_storage[offset++] = (curr_rom.OpenSRAM >> 8) & 0xFF; + + // ld de, $BEB0 + payload_storage[offset++] = 0x11; + payload_storage[offset++] = 0xB0; + payload_storage[offset++] = 0xBE; + + // ld bc, $150 + payload_storage[offset++] = 0x01; + payload_storage[offset++] = 0x50; + payload_storage[offset++] = 0x01; + + // ld hl, ??? + payload_storage[offset++] = 0x21; + payload_storage[offset++] = 0x00; + payload_storage[offset++] = 0x00; + + // CUSTOM EVENT SCRIPT: + // Start with the table data + int init_offset = offset; + insert_ext_copy_cmd(&offset, 0x11410E, 0xD930, 18); // Copy text pointers + insert_ext_copy_cmd(&offset, 0x00C120, 0xC140, 10); // + insert_ext_copy_cmd(&offset, 0x00C220, 0xC240, 16); // + byte temp[] = {0xD0, 0x0A}; + insert_int_copy_cmd(&offset, 0xD4E9, 2, temp); // + byte temp1[] = {0x15, 0x05}; + insert_int_copy_cmd(&offset, 0xD517, 2, temp1); // + byte temp2[] = {0x30, 0xD9}; + insert_int_copy_cmd(&offset, 0xD36B, 2, temp2); // + byte temp3[] = {0x0B, 0xF0, 0xFF}; + insert_int_copy_cmd(&offset, 0xD5D3, 3, temp3); // + byte temp4[] = {0x05}; + insert_int_copy_cmd(&offset, 0xD4E0, 1, temp4); // + byte temp5[] = {0x44, 0xD9, 0x08, 0x21, 0x54, 0xD9, 0xCD, 0x68, 0x31, 0x21, 0xB0, 0xC1, 0x00, 0x00, 0xC3, 0xD2, 0x23, 0x01, 0x00, 0x5E, 0xD8, 0xD8, 0xC9, 0xD8, 0xC9, 0xD8, 0xC9, 0xD8, 0xC9, 0x00, 0x8C, 0xB8, 0xB4, 0xB4, 0xE7, 0x50, 0x08, 0x3E, 0x83, 0xCD, 0x8B, 0x11, 0xCD, 0x3E, 0x37, 0xC3, 0xD2, 0x23}; + insert_int_copy_cmd(&offset, 0xD942, 48, temp5); // + payload_storage[offset++] = 0xFF; + + + // call CloseSRAM + payload_storage[offset++] = 0xC3; + payload_storage[offset++] = (curr_rom.CloseSRAM >> 0) & 0xFF; + payload_storage[offset++] = (curr_rom.CloseSRAM >> 8) & 0xFF; + + // call SoftReset + payload_storage[offset++] = 0xC3; + payload_storage[offset++] = (curr_rom.SoftReset >> 0) & 0xFF; + payload_storage[offset++] = (curr_rom.SoftReset >> 8) & 0xFF; + + }*/ + } + + else if (curr_rom.generation == 2) + { + std::vector jump_vector; + std::vector var_vector; + + z80_asm_handler z80_rng_seed(0x0A, curr_rom.wSerialOtherGameboyRandomNumberListBlock); + z80_asm_handler z80_payload(0x1CD, curr_rom.wSerialEnemyDataBlock); // wOTPartyData + z80_asm_handler z80_patchlist(0xC9, curr_rom.wSerialEnemyMonsPatchList); // wOTPatchLists + + /* + Initally the entire wLinkData is copied into the data section at D26B. + then, CopyBytes is called four times within link.skip_mail: + 1. It copies 0xB bytes from wLinkData to wOTPlayerName (D26B) + 2. It copies 0x8 bytes from where the previous one ended (D280) to wOTPartyCount + 3. It copies 0x2 bytes from where the previous one ended (D276) to wOTPlayerID + 4. It copies 0x1A4 bytes from where the previous one ended (D288) to wOTPartyMons + + 8 bytes aren't overwritten when copied over (D278-D28F), which is where the weird offset comes from. These bytes are index 0xE through 0x15 in the original data + By having 9 bytes of 0xFD, the offset ends up working out correctly. + */ + + z80_jump asm_start(&jump_vector); + z80_jump save_box(&jump_vector); + z80_jump remove_array_loop(&jump_vector); + z80_jump jump_to_party(&jump_vector); + z80_jump jump_to_payload(&jump_vector); + z80_jump packet_loop(&jump_vector); + z80_jump fe_bypass(&jump_vector); + z80_jump send_packet_loop(&jump_vector); + + z80_variable array_counter(&var_vector, 1, 0x00); // 1 byte to store the current array counter + z80_variable removal_array(&var_vector); // 40 byte storage for list of Pokemon to remove, plus a permanent array terminator + byte removal_array_data[41]; + for (int i = 0; i < 41; i++) + { + if (debug) + { + removal_array_data[i] = (i < 30 ? (29 - i) : 0xFF); + } + else + { + removal_array_data[i] = (i < 30 ? 0xFD : 0xFF); + } + } + removal_array.load_data(41, removal_array_data); + z80_variable transfer_wait_string(&var_vector, 13, // SENDING DATA + 0x92, 0x84, 0x8D, 0x83, 0x88, 0x8D, 0x86, 0x7F, 0x83, 0x80, 0x93, 0x80, 0x50); + z80_variable custom_name(&var_vector, 11, // FENNEL + 0x85, 0x84, 0x8D, 0x8D, 0x84, 0x8B, 0x50, 0x50, 0x50, 0x50, 0x50); + + // RNG Seed: + // at 0x00, 0x0A in length + // Does not need to be set + + // Preamble + // At 0x00, 0x09 in length + // Must be filled with 0xFD + for (int i = 0; i < 9; i++) + { + z80_payload.add_byte(0xFD); + } + + // Preamble/Rival name + // At 0x00, 0x1C5 in length + // Set to stored name + int distance = curr_rom.stack_overwrite_location - curr_rom.print_string_start; + int remainder = distance % 40; + distance /= 40; // Automatically truncated, so it won't overshoot + distance -= 8; // There will be 8 extra bytes due to how the copy functions work. + + for (int i = 0; i < distance; i++) + { + z80_payload.add_byte(curr_rom.short_pkmn_name); + } + for (int i = 0; i < remainder; i++) + { + z80_payload.add_byte(0x80); + } + + z80_payload.index -= 1; // Prep for the direct jump, since it usually has to jump forward one for the ASM call + jump_to_payload.place_direct_jump(&z80_payload); + z80_payload.index += 3; + z80_payload.add_byte(0x50); // String terminator + + // Saving the box overwrites our code, so we need to move it here. + jump_to_party.set_start(&z80_payload); + z80_payload.LD(A, curr_rom.SaveBox >> 16 | T_U8); + z80_payload.RST(0x10); // Bank switch + z80_payload.CALL(curr_rom.SaveBox | T_U16); + + z80_payload.JP(curr_rom.SoftReset | T_U16); + + // Patchlist preamble + // At 0x1B4 / 0x1D7, 0x07 in length + // Set as five 0xFD and two 0xFF + + for (int i = 0; i < 7; i++) + { + z80_patchlist.add_byte(i < 5 ? 0xFD : 0xFF); + } + + // Patchlist + // At 0x1DE, 194 in length + // Fill with custom code + + // Write transferring message to screen: + // call ClearScreen + jump_to_payload.set_start(&z80_patchlist); + z80_patchlist.CALL(curr_rom.clearScreen | T_U16); + + z80_patchlist.LD(HL, curr_rom.textBorderUppLeft | T_U16); + z80_patchlist.LD(C, curr_rom.textBorderWidth | T_U8); + z80_patchlist.LD(B, curr_rom.textBorderHeight | T_U8); + z80_patchlist.LD(A, curr_rom.CableClub_TextBoxBorder >> 16 | T_U8); + z80_patchlist.RST(0x10); // Bank switch + z80_patchlist.CALL(curr_rom.CableClub_TextBoxBorder | T_U16); + z80_patchlist.LD(HL, curr_rom.transferStringLocation | T_U16); + z80_patchlist.LD(DE, transfer_wait_string.place_ptr(&z80_patchlist) | T_U16); + + // call PlaceString + z80_patchlist.CALL(curr_rom.placeString | T_U16); + + // call OpenSRAM + z80_patchlist.LD(A, 0x01 | T_U8); + z80_patchlist.CALL(curr_rom.OpenSRAM | T_U16); + + /* Build the packet */ + // HL is the current data pointer + // DE is the destination pointer + // A is the checksum + // B is the 0xFE flag byte + // C is the counter + send_packet_loop.set_start(&z80_patchlist); + + z80_patchlist.LD(HL, (DATA_LOC + PACKET_SIZE + 3) | T_U16); // Load the next data location into HL + z80_patchlist.LD(A, HLI_PTR); + z80_patchlist.LD(H, HL_PTR); + z80_patchlist.LD(L, A); + + z80_patchlist.LD(DE, (DATA_LOC + 2) | T_U16); // Enemy Pokemon data, should be unused + z80_patchlist.XOR(A, A); // Clear the register + z80_patchlist.LD(B, A); // Clear B as well + z80_patchlist.LD(C, A); // Clear C as well + z80_patchlist.PUSH(AF); + packet_loop.set_start(&z80_patchlist); + z80_patchlist.LD(B, 0x00 | T_U8); // Reset the flag byte + z80_patchlist.POP(AF); + z80_patchlist.ADD(A, HL_PTR); // Add the current data to the checksum + z80_patchlist.PUSH(AF); + z80_patchlist.LD(A, 0xFE); + z80_patchlist.CP(A, HL_PTR); // Compare the current data to 0xFE + z80_patchlist.LD(A, HLI_PTR); // Load HL's data into A for modification (if need be) + + // If HL's data is 0xFE + z80_patchlist.JR(NZ_F, fe_bypass.place_relative_jump(&z80_patchlist) | T_I8); + z80_patchlist.DEC(A); + z80_patchlist.INC(B); // Set flag + + fe_bypass.set_start(&z80_patchlist); + z80_patchlist.LD(DE_PTR, A); // Place the data in + z80_patchlist.INC(DE); + z80_patchlist.PUSH(AF); + z80_patchlist.LD(A, B); + z80_patchlist.LD(DE_PTR, A); // Place the flag in as well + z80_patchlist.POP(AF); + z80_patchlist.INC(DE); + z80_patchlist.INC(C); + z80_patchlist.LD(A, DATA_PER_PACKET - 1); + z80_patchlist.CP(A, C); + z80_patchlist.JR(NC_F, packet_loop.place_relative_jump(&z80_patchlist) | T_I8); // If all the data has been set, send the rest of the data + z80_patchlist.POP(AF); + z80_patchlist.RES(7 | T_BIT, A); // Reset bit 7 of the checksum, guaranteeing that it will never be 0xFE + z80_patchlist.LD(DE_PTR, A); + z80_patchlist.INC(DE); + z80_patchlist.LD(A, H); + z80_patchlist.LD(DE_PTR, A); + z80_patchlist.INC(DE); + z80_patchlist.LD(A, L); + z80_patchlist.LD(DE_PTR, A); + + /* Transfer box data packet: */ + z80_patchlist.LD(A, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_patchlist.LDH((curr_rom.hSerialConnectionStatus & 0xFF) | T_U8, A); // Since hSerialConnectionStatus is at 0xFFxx we can use this method instead + z80_patchlist.LD(HL, DATA_LOC | T_U16); + z80_patchlist.LD(HL_PTR, 0xFD | T_U8); // set the start of the data to 0xFD so Serial_ExchangeBytes is happy + z80_patchlist.INC(HL); + z80_patchlist.LD(HL_PTR, 0x00 | T_U8); // add a 0x00 after the 0xFD to prevent further 0xFDs from being interpreted as part of the preamble + z80_patchlist.DEC(HL); // Reset HL back so it points to 0xFD + z80_patchlist.LD(DE, (DATA_LOC + PACKET_SIZE) | T_U16); // location to put stored data + z80_patchlist.LD(BC, PACKET_SIZE | T_U16); + if (debug) // Don't call serialExchangeBytes if debug is enabled + { + z80_patchlist.index += 3; + } + else + { + z80_patchlist.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + z80_patchlist.LD(A, (DATA_LOC + PACKET_SIZE + 3 + 1) | T_U16); + z80_patchlist.CP(A, 0xFF); + z80_patchlist.JR(NZ_F, send_packet_loop.place_relative_jump(&z80_patchlist) | T_I8); + + // Recieve the Pokemon to remove + z80_patchlist.LD(HL, curr_rom.hSerialConnectionStatus | T_U16); // This can also be shortened + z80_patchlist.LD(HL_PTR, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_patchlist.LD(HL, curr_rom.garbageDataLocation | T_U16); + z80_patchlist.LD(DE, removal_array.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.LD(BC, 0x001E | T_U16); // Preamble does *not* count + if (debug) // Don't add in the Serial_ExchangeBytes call if in debug + { + z80_patchlist.index += 3; + } + else + { + z80_patchlist.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + // Remove the transfered Pokemon + z80_patchlist.LD(HL, curr_rom.wRemoveMonFromBox | T_U16); + z80_patchlist.LD(HL_PTR, 0x01 | T_U8); // != 0x00 specifies the current box + remove_array_loop.set_start(&z80_patchlist); + z80_patchlist.LD(A, array_counter.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.LD(E, A); + z80_patchlist.LD(D, 0x00 | T_U8); + z80_patchlist.LD(HL, removal_array.place_ptr(&z80_patchlist) | T_U16); + z80_patchlist.ADD(HL, DE); + z80_patchlist.INC(A); + z80_patchlist.LD(array_counter.place_ptr(&z80_patchlist) | T_U16, A); + z80_patchlist.LD(A, curr_rom.wBoxCount | T_U16); + z80_patchlist.LD(B, A); + z80_patchlist.LD(A, HL_PTR); + z80_patchlist.CP(A, 0xFF | T_U8); + z80_patchlist.JR(Z_F, save_box.place_relative_jump(&z80_patchlist) | T_I8); + z80_patchlist.CP(A, B); + z80_patchlist.JR(NC_F, remove_array_loop.place_relative_jump(&z80_patchlist) | T_I8); + z80_patchlist.LD(HL, curr_rom.wWhichPokemon | T_U16); + z80_patchlist.LD(HL_PTR, A); + if (DONT_REMOVE_PKMN) + { + z80_patchlist.index += 6; + } + else + { + z80_patchlist.LD(A, curr_rom._RemovePokemon >> 16 | T_U8); + z80_patchlist.RST(0x10); // Bank switch + z80_patchlist.CALL(curr_rom._RemovePokemon | T_U16); + } + z80_patchlist.JR(remove_array_loop.place_relative_jump(&z80_patchlist) | T_I8); + + save_box.set_start(&z80_patchlist); + z80_patchlist.JP(jump_to_party.place_direct_jump(&z80_patchlist) | T_U16); // jp pkmn list (because saving the box overwrites the data) + + array_counter.insert_variable(&z80_patchlist); + removal_array.insert_variable(&z80_payload); + transfer_wait_string.insert_variable(&z80_patchlist); + + // This payload works by placing Pokemon ID 0xFC's name in the stack, and causing a return to CD8E, + // which is part of the RNG seed. From there we can jump anywhere- and we choose to jump to D887, + // which is the rival's name. This code fixes the stack and jumps to the patchlist, which is where + // our final code is. + + // Update all the pointers + for (unsigned int i = 0; i < var_vector.size(); i++) + { + var_vector.at(i)->update_ptrs(); + } + for (unsigned int i = 0; i < jump_vector.size(); i++) + { + jump_vector.at(i)->update_jumps(); + } + + // Combine the vectors into the full payload + u8 *cur_out = payload_buffer; + memcpy(cur_out, z80_rng_seed.data_vector.data(), z80_rng_seed.data_vector.size()); + cur_out += z80_rng_seed.data_vector.size(); + memcpy(cur_out, z80_payload.data_vector.data(), z80_payload.data_vector.size()); + cur_out += z80_payload.data_vector.size(); + memcpy(cur_out, z80_patchlist.data_vector.data(), z80_patchlist.data_vector.size()); + cur_out += z80_patchlist.data_vector.size(); + + return; + + // This payload works by placing Pokemon ID 0xFC's name in the stack, and causing a return to CD8E, + // which is part of the RNG seed. From there we can jump anywhere- and we choose to jump to D887, + // which is the rival's name. This code fixes the stack and jumps to the patchlist, which is where + // our final code is. + } + memset(payload_buffer, 0x00, PAYLOAD_SIZE); +}; + +#if PAYLOAD_EXPORT_TEST +#include +#include "gb_rom_values/gb_rom_values.h" +int main() // Rename to "main" to send the payload to test_payload.txt +{ + byte buffer[672] = {0}; + freopen("test_payload.txt", "w", stdout); + printf("\n"); + init_payload(buffer, gb_rom_values_eng[RED_ID], TRANSFER, true); + + if (true) + { + for (int i = 0; i < 0x2A0; i++) + { + printf("0x%02X, ", (unsigned int)buffer[i]); + if (i % 0x10 == 0xF) + { + printf("\n# 0x%X\n", i + 1); + } + } + return 0; + } + else + { + for (int i = 0; i < 0x150; i++) + { + printf("%02X ", (unsigned int)buffer[i + ((0x10 * 28) + 9)]); + if (i % 0x10 == 0xF) + { + printf("\n"); + } + } + return 0; + } +} +#endif \ No newline at end of file diff --git a/source/background_engine.cpp b/source/background_engine.cpp index d7e258a..cf39cb4 100644 --- a/source/background_engine.cpp +++ b/source/background_engine.cpp @@ -1,7 +1,6 @@ #include - -#include "sprite_data.h" -#include "text_engine.h" +#include "pokemon_data.h" +#include "background_engine.h" #define CBB 0 #define SBB 24 diff --git a/source/box_menu.cpp b/source/box_menu.cpp index cc760e9..39f2900 100644 --- a/source/box_menu.cpp +++ b/source/box_menu.cpp @@ -1,4 +1,5 @@ #include +#include "pccs/typeDefs.h" #include "button_menu.h" #include "button_handler.h" #include "save_data_manager.h" @@ -6,14 +7,13 @@ #include "string" #include "sprite_data.h" #include "box_menu.h" -#include "pokemon_data.h" #include "text_engine.h" #include "translated_text.h" #include "text_data_table.h" Box_Menu::Box_Menu() {}; -int Box_Menu::box_main(Pokemon_Party party_data) +int Box_Menu::box_main(PokeBox* box) { u8 names_decompression_buffer[3072]; text_data_table PKMN_NAMES(names_decompression_buffer); @@ -22,7 +22,7 @@ int Box_Menu::box_main(Pokemon_Party party_data) load_flex_background(BG_BOX, 2); REG_BG1VOFS = 0; REG_BG1HOFS = 0; - load_temp_box_sprites(&party_data); + load_temp_box_sprites(box); Button cancel_button(button_cancel_left, button_cancel_right, 64); Button confirm_button(button_confirm_left, button_confirm_right, 64); cancel_button.set_location(88, 124); @@ -42,9 +42,9 @@ int Box_Menu::box_main(Pokemon_Party party_data) { if (get_frame_count() % 20 == 0) { - for (int i = 0; i < 30; i++) + for (int i = 0; i < box->getNumInBox(); i++) { - update_menu_sprite(&party_data, i, get_frame_count() % 40); + update_menu_sprite(box, i, get_frame_count() % 40); } } if (curr_button == 0) @@ -128,15 +128,15 @@ int Box_Menu::box_main(Pokemon_Party party_data) index = x + (y * BOXMENU_HNUM); obj_set_pos(box_select, BOXMENU_LEFT + (x * (BOXMENU_SPRITE_WIDTH + BOXMENU_HSPACE)), BOXMENU_TOP + (y * (BOXMENU_SPRITE_HEIGHT + BOXMENU_VSPACE))); tte_erase_rect(6, 16, 80, 152); - Simplified_Pokemon curr_pkmn = party_data.get_simple_pkmn(index); + GBPokemon* curr_pkmn = box->getGBPokemon(index); obj_hide(grabbed_front_sprite); - if (curr_pkmn.is_valid) + if (index < box->getNumInBox() && curr_pkmn->isValid) { byte val[11]; tte_set_pos(6, 88); - ptgb_write(curr_pkmn.nickname, true); - - if (curr_pkmn.is_shiny) + curr_pkmn->externalConvertNickname(val); + ptgb_write(val, true); + if (curr_pkmn->getIsShiny()) { tte_set_pos(64, 16); val[0] = 0xF9; @@ -144,14 +144,14 @@ int Box_Menu::box_main(Pokemon_Party party_data) ptgb_write(val, true); } tte_set_pos(14, 98); - if (curr_pkmn.is_missingno) + if (curr_pkmn->getSpeciesIndexNumber() == MISSINGNO) { ptgb_write(PKMN_NAMES.get_text_entry(0), true); } else { - ptgb_write(PKMN_NAMES.get_text_entry(curr_pkmn.dex_number), true); + ptgb_write(PKMN_NAMES.get_text_entry(curr_pkmn->getSpeciesIndexNumber()), true); } tte_set_pos(6, 108); val[0] = 0xC6; // L @@ -160,10 +160,10 @@ int Box_Menu::box_main(Pokemon_Party party_data) val[3] = 0x00; // " " val[4] = 0xFF; // endline ptgb_write(val, true); - convert_int_to_ptgb_str(curr_pkmn.met_level, val); // Val should never go out of bounds + convert_int_to_ptgb_str(curr_pkmn->getLevel(), val); // Val should never go out of bounds ptgb_write(val, true); - update_front_box_sprite(&curr_pkmn); + update_front_box_sprite(curr_pkmn); obj_unhide(grabbed_front_sprite, 0); update_pos = false; } diff --git a/source/custom_malloc.c b/source/custom_malloc.cpp similarity index 100% rename from source/custom_malloc.c rename to source/custom_malloc.cpp diff --git a/source/flash_mem.cpp b/source/flash_mem.cpp index c349118..b8f570f 100644 --- a/source/flash_mem.cpp +++ b/source/flash_mem.cpp @@ -1,7 +1,6 @@ #include #include "libstd_replacements.h" #include "flash_mem.h" -#include "pokemon.h" #include "pokemon_data.h" #include "rom_data.h" #include "libraries/Pokemon-Gen3-to-Gen-X/include/save.h" @@ -97,16 +96,18 @@ void initalize_memory_locations() void print_mem_section() { return; // This function isn't really needed now + /* uint16_t charset[256]; byte out[4] = {0, 0, 0, 0xFF}; - load_localized_charset(charset, 3, ENG_ID); + load_localized_charset(charset, 3, ENGLISH); out[0] = get_char_from_charset(charset, mem_name); out[1] = get_char_from_charset(charset, '-'); out[2] = get_char_from_charset(charset, mem_id + 0xA1); // Kinda a dumb way to tte_set_pos(0, 0); ptgb_write(out, true); + */ } // Reverses the endian of the given array @@ -158,29 +159,29 @@ bool read_flag(u16 flag_id) { tte_set_pos(0, 0); tte_write("#{cx:0xD000}Attempting to read byte "); - tte_write(ptgb::to_string((curr_rom.offset_flags + (flag_id / 8)) % 0xF80)); + tte_write(ptgb::to_string((curr_GBA_rom.offset_flags + (flag_id / 8)) % 0xF80)); tte_write(" of memory section "); - tte_write(ptgb::to_string(1 + ((curr_rom.offset_flags + (flag_id / 8)) / 0xF80))); + tte_write(ptgb::to_string(1 + ((curr_GBA_rom.offset_flags + (flag_id / 8)) / 0xF80))); tte_write(" for flag "); tte_write(ptgb::to_string(flag_id)); tte_write(". Flag is "); - copy_save_to_ram(memory_section_array[1 + ((curr_rom.offset_flags + (flag_id / 8)) / 0xF80)], &global_memory_buffer[0], 0x1000); - u8 flags = global_memory_buffer[(curr_rom.offset_flags + (flag_id / 8)) % 0xF80]; + copy_save_to_ram(memory_section_array[1 + ((curr_GBA_rom.offset_flags + (flag_id / 8)) / 0xF80)], &global_memory_buffer[0], 0x1000); + u8 flags = global_memory_buffer[(curr_GBA_rom.offset_flags + (flag_id / 8)) % 0xF80]; tte_write(ptgb::to_string((flags >> (flag_id % 8)) & 0b1)); while (true) { }; } - copy_save_to_ram(memory_section_array[1 + ((curr_rom.offset_flags + (flag_id / 8)) / 0xF80)], &global_memory_buffer[0], 0x1000); - u8 flags = global_memory_buffer[(curr_rom.offset_flags + (flag_id / 8)) % 0xF80]; + copy_save_to_ram(memory_section_array[1 + ((curr_GBA_rom.offset_flags + (flag_id / 8)) / 0xF80)], &global_memory_buffer[0], 0x1000); + u8 flags = global_memory_buffer[(curr_GBA_rom.offset_flags + (flag_id / 8)) % 0xF80]; return (flags >> (flag_id % 8)) & 0b1; } bool compare_map_and_npc_data(int map_bank, int map_id, int npc_id) { copy_save_to_ram(memory_section_array[4], &global_memory_buffer[0], 0x1000); - return (global_memory_buffer[curr_rom.offset_script + 5] == map_bank && - global_memory_buffer[curr_rom.offset_script + 6] == map_id && - global_memory_buffer[curr_rom.offset_script + 7] == npc_id); + return (global_memory_buffer[curr_GBA_rom.offset_script + 5] == map_bank && + global_memory_buffer[curr_GBA_rom.offset_script + 6] == map_id && + global_memory_buffer[curr_GBA_rom.offset_script + 7] == npc_id); } \ No newline at end of file diff --git a/source/gameboy_colour.cpp b/source/gameboy_colour.cpp index 3ae8229..b267026 100644 --- a/source/gameboy_colour.cpp +++ b/source/gameboy_colour.cpp @@ -88,7 +88,7 @@ byte data_packet[PACKET_SIZE]; // Here's a compilation check to ensure that the size of these structs match our expectations. // Just update it if you changed the struct members. The data-generator process prints their actual sizes. -static_assert(sizeof(struct GB_ROM) == 132); +static_assert(sizeof(struct GB_ROM) == 136); static_assert(sizeof(struct ROM_DATA) == 160); void print(const char *format, ...) @@ -169,7 +169,7 @@ void setup(const u16 *debug_charset) } } -byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, Simplified_Pokemon *curr_simple_array, const u16 *debug_charset, bool cancel_connection) +byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, PokeBox *box, const u16 *debug_charset, bool cancel_connection) { // TODO: Change to a switch statement if (state == hs) @@ -224,7 +224,7 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ text_data_table general_text(general_text_table_buffer); general_text.decompress(get_compressed_general_table()); - ptgb_write(general_text.get_text_entry(curr_gb_rom->version != YELLOW_ID ? GENERAL_link_success_yellow : GENERAL_link_success), true); + ptgb_write(general_text.get_text_entry(curr_gb_rom->version != YELLOW_ID ? GENERAL_link_success : GENERAL_link_success_yellow), true); } link_animation_state(STATE_NO_ANIM); @@ -340,7 +340,7 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ if (in != 0xFD) { state = send_remove_array; - return exchange_remove_array(in, curr_simple_array, cancel_connection); + return exchange_remove_array(in, box, cancel_connection); } return in; } @@ -352,27 +352,61 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ state = end2; } data_counter++; - return exchange_remove_array(in, curr_simple_array, cancel_connection); + return exchange_remove_array(in, box, cancel_connection); } return in; } -int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, Simplified_Pokemon *curr_simple_array, const u16 *debug_charset, bool cancel_connection) +int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, PokeBox *box, const u16 *debug_charset, bool cancel_connection) { +#define LINE_WIDTH 21 +#define NUM_LINES 8 int counter = 0; + char stuff[NUM_LINES][LINE_WIDTH]; while (true) { + if (PRINT_LINK_DATA && key_held(KEY_L)) + { + while (!key_hit(KEY_R)) + { + global_next_frame(); + } + global_next_frame(); + } // TODO: Restore Errors in_data = linkSPI->transfer(out_data); - if (PRINT_LINK_DATA && false) + if (PRINT_LINK_DATA && !key_held(KEY_DOWN)) { - tte_set_margins(0, 0, H_MAX, V_MAX); - print("%d: [%d][%d][%" PRIu8 "][%" PRIu8 "]\n\n", counter, data_counter, state, in_data, out_data); + // tte_set_margins(0, 0, H_MAX, V_MAX); + // print("%d: [%d][%d][%" PRIu8 "][%" PRIu8 "]\n\n", counter, data_counter, state, in_data, out_data); + for (int i = 0; i < NUM_LINES; i++) + { + // ptgb_write_debug(debug_charset, "\n", true); + for (int j = 0; j < LINE_WIDTH; j++) + { + stuff[i][j] = stuff[i + 1][j]; + } + stuff[i][20] = '\n'; + } + n2hexstr(&stuff[NUM_LINES - 1][0], counter & 0xFFFFFF, 6); + stuff[NUM_LINES - 1][6] = ':'; + n2hexstr(&stuff[NUM_LINES - 1][7], data_counter & 0xFFFF, 4); + stuff[NUM_LINES - 1][11] = '|'; + n2hexstr(&stuff[NUM_LINES - 1][12], state & 0xFF, 2); + stuff[NUM_LINES - 1][14] = '|'; + n2hexstr(&stuff[NUM_LINES - 1][15], in_data & 0xFF, 2); + stuff[NUM_LINES - 1][17] = '|'; + n2hexstr(&stuff[NUM_LINES - 1][18], out_data & 0xFF, 2); + stuff[NUM_LINES - 1][20] = '\0'; + + create_textbox(0, 0, 125, 80, false); + ptgb_write_debug(debug_charset, *stuff, true); } - out_data = handleIncomingByte(in_data, box_data_storage, curr_payload, curr_gb_rom, curr_simple_array, debug_charset, cancel_connection); + + out_data = handleIncomingByte(in_data, box_data_storage, curr_payload, curr_gb_rom, box, debug_charset, cancel_connection); if (FF_count > (15 * 60)) { @@ -557,13 +591,13 @@ byte exchange_boxes(byte curr_in, byte *box_data_storage, GB_ROM *curr_gb_rom) } }; -byte exchange_remove_array(byte curr_in, Simplified_Pokemon *curr_simple_array, bool cancel_connection) +byte exchange_remove_array(byte curr_in, PokeBox *box, bool cancel_connection) { for (int i = 29; i >= 0; i--) { - if (curr_simple_array[i].is_valid && !curr_simple_array[i].is_transferred && !cancel_connection) + if (box->getGen3Pokemon(i)->isValid && !cancel_connection) { - curr_simple_array[i].is_transferred = true; + box->removePokemon(i); return i; } } diff --git a/source/global_frame_controller.cpp b/source/global_frame_controller.cpp index 256f97f..e12927c 100644 --- a/source/global_frame_controller.cpp +++ b/source/global_frame_controller.cpp @@ -48,7 +48,7 @@ void global_next_frame() if (global_frame_count % 60 == 0) { set_menu_sprite_pal(0); - if (!curr_rom.verify_rom()) + if (!curr_GBA_rom.verify_rom()) { REG_BG0CNT = (REG_BG0CNT & ~BG_PRIO_MASK) | BG_PRIO(2); REG_BG2CNT = (REG_BG2CNT & ~BG_PRIO_MASK) | BG_PRIO(1); @@ -247,7 +247,7 @@ void set_missingno(bool val) missingno_enabled = val; if (val == false) { - set_background_pal(curr_rom.gamecode, false, false); + set_background_pal(curr_GBA_rom.gamecode, false, false); fennel_blink_timer = 0; } } @@ -267,21 +267,6 @@ bool get_treecko_enabled() return treecko_enabled; } -// FNV-1a 32-bit hash function for byte arrays -u32 fnv1a_hash(unsigned char *data, size_t length) -{ - const uint32_t fnv_prime = 0x01000193; - const uint32_t fnv_offset_basis = 0x811C9DC5; - uint32_t hash = fnv_offset_basis; - - for (size_t i = 0; i < length; ++i) - { - hash ^= data[i]; - hash *= fnv_prime; - } - return hash; -} - int get_string_length(const byte *str) { int size = 0; diff --git a/source/main.cpp b/source/main.cpp index e144658..c86d003 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -6,7 +6,6 @@ #include "interrupt.h" #include "gb_link.h" #include "gameboy_colour.h" -#include "pokemon.h" #include "random.h" #include "text_engine.h" #include "background_engine.h" @@ -51,7 +50,7 @@ TODO: int delay_counter = 0; int curr_selection = 0; bool skip = true; -rom_data curr_rom; +rom_data curr_GBA_rom; Button_Menu yes_no_menu(1, 2, 40, 24, false); /* @@ -87,18 +86,6 @@ int test_main(void) Music // (R + G*32 + B*1024) #define RGB(r, g, b) (r + (g * 32) + (b * 1024)) -// make sure outBuffer is large enough! Should be at least hex_len + 1 -template -void n2hexstr(char* outBuffer, I w, size_t hex_len = sizeof(I) << 1) -{ - static const char *digits = "0123456789ABCDEF"; - memset(outBuffer, '0', hex_len); - outBuffer[hex_len] = '\0'; // we must make sure to terminate the string - - for (size_t i = 0, j = (hex_len - 1) * 4; i < hex_len; ++i, j -= 4) - outBuffer[i] = digits[(w >> j) & 0x0f]; -} - void load_graphics() { @@ -253,18 +240,18 @@ int credits() { char hexBuffer[16]; uint16_t charset[256]; - load_localized_charset(charset, 3, ENG_ID); + load_localized_charset(charset, 3, ENGLISH); if (key_held(KEY_UP) && key_held(KEY_L) && key_held(KEY_R)) { set_treecko(true); } u32 pkmn_flags = 0; - bool e4_flag = read_flag(curr_rom.e4_flag); - bool mg_flag = read_flag(curr_rom.mg_flag); - bool all_collected_flag = read_flag(curr_rom.all_collected_flag); + bool e4_flag = read_flag(curr_GBA_rom.e4_flag); + bool mg_flag = read_flag(curr_GBA_rom.mg_flag); + bool all_collected_flag = read_flag(curr_GBA_rom.all_collected_flag); for (int i = 0; i < 30; i++) { - pkmn_flags |= (read_flag(curr_rom.pkmn_collected_flag_start + i) << i); + pkmn_flags |= (read_flag(curr_GBA_rom.pkmn_collected_flag_start + i) << i); } bool tutorial = get_tutorial_flag(); @@ -272,8 +259,8 @@ int credits() create_textbox(4, 1, 160, 80, true); ptgb_write_debug(charset, "Debug info:\n\nG: ", true); - ptgb_write_debug(charset, ptgb::to_string(curr_rom.language), true); - switch (curr_rom.gamecode) + ptgb_write_debug(charset, ptgb::to_string(curr_GBA_rom.language), true); + switch (curr_GBA_rom.gamecode) { case RUBY_ID: ptgb_write_debug(charset, "-R-", true); @@ -292,7 +279,7 @@ int credits() break; } - ptgb_write_debug(charset, ptgb::to_string(curr_rom.version), true); + ptgb_write_debug(charset, ptgb::to_string(curr_GBA_rom.version), true); ptgb_write_debug(charset, "\nF: ", true); ptgb_write_debug(charset, ptgb::to_string(e4_flag), true); @@ -455,7 +442,7 @@ static void __attribute__((noinline)) show_intro() REG_BG1CNT = REG_BG1CNT | BG_PRIO(3); key_poll(); // Reset the keys - curr_rom.load_rom(); + curr_GBA_rom.load_rom(); obj_set_pos(ptgb_logo_l, 56, 12); obj_set_pos(ptgb_logo_r, 56 + 64, 12); @@ -501,7 +488,7 @@ int main(void) REG_BLDALPHA = BLDA_BUILD(0b10000, 0); // Reset fade // Check if the game has been loaded correctly. - while (!curr_rom.load_rom()) + while (!curr_GBA_rom.load_rom()) { obj_hide_multi(ptgb_logo_l, 2); global_next_frame(); @@ -516,13 +503,14 @@ int main(void) initalize_memory_locations(); load_custom_save_data(); - set_background_pal(curr_rom.gamecode, false, true); + set_background_pal(curr_GBA_rom.gamecode, false, true); if (!IGNORE_MG_E4_FLAGS && (!get_tutorial_flag() || FORCE_TUTORIAL)) { obj_hide_multi(ptgb_logo_l, 2); text_loop(BTN_TRANSFER); initalize_save_data(); + // TODO: We should be able to test for a Bootleg rom in here- if the save data isn't written, then it is bootleg. } obj_unhide_multi(ptgb_logo_l, 1, 2); @@ -533,7 +521,7 @@ int main(void) if (DEBUG_MODE && false) // This isn't really needed anymore { print_mem_section(); - curr_rom.print_rom_info(); + curr_GBA_rom.print_rom_info(); } load_flex_background(BG_MAIN_MENU, 2); @@ -555,10 +543,10 @@ int main(void) obj_hide_multi(ptgb_logo_l, 2); global_next_frame(); load_flex_background(BG_DEX, 2); - set_background_pal(curr_rom.gamecode, true, false); + set_background_pal(curr_GBA_rom.gamecode, true, false); pokedex_loop(); load_flex_background(BG_DEX, 3); - set_background_pal(curr_rom.gamecode, false, false); + set_background_pal(curr_GBA_rom.gamecode, false, false); } break; case (BTN_CREDITS): diff --git a/source/mystery_gift_builder.cpp b/source/mystery_gift_builder.cpp index 0e98cb3..5683e6a 100644 --- a/source/mystery_gift_builder.cpp +++ b/source/mystery_gift_builder.cpp @@ -10,7 +10,7 @@ #define MG_SCRIPT false #define S30_SCRIPT true -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; bool asm_payload_location; // These are static variables @@ -75,60 +75,55 @@ union decompressed_data_storage_union // constructor and destructor are needed to make the compiler stop complaining // about the decompressed_data_tables struct not being trivial - decompressed_data_storage_union(){} - ~decompressed_data_storage_union(){} + decompressed_data_storage_union() {} + ~decompressed_data_storage_union() {} }; mystery_gift_script::mystery_gift_script(u8 *save_section_30_buffer) - : curr_mg_index(NPC_LOCATION_OFFSET) - , curr_section30_index(0) - , save_section_30(save_section_30_buffer) - , mg_script() - , value_buffer() - , four_align_value(0) + : curr_mg_index(NPC_LOCATION_OFFSET), curr_section30_index(0), save_section_30(save_section_30_buffer), mg_script(), value_buffer(), four_align_value(0) { - ptr_call_check_flag = (curr_rom.loc_gSpecialVar_0x8000 + 0x08); - ptr_call_return_2 = (curr_rom.loc_gSpecialVar_0x8000 + 0x0A); - ptr_box_return = (curr_rom.loc_gSpecialVar_0x8000 + 0x0C); - ptr_dex_seen_caught = (curr_rom.loc_gSpecialVar_0x8000 + 0x0E); - ptr_index = (curr_rom.loc_gSpecialVar_0x8000 + 0x12); - ptr_pkmn_offset = (curr_rom.loc_gSpecialVar_0x8000 + 0x14); + ptr_call_check_flag = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x08); + ptr_call_return_2 = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x0A); + ptr_box_return = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x0C); + ptr_dex_seen_caught = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x0E); + ptr_index = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x12); + ptr_pkmn_offset = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x14); // TODO: For old script, can be removed later - ptr_callASM = (curr_rom.loc_gSpecialVar_0x8000 + 0x00); - ptr_script_ptr_low = (curr_rom.loc_gSpecialVar_0x8000 + 0x02); - ptr_script_ptr_high = (curr_rom.loc_gSpecialVar_0x8000 + 0x04); - ptr_call_return_1 = (curr_rom.loc_gSpecialVar_0x8000 + 0x06); - ptr_block_ptr_low = (curr_rom.loc_gSaveBlock1PTR + 0x00); - ptr_block_ptr_high = (curr_rom.loc_gSaveBlock1PTR + 0x02); + ptr_callASM = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x00); + ptr_script_ptr_low = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x02); + ptr_script_ptr_high = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x04); + ptr_call_return_1 = (curr_GBA_rom.loc_gSpecialVar_0x8000 + 0x06); + ptr_block_ptr_low = (curr_GBA_rom.loc_gSaveBlock1PTR + 0x00); + ptr_block_ptr_high = (curr_GBA_rom.loc_gSaveBlock1PTR + 0x02); } -void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) +void mystery_gift_script::build_script(PokeBox *box) { decompressed_data_storage_union decompressed_store; text_data_table decompressed_text_table(decompressed_store.text.buffer); ptgb::vector mg_variable_list; ptgb::vector sec30_variable_list; - asm_var sendMonToPC_ptr(curr_rom.loc_sendMonToPC + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); + asm_var sendMonToPC_ptr(curr_GBA_rom.loc_sendMonToPC + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); asm_var returned_box_success_ptr(ptr_box_return, sec30_variable_list, &curr_section30_index); asm_var curr_pkmn_index_ptr(ptr_pkmn_offset, sec30_variable_list, &curr_section30_index); - asm_var setPokedexFlag_ptr(curr_rom.loc_setPokedexFlag + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); + asm_var setPokedexFlag_ptr(curr_GBA_rom.loc_setPokedexFlag + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); asm_var dexSeenCaught_ptr(ptr_dex_seen_caught, sec30_variable_list, &curr_section30_index); asm_var currPkmnIndex_ptr(ptr_index, sec30_variable_list, &curr_section30_index); - asm_var pkmnStruct(curr_rom.loc_gSaveDataBuffer, sec30_variable_list, &curr_section30_index); - asm_var dexStruct(curr_rom.loc_gSaveDataBuffer + (MAX_PKMN_IN_BOX * POKEMON_SIZE), sec30_variable_list, &curr_section30_index); - asm_var m4aMPlayStop_ptr(curr_rom.loc_m4aMPlayStop + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); - asm_var gMPlayInfo_BGM_ptr(curr_rom.loc_gMPlayInfo_BGM, sec30_variable_list, &curr_section30_index); - asm_var gMPlayInfo_SE2_ptr(curr_rom.loc_gMPlayInfo_SE2, sec30_variable_list, &curr_section30_index); - asm_var MPlayStart_ptr(curr_rom.loc_MPlayStart + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); - asm_var CreateFanfareTask_ptr(curr_rom.loc_CreateFanfareTask + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); - asm_var sFanfareCounter_ptr(curr_rom.loc_sFanfareCounter, sec30_variable_list, &curr_section30_index); - asm_var gPlttBufferFaded_ptr(curr_rom.loc_gPlttBufferFaded + (32 * 0x1A), sec30_variable_list, &curr_section30_index); // 0x1A is the pallet number - asm_var copySizeControl(CPU_SET_32BIT | ((32) / (32 / 8) & 0x1FFFFF), sec30_variable_list, &curr_section30_index); // CPU_SET_32BIT | ((size)/(32/8) & 0x1FFFFF) + asm_var pkmnStruct(curr_GBA_rom.loc_gSaveDataBuffer, sec30_variable_list, &curr_section30_index); + asm_var dexStruct(curr_GBA_rom.loc_gSaveDataBuffer + (MAX_PKMN_IN_BOX * POKEMON_SIZE), sec30_variable_list, &curr_section30_index); + asm_var m4aMPlayStop_ptr(curr_GBA_rom.loc_m4aMPlayStop + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); + asm_var gMPlayInfo_BGM_ptr(curr_GBA_rom.loc_gMPlayInfo_BGM, sec30_variable_list, &curr_section30_index); + asm_var gMPlayInfo_SE2_ptr(curr_GBA_rom.loc_gMPlayInfo_SE2, sec30_variable_list, &curr_section30_index); + asm_var MPlayStart_ptr(curr_GBA_rom.loc_MPlayStart + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); + asm_var CreateFanfareTask_ptr(curr_GBA_rom.loc_CreateFanfareTask + READ_AS_THUMB, sec30_variable_list, &curr_section30_index); + asm_var sFanfareCounter_ptr(curr_GBA_rom.loc_sFanfareCounter, sec30_variable_list, &curr_section30_index); + asm_var gPlttBufferFaded_ptr(curr_GBA_rom.loc_gPlttBufferFaded + (32 * 0x1A), sec30_variable_list, &curr_section30_index); // 0x1A is the pallet number + asm_var copySizeControl(CPU_SET_32BIT | ((32) / (32 / 8) & 0x1FFFFF), sec30_variable_list, &curr_section30_index); // CPU_SET_32BIT | ((size)/(32/8) & 0x1FFFFF) - asm_var flashBuffer_ptr(curr_rom.loc_gSaveDataBuffer, mg_variable_list, &curr_mg_index); - asm_var readFlashSector_ptr(curr_rom.loc_readFlashSector + READ_AS_THUMB, mg_variable_list, &curr_mg_index); + asm_var flashBuffer_ptr(curr_GBA_rom.loc_gSaveDataBuffer, mg_variable_list, &curr_mg_index); + asm_var readFlashSector_ptr(curr_GBA_rom.loc_readFlashSector + READ_AS_THUMB, mg_variable_list, &curr_mg_index); asm_var mainAsmStart(sec30_variable_list, &curr_section30_index); asm_var dexAsmStart(sec30_variable_list, &curr_section30_index); @@ -249,7 +244,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) const int movementWalkBackArrayFRLG[2] = {MOVEMENT_ACTION_WALK_FAST_DOWN, MOVEMENT_ACTION_WALK_FAST_DOWN}; const int movementWalkBackArrayE[4] = {MOVEMENT_ACTION_WALK_FAST_RIGHT, MOVEMENT_ACTION_WALK_FAST_RIGHT, MOVEMENT_ACTION_WALK_FAST_RIGHT, MOVEMENT_ACTION_WALK_FAST_DOWN}; - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -304,7 +299,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) // songLooker.add_track(track_7, sizeof(track_7)); unsigned char instrument; - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -331,14 +326,23 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) // placement new is required to run the constructor of PokemonTables for the decompressed_store's instance // it won't get called automatically because it's part of the union (and neither will the destructor) new (&decompressed_store.tables.data) PokemonTables(); + + // TODO make it so that the table is added here(?) + box->setTable(&decompressed_store.tables.data); + box->convertAll(); for (int i = 0; i < MAX_PKMN_IN_BOX; i++) // Add in the Pokemon data { - Pokemon curr_pkmn = incoming_box_data.get_converted_pkmn(decompressed_store.tables.data, i); - if (curr_pkmn.get_validity()) + Gen3Pokemon *curr_pkmn = box->getGen3Pokemon(i); + if (curr_pkmn->isValid) { - memcpy(save_section_30 + curr_section30_index, curr_pkmn.get_full_gen_3_array(), POKEMON_SIZE); + for (int j = 0; j < POKEMON_SIZE; j++) + { + *(save_section_30 + curr_section30_index + j) = curr_pkmn->dataArrayPtr[j]; + } + // memcpy(save_section_30 + curr_section30_index, curr_pkmn->dataArrayPtr, POKEMON_SIZE); + curr_section30_index += POKEMON_SIZE; - dex_nums[i] = curr_pkmn.get_dex_number(); + dex_nums[i] = curr_pkmn->getSpeciesIndexNumber(); } else { @@ -347,7 +351,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) } // the PokemonTables instance is no longer needed, but we do need to keep the english gen3 charset around // for our insert_text() calls - decompressed_store.tables.data.load_gen3_charset(ENG_ID); + decompressed_store.tables.data.load_gen3_charset(ENGLISH); // we specifically defined the decompressed_text_data struct to ensure the memcpy shouldn't overlap memcpy(decompressed_store.text.gen3_charset, decompressed_store.tables.data.gen3_charset, sizeof(decompressed_store.text.gen3_charset)); // calling the destructor is nothing more than a formality for our PokemonTables class, @@ -375,7 +379,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) // this decompresses the ZX0 compressed text table into the buffer inside of the decompressed_store union // thereby reusing the stack (=IWRAM) memory used earlier for the PokemonTables instance we used above decompressed_text_table.decompress(get_compressed_rsefrlg_table()); - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: textGreet.set_text(decompressed_text_table.get_text_entry(RSEFRLG_dia_textGreet_rse)); @@ -433,7 +437,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) curr_section30_index++; // Align the code so that it is byte aligned } - songLooker.insert_music_data(save_section_30, 0, 0, 0, curr_rom.loc_voicegroup); + songLooker.insert_music_data(save_section_30, 0, 0, 0, curr_GBA_rom.loc_voicegroup); asm_var customSong(songLooker.get_loc_in_sec30(), sec30_variable_list, &curr_section30_index); asm_var customSongDuration(119, sec30_variable_list, &curr_section30_index); @@ -445,7 +449,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) #include "lookerFRLG.h" #include "lookerRSE.h" - if (curr_rom.is_hoenn()) + if (curr_GBA_rom.is_hoenn()) { spriteLooker.insert_sprite_data(save_section_30, lookerRSETiles, 256, lookerRSEPal); } @@ -453,7 +457,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) { spriteLooker.insert_sprite_data(save_section_30, lookerFRLGTiles, 256, lookerFRLGPal); } - asm_var paletteData(curr_rom.loc_gSaveDataBuffer + (curr_section30_index - 32), sec30_variable_list, &curr_section30_index); + asm_var paletteData(curr_GBA_rom.loc_gSaveDataBuffer + (curr_section30_index - 32), sec30_variable_list, &curr_section30_index); asm_payload_location = S30_SCRIPT; @@ -574,47 +578,47 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) asm_payload_location = MG_SCRIPT; // Located at 0x?8A8 in the .sav - init_npc_location(curr_rom.map_bank, curr_rom.map_id, curr_rom.npc_id); // Set the location of the NPC - setvirtualaddress(VIRTUAL_ADDRESS); // Set virtual address - if (curr_rom.gamecode == RUBY_ID || curr_rom.gamecode == SAPPHIRE_ID) + init_npc_location(curr_GBA_rom.map_bank, curr_GBA_rom.map_id, curr_GBA_rom.npc_id); // Set the location of the NPC + setvirtualaddress(VIRTUAL_ADDRESS); // Set virtual address + if (curr_GBA_rom.gamecode == RUBY_ID || curr_GBA_rom.gamecode == SAPPHIRE_ID) { callASM(loadSec30.add_reference(1)); } else { - callASM(curr_rom.loc_loadSaveSection30 + READ_AS_THUMB); // Load save section 30 into saveDataBuffer + callASM(curr_GBA_rom.loc_loadSaveSection30 + READ_AS_THUMB); // Load save section 30 into saveDataBuffer } lock(); // Lock the player faceplayer(); // Have the NPC face the player virtualmsgbox(textGreet.add_reference(1)); // Start the dialouge waitmsg(); waitkeypress(); - applymovement(curr_rom.npc_id, movementExclaim.get_loc_in_sec30()); + applymovement(curr_GBA_rom.npc_id, movementExclaim.get_loc_in_sec30()); playse(0x15); waitse(); - waitmovement(curr_rom.npc_id); + waitmovement(curr_GBA_rom.npc_id); virtualmsgbox(textYouMustBe.add_reference(1)); waitmsg(); waitkeypress(); - applymovement(curr_rom.npc_id, movementSlowSpin.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); - applymovement(curr_rom.npc_id, movementFastSpin.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); + applymovement(curr_GBA_rom.npc_id, movementSlowSpin.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); + applymovement(curr_GBA_rom.npc_id, movementFastSpin.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); changeSpriteMacro(1, spriteLooker.get_loc_in_sec30()); callASM(loadPalette.get_loc_in_sec30()); - changePaletteMacro(curr_rom.npc_id, 0xA); - applymovement(curr_rom.npc_id, movementLookDown.get_loc_in_sec30()); + changePaletteMacro(curr_GBA_rom.npc_id, 0xA); + applymovement(curr_GBA_rom.npc_id, movementLookDown.get_loc_in_sec30()); callASM(customSoundASM.get_loc_in_sec30()); waitfanfare(); virtualmsgbox(textIAm.add_reference(1)); waitmsg(); waitkeypress(); - changeSpriteMacro(1, curr_rom.loc_sPicTable_NPC); - changePaletteMacro(curr_rom.npc_id, curr_rom.npc_palette); - applymovement(curr_rom.npc_id, movementFastSpin.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); - applymovement(curr_rom.npc_id, movementSlowSpin.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); + changeSpriteMacro(1, curr_GBA_rom.loc_sPicTable_NPC); + changePaletteMacro(curr_GBA_rom.npc_id, curr_GBA_rom.npc_palette); + applymovement(curr_GBA_rom.npc_id, movementFastSpin.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); + applymovement(curr_GBA_rom.npc_id, movementSlowSpin.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); faceplayer(); msgboxMacro(textWeHere.get_loc_in_sec30()); compare(0x800C, 1); // 0x800C == SpecialVar_Facing @@ -622,13 +626,13 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) applymovement(0xFF, movementOutOfWay.get_loc_in_sec30()); waitmovement(0xFF); jumpNotInWay.set_start(); - applymovement(curr_rom.npc_id, movementToBoxes.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); + applymovement(curr_GBA_rom.npc_id, movementToBoxes.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); playse(0x15); waitse(); msgboxMacro(textMoveBox.get_loc_in_sec30()); fadeScreen(1); - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -646,11 +650,11 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) setMetaTile(3, 2, 566, 1); setMetaTile(1, 1, 531, 1); setMetaTile(1, 2, 539, 0); - applymovement(curr_rom.npc_id, movementGoUp.get_loc_in_sec30()); + applymovement(curr_GBA_rom.npc_id, movementGoUp.get_loc_in_sec30()); break; } - special(curr_rom.special_DrawWholeMapView); - switch (curr_rom.gamecode) + special(curr_GBA_rom.special_DrawWholeMapView); + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -664,7 +668,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) } waitse(); fadeScreen(0); - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -678,41 +682,41 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) setMetaTile(3, 1, 5, 1); break; } - special(curr_rom.special_DrawWholeMapView); + special(curr_GBA_rom.special_DrawWholeMapView); playse(0x2); waitse(); msgboxMacro(textPCConvo.get_loc_in_sec30()); // -- POKEMON INJECTION START-- - setvar(var_index, 0); // set the index to 0 - setvar(var_pkmn_offset, 0); // Set the Pokemon struct offset to 0 - setvar(var_call_check_flag, rev_endian(0x2B00)); // Set the variable to 0x2B. 0x2B = CHECK FLAG - addvar(var_call_check_flag, rev_endian(curr_rom.pkmn_collected_flag_start)); // Add the starting flag ID (plus one to ignore the is collected flag) to the check flag ASM variable - setvar(var_call_return_2, rev_endian(0x0003)); // Set the variable to 0x03. 0x03 = RETURN - jumpLoop.set_start(); // Set the jump destination for the JUMP_LOOP - call(ptr_call_check_flag); // Call the check flag ASM - virtualgotoif(COND_FLAGFALSE, jumpPkmnCollected.add_reference(2)); // If the "pokemon collected" flag is false, jump to the end of the loop - callASM(mainAsmStart.get_loc_in_sec30()); // Call SendMonToPC ASM - compare(var_box_return, 2); // Compare the resulting return to #2 - virtualgotoif(COND_EQUALS, jumpBoxFull.add_reference(2)); // If the return value was #2, jump to the box full message - setvar(var_dex_seen_caught, 2); // set the seen caught variable to 2, so that the Pokemon is set to "seen" - callASM(dexAsmStart.get_loc_in_sec30()); // call "PTR_DEX_START" - addvar(var_dex_seen_caught, 1); // add 1 to the seen caught variable so that the Pokemon will be "Caught" - callASM(dexAsmStart.get_loc_in_sec30()); // Call "PTR_DEX_START" again - jumpPkmnCollected.set_start(); // Set the jump destination for if the Pokemon has already been collected - addvar(var_pkmn_offset, POKEMON_SIZE); // Add the size of one Pokmeon to the Pokemon offset - addvar(var_index, 1); // Add one to the index - addvar(var_call_check_flag, rev_endian(1)); // Add one to the flag index - compare(var_index, MAX_PKMN_IN_BOX); // Compare the index to 30 - virtualgotoif(COND_LESSTHAN, jumpLoop.add_reference(2)); // if index is less than six, jump to the start of the loop - setflag(curr_rom.all_collected_flag); // Set the "all collected" flag - fanfare(257); // Play the received fanfare - msgboxMacro(textReceived.get_loc_in_sec30()); // Display the recieved text - waitfanfare(); // Wait for the fanfare + setvar(var_index, 0); // set the index to 0 + setvar(var_pkmn_offset, 0); // Set the Pokemon struct offset to 0 + setvar(var_call_check_flag, rev_endian(0x2B00)); // Set the variable to 0x2B. 0x2B = CHECK FLAG + addvar(var_call_check_flag, rev_endian(curr_GBA_rom.pkmn_collected_flag_start)); // Add the starting flag ID (plus one to ignore the is collected flag) to the check flag ASM variable + setvar(var_call_return_2, rev_endian(0x0003)); // Set the variable to 0x03. 0x03 = RETURN + jumpLoop.set_start(); // Set the jump destination for the JUMP_LOOP + call(ptr_call_check_flag); // Call the check flag ASM + virtualgotoif(COND_FLAGFALSE, jumpPkmnCollected.add_reference(2)); // If the "pokemon collected" flag is false, jump to the end of the loop + callASM(mainAsmStart.get_loc_in_sec30()); // Call SendMonToPC ASM + compare(var_box_return, 2); // Compare the resulting return to #2 + virtualgotoif(COND_EQUALS, jumpBoxFull.add_reference(2)); // If the return value was #2, jump to the box full message + setvar(var_dex_seen_caught, 2); // set the seen caught variable to 2, so that the Pokemon is set to "seen" + callASM(dexAsmStart.get_loc_in_sec30()); // call "PTR_DEX_START" + addvar(var_dex_seen_caught, 1); // add 1 to the seen caught variable so that the Pokemon will be "Caught" + callASM(dexAsmStart.get_loc_in_sec30()); // Call "PTR_DEX_START" again + jumpPkmnCollected.set_start(); // Set the jump destination for if the Pokemon has already been collected + addvar(var_pkmn_offset, POKEMON_SIZE); // Add the size of one Pokmeon to the Pokemon offset + addvar(var_index, 1); // Add one to the index + addvar(var_call_check_flag, rev_endian(1)); // Add one to the flag index + compare(var_index, MAX_PKMN_IN_BOX); // Compare the index to 30 + virtualgotoif(COND_LESSTHAN, jumpLoop.add_reference(2)); // if index is less than six, jump to the start of the loop + setflag(curr_GBA_rom.all_collected_flag); // Set the "all collected" flag + fanfare(257); // Play the received fanfare + msgboxMacro(textReceived.get_loc_in_sec30()); // Display the recieved text + waitfanfare(); // Wait for the fanfare // -- POKEMON INJECTION END -- jumpAllCollected.set_start(); // Set the destination for if all the Pokemon have already been collected msgboxMacro(textPCThanks.get_loc_in_sec30()); // Display the thank text - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -726,12 +730,12 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) setMetaTile(3, 1, 4, 0); break; } - special(curr_rom.special_DrawWholeMapView); + special(curr_GBA_rom.special_DrawWholeMapView); playse(0x3); waitse(); fadeScreen(1); // Place the PC and boxes - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -749,11 +753,11 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) setMetaTile(3, 2, 539, 1); setMetaTile(1, 1, 525, 1); setMetaTile(1, 2, 566, 0); - applymovement(curr_rom.npc_id, movementGoDown.get_loc_in_sec30()); + applymovement(curr_GBA_rom.npc_id, movementGoDown.get_loc_in_sec30()); break; } - special(curr_rom.special_DrawWholeMapView); - switch (curr_rom.gamecode) + special(curr_GBA_rom.special_DrawWholeMapView); + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -767,8 +771,8 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) } waitse(); fadeScreen(0); - applymovement(curr_rom.npc_id, movementWalkBack.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); + applymovement(curr_GBA_rom.npc_id, movementWalkBack.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); compare(0x800C, 1); // 0x800C == SpecialVar_Facing virtualgotoif(COND_NOTEQUAL, jumpNotToSide.add_reference(2)); applymovement(0xFF, movementInWay.get_loc_in_sec30()); @@ -783,7 +787,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) jumpBoxFull.set_start(); // Set the destination for if the box is full msgboxMacro(textPCFull.get_loc_in_sec30()); // Display the thank text setMetaTile(4, 1, 98, 0); - special(curr_rom.special_DrawWholeMapView); + special(curr_GBA_rom.special_DrawWholeMapView); playse(0x3); waitse(); fadeScreen(1); @@ -792,8 +796,8 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) // Place the boxes setMetaTile(2, 1, 272, 1); setMetaTile(2, 2, 273, 0); - special(curr_rom.special_DrawWholeMapView); - switch (curr_rom.gamecode) + special(curr_GBA_rom.special_DrawWholeMapView); + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -807,8 +811,8 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data) } waitse(); fadeScreen(0); - applymovement(curr_rom.npc_id, movementWalkBack.get_loc_in_sec30()); - waitmovement(curr_rom.npc_id); + applymovement(curr_GBA_rom.npc_id, movementWalkBack.get_loc_in_sec30()); + waitmovement(curr_GBA_rom.npc_id); compare(0x800C, 1); // 0x800C == SpecialVar_Facing virtualgotoif(COND_NOTEQUAL, jumpNotToSideFull.add_reference(2)); applymovement(0xFF, movementInWay.get_loc_in_sec30()); @@ -1094,12 +1098,12 @@ void mystery_gift_script::build_script_old(Pokemon_Party &incoming_box_data) }; */ -const u8* mystery_gift_script::get_script() const +const u8 *mystery_gift_script::get_script() const { return mg_script; } -const u8* mystery_gift_script::get_section30() const +const u8 *mystery_gift_script::get_section30() const { return save_section_30; } @@ -1487,15 +1491,15 @@ void mystery_gift_script::msgboxMacro(u32 location) void mystery_gift_script::changeSpriteMacro(u8 npcId, u32 spriteTablePtr) { - writebytetooffset(spriteTablePtr >> 0, curr_rom.loc_gSprites + (0x44 * npcId) + 0xC + 0); - writebytetooffset(spriteTablePtr >> 8, curr_rom.loc_gSprites + (0x44 * npcId) + 0xC + 1); - writebytetooffset(spriteTablePtr >> 16, curr_rom.loc_gSprites + (0x44 * npcId) + 0xC + 2); - writebytetooffset(spriteTablePtr >> 24, curr_rom.loc_gSprites + (0x44 * npcId) + 0xC + 3); + writebytetooffset(spriteTablePtr >> 0, curr_GBA_rom.loc_gSprites + (0x44 * npcId) + 0xC + 0); + writebytetooffset(spriteTablePtr >> 8, curr_GBA_rom.loc_gSprites + (0x44 * npcId) + 0xC + 1); + writebytetooffset(spriteTablePtr >> 16, curr_GBA_rom.loc_gSprites + (0x44 * npcId) + 0xC + 2); + writebytetooffset(spriteTablePtr >> 24, curr_GBA_rom.loc_gSprites + (0x44 * npcId) + 0xC + 3); } void mystery_gift_script::changePaletteMacro(u8 npcId, u8 palNum) { - writebytetooffset((palNum << 4) | 0x08, curr_rom.loc_gSprites + (0x44 * npcId) + 0x5); + writebytetooffset((palNum << 4) | 0x08, curr_GBA_rom.loc_gSprites + (0x44 * npcId) + 0x5); } // ASM Commands diff --git a/source/mystery_gift_injector.cpp b/source/mystery_gift_injector.cpp index 2d0a498..8eb0e6b 100644 --- a/source/mystery_gift_injector.cpp +++ b/source/mystery_gift_injector.cpp @@ -14,36 +14,7 @@ static const u8 em_wonder_card[0x14E] = { static const u8 frlg_wonder_card[0x14E] = { 0x67, 0x18, 0x00, 0x00, 0xBA, 0xB4, 0xBE, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xCA, 0xCC, 0xC9, 0xC0, 0xBF, 0xCD, 0xCD, 0xC9, 0xCC, 0x00, 0xC0, 0xBF, 0xC8, 0xC8, 0xBF, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0xE6, 0xD5, 0xE2, 0xE7, 0xDA, 0xD9, 0xE6, 0x00, 0xBD, 0xD9, 0xE6, 0xE8, 0xDD, 0xDA, 0xDD, 0xD7, 0xD5, 0xE8, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xDD, 0xE7, 0xDD, 0xE8, 0x00, 0xE8, 0xDC, 0xD9, 0x00, 0xDC, 0xE3, 0xE9, 0xE7, 0xD9, 0x00, 0xE7, 0xE3, 0xE9, 0xE8, 0xDC, 0x00, 0xE3, 0xDA, 0x00, 0xE8, 0xDC, 0xD9, 0x00, 0xCA, 0xC9, 0xC5, 0x1B, 0xC7, 0xC9, 0xC8, 0x00, 0x00, 0x00, 0x00, 0xBD, 0xBF, 0xC8, 0xCE, 0xBF, 0xCC, 0x00, 0xE3, 0xE2, 0x00, 0xCD, 0xD9, 0xEA, 0xD9, 0xE2, 0x00, 0xC3, 0xE7, 0xE0, 0xD5, 0xE2, 0xD8, 0x00, 0xE8, 0xE3, 0x00, 0xE6, 0xD9, 0xD7, 0xDD, 0xD9, 0xEA, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xED, 0xE3, 0xE9, 0xE6, 0x00, 0xE8, 0xE6, 0xD5, 0xE2, 0xE7, 0xDA, 0xD9, 0xE6, 0xD9, 0xD8, 0x00, 0xCA, 0xC9, 0xC5, 0x1B, 0xC7, 0xC9, 0xC8, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xE3, 0x00, 0xE2, 0xE3, 0xE8, 0x00, 0xE8, 0xE3, 0xE7, 0xE7, 0x00, 0xE8, 0xDC, 0xDD, 0xE7, 0x00, 0xBF, 0xEC, 0xD7, 0xDC, 0xD5, 0xE2, 0xDB, 0xD9, 0x00, 0xBD, 0xD5, 0xE6, 0xD8, 0x00, 0xD6, 0xD9, 0xDA, 0xE3, 0xE6, 0xD9, 0x00, 0x00, 0x00, 0xE6, 0xD9, 0xD7, 0xD9, 0xDD, 0xEA, 0xDD, 0xE2, 0xDB, 0x00, 0xED, 0xE3, 0xE9, 0xE6, 0x00, 0xE8, 0xE6, 0xD5, 0xE2, 0xE7, 0xDA, 0xD9, 0xE6, 0xD9, 0xD8, 0x00, 0xCA, 0xC9, 0xC5, 0x1B, 0xC7, 0xC9, 0xC8, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // checksum -// noinline to ensure the scope of data_tables remains limited to this function -static void __attribute__((noinline)) handle_old_event(Pokemon_Party &incoming_box_data, int &curr_index, int *dex_nums) -{ - PokemonTables data_tables; - for (int i = 0; i < MAX_PKMN_IN_BOX; i++) // Add in the Pokemon data - { - Pokemon curr_pkmn = incoming_box_data.get_converted_pkmn(data_tables, i); - if (curr_pkmn.get_validity()) - { - - for (int curr_byte = 0; curr_byte < POKEMON_SIZE; curr_byte++) - { - global_memory_buffer[curr_index] = curr_pkmn.get_gen_3_data(curr_byte); - curr_index++; - } - dex_nums[i] = curr_pkmn.get_dex_number(); - } - else - { - curr_index += POKEMON_SIZE; - } - } - for (int i = 0; i < MAX_PKMN_IN_BOX; i++) // Add in the dex numbers - { - global_memory_buffer[curr_index] = dex_nums[i]; - curr_index++; - } -} - -bool inject_mystery(Pokemon_Party &incoming_box_data) +bool inject_mystery(PokeBox* box) { // WARNING: Look right here: we're passing global_memory_buffer to mystery_gift_script to be used as its save_section_30 buffer. // Since we're going to be reusing global_memory_buffer later, we need to be careful about the timing/sequence of operations. @@ -51,16 +22,9 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) mystery_gift_script script(global_memory_buffer); u32 checksum = 0; - if (ENABLE_OLD_EVENT) - { - // script.build_script_old(incoming_box_data); - } - else - { - script.build_script(incoming_box_data); - } + script.build_script(box); - if (curr_rom.is_ruby_sapphire()) + if (curr_GBA_rom.is_ruby_sapphire()) { checksum = script.calc_checksum32(); } @@ -73,17 +37,8 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) // We need to do this NOW, because mystery_gift_script::build_script() actually fills the global_memory_buffer. // In the steps after this, we will be recycling the global_memory_buffer to read and write data to other sections of the save. // So we really MUST write the generated data now, before we lose it. - if (ENABLE_OLD_EVENT) - { - int dex_nums[MAX_PKMN_IN_BOX] = {}; - int curr_index = 0; - copy_save_to_ram(0x1E000, &global_memory_buffer[0], 0x1000); - handle_old_event(incoming_box_data, curr_index, dex_nums); - } - else - { - memcpy(global_memory_buffer, script.get_section30(), 0x1000); - } + + memcpy(global_memory_buffer, script.get_section30(), 0x1000); update_memory_buffer_checksum(false); erase_sector(0x1E000); @@ -91,10 +46,10 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) // section_30 data has been stored, so now we can safely re-use the global_memory_buffer for other sections. // Let's move on to the next step. - + // Add in Wonder Card copy_save_to_ram(memory_section_array[4], &global_memory_buffer[0], 0x1000); - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: case SAPPHIRE_ID: @@ -102,22 +57,22 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) break; case FIRERED_ID: case LEAFGREEN_ID: - memcpy(global_memory_buffer + curr_rom.offset_wondercard, frlg_wonder_card, 0x14E); + memcpy(global_memory_buffer + curr_GBA_rom.offset_wondercard, frlg_wonder_card, 0x14E); break; case EMERALD_ID: default: - memcpy(global_memory_buffer + curr_rom.offset_wondercard, em_wonder_card, 0x14E); + memcpy(global_memory_buffer + curr_GBA_rom.offset_wondercard, em_wonder_card, 0x14E); break; } // Set checksum and padding - global_memory_buffer[curr_rom.offset_script] = checksum >> 0; - global_memory_buffer[curr_rom.offset_script + 1] = checksum >> 8; - global_memory_buffer[curr_rom.offset_script + 2] = checksum >> 16; - global_memory_buffer[curr_rom.offset_script + 3] = checksum >> 24; + global_memory_buffer[curr_GBA_rom.offset_script] = checksum >> 0; + global_memory_buffer[curr_GBA_rom.offset_script + 1] = checksum >> 8; + global_memory_buffer[curr_GBA_rom.offset_script + 2] = checksum >> 16; + global_memory_buffer[curr_GBA_rom.offset_script + 3] = checksum >> 24; // Add in Mystery Script data - memcpy(global_memory_buffer + curr_rom.offset_script + 4, script.get_script(), MG_SCRIPT_SIZE); + memcpy(global_memory_buffer + curr_GBA_rom.offset_script + 4, script.get_script(), MG_SCRIPT_SIZE); update_memory_buffer_checksum(false); erase_sector(memory_section_array[4]); @@ -127,7 +82,9 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) { for (int i = 0; i < 1122; i++) { - global_memory_buffer[i] = incoming_box_data.box_data_array[i]; + // global_memory_buffer[i] = incoming_box_data.box_data_array[i]; + while(true){} + // This is currently not possible(?) } for (int i = 0; i < 0x1000 - 1122; i++) { @@ -137,18 +94,18 @@ bool inject_mystery(Pokemon_Party &incoming_box_data) } // Set flags - int memory_section = 1 + ((curr_rom.offset_flags + (curr_rom.unused_flag_start / 8)) / 0xF80); // This sets the correct memory section, since flags stretch between section 1 and 2. + int memory_section = 1 + ((curr_GBA_rom.offset_flags + (curr_GBA_rom.unused_flag_start / 8)) / 0xF80); // This sets the correct memory section, since flags stretch between section 1 and 2. copy_save_to_ram(memory_section_array[memory_section], &global_memory_buffer[0], 0x1000); - global_memory_buffer[(curr_rom.offset_flags + (curr_rom.all_collected_flag / 8)) % 0xF80] &= ~(1 << (curr_rom.all_collected_flag % 8)); // Set "collected all" flag to 0 + global_memory_buffer[(curr_GBA_rom.offset_flags + (curr_GBA_rom.all_collected_flag / 8)) % 0xF80] &= ~(1 << (curr_GBA_rom.all_collected_flag % 8)); // Set "collected all" flag to 0 for (int i = 0; i < MAX_PKMN_IN_BOX; i++) { int curr_flag; - curr_flag = curr_rom.pkmn_collected_flag_start + i; - global_memory_buffer[(curr_rom.offset_flags + (curr_flag / 8)) % 0xF80] &= ~(1 << (curr_flag % 8)); // Reset the flag - if (incoming_box_data.get_simple_pkmn(i).is_valid) + curr_flag = curr_GBA_rom.pkmn_collected_flag_start + i; + global_memory_buffer[(curr_GBA_rom.offset_flags + (curr_flag / 8)) % 0xF80] &= ~(1 << (curr_flag % 8)); // Reset the flag + if (box->getGen3Pokemon(i)->isValid) { - global_memory_buffer[(curr_rom.offset_flags + (curr_flag / 8)) % 0xF80] |= (1 << (curr_flag % 8)); // Set flag accordingly + global_memory_buffer[(curr_GBA_rom.offset_flags + (curr_flag / 8)) % 0xF80] |= (1 << (curr_flag % 8)); // Set flag accordingly } } diff --git a/source/pccs/GBPokemon.cpp b/source/pccs/GBPokemon.cpp new file mode 100644 index 0000000..dc162d2 --- /dev/null +++ b/source/pccs/GBPokemon.cpp @@ -0,0 +1,818 @@ +#include "GBPokemon.h" + +// This constructor fills all our convenience arrays +GBPokemon::GBPokemon() +{ + nicknameArrayPtr = nicknameArray; + nicknameArraySize = 11; + OTArrayPtr = OTArray; + OTArraySize = 11; + externalIndexNumberPtr = &externalIndexNumber; + isBigEndian = true; + generation = 0; +} + +// This is used to load our data in from an array +void GBPokemon::loadData(Language nLang, byte nDataArray[], byte nNicknameArray[], byte nOTArray[], byte nExternalIndexNum) +{ + for (int i = 0; i < dataArraySize; i++) + { + dataArrayPtr[i] = nDataArray[i]; + } + + for (int i = 0; i < nicknameArraySize; i++) + { + nicknameArray[i] = nNicknameArray[i]; + } + + for (int i = 0; i < OTArraySize; i++) + { + OTArray[i] = nOTArray[i]; + } + + if (generation == 1) + { + externalIndexNumber = gen_1_index_array[nExternalIndexNum]; + } + else + { + externalIndexNumber = nExternalIndexNum; + } + + lang = nLang; + updateValidity(); +} + +// This is used to easily print out a Pokemon, when using a standard C++ terminal +#if ON_GBA +#else +std::string GBPokemon::parentPrint() +{ + pokeTable->load_input_charset(generation, ENGLISH); + std::stringstream os; + os << "Species Index Number: " << getSpeciesIndexNumber() << "\n" + << "Nickname: ["; + + for (int i = 0; i < 10; i++) + { + os << "0x" << std::setfill('0') << std::setw(2) << std::right << std::hex << (int)nicknameArray[i] << (i < 9 ? ", " : ""); + } + + os << "] ("; + + for (int i = 0; i < 10; i++) + { + os << (char)(pokeTable->input_charset[(int)nicknameArray[i]]); + } + + os << ")" << "\n" + << "Original Trainer: ["; + + for (int i = 0; i < 7; i++) + { + os << "0x" << std::setfill('0') << std::setw(2) << std::right << std::hex << (int)OTArray[i] << (i < 6 ? ", " : ""); + } + + os << "] ("; + + for (int i = 0; i < 7; i++) + { + os << (char)(pokeTable->input_charset[(int)OTArray[i]]); + } + + os << ")" << "\n" + << std::dec + << "Trainer ID: " << getTrainerID() << "\n" + << "Level: " << getLevel() << "\n" + << "Exp: " << getExpPoints() << "\n" + << "Moves: " + << "\n\t" << getMove(0) << " (" << getPPTotal(0) << " PP, " << getPPUpNum(0) << " PP Ups" << ")" + << "\n\t" << getMove(1) << " (" << getPPTotal(1) << " PP, " << getPPUpNum(1) << " PP Ups" << ")" + << "\n\t" << getMove(2) << " (" << getPPTotal(2) << " PP, " << getPPUpNum(2) << " PP Ups" << ")" + << "\n\t" << getMove(3) << " (" << getPPTotal(3) << " PP, " << getPPUpNum(3) << " PP Ups" << ")" << "\n" + << "Is Shiny: " << getIsShiny() << "\n"; + return os.str(); +} +#endif + +u32 GBPokemon::getDV(Stat currStat) +{ + if (currStat == HP) + { + + return ((getVar(DVs[ATTACK][generation - 1]) & 0x1) << 3) | + ((getVar(DVs[DEFENSE][generation - 1]) & 0x1) << 2) | + ((getVar(DVs[SPEED][generation - 1]) & 0x1) << 1) | + ((getVar(DVs[SPECIAL][generation - 1]) & 0x1) << 0); + } + else + { + return getVar(DVs[currStat][generation - 1]); + } +} + +bool GBPokemon::setDV(Stat currStat, byte newVal) +{ + if (currStat == HP) + { + return setVar(DVs[ATTACK][generation - 1], (getVar(DVs[ATTACK][generation - 1]) & 0b1110) | ((newVal >> 3) & 0x1)) && + setVar(DVs[DEFENSE][generation - 1], (getVar(DVs[DEFENSE][generation - 1]) & 0b1110) | ((newVal >> 2) & 0x1)) && + setVar(DVs[SPEED][generation - 1], (getVar(DVs[SPEED][generation - 1]) & 0b1110) | ((newVal >> 1) & 0x1)) && + setVar(DVs[SPECIAL][generation - 1], (getVar(DVs[SPECIAL][generation - 1]) & 0b1110) | ((newVal >> 0) & 0x1)); + } + else + { + return setVar(DVs[currStat][generation - 1], newVal); + } +} + +byte GBPokemon::getUnownLetter() +{ + if (getSpeciesIndexNumber() == 201) + { + byte letter = 0; + letter |= ((getDV(ATTACK) & 0b0110) >> 1) << 6; + letter |= ((getDV(DEFENSE) & 0b0110) >> 1) << 4; + letter |= ((getDV(SPEED) & 0b0110) >> 1) << 2; + letter |= ((getDV(SPECIAL) & 0b0110) >> 1) << 0; + letter = letter / 10; + return letter; + } + return 255; +} + +Gender GBPokemon::getGender() +{ + byte index = getSpeciesIndexNumber(); + u32 threshold = pokeTable->get_gender_threshold(index, false); + + if (threshold == 255) + { + return GENDERLESS; + } + else + { + if (getDV(ATTACK) <= threshold) + { + return FEMALE; + } + return MALE; + } +} + +Nature GBPokemon::getVirtualConsoleNature() +{ + return (Nature)(getExpPoints() % 25); +} + +bool GBPokemon::getIsShiny() +{ + return ((getDV(ATTACK) & 0b0010) == 0b0010) && + getDV(DEFENSE) == 10 && + getDV(SPEED) == 10 && + getDV(SPECIAL) == 10; +} + +bool GBPokemon::convertToGen3(Gen3Pokemon *newPkmn, bool sanitizeMythicals) +{ + if (!isValid) + { + return false; + } + + bool valid = + // Start with things that effect the PID + convertSpeciesIndexNumber(newPkmn) && + setRequestedLetter(newPkmn) && + setRequestedNature(newPkmn) && + setRequestedGender(newPkmn) && + setRequestedAbility(newPkmn) && + setRequestedSize(newPkmn) && + + // Then set the PID + generatePersonalityValue(newPkmn, ABCD_U) && + + // Then set everything else + convertTrainerID(newPkmn) && + convertNickname(newPkmn) && + convertLanguage(newPkmn) && + convertMiscFlags(newPkmn) && + convertTrainerNickname(newPkmn) && + convertMarkings(newPkmn) && + convertItem(newPkmn) && + convertEXP(newPkmn) && + convertFriendship(newPkmn) && + convertMoves(newPkmn) && + convertEVs(newPkmn) && + convertContestConditions(newPkmn) && + convertPokerus(newPkmn) && + convertMetLocation(newPkmn) && + convertMetLevel(newPkmn) && + convertGameOfOrigin(newPkmn) && + convertPokeball(newPkmn) && + convertTrainerGender(newPkmn) && + convertIVs(newPkmn) && + convertRibbonsAndObedience(newPkmn) && + convertShininess(newPkmn); + + if (sanitizeMythicals && (getSpeciesIndexNumber() == MEW || getSpeciesIndexNumber() == CELEBI)) + { + // Modify the required data for the event + valid &= loadEvent(newPkmn); + } + + newPkmn->isValid = valid; + return valid; +}; + +bool GBPokemon::loadEvent(Gen3Pokemon *newPkmn) +{ + bool valid = + generatePersonalityValue(newPkmn, BACD_R) && + convertEVs(newPkmn) && + convertIVs(newPkmn); + if (!valid) + { + return false; + } + if (getSpeciesIndexNumber() == MEW) + { + newPkmn->setGameOfOrigin(RUBY); + newPkmn->setFatefulEncounterObedience(true); + newPkmn->setMetLocation(0xFF); // Fateful Encounter + newPkmn->setLevelMet(10); + newPkmn->setSecretID(00000); + if (newPkmn->getExpPoints() < 560) // 560 is level 10 for Mew + { + newPkmn->setExpPoints(560); + } + + byte jpnOT[] = {0x6A, 0x95, 0x53, 0xFF, 0xFF, 0xFF, 0xFF}; + byte engOT[] = {0xBB, 0xE9, 0xE6, 0xD5, 0xFF, 0x00, 0x00}; + + switch (getLanguage()) + { + case JAPANESE: + case KOREAN: + newPkmn->setTrainerID(50716); + newPkmn->setOTArray(jpnOT, 7); + break; + case ENGLISH: + case FRENCH: + case ITALIAN: + case GERMAN: + case SPANISH: + default: + newPkmn->setTrainerID(20078); + newPkmn->setOTArray(engOT, 7); + break; + } + } + else if (getSpeciesIndexNumber() == CELEBI) + { + newPkmn->setGameOfOrigin(RUBY); + newPkmn->setFatefulEncounterObedience(false); + newPkmn->setMetLocation(0xFF); // Fateful Encounter + newPkmn->setSecretID(0); + + byte jpnOT[] = {0x70, 0x62, 0x78, 0x7E, 0xFF, 0x00, 0x00}; + byte engOT[] = {0xA2, 0xA1, 0x00, 0xBB, 0xC8, 0xC3, 0xD0}; + + switch (getLanguage()) + { + case JAPANESE: + case KOREAN: + newPkmn->setLevelMet(10); + if (newPkmn->getExpPoints() < 560) // 560 is level 10 for Celebi + { + newPkmn->setExpPoints(560); + } + newPkmn->setTrainerID(60720); + newPkmn->setOTArray(jpnOT, 7); + break; + case ENGLISH: + case FRENCH: + case ITALIAN: + case GERMAN: + case SPANISH: + default: + newPkmn->setLanguage(ENGLISH); + newPkmn->setLevelMet(70); + if (newPkmn->getExpPoints() < 344960) // 344960 is level 70 for Celebi + { + newPkmn->setExpPoints(344960); + } + newPkmn->setTrainerID(10); + newPkmn->setOTArray(engOT, 7); + break; + } + } + + int val = getExpPoints(); + if (val < 560) // Mew and Celebi are both Medium Slow, 560 is level 10 + { + setExpPoints(560); + } + return true; +} + +void GBPokemon::updateValidity() +{ + byte currSpeciesIndexNumber = getSpeciesIndexNumber(); + isValid = ((currSpeciesIndexNumber <= CELEBI || // Checks if the Pokemon is beyond the spported Pokemon, excluding Treecko for now + (currSpeciesIndexNumber == MISSINGNO && generation == 1)) && // But keep MissingNo + currSpeciesIndexNumber != 0 && // Makes sure the Pokemon isn't a blank party space + currSpeciesIndexNumber == externalIndexNumber && // Checks that the Pokemon isn't a hybrid or an egg + getHeldItem() == 0 // Makes sure the current Pokemon doesn't have a held item + ); +}; + +bool GBPokemon::externalConvertNickname(byte outputArray[]) +{ + pokeTable->load_input_charset(generation, ENGLISH); + pokeTable->load_gen3_charset(ENGLISH); + for (int i = 0; i < 10; i++) + { + outputArray[i] = pokeTable->get_gen_3_char(pokeTable->input_charset[nicknameArray[i]]); + } + outputArray[10] = 0xFF; + return true; +}; + +bool GBPokemon::generatePersonalityValue(Gen3Pokemon *newPkmn, RNGMethod rng) +{ + newPkmn->currRand = getPureRand(); + u32 pid = 0; + u16 seedA = 0; + u16 seedB = 0; + do + { + if (rng == ABCD_U) + { + seedA = newPkmn->getNextRand_u16(); + seedB = newPkmn->getNextRand_u16(); + pid = seedA | (seedB << 16); + } + else if (rng == BACD_R) + { + newPkmn->currRand &= 0xFFFF; // Restrict the seed to 16 bits + seedA = newPkmn->getNextRand_u16(); + seedB = newPkmn->getNextRand_u16(); + pid = seedB | (seedA << 16); + } + newPkmn->setPersonalityValue(pid); + // std::cout << "Testing PID: " << std::hex << pid << "\n"; + /* + std::cout << "PV: " << newPkmn->getPersonalityValue() << "\n" + << "Letter: " << newPkmn->getUnownLetter() << " | " << getUnownLetter() << "\n" + << "Nature: " << newPkmn->getNature() << " | " << getVirtualConsoleNature() << "\n" + << "Gender: " << newPkmn->getGender() << " | " << getGender() << "\n"; + */ + } while (!( + newPkmn->getAbilityFromPersonalityValue() == newPkmn->internalAbility && + newPkmn->getUnownLetter() == newPkmn->internalUnownLetter && + newPkmn->getNature() == newPkmn->internalNature && + newPkmn->getGender() == newPkmn->internalGender && + newPkmn->getSize() == newPkmn->internalSize)); + return true; +}; + +bool GBPokemon::convertTrainerID(Gen3Pokemon *newPkmn) +{ + newPkmn->setTrainerID(getTrainerID()); + return true; +} + +bool GBPokemon::convertNickname(Gen3Pokemon *newPkmn) +{ + pokeTable->load_input_charset(generation, ENGLISH); + pokeTable->load_gen3_charset(ENGLISH); + for (int i = 0; i < 10; i++) + { + newPkmn->setNicknameLetter(i, pokeTable->get_gen_3_char(pokeTable->input_charset[nicknameArray[i]])); + } + return true; +}; + +bool GBPokemon::convertLanguage(Gen3Pokemon *newPkmn) +{ + newPkmn->setLanguage(getLanguage()); + return true; +} + +bool GBPokemon::convertMiscFlags(Gen3Pokemon *newPkmn) +{ + newPkmn->setIsBadEgg(false); + newPkmn->setHasSpecies(true); + newPkmn->setUseEggName(false); + newPkmn->setIsEgg(false); + return true; +} + +bool GBPokemon::convertTrainerNickname(Gen3Pokemon *newPkmn) +{ + pokeTable->load_input_charset(1, ENGLISH); + pokeTable->load_gen3_charset(ENGLISH); + + for (int i = 0; i < 6; i++) + { + newPkmn->setOTLetter(i, pokeTable->get_gen_3_char(pokeTable->input_charset[OTArray[i]])); + } + + return true; +}; + +bool GBPokemon::convertMarkings(Gen3Pokemon *newPkmn) +{ + newPkmn->setMarkings(0b0000); + return true; +} + +bool GBPokemon::convertSpeciesIndexNumber(Gen3Pokemon *newPkmn) +{ + switch (getSpeciesIndexNumber()) + { + case TREECKO: + newPkmn->setSpeciesIndexNumber(0x115); + break; + case MISSINGNO: + newPkmn->setSpeciesIndexNumber(PORYGON); + break; + default: + newPkmn->setSpeciesIndexNumber(getSpeciesIndexNumber()); + break; + } + return true; +} + +bool GBPokemon::convertItem(Gen3Pokemon *newPkmn) +{ +#if ACCESS_POKEDEX +#include "save_data_manager.h" + if (!is_caught(newPkmn->getSpeciesIndexNumber())) + { + newPkmn->setHeldItem(RARE_CANDY); + set_caught(newPkmn->getSpeciesIndexNumber()); + } + else + { + newPkmn->setHeldItem(NONE); + } +#else + newPkmn->setHeldItem(NONE); +#endif + return true; +} + +bool GBPokemon::convertEXP(Gen3Pokemon *newPkmn) +{ + // As per Poke Transporter, the level will be based on the level value, not the EXP + // Make sure Level is not over 100 + + int speciesIndex = getSpeciesIndexNumber(); + int currLevel = getLevel(); + if (currLevel > 100) + { + currLevel = 100; + } + + // Truncate the EXP down to the current level + pokeTable->load_exp_groups(); + switch (pokeTable->EXP_GROUPS[speciesIndex]) + { + case EXP_FAST: + newPkmn->setExpPoints((4 * (currLevel * currLevel * currLevel)) / 5); + break; + + default: // MissingNo is the only one that should hit default, so match it to Porygon + case EXP_MED_FAST: + newPkmn->setExpPoints(currLevel * currLevel * currLevel); + break; + + case EXP_MED_SLOW: + newPkmn->setExpPoints(((6 * currLevel * currLevel * currLevel) / 5) - (15 * currLevel * currLevel) + (100 * currLevel) - 140); + break; + + case EXP_SLOW: + newPkmn->setExpPoints((5 * (currLevel * currLevel * currLevel)) / 4); + break; + } + return true; +}; + +bool GBPokemon::convertFriendship(Gen3Pokemon *newPkmn) +{ + newPkmn->setFriendship(70); + return true; +} + +bool GBPokemon::convertMoves(Gen3Pokemon *newPkmn) +{ + Species speciesIndexNum = (Species)getSpeciesIndexNumber(); + // Check that the moves are valid + if ((speciesIndexNum != SMEARGLE) && + (speciesIndexNum != MISSINGNO) && + (speciesIndexNum != TREECKO)) // Ignore Smeargle, MissingNo, and Treecko + { + for (int i = 0; i < 4; i++) + { + if (pokeTable->can_learn_move(speciesIndexNum, getMove(i))) + { + newPkmn->setMove(i, getMove(i)); // Add the move + newPkmn->setPPUpNum(i, getPPUpNum(i)); // Add the PP Bonuses + } + } + } + + // Make sure it has at least one move + int count = 0; + for (int i = 0; i < 4; i++) + { + count += (newPkmn->getMove(i) != 0); + } + if (count == 0) + { + newPkmn->setMove(0, pokeTable->get_earliest_move(speciesIndexNum)); + } + + // Bubble valid moves to the top + int i, j; + bool swapped; + for (i = 0; i < 3; i++) + { + swapped = false; + for (j = 0; j < 3 - i; j++) + { + if (newPkmn->getMove(j) == 0 && newPkmn->getMove(j + 1) != 0) + { + // Move the move *and* PP bonus up if there is a blank space + newPkmn->setMove(j, newPkmn->getMove(j + 1)); + newPkmn->setPPUpNum(j, newPkmn->getPPUpNum(j + 1)); + newPkmn->setMove(j + 1, 0); + newPkmn->setPPUpNum(j + 1, 0); + swapped = true; + } + } + + // If no two elements were swapped + // by inner loop, then break + if (swapped == false) + break; + } + + // Restore the PP values + pokeTable->load_power_points(); + for (int i = 0; i < 4; i++) + { + int move = newPkmn->getMove(i); + newPkmn->setPPTotal(i, pokeTable->POWER_POINTS[move] + ((pokeTable->POWER_POINTS[move] / 5) * newPkmn->getPPUpNum(i))); + } + + return true; +}; + +bool GBPokemon::convertEVs(Gen3Pokemon *newPkmn) +{ + for (int i = 0; i < 6; i++) + { + newPkmn->setEV((Stat)i, 0); + } + return true; +}; + +bool GBPokemon::convertContestConditions(Gen3Pokemon *newPkmn) +{ + for (int i = 0; i < 5; i++) + { + newPkmn->setContestCondition((Condition)i, 0); + } + newPkmn->setSheen(0); + return true; +}; + +bool GBPokemon::convertPokerus(Gen3Pokemon *newPkmn) +{ + newPkmn->setPokerusStrain(getPokerusStrain()); + newPkmn->setPokerusDaysRemaining(getPokerusDaysRemaining()); + return true; +} + +bool GBPokemon::convertMetLocation(Gen3Pokemon *newPkmn) +{ + newPkmn->setMetLocation(0xFF); // A fateful encounter + return true; +} + +bool GBPokemon::convertMetLevel(Gen3Pokemon *newPkmn) +{ + newPkmn->setLevelMet(getLevel()); + return true; +} + +bool GBPokemon::convertGameOfOrigin(Gen3Pokemon *newPkmn) +{ + switch (generation) + { + case 1: + newPkmn->setGameOfOrigin(FIRERED); + break; + + case 2: + newPkmn->setGameOfOrigin(HEARTGOLD); + break; + + default: + return false; + } + return true; +} + +bool GBPokemon::convertPokeball(Gen3Pokemon *newPkmn) +{ + if (getSpeciesIndexNumber() == MISSINGNO) + { + newPkmn->setPokeballCaughtIn(MASTER); + } + else + { + newPkmn->setPokeballCaughtIn(POKE); + } + + return true; +} + +bool GBPokemon::convertTrainerGender(Gen3Pokemon *newPkmn) +{ + newPkmn->setOriginalTrainerGender(getCaughtDataGender()); + return true; +}; + +bool GBPokemon::convertIVs(Gen3Pokemon *newPkmn) +{ + u16 currRand; + + currRand = newPkmn->getNextRand_u16(); + newPkmn->setIV(HP, (currRand >> 0) & 0b11111); + newPkmn->setIV(ATTACK, (currRand >> 5) & 0b11111); + newPkmn->setIV(DEFENSE, (currRand >> 10) & 0b11111); + currRand = newPkmn->getNextRand_u16(); + newPkmn->setIV(SPEED, (currRand >> 0) & 0b11111); + newPkmn->setIV(SPECIAL_ATTACK, (currRand >> 5) & 0b11111); + newPkmn->setIV(SPECIAL_DEFENSE, (currRand >> 10) & 0b11111); + + return true; +}; + +bool GBPokemon::convertAbilityFlag(Gen3Pokemon *newPkmn) +{ + newPkmn->setAbility(newPkmn->getPersonalityValue() & 0b1); + return true; +} + +bool GBPokemon::convertRibbonsAndObedience(Gen3Pokemon *newPkmn) +{ + Species speciesIndexNumber = (Species)getSpeciesIndexNumber(); + if (speciesIndexNumber == MEW || speciesIndexNumber == CELEBI) + { + newPkmn->setFatefulEncounterObedience(true); + } + return true; +}; + +bool GBPokemon::setRequestedLetter(Gen3Pokemon *newPkmn) +{ + newPkmn->internalUnownLetter = getUnownLetter(); + return true; +}; + +bool GBPokemon::setRequestedNature(Gen3Pokemon *newPkmn) +{ + newPkmn->internalNature = getVirtualConsoleNature(); + return true; +}; + +bool GBPokemon::setRequestedGender(Gen3Pokemon *newPkmn) +{ + newPkmn->internalGender = getGender(); + return true; +}; + +bool GBPokemon::setRequestedAbility(Gen3Pokemon *newPkmn) +{ + newPkmn->internalAbility = 255; + return true; +}; + +bool GBPokemon::setRequestedSize(Gen3Pokemon *newPkmn) +{ + newPkmn->internalSize = 255; + return true; +}; + +bool GBPokemon::convertShininess(Gen3Pokemon *newPkmn) +{ + byte nickname[10] = {}; + byte trainerName[7] = {}; + + for (int i = 0; i < 10; i++) + { + nickname[i] = newPkmn->getNicknameLetter(i); + } + + for (int i = 0; i < 7; i++) + { + trainerName[i] = newPkmn->getOTLetter(i); + } + + if ((getSpeciesIndexNumber() == 52) && + fnv1a_hash(trainerName, 7) == 1342961308 && + (fnv1a_hash(nickname, 7) == 1515822901 || fnv1a_hash(nickname, 8) == 2671449886)) + { + for (int i = 1; i <= 4; i++) + { + setDV((Stat)i, 15); + } + } + + u16 shinyTest = newPkmn->getTrainerID() ^ + (newPkmn->getPersonalityValue() >> 0 & 0xFFFF) ^ + (newPkmn->getPersonalityValue() >> 16 & 0xFFFF); + + if (getIsShiny()) + { // Make shiny + newPkmn->setSecretID(shinyTest); + } + else + { // Make sure it isn't shiny + if (shinyTest < 8) + { // It became shiny, fix that + newPkmn->setSecretID(51691); + } + else + { + newPkmn->setSecretID(0); + } + } + return true; +}; + +const DataVarInfo + GBPokemon::speciesIndexNumber[2] = {{0x00, 8, 0}, {0x00, 8, 0}}, + GBPokemon::level[2] = {{0x03, 8, 0}, {0x1F, 8, 0}}, + GBPokemon::moveOne[2] = {{0x08, 8, 0}, {0x02, 8, 0}}, + GBPokemon::moveTwo[2] = {{0x09, 8, 0}, {0x03, 8, 0}}, + GBPokemon::moveThree[2] = {{0x0A, 8, 0}, {0x04, 8, 0}}, + GBPokemon::moveFour[2] = {{0x0B, 8, 0}, {0x05, 8, 0}}, + GBPokemon::trainerID[2] = {{0x0C, 16, 0}, {0x06, 16, 0}}, + GBPokemon::expPoints[2] = {{0x0E, 24, 0}, {0x08, 24, 0}}, + GBPokemon::hpStatExp[2] = {{0x11, 16, 0}, {0x0B, 16, 0}}, + GBPokemon::atkStatExp[2] = {{0x13, 16, 0}, {0x0D, 16, 0}}, + GBPokemon::defStatExp[2] = {{0x15, 16, 0}, {0x0F, 16, 0}}, + GBPokemon::speStatExp[2] = {{0x17, 16, 0}, {0x11, 16, 0}}, + GBPokemon::spcStatExp[2] = {{0x19, 16, 0}, {0x13, 16, 0}}, + GBPokemon::atkDV[2] = {{0x1B, 4, 4}, {0x15, 4, 4}}, + GBPokemon::defDV[2] = {{0x1B, 4, 0}, {0x15, 4, 0}}, + GBPokemon::speDV[2] = {{0x1C, 4, 4}, {0x16, 4, 4}}, + GBPokemon::spcDV[2] = {{0x1C, 4, 0}, {0x16, 4, 0}}, + GBPokemon::ppUpNumMoveOne[2] = {{0x1D, 2, 6}, {0x17, 2, 6}}, + GBPokemon::ppNumTotalMoveOne[2] = {{0x1D, 6, 0}, {0x17, 6, 0}}, + GBPokemon::ppUpNumMoveTwo[2] = {{0x1E, 2, 6}, {0x18, 2, 6}}, + GBPokemon::ppNumTotalMoveTwo[2] = {{0x1E, 6, 0}, {0x18, 6, 0}}, + GBPokemon::ppUpNumMoveThree[2] = {{0x1F, 2, 6}, {0x19, 2, 6}}, + GBPokemon::ppNumTotalMoveThree[2] = {{0x1F, 6, 0}, {0x19, 6, 0}}, + GBPokemon::ppUpNumMoveFour[2] = {{0x20, 2, 6}, {0x1A, 2, 6}}, + GBPokemon::ppNumTotalMoveFour[2] = {{0x20, 6, 0}, {0x1A, 6, 0}}; + +const DataVarInfo + *GBPokemon::moves[4] = { + GBPokemon::moveOne, + GBPokemon::moveTwo, + GBPokemon::moveThree, + GBPokemon::moveFour, +}, + *GBPokemon::statExps[5] = { + GBPokemon::hpStatExp, + GBPokemon::atkStatExp, + GBPokemon::defStatExp, + GBPokemon::speStatExp, + GBPokemon::spcStatExp, +}, + *GBPokemon::DVs[5] = { + GBPokemon::atkDV, // This is wrong, but it will never be accessed anyway. + GBPokemon::atkDV, + GBPokemon::defDV, + GBPokemon::speDV, + GBPokemon::spcDV, +}, + *GBPokemon::PPUpNums[4] = { + GBPokemon::ppUpNumMoveOne, + GBPokemon::ppUpNumMoveTwo, + GBPokemon::ppUpNumMoveThree, + GBPokemon::ppUpNumMoveFour, +}, + *GBPokemon::PPUpTotals[4] = { + GBPokemon::ppNumTotalMoveOne, + GBPokemon::ppNumTotalMoveTwo, + GBPokemon::ppNumTotalMoveThree, + GBPokemon::ppNumTotalMoveFour, +}; \ No newline at end of file diff --git a/source/pccs/Gen1Pokemon.cpp b/source/pccs/Gen1Pokemon.cpp new file mode 100644 index 0000000..8a3f702 --- /dev/null +++ b/source/pccs/Gen1Pokemon.cpp @@ -0,0 +1,60 @@ +#include "Gen1Pokemon.h" + +Gen1Pokemon::Gen1Pokemon(PokemonTables *table) +{ + pokeTable = table; + dataArrayPtr = dataArray; + dataArraySize = 33; + generation = 1; +} + +#if ON_GBA +#else +void Gen1Pokemon::print(std::ostream &os) +{ + os << parentPrint() + << "Stats: " + << "\n\tHP: " << getStatExp(HP) << " Stat EXP, " << getDV(HP) << " DVs" + << "\n\tAttack: " << getStatExp(ATTACK) << " Stat EXP, " << getDV(ATTACK) << " DVs" + << "\n\tDefense: " << getStatExp(DEFENSE) << " Stat EXP, " << getDV(DEFENSE) << " DVs" + << "\n\tSpeed: " << getStatExp(SPEED) << " Stat EXP, " << getDV(SPEED) << " DVs" + << "\n\tSpecial: " << getStatExp(SPECIAL) << " Stat EXP, " << getDV(SPECIAL) << " DVs" << "\n" + << "Types: " + << "\n\t" << getType(0) + << "\n\t" << getType(1) << "\n" + << "Current HP: " << getCurrentHP() << "\n" + << "Status Condition: " << getStatusCondition() << "\n" + << "Catch Rate: " << getCatchRate() << "\n"; +} +#endif + +u32 Gen1Pokemon::getSpeciesIndexNumber() +{ + return gen_1_index_array[getVar(speciesIndexNumber[1])]; +} + +bool Gen1Pokemon::setSpeciesIndexNumber(byte newVal) +{ + for (int i = 0; i < 191; i++) + { + if (gen_1_index_array[i] == newVal) + { + return setVar(speciesIndexNumber[1], newVal); + } + } + return setVar(speciesIndexNumber[1], newVal); +} + +const DataVarInfo + Gen1Pokemon::g1_currentHP = {0x01, 16, 0}, + Gen1Pokemon::g1_statusCondition = {0x04, 8, 0}, + Gen1Pokemon::g1_typeOne = {0x05, 8, 0}, + Gen1Pokemon::g1_typeTwo = {0x06, 8, 0}, + Gen1Pokemon::g1_catchRate = {0x07, 8, 0}; + +const DataVarInfo + *Gen1Pokemon::g1_types[2] = + { + &Gen1Pokemon::g1_typeOne, + &Gen1Pokemon::g1_typeTwo, +}; \ No newline at end of file diff --git a/source/pccs/Gen2Pokemon.cpp b/source/pccs/Gen2Pokemon.cpp new file mode 100644 index 0000000..a2af0a9 --- /dev/null +++ b/source/pccs/Gen2Pokemon.cpp @@ -0,0 +1,44 @@ +#include "Gen2Pokemon.h" + +Gen2Pokemon::Gen2Pokemon(PokemonTables *table) +{ + pokeTable = table; + dataArrayPtr = dataArray; + dataArraySize = 32; + generation = 2; +} + +#if ON_GBA +#else +void Gen2Pokemon::print(std::ostream &os) +{ + os << parentPrint() + << "Stats: " + << "\n\tHP: " << getStatExp(HP) << " Stat EXP, " << getDV(HP) << " DVs" + << "\n\tAttack: " << getStatExp(ATTACK) << " Stat EXP, " << getDV(ATTACK) << " DVs" + << "\n\tDefense: " << getStatExp(DEFENSE) << " Stat EXP, " << getDV(DEFENSE) << " DVs" + << "\n\tSpeed: " << getStatExp(SPEED) << " Stat EXP, " << getDV(SPEED) << " DVs" + << "\n\tSpecial Attack: " << getStatExp(SPECIAL) << " Stat EXP, " << getDV(SPECIAL) << " DVs" + << "\n\tSpecial Defense: " << getStatExp(SPECIAL) << " Stat EXP, " << getDV(SPECIAL) << " DVs" << "\n" // Special Attack and Special Defense are the same + << "Held Item: " << getHeldItem() << "\n" + << "Friendship: " << getFriendship() << "\n" + << "Pokerus: " + << "\n\tStrain: " << getPokerusStrain() + << "\n\tDays Remaining: " << getPokerusDaysRemaining() << "\n" + << "Caught Data: " + << "\n\tTime: " << getCaughtDataTime() + << "\n\tLevel: " << getCaughtDataLevel() + << "\n\tTrainer Gender: " << getCaughtDataGender() + << "\n\tLocation: " << getCaughtDataLocation() << "\n"; +} +#endif + +const DataVarInfo + Gen2Pokemon::g2_heldItem = {0x01, 8, 0}, + Gen2Pokemon::g2_friendship = {0x1B, 8, 0}, + Gen2Pokemon::g2_pokerusStrain = {0x1C, 4, 4}, + Gen2Pokemon::g2_pokerusDaysRemaining = {0x1C, 4, 0}, + Gen2Pokemon::g2_caughtDataTime = {0x1D, 2, 6}, + Gen2Pokemon::g2_caughtDataLevel = {0x1D, 6, 0}, + Gen2Pokemon::g2_caughtDataGender = {0x1E, 1, 7}, + Gen2Pokemon::g2_caughtDataLocation = {0x1E, 7, 0}; \ No newline at end of file diff --git a/source/pccs/Gen3Pokemon.cpp b/source/pccs/Gen3Pokemon.cpp new file mode 100644 index 0000000..75beb28 --- /dev/null +++ b/source/pccs/Gen3Pokemon.cpp @@ -0,0 +1,743 @@ +#include "Gen3Pokemon.h" + +Gen3Pokemon::Gen3Pokemon(PokemonTables *table) +{ + pokeTable = table; + dataArrayPtr = dataArray; + dataArraySize = 80; + nicknameArrayPtr = &dataArray[0x8]; + OTArrayPtr = &dataArray[0x14]; + isBigEndian = false; + isEncrypted = false; + generation = 3; +}; + +bool Gen3Pokemon::convertToGen3(Gen3Pokemon *g3p) +{ + return false; +} + +// This is used to easily print out a Pokemon, when using a standard C++ terminal +#if ON_GBA +#else +void Gen3Pokemon::print(std::ostream &os) +{ + updateChecksum(); + updateSubstructureShift(); + + pokeTable->load_gen3_charset(ENGLISH); + if (!isValid) + { + os << "ERROR: POKEMON IS INVALID\n"; + } + else + { + os + << "Personality Value: " << std::hex << getPersonalityValue() << std::dec + << "\n\tLetter: " << (int)getUnownLetter() + << "\n\tNature: " << getNature() + << "\n\tGender: " << getGender() << '\n' + << "Trainer ID: " << getTrainerID() << "\n" + << "Secret ID: " << getSecretID() << "\n" + << "Nickname: ["; + + for (int i = 0; i < 10; i++) + { + os << "0x" << std::setfill('0') << std::setw(2) << std::right << std::hex << (int)getNicknameLetter(i) << (i < 9 ? ", " : ""); + } + + os << "] ("; + + for (int i = 0; i < 10; i++) + { + os << (char)(pokeTable->gen3_charset[(int)getNicknameLetter(i)]); + } + + os << ")" << "\n" + << "Original Trainer: ["; + + for (int i = 0; i < 7; i++) + { + os << "0x" << std::setfill('0') << std::setw(2) << std::right << std::hex << (int)getOTLetter(i) << (i < 6 ? ", " : ""); + } + + os << "] ("; + + for (int i = 0; i < 7; i++) + { + os << (char)(pokeTable->gen3_charset[(int)getOTLetter(i)]); + } + + os << ")" << "\n" + << std::dec + << "Language: " << getLanguage() << "\n" + << "Is Bad Egg: " << getIsBadEgg() << "\n" + << "Has Species: " << getHasSpecies() << "\n" + << "Use Egg Name: " << getUseEggName() << "\n" + << "Block Box RS: " << getBlockBoxRS() << "\n" + << "Markings: " << getMarkings() << "\n" + << "Checksum: " << getChecksum() << "\n" + << "Species Index Number: " << getSpeciesIndexNumber() << "\n" + << "Held Item: " << getHeldItem() << "\n" + << "Experience: " << getExpPoints() << "\n" + << "Friendship: " << getFriendship() << "\n" + << "Stats: " + << "\n\tHP: " << getEV(HP) << " EVs, " << getIV(HP) << " IVs" + << "\n\tAttack: " << getEV(ATTACK) << " EVs, " << getIV(ATTACK) << " IVs" + << "\n\tDefense: " << getEV(DEFENSE) << " EVs, " << getIV(DEFENSE) << " IVs" + << "\n\tSpecial Attack: " << getEV(SPECIAL_ATTACK) << " EVs, " << getIV(SPECIAL_ATTACK) << " IVs" + << "\n\tSpecial Defense: " << getEV(SPECIAL_DEFENSE) << " EVs, " << getIV(SPECIAL_DEFENSE) << " IVs" + << "\n\tSpeed: " << getEV(SPEED) << " EVs, " << getIV(SPEED) << " IVs" << "\n" + << "Contest Stats: " + << "\n\tCoolness: " << getContestCondition(COOLNESS) + << "\n\tBeauty: " << getContestCondition(BEAUTY) + << "\n\tCuteness: " << getContestCondition(CUTENESS) + << "\n\tSmartness: " << getContestCondition(SMARTNESS) + << "\n\tToughness: " << getContestCondition(TOUGHNESS) + << "\n\tSheen: " << getSheen() << "\n" + << "Moves: " + << "\n\t" << getMove(0) << " (" << getPPTotal(0) << " PP, " << getPPUpNum(0) << " PP Ups" << ")" + << "\n\t" << getMove(1) << " (" << getPPTotal(1) << " PP, " << getPPUpNum(1) << " PP Ups" << ")" + << "\n\t" << getMove(2) << " (" << getPPTotal(2) << " PP, " << getPPUpNum(2) << " PP Ups" << ")" + << "\n\t" << getMove(3) << " (" << getPPTotal(3) << " PP, " << getPPUpNum(3) << " PP Ups" << ")" << "\n" + << "Pokerus: " + << "\n\tStrain: " << getPokerusStrain() + << "\n\tDays Remaining: " << getPokerusDaysRemaining() << "\n" + << "Met Location: " << getMetLocation() << "\n" + << "Level Met: " << getLevelMet() << "\n" + << "Game of Origin: " << getGameOfOrigin() << "\n" + << "Pokeball Caught In: " << getPokeballCaughtIn() << "\n" + << "Original Trainer Gender: " << getOriginalTrainerGender() << "\n" + << "Is Egg: " << getIsEgg() << "\n" + << "Ability: " << getAbility() << "\n" + << "Fateful Encounter/Obedience: " << getFatefulEncounterObedience() << "\n" + << "Is Shiny: " << getIsShiny() << "\n" + << "\n" + << "Substructure Perm: " << currSubstructureShift << "\n" + << "Encryption Key: " << std::hex << ((getTrainerID() | getSecretID() << 16) ^ getPersonalityValue()) << std::dec << "\n" + << "Substructure offsets:" + << "\n\tG: " << substructOffsets[SUB_G] + << "\n\tA: " << substructOffsets[SUB_A] + << "\n\tE: " << substructOffsets[SUB_E] + << "\n\tM: " << substructOffsets[SUB_M] + << "\n"; + } +}; +std::string Gen3Pokemon::printDataArray(bool encrypedData) +{ + updateSubstructureShift(); + updateChecksum(); + encryptSubstructures(); + std::stringstream ss; + for (int i = 0; i < 80; i++) + { + ss << std::hex << std::setw(2) << std::setfill('0') << (int)dataArray[i] << (i < 79 ? " " : ""); + } + return ss.str(); +} +#endif + +// Get Nickname is different +// u32 getNickname() {}; +// u32 getOriginalTrainerName() {} + +u32 Gen3Pokemon::getNextRand_u32() +{ + currRand = (0x41C64E6D * currRand) + 0x6073; + // std::cout << "Rolled: " << std::hex << currRand << "\n"; + return currRand; +} + +u32 Gen3Pokemon::getPrevRand_u32() +{ + currRand = (currRand - 24691) * 4005161829; + return currRand; +} + +u16 Gen3Pokemon::getNextRand_u16() +{ + return getNextRand_u32() >> 16; +} + +u16 Gen3Pokemon::getPrevRand_u16() +{ + return getPrevRand_u32() >> 16; +} + +bool Gen3Pokemon::setPersonalityValue(u32 newVal) // Setting the Personality Value should modify some other values as well +{ + bool successful = setVar(personalityValue, newVal); + if (successful) + { + //successful &= setAbility(getPersonalityValue() & 0b1); + } + return successful; +} + +bool Gen3Pokemon::setAbility(u32 newVal) // We need to check if they have two abilities +{ + if (pokeTable->get_num_abilities(getSpeciesIndexNumber()) == 0) + { + newVal = 0; + } + internalAbility = newVal; + return setVar(ability, substructOffsets[SUB_M], newVal); +} + +// This is used to load our data in from an array and mark it as encrypted +void Gen3Pokemon::loadData(byte incomingArray[]) +{ + for (int i = 0; i < dataArraySize; i++) + { + dataArrayPtr[i] = incomingArray[i]; + } + isEncrypted = true; +} + +// And then some general functions +void Gen3Pokemon::decryptSubstructures() +{ + if (isEncrypted) + { + u32 key = (getTrainerID() | getSecretID() << 16) ^ getPersonalityValue(); + for (int i = 0; i < 48; i++) + { + dataArrayPtr[0x20 + i] ^= ((key >> (8 * (i % 4))) & 0xFF); + } + } +}; + +void Gen3Pokemon::encryptSubstructures() +{ + if (!isEncrypted) + { + u32 key = (getTrainerID() | getSecretID() << 16) ^ getPersonalityValue(); + for (int i = 0; i < 48; i++) + { + dataArrayPtr[0x20 + i] ^= ((key >> (8 * (i % 4))) & 0xFF); + } + } +}; + +void Gen3Pokemon::updateChecksum() +{ + bool encryptionState = isEncrypted; + decryptSubstructures(); + int checksum = 0x0000; + for (int i = 0; i < 48; i = i + 2) + { + checksum = checksum + ((dataArrayPtr[0x20 + i + 1] << 8) | dataArrayPtr[0x20 + i]); + } + setChecksum(checksum); + if (encryptionState) + { + encryptSubstructures(); + } +} + +void Gen3Pokemon::updateSubstructureShift() +{ + int structureVal = getPersonalityValue() % 24; + if (structureVal == currSubstructureShift) + { + return; + } + currSubstructureShift = structureVal; + + resetSubstructureShift(); + +#define MAX_LEN 4 + int index = 0; + while (index < MAX_LEN) + { + int len = MAX_LEN - index; + int factorial = 1; + for (int i = 1; i < len; i++) + { + factorial *= i; + } + int swapLoc = (structureVal / factorial) + index; + for (int i = index; i < swapLoc; i++) + { + swapSubstructures(index, (i + 1)); + } + index += 1; + structureVal %= factorial; + } +} + +void Gen3Pokemon::resetSubstructureShift() +{ + for (int currDest = 0; currDest < 4; currDest++) + { + for (int i = 0; i < 4; i++) + { + if ((substructOffsets[i] / 12) == currDest) + { + swapSubstructures(currDest, i); + } + } + } +} + +void Gen3Pokemon::swapSubstructures(int indexOne, int indexTwo) +{ + if (indexOne == indexTwo) + { + return; + } + + byte tempByte; + for (int i = 0; i < 12; i++) + { + tempByte = dataArrayPtr[0x20 + (indexOne * 12) + i]; + dataArrayPtr[0x20 + (indexOne * 12) + i] = dataArrayPtr[0x20 + (indexTwo * 12) + i]; + dataArrayPtr[0x20 + (indexTwo * 12) + i] = tempByte; + } + + int valOne = 0; + int valTwo = 0; + int tempInt; + + for (int i = 0; i < 4; i++) + { + if (substructOffsets[i] == indexOne * 12) + { + valOne = i; + } + if (substructOffsets[i] == indexTwo * 12) + { + valTwo = i; + } + } + tempInt = substructOffsets[valOne]; + substructOffsets[valOne] = substructOffsets[valTwo]; + substructOffsets[valTwo] = tempInt; +} + +void Gen3Pokemon::updateSecurityData() +{ + updateSubstructureShift(); + updateChecksum(); + encryptSubstructures(); +} + +byte Gen3Pokemon::getUnownLetter() +{ + if (getSpeciesIndexNumber() == 201) + { + + u32 personalityValue = getPersonalityValue(); + return ( + ((personalityValue & 0x03000000) >> 18) + + ((personalityValue & 0x00030000) >> 12) + + ((personalityValue & 0x00000300) >> 6) + + ((personalityValue & 0x00000003) >> 0)) % + 28; + } + else + { + return 255; + } +}; + +Nature Gen3Pokemon::getNature() +{ + return (Nature)(getPersonalityValue() % 25); +}; + +Gender Gen3Pokemon::getGender() +{ + byte index = getSpeciesIndexNumber(); + u32 threshold = pokeTable->get_gender_threshold(index, true); + + switch (threshold) + { + case 0: + return MALE; + case 254: + return FEMALE; + case 255: + return GENDERLESS; + default: + if ((getPersonalityValue() & 0xFF) >= threshold) + { + return MALE; + } + return FEMALE; + } +} + +int Gen3Pokemon::getAbilityFromPersonalityValue() +{ + if (internalAbility == 255) + { + return 255; + } + return getPersonalityValue() & 0b1; +} + +int Gen3Pokemon::getSize() +{ + return 255; +} + +bool Gen3Pokemon::getIsShiny() +{ + return (getTrainerID() ^ + getSecretID() ^ + (getPersonalityValue() >> 0 & 0xFFFF) ^ + (getPersonalityValue() >> 16 & 0xFFFF)) < 8; +} + +bool Gen3Pokemon::setNicknameArray(byte nameArr[], int nameArrSize) +{ + for (int i = 0; i < nameArrSize; i++) + { + setNicknameLetter(i, nameArr[i]); + } + return true; +} + +bool Gen3Pokemon::setOTArray(byte otArr[], int otArrSize) +{ + for (int i = 0; i < otArrSize; i++) + { + setOTLetter(i, otArr[i]); + } + return true; +} + +#pragma region +// Since there is only the Pokemon parent class, we can directly define these directly +const DataVarInfo + // All of the data info variables + Gen3Pokemon::personalityValue = + {0x00, 32, 0}, + Gen3Pokemon::trainerID = + {0x04, 16, 0}, + Gen3Pokemon::secretID = + {0x06, 16, 0}, + Gen3Pokemon::nicknameLetterOne = + {0x08, 8, 0}, // This is silly. Change this. + Gen3Pokemon::nicknameLetterTwo = + {0x09, 8, 0}, + Gen3Pokemon::nicknameLetterThree = + {0x0A, 8, 0}, + Gen3Pokemon::nicknameLetterFour = + {0x0B, 8, 0}, + Gen3Pokemon::nicknameLetterFive = + {0x0C, 8, 0}, + Gen3Pokemon::nicknameLetterSix = + {0x0D, 8, 0}, + Gen3Pokemon::nicknameLetterSeven = + {0x0E, 8, 0}, + Gen3Pokemon::nicknameLetterEight = + {0x0F, 8, 0}, + Gen3Pokemon::nicknameLetterNine = + {0x10, 8, 0}, + Gen3Pokemon::nicknameLetterTen = + {0x11, 8, 0}, + Gen3Pokemon::language = + {0x12, 8, 0}, + Gen3Pokemon::isBadEgg = + {0x13, 1, 0}, + Gen3Pokemon::hasSpecies = + {0x13, 1, 1}, + Gen3Pokemon::useEggName = + {0x13, 1, 2}, + Gen3Pokemon::blockBoxRS = + {0x13, 1, 3}, + // Gen3Pokemon::unusedFlags = + // {0x13, 4, 4}, + Gen3Pokemon::originalTrainerNameLetterOne = + {0x14, 8, 0}, // This is also silly. Change this. + Gen3Pokemon::originalTrainerNameLetterTwo = + {0x15, 8, 0}, + Gen3Pokemon::originalTrainerNameLetterThree = + {0x16, 8, 0}, + Gen3Pokemon::originalTrainerNameLetterFour = + {0x17, 8, 0}, + Gen3Pokemon::originalTrainerNameLetterFive = + {0x18, 8, 0}, + Gen3Pokemon::originalTrainerNameLetterSix = + {0x19, 8, 0}, + Gen3Pokemon::originalTrainerNameLetterSeven = + {0x1A, 8, 0}, + Gen3Pokemon::markings = + {0x1B, 4, 0}, + Gen3Pokemon::checksum = + {0x1C, 16, 0}; +// Gen3Pokemon::unknown = +// {0x1E, 16, 0}; + +const DataVarInfo + *Gen3Pokemon::nickname[10] = { + &Gen3Pokemon::nicknameLetterOne, + &Gen3Pokemon::nicknameLetterTwo, + &Gen3Pokemon::nicknameLetterThree, + &Gen3Pokemon::nicknameLetterFour, + &Gen3Pokemon::nicknameLetterFive, + &Gen3Pokemon::nicknameLetterSix, + &Gen3Pokemon::nicknameLetterSeven, + &Gen3Pokemon::nicknameLetterEight, + &Gen3Pokemon::nicknameLetterNine, + &Gen3Pokemon::nicknameLetterTen, +}, + *Gen3Pokemon::originalTrainerName[7] = { + &Gen3Pokemon::originalTrainerNameLetterOne, + &Gen3Pokemon::originalTrainerNameLetterTwo, + &Gen3Pokemon::originalTrainerNameLetterThree, + &Gen3Pokemon::originalTrainerNameLetterFour, + &Gen3Pokemon::originalTrainerNameLetterFive, + &Gen3Pokemon::originalTrainerNameLetterSix, + &Gen3Pokemon::originalTrainerNameLetterSeven, +}; + +// data section G +const DataVarInfo + Gen3Pokemon::speciesIndexNumber = + {0x20 + 0x00, 16, 0}, + Gen3Pokemon::heldItem = + {0x20 + 0x02, 16, 0}, + Gen3Pokemon::expPoints = + {0x20 + 0x04, 32, 0}, + Gen3Pokemon::ppUpNumMoveOne = + {0x20 + 0x08, 2, 0}, + Gen3Pokemon::ppUpNumMoveTwo = + {0x20 + 0x08, 2, 2}, + Gen3Pokemon::ppUpNumMoveThree = + {0x20 + 0x08, 2, 4}, + Gen3Pokemon::ppUpNumMoveFour = + {0x20 + 0x08, 2, 6}, + Gen3Pokemon::friendship = + {0x20 + 0x09, 8, 0}; +// Gen3Pokemon::unused = +// {0x20 + 0x0A, 16, 0}; +const DataVarInfo + *Gen3Pokemon::ppUpNums[4] = { + &Gen3Pokemon::ppUpNumMoveOne, + &Gen3Pokemon::ppUpNumMoveTwo, + &Gen3Pokemon::ppUpNumMoveThree, + &Gen3Pokemon::ppUpNumMoveFour, +}; + +// data section A +const DataVarInfo + Gen3Pokemon::moveOne = + {0x20 + 0x00, 16, 0}, + Gen3Pokemon::moveTwo = + {0x20 + 0x02, 16, 0}, + Gen3Pokemon::moveThree = + {0x20 + 0x04, 16, 0}, + Gen3Pokemon::moveFour = + {0x20 + 0x06, 16, 0}, + Gen3Pokemon::moveOnePP = + {0x20 + 0x08, 8, 0}, + Gen3Pokemon::moveTwoPP = + {0x20 + 0x09, 8, 0}, + Gen3Pokemon::moveThreePP = + {0x20 + 0x0A, 8, 0}, + Gen3Pokemon::moveFourPP = + {0x20 + 0x0B, 8, 0}; +const DataVarInfo + *Gen3Pokemon::moves[4] = { + &Gen3Pokemon::moveOne, + &Gen3Pokemon::moveTwo, + &Gen3Pokemon::moveThree, + &Gen3Pokemon::moveFour, +}, + *Gen3Pokemon::ppUpTotals[4] = { + &Gen3Pokemon::moveOnePP, + &Gen3Pokemon::moveTwoPP, + &Gen3Pokemon::moveThreePP, + &Gen3Pokemon::moveFourPP, +}; + +// data section E +const DataVarInfo + Gen3Pokemon::hpEVs = + {0x20 + 0x00, 8, 0}, + Gen3Pokemon::attackEVs = + {0x20 + 0x01, 8, 0}, + Gen3Pokemon::defenseEVs = + {0x20 + 0x02, 8, 0}, + Gen3Pokemon::speedEVs = + {0x20 + 0x03, 8, 0}, + Gen3Pokemon::specialAttackEVs = + {0x20 + 0x04, 8, 0}, + Gen3Pokemon::specialDefenseEVs = + {0x20 + 0x05, 8, 0}, + Gen3Pokemon::coolnessCondition = + {0x20 + 0x06, 8, 0}, + Gen3Pokemon::beautyCondition = + {0x20 + 0x07, 8, 0}, + Gen3Pokemon::cutenessCondition = + {0x20 + 0x08, 8, 0}, + Gen3Pokemon::smartnessCondition = + {0x20 + 0x09, 8, 0}, + Gen3Pokemon::toughnessCondition = + {0x20 + 0x0A, 8, 0}, + Gen3Pokemon::sheen = + {0x20 + 0x0B, 8, 0}; + +const DataVarInfo + *Gen3Pokemon::EVs[6] = { + &Gen3Pokemon::hpEVs, + &Gen3Pokemon::attackEVs, + &Gen3Pokemon::defenseEVs, + &Gen3Pokemon::speedEVs, + &Gen3Pokemon::specialAttackEVs, + &Gen3Pokemon::specialDefenseEVs, +}, + *Gen3Pokemon::contestConditions[5] = { + &Gen3Pokemon::coolnessCondition, + &Gen3Pokemon::beautyCondition, + &Gen3Pokemon::cutenessCondition, + &Gen3Pokemon::smartnessCondition, + &Gen3Pokemon::toughnessCondition, +}; + +const DataVarInfo + + // data section M + Gen3Pokemon::pokerusStrain = + {0x20 + 0x00, 4, 0}, + Gen3Pokemon::pokerusDaysRemaining = + {0x20 + 0x00, 4, 4}, + Gen3Pokemon::metLocation = + {0x20 + 0x01, 8, 0}, + Gen3Pokemon::levelMet = + {0x20 + 0x02, 7, 0}, + Gen3Pokemon::gameOfOrigin = + {0x20 + 0x02, 4, 7}, + Gen3Pokemon::pokeballCaughtIn = + {0x20 + 0x02, 4, 11}, + Gen3Pokemon::originalTrainerGender = + {0x20 + 0x02, 1, 15}, + Gen3Pokemon::hpIVs = + {0x20 + 0x04, 5, 0}, + Gen3Pokemon::attackIVs = + {0x20 + 0x04, 5, 5}, + Gen3Pokemon::defenseIVs = + {0x20 + 0x04, 5, 10}, + Gen3Pokemon::speedIVs = + {0x20 + 0x04, 5, 15}, + Gen3Pokemon::specialAttackIVs = + {0x20 + 0x04, 5, 20}, + Gen3Pokemon::specialDefenseIVs = + {0x20 + 0x04, 5, 25}, + Gen3Pokemon::isEgg = + {0x20 + 0x04, 1, 30}, + Gen3Pokemon::ability = + {0x20 + 0x04, 1, 31}, + Gen3Pokemon::coolNormalContestRibbon = + {0x20 + 0x08, 1, 0}, // This is also very silly. Change it. + Gen3Pokemon::coolSuperContestRibbon = + {0x20 + 0x08, 1, 0}, + Gen3Pokemon::coolHyperContestRibbon = + {0x20 + 0x08, 1, 1}, + Gen3Pokemon::coolMasterContestRibbon = + {0x20 + 0x08, 1, 2}, + Gen3Pokemon::beautyNormalContestRibbon = + {0x20 + 0x08, 1, 3}, + Gen3Pokemon::beautySuperContestRibbon = + {0x20 + 0x08, 1, 4}, + Gen3Pokemon::beautyHyperContestRibbon = + {0x20 + 0x08, 1, 5}, + Gen3Pokemon::beautyMasterContestRibbon = + {0x20 + 0x08, 1, 6}, + Gen3Pokemon::cuteNormalContestRibbon = + {0x20 + 0x08, 1, 7}, + Gen3Pokemon::cuteSuperContestRibbon = + {0x20 + 0x08, 1, 8}, + Gen3Pokemon::cuteHyperContestRibbon = + {0x20 + 0x08, 1, 9}, + Gen3Pokemon::cuteMasterContestRibbon = + {0x20 + 0x08, 1, 10}, + Gen3Pokemon::smartNormalContestRibbon = + {0x20 + 0x08, 1, 11}, + Gen3Pokemon::smartSuperContestRibbon = + {0x20 + 0x08, 1, 12}, + Gen3Pokemon::smartHyperContestRibbon = + {0x20 + 0x08, 1, 13}, + Gen3Pokemon::smartMasterContestRibbon = + {0x20 + 0x08, 1, 14}, + Gen3Pokemon::toughNormalContestRibbon = + {0x20 + 0x08, 1, 15}, + Gen3Pokemon::toughSuperContestRibbon = + {0x20 + 0x08, 1, 16}, + Gen3Pokemon::toughHyperContestRibbon = + {0x20 + 0x08, 1, 17}, + Gen3Pokemon::toughMasterContestRibbon = + {0x20 + 0x08, 1, 18}, + Gen3Pokemon::championRibbon = + {0x20 + 0x08, 1, 19}, + Gen3Pokemon::winningRibbon = + {0x20 + 0x08, 1, 20}, + Gen3Pokemon::victoryRibbon = + {0x20 + 0x08, 1, 21}, + Gen3Pokemon::artistRibbon = + {0x20 + 0x08, 1, 22}, + Gen3Pokemon::effortRibbon = + {0x20 + 0x08, 1, 23}, + Gen3Pokemon::battleChampionRibbon = + {0x20 + 0x08, 1, 24}, + Gen3Pokemon::regionalChampionRibbon = + {0x20 + 0x08, 1, 25}, + Gen3Pokemon::nationalChampionRibbon = + {0x20 + 0x08, 1, 26}, + Gen3Pokemon::countryRibbon = + {0x20 + 0x08, 1, 27}, + Gen3Pokemon::nationalRibbon = + {0x20 + 0x08, 1, 28}, + Gen3Pokemon::earthRibbon = + {0x20 + 0x08, 1, 29}, + Gen3Pokemon::unusedRibbons = + {0x20 + 0x08, 1, 30}, + Gen3Pokemon::fatefulEncounterObedience = + {0x20 + 0x08, 1, 31}; + +const DataVarInfo + *Gen3Pokemon::IVs[6] = { + &Gen3Pokemon::hpIVs, + &Gen3Pokemon::attackIVs, + &Gen3Pokemon::defenseIVs, + &Gen3Pokemon::speedIVs, + &Gen3Pokemon::specialAttackIVs, + &Gen3Pokemon::specialDefenseIVs, +}, + *Gen3Pokemon::ribbons[31] = { + &Gen3Pokemon::coolNormalContestRibbon, + &Gen3Pokemon::coolSuperContestRibbon, + &Gen3Pokemon::coolHyperContestRibbon, + &Gen3Pokemon::coolMasterContestRibbon, + &Gen3Pokemon::beautyNormalContestRibbon, + &Gen3Pokemon::beautySuperContestRibbon, + &Gen3Pokemon::beautyHyperContestRibbon, + &Gen3Pokemon::beautyMasterContestRibbon, + &Gen3Pokemon::cuteNormalContestRibbon, + &Gen3Pokemon::cuteSuperContestRibbon, + &Gen3Pokemon::cuteHyperContestRibbon, + &Gen3Pokemon::cuteMasterContestRibbon, + &Gen3Pokemon::smartNormalContestRibbon, + &Gen3Pokemon::smartSuperContestRibbon, + &Gen3Pokemon::smartHyperContestRibbon, + &Gen3Pokemon::smartMasterContestRibbon, + &Gen3Pokemon::toughNormalContestRibbon, + &Gen3Pokemon::toughSuperContestRibbon, + &Gen3Pokemon::toughHyperContestRibbon, + &Gen3Pokemon::toughMasterContestRibbon, + &Gen3Pokemon::championRibbon, + &Gen3Pokemon::winningRibbon, + &Gen3Pokemon::victoryRibbon, + &Gen3Pokemon::artistRibbon, + &Gen3Pokemon::effortRibbon, + &Gen3Pokemon::battleChampionRibbon, + &Gen3Pokemon::regionalChampionRibbon, + &Gen3Pokemon::nationalChampionRibbon, + &Gen3Pokemon::countryRibbon, + &Gen3Pokemon::nationalRibbon, + &Gen3Pokemon::earthRibbon, +}; +#pragma endregion \ No newline at end of file diff --git a/source/pccs/PokeBox.cpp b/source/pccs/PokeBox.cpp new file mode 100644 index 0000000..b9b428b --- /dev/null +++ b/source/pccs/PokeBox.cpp @@ -0,0 +1,165 @@ +#include "PokeBox.h" +#include + +#if ON_GBA +#include "global_frame_controller.h" +#include "text_engine.h" +#endif + +PokeBox::PokeBox() +{ + nullMon = new Pokemon(); +} + +PokeBox::PokeBox(PokemonTables *nTable) +{ + table = nTable; +} + +void PokeBox::setTable(PokemonTables *nTable) +{ + table = nTable; +} + +bool PokeBox::addPokemon(Pokemon *currPkmn) +{ + if (currIndex < 30) + { + boxStorage[currIndex] = currPkmn; + currIndex++; + return true; + } + return false; +} + +Pokemon *PokeBox::getPokemon(int index) +{ + if (index < currIndex) + { + return boxStorage[index]; + } + return nullMon; +} + +GBPokemon *PokeBox::getGBPokemon(int index) +{ + Pokemon *currPkmn = getPokemon(index); + GBPokemon *currGBPkmn = (GBPokemon *)currPkmn; + return currGBPkmn; +} + +Gen3Pokemon *PokeBox::getGen3Pokemon(int index) +{ + Pokemon *currPkmn = getPokemon(index); + Gen3Pokemon *currGen3Pkmn = (Gen3Pokemon *)currPkmn; + currGen3Pkmn->updateSecurityData(); + return currGen3Pkmn; +} + +bool PokeBox::removePokemon(int index) +{ + if (index < currIndex) + { + for (int i = index; i < currIndex; i++) + { + boxStorage[i] = boxStorage[i + 1]; + } + currIndex -= 1; + return true; + } + return false; +} + +// This is used to load our data in from an array +void PokeBox::loadData(int generation, Language nLang, byte nDataArray[]) +{ + if (nLang != ENGLISH) + { + return; // Other languages are not supported yet + } + for (int pkmnIndex = 0; pkmnIndex < nDataArray[0]; pkmnIndex++) + { + GBPokemon *newPkmn = nullptr; + if (generation == 1) + { + newPkmn = new Gen1Pokemon(table); + } + else if (generation == 2) + { + newPkmn = new Gen2Pokemon(table); + } + + int externalIDOffset = 1; + int dataOffset = externalIDOffset + (20 * 1) + 1; + int trainerNameOffset = dataOffset + (20 * newPkmn->dataArraySize); + int nicknameOffset = trainerNameOffset + (20 * newPkmn->OTArraySize); + + externalIDOffset += pkmnIndex * 1; + dataOffset += pkmnIndex * newPkmn->dataArraySize; + trainerNameOffset += pkmnIndex * newPkmn->OTArraySize; + nicknameOffset += pkmnIndex * newPkmn->nicknameArraySize; + + newPkmn->loadData( + nLang, + &nDataArray[dataOffset], // Pokemon Data + &nDataArray[nicknameOffset], // Nickname + &nDataArray[trainerNameOffset], // Trainer Name + nDataArray[externalIDOffset] // External ID Number + ); + + addPokemon(newPkmn); + } +} + +void PokeBox::convertPkmn(int index) +{ + Gen3Pokemon *convertedPkmn = new Gen3Pokemon(table); + Pokemon *basePkmn = getPokemon(index); + GBPokemon *oldPkmn = (GBPokemon *)(basePkmn); + + oldPkmn->convertToGen3(convertedPkmn, stabilize_mythical); + delete boxStorage[index]; + boxStorage[index] = convertedPkmn; +} + +void PokeBox::convertAll() +{ + for (int i = 0; i < currIndex; i++) + { + convertPkmn(i); + } +} + +int PokeBox::getNumInBox() +{ + return currIndex; +} + +int PokeBox::getNumValid() +{ + int numValid = 0; + for (int i = 0; i < currIndex; i++) + { + if (getPokemon(i)->isValid) + { + numValid++; + } + } + return numValid; +} + +#if ON_GBA +#else +std::string PokeBox::printDataArray() +{ + std::stringstream ss; + for (int i = 0; i < currIndex; i++) + { + if (boxStorage[i]->generation == 3) + { + ss << ((Gen3Pokemon *)boxStorage[i])->printDataArray(true) << "\n"; + } + } + return ss.str(); +} +#endif \ No newline at end of file diff --git a/source/pccs/Pokemon.cpp b/source/pccs/Pokemon.cpp new file mode 100644 index 0000000..4115ead --- /dev/null +++ b/source/pccs/Pokemon.cpp @@ -0,0 +1,99 @@ +#include "Pokemon.h" + +Pokemon::Pokemon() +{ + isValid = false; +} + +u32 Pokemon::getSpeciesIndexNumber() +{ + return 0; +} + +u32 Pokemon::getVar(DataVarInfo dataVar) +{ + return getVar(dataVar, 0); +} + +u32 Pokemon::getVar(DataVarInfo dataVar, int extraByteOffset) +{ + u32 out = 0; + if (dataVar.dataLength < 8) + { // is less than a byte, do bitwise stuff on a single byte + // ... but we can't assume that the data is within a single byte (thanks gen 3) + if (dataVar.dataLength + dataVar.bitOffset > 8) + { + int numBytes = (dataVar.dataLength + dataVar.bitOffset) / 8 + 1; + if (numBytes > 4) + { + numBytes = 4; // This avoids importing math for rounding. Silly though. + } + int arrayIndex; + for (int i = 0; i < numBytes; i++) + { + arrayIndex = (isBigEndian ? i : numBytes - (i + 1)); + out = (out << 8) | dataArrayPtr[dataVar.byteOffset + extraByteOffset + arrayIndex]; + } + out = (out >> dataVar.bitOffset) & sizeToMask(dataVar.dataLength); + } + else + { + out = (dataArrayPtr[dataVar.byteOffset + extraByteOffset] >> dataVar.bitOffset) & sizeToMask(dataVar.dataLength); + } + } + else + { // is larger than a byte, will have to access multiple parts of the array + int numBytes = dataVar.dataLength / 8; + int arrayIndex; + for (int i = 0; i < numBytes; i++) + { + arrayIndex = (isBigEndian ? i : numBytes - (i + 1)); + out = (out << 8) | dataArrayPtr[dataVar.byteOffset + extraByteOffset + arrayIndex]; + } + } + return out; +} + +bool Pokemon::setVar(DataVarInfo dataVar, u32 newValue) +{ + return setVar(dataVar, 0, newValue); +} + +bool Pokemon::setVar(DataVarInfo dataVar, int extraByteOffset, u32 newValue) +{ + if (dataVar.dataLength < 8) + { // is less than a byte, do bitwise stuff on a single byte + // ... but we can't assume that the data is within a single byte (thanks gen 3) + if (dataVar.dataLength + dataVar.bitOffset > 8) + { + int numBytes = (dataVar.dataLength + dataVar.bitOffset) / 8 + 1; + if (numBytes > 4) + { + numBytes = 4; // This avoids importing math for rounding. Silly though. + } + int arrayIndex; + for (int i = 0; i < numBytes; i++) + { + arrayIndex = (isBigEndian ? i : numBytes - (i + 1)); + dataArrayPtr[dataVar.byteOffset + arrayIndex + extraByteOffset] &= ~((sizeToMask(dataVar.dataLength) << dataVar.bitOffset) >> (arrayIndex * 8)); + dataArrayPtr[dataVar.byteOffset + arrayIndex + extraByteOffset] |= ((newValue & sizeToMask(dataVar.dataLength)) << dataVar.bitOffset) >> (arrayIndex * 8); + } + } + else + { + dataArrayPtr[dataVar.byteOffset + extraByteOffset] &= ~(sizeToMask(dataVar.dataLength) << dataVar.bitOffset); + dataArrayPtr[dataVar.byteOffset + extraByteOffset] |= (newValue & sizeToMask(dataVar.dataLength)) << dataVar.bitOffset; + } + } + else + { // is larger than a byte, will have to access multiple parts of the array + int numBytes = dataVar.dataLength / 8; + int arrayIndex; + for (int i = 0; i < numBytes; i++) + { + arrayIndex = (isBigEndian ? i : numBytes - (i + 1)); + dataArrayPtr[dataVar.byteOffset + arrayIndex + extraByteOffset] = (newValue >> (8 * ((numBytes - 1) - i))); + } + } + return true; +} \ No newline at end of file diff --git a/source/pokemon_data.cpp b/source/pccs/pokemon_data.cpp similarity index 75% rename from source/pokemon_data.cpp rename to source/pccs/pokemon_data.cpp index 994f2bd..d2c3263 100644 --- a/source/pokemon_data.cpp +++ b/source/pccs/pokemon_data.cpp @@ -1,4 +1,7 @@ #include "pokemon_data.h" +#include + +#if USE_COMPRESSED_DATA #include "EXP_GROUPS_lz10_bin.h" #include "GENDER_RATIO_lz10_bin.h" #include "NUM_ABILITIES_lz10_bin.h" @@ -10,7 +13,7 @@ #include "gen_2_charsets_lz10_bin.h" #include "gen_3_charsets_lz10_bin.h" #include -#include +#endif // All data was obtained using PokeAPI // This data won't compress very well with ZX0 (only 1 byte reduction), so we leave it uncompressed. @@ -211,8 +214,8 @@ const byte gen_1_index_array[191]{ // Indexes found here: https://bulbapedia.bulbagarden.net/wiki/Experience#In_the_core_series const u32 EXP_MAXIMUMS[6]{ med_fast_max, - 0, //erratic_max - 0, //flux_max + 0, // erratic_max + 0, // flux_max med_slow_max, fast_max, slow_max}; @@ -737,68 +740,2673 @@ const byte MOVESETS[POKEMON_ARRAY_SIZE][32]{ {0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000010, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000}, // Treecko }; -static void load_table(u8 *table, const u8* source, bool &loadedBool) +#if USE_COMPRESSED_DATA +#else +const u16 gen_1_charsets[4][256]{ + // gen_1_Jpn_char_array + { + 0x20, + 0x30A4, + 0x30F4, + 0x30A8, + 0x30AA, + 0x30AC, + 0x30AE, + 0x30B0, + 0x30B2, + 0x30B4, + 0x30B6, + 0x30B8, + 0x30BA, + 0x30BC, + 0x30BE, + 0x30C0, + 0x20, + 0x30C5, + 0x30C7, + 0x30C9, + 0x30CA, + 0x30CB, + 0x30CC, + 0x30CD, + 0x30CE, + 0x30D0, + 0x30D3, + 0x30D6, + 0x30DC, + 0x30DE, + 0x30DF, + 0x30E0, + 0x30A3, + 0x3042, + 0x3044, + 0x3094, + 0x3048, + 0x304A, + 0x304C, + 0x304E, + 0x3050, + 0x3052, + 0x3054, + 0x3056, + 0x3058, + 0x305A, + 0x305C, + 0x305E, + 0x3060, + 0x3062, + 0x3065, + 0x3067, + 0x3069, + 0x306A, + 0x306B, + 0x306C, + 0x306D, + 0x306E, + 0x3070, + 0x3073, + 0x3076, + 0x3079, + 0x307C, + 0x307E, + 0x30D1, + 0x30D4, + 0x30D7, + 0x30DD, + 0x3071, + 0x3074, + 0x3077, + 0x307A, + 0x307D, + 0x307E, + 0x20, + 0x20, + 0x20, + 0x3082, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0xFF1A, + 0x3043, + 0x3045, + 0x300C, + 0x300D, + 0x300E, + 0x300F, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x30A2, + 0x30A4, + 0x30A6, + 0x30A8, + 0x30AA, + 0x30AB, + 0x30AD, + 0x30AF, + 0x30B1, + 0x30B3, + 0x30B5, + 0x30B7, + 0x30B9, + 0x30BB, + 0x30BD, + 0x30BF, + 0x30C1, + 0x30C4, + 0x30C6, + 0x30C8, + 0x30CA, + 0x30CB, + 0x30CC, + 0x30CD, + 0x30CE, + 0x30CF, + 0x30D2, + 0x30D5, + 0x30DB, + 0x30DE, + 0x30DF, + 0x30E0, + 0x30E1, + 0x30E2, + 0x30E4, + 0x30E6, + 0x30E8, + 0x30E9, + 0x30EB, + 0x30EC, + 0x30ED, + 0x30EF, + 0x30F2, + 0x30F3, + 0x30C3, + 0x30E3, + 0x30E5, + 0x30E7, + 0x30A3, + 0x3042, + 0x3044, + 0x3046, + 0x3048, + 0x304A, + 0x304B, + 0x304D, + 0x304F, + 0x3051, + 0x3053, + 0x3055, + 0x3057, + 0x3059, + 0x305B, + 0x305D, + 0x20, + 0x3061, + 0x3064, + 0x3066, + 0x3068, + 0x306A, + 0x306B, + 0x306C, + 0x306D, + 0x306E, + 0x306F, + 0x3072, + 0x3075, + 0x3078, + 0x307B, + 0x307E, + 0x307F, + 0x3080, + 0x3081, + 0x3082, + 0x3084, + 0x3086, + 0x3088, + 0x3089, + 0x30EA, + 0x308B, + 0x308C, + 0x308D, + 0x308F, + 0x3092, + 0x3093, + 0x3063, + 0x3083, + 0x50, + 0x4D, + 0x30FC, + 0x309C, + 0x309B, + 0x3F, + 0x21, + 0x3002, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x5186, + 0xD7, + 0x2E, + 0x2F, + 0x30A9, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }, + // gen_1_Eng_char_array + { + 0x2400, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x2018, + 0x2019, + 0x201C, + 0x201D, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x2554, + 0x2550, + 0x2557, + 0x2551, + 0x255A, + 0x255D, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x29, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE9, + 0x64, + 0x6C, + 0x73, + 0x74, + 0x76, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0x72, + 0x6D, + 0x3F, + 0x21, + 0x2E, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }, + // gen_1_FreGer_char_array + { + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x2018, + 0x2019, + 0x201C, + 0x201D, + 0x30FB, + 0x22EF, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x29, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE0, + 0xE8, + 0xE9, + 0xF9, + 0xDF, + 0xE7, + 0x20, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0xEB, + 0xEF, + 0xE2, + 0xF4, + 0xFB, + 0xEA, + 0xEE, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x63, + 0x64, + 0x6A, + 0x6C, + 0x6D, + 0x6E, + 0x70, + 0x73, + 0x73, + 0x74, + 0x75, + 0x79, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0x2B, + 0x20, + 0x3F, + 0x21, + 0x2E, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }, + // gen_1_ItaSpa_char_array + { + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x2018, + 0x2019, + 0x201C, + 0x201D, + 0x30FB, + 0x22EF, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x29, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE0, + 0xE8, + 0xE9, + 0xF9, + 0xC0, + 0xC1, + 0x20, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0xC8, + 0xC9, + 0xCC, + 0xCD, + 0xD1, + 0xD2, + 0xD3, + 0xD9, + 0xDA, + 0xE1, + 0xEC, + 0xED, + 0xF1, + 0xF2, + 0xF3, + 0xFA, + 0xBA, + 0x26, + 0x64, + 0x6C, + 0x6D, + 0x72, + 0x73, + 0x74, + 0x76, + 0x20, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0xBF, + 0xA1, + 0x3F, + 0x21, + 0x2E, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }}; +const u16 gen_2_charsets[4][256]{ + // gen_2_Jpn_char_array + { + 0x3F, + 0x30A4, + 0x30F4, + 0x30A8, + 0x30AA, + 0x30AC, + 0x30AE, + 0x30B0, + 0x30B2, + 0x30B4, + 0x30B6, + 0x30B8, + 0x30BA, + 0x30BC, + 0x30BE, + 0x30C0, + 0x30C2, + 0x30C5, + 0x30C7, + 0x30C9, + 0x2A, + 0x2A, + 0x2A, + 0x30CD, + 0x30CE, + 0x30D0, + 0x30D3, + 0x30D6, + 0x30DC, + 0x2A, + 0x2A, + 0x2A, + 0x30A3, + 0x3042, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x304C, + 0x304E, + 0x3050, + 0x3052, + 0x3054, + 0x3056, + 0x3058, + 0x305A, + 0x305C, + 0x305E, + 0x3060, + 0x3062, + 0x3065, + 0x3067, + 0x3069, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x3070, + 0x3073, + 0x3076, + 0x3079, + 0x307C, + 0x2A, + 0x30D1, + 0x30D4, + 0x30D7, + 0x30DD, + 0x3071, + 0x3074, + 0x3077, + 0x307A, + 0x307D, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x3082, + 0x2A, + 0x2A, + 0x19E, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x20, + 0x25B2, + 0x20, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x300C, + 0x300D, + 0x300E, + 0x300F, + 0x30FB, + 0x22EF, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x30A2, + 0x30A4, + 0x30A6, + 0x30A8, + 0x30AA, + 0x30AB, + 0x30AD, + 0x30AF, + 0x30B1, + 0x30B3, + 0x30B5, + 0x30B7, + 0x30B9, + 0x30BB, + 0x30BD, + 0x30BF, + 0x30C1, + 0x30C4, + 0x30C6, + 0x30C8, + 0x30CA, + 0x30CB, + 0x30CC, + 0x30CD, + 0x30CE, + 0x30CF, + 0x30D2, + 0x30D5, + 0x30DB, + 0x30DE, + 0x30DF, + 0x30E0, + 0x30E1, + 0x30E2, + 0x30E4, + 0x30E6, + 0x30E8, + 0x30E9, + 0x30EB, + 0x30EC, + 0x30ED, + 0x30EF, + 0x30F2, + 0x30F3, + 0x30C3, + 0x30E3, + 0x30E5, + 0x30E7, + 0x30A3, + 0x3042, + 0x3044, + 0x3046, + 0x3048, + 0x304A, + 0x304B, + 0x304D, + 0x304F, + 0x3051, + 0x3053, + 0x3055, + 0x3057, + 0x3059, + 0x305B, + 0x305D, + 0x305F, + 0x3061, + 0x3064, + 0x3066, + 0x3068, + 0x306A, + 0x306B, + 0x306C, + 0x306D, + 0x306E, + 0x306F, + 0x3072, + 0x3075, + 0x3078, + 0x307B, + 0x307E, + 0x307F, + 0x3080, + 0x3081, + 0x3082, + 0x3084, + 0x3086, + 0x3088, + 0x3089, + 0x30EA, + 0x308B, + 0x308C, + 0x308D, + 0x308F, + 0x3092, + 0x3093, + 0x3063, + 0x3083, + 0x3085, + 0x3087, + 0x30FC, + 0x309C, + 0x309B, + 0x3F, + 0x21, + 0x3002, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x5186, + 0xD7, + 0x2E, + 0x2F, + 0x30A9, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }, + // gen_2_Eng_char_array + { + 0x3F, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x20, + 0x20, + 0x20, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x20, + 0x71, + 0x72, + 0x20, + 0x20, + 0x20, + 0x20, + 0x77, + 0x78, + 0x79, + 0x7A, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0xC4, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x72, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2588, + 0x25B2, + 0x20, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x50, + 0x4B, + 0x201C, + 0x201D, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x2550, + 0x2557, + 0x2551, + 0x255A, + 0x255D, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x29, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0xC4, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x64, + 0x6C, + 0x6D, + 0x72, + 0x73, + 0x74, + 0x76, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0xD83E, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0x20, + 0x20, + 0x3F, + 0x21, + 0x2E, + 0x26, + 0xE9, + 0xD83E, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }, + // gen_2_FreGer_char_array + { + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x25B2, + 0x20, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x50, + 0x4B, + 0x201C, + 0x201D, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x29, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE0, + 0xE8, + 0xE9, + 0xF9, + 0xDF, + 0xE7, + 0xC4, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0xEB, + 0xEF, + 0xE2, + 0xF4, + 0xFB, + 0xEA, + 0xEE, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x63, + 0x64, + 0x6A, + 0x6C, + 0x6D, + 0x6E, + 0x70, + 0x73, + 0x73, + 0x74, + 0x75, + 0x79, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0x2B, + 0x20, + 0x3F, + 0x21, + 0x2E, + 0x26, + 0xE9, + 0x20, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }, + // gen_2_ItaSpa_char_array + { + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x25B2, + 0x20, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x50, + 0x4B, + 0x201C, + 0x201D, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x28, + 0x29, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE0, + 0xE8, + 0xE9, + 0xF9, + 0xC0, + 0xC1, + 0xC4, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0xC8, + 0xC9, + 0xCC, + 0xCD, + 0xD1, + 0xD2, + 0xD3, + 0xD9, + 0xDA, + 0xE1, + 0xEC, + 0xED, + 0xF1, + 0xF2, + 0xF3, + 0xFA, + 0xBA, + 0x26, + 0x64, + 0x6C, + 0x6D, + 0x72, + 0x73, + 0x74, + 0x76, + 0x20, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0xBF, + 0xA1, + 0x3F, + 0x21, + 0x2E, + 0x26, + 0xE9, + 0x20, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + }}; +const u16 gen_3_charsets[2][256]{ + // gen_3_Jpn_char_array + { + 0x20, + 0x3042, + 0x3044, + 0x3046, + 0x3048, + 0x304A, + 0x304B, + 0x304D, + 0x304F, + 0x3051, + 0x3053, + 0x3055, + 0x3057, + 0x3059, + 0x305B, + 0x305D, + 0x305F, + 0x3061, + 0x3064, + 0x3066, + 0x3068, + 0x306A, + 0x306B, + 0x306C, + 0x306D, + 0x306E, + 0x306F, + 0x3072, + 0x3075, + 0x3078, + 0x307B, + 0x307E, + 0x307F, + 0x3080, + 0x3081, + 0x3082, + 0x3084, + 0x3086, + 0x3088, + 0x3089, + 0x308A, + 0x308B, + 0x308C, + 0x308D, + 0x308F, + 0x3092, + 0x3093, + 0x3041, + 0x3043, + 0x3045, + 0x3047, + 0x3049, + 0x3083, + 0x3085, + 0x3087, + 0x304C, + 0x304E, + 0x3050, + 0x3052, + 0x3054, + 0x3056, + 0x3058, + 0x305A, + 0x305C, + 0x305E, + 0x3060, + 0x3062, + 0x3065, + 0x3067, + 0x3069, + 0x3070, + 0x3073, + 0x3076, + 0x3079, + 0x307C, + 0x3071, + 0x3074, + 0x3077, + 0x307A, + 0x307D, + 0x3063, + 0x30A2, + 0x30A4, + 0x30A6, + 0x30A8, + 0x30AA, + 0x30AB, + 0x30AD, + 0x30AF, + 0x30B1, + 0x30B3, + 0x30B5, + 0x30B7, + 0x30B9, + 0x30BB, + 0x30BD, + 0x30BF, + 0x30C1, + 0x30C4, + 0x30C6, + 0x30C8, + 0x30CA, + 0x30CB, + 0x30CC, + 0x30CD, + 0x30CE, + 0x30CF, + 0x30D2, + 0x30D5, + 0x30D8, + 0x30DB, + 0x30DE, + 0x30DF, + 0x30E0, + 0x30E1, + 0x30E2, + 0x30E4, + 0x30E6, + 0x30E8, + 0x30E9, + 0x30EA, + 0x20, + 0x30EC, + 0x30ED, + 0x30EF, + 0x30F2, + 0x30F3, + 0x30A1, + 0x30A3, + 0x30A5, + 0x30A7, + 0x30A9, + 0x30E3, + 0x30E5, + 0x30E7, + 0x30AC, + 0x30AE, + 0x30B0, + 0x30B2, + 0x30B4, + 0x30B6, + 0x30B8, + 0x30BA, + 0x30BC, + 0x30BE, + 0x30C0, + 0x30C2, + 0x30C5, + 0x30C7, + 0x30C9, + 0x30D0, + 0x30D3, + 0x30D6, + 0x30D9, + 0x30DC, + 0x30D1, + 0x30D4, + 0x30D7, + 0x30DA, + 0x30DD, + 0x30C3, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + 0xFF01, + 0xFF1F, + 0x3002, + 0x30FC, + 0x30FB, + 0x30FB, + 0x300E, + 0x300F, + 0x300C, + 0x300D, + 0x2642, + 0x2640, + 0x5186, + 0x2E, + 0xD7, + 0x2F, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0x25B6, + 0x3A, + 0xC4, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0x2B06, + 0x2B07, + 0x2B05, + 0x15E, + 0x23C, + 0x206, + 0x1B2, + 0x147, + 0x19E, + }, + // gen_3_Intern_char_array + { + 0x20, + 0xC0, + 0xC1, + 0xC2, + 0xC7, + 0xC8, + 0xC9, + 0xCA, + 0xCB, + 0xCC, + 0x20, + 0xCE, + 0xCF, + 0xD2, + 0xD3, + 0xD4, + 0x152, + 0xD9, + 0xDA, + 0xDB, + 0xD1, + 0xDF, + 0xE0, + 0xE1, + 0x20, + 0xE7, + 0xE8, + 0xE9, + 0xEA, + 0xEB, + 0xEC, + 0x20, + 0xEE, + 0xEF, + 0xF2, + 0xF3, + 0xF4, + 0x153, + 0xF9, + 0xFA, + 0xFB, + 0xF1, + 0xBA, + 0xAA, + 0x1D49, + 0x26, + 0x2B, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x3D, + 0x3B, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x25AF, + 0xBF, + 0xA1, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0xCD, + 0x25, + 0x28, + 0x29, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0xE2, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0xED, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2B07, + 0x2B05, + 0x27A1, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x2A, + 0x1D49, + 0x3C, + 0x3E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2B3, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, + 0x21, + 0x3F, + 0x2E, + 0x2D, + 0x30FB, + 0x2026, + 0x201C, + 0x201D, + 0x2018, + 0x2019, + 0x2642, + 0x2640, + 0x20, + 0x2C, + 0xD7, + 0x2F, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0x25B6, + 0x3A, + 0xC4, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0x20, + 0x20, + 0x20, + 0x15E, + 0x23C, + 0x206, + 0x1B2, + 0x147, + 0x19E, + }}; +#endif + +static void load_table(u8 *table, const u8 *source, bool &loadedBool) { - if(loadedBool) + if (loadedBool) { return; } +#if USE_COMPRESSED_DATA LZ77UnCompWram(source, table); +#endif loadedBool = true; } PokemonTables::PokemonTables() - : exp_groups_loaded(false) - , gender_ratios_loaded(false) - , num_abilities_loaded(false) - , first_moves_loaded(false) - , power_points_loaded(false) - , event_pkmn_loaded(false) - , types_loaded(false) - , input_charset_type(0) - , gen3_charset_type(0) + : exp_groups_loaded(false), gender_ratios_loaded(false), num_abilities_loaded(false), first_moves_loaded(false), power_points_loaded(false), event_pkmn_loaded(false), types_loaded(false), input_charset_type(0), gen3_charset_type(0) { } void PokemonTables::load_exp_groups() { +#if USE_COMPRESSED_DATA load_table(EXP_GROUPS, EXP_GROUPS_lz10_bin, exp_groups_loaded); +#endif } void PokemonTables::load_gender_ratios() { +#if USE_COMPRESSED_DATA load_table(GENDER_RATIO, GENDER_RATIO_lz10_bin, gender_ratios_loaded); +#endif } void PokemonTables::load_num_abilities() { - load_table((uint8_t*)NUM_ABILITIES, NUM_ABILITIES_lz10_bin, num_abilities_loaded); +#if USE_COMPRESSED_DATA + load_table((uint8_t *)NUM_ABILITIES, NUM_ABILITIES_lz10_bin, num_abilities_loaded); +#endif } void PokemonTables::load_first_moves() { +#if USE_COMPRESSED_DATA load_table(FIRST_MOVES, FIRST_MOVES_lz10_bin, first_moves_loaded); +#endif } void PokemonTables::load_power_points() { +#if USE_COMPRESSED_DATA load_table(POWER_POINTS, POWER_POINTS_lz10_bin, power_points_loaded); +#endif } void PokemonTables::load_event_pkmn() { - load_table((uint8_t*)EVENT_PKMN, EVENT_PKMN_lz10_bin, event_pkmn_loaded); +#if USE_COMPRESSED_DATA + load_table((uint8_t *)EVENT_PKMN, EVENT_PKMN_lz10_bin, event_pkmn_loaded); +#endif } void PokemonTables::load_types() { - load_table((uint8_t*)TYPES, TYPES_lz10_bin, types_loaded); +#if USE_COMPRESSED_DATA + load_table((uint8_t *)TYPES, TYPES_lz10_bin, types_loaded); +#endif } -void PokemonTables::load_input_charset(byte gen, byte lang) +void PokemonTables::load_input_charset(byte gen, Language lang) { const u8 desired_charset = (gen << 4) | (lang); - if(input_charset_type == desired_charset) + if (input_charset_type == desired_charset) { return; } @@ -806,19 +3414,19 @@ void PokemonTables::load_input_charset(byte gen, byte lang) input_charset_type = desired_charset; } -void PokemonTables::load_gen3_charset(byte lang) +void PokemonTables::load_gen3_charset(Language lang) { // transform lang into the value that would get stored in gen3_charset_index - if(lang == KOR_ID) + if (lang == KOREAN) { - lang = JPN_ID; + lang = JAPANESE; } - else if(lang != JPN_ID) + else if (lang != JAPANESE) { - lang = ENG_ID; + lang = ENGLISH; } - if(gen3_charset_type == lang) + if (gen3_charset_type == lang) { return; } @@ -845,12 +3453,20 @@ u8 PokemonTables::get_gender_threshold(int index_num, bool is_gen_3) // If the Pokemon has two abilities it returns a 1, since ability 1 is valid. Otherwise it returns 0 bool PokemonTables::get_num_abilities(int index_num) { + if (index_num == 0x115) // Hardcode Treecko - dumb, but it works + { + return 0; // Treecko only has one ability; + } load_num_abilities(); return NUM_ABILITIES[index_num]; } bool PokemonTables::can_learn_move(int pkmn_index, int move_index) { + if (move_index == 0) + { + return false; + } byte data_byte = MOVESETS[pkmn_index][move_index / 8]; data_byte |= MOVESETS[EVOLUTIONS[pkmn_index]][move_index / 8]; // add in the previous evolution's moves (if they exist) data_byte |= MOVESETS[EVOLUTIONS[EVOLUTIONS[pkmn_index]]][move_index / 8]; // add in the first evolution's moves (if they exist) @@ -869,8 +3485,7 @@ byte PokemonTables::get_gen_3_char(u16 input_char) } // This table indicates the index of each specific charset in their generations' charsets file -static const u8 localization_charset_indices[] -{ +static const u8 localization_charset_indices[]{ 0, // gen 1 JPN 1, // gen 1 ENG 2, // gen 1 FR/GER @@ -894,17 +3509,17 @@ static const u8 localization_charset_indices[] 0, // gen 3 KOR -> JPN }; -void load_localized_charset(u16 *output_char_array, byte gen, byte lang) +void load_localized_charset(u16 *output_char_array, byte gen, Language lang) { u8 generation_charsets[2048]; const u8 *input_data; - // in the localization_charset_indices list, // gen 1 starts first and every gen has 7 entries (1 per language) // however, the language values are 1-based, so we need to convert to 0-based const u8 lang_index = localization_charset_indices[(gen - 1) * 7 + (lang - 1)]; - switch(gen) +#if USE_COMPRESSED_DATA + switch (gen) { case 1: input_data = gen_1_charsets_lz10_bin; @@ -921,14 +3536,32 @@ void load_localized_charset(u16 *output_char_array, byte gen, byte lang) } LZ77UnCompWram(input_data, generation_charsets); +#else + switch (gen) + { + case 1: + memcpy(generation_charsets, gen_1_charsets, 4 * 256); + break; + case 2: + memcpy(generation_charsets, gen_2_charsets, 4 * 256); + break; + case 3: + memcpy(generation_charsets, gen_3_charsets, 4 * 256); + break; + default: + // Invalid generation, return without doing anything + return; + } - memcpy(output_char_array, generation_charsets + (lang_index * 256 * sizeof(u16)), 256 * sizeof(u16)); // copy the charset into the output array +#endif + + memcpy(output_char_array, generation_charsets + (lang_index * 256 * sizeof(u16)), 256 * sizeof(u16)); // copy the charset into the output array } byte get_char_from_charset(const u16 *charset, u16 input_char) { u16 i = 0; - while(i < 256) + while (i < 256) { if (charset[i] == input_char) { diff --git a/source/pokemon.cpp b/source/pokemon.cpp deleted file mode 100644 index 31ae81e..0000000 --- a/source/pokemon.cpp +++ /dev/null @@ -1,1142 +0,0 @@ -#include -#include "libstd_replacements.h" -#include "pokemon.h" -#include "pokemon_data.h" -#include "random.h" -#include "save_data_manager.h" -#include "debug_mode.h" -#include "text_engine.h" -#include "JPN_NAMES_lz10_bin.h" - -Pokemon::Pokemon() {}; - -// TODO: Rewrite this with two different classes/structs that have arrays as input/output -// GBpkmn and GBApkmn -// A lot of the event Pokemon script is reused. Really should be split into many different functions -// Endian-ness too is all over the place... :/ - -void Pokemon::load_data(int index, const byte *party_data, int game, int lang) -{ - language = lang; - if (lang == JPN_ID) - { - switch (game) - { - case GREEN_ID: - case RED_ID: - case BLUE_ID: - case YELLOW_ID: - gen = 1; - pkmn_size = 44; - ot_size = 6; - nickname_size = 6; - box_size = 30; - break; - case GOLD_ID: - case SILVER_ID: - case CRYSTAL_ID: - gen = 2; - pkmn_size = 32; - ot_size = 6; - nickname_size = 6; - box_size = 30; - break; - } - } - else - { - switch (game) - { - case RED_ID: - case BLUE_ID: - case YELLOW_ID: - gen = 1; - pkmn_size = 33; - ot_size = 11; - nickname_size = 11; - box_size = 20; - break; - case GOLD_ID: - case SILVER_ID: - case CRYSTAL_ID: - gen = 2; - pkmn_size = 32; - ot_size = 11; - nickname_size = 11; - box_size = 20; - break; - } - } - int party_species_offset = - 1 + // the num pkmn byte - (1 * index); // the pkmn index we're looking for - - int box_struct_offset = - 1 + // the num of pkmn byte - (1 * box_size) + 1 + // list of pkmn in box and terminator - (pkmn_size * index); // the pokemon we're looking for - - int ot_offset = - 1 + // the num of pkmn byte - (1 * box_size) + 1 + // list of pkmn in box and terminator - (pkmn_size * box_size) + // the pokemon structs - (ot_size * index); // the ot we're looking for - - int nickname_offset = - 1 + // the num of pkmn byte - (1 * box_size) + 1 + // list of pkmn in box and terminator - (pkmn_size * box_size) + // the pokemon structs - (ot_size * box_size) + // the ots - (nickname_size * index); // the nickname we're looking for - - num_in_box = party_data[0]; - index_in_box = index; - - switch (gen) - { - case 1: - // ptgb_write(ptgb::to_string(party_data[1121])); - // while (true){}; - species_index_party = party_data[party_species_offset]; - species_index_struct = party_data[box_struct_offset + 0x00]; - met_level = party_data[box_struct_offset + 0x03]; - copy_from_to(&party_data[box_struct_offset + 0x08], &moves[0], 4, false); - copy_from_to(&party_data[box_struct_offset + 0x0C], &trainer_id[0], 2, false); - exp = 0; - for (int i = 0; i < 3; i++) - { - exp += party_data[box_struct_offset + 0x0E + i]; - } - copy_from_to(&party_data[box_struct_offset + 0x1B], &dvs[0], 2, false); - copy_from_to(&party_data[box_struct_offset + 0x1D], &pp_values[0], 4, false); - copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); - copy_from_to(&party_data[ot_offset], &trainer_name[0], 7, false); - // Data not in gen 1 - pokerus = 0x00; - caught_data[0] = 0x00; - caught_data[1] = 0x00; - item = 0; - - break; - case 2: - species_index_party = party_data[party_species_offset]; - species_index_struct = party_data[box_struct_offset + 0x00]; - item = party_data[box_struct_offset + 0x01]; - copy_from_to(&party_data[box_struct_offset + 0x02], &moves[0], 4, false); - copy_from_to(&party_data[box_struct_offset + 0x06], &trainer_id[0], 2, false); - exp = 0; - for (int i = 0; i < 3; i++) - { - exp += party_data[box_struct_offset + 0x08 + i] << (8 * (2 - i)); - } - copy_from_to(&party_data[box_struct_offset + 0x15], &dvs[0], 2, false); - copy_from_to(&party_data[box_struct_offset + 0x17], &pp_values[0], 4, false); - pokerus = party_data[box_struct_offset + 0x1C]; - copy_from_to(&party_data[box_struct_offset + 0x1D], &caught_data[0], 2, false); - met_level = party_data[box_struct_offset + 0x1F]; - copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); - copy_from_to(&party_data[ot_offset + 0x00], &trainer_name[0], 7, false); - break; - } - - // box_struct_offset = 0; - if (SHOW_DATA_PACKETS) - { - tte_set_pos(8, 120); - ptgb_write("struct offset: "); - ptgb_write(ptgb::to_string(box_struct_offset)); - ptgb_write("\nbox_size: "); - ptgb_write(ptgb::to_string(box_size)); - ptgb_write("\npkmn_size: "); - ptgb_write(ptgb::to_string(pkmn_size)); - ptgb_write("\nindex: "); - ptgb_write(ptgb::to_string(index)); - ptgb_write(", game: "); - ptgb_write(ptgb::to_string(game)); - while (!key_hit(KEY_A)) - { - global_next_frame(); - } - global_next_frame(); - } -} -void Pokemon::convert_to_gen_three(PokemonTables& data_tables, Conversion_Types conv_type, bool simplified, bool stabilize_mythical) -{ - // Convert the species indexes - if (gen == 1) - { - if (species_index_struct > 190) - { - species_index_struct = 0; - } - else - { - species_index_struct = gen_1_index_array[species_index_struct]; - if (species_index_struct == 0xFF) - { - is_missingno = true; - species_index_struct = 0x89; // Porygon - } - } - species_index_party = species_index_struct; - } - - if ( // index_in_box % 4 == 0 || - (species_index_struct > NUM_POKEMON - (get_treecko_enabled() ? 0 : 1)) || // Checks if the Pokemon is beyond the supported Pokemon - species_index_struct == 0 || // Checks that the Pokemon isn't a blank party space - species_index_struct != species_index_party || // Checks that the Pokemon isn't a hybrid or an egg - index_in_box >= num_in_box || // Checks that we're not reading beyond the Pokemon in the box - item != 0) // Checks that the Pokemon doesn't have an item - { - if (!DONT_HIDE_INVALID_PKMN) - { - is_valid = false; - return; - } - } - is_valid = true; - - nature_mod = exp % 25; // save the nature mod in case the level is changed - // Update dex if not simple - if (!simplified && !is_caught(species_index_struct)) - { - is_new = true; - set_caught(species_index_struct); - } - - // Set nickname - if (language == KOR_ID) - { - u16 JPN_NAMES[POKEMON_ARRAY_SIZE * 6]; - gen_3_pkmn[18] = JPN_ID; // Set to JPN - byte new_nickname[10]; - byte new_ot[7]; - u16 cur_char; - - data_tables.load_gen3_charset(language); - - LZ77UnCompWram(JPN_NAMES_lz10_bin, (u8*)JPN_NAMES); - - for (int i = 0; i < 6; i++) - { // Read the JPN name and convert it - cur_char = JPN_NAMES[species_index_struct * 6]; - new_nickname[i] = data_tables.get_gen_3_char(cur_char); - } - - if (gen == 1) - { - // レッド (Red) - new_ot[0] = 0x7A; // レ - new_ot[1] = 0xA0; // ッ - new_ot[2] = 0x95; // ド - new_ot[3] = 0xFF; - } - else - { - if (((caught_data[1] & 0b10000000) >> 7) == 1) // Checks if the Gen 2 player is male or female - { - // クリス (Kurisu) - new_ot[0] = 0x58; // ク - new_ot[1] = 0x78; // リ - new_ot[2] = 0x5D; // ス - new_ot[3] = 0xFF; - } - else - { - // ヒビキ (Hibiki) - new_ot[0] = 0x6B; // ヒ - new_ot[1] = 0x97; // ビ - new_ot[2] = 0x57; // キ - new_ot[3] = 0xFF; - } - } - copy_from_to(&new_nickname[0], &gen_3_pkmn[8], 10, false); // Nickname - copy_from_to(&new_ot[0], &gen_3_pkmn[20], 7, false); // OT Name - } - else - { - gen_3_pkmn[18] = language; // Language - - data_tables.load_input_charset(gen, language); - data_tables.load_gen3_charset(language); - copy_from_to(convert_text(data_tables, &nickname[0], 10), &gen_3_pkmn[8], 10, false); // Nickname - copy_from_to(convert_text(data_tables, &trainer_name[0], 7), &gen_3_pkmn[20], 7, false); // OT Name - } - - // Make sure Level is not over 100 based on EXP - u32 max_exp = data_tables.get_max_exp(species_index_struct); - if (exp > max_exp) - { - exp = max_exp; - } - - // Truncate the EXP down to the current level - if (conv_type == Virtual) - { - data_tables.load_exp_groups(); - switch (data_tables.EXP_GROUPS[species_index_struct]) - { - case EXP_FAST: - exp = (4 * (met_level * met_level * met_level)) / 5; - break; - - case EXP_MED_FAST: - exp = (met_level * met_level * met_level); - break; - - case EXP_MED_SLOW: - exp = ((6 * met_level * met_level * met_level) / 5) - (15 * met_level * met_level) + (100 * met_level) - 140; - break; - - case EXP_SLOW: - exp = (5 * (met_level * met_level * met_level)) / 4; - break; - } - } - - // Check if shiny - is_shiny = - ((dvs[1] == 0b10101010) && // Checks if the Speed and Special DVs equal 10 - ((dvs[0] & 0xF) == 0b1010) && // Checks if the Defense DVs equal 10 - ((dvs[0] & 0b00100000) >> 5)); // Checks if the second bit of the Attack DV is true - - if (species_index_struct == 52 && fnv1a_hash(nickname, 7) == 1515822901 && - (fnv1a_hash(trainer_name, 7) == 2671449886 || fnv1a_hash(trainer_name, 7) == 1342961308)) - { - is_shiny = true; - dvs[0] = 0xFF; - dvs[1] = 0xFF; - } - - if (species_index_struct == 201) // Checks if the Pokemon is Unown - { - unown_letter = 0; - unown_letter |= ((dvs[0] >> 5) & 0b11) << 6; - unown_letter |= ((dvs[0] >> 1) & 0b11) << 4; - unown_letter |= ((dvs[1] >> 5) & 0b11) << 2; - unown_letter |= ((dvs[1] >> 1) & 0b11); - unown_letter = unown_letter / 10; - } - else - { - unown_letter = -1; - } - - if (simplified) - { - if ((species_index_struct == 151 || species_index_struct == 251) && exp < 560) // Minimum EXP for level 10 - { - met_level = 10; - } - return; - } - - // Separate the PP Up values from the Move PP values - for (int i = 0; i < 4; i++) - { - pure_pp_values[i] = (pp_values[i] & 0b00111111); // Take only the bottom six bits - if (conv_type == Virtual) - { - pp_bonus[i] = 0; // Reset bonus - } - else - { - pp_bonus[i] = (pp_values[i] >> 6); // Take only the top two bits - } - } - - if (conv_type == Legal) - { - // Check that the moves are valid - if (is_missingno) - { - moves[0] = 55; // Water Gun - moves[1] = 143; // Sky Attack - moves[2] = 6; // Pay Day - moves[3] = 20; // Bind - for (int i = 0; i < 4; i++) - { - pp_bonus[i] = 0; - } - } - else if ((species_index_struct != 0xEB) && (species_index_struct != 0xFC)) // Ignore Smeargle due to Sketch, Ignore Treecko because Treecko - { - for (int i = 0; i < 4; i++) - { - if ((!data_tables.can_learn_move(species_index_struct, moves[i])) && (moves[i] != 0)) - { - moves[i] = 0; // Remove the move - pp_bonus[i] = 0; // Remove the PP bonus - } - } - } - - // Make sure it has at least one move - if (moves[0] + moves[1] + moves[2] + moves[3] == 0) - { - moves[0] = data_tables.get_earliest_move(species_index_struct); - } - - // Bubble valid moves to the top - int i, j; - bool swapped; - for (i = 0; i < 3; i++) - { - swapped = false; - for (j = 0; j < 3 - i; j++) - { - if ((moves[j] < moves[j + 1]) && moves[j] == 0) - { - // Move the move *and* PP bonus up if there is a blank space - moves[j] = moves[j + 1]; - pp_bonus[j] = pp_bonus[j + 1]; - moves[j + 1] = 0; - pp_bonus[j + 1] = 0; - swapped = true; - } - } - - // If no two elements were swapped - // by inner loop, then break - if (swapped == false) - break; - } - } - // Restore the PP values - data_tables.load_power_points(); - for (int i = 0; i < 4; i++) - { - pure_pp_values[i] = data_tables.POWER_POINTS[moves[i]] + ((data_tables.POWER_POINTS[moves[i]] / 5) * pp_bonus[i]); - } - - // This is everything the mythical needs, don't change anything else - if (stabilize_mythical && (species_index_struct == 151 || species_index_struct == 251)) - { - set_to_event(data_tables, nature_mod); - return; - } - - // Generate PID - disable_auto_random(); - u32 n_pid; - if (ENABLE_MATCH_PID) - { - n_pid = generate_pid_iv_match(data_tables, species_index_struct, nature_mod, &dvs[0]); - ///n_pid = generate_pid_iv_legendary(data_tables, species_index_struct, &dvs[0], &ivs[0]); - - u16 curr_rand = get_rand_u16(); - ivs[0] = (curr_rand >> 0) & 0b11111; - ivs[1] = (curr_rand >> 5) & 0b11111; - ivs[2] = (curr_rand >> 10) & 0b11111; - curr_rand = get_rand_u16(); - ivs[3] = (curr_rand >> 0) & 0b11111; - ivs[4] = (curr_rand >> 5) & 0b11111; - ivs[5] = (curr_rand >> 10) & 0b11111; - - iv_egg_ability = 0; - for (int i = 0; i < 6; i++) - { - iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); - } - } - else - { - n_pid = generate_pid_save_iv(data_tables, species_index_struct, nature_mod, &dvs[0]); - - // Convert and set IVs - int hp_iv = 0; - for (int i = 0; i < 4; i++) - { - ivs[i + 1] = (dvs[i / 2] >> (((i + 1) % 2) * 4)) & 0b1111; - hp_iv |= ((ivs[i + 1] & 0x1) << i); - }; - ivs[0] = hp_iv; - ivs[5] = ivs[4]; - - for (int i = 0; i < 6; i++) - { - ivs[i] = (ivs[i] * 2) + 1; - iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); - } - } - for (int i = 0; i < 4; i++) - { - pid[i] = (n_pid >> (i * 8)) & 0xFF; - } - enable_auto_random(); - - // Determine and set Ability based off PID - iv_egg_ability |= ((pid[0] & 0x1) ? data_tables.get_num_abilities(species_index_struct) : 0) << 31; - - // Origin info - if (conv_type == Faithful || conv_type == Legal) - { - origin_info |= ((caught_data[1] & 0b10000000) << 8); // OT gender - We would shift left 15 bits, but the bit is already shifted over 7 - } - if (is_missingno) - { - origin_info |= (1 << 11); // Master Ball - } - else - { - origin_info |= (4 << 11); // Poke Ball - } - origin_info |= (((gen == 1 || conv_type == Legal) ? 4 : 7) << 7); // Game - - if (conv_type != Legal) - { - origin_info |= met_level; // Level met. Set to zero (ie do nothing) if legal, so it is "hatched" - } - - // Ribbons and Obedience - // ribbons[2] |= 0b00000100; // Artist Ribbon - if (species_index_struct == 151 || species_index_struct == 251) // Pokemon is Mew or Celebi - { - ribbons[3] |= 0b10000000; // Fateful Encounter flag - } - else if (is_missingno) - { - ribbons[3] |= 0b10000000; // Fateful Encounter flag - // ribbons[3] |= 0b00000100; // World Ribbon - } - - // Personality Value - copy_from_to(&pid[0], &gen_3_pkmn[0], 4, false); - // Trainer ID - copy_from_to(&trainer_id[0], &gen_3_pkmn[4], 2, true); - - // Check if the Pokemon is shiny - if (is_shiny) - { - secret_id[0] = trainer_id[1] ^ pid[0] ^ pid[2] ^ 0x0; // This value at the end should be random between 0 - 15, if that is to be implemented - secret_id[1] = trainer_id[0] ^ pid[1] ^ pid[3] ^ 0x0; - // Randomly shift by 16 (maybe) - } - else // Not shiny, make sure it isn't - { - secret_id[0] = dvs[0]; - secret_id[1] = dvs[1]; - - if (((trainer_id[0] ^ secret_id[0] ^ pid[0] ^ pid[2]) == 0) && - ((trainer_id[1] ^ secret_id[1] ^ pid[1] ^ pid[3]) < 8)) - { - secret_id[1] += 8; - } - } - copy_from_to(&secret_id[0], &gen_3_pkmn[6], 2, false); // Set SID - - gen_3_pkmn[19] = 0b00000010; // Egg Name (has species sanity flag) - gen_3_pkmn[27] = 0b00000000; // Markings - - // Data: - - // Reset the data sections (in case the player runs the program twice) - for (int i = 0; i < 12; i++) - { - data_section_G[i] = 0; - data_section_A[i] = 0; - data_section_E[i] = 0; - data_section_M[i] = 0; - } - - data_section_G[0] = (species_index_struct != 252 ? species_index_struct : 277); // Treecko check - data_section_G[1] = (species_index_struct != 252 ? 0x00 : 0x01); // Treecko check; - data_section_G[2] = (is_new ? 0x44 : 0x00); // Rare Candy if new - data_section_G[3] = 0x00; - for (int i = 0; i < 3; i++) - { - data_section_G[4 + i] = exp >> (8 * i); - } - data_section_G[8] = (pp_bonus[0] << 0 | pp_bonus[1] << 2 | pp_bonus[2] << 4 | pp_bonus[3] << 6); - - data_section_A[0] = moves[0]; // Move 1 - data_section_A[2] = moves[1]; // Move 2 - data_section_A[4] = moves[2]; // Move 3 - data_section_A[6] = moves[3]; // Move 4 - copy_from_to(&pure_pp_values[0], &data_section_A[8], 4, false); // PP Values - - // Data section E is all zero (EVs and Contest Stats) - - byte met_location = 0xFF; // Fateful Encounter - if (conv_type == Legal) - { - switch (species_index_struct) - { - case 144: // Articuno - met_location = 0x8B; // Seafoam Islands - break; - case 145: // Zapdos - met_location = 0x8E; // Power Plant - break; - case 146: // Moltres - met_location = 0xAF; // Mt. Ember - break; - case 150: // Mewtwo - met_location = 0x8D; // Cerulean Cave - break; - case 201: // Unown - met_location = 0xB8; // Tanoby Chambers - break; - case 243: // Raikou - met_location = 0x6E; // Route 10 - in reference to the Power Plant - break; - case 244: // Entei - met_location = 0x79; // Route 21 - in reference to the Cinnabar Volcano - break; - case 245: // Suicune - met_location = 0x7D; // Route 25 - in reference to their final encounter in HGSS - break; - case 249: // Lugia - case 250: // Ho-Oh - met_location = 0xAE; // Navel Rock - break; - default: - met_location == 0xD7; // Met in a trade? - break; - } - } - - data_section_M[0] = (conv_type == Virtual ? 0 : pokerus); - data_section_M[1] = met_location; // Met location, will be replaced by Pal Park in gen 4 - data_section_M[2] = origin_info & 0x00FF; // Lower origins info - data_section_M[3] = (origin_info >> 8) & 0xFF; // Upper origins info - for (int i = 0; i < 4; i++) - { - data_section_M[i + 4] = (iv_egg_ability >> (i * 8) & 0xFF); // Set IVs, Egg, and Ability - } - copy_from_to(&ribbons[0], &data_section_M[8], 4, false); // Ribbons and Fateful Encounter - - // Checksum: - checksum = 0x0000; - for (int i = 0; i < 12; i = i + 2) - { - checksum = checksum + ((data_section_G[i + 1] << 8) | data_section_G[i]); - checksum = checksum + ((data_section_A[i + 1] << 8) | data_section_A[i]); - checksum = checksum + ((data_section_E[i + 1] << 8) | data_section_E[i]); - checksum = checksum + ((data_section_M[i + 1] << 8) | data_section_M[i]); - } - - gen_3_pkmn[28] = checksum & 0xFF; - gen_3_pkmn[29] = (checksum & 0xFF00) >> 8; - - for (int i = 0; i < 4; i++) - { - encryption_key[i] = gen_3_pkmn[4 + i] ^ pid[i]; // XOR SID and TID with PID - } - - for (int i = 0; i < 12; i++) - { - unencrypted_data[i] = data_section_G[i]; - data_section_G[i] ^= encryption_key[i % 4]; - unencrypted_data[12 + i] = data_section_A[i]; - data_section_A[i] ^= encryption_key[i % 4]; - unencrypted_data[24 + i] = data_section_E[i]; - data_section_E[i] ^= encryption_key[i % 4]; - unencrypted_data[36 + i] = data_section_M[i]; - data_section_M[i] ^= encryption_key[i % 4]; - } - - // Puts the four data chunks into their correct locations based on the PID - alocate_data_chunks(data_section_G, data_section_A, data_section_E, data_section_M); - global_next_frame(); -} - -void Pokemon::copy_from_to(const byte *source, byte *destination, int size, bool reverse_endian) -{ - if (reverse_endian) - { - for (int i = 0; i < size; i++) - { - destination[(size - 1) - i] = source[i]; - } - } - else - { - memcpy(destination, source, size); - } -} - -void Pokemon::alocate_data_chunks(byte *G, byte *A, byte *E, byte *M) -{ - word full_pid = (pid[3] << 24 | pid[2] << 16 | pid[1] << 8 | pid[0]); - byte mod_pid = full_pid % 24; - unencrypted_data[48] = mod_pid; - // This is such a stupid way to do this, but I can't for the life of me find a formula for the permutation table. - switch (mod_pid) - { - case 0: - insert_data(G, A, E, M); - break; - case 1: - insert_data(G, A, M, E); - break; - case 2: - insert_data(G, E, A, M); - break; - case 3: - insert_data(G, E, M, A); - break; - case 4: - insert_data(G, M, A, E); - break; - case 5: - insert_data(G, M, E, A); - break; - case 6: - insert_data(A, G, E, M); - break; - case 7: - insert_data(A, G, M, E); - break; - case 8: - insert_data(A, E, G, M); - break; - case 9: - insert_data(A, E, M, G); - break; - case 10: - insert_data(A, M, G, E); - break; - case 11: - insert_data(A, M, E, G); - break; - case 12: - insert_data(E, G, A, M); - break; - case 13: - insert_data(E, G, M, A); - break; - case 14: - insert_data(E, A, G, M); - break; - case 15: - insert_data(E, A, M, G); - break; - case 16: - insert_data(E, M, G, A); - break; - case 17: - insert_data(E, M, A, G); - break; - case 18: - insert_data(M, G, A, E); - break; - case 19: - insert_data(M, G, E, A); - break; - case 20: - insert_data(M, A, G, E); - break; - case 21: - insert_data(M, A, E, G); - break; - case 22: - insert_data(M, E, G, A); - break; - case 23: - insert_data(M, E, A, G); - break; - } -} - -void Pokemon::insert_data(byte *first, byte *second, byte *third, byte *fourth) -{ - copy_from_to(&first[0], &gen_3_pkmn[32], 12, false); - copy_from_to(&second[0], &gen_3_pkmn[44], 12, false); - copy_from_to(&third[0], &gen_3_pkmn[56], 12, false); - copy_from_to(&fourth[0], &gen_3_pkmn[68], 12, false); -} - -byte Pokemon::get_gen_3_data(int index) -{ - return gen_3_pkmn[index]; -} - -byte *Pokemon::get_full_gen_3_array() -{ - return gen_3_pkmn; -} - -byte Pokemon::get_unencrypted_data(int index) -{ - return unencrypted_data[index]; -} - -byte *Pokemon::convert_text(PokemonTables& data_tables, byte *text_array, int size) -{ - for (int i = 0; i < size; i++) - { - text_array[i] = data_tables.get_gen_3_char(data_tables.input_charset[text_array[i]]); - } - return text_array; -} - -u32 Pokemon::generate_pid_iv_match(PokemonTables& data_tables, byte pid_species_index, byte nature, byte *pid_dvs) -{ - u32 new_pid = 0; - byte new_nature = 0; - byte new_gender = 0; - byte new_letter = 0; - int gen2_gender_threshold = data_tables.get_gender_threshold(pid_species_index, false); - int gen3_gender_threshold = data_tables.get_gender_threshold(pid_species_index, true); - bool gender = (((pid_dvs[0] >> 4) & 0b1111) < gen2_gender_threshold); - - do - { - new_pid = get_rand_u16() | (get_rand_u16() << 16); - new_nature = get_nature_from_pid(new_pid); - new_gender = get_gender_from_pid(new_pid); - new_letter = get_letter_from_pid(new_pid); - } while (!( - (unown_letter != -1 ? new_letter == unown_letter : true) && - new_nature == nature && - (gen2_gender_threshold != -1 - ? ((new_gender < gen3_gender_threshold) == gender) - : true))); - - return new_pid; -} - -u32 Pokemon::generate_pid_iv_legendary(byte pid_species_index, byte *pid_dvs, byte *out_ivs) -{ - // Convert and set IVs - - // This stores the DVs in the IV order - byte ivs[6] = { - (((dvs[0] >> 4) & 0b1) << 3) | - (((dvs[0] >> 0) & 0b1) << 2) | - (((dvs[1] >> 4) & 0b1) << 1) | - (((dvs[1] >> 0) & 0b1) << 0), - - (dvs[0] >> 4) & 0b1111, // Attack - (dvs[0] >> 0) & 0b1111, // Defense - (dvs[1] >> 4) & 0b1111, // Speed - (dvs[1] >> 0) & 0b1111, // Special Attack - (dvs[1] >> 0) & 0b1111, // Special Defense - }; - - u32 iv_low_rng; - u32 iv_high_rng; - u32 pid_high_rng; - u32 pid_low_rng; - u32 pid; - u32 seed; - - u32 comp; - u32 n_val; - u32 n_comp; - - for (int i = 0; i < 65535; i++) - { - // Generate the low IV byte, being the SpD, SpA, Spe - iv_low_rng = (i % 2) << 31 | (ivs[5] << 27) | (ivs[4] << 22) | (ivs[3] << 17) | (i >> 1); - iv_high_rng = get_rev_rand_u32(iv_low_rng); - pid_high_rng = get_rev_rand_u32(iv_high_rng); - pid_low_rng = get_rev_rand_u32(pid_high_rng); - seed = get_rev_rand_u32(pid_low_rng); - pid = ((pid_high_rng & 0xFFFF0000) << 0) | (pid_low_rng & 0xFFFF0000) >> 16; - - // Test it against the high IV byte, being the Def, Atk, HP - comp = (ivs[2] << 11) | (ivs[1] << 6) | (ivs[0] << 1); - n_val = (iv_high_rng >> 16) & 0b0111101111011110; - n_comp = comp & 0b0111101111011110; - - if (n_comp == n_val) - { - if ((pid % 25) % 6 == 0) - { - out_ivs[0] = (iv_low_rng >> 0) & 0b11111; // HP - out_ivs[1] = (iv_low_rng >> 5) & 0b11111; // Atk - out_ivs[2] = (iv_low_rng >> 10) & 0b11111; // Def - out_ivs[3] = (iv_high_rng >> 5) & 0b11111; // SpA - out_ivs[4] = (iv_high_rng >> 10) & 0b11111; // SpD - out_ivs[5] = (iv_high_rng >> 0) & 0b11111; // Spe - - return pid_low_rng | seed; - } - } - } - return 0; -} - -u8 Pokemon::get_letter_from_pid(u32 pid) -{ - return ( - ((pid & 0x03000000) >> 18) + - ((pid & 0x00030000) >> 12) + - ((pid & 0x00000300) >> 6) + - ((pid & 0x00000003) >> 0)) % - 28; -}; -u8 Pokemon::get_nature_from_pid(u32 pid) -{ - return (pid % 25); -}; -u8 Pokemon::get_gender_from_pid(u32 pid) -{ - return (pid & 0xFF); -}; - -u32 Pokemon::generate_pid_save_iv(PokemonTables &data_tables, byte pid_species_index, byte nature, byte *pid_dvs) -{ - // Set Unown Letter - u32 new_pid = 0; - if (pid_species_index == 0xC9) // Checks if the Pokemon is Unown - { - byte letter_mod = rand_reverse_mod(28, unown_letter); - for (int i = 0; i < 4; i++) - { - new_pid |= ((letter_mod >> (i * 2)) & 0b11) << (8 * i); - } - - // Randomize rest of PID - new_pid |= get_rand_u32() & 0xFCFCFCFC; - - // Set Nature - while ((new_pid % 25) != nature) - { - // Keep adding 0b100 to the PID until the nature matches - // 0b100 ensures that the 2 LSBs are maintained, as they determine the letter - new_pid = (new_pid & 0xFFFFFF00) | ((new_pid + 0b100) & 0xFF); - } - return new_pid; - } - else - { - // Set the correct gender for the Pokemon - new_pid |= get_rand_gender_byte(data_tables, pid_species_index, ((pid_dvs[0] >> 4) & 0b1111)); - - // Randomize rest of PID - new_pid |= get_rand_u32() & 0xFFFFFF00; - - // Set nature - while (new_pid % 25 != nature) - { - new_pid = new_pid + 256; - } - return new_pid; - } -} - -byte Pokemon::rand_reverse_mod(byte modulo_divisor, byte target_mod) -{ - return (modulo_divisor * get_rand_range(0, (255 - target_mod) / modulo_divisor)) + target_mod; -} - -byte Pokemon::get_rand_gender_byte(PokemonTables &data_tables, byte index_num, byte attack_DVs) -{ - byte gen2_threshold = data_tables.get_gender_threshold(index_num, false); - byte gen3_threshold = data_tables.get_gender_threshold(index_num, true); - if (gen2_threshold == -1) // Is one gender or is genderless - { - return get_rand_range(0, 256); - } - else if (attack_DVs < gen2_threshold) // Is Female - { - return get_rand_range(0, gen3_threshold); - } - else // Is Male - { - return get_rand_range(gen3_threshold, 256); - } -} - -byte Pokemon::get_dex_number() -{ - return (is_valid ? species_index_struct : 0); -} - -bool Pokemon::get_validity() -{ - return is_valid; -} - -bool Pokemon::get_is_shiny() -{ - return is_shiny; -} - -bool Pokemon::get_is_new() -{ - return (is_valid ? is_new : false); -} - -Simplified_Pokemon Pokemon::get_simple_pkmn() -{ - Simplified_Pokemon curr_pkmn; - curr_pkmn.dex_number = get_dex_number(); - curr_pkmn.met_level = met_level; - for (int i = 0; i < 10; i++) - { - curr_pkmn.nickname[i] = nickname[i]; - } - curr_pkmn.is_valid = get_validity(); - curr_pkmn.is_transferred = false; - curr_pkmn.is_shiny = get_is_shiny(); - curr_pkmn.unown_letter = unown_letter; - curr_pkmn.is_missingno = is_missingno; - return curr_pkmn; -} - -void Pokemon::set_to_event(PokemonTables &data_tables, byte nature) -{ - int event_id = 0; - if (species_index_struct == 151) - { - switch (language) - { - case JPN_ID: - case KOR_ID: - event_id = 0; - break; - case ENG_ID: - event_id = 1; - break; - case FRE_ID: - event_id = 2; - break; - case ITA_ID: - event_id = 3; - break; - case GER_ID: - event_id = 4; - break; - case SPA_ID: - event_id = 5; - break; - } - } - else - { - switch (language) - { - case JPN_ID: - case KOR_ID: - event_id = 6; - break; - case ENG_ID: - case FRE_ID: - case ITA_ID: - case GER_ID: - case SPA_ID: - event_id = 7; - break; - } - } - - data_tables.load_event_pkmn(); - // Load the event into the Pokemon array and unencrypted data array - for (int i = 0; i < 0x20; i++) - { - if (i == 0x08) - { - i += 10; // Skip over the nickname - } - gen_3_pkmn[i] = data_tables.EVENT_PKMN[event_id][i]; - } - - for (int i = 0; i < 12; i++) - { - data_section_G[i] = data_tables.EVENT_PKMN[event_id][i + 0x20 + 0]; - data_section_A[i] = data_tables.EVENT_PKMN[event_id][i + 0x20 + 12]; - data_section_E[i] = data_tables.EVENT_PKMN[event_id][i + 0x20 + 24]; - data_section_M[i] = data_tables.EVENT_PKMN[event_id][i + 0x20 + 36]; - } - - // insert moves and PP bonuses - data_section_G[8] = (pp_bonus[0] << 0 | pp_bonus[1] << 2 | pp_bonus[2] << 4 | pp_bonus[3] << 6); - data_section_A[0] = moves[0]; // Move 1 - data_section_A[2] = moves[1]; // Move 2 - data_section_A[4] = moves[2]; // Move 3 - data_section_A[6] = moves[3]; // Move 4 - - // get a new PID in the BACD_R format, and make sure it isn't shiny - disable_auto_random(); - u32 n_pid; - do - { - // Make the seed 16 bits long, per the BACD_R format - rand_set_seed(rand_get_seed() & 0xFFFF); - n_pid = (get_rand_u16() << 16) | get_rand_u16(); - for (int i = 0; i < 4; i++) - { - gen_3_pkmn[i] = (n_pid >> (i * 8)) & 0xFF; - pid[i] = (n_pid >> (i * 8)) & 0xFF; - }; - } while (((pid[0] ^ pid[2] ^ gen_3_pkmn[4] ^ gen_3_pkmn[6]) < 8) && - ((pid[1] ^ pid[3] ^ gen_3_pkmn[5] ^ gen_3_pkmn[7]) == 0) && - (n_pid % 25 != nature)); // maintain the nature - - // Set and fill the IVs - u16 curr_rand = get_rand_u16(); - ivs[0] = (curr_rand >> 0) & 0b11111; - ivs[1] = (curr_rand >> 5) & 0b11111; - ivs[2] = (curr_rand >> 10) & 0b11111; - curr_rand = get_rand_u16(); - ivs[3] = (curr_rand >> 0) & 0b11111; - ivs[4] = (curr_rand >> 5) & 0b11111; - ivs[5] = (curr_rand >> 10) & 0b11111; - - iv_egg_ability = 0; - for (int i = 0; i < 6; i++) - { - iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); - } - enable_auto_random(); - - // Determine and set Ability - iv_egg_ability |= ((pid[0] & 0x1) ? data_tables.get_num_abilities(species_index_struct) : 0) << 31; - - // Set IVs, Egg, and Ability - for (int i = 0; i < 4; i++) - { - data_section_M[i + 4] = (iv_egg_ability >> (i * 8) & 0xFF); - } - - // Determine and set OT gender - data_section_M[3] |= (caught_data[1] & 0b10000000); - - // Check the level - if (exp < 560) // Minimum EXP for level 10 - { - exp = 560; - } - - data_section_G[2] = (is_new ? 0x44 : 0x00); // Rare Candy if new - - // Update and set the checksum - checksum = 0x0000; - for (int i = 0; i < 12; i = i + 2) - { - checksum = checksum + ((data_section_G[i + 1] << 8) | data_section_G[i]); - checksum = checksum + ((data_section_A[i + 1] << 8) | data_section_A[i]); - checksum = checksum + ((data_section_E[i + 1] << 8) | data_section_E[i]); - checksum = checksum + ((data_section_M[i + 1] << 8) | data_section_M[i]); - } - - gen_3_pkmn[28] = checksum & 0xFF; - gen_3_pkmn[29] = (checksum & 0xFF00) >> 8; - - // Determine the encryption key - for (int i = 0; i < 4; i++) - { - encryption_key[i] = gen_3_pkmn[4 + i] ^ pid[i]; // XOR SID and TID with PID - } - - // Encrypt the data - for (int i = 0; i < 12; i++) - { - unencrypted_data[i] = data_section_G[i]; - data_section_G[i] ^= encryption_key[i % 4]; - unencrypted_data[12 + i] = data_section_A[i]; - data_section_A[i] ^= encryption_key[i % 4]; - unencrypted_data[24 + i] = data_section_E[i]; - data_section_E[i] ^= encryption_key[i % 4]; - unencrypted_data[36 + i] = data_section_M[i]; - data_section_M[i] ^= encryption_key[i % 4]; - } - - // Puts the four data chunks into their correct locations based on the PID - alocate_data_chunks(data_section_G, data_section_A, data_section_E, data_section_M); - return; -} diff --git a/source/pokemon_party.cpp b/source/pokemon_party.cpp index e9fc8a0..809f67f 100644 --- a/source/pokemon_party.cpp +++ b/source/pokemon_party.cpp @@ -1,6 +1,5 @@ #include "gameboy_colour.h" #include "pokemon_party.h" -#include "pokemon.h" #include "flash_mem.h" #include "debug_mode.h" #include "mystery_gift_injector.h" @@ -13,8 +12,9 @@ #include "gb_gen1_payloads_RB_lz10_bin.h" #include "gb_gen1_payloads_Y_lz10_bin.h" #include "gb_gen2_payloads_lz10_bin.h" +#include "save_data_manager.h" -static const byte gen1_rb_debug_box_data[0x462] = { +static byte gen1_rb_debug_box_data[0x462] = { // Num of Pokemon 0x14, // Pokemon 1-20 @@ -83,7 +83,7 @@ static const byte gen1_rb_debug_box_data[0x462] = { 0x91, 0x80, 0x93, 0x93, 0x80, 0x93, 0x80, 0x50, 0x50, 0x50, 0x50, 0x8F, 0x88, 0x83, 0x86, 0x84, 0x98, 0x50, 0x50, 0x50, 0x50, 0x50}; -static const byte gen2_debug_box_data[0x44E] = { +static byte gen2_debug_box_data[0x44E] = { // Num of Pokemon 0x14, // Pokemon 1-20 @@ -152,7 +152,9 @@ static const byte gen2_debug_box_data[0x44E] = { 0x92, 0x87, 0x94, 0x82, 0x8A, 0x8B, 0x84, 0x50, 0x50, 0x50, 0x50, 0x92, 0x87, 0x94, 0x82, 0x8A, 0x8B, 0x84, 0x50, 0x50, 0x50, 0x50}; -Pokemon_Party::Pokemon_Party() {}; +Pokemon_Party::Pokemon_Party() { + box.setTable(&table); +}; void Pokemon_Party::start_link() { @@ -160,30 +162,27 @@ void Pokemon_Party::start_link() { if (curr_gb_rom.generation == 1 && curr_gb_rom.version) { - for (int i = 0; i < 0x462; i++) - { - box_data_array[i] = gen1_rb_debug_box_data[i]; - } + box.loadData(1, ENGLISH, gen1_rb_debug_box_data); } else { - for (int i = 0; i < 0x44E; i++) - { - box_data_array[i] = gen2_debug_box_data[i]; - } + box.loadData(2, ENGLISH, gen2_debug_box_data); } } else { u16 debug_charset[256]; - load_localized_charset(debug_charset, 3, ENG_ID); + load_localized_charset(debug_charset, 3, ENGLISH); init_payload(); setup(debug_charset); - memset(box_data_array, 0, curr_gb_rom.box_data_size); - last_error = loop(&box_data_array[0], current_payload, &curr_gb_rom, simple_pkmn_array, debug_charset, false); + // This used to clear out the box data, probably isn't needed anymore + // memset(box_data_array, 0, curr_gb_rom.box_data_size); + + last_error = loop(&box_data_array[0], current_payload, &curr_gb_rom, &box, debug_charset, false); + box.loadData(curr_gb_rom.generation, (Language)curr_gb_rom.language, box_data_array); } } @@ -193,9 +192,9 @@ void Pokemon_Party::continue_link(bool cancel_connection) { u16 debug_charset[256]; - load_localized_charset(debug_charset, 3, ENG_ID); + load_localized_charset(debug_charset, 3, ENGLISH); - last_error = loop(&box_data_array[0], current_payload, &curr_gb_rom, simple_pkmn_array, debug_charset, cancel_connection); + last_error = loop(&box_data_array[0], current_payload, &curr_gb_rom, &box, debug_charset, cancel_connection); } } @@ -204,29 +203,30 @@ int Pokemon_Party::get_last_error() return last_error; } -Pokemon Pokemon_Party::get_converted_pkmn(PokemonTables& data_tables, int index) -{ - Pokemon converted_mon; - converted_mon.load_data(index, box_data_array, game, lang); - converted_mon.convert_to_gen_three(data_tables, Legal, false, stabilize_mythic); - has_new_pkmn = has_new_pkmn || converted_mon.get_is_new(); - simple_pkmn_array[index] = converted_mon.get_simple_pkmn(); - return converted_mon; -} - bool Pokemon_Party::get_has_new_pkmn() // If Pokemon is not in the dex { - return has_new_pkmn; + bool out = false; + for (int i = 0; i < box.getNumInBox(); i++) + { + + out |= !is_caught(box.getPokemon(i)->getSpeciesIndexNumber()); + } + return out; } bool Pokemon_Party::get_contains_mythical() { - return contains_mythical; + bool out = false; + for (int i = 0; i < box.getNumInBox(); i++) + { + out |= (box.getPokemon(i)->getSpeciesIndexNumber() == MEW || box.getPokemon(i)->getSpeciesIndexNumber() == CELEBI); + } + return out; } void Pokemon_Party::set_mythic_stabilization(bool stabilize) { - stabilize_mythic = stabilize; + box.stabilize_mythical = stabilize; } void Pokemon_Party::set_game(int nGame) @@ -269,7 +269,7 @@ bool Pokemon_Party::load_gb_rom() u32 rom_table_size; const u8 *cur; - switch(lang) + switch (lang) { case ENG_ID: compressed_rom_table = gb_rom_values_eng_lz10_bin; @@ -287,7 +287,7 @@ bool Pokemon_Party::load_gb_rom() LZ77UnCompWram(compressed_rom_table, gb_rom_table_buffer); cur = gb_rom_table_buffer; - while(cur < gb_rom_table_buffer + rom_table_size) + while (cur < gb_rom_table_buffer + rom_table_size) { const GB_ROM *rom_values = reinterpret_cast(cur); if (lang == rom_values->language && @@ -302,44 +302,30 @@ bool Pokemon_Party::load_gb_rom() return false; } - -Simplified_Pokemon Pokemon_Party::get_simple_pkmn(int index) -{ - return simple_pkmn_array[index]; -} - -bool Pokemon_Party::fill_simple_pkmn_array(PokemonTables &data_tables) -{ - contains_mythical = false; - for (int index = 0; index < get_num_pkmn(); index++) - { - Pokemon converted_mon; - converted_mon.load_data(index, box_data_array, game, lang); - converted_mon.convert_to_gen_three(data_tables, Legal, true, stabilize_mythic); - has_new_pkmn = has_new_pkmn || converted_mon.get_is_new(); - contains_mythical = contains_mythical || - converted_mon.get_dex_number() == 151 || converted_mon.get_dex_number() == 251; - simple_pkmn_array[index] = converted_mon.get_simple_pkmn(); - contains_valid |= converted_mon.get_validity(); - contains_invalid |= !converted_mon.get_validity(); - contains_missingno |= converted_mon.is_missingno; - } - return contains_valid || DONT_HIDE_INVALID_PKMN; -} - int Pokemon_Party::get_num_pkmn() { - return box_data_array[0]; + return box.getNumInBox(); } bool Pokemon_Party::get_contains_invalid() { - return contains_invalid; -} + bool out = false; + for (int i = 0; i < box.getNumInBox(); i++) + { + out |= !box.getGBPokemon(i)->isValid; + } + return out; +} bool Pokemon_Party::get_contains_missingno() { - return contains_missingno; + bool out = false; + for (int i = 0; i < box.getNumInBox(); i++) + { + + out |= box.getPokemon(i)->getSpeciesIndexNumber() == MISSINGNO; + } + return out; } void Pokemon_Party::init_payload() @@ -348,11 +334,11 @@ void Pokemon_Party::init_payload() const u8 *payload_src; u32 payload_file_size; - //WARNING: Ensure sure decompression_buffer is large enough! + // WARNING: Ensure sure decompression_buffer is large enough! - if(curr_gb_rom.generation == 1) + if (curr_gb_rom.generation == 1) { - if(curr_gb_rom.version == YELLOW_ID) + if (curr_gb_rom.version == YELLOW_ID) { payload_src = gb_gen1_payloads_Y_lz10_bin; } diff --git a/source/random.cpp b/source/random.cpp index f4c4432..2c6c98c 100644 --- a/source/random.cpp +++ b/source/random.cpp @@ -1,11 +1,11 @@ -#include "random.h" #include +#include "random.h" unsigned int u32_rand; void rand_set_seed(unsigned int init_seed) { - u32_rand = init_seed; + u32_rand = init_seed + 1; } unsigned int rand_get_seed() diff --git a/source/rom_data.cpp b/source/rom_data.cpp index a4b7e67..755da4d 100644 --- a/source/rom_data.cpp +++ b/source/rom_data.cpp @@ -12,7 +12,7 @@ #include "gba_rom_values_jpn_lz10_bin.h" #include "gba_rom_values_spa_lz10_bin.h" -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; rom_data::rom_data() {} bool rom_data::load_rom() @@ -124,9 +124,9 @@ void rom_data::fill_values(const ROM_DATA *rom_values) all_collected_flag = rom_values->unused_flag_start; // The flag for if everything has been collected pkmn_collected_flag_start = rom_values->unused_flag_start + 1; // The beginning of the flags for each of the Pokemon - map_bank = (ENABLE_OLD_EVENT ? rom_values->old_map_bank : rom_values->map_bank); - map_id = (ENABLE_OLD_EVENT ? rom_values->old_map_id : rom_values->map_id); - npc_id = (ENABLE_OLD_EVENT ? rom_values->old_npc_id : rom_values->npc_id); + map_bank = rom_values->map_bank; + map_id = rom_values->map_id; + npc_id = rom_values->npc_id; npc_palette = rom_values->npc_palette; def_map_bank = rom_values->def_map_bank; diff --git a/source/script_array.cpp b/source/script_array.cpp index 78e831e..cb735f9 100644 --- a/source/script_array.cpp +++ b/source/script_array.cpp @@ -67,7 +67,7 @@ Box_Menu box_viewer; // DIA_ERROR_DISCONNECT // // Pause the transfer and show the user their box data -// CMD_LOAD_SIMP +// CMD_IS_A_VALID_PKMN // DIA_NO_VALID_PKMN // COND_SOME_INVALID_PKMN // DIA_SOME_INVALID_PKMN @@ -364,9 +364,9 @@ const script_obj_params transfer_script_params[SCRIPT_SIZE] = { .conditional_index = CMD_MYTHIC_MENU, .next_if_true = COND_CHECK_MISSINGNO }, - // CMD_LOAD_SIMP + // CMD_IS_A_VALID_PKMN { - .conditional_index = CMD_LOAD_SIMP, + .conditional_index = CMD_IS_A_VALID_PKMN, .next_if_true = COND_SOME_INVALID_PKMN, .next_if_false = DIA_NO_VALID_PKMN }, @@ -389,7 +389,7 @@ const script_obj_params transfer_script_params[SCRIPT_SIZE] = { // COND_ERROR_DISCONNECT { .conditional_index = COND_ERROR_DISCONNECT, - .next_if_true = CMD_LOAD_SIMP, + .next_if_true = CMD_IS_A_VALID_PKMN, .next_if_false = DIA_ERROR_DISCONNECT }, // COND_ERROR_COM_ENDED @@ -640,7 +640,7 @@ const script_obj_params event_script_params[SCRIPT_SIZE] = { {}, // CMD_CONTINUE_LINK {}, // CMD_BOX_MENU {}, // CMD_MYTHIC_MENU - {}, // CMD_LOAD_SIMP + {}, // CMD_IS_A_VALID_PKMN {}, // CMD_CANCEL_LINK {}, // CMD_END_MISSINGNO {}, // COND_ERROR_TIMEOUT_ONE @@ -689,7 +689,7 @@ void populate_lang_menu() langs.add_option(GENERAL_option_german, GER_ID); langs.add_option(GENERAL_option_italian, ITA_ID); langs.add_option(GENERAL_option_korean, KOR_ID); - // Removing the cancel option for the time being, since canceling the + // TODO: Removing the cancel option for the time being, since canceling the // link trade when there is no link connection crashes the game // langs.add_option(GENERAL_option_cancel, UINT8_MAX); } @@ -727,12 +727,6 @@ void populate_game_menu(int lang) } } -static bool __attribute__((noinline)) load_simple_party_data() -{ - PokemonTables data_tables; - return party_data.fill_simple_pkmn_array(data_tables); -} - bool run_conditional(int index) { // Here is most of the logic that drives what lines show up where. It's probably not the best way to code it, but it works @@ -758,10 +752,10 @@ bool run_conditional(int index) return party_data.get_last_error() != COND_ERROR_COLOSSEUM; case COND_BEAT_E4: - return read_flag(curr_rom.e4_flag) || IGNORE_MG_E4_FLAGS; + return read_flag(curr_GBA_rom.e4_flag) || IGNORE_MG_E4_FLAGS; case COND_MG_ENABLED: - return read_flag(curr_rom.mg_flag) || IGNORE_MG_E4_FLAGS; + return read_flag(curr_GBA_rom.mg_flag) || IGNORE_MG_E4_FLAGS; case COND_TUTORIAL_COMPLETE: return get_tutorial_flag() && !FORCE_TUTORIAL; @@ -770,16 +764,16 @@ bool run_conditional(int index) return party_data.get_has_new_pkmn(); case COND_IS_HOENN_RS: - return curr_rom.is_ruby_sapphire(); + return curr_GBA_rom.is_ruby_sapphire(); case COND_IS_FRLGE: - return !curr_rom.is_ruby_sapphire(); + return !curr_GBA_rom.is_ruby_sapphire(); case COND_MG_OTHER_EVENT: - return compare_map_and_npc_data(curr_rom.def_map_bank, curr_rom.def_map_id, curr_rom.def_npc_id) && !IGNORE_MG_E4_FLAGS; + return compare_map_and_npc_data(curr_GBA_rom.def_map_bank, curr_GBA_rom.def_map_id, curr_GBA_rom.def_npc_id) && !IGNORE_MG_E4_FLAGS; case COND_PKMN_TO_COLLECT: - return compare_map_and_npc_data(curr_rom.map_bank, curr_rom.map_id, curr_rom.npc_id) && !read_flag(curr_rom.all_collected_flag) && !IGNORE_UNRECEIVED_PKMN; + return compare_map_and_npc_data(curr_GBA_rom.map_bank, curr_GBA_rom.map_id, curr_GBA_rom.npc_id) && !read_flag(curr_GBA_rom.all_collected_flag) && !IGNORE_UNRECEIVED_PKMN; case COND_GB_ROM_EXISTS: return party_data.load_gb_rom(); @@ -804,7 +798,7 @@ bool run_conditional(int index) return party_data.get_contains_invalid(); case COND_IS_HOENN_E: - return curr_rom.gamecode == EMERALD_ID; + return curr_GBA_rom.gamecode == EMERALD_ID; case COND_CHECK_MISSINGNO: if (party_data.get_contains_missingno()) @@ -824,7 +818,7 @@ bool run_conditional(int index) return true; case CMD_IMPORT_POKEMON: - inject_mystery(party_data); + inject_mystery(&party_data.box); return true; case CMD_BACK_TO_MENU: @@ -901,7 +895,7 @@ bool run_conditional(int index) case CMD_BOX_MENU: hide_text_box(); - ret = (box_viewer.box_main(party_data) == CONFIRM_BUTTON); + ret = (box_viewer.box_main(&party_data.box) == CONFIRM_BUTTON); show_text_box(); return ret; @@ -909,8 +903,8 @@ bool run_conditional(int index) party_data.set_mythic_stabilization(yes_no_menu.button_main()); return true; - case CMD_LOAD_SIMP: - return load_simple_party_data(); + case CMD_IS_A_VALID_PKMN: + return party_data.box.getNumValid() > 0; case CMD_CANCEL_LINK: party_data.continue_link(true); diff --git a/source/script_var.cpp b/source/script_var.cpp index 16bbb43..3b8d802 100644 --- a/source/script_var.cpp +++ b/source/script_var.cpp @@ -5,7 +5,7 @@ #include "debug_mode.h" #include "global_frame_controller.h" -extern rom_data curr_rom; +extern rom_data curr_GBA_rom; script_var::script_var(u32 nValue, ptgb::vector &var_list_ref, int *nCurr_loc_ptr) { @@ -77,7 +77,7 @@ void asm_var::fill_refrences(u8 mg_array[]) { for (int j = 0; j < 4; j++) { - mg_array[location_list[i] + j] += (start_location_in_script + curr_rom.loc_gSaveBlock1 + curr_rom.offset_ramscript + 7) >> (j * 8); + mg_array[location_list[i] + j] += (start_location_in_script + curr_GBA_rom.loc_gSaveBlock1 + curr_GBA_rom.offset_ramscript + 7) >> (j * 8); } } else @@ -89,7 +89,7 @@ void asm_var::fill_refrences(u8 mg_array[]) u32 asm_var::get_loc_in_sec30() { - return start_location_in_script + curr_rom.loc_gSaveDataBuffer + 3; // plus 3 to offset the -2 in set_start, and one for reading as thumb + return start_location_in_script + curr_GBA_rom.loc_gSaveDataBuffer + 3; // plus 3 to offset the -2 in set_start, and one for reading as thumb } // XSE VAR ---------------- @@ -132,7 +132,7 @@ void xse_var::fill_refrences(u8 mg_array[]) u32 xse_var::get_loc_in_sec30() { - return start_location_in_script + curr_rom.loc_gSaveDataBuffer; + return start_location_in_script + curr_GBA_rom.loc_gSaveDataBuffer; } // TEXTBOX VAR @@ -145,7 +145,7 @@ void textbox_var::set_text(const byte nText[]) void textbox_var::set_start() { - start_location_in_script = *curr_loc_ptr - (ENABLE_OLD_EVENT * 4); + start_location_in_script = *curr_loc_ptr; } void textbox_var::set_virtual_start() @@ -166,7 +166,7 @@ void textbox_var::insert_text(const u16 *charset, u8 mg_array[], bool should_set for (int parser = 0; parser < text_length; parser++) { - if (curr_rom.is_hoenn() && (text[parser] == 0xFC) && (get_char_from_charset(charset, (char16_t)(text[parser + 1])) == 0x01)) // Removes colored text + if (curr_GBA_rom.is_hoenn() && (text[parser] == 0xFC) && (get_char_from_charset(charset, (char16_t)(text[parser + 1])) == 0x01)) // Removes colored text { parser += 2; } @@ -216,7 +216,7 @@ void sprite_var::insert_sprite_data(u8 mg_array[], const unsigned int sprite_arr { set_start(); - u32 pointer = curr_rom.loc_gSaveDataBuffer + *curr_loc_ptr + 8; + u32 pointer = curr_GBA_rom.loc_gSaveDataBuffer + *curr_loc_ptr + 8; for (int i = 0; i < 4; i++) { mg_array[*curr_loc_ptr] = pointer >> (8 * i); @@ -255,7 +255,7 @@ void music_var::insert_music_data(u8 mg_array[], u8 blockCount, u8 priority, u8 { for (unsigned int i = 0; i < trackArrays.size(); i++) { - trackPointers.push_back(*curr_loc_ptr + curr_rom.loc_gSaveDataBuffer); + trackPointers.push_back(*curr_loc_ptr + curr_GBA_rom.loc_gSaveDataBuffer); for (unsigned int j = 0; j < trackArrays[i].size(); j++) { mg_array[(*curr_loc_ptr)++] = trackArrays[i][j]; diff --git a/source/select_menu.cpp b/source/select_menu.cpp index 8f6cc0d..fd8ae1d 100644 --- a/source/select_menu.cpp +++ b/source/select_menu.cpp @@ -2,6 +2,7 @@ #include "sprite_data.h" #include "translated_text.h" #include "text_data_table.h" +#include "global_frame_controller.h" #define TEXT_HEIGHT 10 #define TEXT_WIDTH 8 diff --git a/source/sprite_data.cpp b/source/sprite_data.cpp index 49ac7ca..96faec7 100644 --- a/source/sprite_data.cpp +++ b/source/sprite_data.cpp @@ -3,6 +3,7 @@ #include "sprite_data.h" #include "debug_mode.h" #include "gba_rom_values/base_gba_rom_struct.h" +#include "global_frame_controller.h" #define SPRITE_CHAR_BLOCK 4 @@ -464,7 +465,7 @@ void load_eternal_sprites() obj_set_pos(up_arrow, 14 * 8, 3 * 8); } -void load_temp_box_sprites(Pokemon_Party *party_data) +void load_temp_box_sprites(PokeBox *box) { u32 curr_tile_id = global_tile_id_end; @@ -472,21 +473,21 @@ void load_temp_box_sprites(Pokemon_Party *party_data) { for (int i = 0; i < 30; i++) { - if (party_data->get_simple_pkmn(i).is_valid || DONT_HIDE_INVALID_PKMN) + GBPokemon *curr_pkmn = box->getGBPokemon(i); + if (curr_pkmn->isValid || DONT_HIDE_INVALID_PKMN) { - Simplified_Pokemon curr_pkmn = party_data->get_simple_pkmn(i); - int dex_num = curr_pkmn.dex_number; + int dex_num = curr_pkmn->getSpeciesIndexNumber(); if (dex_num == 201) { - dex_num = POKEMON_ARRAY_SIZE + curr_pkmn.unown_letter; + dex_num = POKEMON_ARRAY_SIZE + curr_pkmn->getUnownLetter(); } - else if (curr_pkmn.is_missingno) + else if (curr_pkmn->getSpeciesIndexNumber() == MISSINGNO) { dex_num = 0; } - u32 sprite_location = (*(u32 *)(curr_rom.loc_gMonIconTable + (dex_num * 4))); - int pal_num = *(byte *)(curr_rom.loc_gMonIconPaletteIndices + dex_num); + u32 sprite_location = (*(u32 *)(curr_GBA_rom.loc_gMonIconTable + (dex_num * 4))); + int pal_num = *(byte *)(curr_GBA_rom.loc_gMonIconPaletteIndices + dex_num); load_sprite(party_sprites[i], (const unsigned int *)sprite_location, 512, curr_tile_id, MENU_PAL_RED + pal_num, ATTR0_SQUARE, ATTR1_SIZE_32x32, 1); obj_set_pos(party_sprites[i], ((BOXMENU_SPRITE_WIDTH + BOXMENU_HSPACE) * (i % BOXMENU_HNUM)) + (BOXMENU_LEFT + BOXMENU_SPRITE_HOFFSET), ((BOXMENU_SPRITE_HEIGHT + BOXMENU_VSPACE) * (i / BOXMENU_HNUM)) + (BOXMENU_TOP + BOXMENU_SPRITE_VOFFSET)); obj_unhide(party_sprites[i], 0); @@ -499,10 +500,10 @@ void load_temp_box_sprites(Pokemon_Party *party_data) // Load the menu sprite palettes. Should this be done somewhere else? for (int i = 0; i < 3; i++) { - tonccpy((pal_obj_mem + ((MENU_PAL_RED + i) * 16)), (const unsigned short *)(curr_rom.loc_gMonIconPalettes + (i * 32)), 32); + tonccpy((pal_obj_mem + ((MENU_PAL_RED + i) * 16)), (const unsigned short *)(curr_GBA_rom.loc_gMonIconPalettes + (i * 32)), 32); } - load_sprite_compressed(grabbed_front_sprite, (const unsigned int *)*(u32 *)(curr_rom.loc_gMonFrontPicTable + (0 * 8)), curr_tile_id, PULLED_SPRITE_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); + load_sprite_compressed(grabbed_front_sprite, (const unsigned int *)*(u32 *)(curr_GBA_rom.loc_gMonFrontPicTable + (0 * 8)), curr_tile_id, PULLED_SPRITE_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); obj_set_pos(grabbed_front_sprite, 8, 16); } @@ -721,7 +722,7 @@ void load_select_sprites(u8 game_id, u8 lang) const unsigned int *gba_cart_tiles = 0; const unsigned short *gba_cart_palette = 0; - switch (curr_rom.gamecode) + switch (curr_GBA_rom.gamecode) { case RUBY_ID: @@ -852,7 +853,7 @@ void update_y_offset() obj_set_pos(flag, (8 * 11) + 4, (8 * 4) + 19 + y_offset); } -void update_front_box_sprite(Simplified_Pokemon *curr_pkmn) +void update_front_box_sprite(GBPokemon *curr_pkmn) { if (IGNORE_GAME_PAK || IGNORE_GAME_PAK_SPRITES) { @@ -860,23 +861,26 @@ void update_front_box_sprite(Simplified_Pokemon *curr_pkmn) } u32 curr_tile_id = global_tile_id_end + (30 * 16); - int dex_num = 0; - if (curr_pkmn->unown_letter > 1) + int dex_num = curr_pkmn->getSpeciesIndexNumber(); + if (dex_num == 201) { - dex_num = 412 + curr_pkmn->unown_letter; + if (curr_pkmn->getUnownLetter() > 1) + { + dex_num = 412 + curr_pkmn->getUnownLetter(); + } } - else if (curr_pkmn->is_missingno) + else if (curr_pkmn->getSpeciesIndexNumber() == MISSINGNO) { dex_num = 0; } - else + else if (curr_pkmn->getSpeciesIndexNumber() == TREECKO) { - dex_num = curr_pkmn->dex_number; + dex_num = 277; } - u32 sprite_location = *(u32 *)(curr_rom.loc_gMonFrontPicTable + (dex_num * 8)); - u32 palette_location = *(u32 *)((curr_pkmn->is_shiny ? curr_rom.loc_gMonShinyPaletteTable : curr_rom.loc_gMonPaletteTable) + (curr_pkmn->dex_number * 8)); + u32 sprite_location = *(u32 *)(curr_GBA_rom.loc_gMonFrontPicTable + (dex_num * 8)); + u32 palette_location = *(u32 *)((curr_pkmn->getIsShiny() ? curr_GBA_rom.loc_gMonShinyPaletteTable : curr_GBA_rom.loc_gMonPaletteTable) + (curr_pkmn->getSpeciesIndexNumber() * 8)); unsigned short buffer[16]; LZ77UnCompWram((const unsigned short *)palette_location, buffer); // This is a little silly, but it's being weird with bytes vs shorts when we copy it directly @@ -894,7 +898,7 @@ void update_front_box_sprite(Simplified_Pokemon *curr_pkmn) LZ77UnCompVram((const unsigned int *)sprite_location, &tile_mem[SPRITE_CHAR_BLOCK][curr_tile_id]); } -void update_menu_sprite(Pokemon_Party *party_data, int index, int frame) +void update_menu_sprite(PokeBox *box, int index, int frame) { if (IGNORE_GAME_PAK || IGNORE_GAME_PAK_SPRITES) { @@ -903,20 +907,25 @@ void update_menu_sprite(Pokemon_Party *party_data, int index, int frame) u32 curr_tile_id = global_tile_id_end + (index * 16); - Simplified_Pokemon curr_pkmn = party_data->get_simple_pkmn(index); - int dex_num = curr_pkmn.dex_number; + GBPokemon *curr_pkmn = box->getGBPokemon(index); + + int dex_num = curr_pkmn->getSpeciesIndexNumber(); if (dex_num == 201) { - if (curr_pkmn.unown_letter != 0) + if (curr_pkmn->getUnownLetter() > 1) { - dex_num = 0x19C + curr_pkmn.unown_letter; + dex_num = 412 + curr_pkmn->getUnownLetter(); } } - else if (curr_pkmn.is_missingno) + else if (curr_pkmn->getSpeciesIndexNumber() == MISSINGNO) { dex_num = 0; } + else if (curr_pkmn->getSpeciesIndexNumber() == TREECKO) + { + dex_num = 277; + } - u32 sprite_location = (*(u32 *)(curr_rom.loc_gMonIconTable + (dex_num * 4))) + (frame == 0 ? 0 : 512); + u32 sprite_location = (*(u32 *)(curr_GBA_rom.loc_gMonIconTable + (dex_num * 4))) + (frame == 0 ? 0 : 512); tonccpy(&tile_mem[SPRITE_CHAR_BLOCK][curr_tile_id], (const unsigned int *)sprite_location, 512); } \ No newline at end of file diff --git a/source/text_engine.cpp b/source/text_engine.cpp index d5f06b0..51d94be 100644 --- a/source/text_engine.cpp +++ b/source/text_engine.cpp @@ -174,6 +174,7 @@ int ptgb_write(const byte *text, bool instant) // Re-implementing TTE's "tte_write" to use the gen 3 character encoding chart int ptgb_write(const byte *text, bool instant, int length) { + instant = instant || INSTANT_TEXT_SPEED; if (text == NULL) return 0; diff --git a/text_helper/main.py b/text_helper/main.py index 9f86b9d..43b6aa6 100755 --- a/text_helper/main.py +++ b/text_helper/main.py @@ -20,6 +20,7 @@ if (update == True): new_file_path = 'text_helper/new_text.xlsx' old_file_path = 'text_helper/text.xlsx' json_file_path = 'text_helper/output.json' + no_file = False try: response = requests.get(url, timeout=5) @@ -31,22 +32,26 @@ if (update == True): except requests.exceptions.ReadTimeout as errrt: if os.path.exists(old_file_path): print("Connection timed out. Continuing with locally downloaded file.") + no_file = True else: print("xlsx file is missing and connection timed out. Exiting...") except requests.exceptions.ConnectionError as conerr: if os.path.exists(old_file_path): print("Connection error. Continuing with locally downloaded file.") + no_file = True else: print("xlsx file is missing and connection timed out. Exiting...") if os.path.exists(old_file_path): - new_file = pd.read_excel(new_file_path, sheet_name="Translations") - old_file = pd.read_excel(old_file_path, sheet_name="Translations") - if new_file.equals(old_file): + if (not no_file): + new_file = pd.read_excel(new_file_path, sheet_name="Translations") + old_file = pd.read_excel(old_file_path, sheet_name="Translations") + if no_file or new_file.equals(old_file): if os.path.exists(json_file_path): print("Downloaded file is identical. Skipping parse\n") - os.remove(new_file_path) + if (not no_file): + os.remove(new_file_path) exit() print("json file missing - forcing rebuild.") os.remove(old_file_path) @@ -516,7 +521,7 @@ for lang in Languages: # now generate the cpp file. with open(os.curdir + '/source/translated_text.cpp', 'w') as cppFile: - cppFile.write("#include \"translated_text.h\"\n#include \"debug_mode.h\"\n#include \"pokemon_data.h\"\n") + cppFile.write("#include \"translated_text.h\"\n#include \"debug_mode.h\"\n#include \"extern_pokemon_data.h\"\n") # generate includes for each language for lang in Languages: for cat in mainDict[lang.name]: diff --git a/tools/data-generator/include/common.h b/tools/data-generator/include/common.h index 5cf1bd2..3ffb239 100644 --- a/tools/data-generator/include/common.h +++ b/tools/data-generator/include/common.h @@ -5,5 +5,6 @@ #include void writeTable(const char *input_path, const char *output_path, const char *filename, const char *buffer, size_t buffer_size); +void generate_pokemon_data(const char *output_path); #endif \ No newline at end of file diff --git a/tools/data-generator/include/pokemon_data.h b/tools/data-generator/include/extern_pokemon_data.h similarity index 100% rename from tools/data-generator/include/pokemon_data.h rename to tools/data-generator/include/extern_pokemon_data.h diff --git a/tools/data-generator/include/gb_rom_values/base_gb_rom_struct.h b/tools/data-generator/include/gb_rom_values/base_gb_rom_struct.h index dc5e315..c65a249 100644 --- a/tools/data-generator/include/gb_rom_values/base_gb_rom_struct.h +++ b/tools/data-generator/include/gb_rom_values/base_gb_rom_struct.h @@ -16,7 +16,7 @@ typedef int32_t i32; #else extern "C" { - #include +#include } #endif @@ -79,6 +79,7 @@ public: u32 _RemovePokemon; // location of the _RemovePokemon function in the ROM u32 SaveSAVtoSRAM1; // location of the SaveSAVtoSRAM1 function in the ROM u32 SaveSAVtoSRAM2; // location of the SaveSAVtoSRAM2 function in the ROM + u32 LoadCurrentBoxData; // location of the LoadCurrentBoxData function in the ROM u32 OpenSRAM; // location of the OpenSRAM function in the ROM u32 SaveBox; // location of the SaveBox function in the ROM u32 Bankswitch; // location of the BankswitchCommon function in the ROM @@ -86,22 +87,22 @@ public: u32 CloseSRAM; // location of the OpenSRAM function in the ROM u32 garbageDataLocation; // location of random data starting with 0xFD in the ROM - u32 wRemoveMonFromBox; // location of wRemoveMonFromBox in RAM - u32 wBoxCount; // location of wBoxCount in RAM - u32 wWhichPokemon; // location of wWhichPokemon in RAM - u32 wBoxDataStart; // location of wBoxDataStart in RAM - u32 wBoxDataEnd; // location of wBoxDataEnd in RAM - u32 wSerialEnemyDataBlock; // location of wSerialEnemyDataBlock in RAM - u32 wEnemyMonSpecies; // location of wEnemyMonSpecies in RAM - + u32 wRemoveMonFromBox; // location of wRemoveMonFromBox in RAM + u32 wBoxCount; // location of wBoxCount in RAM + u32 wWhichPokemon; // location of wWhichPokemon in RAM + u32 wBoxDataStart; // location of wBoxDataStart in RAM + u32 wBoxDataEnd; // location of wBoxDataEnd in RAM + u32 wSerialEnemyDataBlock; // location of wSerialEnemyDataBlock in RAM + u32 wEnemyMonSpecies; // location of wEnemyMonSpecies in RAM + u32 wSerialEnemyMonsPatchList; // location of wSerialEnemyMonsPatchList in RAM u32 wSerialOtherGameboyRandomNumberListBlock; // location of wSerialOtherGameboyRandomNumberListBlock in RAM u32 hSerialConnectionStatus; // location of hSerialConnectionStatus in RAM - u16 transferStringLocation; // location in VRAM to start writing the transfer string to - u16 textBorderUppLeft; // location in VRAM to put the upper left corner of the border - u8 textBorderWidth; // the width of the text box border - u8 textBorderHeight; // the height of the text box border + u16 transferStringLocation; // location in VRAM to start writing the transfer string to + u16 textBorderUppLeft; // location in VRAM to put the upper left corner of the border + u8 textBorderWidth; // the width of the text box border + u8 textBorderHeight; // the height of the text box border u16 padding_2; }; diff --git a/tools/data-generator/src/common.cpp b/tools/data-generator/src/common.cpp index 72ada3e..df1babc 100644 --- a/tools/data-generator/src/common.cpp +++ b/tools/data-generator/src/common.cpp @@ -1,4 +1,5 @@ #include "common.h" +#include "extern_pokemon_data.h" #include #include diff --git a/tools/data-generator/src/debug_scripts/__pycache__/bgb_link.cpython-313.pyc b/tools/data-generator/src/debug_scripts/__pycache__/bgb_link.cpython-313.pyc new file mode 100644 index 0000000..b97617d Binary files /dev/null and b/tools/data-generator/src/debug_scripts/__pycache__/bgb_link.cpython-313.pyc differ diff --git a/tools/data-generator/src/debug_scripts/bgb_link.py b/tools/data-generator/src/debug_scripts/bgb_link.py new file mode 100644 index 0000000..56a4bcd --- /dev/null +++ b/tools/data-generator/src/debug_scripts/bgb_link.py @@ -0,0 +1,80 @@ +import socket +import sys + + +def format_data(string) -> int: + result = 0 + for c in string: + result = (result << 8) | c + return result + + +def send_data(sock, b1: int, b2: int, b3: int, b4: int, time) -> None: + data = bytearray() + + data.append(b1) + data.append(b2) + data.append(b3) + data.append(b4) + + data.append((time >> 24) & 0xff) + data.append((time >> 16) & 0xff) + data.append((time >> 8) & 0xff) + data.append(time & 0xff) + + sock.send(data) + + +def connect(port, callback) -> None: + sock = socket.socket() + sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, + 1) # requires nodelay + sock.connect(("localhost", port)) + + send_data(sock, 1, 1, 4, 0, 0) # send version + + try: + while 1: + # data packet will be 8 byte long + raw = format_data(sock.recv(8)) + if raw == 0: + continue + + b1 = cmd = raw >> 56 + b2 = (raw >> 48) & 0xff + b3 = (raw >> 40) & 0xff + b4 = (raw >> 32) & 0xff + time = raw & 0xffffffff + + # print("%.2x %.2x %.2x %.2x %.8x" % (b1, b2, b3, b4, time)) + + if cmd == 1: + # handshake (version) + pass + # send_data(sock, 0x01, 0x01, 0x04, 0x00, time) + # send_data(sock, b1, b2, b3, b4, time) + + elif cmd == 101: + # sync gamepad + pass + + elif cmd == 104: + # byte received from master + result = callback(b2) + if not result == None: + # send data + send_data(sock, 105, result, 0x80, 0, 0) + else: + # send ack + send_data(sock, 106, 1, 00, 0, 0) + + elif cmd == 106: + send_data(sock, b1, b2, b3, b4, time) + + elif cmd == 108: + send_data(sock, 108, 1, 0, 0, 0) + except Exception as e: + sock.close() + raise e + + print("Connection closed.") \ No newline at end of file diff --git a/tools/data-generator/src/debug_scripts/cable_club_y.py b/tools/data-generator/src/debug_scripts/cable_club_y.py new file mode 100644 index 0000000..d182353 --- /dev/null +++ b/tools/data-generator/src/debug_scripts/cable_club_y.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 + +import bgb_link +import numpy as np +from io import BufferedReader +from typing import List + +hs: int +ack: int +menu: int +trade: int +colosseum: int +cancel: int +preamble: int +trade_data: int +done: int + +hs, ack, menu, trade, colosseum, cancel, preamble, trade_data, done = list( + range(9)) +state: int = hs +counter = 0 + +file_path = "to_compress/gb_gen1_payloads_Y.bin" +try: + data = np.fromfile(file_path, dtype=np.uint8) +except FileNotFoundError: + print(f"Error: The file '{file_path}' was not found.") +except Exception as e: + print(f"An error occurred: {e}") + + +def cable_club(byte): + global state, hs, ack, menu, trade, colosseum, cancel, trade_data + + if state == hs: + if byte == 0x01: + state = ack + print("Connection established") + return 0x02 + + elif state == ack: + if byte == 0x00: + state = menu + print("Menu") + return 0x00 + + elif state == menu: + # 0xd1 battle + # 0xd5 battle selected + if byte == 0xd0: + print("Battle") + state = trade + return 0xd5 + else: + return byte + + elif state == trade: + if byte == 0xfd: + state = preamble + return byte + + elif state == preamble: + if byte != 0xfd: + print("Sending data...") + state = trade_data + return exchange_parties(byte) + return byte + + elif state == trade_data: + # 0xfd = Preamble byte for array + # 0xfe = No data + return exchange_parties(byte) + + elif state == done: + # Refill the code section + return exchange_parties(byte) + return byte + + +def exchange_parties(byte): + global counter, data, state, done + if counter < len(data): + ret = data[counter] + counter += 1 + print(hex(ret)) + return ret + else: + while(True): + 1==1 + state = done + print("Restarting!") + counter = 436 + ret = data[counter] + counter += 1 + print(hex(ret)) + return ret + + +bgb_link.connect(8765, cable_club) diff --git a/tools/data-generator/src/pokemon_data.cpp b/tools/data-generator/src/extern_pokemon_data.cpp similarity index 98% rename from tools/data-generator/src/pokemon_data.cpp rename to tools/data-generator/src/extern_pokemon_data.cpp index 632d00b..1864f1c 100644 --- a/tools/data-generator/src/pokemon_data.cpp +++ b/tools/data-generator/src/extern_pokemon_data.cpp @@ -1,4 +1,4 @@ -#include "pokemon_data.h" +#include "extern_pokemon_data.h" #include "common.h" #include @@ -4705,16 +4705,16 @@ const u8 TYPES[POKEMON_ARRAY_SIZE][2]{ void generate_pokemon_data(const char *output_path) { - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "gen_1_charsets.bin", (const char*)gen_1_charsets, sizeof(gen_1_charsets)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "gen_2_charsets.bin", (const char*)gen_2_charsets, sizeof(gen_2_charsets)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "gen_3_charsets.bin", (const char*)gen_3_charsets, sizeof(gen_3_charsets)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "EXP_GROUPS.bin", (const char*)EXP_GROUPS, sizeof(EXP_GROUPS)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "GENDER_RATIO.bin", (const char*)GENDER_RATIO, sizeof(GENDER_RATIO)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "NUM_ABILITIES.bin", (const char*)(NUM_ABILITIES), sizeof(NUM_ABILITIES)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "FIRST_MOVES.bin", (const char*)FIRST_MOVES, sizeof(FIRST_MOVES)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "JPN_NAMES.bin", (const char*)JPN_NAMES, sizeof(JPN_NAMES)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "POWER_POINTS.bin", (const char*)POWER_POINTS, sizeof(POWER_POINTS)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "MENU_SPRITE_PALS.bin", (const char*)MENU_SPRITE_PALS, sizeof(MENU_SPRITE_PALS)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "EVENT_PKMN.bin", (const char*)EVENT_PKMN, sizeof(EVENT_PKMN)); - writeTable("tools/data-generator/src/pokemon_data.cpp", output_path, "TYPES.bin", (const char*)TYPES, sizeof(TYPES)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "gen_1_charsets.bin", (const char*)gen_1_charsets, sizeof(gen_1_charsets)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "gen_2_charsets.bin", (const char*)gen_2_charsets, sizeof(gen_2_charsets)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "gen_3_charsets.bin", (const char*)gen_3_charsets, sizeof(gen_3_charsets)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "EXP_GROUPS.bin", (const char*)EXP_GROUPS, sizeof(EXP_GROUPS)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "GENDER_RATIO.bin", (const char*)GENDER_RATIO, sizeof(GENDER_RATIO)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "NUM_ABILITIES.bin", (const char*)(NUM_ABILITIES), sizeof(NUM_ABILITIES)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "FIRST_MOVES.bin", (const char*)FIRST_MOVES, sizeof(FIRST_MOVES)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "JPN_NAMES.bin", (const char*)JPN_NAMES, sizeof(JPN_NAMES)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "POWER_POINTS.bin", (const char*)POWER_POINTS, sizeof(POWER_POINTS)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "MENU_SPRITE_PALS.bin", (const char*)MENU_SPRITE_PALS, sizeof(MENU_SPRITE_PALS)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "EVENT_PKMN.bin", (const char*)EVENT_PKMN, sizeof(EVENT_PKMN)); + writeTable("tools/data-generator/src/extern_pokemon_data.cpp", output_path, "TYPES.bin", (const char*)TYPES, sizeof(TYPES)); } \ No newline at end of file diff --git a/tools/data-generator/src/gb_rom_values/gb_rom_values_eng.cpp b/tools/data-generator/src/gb_rom_values/gb_rom_values_eng.cpp index aeb7a75..4ba4f4f 100644 --- a/tools/data-generator/src/gb_rom_values/gb_rom_values_eng.cpp +++ b/tools/data-generator/src/gb_rom_values/gb_rom_values_eng.cpp @@ -1,282 +1,281 @@ #include "gb_rom_values/gb_rom_values.h" const struct GB_ROM gb_rom_values_eng[] = { - { // ENG_RED - .language = ENG_ID, - .version = RED_ID, - .generation = 1, - .method = METHOD_NEWLINE, - .payload_size = 637, - .box_data_size = 0x462, + {// ENG_RED + .language = ENG_ID, + .version = RED_ID, + .generation = 1, + .method = METHOD_NEWLINE, + .payload_size = 637, + .box_data_size = 0x462, - .print_string_start = 0xC456, - .stack_overwrite_location = 0xDFDD, - .short_pkmn_name = 0xE3, - .pointer_pkmn_name = 0xFC, - .padding_1 = 0, + .print_string_start = 0xC456, + .stack_overwrite_location = 0xDFDD, + .short_pkmn_name = 0xE3, + .pointer_pkmn_name = 0xFC, + .padding_1 = 0, - .clearScreen = 0x190F, - .CableClub_TextBoxBorder = 0x5AB3, - .placeString = 0x1955, - .Serial_ExchangeBytes = 0x216F, - ._RemovePokemon = 0x7B68, - .SaveSAVtoSRAM1 = 0x1C77E2, - .SaveSAVtoSRAM2 = 0x1C780F, - .OpenSRAM = 0, - .SaveBox = 0, - .Bankswitch = 0x35D6, - .SoftReset = 0x1F49, - .CloseSRAM = 0, - .garbageDataLocation = 0x0316, + .clearScreen = 0x190F, + .CableClub_TextBoxBorder = 0x5AB3, + .placeString = 0x1955, + .Serial_ExchangeBytes = 0x216F, + ._RemovePokemon = 0x7B68, + .SaveSAVtoSRAM1 = 0x1C77E2, + .SaveSAVtoSRAM2 = 0x1C780F, + .LoadCurrentBoxData = 0, + .OpenSRAM = 0, + .SaveBox = 0, + .Bankswitch = 0x35D6, + .SoftReset = 0x1F49, + .CloseSRAM = 0, + .garbageDataLocation = 0x0316, - .wRemoveMonFromBox = 0xCF95, - .wBoxCount = 0xDA80, - .wWhichPokemon = 0xCF92, - .wBoxDataStart = 0xDA80, - .wBoxDataEnd = 0xDEE2, - .wSerialEnemyDataBlock = 0xD893, - .wEnemyMonSpecies = 0xCFE5, + .wRemoveMonFromBox = 0xCF95, + .wBoxCount = 0xDA80, + .wWhichPokemon = 0xCF92, + .wBoxDataStart = 0xDA80, + .wBoxDataEnd = 0xDEE2, + .wSerialEnemyDataBlock = 0xD893, + .wEnemyMonSpecies = 0xCFE5, - .wSerialEnemyMonsPatchList = 0xC5D0, - .wSerialOtherGameboyRandomNumberListBlock = 0xCD81, - .hSerialConnectionStatus = 0xFFAA, + .wSerialEnemyMonsPatchList = 0xC5D0, + .wSerialOtherGameboyRandomNumberListBlock = 0xCD81, + .hSerialConnectionStatus = 0xFFAA, - .transferStringLocation = 0xC444, - .textBorderUppLeft = 0xC42F, - .textBorderWidth = 12, - .textBorderHeight = 1, - .padding_2 = 0 - }, - { // ENG_BLUE - .language = ENG_ID, - .version = BLUE_ID, - .generation = 1, - .method = METHOD_NEWLINE, - .payload_size = 637, - .box_data_size = 0x462, + .transferStringLocation = 0xC444, + .textBorderUppLeft = 0xC42F, + .textBorderWidth = 12, + .textBorderHeight = 1, + .padding_2 = 0}, + {// ENG_BLUE + .language = ENG_ID, + .version = BLUE_ID, + .generation = 1, + .method = METHOD_NEWLINE, + .payload_size = 637, + .box_data_size = 0x462, - .print_string_start = 0xC456, - .stack_overwrite_location = 0xDFDD, - .short_pkmn_name = 0xE3, - .pointer_pkmn_name = 0xFC, - .padding_1 = 0, + .print_string_start = 0xC456, + .stack_overwrite_location = 0xDFDD, + .short_pkmn_name = 0xE3, + .pointer_pkmn_name = 0xFC, + .padding_1 = 0, - .clearScreen = 0x190F, - .CableClub_TextBoxBorder = 0x5AB3, - .placeString = 0x1955, - .Serial_ExchangeBytes = 0x216F, - ._RemovePokemon = 0x7B68, - .SaveSAVtoSRAM1 = 0x1C77E2, - .SaveSAVtoSRAM2 = 0x1C780F, - .OpenSRAM = 0, - .SaveBox = 0, - .Bankswitch = 0x35D6, - .SoftReset = 0x1F49, - .CloseSRAM = 0, - .garbageDataLocation = 0x0316, + .clearScreen = 0x190F, + .CableClub_TextBoxBorder = 0x5AB3, + .placeString = 0x1955, + .Serial_ExchangeBytes = 0x216F, + ._RemovePokemon = 0x7B68, + .SaveSAVtoSRAM1 = 0x1C77E2, + .SaveSAVtoSRAM2 = 0x1C780F, + .LoadCurrentBoxData = 0, + .OpenSRAM = 0, + .SaveBox = 0, + .Bankswitch = 0x35D6, + .SoftReset = 0x1F49, + .CloseSRAM = 0, + .garbageDataLocation = 0x0316, - .wRemoveMonFromBox = 0xCF95, - .wBoxCount = 0xDA80, - .wWhichPokemon = 0xCF92, - .wBoxDataStart = 0xDA80, - .wBoxDataEnd = 0xDEE2, - .wSerialEnemyDataBlock = 0xD893, - .wEnemyMonSpecies = 0xCFE5, + .wRemoveMonFromBox = 0xCF95, + .wBoxCount = 0xDA80, + .wWhichPokemon = 0xCF92, + .wBoxDataStart = 0xDA80, + .wBoxDataEnd = 0xDEE2, + .wSerialEnemyDataBlock = 0xD893, + .wEnemyMonSpecies = 0xCFE5, - .wSerialEnemyMonsPatchList = 0xC5D0, - .wSerialOtherGameboyRandomNumberListBlock = 0xCD81, - .hSerialConnectionStatus = 0xFFAA, + .wSerialEnemyMonsPatchList = 0xC5D0, + .wSerialOtherGameboyRandomNumberListBlock = 0xCD81, + .hSerialConnectionStatus = 0xFFAA, - .transferStringLocation = 0xC444, - .textBorderUppLeft = 0xC42F, - .textBorderWidth = 12, - .textBorderHeight = 1, - .padding_2 = 0 - }, - { // ENG_YELLOW - .language = ENG_ID, - .version = YELLOW_ID, - .generation = 1, - .method = METHOD_MEW, - .payload_size = 637, - .box_data_size = 0x462, + .transferStringLocation = 0xC444, + .textBorderUppLeft = 0xC42F, + .textBorderWidth = 12, + .textBorderHeight = 1, + .padding_2 = 0}, + {// ENG_YELLOW + .language = ENG_ID, + .version = YELLOW_ID, + .generation = 1, + .method = METHOD_MEW, + .payload_size = 637, + .box_data_size = 0x462, - .print_string_start = 0xC456, - .stack_overwrite_location = 0xDFDD, - .short_pkmn_name = 0x15, - .pointer_pkmn_name = 0xE3, - .padding_1 = 0, + .print_string_start = 0xC456, + .stack_overwrite_location = 0xDFDD, + .short_pkmn_name = 0x15, + .pointer_pkmn_name = 0xE3, + .padding_1 = 0, - .clearScreen = 0x16DD, - .CableClub_TextBoxBorder = 0x16F0, // TextBoxBoarder, since the Cable Club isn't loaded - .placeString = 0x1723, - .Serial_ExchangeBytes = 0x1FCB, - ._RemovePokemon = 0x7A0F, - .SaveSAVtoSRAM1 = 0x1C7B32, - .SaveSAVtoSRAM2 = 0x1C7B56, - .OpenSRAM = 0x3E99, - .SaveBox = 0, - .Bankswitch = 0x3E7E, // BankswitchCommon - .SoftReset = 0x1D05, - .CloseSRAM = 0x3EA9, - .garbageDataLocation = 0x0161, + .clearScreen = 0x16DD, + .CableClub_TextBoxBorder = 0x16F0, // TextBoxBoarder, since the Cable Club isn't loaded + .placeString = 0x1723, + .Serial_ExchangeBytes = 0x1FCB, + ._RemovePokemon = 0x017A0F, + .SaveSAVtoSRAM1 = 0x1C7B32, + .SaveSAVtoSRAM2 = 0x1C7B56, + .LoadCurrentBoxData = 0x1C79FC, + .OpenSRAM = 0x3E99, + .SaveBox = 0, + .Bankswitch = 0x3E84, + .SoftReset = 0x1D05, + .CloseSRAM = 0x3EA9, + .garbageDataLocation = 0x0161, - .wRemoveMonFromBox = 0xCF94, - .wBoxCount = 0xDA7F, - .wWhichPokemon = 0xCF91, - .wBoxDataStart = 0xDA7F, - .wBoxDataEnd = 0xDEE1, - .wSerialEnemyDataBlock = 0xD892, - .wEnemyMonSpecies = 0xCFE4, + .wRemoveMonFromBox = 0xCF94, + .wBoxCount = 0xDA7F, + .wWhichPokemon = 0xCF91, + .wBoxDataStart = 0xDA7F, + .wBoxDataEnd = 0xDEE1, + .wSerialEnemyDataBlock = 0xD892, + .wEnemyMonSpecies = 0xCFE4, - .wSerialEnemyMonsPatchList = 0xC5D0, - .wSerialOtherGameboyRandomNumberListBlock = 0xCD81, - .hSerialConnectionStatus = 0xFFAA, + .wSerialEnemyMonsPatchList = 0xC5D0, + .wSerialOtherGameboyRandomNumberListBlock = 0xCD81, + .hSerialConnectionStatus = 0xFFAA, - .transferStringLocation = 0xC444, - .textBorderUppLeft = 0xC42F, - .textBorderWidth = 12, - .textBorderHeight = 1, - .padding_2 = 0 - }, - { // ENG_GOLD - .language = ENG_ID, - .version = GOLD_ID, - .generation = 2, - .method = METHOD_GEN2, - .payload_size = 672, - .box_data_size = 0x44E, + .transferStringLocation = 0xC444, + .textBorderUppLeft = 0xC42F, + .textBorderWidth = 12, + .textBorderHeight = 1, + .padding_2 = 0}, + {// ENG_GOLD + .language = ENG_ID, + .version = GOLD_ID, + .generation = 2, + .method = METHOD_GEN2, + .payload_size = 672, + .box_data_size = 0x44E, - .print_string_start = 0xC442, - .stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString - .short_pkmn_name = 0x4E, - .pointer_pkmn_name = 0, - .padding_1 = 0, + .print_string_start = 0xC442, + .stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString + .short_pkmn_name = 0x4E, + .pointer_pkmn_name = 0, + .padding_1 = 0, - .clearScreen = 0x000EE2, - .CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL - .placeString = 0x000F74, - .Serial_ExchangeBytes = 0x0710, - ._RemovePokemon = 0x03603F, // RemoveMonFromPartyOrBox - .SaveSAVtoSRAM1 = 0, - .SaveSAVtoSRAM2 = 0, - .OpenSRAM = 0x0030E1, - .SaveBox = 0x054DF6, - .Bankswitch = 0, - .SoftReset = 0x05B0, - .CloseSRAM = 0, - .garbageDataLocation = 0x0654, + .clearScreen = 0x000EE2, + .CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL + .placeString = 0x000F74, + .Serial_ExchangeBytes = 0x0710, + ._RemovePokemon = 0x03603F, // RemoveMonFromPartyOrBox + .SaveSAVtoSRAM1 = 0, + .SaveSAVtoSRAM2 = 0, + .LoadCurrentBoxData = 0, + .OpenSRAM = 0x0030E1, + .SaveBox = 0x054DF6, + .Bankswitch = 0, + .SoftReset = 0x05B0, + .CloseSRAM = 0, + .garbageDataLocation = 0x0654, - .wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter - .wBoxCount = 0x01AD6C, // sBoxCount - .wWhichPokemon = 0x01D005, // wCurPartyMon - .wBoxDataStart = 0xAD6C, // sBoxStart - .wBoxDataEnd = 0xB1BA, // sBoxEnd - .wSerialEnemyDataBlock = 0xDD40, // wOTPartyData - .wEnemyMonSpecies = 0x01D0EF, + .wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter + .wBoxCount = 0x01AD6C, // sBoxCount + .wWhichPokemon = 0x01D005, // wCurPartyMon + .wBoxDataStart = 0xAD6C, // sBoxStart + .wBoxDataEnd = 0xB1BA, // sBoxEnd + .wSerialEnemyDataBlock = 0xDD40, // wOTPartyData + .wEnemyMonSpecies = 0x01D0EF, - .wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists - .wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData - .hSerialConnectionStatus = 0xFFCD, + .wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists + .wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData + .hSerialConnectionStatus = 0xFFCD, - .transferStringLocation = 0xC444, - .textBorderUppLeft = 0xC42F, - .textBorderWidth = 12, - .textBorderHeight = 1, - .padding_2 = 0 - }, - { // ENG_SILVER - .language = ENG_ID, - .version = SILVER_ID, - .generation = 2, - .method = METHOD_GEN2, - .payload_size = 672, - .box_data_size = 0x44E, + .transferStringLocation = 0xC444, + .textBorderUppLeft = 0xC42F, + .textBorderWidth = 12, + .textBorderHeight = 1, + .padding_2 = 0}, + {// ENG_SILVER + .language = ENG_ID, + .version = SILVER_ID, + .generation = 2, + .method = METHOD_GEN2, + .payload_size = 672, + .box_data_size = 0x44E, - .print_string_start = 0xC442, - .stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString - .short_pkmn_name = 0x4E, - .pointer_pkmn_name = 0, - .padding_1 = 0, + .print_string_start = 0xC442, + .stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString + .short_pkmn_name = 0x4E, + .pointer_pkmn_name = 0, + .padding_1 = 0, - .clearScreen = 0x000EE2, - .CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL - .placeString = 0x000F74, - .Serial_ExchangeBytes = 0x0710, - ._RemovePokemon = 0x03603D, // RemoveMonFromPartyOrBox - .SaveSAVtoSRAM1 = 0, - .SaveSAVtoSRAM2 = 0, - .OpenSRAM = 0x0030E1, - .SaveBox = 0x054DF6, - .Bankswitch = 0, - .SoftReset = 0x05B0, - .CloseSRAM = 0, - .garbageDataLocation = 0x0654, + .clearScreen = 0x000EE2, + .CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL + .placeString = 0x000F74, + .Serial_ExchangeBytes = 0x0710, + ._RemovePokemon = 0x03603D, // RemoveMonFromPartyOrBox + .SaveSAVtoSRAM1 = 0, + .SaveSAVtoSRAM2 = 0, + .LoadCurrentBoxData = 0, + .OpenSRAM = 0x0030E1, + .SaveBox = 0x054DF6, + .Bankswitch = 0, + .SoftReset = 0x05B0, + .CloseSRAM = 0, + .garbageDataLocation = 0x0654, - .wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter - .wBoxCount = 0x01AD6C, // sBoxCount - .wWhichPokemon = 0x01D005, // wCurPartyMon - .wBoxDataStart = 0xAD6C, // sBoxStart - .wBoxDataEnd = 0xB1BA, // sBoxEnd - .wSerialEnemyDataBlock = 0xDD40, // wOTPartyData - .wEnemyMonSpecies = 0x01D0EF, + .wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter + .wBoxCount = 0x01AD6C, // sBoxCount + .wWhichPokemon = 0x01D005, // wCurPartyMon + .wBoxDataStart = 0xAD6C, // sBoxStart + .wBoxDataEnd = 0xB1BA, // sBoxEnd + .wSerialEnemyDataBlock = 0xDD40, // wOTPartyData + .wEnemyMonSpecies = 0x01D0EF, - .wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists - .wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData - .hSerialConnectionStatus = 0xFFCD, + .wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists + .wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData + .hSerialConnectionStatus = 0xFFCD, - .transferStringLocation = 0xC444, - .textBorderUppLeft = 0xC42F, - .textBorderWidth = 12, - .textBorderHeight = 1, - .padding_2 = 0 - }, - { // ENG_CRYSTAL - .language = ENG_ID, - .version = CRYSTAL_ID, - .generation = 2, - .method = METHOD_GEN2, - .payload_size = 672, - .box_data_size = 0x44E, + .transferStringLocation = 0xC444, + .textBorderUppLeft = 0xC42F, + .textBorderWidth = 12, + .textBorderHeight = 1, + .padding_2 = 0}, + {// ENG_CRYSTAL + .language = ENG_ID, + .version = CRYSTAL_ID, + .generation = 2, + .method = METHOD_GEN2, + .payload_size = 672, + .box_data_size = 0x44E, - .print_string_start = 0xC544, - .stack_overwrite_location = 0xE0BB, // Found by seeing where 7622 is stored in the stack, 7622 is the code that calls PlaceString (PlaceTradePartnerNamesAndParty) - .short_pkmn_name = 0x4E, - .pointer_pkmn_name = 0, - .padding_1 = 0, + .print_string_start = 0xC544, + .stack_overwrite_location = 0xE0BB, // Found by seeing where 7622 is stored in the stack, 7622 is the code that calls PlaceString (PlaceTradePartnerNamesAndParty) + .short_pkmn_name = 0x4E, + .pointer_pkmn_name = 0, + .padding_1 = 0, - .clearScreen = 0x000FDB, - .CableClub_TextBoxBorder = 0x0A4EEF, // LinkTextboxAtHL - .placeString = 0x001078, - .Serial_ExchangeBytes = 0x075F, - ._RemovePokemon = 0x036039, // RemoveMonFromPartyOrBox - .SaveSAVtoSRAM1 = 0, - .SaveSAVtoSRAM2 = 0, - .OpenSRAM = 0x002FCB, - .SaveBox = 0x054E0C, - .Bankswitch = 0, - .SoftReset = 0x0150, // Reset - .CloseSRAM = 0, - .garbageDataLocation = 0x0770, + .clearScreen = 0x000FDB, + .CableClub_TextBoxBorder = 0x0A4EEF, // LinkTextboxAtHL + .placeString = 0x001078, + .Serial_ExchangeBytes = 0x075F, + ._RemovePokemon = 0x036039, // RemoveMonFromPartyOrBox + .SaveSAVtoSRAM1 = 0, + .SaveSAVtoSRAM2 = 0, + .LoadCurrentBoxData = 0, + .OpenSRAM = 0x002FCB, + .SaveBox = 0x054E0C, + .Bankswitch = 0, + .SoftReset = 0x0150, // Reset + .CloseSRAM = 0, + .garbageDataLocation = 0x0770, - .wRemoveMonFromBox = 0x01D10B, // wPokemonWithdrawDepositParameter - .wBoxCount = 0x01AD10, // sBoxCount - .wWhichPokemon = 0x01D109, // wCurPartyMon - .wBoxDataStart = 0x01AD10, // sBox - .wBoxDataEnd = 0x01B15E, // sBoxEnd - .wSerialEnemyDataBlock = 0xD26B, // wOTPartyData - .wEnemyMonSpecies = 0x01D206, + .wRemoveMonFromBox = 0x01D10B, // wPokemonWithdrawDepositParameter + .wBoxCount = 0x01AD10, // sBoxCount + .wWhichPokemon = 0x01D109, // wCurPartyMon + .wBoxDataStart = 0x01AD10, // sBox + .wBoxDataEnd = 0x01B15E, // sBoxEnd + .wSerialEnemyDataBlock = 0xD26B, // wOTPartyData + .wEnemyMonSpecies = 0x01D206, - .wSerialEnemyMonsPatchList = 0xC6D0, // wOTPatchLists - .wSerialOtherGameboyRandomNumberListBlock = 0xD206, // wOTLinkBattleRNData - .hSerialConnectionStatus = 0xFFCB, + .wSerialEnemyMonsPatchList = 0xC6D0, // wOTPatchLists + .wSerialOtherGameboyRandomNumberListBlock = 0xD206, // wOTLinkBattleRNData + .hSerialConnectionStatus = 0xFFCB, - .transferStringLocation = 0xC544, - .textBorderUppLeft = 0xC52F, - .textBorderWidth = 12, - .textBorderHeight = 1, - .padding_2 = 0 - } -}; + .transferStringLocation = 0xC544, + .textBorderUppLeft = 0xC52F, + .textBorderWidth = 12, + .textBorderHeight = 1, + .padding_2 = 0}}; const u16 gb_rom_values_eng_size = static_cast(sizeof(gb_rom_values_eng) / sizeof(struct GB_ROM)); \ No newline at end of file diff --git a/tools/data-generator/src/main.cpp b/tools/data-generator/src/main.cpp index a645cf8..ca8b697 100644 --- a/tools/data-generator/src/main.cpp +++ b/tools/data-generator/src/main.cpp @@ -1,4 +1,4 @@ -#include "pokemon_data.h" +//#include "pokemon_data.h" #include "common.h" #include "gba_rom_values/gba_rom_values.h" #include "gb_rom_values/gb_rom_values.h" diff --git a/tools/data-generator/src/payloads/payload_builder.cpp b/tools/data-generator/src/payloads/payload_builder.cpp index 4db69c3..8341d3d 100644 --- a/tools/data-generator/src/payloads/payload_builder.cpp +++ b/tools/data-generator/src/payloads/payload_builder.cpp @@ -5,9 +5,15 @@ #include #define DATA_LOC (SHOW_DATA_PACKETS ? curr_rom.transferStringLocation : curr_rom.wEnemyMonSpecies) +#define DEBUG_PAYLOADS (false && DEBUG_MODE) -void init_payload(byte *payload_buffer, const GB_ROM& curr_rom, int type, bool debug) +void init_payload(byte *payload_buffer, const GB_ROM &curr_rom, int type, bool debug) { + if (DEBUG_PAYLOADS) + { + debug = true; + } + (void)type; /* 10 RNG bytes 8 Preamble bytes @@ -420,94 +426,95 @@ void init_payload(byte *payload_buffer, const GB_ROM& curr_rom, int type, bool d skip_enemy_write.set_start(&z80_payload); // Reload the save data to remove any data that was overwritten during exploit entry - z80_payload.LD(A, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); + z80_payload.LD(B, (curr_rom.LoadCurrentBoxData >> 16) | T_U8); + z80_payload.LD(HL, curr_rom.LoadCurrentBoxData | T_U16); z80_payload.CALL(curr_rom.Bankswitch | T_U16); - z80_payload.CALL(0x79FC | T_U16); // Call LoadSAV1 TODO FIX THIS BAD BAD NO BAD - - /* Build the packet */ - // HL is the current data pointer - // DE is the destination pointer - // A is the checksum - // B is the 0xFE flag byte - // C is the counter - send_packet_loop.set_start(&z80_payload); - - z80_payload.LD(HL, (DATA_LOC + PACKET_SIZE + 3) | T_U16); // Load the next data location into HL - z80_payload.LD(A, HLI_PTR); - z80_payload.LD(H, HL_PTR); - z80_payload.LD(L, A); - z80_payload.LD(DE, (DATA_LOC + 2) | T_U16); // Enemy Pokemon data, should be unused - z80_payload.XOR(A, A); // Clear the register - z80_payload.LD(B, A); // Clear B as well - z80_payload.LD(C, A); // Clear C as well - z80_payload.PUSH(AF); - packet_loop.set_start(&z80_payload); - z80_payload.LD(B, 0x00 | T_U8); // Reset the flag byte - z80_payload.POP(AF); - z80_payload.ADD(A, HL_PTR); // Add the current data to the checksum - z80_payload.PUSH(AF); - z80_payload.LD(A, 0xFE); - z80_payload.CP(A, HL_PTR); // Compare the current data to 0xFE - z80_payload.LD(A, HLI_PTR); // Load HL's data into A for modification (if need be) - - // If HL's data is 0xFE - z80_payload.JR(NZ_F, fe_bypass.place_relative_jump(&z80_payload) | T_I8); - z80_payload.DEC(A); - z80_payload.INC(B); // Set flag - - fe_bypass.set_start(&z80_payload); - z80_payload.LD(DE_PTR, A); // Place the data in - z80_payload.INC(DE); - z80_payload.PUSH(AF); - z80_payload.LD(A, B); - z80_payload.LD(DE_PTR, A); // Place the flag in as well - z80_payload.POP(AF); - z80_payload.INC(DE); - z80_payload.INC(C); - z80_payload.LD(A, DATA_PER_PACKET - 1); - z80_payload.CP(A, C); - z80_payload.JR(NC_F, packet_loop.place_relative_jump(&z80_payload) | T_I8); // If all the data has been set, send the rest of the data - z80_payload.POP(AF); - z80_payload.RES(7 | T_BIT, A); // Reset bit 7 of the checksum, guaranteeing that it will never be 0xFE - z80_payload.LD(DE_PTR, A); - z80_payload.INC(DE); - z80_payload.LD(A, H); - - z80_payload.LD(DE_PTR, A); - z80_payload.INC(DE); - z80_payload.LD(A, L); - z80_payload.LD(DE_PTR, A); - - /* Transfer box data packet: */ - z80_payload.LD(A, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug - z80_payload.LDH((curr_rom.hSerialConnectionStatus & 0xFF) | T_U8, A); // Since hSerialConnectionStatus is at 0xFFxx we can use this method instead - z80_payload.LD(HL, DATA_LOC | T_U16); - z80_payload.LD(HL_PTR, 0xFD | T_U8); // set the start of the data to 0xFD so Serial_ExchangeBytes is happy - z80_payload.INC(HL); - z80_payload.LD(HL_PTR, 0x00 | T_U8); // add a 0x00 after the 0xFD to prevent further 0xFDs from being interpreted as part of the preamble - z80_payload.DEC(HL); // Reset HL back so it points to 0xFD - z80_payload.LD(DE, (DATA_LOC + PACKET_SIZE) | T_U16); // location to put stored data - z80_payload.LD(BC, PACKET_SIZE | T_U16); - if (debug) // Don't call serialExchangeBytes if debug is enabled + if (!debug) { - z80_payload.index += 3; - } - else - { - z80_payload.CALL(curr_rom.Serial_ExchangeBytes | T_U16); - } + /* Build the packet */ + // HL is the current data pointer + // DE is the destination pointer + // A is the checksum + // B is the 0xFE flag byte + // C is the counter + send_packet_loop.set_start(&z80_payload); - z80_payload.LD(A, (DATA_LOC + PACKET_SIZE + 3 + 1) | T_U16); - z80_payload.CP(A, 0xFF); - if (debug && false) // Don't compare the "recieved" data if in debug - { - z80_payload.index += 2; - } - else - { - z80_payload.JR(NZ_F, send_packet_loop.place_relative_jump(&z80_payload) | T_I8); - } + z80_payload.LD(HL, (DATA_LOC + PACKET_SIZE + 3) | T_U16); // Load the next data location into HL + z80_payload.LD(A, HLI_PTR); + z80_payload.LD(H, HL_PTR); + z80_payload.LD(L, A); + z80_payload.LD(DE, (DATA_LOC + 2) | T_U16); // Enemy Pokemon data, should be unused + z80_payload.XOR(A, A); // Clear the register + z80_payload.LD(B, A); // Clear B as well + z80_payload.LD(C, A); // Clear C as well + z80_payload.PUSH(AF); + packet_loop.set_start(&z80_payload); + z80_payload.LD(B, 0x00 | T_U8); // Reset the flag byte + z80_payload.POP(AF); + z80_payload.ADD(A, HL_PTR); // Add the current data to the checksum + z80_payload.PUSH(AF); + z80_payload.LD(A, 0xFE); + z80_payload.CP(A, HL_PTR); // Compare the current data to 0xFE + z80_payload.LD(A, HLI_PTR); // Load HL's data into A for modification (if need be) + // If HL's data is 0xFE + z80_payload.JR(NZ_F, fe_bypass.place_relative_jump(&z80_payload) | T_I8); + z80_payload.DEC(A); + z80_payload.INC(B); // Set flag + + fe_bypass.set_start(&z80_payload); + z80_payload.LD(DE_PTR, A); // Place the data in + z80_payload.INC(DE); + z80_payload.PUSH(AF); + z80_payload.LD(A, B); + z80_payload.LD(DE_PTR, A); // Place the flag in as well + z80_payload.POP(AF); + z80_payload.INC(DE); + z80_payload.INC(C); + z80_payload.LD(A, DATA_PER_PACKET - 1); + z80_payload.CP(A, C); + z80_payload.JR(NC_F, packet_loop.place_relative_jump(&z80_payload) | T_I8); // If all the data has been set, send the rest of the data + z80_payload.POP(AF); + z80_payload.RES(7 | T_BIT, A); // Reset bit 7 of the checksum, guaranteeing that it will never be 0xFE + z80_payload.LD(DE_PTR, A); + z80_payload.INC(DE); + z80_payload.LD(A, H); + + z80_payload.LD(DE_PTR, A); + z80_payload.INC(DE); + z80_payload.LD(A, L); + z80_payload.LD(DE_PTR, A); + + /* Transfer box data packet: */ + z80_payload.LD(A, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug + z80_payload.LDH((curr_rom.hSerialConnectionStatus & 0xFF) | T_U8, A); // Since hSerialConnectionStatus is at 0xFFxx we can use this method instead + z80_payload.LD(HL, DATA_LOC | T_U16); + z80_payload.LD(HL_PTR, 0xFD | T_U8); // set the start of the data to 0xFD so Serial_ExchangeBytes is happy + z80_payload.INC(HL); + z80_payload.LD(HL_PTR, 0x00 | T_U8); // add a 0x00 after the 0xFD to prevent further 0xFDs from being interpreted as part of the preamble + z80_payload.DEC(HL); // Reset HL back so it points to 0xFD + z80_payload.LD(DE, (DATA_LOC + PACKET_SIZE) | T_U16); // location to put stored data + z80_payload.LD(BC, PACKET_SIZE | T_U16); + if (debug) // Don't call serialExchangeBytes if debug is enabled + { + z80_payload.index += 3; + } + else + { + z80_payload.CALL(curr_rom.Serial_ExchangeBytes | T_U16); + } + + z80_payload.LD(A, (DATA_LOC + PACKET_SIZE + 3 + 1) | T_U16); + z80_payload.CP(A, 0xFF); + if (debug && false) // Don't compare the "recieved" data if in debug + { + z80_payload.index += 2; + } + else + { + z80_payload.JR(NZ_F, send_packet_loop.place_relative_jump(&z80_payload) | T_I8); + } + } /* Recieve the Pokemon to remove */ z80_payload.LD(HL, curr_rom.hSerialConnectionStatus | T_U16); // This can also be shortened z80_payload.LD(HL_PTR, (debug ? 0x02 : 0x01) | T_U8); // Make sure GB is the slave, master if debug @@ -549,16 +556,22 @@ void init_payload(byte *payload_buffer, const GB_ROM& curr_rom, int type, bool d } else { - z80_payload.CALL(curr_rom._RemovePokemon | T_U16); + z80_payload.LD(B, (curr_rom._RemovePokemon >> 16) | T_U8); // Load ROM Bank + z80_payload.LD(HL, curr_rom._RemovePokemon | T_U16); + z80_payload.CALL(curr_rom.Bankswitch | T_U16); } z80_payload.JR((remove_array_loop.place_relative_jump(&z80_payload) & 0xFF) | T_I8); + // We need to move this in order to not corrupt the 4E's + z80_payload.JR((save_box.place_relative_jump(&z80_payload) & 0xFF) | T_I8); + z80_payload.index = 0x17A; + /* Save the current box */ save_box.set_start(&z80_payload); - z80_payload.LD(A, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); // Load ROM Bank + z80_payload.LD(B, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); // Load ROM Bank z80_payload.LD(HL, curr_rom.SaveSAVtoSRAM1 | T_U16); z80_payload.CALL(curr_rom.Bankswitch | T_U16); - z80_payload.LD(A, (curr_rom.SaveSAVtoSRAM1 >> 16) | T_U8); // Load ROM Bank + z80_payload.LD(B, (curr_rom.SaveSAVtoSRAM2 >> 16) | T_U8); // Load ROM Bank z80_payload.LD(HL, curr_rom.SaveSAVtoSRAM2 | T_U16); z80_payload.CALL(curr_rom.Bankswitch | T_U16); z80_payload.JP(curr_rom.SoftReset | T_U16); @@ -949,17 +962,19 @@ void init_payload(byte *payload_buffer, const GB_ROM& curr_rom, int type, bool d #if PAYLOAD_EXPORT_TEST #include +#include "gb_rom_values/gb_rom_values.h" int main() // Rename to "main" to send the payload to test_payload.txt { + byte buffer[672] = {0}; freopen("test_payload.txt", "w", stdout); printf("\n"); - init_payload(ENG_GOLD, TRANSFER, true); - byte *payload = get_payload(); + init_payload(buffer, gb_rom_values_eng[RED_ID], TRANSFER, true); + if (true) { for (int i = 0; i < 0x2A0; i++) { - printf("0x%02X, ", (unsigned int)payload[i]); + printf("0x%02X, ", (unsigned int)buffer[i]); if (i % 0x10 == 0xF) { printf("\n# 0x%X\n", i + 1); @@ -971,7 +986,7 @@ int main() // Rename to "main" to send the payload to test_payload.txt { for (int i = 0; i < 0x150; i++) { - printf("%02X ", (unsigned int)payload[i + ((0x10 * 28) + 9)]); + printf("%02X ", (unsigned int)buffer[i + ((0x10 * 28) + 9)]); if (i % 0x10 == 0xF) { printf("\n");