diff --git a/Poke_Transporter_GB_mb.sym b/Poke_Transporter_GB_mb.sym index f79af4f..e3c978a 100644 --- a/Poke_Transporter_GB_mb.sym +++ b/Poke_Transporter_GB_mb.sym @@ -88,11 +88,11 @@ 00000004 T _ZN10script_obj14get_true_indexEv 00000004 T _ZN10script_obj15get_false_indexEv 00000004 T _ZN11Button_Menu21set_bottom_row_offsetEi +00000004 T _ZN11Select_Menu8set_langEi 00000004 b _ZN12_GLOBAL__N_113__new_handlerE 00000004 b _ZN12_GLOBAL__N_1L11static_condE 00000004 b _ZN12_GLOBAL__N_1L12static_mutexE 00000004 T _ZN7Pokemon20get_full_gen_3_arrayEv -00000004 T _ZN8rom_data10verify_romEv 00000004 T _ZNKSt11logic_error4whatEv 00000004 T _ZNKSt13runtime_error4whatEv 00000004 T _ZNKSt9type_info14__is_pointer_pEv @@ -111,41 +111,18 @@ 00000004 B btn_c_r 00000004 B btn_d_l 00000004 B btn_d_r -00000004 B btn_lang_eng -00000004 B btn_lang_fre -00000004 B btn_lang_ger -00000004 B btn_lang_ita -00000004 B btn_lang_jpn -00000004 B btn_lang_kor -00000004 B btn_lang_spa 00000004 B btn_p_l 00000004 B btn_p_r 00000004 B btn_t_l 00000004 B btn_t_r -00000004 B button_blank_left -00000004 B button_blank_left_2 -00000004 B button_blank_right -00000004 B button_blank_right_2 -00000004 B button_blue_left -00000004 B button_blue_right 00000004 B button_cancel_left 00000004 B button_cancel_right 00000004 B button_confirm_left 00000004 B button_confirm_right -00000004 B button_crystal_left -00000004 B button_crystal_right -00000004 B button_gold_left -00000004 B button_gold_right -00000004 B button_green_left -00000004 B button_green_right 00000004 B button_no -00000004 B button_red_left -00000004 B button_red_right -00000004 B button_silver_left -00000004 B button_silver_right -00000004 B button_yellow_left -00000004 B button_yellow_right 00000004 B button_yes +00000004 B cart_label +00000004 B cart_shell 00000004 B char_index 00000004 B count 00000004 B counter @@ -161,10 +138,12 @@ 00000004 T Diff8bitUnFilterWram 00000004 T Div 00000004 T DivArm +00000004 B down_arrow 00000004 D environ 00000004 B fake_heap_end 00000004 B fake_heap_start 00000004 B FF_count +00000004 B flag 00000004 B frame 00000004 B gen 00000004 B gen_1_room_counter @@ -191,7 +170,7 @@ 00000004 B newest_save_offset 00000004 B num_sprites 00000004 T ObjAffineSet -00000004 B prof +00000004 B point_arrow 00000004 B ptgb_logo_l 00000004 B ptgb_logo_r 00000004 B ptr_block_ptr_high @@ -224,6 +203,7 @@ 00000004 T Stop 00000004 B trade_pokemon 00000004 B u32_rand +00000004 B up_arrow 00000004 D var_box_return 00000004 D var_call_check_flag 00000004 D var_call_return_1 @@ -251,9 +231,15 @@ 00000006 T DivArmAbs 00000006 T DivArmMod 00000006 T Mod +00000008 t ____aeabi_d2iz_from_thumb 00000008 t ____aeabi_d2uiz_from_thumb 00000008 t ____aeabi_dadd_from_thumb +00000008 t ____aeabi_dcmpeq_from_thumb +00000008 t ____aeabi_dcmpge_from_thumb +00000008 t ____aeabi_dcmpgt_from_thumb 00000008 t ____aeabi_dmul_from_thumb +00000008 t ____aeabi_dsub_from_thumb +00000008 t ____aeabi_i2d_from_thumb 00000008 t ____aeabi_idiv_from_thumb 00000008 t ____aeabi_idivmod_from_thumb 00000008 t ____aeabi_ui2d_from_thumb @@ -299,6 +285,7 @@ 00000008 R _ZTIN10__cxxabiv119__foreign_exceptionE 00000008 R _ZTISt9exception 00000008 R _ZTISt9type_info +00000008 T fabs 0000000a T _getpid_r 0000000a T _kill_r 0000000a T _Z12delay_cyclesm @@ -396,6 +383,7 @@ 00000010 R _ZTV9music_var 00000010 b _ZZN12_GLOBAL__N_116get_atomic_mutexEvE12atomic_mutex 00000010 T CpuFastFill +00000010 r init_jk 00000010 T key_repeat_mask 00000010 T sbmp16_get_pixel 00000010 T tte_cmd_skip @@ -407,7 +395,6 @@ 00000012 T _ZN11textbox_var8set_textESt17basic_string_viewIDsSt11char_traitsIDsEE 00000012 T _ZN13Pokemon_Party12get_game_genEv 00000012 T _ZN19mystery_gift_script17init_npc_locationEhhh -00000012 T _ZN7Pokemon14get_dex_numberEv 00000012 T _ZNK10__cxxabiv117__class_type_info20__do_find_public_srcEiPKvPKS0_S2_ 00000012 T _ZNSt13bad_exceptionD0Ev 00000012 R _ZTSSt13bad_exception @@ -423,9 +410,12 @@ 00000014 T _ZN10__cxxabiv111__terminateEPFvvE 00000014 T _ZN10script_var10place_wordEv 00000014 T _ZN11Button_Menu14get_x_from_posEi +00000014 T _ZN11Select_MenuC1Ebi +00000014 T _ZN11Select_MenuC2Ebi 00000014 T _ZN13Pokemon_PartyC1Ev 00000014 T _ZN13Pokemon_PartyC2Ev 00000014 T _ZN7Pokemon10get_is_newEv +00000014 T _ZN7Pokemon14get_dex_numberEv 00000014 T _ZN7Pokemon19get_nature_from_pidEj 00000014 R _ZTVN9__gnu_cxx20recursive_init_errorE 00000014 V _ZTVN9__gnu_cxx24__concurrence_lock_errorE @@ -439,7 +429,6 @@ 00000014 R _ZTVSt9bad_alloc 00000014 T free 00000014 T key_repeat_limits -00000014 D list_of_gb_roms 00000014 B memory_section_array 00000014 T raise 00000014 T sbmp16_plot @@ -450,6 +439,13 @@ 00000016 T _ZN10script_objC2Eiii 00000016 W _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv 00000016 t selfrel_offset31 +00000018 T __aeabi_cdcmpeq +00000018 T __aeabi_cdcmple +00000018 T __aeabi_dcmpeq +00000018 T __aeabi_dcmpge +00000018 T __aeabi_dcmpgt +00000018 T __aeabi_dcmple +00000018 T __aeabi_dcmplt 00000018 T __gnu_Unwind_ForcedUnwind 00000018 T __libc_lock_acquire_recursive 00000018 T __libc_lock_release_recursive @@ -491,6 +487,7 @@ 00000018 T _ZNSt9bad_allocD2Ev 00000018 B curr_line 00000018 R EXP_TYPES +00000018 D list_of_gb_roms 00000018 T tte_set_context 00000018 T tte_set_margins 0000001a t _Unwind_GetGR @@ -506,6 +503,7 @@ 0000001c T __restore_core_regs 0000001c T _Z19initalize_save_datav 0000001c T _Z20get_gender_thresholdib +0000001c T _Z25reload_textbox_backgroundv 0000001c T _Z9is_caughti 0000001c b _ZN12_GLOBAL__N_114emergency_poolE 0000001c T _ZN13Pokemon_Party15get_simple_pkmnEi @@ -546,8 +544,8 @@ 00000020 T _ZNSt9bad_allocD0Ev 00000020 T _ZSt17__throw_bad_allocv 00000020 R _ZTSN10__cxxabiv115__forced_unwindE -00000020 R frame_one_pal -00000020 R frame_two_pal +00000020 r CSWTCH.214 +00000020 r CSWTCH.215 00000020 T tte_set_color 00000022 T _Z14reverse_endianPhj 00000022 R _ZTSN10__cxxabiv117__class_type_infoE @@ -583,6 +581,8 @@ 00000028 T _ZN19mystery_gift_script7callstdEh 00000028 T _ZN6Button4showEv 00000028 T _ZN7asm_var13add_referenceEv +00000028 B games +00000028 B langs 00000028 T obj_hide_multi 00000028 T obj_unhide_multi 00000028 T tte_erase_line @@ -613,9 +613,11 @@ 0000002e T sbmp16_hline 00000030 T __cxa_allocate_exception 00000030 t _GLOBAL__sub_D_delay_counter +00000030 t _GLOBAL__sub_D_last_error 00000030 t _GLOBAL__sub_D_linkSPI 00000030 t _GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE 00000030 T _Z21load_custom_save_datav +00000030 T _Z21modify_background_palb 00000030 T _ZN3Dex4hideEv 00000030 T _ZN3DexC1EP8OBJ_ATTRS1_S1_ 00000030 T _ZN3DexC2EP8OBJ_ATTRS1_S1_ @@ -624,11 +626,12 @@ 00000030 T _ZSt20__throw_out_of_rangePKc 00000030 T se_drawg_w8h8 00000030 T tte_write_ex -00000032 T _ZN7Pokemon15get_simple_pkmnEv 00000032 t next_unwind_byte +00000034 T __aeabi_cdrcmple 00000034 T __cxa_throw 00000034 t _GLOBAL__sub_I_dex_array 00000034 T _ZN19mystery_gift_script13virtualmsgboxEj +00000034 T _ZN7Pokemon15get_simple_pkmnEv 00000036 T _ZN7Pokemon12copy_from_toEPhS0_ib 00000036 T memset16 00000038 r __irq_senders @@ -636,11 +639,13 @@ 00000038 t _ZN10__cxxabiv1L24__is_gxx_exception_classEPc 00000038 T _ZN11Button_MenuC1Eiiiib 00000038 T _ZN11Button_MenuC2Eiiiib +00000038 T _ZN11Select_Menu13clear_optionsEv 00000038 T _ZN6Button13set_highlightEb 00000038 T memcpy32 00000038 T sbmp16_vline 00000038 T strtol 00000038 T tte_cmd_next +00000038 B type_sprites 0000003a T _Z16text_next_obj_id10script_obj 0000003a T _ZN7xse_var13add_referenceEi 0000003c t _GLOBAL__sub_I_linkSPI @@ -659,18 +664,19 @@ 0000003c T _ZN7xse_var13add_referenceEiPS_ 0000003c T _ZNK10__cxxabiv117__class_type_info11__do_upcastEPKS0_PKvRNS0_15__upcast_resultE 0000003c T _ZNK10__cxxabiv117__class_type_info11__do_upcastEPKS0_PPv +0000003c W _ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED1Ev +0000003c W _ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev 0000003e T memcpy16 0000003e t unwind_phase2 -00000040 T _Z12pokedex_hidev 00000040 T _Z15write_byte_savejh 00000040 T _ZN10script_varC1EjRSt6vectorIPS_SaIS1_EEPi 00000040 T _ZN10script_varC2EjRSt6vectorIPS_SaIS1_EEPi -00000040 T _ZN13Pokemon_Party11load_gb_romEv 00000040 W _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERjj 00000040 T _ZSt13get_terminatev 00000040 T _ZSt14get_unexpectedv 00000040 T _ZSt15get_new_handlerv 00000040 R GENDER_THRESHOLDS +00000040 r PIo2 00000040 T se_drawg_w8h16 00000040 T tte_set_colors 00000042 T _Unwind_VRS_Get @@ -678,6 +684,7 @@ 00000044 t _GLOBAL__sub_I_delay_counter 00000044 t _ZL21base_of_encoded_valuehP15_Unwind_Context 00000044 T _ZN11Button_Menu12show_buttonsEv +00000044 T _ZN13Pokemon_Party11load_gb_romEv 00000044 T _ZN19mystery_gift_script10spritefaceEth 00000044 T _ZN19mystery_gift_script12spritebehaveEth 00000044 T _ZN19mystery_gift_script3swiEh @@ -687,30 +694,26 @@ 00000048 T __aeabi_f2d 00000048 T __extendsfdf2 00000048 B __tte_main_context -00000048 T _Z12pokedex_showv 00000048 T _Z14read_byte_savej 00000048 T _Z24compare_map_and_npc_dataiii 00000048 T _ZN19mystery_gift_script13virtualgotoifEhj 00000048 T _ZN19mystery_gift_script7add_asmEt 00000048 T _ZN6Button12set_locationEii 00000048 T _ZN7Pokemon11insert_dataEPhS0_S0_S0_ -00000048 B dex_sprites -00000048 B game_select_def -00000048 B game_select_jpn -00000048 B game_select_kor 00000048 T irq_enable -00000048 B lang_select 00000048 B main_menu 00000048 T oam_init 00000048 B yes_no_menu 0000004a T __gnu_Unwind_Resume 0000004a W _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEjc 0000004a T memcmp +0000004c T _Z12pokedex_showv 0000004c T _Z14can_learn_moveii 0000004c T _Z15load_backgroundv 0000004c T _Z22write_custom_save_datav 0000004c T _ZN13Pokemon_Party10start_linkEv 0000004c T memset32 +0000004e t _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag.isra.0 0000004e t _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag.isra.0 00000050 T __cxa_get_globals 00000050 T __cxa_init_primary_exception @@ -733,8 +736,6 @@ 00000050 T _ZN19mystery_gift_script7compareEtt 00000050 T tte_putc 00000052 T __libc_init_array -00000052 T _ZN7PokemonC1Ev -00000052 T _ZN7PokemonC2Ev 00000052 T _ZNK10__cxxabiv117__class_type_info10__do_catchEPKSt9type_infoPPvj 00000054 T __aeabi_d2uiz 00000054 T __fixunsdfsi @@ -749,16 +750,20 @@ 00000054 T _ZN19mystery_gift_script4ldr1Ehhh 00000054 T _ZN19mystery_gift_script4str1Ehhh 00000054 T _ZN3Dex12set_locationEii +00000054 T _ZN8rom_data10verify_romEv 00000054 T key_poll 00000056 t _ZL23__gxx_exception_cleanup19_Unwind_Reason_CodeP21_Unwind_Control_Block -00000058 t _GLOBAL__sub_D_last_error +00000056 T _ZN11Select_Menu10add_optionENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi +00000058 T _Z23load_textbox_backgroundv 00000058 T _ZN12movement_var15insert_movementEPh 00000058 T _ZN19mystery_gift_script4ldr2Ehhh +00000058 T _ZN7PokemonC1Ev +00000058 T _ZN7PokemonC2Ev 00000058 W _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcj 0000005a T __gnu_Unwind_RaiseException 0000005a T _ZNK10__cxxabiv120__si_class_type_info20__do_find_public_srcEiPKvPKNS_17__class_type_infoES2_ -0000005c T _Z23load_opening_backgroundv -0000005c T _Z23load_textbox_backgroundv +0000005c T __aeabi_d2iz +0000005c T __fixdfsi 0000005c T _ZNSt11logic_errorD1Ev 0000005c T _ZNSt11logic_errorD2Ev 0000005c T _ZNSt12length_errorD1Ev @@ -778,10 +783,9 @@ 00000062 T __cxa_begin_cleanup 00000064 t _GLOBAL__sub_I__ZNSt12ctype_bynameIcEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj 00000064 t _GLOBAL__sub_I__ZNSt12ctype_bynameIwEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj -00000064 T _Z20initalization_scriptv 00000064 T _ZN19mystery_gift_script13applymovementEtj -00000064 T _ZN8rom_data8load_romEv 00000064 W _ZNSs4_Rep9_S_createEjjRKSaIcE +00000068 t _GLOBAL__sub_I_last_error 00000068 T _Z14get_rand_rangejj 00000068 T _ZN19mystery_gift_script18changePaletteMacroEhh 00000068 T _ZN19mystery_gift_script4mov3Ehh @@ -792,6 +796,7 @@ 0000006c T se_drawg_s 0000006c T strncmp 00000070 T __cxa_rethrow +00000070 T _Z20initalization_scriptv 00000070 T _ZN7xse_var14fill_refrencesEPh 00000072 T __gnu_end_cleanup 00000072 t search_EIT_table @@ -799,10 +804,12 @@ 00000074 T __floatundidf 00000078 T __cxa_begin_catch 00000078 B __isr_table +00000078 T _Z12pokedex_hidev 00000078 r _ZL10ENG_SILVER 00000078 r _ZL10ENG_YELLOW 00000078 r _ZL11ENG_CRYSTAL -00000078 r _ZL12ENG_RED_BLUE +00000078 r _ZL7ENG_RED +00000078 r _ZL8ENG_BLUE 00000078 r _ZL8ENG_GOLD 00000078 T _ZN10script_obj8get_textB5cxx11Ev 00000078 T _ZN19mystery_gift_script11setMetaTileEtttt @@ -817,7 +824,12 @@ 0000007c T srf_get_ptr 0000007e T _ZNK10__cxxabiv117__class_type_info12__do_dyncastEiNS0_10__sub_kindEPKS0_PKvS3_S5_RNS0_16__dyncast_resultE 00000080 T __cxa_guard_release +00000080 T _Z12pokedex_initv 00000080 T _Z16init_text_enginev +00000080 r npio2_hw +00000088 T __cmpdf2 +00000088 T __eqdf2 +00000088 T __nedf2 00000088 T _Z9init_bankv 00000088 r _ZL11ENG_RUBY_v0 00000088 r _ZL11ENG_RUBY_v1 @@ -832,11 +844,15 @@ 00000088 r _ZL16ENG_LEAFGREEN_v1 00000088 t _ZN12_GLOBAL__N_14pool8allocateEj.constprop.0 0000008c T __gnu_Unwind_Backtrace +0000008c T _ZN8rom_data8load_romEv 0000008c T _ZNSt11logic_errorC1EPKc 0000008c T _ZNSt11logic_errorC2EPKc 0000008c B curr_rom -00000090 B dex_array +00000090 T __ledf2 +00000090 T __ltdf2 +00000090 T _ZN11Select_Menu9show_menuEv 00000090 T sbmp16_frame +00000090 T sin 00000092 T __cxa_end_catch 00000092 T _ZN7Pokemon21generate_pid_iv_matchEhhPh 00000092 T _ZN8rom_data11fill_valuesEPK8ROM_DATA @@ -845,6 +861,8 @@ 00000094 t _GLOBAL__sub_I__ZNSt12ctype_bynameIwEC2ERKSsj 00000094 t _ZL17parse_lsda_headerP15_Unwind_ContextPKhP16lsda_header_info 00000094 T tte_init_base +00000098 T __gedf2 +00000098 T __gtdf2 00000098 t get_eit_entry 00000098 T memset 0000009c T _Z29update_memory_buffer_checksumb @@ -852,9 +870,10 @@ 0000009c W _ZNSt6vectorIiSaIiEE17_M_realloc_appendIJRKiEEEvDpOT_ 0000009c W _ZNSt6vectorIjSaIjEE17_M_realloc_appendIJjEEEvDpOT_ 0000009c W _ZNSt6vectorIP10script_varSaIS1_EE17_M_realloc_appendIJS1_EEEvDpOT_ +000000a0 T _ZN11Select_Menu9hide_menuEv 000000a0 T isr_master 000000a4 T _ZN11textbox_var19insert_virtual_textEPh -000000ac t _GLOBAL__sub_I_last_error +000000a8 B dex_array 000000ac T _malloc_trim_r 000000ac t _ZN12_GLOBAL__N_14pool4freeEPv.constprop.0 000000ae T memcpy @@ -868,13 +887,17 @@ 000000bc T sbmp16_line 000000bf R gen_1_index_array 000000c0 T _Z26initalize_memory_locationsv +000000c4 T _Z12add_menu_boxi 000000c8 T _ZN10sprite_var18insert_sprite_dataEPhPKjjPKt 000000c8 T srf_init 000000c8 T strchr 000000ca T memmove 000000cc T __cxa_type_match +000000cc T _Z20load_flex_backgroundii +000000cc T _Z9load_flagi 000000d4 T tte_get_text_size 000000d6 T _ZNK10__cxxabiv120__si_class_type_info12__do_dyncastEiNS_17__class_type_info10__sub_kindEPKS1_PKvS4_S6_RNS1_16__dyncast_resultE +000000e4 T _Z17global_next_framev 000000e8 t unwind_phase2_forced 000000ec T tte_write 000000f0 B _Z9out_arrayB5cxx11 @@ -888,18 +911,20 @@ 000000fc R MENU_SPRITES 000000fc R NUM_ABILITIES 000000fc R POWER_POINTS +000000fc T scalbn 00000100 T _ZN13Pokemon_Party22fill_simple_pkmn_arrayEv 00000101 R _ctype_ 00000104 t _ZL28read_encoded_value_with_basehjPKhPj -00000108 T _Z12pokedex_initv -00000108 T _Z17global_next_framev -00000108 T _ZN7Pokemon20generate_pid_save_ivEhhPh +00000108 r two_over_pi 00000110 T _Z16copy_ram_to_savePhjj 00000114 T sbmp16_floodfill_internal 00000118 T _Z16copy_save_to_ramjPhj +0000011c T _ZN7Pokemon20generate_pid_save_ivEhhPh 00000120 D _impure_data 00000120 T _ZN19mystery_gift_script17changeSpriteMacroEhj +00000120 W _ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_appendIJRKS5_EEEvDpOT_ 00000120 B dialogue +00000120 T floor 00000126 T _ZN11Button_Menu16organize_buttonsEv 00000128 T _memalign_r 00000128 T irq_set @@ -909,18 +934,21 @@ 00000130 T _Z15is_save_correctPhjj 0000013c T _ZN11Button_Menu10add_buttonE6Buttoni 00000148 T sbmp16_blit +0000014c T _Z13load_graphicsv 0000014c W _ZNSt6vectorIS_IhSaIhEESaIS1_EE17_M_realloc_appendIJRKS1_EEEvDpOT_ -00000150 T _Z21populate_lang_buttonsv 00000154 t _strtoul_l.isra.0 +00000158 T __kernel_sin +00000164 T _Z17load_type_spritesiib +00000164 T _ZN11Select_Menu16select_menu_mainEv 00000164 T tte_init_se 00000168 B __sf 00000168 T _Z17print_mem_sectionv -0000017c T _Z13load_graphicsv +000001a4 T _Z18populate_lang_menuv 000001b0 T _ZN9music_var17insert_music_dataEPhhhhj -000001dc T _Z21load_temp_box_sprites13Pokemon_Party +000001cc T _Z21load_temp_box_sprites13Pokemon_Party 000001e8 T _ZN7Pokemon19alocate_data_chunksEPhS0_S0_S0_ 000001f4 T _free_r -000001f8 T main +000001f8 R TYPES 000001fc T _Z17populate_dialoguev 00000200 R gen_1_Eng_char_array 00000200 R gen_1_FreGer_char_array @@ -934,48 +962,52 @@ 00000200 R gen_3_Jpn_char_array 0000020c T __aeabi_ddiv 0000020c T __divdf3 +00000210 T main 00000224 T _Z14inject_mysteryR13Pokemon_Party 00000224 T strcmp +0000022c T __kernel_cos +00000234 T _Z18populate_game_menui 0000025c t _strtol_l.part.0 00000280 R EVENT_PKMN 0000028c T _ZN11Button_Menu11button_mainEv 00000290 T __aeabi_dmul 00000290 T __muldf3 -00000294 T _Z20load_eternal_spritesv -00000298 T _ZN7Pokemon9load_dataEiPhii +00000298 T _Z15run_conditionali +0000029c T _Z20load_eternal_spritesv 000002a4 T _ZN8rom_data14print_rom_infoEv +000002ac T _ZN7Pokemon9load_dataEiPhii +000002b4 T _Z9load_cartii 000002cc t __gnu_unwind_pr_common -000002cc T _Z15run_conditionali 000002e4 T _Unwind_VRS_Pop +00000300 t _GLOBAL__sub_I_obj_buffer 0000030c T __gnu_unwind_execute 00000310 T __adddf3 00000310 T __aeabi_dadd 00000314 T __aeabi_dsub 00000314 T __subdf3 -0000037c T _Z21populate_game_buttonsv -00000380 T _ZN7Pokemon12set_to_eventEh +00000388 T _ZN7Pokemon12set_to_eventEh 00000400 B obj_buffer 00000408 D __malloc_av_ -00000430 t _GLOBAL__sub_I_obj_buffer -00000444 T _Z17load_temp_spritesi +00000438 T __ieee754_rem_pio2 0000044e D gen2_debug_box_data 00000454 T tte_cmd_default 00000462 D gen1_debug_box_data -000004d4 T _Z9text_loopi +000004bc T _Z9text_loopi 000004ee T __gxx_personality_v0 00000588 T _malloc_r -000005d8 T _ZN8Box_Menu8box_mainE13Pokemon_Party +000005b8 T _ZN8Box_Menu8box_mainE13Pokemon_Party 00000690 B party_data -0000069c T _ZN7Pokemon20convert_to_gen_threeEbb 000006c0 B event_script 000006c0 B transfer_script +000006dc T _ZN7Pokemon20convert_to_gen_threeEbb 000007e0 B NAMES -000007f4 T _Z12pokedex_loopv 00000850 T _Z7creditsv +00000870 T _Z12pokedex_loopv +000008d8 T __kernel_rem_pio2 00000940 T _Z15populate_scriptv 00000bd0 R JPN_NAMES 00001000 B global_memory_buffer 000011f8 t _GLOBAL__sub_I_EXP_TYPES 00001570 T _ZN19mystery_gift_script16build_script_oldER13Pokemon_Party 00001f80 R MOVESETS -00004418 T _ZN19mystery_gift_script12build_scriptER13Pokemon_Party +00004438 T _ZN19mystery_gift_script12build_scriptER13Pokemon_Party diff --git a/graphics/btn_lang_eng.grit b/graphics/GBCS_Shell.grit similarity index 80% rename from graphics/btn_lang_eng.grit rename to graphics/GBCS_Shell.grit index aa1971c..8049edb 100644 --- a/graphics/btn_lang_eng.grit +++ b/graphics/GBCS_Shell.grit @@ -1,3 +1,3 @@ # # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file +-gB4 \ No newline at end of file diff --git a/graphics/GBCS_Shell.png b/graphics/GBCS_Shell.png new file mode 100644 index 0000000..4bcbc50 Binary files /dev/null and b/graphics/GBCS_Shell.png differ diff --git a/graphics/btn_lang_ger.grit b/graphics/GBC_Shell.grit similarity index 80% rename from graphics/btn_lang_ger.grit rename to graphics/GBC_Shell.grit index aa1971c..8049edb 100644 --- a/graphics/btn_lang_ger.grit +++ b/graphics/GBC_Shell.grit @@ -1,3 +1,3 @@ # # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file +-gB4 \ No newline at end of file diff --git a/graphics/GBC_Shell.png b/graphics/GBC_Shell.png new file mode 100644 index 0000000..fbf748b Binary files /dev/null and b/graphics/GBC_Shell.png differ diff --git a/graphics/btn_lang_fre.grit b/graphics/GBS_Shell.grit similarity index 80% rename from graphics/btn_lang_fre.grit rename to graphics/GBS_Shell.grit index aa1971c..8049edb 100644 --- a/graphics/btn_lang_fre.grit +++ b/graphics/GBS_Shell.grit @@ -1,3 +1,3 @@ # # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file +-gB4 \ No newline at end of file diff --git a/graphics/GBS_Shell.png b/graphics/GBS_Shell.png new file mode 100644 index 0000000..dc1aec2 Binary files /dev/null and b/graphics/GBS_Shell.png differ diff --git a/graphics/btn_lang_ita.grit b/graphics/GB_Shell.grit similarity index 80% rename from graphics/btn_lang_ita.grit rename to graphics/GB_Shell.grit index aa1971c..8049edb 100644 --- a/graphics/btn_lang_ita.grit +++ b/graphics/GB_Shell.grit @@ -1,3 +1,3 @@ # # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file +-gB4 \ No newline at end of file diff --git a/graphics/GB_Shell.png b/graphics/GB_Shell.png new file mode 100644 index 0000000..ce04ffe Binary files /dev/null and b/graphics/GB_Shell.png differ diff --git a/graphics/Label_Blue.grit b/graphics/Label_Blue.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Blue.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Blue.png b/graphics/Label_Blue.png new file mode 100644 index 0000000..be5fc56 Binary files /dev/null and b/graphics/Label_Blue.png differ diff --git a/graphics/Label_Crystal.grit b/graphics/Label_Crystal.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Crystal.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Crystal.png b/graphics/Label_Crystal.png new file mode 100644 index 0000000..17fe929 Binary files /dev/null and b/graphics/Label_Crystal.png differ diff --git a/graphics/Label_Gold.grit b/graphics/Label_Gold.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Gold.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Gold.png b/graphics/Label_Gold.png new file mode 100644 index 0000000..03502ac Binary files /dev/null and b/graphics/Label_Gold.png differ diff --git a/graphics/Label_Green.grit b/graphics/Label_Green.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Green.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Green.png b/graphics/Label_Green.png new file mode 100644 index 0000000..1c5d41f Binary files /dev/null and b/graphics/Label_Green.png differ diff --git a/graphics/Label_Red.grit b/graphics/Label_Red.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Red.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Red.png b/graphics/Label_Red.png new file mode 100644 index 0000000..9b3c860 Binary files /dev/null and b/graphics/Label_Red.png differ diff --git a/graphics/Label_Silver.grit b/graphics/Label_Silver.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Silver.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Silver.png b/graphics/Label_Silver.png new file mode 100644 index 0000000..89899e1 Binary files /dev/null and b/graphics/Label_Silver.png differ diff --git a/graphics/Label_Yellow.grit b/graphics/Label_Yellow.grit new file mode 100644 index 0000000..122a18f --- /dev/null +++ b/graphics/Label_Yellow.grit @@ -0,0 +1,3 @@ +# +# label sprites : 4bpp, not compressed. Pallet 8, copy from 0 to 16. +-mp8 -gB4 -ps0 -pe16 -mR! \ No newline at end of file diff --git a/graphics/Label_Yellow.png b/graphics/Label_Yellow.png new file mode 100644 index 0000000..9f3a57b Binary files /dev/null and b/graphics/Label_Yellow.png differ diff --git a/graphics/btn_lang_eng.png b/graphics/btn_lang_eng.png deleted file mode 100644 index 2c3aac8..0000000 Binary files a/graphics/btn_lang_eng.png and /dev/null differ diff --git a/graphics/btn_lang_fre.png b/graphics/btn_lang_fre.png deleted file mode 100644 index 5d06073..0000000 Binary files a/graphics/btn_lang_fre.png and /dev/null differ diff --git a/graphics/btn_lang_ger.png b/graphics/btn_lang_ger.png deleted file mode 100644 index c7c4c09..0000000 Binary files a/graphics/btn_lang_ger.png and /dev/null differ diff --git a/graphics/btn_lang_ita.png b/graphics/btn_lang_ita.png deleted file mode 100644 index 87d9a98..0000000 Binary files a/graphics/btn_lang_ita.png and /dev/null differ diff --git a/graphics/btn_lang_jpn.grit b/graphics/btn_lang_jpn.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/btn_lang_jpn.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/btn_lang_jpn.png b/graphics/btn_lang_jpn.png deleted file mode 100644 index 9acd97f..0000000 Binary files a/graphics/btn_lang_jpn.png and /dev/null differ diff --git a/graphics/btn_lang_kor.grit b/graphics/btn_lang_kor.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/btn_lang_kor.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/btn_lang_kor.png b/graphics/btn_lang_kor.png deleted file mode 100644 index 2c5f1a3..0000000 Binary files a/graphics/btn_lang_kor.png and /dev/null differ diff --git a/graphics/btn_lang_spa.grit b/graphics/btn_lang_spa.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/btn_lang_spa.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/btn_lang_spa.png b/graphics/btn_lang_spa.png deleted file mode 100644 index 09dbcc6..0000000 Binary files a/graphics/btn_lang_spa.png and /dev/null differ diff --git a/graphics/button_blank_left.grit b/graphics/button_blank_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_blank_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_blank_left.png b/graphics/button_blank_left.png deleted file mode 100644 index 52091f7..0000000 Binary files a/graphics/button_blank_left.png and /dev/null differ diff --git a/graphics/button_blue_left.grit b/graphics/button_blue_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_blue_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_blue_left.png b/graphics/button_blue_left.png deleted file mode 100644 index ec820c4..0000000 Binary files a/graphics/button_blue_left.png and /dev/null differ diff --git a/graphics/button_crystal_left.grit b/graphics/button_crystal_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_crystal_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_crystal_left.png b/graphics/button_crystal_left.png deleted file mode 100644 index f5cf7bc..0000000 Binary files a/graphics/button_crystal_left.png and /dev/null differ diff --git a/graphics/button_gold_left.grit b/graphics/button_gold_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_gold_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_gold_left.png b/graphics/button_gold_left.png deleted file mode 100644 index 290e801..0000000 Binary files a/graphics/button_gold_left.png and /dev/null differ diff --git a/graphics/button_green_left.grit b/graphics/button_green_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_green_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_green_left.png b/graphics/button_green_left.png deleted file mode 100644 index 950d710..0000000 Binary files a/graphics/button_green_left.png and /dev/null differ diff --git a/graphics/button_red_left.grit b/graphics/button_red_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_red_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_red_left.png b/graphics/button_red_left.png deleted file mode 100644 index dab5f65..0000000 Binary files a/graphics/button_red_left.png and /dev/null differ diff --git a/graphics/button_silver_left.grit b/graphics/button_silver_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_silver_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_silver_left.png b/graphics/button_silver_left.png deleted file mode 100644 index 9227a9a..0000000 Binary files a/graphics/button_silver_left.png and /dev/null differ diff --git a/graphics/button_yellow_left.grit b/graphics/button_yellow_left.grit deleted file mode 100644 index aa1971c..0000000 --- a/graphics/button_yellow_left.grit +++ /dev/null @@ -1,3 +0,0 @@ -# -# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. --gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/button_yellow_left.png b/graphics/button_yellow_left.png deleted file mode 100644 index 4bfd5f8..0000000 Binary files a/graphics/button_yellow_left.png and /dev/null differ diff --git a/graphics/flag_eng.grit b/graphics/flag_eng.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_eng.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_eng.png b/graphics/flag_eng.png new file mode 100644 index 0000000..914a4ef Binary files /dev/null and b/graphics/flag_eng.png differ diff --git a/graphics/flag_fre.grit b/graphics/flag_fre.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_fre.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_fre.png b/graphics/flag_fre.png new file mode 100644 index 0000000..fb55848 Binary files /dev/null and b/graphics/flag_fre.png differ diff --git a/graphics/flag_ger.grit b/graphics/flag_ger.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_ger.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_ger.png b/graphics/flag_ger.png new file mode 100644 index 0000000..7a4005d Binary files /dev/null and b/graphics/flag_ger.png differ diff --git a/graphics/flag_ita.grit b/graphics/flag_ita.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_ita.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_ita.png b/graphics/flag_ita.png new file mode 100644 index 0000000..ece84ab Binary files /dev/null and b/graphics/flag_ita.png differ diff --git a/graphics/flag_jpn.grit b/graphics/flag_jpn.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_jpn.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_jpn.png b/graphics/flag_jpn.png new file mode 100644 index 0000000..5b6cf98 Binary files /dev/null and b/graphics/flag_jpn.png differ diff --git a/graphics/flag_kor.grit b/graphics/flag_kor.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_kor.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_kor.png b/graphics/flag_kor.png new file mode 100644 index 0000000..0b257a4 Binary files /dev/null and b/graphics/flag_kor.png differ diff --git a/graphics/flag_spa.grit b/graphics/flag_spa.grit new file mode 100644 index 0000000..07e8123 --- /dev/null +++ b/graphics/flag_spa.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. +-gB4 \ No newline at end of file diff --git a/graphics/flag_spa.png b/graphics/flag_spa.png new file mode 100644 index 0000000..60b3672 Binary files /dev/null and b/graphics/flag_spa.png differ diff --git a/graphics/unused graphics/0a_GB.png b/graphics/unused graphics/0a_GB.png new file mode 100644 index 0000000..1b4b3c9 Binary files /dev/null and b/graphics/unused graphics/0a_GB.png differ diff --git a/graphics/unused graphics/0b_GBC.png b/graphics/unused graphics/0b_GBC.png new file mode 100644 index 0000000..598292e Binary files /dev/null and b/graphics/unused graphics/0b_GBC.png differ diff --git a/graphics/unused graphics/1_Red.png b/graphics/unused graphics/1_Red.png new file mode 100644 index 0000000..65fdf80 Binary files /dev/null and b/graphics/unused graphics/1_Red.png differ diff --git a/graphics/unused graphics/2_Blue.png b/graphics/unused graphics/2_Blue.png new file mode 100644 index 0000000..6abd4a7 Binary files /dev/null and b/graphics/unused graphics/2_Blue.png differ diff --git a/graphics/unused graphics/3_Yellow.png b/graphics/unused graphics/3_Yellow.png new file mode 100644 index 0000000..6af16dc Binary files /dev/null and b/graphics/unused graphics/3_Yellow.png differ diff --git a/graphics/unused graphics/4_Gold.png b/graphics/unused graphics/4_Gold.png new file mode 100644 index 0000000..82d9680 Binary files /dev/null and b/graphics/unused graphics/4_Gold.png differ diff --git a/graphics/unused graphics/5_Silver.png b/graphics/unused graphics/5_Silver.png new file mode 100644 index 0000000..d84cf1a Binary files /dev/null and b/graphics/unused graphics/5_Silver.png differ diff --git a/graphics/unused graphics/6_Crystal.png b/graphics/unused graphics/6_Crystal.png new file mode 100644 index 0000000..012f45b Binary files /dev/null and b/graphics/unused graphics/6_Crystal.png differ diff --git a/graphics/unused graphics/7_JpnGold.png b/graphics/unused graphics/7_JpnGold.png new file mode 100644 index 0000000..7130610 Binary files /dev/null and b/graphics/unused graphics/7_JpnGold.png differ diff --git a/graphics/unused graphics/8_JpnSilver.png b/graphics/unused graphics/8_JpnSilver.png new file mode 100644 index 0000000..ee970bc Binary files /dev/null and b/graphics/unused graphics/8_JpnSilver.png differ diff --git a/graphics/unused graphics/l_tcg.png b/graphics/unused graphics/l_tcg.png new file mode 100644 index 0000000..05decb2 Binary files /dev/null and b/graphics/unused graphics/l_tcg.png differ diff --git a/include/debug_mode.h b/include/debug_mode.h index 05e8d10..7bf8042 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -2,14 +2,14 @@ #define DEBUG_MODE_H #define DEBUG_MODE false -#define IGNORE_GAME_PAK true +#define IGNORE_GAME_PAK false #define IGNORE_LINK_CABLE true #define IGNORE_MG_E4_FLAGS false -#define IGNORE_UNRECEIVED_PKMN true +#define IGNORE_UNRECEIVED_PKMN false #define FORCE_TUTORIAL false #define DONT_REMOVE_PKMN false #define SHOW_INVALID_PKMN false -#define IGNORE_DEX_COMPLETION true +#define IGNORE_DEX_COMPLETION false #define DEBUG_GAME FIRERED_ID #define DEBUG_VERS VERS_1_1 diff --git a/include/gb_rom_values/base_gb_rom_struct.h b/include/gb_rom_values/base_gb_rom_struct.h index 93bf21f..a9eb909 100644 --- a/include/gb_rom_values/base_gb_rom_struct.h +++ b/include/gb_rom_values/base_gb_rom_struct.h @@ -8,7 +8,7 @@ typedef unsigned int u32, word, uint, eint; typedef unsigned long long u64; #define PAYLOAD_SIZE 672 -#define NUM_GB_ROMS 5 +#define NUM_GB_ROMS 6 #define GB_TILE_WIDTH 20 diff --git a/include/gb_rom_values/eng_gb_rom_values.h b/include/gb_rom_values/eng_gb_rom_values.h index 9931f0b..1524f71 100644 --- a/include/gb_rom_values/eng_gb_rom_values.h +++ b/include/gb_rom_values/eng_gb_rom_values.h @@ -24,7 +24,45 @@ #include "gb_rom_values/base_gb_rom_struct.h" -const struct GB_ROM ENG_RED_BLUE = { +const struct GB_ROM 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, + + .enter_vector_location = 0xC5D6, + + .clearScreen = 0x190F, + .CableClub_TextBoxBorder = 0x5AB3, + .placeString = 0x1955, + .Serial_ExchangeBytes = 0x216F, + ._RemovePokemon = 0x7B68, + .SaveSAVtoSRAM1 = 0x1C77E2, + .SaveSAVtoSRAM2 = 0x1C780F, + .Bankswitch = 0x35D6, + .SoftReset = 0x1F49, + .garbageDataLocation = 0x0316, + + .wRemoveMonFromBox = 0xCF95, + .wBoxCount = 0xDA80, + .wWhichPokemon = 0xCF92, + .hSerialConnectionStatus = 0xFFAA, + .wBoxDataStart = 0xDA80, + .wBoxDataEnd = 0xDEE2, + + .transferStringLocation = 0xC443, + .textBorderUppLeft = 0xC42E, + .textBorderWidth = 3, + .textBorderHeight = 14, +}; +const struct GB_ROM ENG_BLUE = { .language = ENG_ID, .version = RED_ID, .generation = 1, diff --git a/include/pokemon.h b/include/pokemon.h index 84a201c..43e71ba 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -31,6 +31,7 @@ public: int ot_size = 0; int nickname_size = 0; int nature_mod = 0; + byte unown_letter = -1; Pokemon(); void load_data(int index, byte *party_data, int game, int lang); void convert_to_gen_three(bool simplified, bool stabilize_mythical); diff --git a/include/script_array.h b/include/script_array.h index 2755c2e..be5ccc4 100644 --- a/include/script_array.h +++ b/include/script_array.h @@ -102,8 +102,8 @@ extern rom_data curr_rom; void populate_script(); void populate_dialogue(); -void populate_lang_buttons(); -void populate_game_buttons(); +void populate_lang_menu(); +void populate_game_menu(int lang); bool run_conditional(int index); #endif \ No newline at end of file diff --git a/include/select_menu.h b/include/select_menu.h new file mode 100644 index 0000000..46b8b45 --- /dev/null +++ b/include/select_menu.h @@ -0,0 +1,31 @@ +#ifndef SELECT_MENU_H +#define SELECT_MENU_H + +#include +#include +#include + +#define LANG_MENU 1 +#define CART_MENU 2 + +class Select_Menu +{ +public: + Select_Menu(bool enable_cancel, int nMenu_type); + int select_menu_main(); + void hide_menu(); + void show_menu(); + void clear_options(); + void add_option(std::string option, int return_value); + void set_lang(int nLang); + +private: + std::vector menu_options; + std::vector return_values; + unsigned int curr_selection; + bool cancel_enabled; + int menu_type; + int lang; +}; + +#endif \ No newline at end of file diff --git a/include/sprite_data.h b/include/sprite_data.h index 677b6fc..a161af7 100644 --- a/include/sprite_data.h +++ b/include/sprite_data.h @@ -10,8 +10,8 @@ extern OBJ_ATTR obj_buffer[128]; extern OBJ_AFFINE *obj_aff_buffer; extern int num_sprites; -//#include "metr.h" -//extern OBJ_ATTR *testroid; +// #include "metr.h" +// extern OBJ_ATTR *testroid; #include "btn_t_l.h" extern OBJ_ATTR *btn_t_l; #include "btn_t_r.h" @@ -32,65 +32,40 @@ extern OBJ_ATTR *btn_d_r; extern OBJ_ATTR *button_yes; #include "button_no.h" extern OBJ_ATTR *button_no; -#include "button_blank_left.h" -extern OBJ_ATTR *button_blank_left; -extern OBJ_ATTR *button_blank_right; -extern OBJ_ATTR *button_blank_left_2; -extern OBJ_ATTR *button_blank_right_2; - -#define SPRITE_BATCH_LANG 0 -#include "btn_lang_jpn.h" -extern OBJ_ATTR *btn_lang_jpn; -#include "btn_lang_eng.h" -extern OBJ_ATTR *btn_lang_eng; -#include "btn_lang_fre.h" -extern OBJ_ATTR *btn_lang_fre; -#include "btn_lang_ita.h" -extern OBJ_ATTR *btn_lang_ita; -#include "btn_lang_ger.h" -extern OBJ_ATTR *btn_lang_ger; -#include "btn_lang_spa.h" -extern OBJ_ATTR *btn_lang_spa; -#include "btn_lang_kor.h" -extern OBJ_ATTR *btn_lang_kor; - -#define SPRITE_BATCH_GAMES 1 -#include "button_green_left.h" -extern OBJ_ATTR *button_green_left; -extern OBJ_ATTR *button_green_right; -#include "button_blue_left.h" -extern OBJ_ATTR *button_blue_left; -extern OBJ_ATTR *button_blue_right; -#include "button_red_left.h" -extern OBJ_ATTR *button_red_left; -extern OBJ_ATTR *button_red_right; -#include "button_yellow_left.h" -extern OBJ_ATTR *button_yellow_left; -extern OBJ_ATTR *button_yellow_right; -#include "button_gold_left.h" -extern OBJ_ATTR *button_gold_left; -extern OBJ_ATTR *button_gold_right; -#include "button_silver_left.h" -extern OBJ_ATTR *button_silver_left; -extern OBJ_ATTR *button_silver_right; -#include "button_crystal_left.h" -extern OBJ_ATTR *button_crystal_left; -extern OBJ_ATTR *button_crystal_right; #include "button_game_select_edge.h" -#define SPRITE_BATCH_DEX 2 #include "types.h" extern OBJ_ATTR *type_sprites[14]; + +#include "flag_jpn.h" +#include "flag_eng.h" +#include "flag_fre.h" +#include "flag_ita.h" +#include "flag_ger.h" +#include "flag_spa.h" +#include "flag_kor.h" +extern OBJ_ATTR *flag; +#include "Label_Green.h" +#include "Label_Red.h" +#include "Label_Blue.h" +#include "Label_Yellow.h" +#include "Label_Gold.h" +#include "Label_Silver.h" +#include "Label_Crystal.h" +extern OBJ_ATTR *cart_label; +#include "GB_Shell.h" +#include "GBC_Shell.h" +#include "GBS_Shell.h" +#include "GBCS_Shell.h" +extern OBJ_ATTR *cart_shell; + #include "arrows.h" extern OBJ_ATTR *up_arrow; extern OBJ_ATTR *down_arrow; extern OBJ_ATTR *point_arrow; - #include "duel_frame_menu_sprites.h" extern OBJ_ATTR *party_sprites[30]; -extern const unsigned short frame_one_pal[16]; -extern const unsigned short frame_two_pal[16]; #include "box_select.h" extern OBJ_ATTR *box_select; #include "button_cancel_left.h" @@ -105,8 +80,6 @@ extern OBJ_ATTR *ptgb_logo_l; #include "ptgb_logo_r.h" extern OBJ_ATTR *ptgb_logo_r; -#include "lookerFRLG.h" - #define BG2VOF_SMALL_TEXTBOX 96 #define BG2VOF_LARGE_TEXTBOX 0 @@ -118,6 +91,8 @@ extern OBJ_ATTR *ptgb_logo_r; #define LOGO_PAL 5 #define TYPES_PAL1 6 #define TYPES_PAL2 7 +#define CART_PAL 8 +#define FLAG_PAL 9 #define BG_OPENING 0 #define BG_FENNEL 1 @@ -130,8 +105,11 @@ void modify_background_pal(bool dark); void load_textbox_background(); void load_flex_background(int background_id, int layer); void load_eternal_sprites(); -void load_temp_sprites(int sprite_batch_id); void load_temp_box_sprites(Pokemon_Party party_data); void load_type_sprites(int pkmn_index, int dex_offset, bool is_caught); +void add_menu_box(int options); +void reload_textbox_background(); +void load_cart(int game_id, int lang); +void load_flag(int lang_id); #endif \ No newline at end of file diff --git a/source/global_frame_controller.cpp b/source/global_frame_controller.cpp index 44953e1..a03ca34 100644 --- a/source/global_frame_controller.cpp +++ b/source/global_frame_controller.cpp @@ -22,8 +22,6 @@ void global_next_frame() // mmFrame(); //Music if (global_frame_count % 60 == 0) { - memcpy(pal_obj_mem + (MENU_SPRITE_PAL * 16), frame_one_pal, 32); - if (!curr_rom.verify_rom()) { REG_BG0CNT = (REG_BG0CNT & ~BG_PRIO_MASK) | BG_PRIO(3); @@ -39,10 +37,7 @@ void global_next_frame() while(true){}; } } - else if (global_frame_count % 60 == 30) - { - memcpy(pal_obj_mem + (MENU_SPRITE_PAL * 16), frame_two_pal, 32); - } + global_frame_count++; }; diff --git a/source/main.cpp b/source/main.cpp index fd4edca..5ceeac1 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -104,7 +104,7 @@ void load_graphics() main_menu.clear_vector(); main_menu.add_button(Button(btn_t_l, btn_t_r, 48), BTN_TRANSFER); main_menu.add_button(Button(btn_p_l, btn_p_r, 48), BTN_POKEDEX); - //main_menu.add_button(Button(btn_d_l, btn_d_r, 48), BTN_EVENTS); + // main_menu.add_button(Button(btn_d_l, btn_d_r, 48), BTN_EVENTS); main_menu.add_button(Button(btn_c_l, btn_c_r, 48), BTN_CREDITS); main_menu.set_xy_min_max(0, H_MAX, 48, V_MAX); @@ -117,7 +117,7 @@ void load_graphics() void initalization_script(void) { // Initalizations - REG_DISPCNT = DCNT_MODE0 | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_BG3 | DCNT_OBJ | DCNT_OBJ_1D; + REG_DISPCNT = DCNT_BLANK | DCNT_MODE0 | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_BG3 | DCNT_OBJ | DCNT_OBJ_1D; irq_init(NULL); irq_enable(II_VBLANK); @@ -143,6 +143,9 @@ void initalization_script(void) // Set the random seed rand_set_seed(0x1216); + + VBlankIntrWait(); + REG_DISPCNT &= ~DCNT_BLANK; }; void game_load_error(void) @@ -237,7 +240,7 @@ int credits() bool tutorial = get_tutorial_flag(); int def_lang = get_def_lang_num(); - + set_textbox_large(); tte_write("Debug info:\n\nG: "); std::string lang; @@ -292,7 +295,7 @@ int main(void) { initalization_script(); - // Check if the game has been loaded correctly. + // Check if the game has been loaded correctly. while (!curr_rom.load_rom()) { game_load_error(); @@ -364,7 +367,6 @@ int main(void) { load_flex_background(BG_DEX, 2); modify_background_pal(true); - load_temp_sprites(SPRITE_BATCH_DEX); obj_hide_multi(ptgb_logo_l, 2); pokedex_loop(); load_flex_background(BG_DEX, 3); diff --git a/source/pokemon.cpp b/source/pokemon.cpp index e11f6f8..92f88b5 100644 --- a/source/pokemon.cpp +++ b/source/pokemon.cpp @@ -675,16 +675,15 @@ u32 Pokemon::generate_pid_save_iv(byte pid_species_index, byte nature, byte *pid { // Set Unown Letter u32 new_pid = 0; - byte letter = 0; if (pid_species_index == 0xC9) // Checks if the Pokemon is Unown { - letter |= ((pid_dvs[0] >> 5) & 0b11) << 6; - letter |= ((pid_dvs[0] >> 1) & 0b11) << 4; - letter |= ((pid_dvs[1] >> 5) & 0b11) << 2; - letter |= ((pid_dvs[1] >> 1) & 0b11); - letter = letter / 10; + unown_letter |= ((pid_dvs[0] >> 5) & 0b11) << 6; + unown_letter |= ((pid_dvs[0] >> 1) & 0b11) << 4; + unown_letter |= ((pid_dvs[1] >> 5) & 0b11) << 2; + unown_letter |= ((pid_dvs[1] >> 1) & 0b11); + unown_letter = unown_letter / 10; - byte letter_mod = rand_reverse_mod(28, letter); + 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); @@ -931,4 +930,5 @@ void Pokemon::set_to_event(byte nature) // 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; -} \ No newline at end of file +} + diff --git a/source/pokemon_party.cpp b/source/pokemon_party.cpp index 8e71a8d..c356188 100644 --- a/source/pokemon_party.cpp +++ b/source/pokemon_party.cpp @@ -10,7 +10,8 @@ #include "payload_builder.h" const GB_ROM *list_of_gb_roms[NUM_GB_ROMS] = { - &ENG_RED_BLUE, + &ENG_RED, + &ENG_BLUE, &ENG_YELLOW, &ENG_GOLD, &ENG_SILVER, diff --git a/source/script_array.cpp b/source/script_array.cpp index 5a06e20..80eeb59 100644 --- a/source/script_array.cpp +++ b/source/script_array.cpp @@ -10,14 +10,13 @@ #include "box_menu.h" #include #include "background_engine.h" +#include "select_menu.h" int last_error; Pokemon_Party party_data = Pokemon_Party(); -Button_Menu lang_select(2, 4, 40, 24, false); -Button_Menu game_select_def(2, 2, 72, 32, true); -Button_Menu game_select_jpn(3, 2, 72, 32, true); -Button_Menu game_select_kor(1, 1, 72, 32, true); +Select_Menu langs(false, LANG_MENU); +Select_Menu games(false, CART_MENU); Box_Menu box_viewer; script_obj transfer_script[SCRIPT_SIZE]; @@ -86,7 +85,7 @@ void populate_script() transfer_script[DIA_WHAT_GAME_TRANS] = script_obj(dialogue[DIA_WHAT_GAME_TRANS], CMD_GAME_MENU); transfer_script[CMD_GAME_MENU] = script_obj(CMD_GAME_MENU, COND_GB_ROM_EXISTS, DIA_WHAT_LANG_TRANS); transfer_script[DIA_WHAT_LANG_TRANS] = script_obj(dialogue[DIA_WHAT_LANG_TRANS], CMD_LANG_MENU); - transfer_script[CMD_LANG_MENU] = script_obj(CMD_LANG_MENU, DIA_WHAT_GAME_TRANS); + transfer_script[CMD_LANG_MENU] = script_obj(CMD_LANG_MENU, DIA_WHAT_GAME_TRANS, DIA_CANCEL); transfer_script[DIA_ASK_QUEST] = script_obj(dialogue[DIA_ASK_QUEST], CMD_SLIDE_PROF_LEFT); transfer_script[CMD_SLIDE_PROF_LEFT] = script_obj(CMD_SLIDE_PROF_LEFT, DIA_WHAT_LANG_TRANS); transfer_script[CMD_SLIDE_PROF_RIGHT] = script_obj(CMD_SLIDE_PROF_RIGHT, DIA_LETS_START); @@ -164,53 +163,56 @@ void populate_script() event_script[CMD_BACK_TO_MENU] = script_obj(CMD_BACK_TO_MENU, T_SCRIPT_START); }; -void populate_lang_buttons() +void populate_lang_menu() { - lang_select.set_xy_min_max(48, 240, 0, 112); - lang_select.clear_vector(); - lang_select.add_button(Button(btn_lang_jpn), JPN_ID); - lang_select.add_button(Button(btn_lang_eng), ENG_ID); - lang_select.add_button(Button(btn_lang_fre), FRE_ID); - lang_select.add_button(Button(btn_lang_ita), ITA_ID); - lang_select.add_button(Button(btn_lang_ger), GER_ID); - lang_select.add_button(Button(btn_lang_spa), SPA_ID); - lang_select.add_button(Button(btn_lang_kor), KOR_ID); + langs.add_option("English", ENG_ID); + langs.add_option("Japanese", JPN_ID); + langs.add_option("Spanish", SPA_ID); + langs.add_option("French", FRE_ID); + langs.add_option("German", GER_ID); + langs.add_option("Italian", ITA_ID); + langs.add_option("Korean", KOR_ID); + langs.add_option("Cancel", -1); } -void populate_game_buttons() +void populate_game_menu(int lang) { - game_select_jpn.clear_vector(); - game_select_jpn.set_rows_and_columns(3, 3); - game_select_jpn.add_button(Button(button_green_left, button_green_right, 64), GREEN_ID); - game_select_jpn.add_button(Button(button_red_left, button_red_right, 64), RED_ID); - game_select_jpn.add_button(Button(button_blue_left, button_blue_right, 64), BLUE_ID); - game_select_jpn.add_button(Button(button_yellow_left, button_yellow_right, 64), YELLOW_ID); - game_select_jpn.add_button(Button(button_gold_left, button_gold_right, 64), GOLD_ID); - game_select_jpn.add_button(Button(button_silver_left, button_silver_right, 64), SILVER_ID); - game_select_jpn.add_button(Button(button_crystal_left, button_crystal_right, 64), CRYSTAL_ID); - game_select_jpn.set_xy_min_max(32, 240, 0, 120); + switch (lang) + { + case (JPN_ID): + games.add_option("Red", RED_ID); + games.add_option("Green", GREEN_ID); + games.add_option("Blue", BLUE_ID); + games.add_option("Yellow", YELLOW_ID); + games.add_option("Gold", GOLD_ID); + games.add_option("Silver", SILVER_ID); + games.add_option("Crystal", CRYSTAL_ID); + games.add_option("Cancel", -1); + break; - game_select_kor.clear_vector(); - game_select_kor.set_rows_and_columns(1, 2); - game_select_kor.add_button(Button(button_gold_left, button_gold_right, 64), GOLD_ID); - game_select_kor.add_button(Button(button_silver_left, button_silver_right, 64), SILVER_ID); - game_select_kor.set_xy_min_max(48, 240, 0, 120); + case (KOR_ID): + games.add_option("Gold", GOLD_ID); + games.add_option("Silver", SILVER_ID); + games.add_option("Cancel", -1); + break; - game_select_def.clear_vector(); - game_select_def.set_rows_and_columns(3, 2); - game_select_def.add_button(Button(button_red_left, button_red_right, 64), RED_ID); - game_select_def.add_button(Button(button_blue_left, button_blue_right, 64), RED_ID); // red and blue are identical, so we just say red - game_select_def.add_button(Button(button_yellow_left, button_yellow_right, 64), YELLOW_ID); - game_select_def.add_button(Button(button_gold_left, button_gold_right, 64), GOLD_ID); - game_select_def.add_button(Button(button_silver_left, button_silver_right, 64), SILVER_ID); - game_select_def.add_button(Button(button_crystal_left, button_crystal_right, 64), CRYSTAL_ID); - game_select_def.set_xy_min_max(48, 240, 0, 120); + default: + games.add_option("Red", RED_ID); + games.add_option("Blue", BLUE_ID); + games.add_option("Yellow", YELLOW_ID); + games.add_option("Gold", GOLD_ID); + games.add_option("Silver", SILVER_ID); + games.add_option("Crystal", CRYSTAL_ID); + games.add_option("Cancel", -1); + break; + } } 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 int game; + int lang; switch (index) { @@ -288,6 +290,7 @@ bool run_conditional(int index) case CMD_BACK_TO_MENU: set_text_exit(); + REG_BG1HOFS = 0; load_flex_background(BG_FENNEL, 3); return true; @@ -307,26 +310,19 @@ bool run_conditional(int index) return true; case CMD_LANG_MENU: - load_temp_sprites(SPRITE_BATCH_LANG); - populate_lang_buttons(); - party_data.set_lang(lang_select.button_main()); + populate_lang_menu(); + lang = langs.select_menu_main(); + if (lang == BUTTON_CANCEL) + { + return false; + } + games.set_lang(lang); + party_data.set_lang(lang); return true; case CMD_GAME_MENU: - load_temp_sprites(SPRITE_BATCH_GAMES); - populate_game_buttons(); - switch (party_data.get_lang()) - { - case JPN_ID: - game = game_select_jpn.button_main(); - break; - case KOR_ID: - game = game_select_kor.button_main(); - break; - default: - game = game_select_def.button_main(); - break; - } + populate_game_menu(party_data.get_lang()); + game = games.select_menu_main(); if (game == BUTTON_CANCEL) { return false; @@ -335,9 +331,9 @@ bool run_conditional(int index) return true; case CMD_SLIDE_PROF_LEFT: - for (int i = 0; i < 48; i++) + for (int i = 0; i <= (8 * 7); i += 2) { - //obj_set_pos(prof, (prof->attr1 & ATTR1_X_MASK) - 2, prof->attr0 & ATTR0_Y_MASK); + REG_BG1HOFS = i; if (!DEBUG_MODE) { global_next_frame(); @@ -346,9 +342,9 @@ bool run_conditional(int index) return true; case CMD_SLIDE_PROF_RIGHT: - for (int i = 0; i < 48; i++) + for (int i = (8 * 7); i >= 0; i -= 2) { - //obj_set_pos(prof, (prof->attr1 & ATTR1_X_MASK) + 2, prof->attr0 & ATTR0_Y_MASK); + REG_BG1HOFS = i; if (!DEBUG_MODE) { global_next_frame(); diff --git a/source/select_menu.cpp b/source/select_menu.cpp new file mode 100644 index 0000000..6c547c2 --- /dev/null +++ b/source/select_menu.cpp @@ -0,0 +1,117 @@ +#include "select_menu.h" +#include "sprite_data.h" + +Select_Menu::Select_Menu(bool enable_cancel, int nMenu_type) +{ + cancel_enabled = enable_cancel; + menu_type = nMenu_type; +} + +void Select_Menu::add_option(std::string option, int return_value) +{ + menu_options.push_back(option); + return_values.push_back(return_value); +} + +int Select_Menu::select_menu_main() +{ + show_menu(); + curr_selection = 0; + + key_poll(); // Reset the buttons + + while (true) + { + obj_set_pos(point_arrow, 19 * 8, (2 + curr_selection) * 8); + if (return_values[curr_selection] == -1) + { + switch (menu_type) + { + case CART_MENU: + obj_hide(cart_shell); + obj_hide(cart_label); + break; + case LANG_MENU: + obj_hide(flag); + break; + } + } + else + { + switch (menu_type) + { + case CART_MENU: + load_cart(return_values[curr_selection], lang); + break; + case LANG_MENU: + load_flag(return_values[curr_selection]); + break; + } + } + + if (key_hit(KEY_DOWN)) + { + curr_selection = ((curr_selection + 1) % menu_options.size()); + } + + else if (key_hit(KEY_UP)) + { + curr_selection = ((curr_selection + (menu_options.size() - 1)) % menu_options.size()); + } + else if (key_hit(KEY_A)) + { + hide_menu(); + return return_values[curr_selection]; + } + else if (cancel_enabled && key_hit(KEY_B)) + { + hide_menu(); + return -1; + } + + global_next_frame(); + } + return 0; +} + +void Select_Menu::show_menu() +{ + add_menu_box(menu_options.size()); + for (unsigned int i = 0; i < menu_options.size(); i++) + { + tte_set_pos(20 * 8, (2 + i) * 8); + tte_write(menu_options[i].c_str()); + } + obj_unhide(point_arrow, 0); + obj_set_pos(point_arrow, 19 * 8, 2 * 8); +} + +void Select_Menu::hide_menu() +{ + obj_hide(point_arrow); + tte_erase_rect(20 * 8, 2 * 8, (20 + 8) * 8, (2 + menu_options.size()) * 8); + reload_textbox_background(); + clear_options(); + obj_hide(point_arrow); + switch (menu_type) + { + case CART_MENU: + obj_hide(cart_shell); + obj_hide(cart_label); + break; + case LANG_MENU: + obj_hide(flag); + break; + } +} + +void Select_Menu::clear_options() +{ + menu_options.clear(); + return_values.clear(); +} + +void Select_Menu::set_lang(int nLang) +{ + lang = nLang; +} \ No newline at end of file diff --git a/source/sprite_data.cpp b/source/sprite_data.cpp index 9d11d81..69c78c6 100644 --- a/source/sprite_data.cpp +++ b/source/sprite_data.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "sprite_data.h" #include "debug_mode.h" @@ -11,10 +12,11 @@ OBJ_AFFINE *obj_aff_buffer = (OBJ_AFFINE *)obj_buffer; // These are the two pallets used by the menu sprites, // it's easier to set them up this way instead of through grit // (R + G*32 + B*1024) -#define WHITE (31 + 31 * 32 + 31 * 1024) -#define YELLOW (31 + 19 * 32 + 10 * 1024) -#define RED (31 + 07 * 32 + 04 * 1024) -#define BLACK (00 + 00 * 32 + 00 * 1024) +#define RGB(r, g, b) (r + g * 32 + b * 1024) +#define WHITE RGB(31, 31, 31) +#define YELLOW RGB(31, 19, 10) +#define RED RGB(31, 7, 4) +#define BLACK RGB(0, 0, 0) const unsigned short frame_one_pal[16] = { WHITE, WHITE, WHITE, WHITE, YELLOW, YELLOW, YELLOW, YELLOW, @@ -125,6 +127,56 @@ void load_textbox_background() REG_BG2CNT = BG_CBB(CBB) | BG_SBB(SBB) | BG_4BPP | BG_REG_32x32 | BG_PRIO(3); } +void reload_textbox_background() +{ + int SBB = 17; + memcpy(&se_mem[SBB][0], textBoxBGMap, textBoxBGMapLen); +} + +// tile ID, VH Flip, Palette Bank +#define TILE_CLEAR (0 | (0b00 << 0xA) | (1 << 0xC)) +#define TILE_N (2 | (0b00 << 0xA) | (1 << 0xC)) +#define TILE_NE (1 | (0b01 << 0xA) | (1 << 0xC)) +#define TILE_E (3 | (0b01 << 0xA) | (1 << 0xC)) +#define TILE_SE (5 | (0b01 << 0xA) | (1 << 0xC)) +#define TILE_S (6 | (0b00 << 0xA) | (1 << 0xC)) +#define TILE_SW (5 | (0b00 << 0xA) | (1 << 0xC)) +#define TILE_W (3 | (0b00 << 0xA) | (1 << 0xC)) +#define TILE_NW (1 | (0b00 << 0xA) | (1 << 0xC)) +#define TILE_MID (4 | (0b00 << 0xA) | (1 << 0xC)) +#define MENU_WIDTH 11 - 1 + +void add_menu_box(int options) +{ + int start = (32 * 13) + 18; + int SBB = 17; + + se_mem[SBB][start] = TILE_NW; + se_mem[SBB][start + MENU_WIDTH] = TILE_NE; + se_mem[SBB][start + (32 * (options + 1))] = TILE_SW; + se_mem[SBB][start + (32 * (options + 1)) + MENU_WIDTH] = TILE_SE; + + for (int i = 1; i < MENU_WIDTH; i++) + { + se_mem[SBB][start + i] = TILE_N; + se_mem[SBB][start + ((32 * (options + 1))) + i] = TILE_S; + } + + for (int i = 0; i < options; i++) + { + se_mem[SBB][start + (32 * (i + 1)) + MENU_WIDTH] = TILE_E; + se_mem[SBB][start + (32 * (i + 1))] = TILE_W; + } + + for (int x = 1; x < MENU_WIDTH; x++) + { + for (int y = 1; y < options + 1; y++) + { + se_mem[SBB][start + (32 * y) + x] = TILE_MID; + } + } +} + // SPRITES int num_sprites = 0; @@ -141,41 +193,9 @@ OBJ_ATTR *btn_d_l = &obj_buffer[num_sprites++]; OBJ_ATTR *btn_d_r = &obj_buffer[num_sprites++]; OBJ_ATTR *button_yes = &obj_buffer[num_sprites++]; OBJ_ATTR *button_no = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_blank_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_blank_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_blank_left_2 = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_blank_right_2 = &obj_buffer[num_sprites++]; - -OBJ_ATTR *dex_sprites[3][6] = { // Fills the dex sprites top to bottom, left to right - {&obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++], - &obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++]}, - {&obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++], - &obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++]}, - {&obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++], - &obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++]}}; - -OBJ_ATTR *btn_lang_jpn = &obj_buffer[num_sprites++]; -OBJ_ATTR *btn_lang_eng = &obj_buffer[num_sprites++]; -OBJ_ATTR *btn_lang_fre = &obj_buffer[num_sprites++]; -OBJ_ATTR *btn_lang_ita = &obj_buffer[num_sprites++]; -OBJ_ATTR *btn_lang_ger = &obj_buffer[num_sprites++]; -OBJ_ATTR *btn_lang_spa = &obj_buffer[num_sprites++]; -OBJ_ATTR *btn_lang_kor = &obj_buffer[num_sprites++]; - -OBJ_ATTR *button_green_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_green_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_blue_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_blue_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_red_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_red_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_yellow_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_yellow_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_gold_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_gold_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_silver_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_silver_right = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_crystal_left = &obj_buffer[num_sprites++]; -OBJ_ATTR *button_crystal_right = &obj_buffer[num_sprites++]; +OBJ_ATTR *cart_shell = &obj_buffer[num_sprites++]; +OBJ_ATTR *cart_label = &obj_buffer[num_sprites++]; +OBJ_ATTR *flag = &obj_buffer[num_sprites++]; OBJ_ATTR *type_sprites[14] = { &obj_buffer[num_sprites++], @@ -196,6 +216,7 @@ OBJ_ATTR *type_sprites[14] = { OBJ_ATTR *up_arrow = &obj_buffer[num_sprites++]; OBJ_ATTR *down_arrow = &obj_buffer[num_sprites++]; +OBJ_ATTR *point_arrow = &obj_buffer[num_sprites++]; OBJ_ATTR *box_select = &obj_buffer[num_sprites++]; @@ -259,55 +280,15 @@ void load_eternal_sprites() load_sprite(btn_d_r, btn_d_rTiles, btn_d_rTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); load_sprite(button_yes, button_yesTiles, button_yesTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); load_sprite(button_no, button_noTiles, button_noTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_blank_left, button_blank_leftTiles, button_blank_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_blank_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_blank_left_2, button_blank_leftTiles, button_blank_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_blank_right_2, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); + load_sprite(cart_label, &Label_GreenTiles[8], Label_GreenTilesLen - 32, curr_tile_id, CART_PAL, ATTR0_SQUARE, ATTR1_SIZE_32x32, 1); + load_sprite(point_arrow, &arrowsTiles[32], 32, curr_tile_id, BTN_PAL, ATTR0_SQUARE, ATTR1_SIZE_8x8, 1); + load_sprite(down_arrow, &arrowsTiles[0], 64, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_16x8, 1); + load_sprite(up_arrow, &arrowsTiles[16], 64, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_16x8, 1); + obj_set_pos(down_arrow, 14 * 8, 17 * 8); + obj_set_pos(up_arrow, 14 * 8, 3 * 8); global_tile_id_end = curr_tile_id; } -void load_temp_sprites(int sprite_batch_id) -{ - u32 curr_tile_id = global_tile_id_end; - switch (sprite_batch_id) - { - case SPRITE_BATCH_LANG: - load_sprite(btn_lang_jpn, btn_lang_jpnTiles, btn_lang_jpnTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(btn_lang_eng, btn_lang_engTiles, btn_lang_engTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(btn_lang_fre, btn_lang_freTiles, btn_lang_freTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(btn_lang_ita, btn_lang_itaTiles, btn_lang_itaTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(btn_lang_ger, btn_lang_gerTiles, btn_lang_gerTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(btn_lang_spa, btn_lang_spaTiles, btn_lang_spaTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(btn_lang_kor, btn_lang_korTiles, btn_lang_korTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - break; - - case SPRITE_BATCH_GAMES: - load_sprite(button_green_left, button_green_leftTiles, button_green_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_green_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_blue_left, button_blue_leftTiles, button_blue_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_blue_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_red_left, button_red_leftTiles, button_red_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_red_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_yellow_left, button_yellow_leftTiles, button_yellow_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_yellow_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_gold_left, button_gold_leftTiles, button_gold_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_gold_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_silver_left, button_silver_leftTiles, button_silver_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_silver_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - load_sprite(button_crystal_left, button_crystal_leftTiles, button_crystal_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); - load_sprite(button_crystal_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); - break; - - case SPRITE_BATCH_DEX: - global_tile_id_end += 14 * 4; // For the type sprites - load_sprite(down_arrow, &arrowsTiles[0], 64, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_16x8, 1); - load_sprite(up_arrow, &arrowsTiles[16], 64, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_16x8, 1); - obj_set_pos(down_arrow, 14 * 8, 17 * 8); - obj_set_pos(up_arrow, 14 * 8, 3 * 8); - break; - } -} - void load_temp_box_sprites(Pokemon_Party party_data) { u32 curr_tile_id = global_tile_id_end; @@ -362,4 +343,177 @@ void load_sprite(OBJ_ATTR *sprite, const unsigned int objTiles[], int objTilesLe obj_set_attr(sprite, attr0, attr1, ATTR2_PALBANK(pal_bank) | tile_id | ATTR2_PRIO(priority)); tile_id += objTilesLen / 32; obj_hide(sprite); -}; \ No newline at end of file +}; + +void load_cart(int game_id, int lang) +{ + // Alpha Shadow Main Color Grey Black Mid + const unsigned short jpn_gb_pal[6] = {RGB(0, 0, 0), RGB(10, 9, 10), RGB(17, 17, 17), RGB(22, 22, 22), RGB(0, 0, 0), RGB(14, 13, 14)}; + const unsigned short eng_red_pal[6] = {RGB(0, 0, 0), RGB(16, 1, 0), RGB(27, 6, 5), RGB(22, 22, 22), RGB(0, 0, 0), RGB(23, 3, 2)}; + const unsigned short eng_blue_pal[6] = {RGB(0, 0, 0), RGB(0, 4, 16), RGB(5, 10, 24), RGB(22, 22, 22), RGB(0, 0, 0), RGB(1, 6, 20)}; + const unsigned short eng_yellow_pal[6] = {RGB(0, 0, 0), RGB(18, 12, 0), RGB(27, 21, 5), RGB(22, 22, 22), RGB(0, 0, 0), RGB(22, 16, 1)}; + const unsigned short eng_gold_pal[6] = {RGB(0, 0, 0), RGB(13, 10, 2), RGB(22, 18, 8), RGB(22, 22, 22), RGB(0, 0, 0), RGB(17, 14, 4)}; + const unsigned short eng_silver_pal[6] = {RGB(0, 0, 0), RGB(11, 12, 14), RGB(20, 22, 23), RGB(22, 22, 22), RGB(0, 0, 0), RGB(15, 16, 19)}; + const unsigned short crystal_pal[6] = {RGB(0, 0, 0), RGB(9, 13, 17), RGB(16, 21, 25), RGB(22, 22, 22), RGB(0, 0, 0), RGB(12, 17, 22)}; + const unsigned short jpn_gold_pal[6] = {RGB(0, 0, 0), RGB(0, 0, 0), RGB(5, 7, 12), RGB(22, 22, 22), RGB(0, 0, 0), RGB(3, 4, 8)}; + const unsigned short jpn_silver_pal[6] = {RGB(0, 0, 0), RGB(5, 4, 5), RGB(11, 10, 10), RGB(22, 22, 22), RGB(0, 0, 0), RGB(8, 7, 7)}; + + const unsigned int *label_tiles = 0; + const unsigned short *label_palette = 0; + const unsigned int *cart_tiles = 0; + const unsigned short *cart_palette = 0; + switch (game_id) + { + case (GREEN_ID): + label_tiles = Label_GreenTiles; + label_palette = Label_GreenPal; + cart_tiles = GB_ShellTiles; + cart_palette = jpn_gb_pal; + break; + + case (RED_ID): + label_tiles = Label_RedTiles; + label_palette = Label_RedPal; + cart_tiles = GB_ShellTiles; + if (lang == JPN_ID) + { + cart_palette = jpn_gb_pal; + } + else + { + cart_palette = eng_red_pal; + } + break; + + case (BLUE_ID): + label_tiles = Label_BlueTiles; + label_palette = Label_BluePal; + cart_tiles = GB_ShellTiles; + if (lang == JPN_ID) + { + cart_palette = jpn_gb_pal; + } + else + { + cart_palette = eng_blue_pal; + } + break; + + case (YELLOW_ID): + label_tiles = Label_YellowTiles; + label_palette = Label_YellowPal; + cart_tiles = GB_ShellTiles; + if (lang == JPN_ID) + { + cart_palette = jpn_gb_pal; + } + else + { + cart_palette = eng_yellow_pal; + } + break; + + case (GOLD_ID): + label_tiles = Label_GoldTiles; + label_palette = Label_GoldPal; + if (lang == JPN_ID) + { + cart_tiles = GB_ShellTiles; + cart_palette = jpn_gold_pal; + } + else if (lang == KOR_ID) + { + cart_tiles = GBC_ShellTiles; + cart_palette = jpn_gold_pal; + } + else + { + cart_tiles = GBS_ShellTiles; + cart_palette = eng_gold_pal; + } + break; + + case (SILVER_ID): + label_tiles = Label_SilverTiles; + label_palette = Label_SilverPal; + if (lang == JPN_ID) + { + cart_tiles = GB_ShellTiles; + cart_palette = jpn_silver_pal; + } + else if (lang == KOR_ID) + { + cart_tiles = GBC_ShellTiles; + cart_palette = jpn_silver_pal; + } + else + { + cart_tiles = GBS_ShellTiles; + cart_palette = eng_silver_pal; + } + break; + + case (CRYSTAL_ID): + label_tiles = Label_CrystalTiles; + label_palette = Label_CrystalPal; + cart_tiles = GBCS_ShellTiles; + cart_palette = crystal_pal; + break; + } + u32 curr_tile_id = global_tile_id_end; + + memcpy(pal_obj_mem + (CART_PAL * 16), cart_palette, 12); + memcpy(pal_obj_mem + (CART_PAL * 16) + 6, label_palette + 6, 20); + load_sprite(cart_shell, cart_tiles, GB_ShellTilesLen, curr_tile_id, CART_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); + load_sprite(cart_label, &label_tiles[8], Label_GreenTilesLen - 32, curr_tile_id, CART_PAL, ATTR0_SQUARE, ATTR1_SIZE_32x32, 1); + int y_offset = sin((get_frame_count() * 4) % 360 * (3.1415 / 180)) * 5; + obj_set_pos(cart_shell, (8 * 12) + 4, (8 * 4) + 11 + y_offset); + obj_set_pos(cart_label, (8 * 12) + 4 + 8, (8 * 4) + 11 + 13 + y_offset); + obj_unhide(cart_shell, 0); + obj_unhide(cart_label, 0); +} + +void load_flag(int lang_id) +{ + u32 curr_tile_id = global_tile_id_end; + + const unsigned int *flag_tiles = 0; + const unsigned short *flag_palette = 0; + switch (lang_id) + { + case JPN_ID: + flag_tiles = flag_jpnTiles; + flag_palette = flag_jpnPal; + break; + case ENG_ID: + flag_tiles = flag_engTiles; + flag_palette = flag_engPal; + break; + case FRE_ID: + flag_tiles = flag_freTiles; + flag_palette = flag_frePal; + break; + case ITA_ID: + flag_tiles = flag_itaTiles; + flag_palette = flag_itaPal; + break; + case GER_ID: + flag_tiles = flag_gerTiles; + flag_palette = flag_gerPal; + break; + case SPA_ID: + flag_tiles = flag_spaTiles; + flag_palette = flag_spaPal; + break; + case KOR_ID: + flag_tiles = flag_korTiles; + flag_palette = flag_korPal; + break; + } + + load_sprite(flag, flag_tiles, flag_jpnTilesLen, curr_tile_id, FLAG_PAL, ATTR0_WIDE, ATTR1_SIZE_32x64, 1); + memcpy(pal_obj_mem + (FLAG_PAL * 16), flag_palette, 16); // Grit is being stupid. + int y_offset = sin((get_frame_count() * 4) % 360 * (3.1415 / 180)) * 5; + obj_set_pos(flag, (8 * 12) + 4, (8 * 4) + 19 + y_offset); + obj_unhide(flag, 0); +} \ No newline at end of file