Updating tons of graphics

This commit is contained in:
The Gears of Progress 2024-08-19 14:47:29 -04:00
parent 22f7aaac26
commit 1ec09842ad
100 changed files with 4667 additions and 1578 deletions

View File

@ -42,12 +42,12 @@ CFLAGS := -g -Wall -O2\
-mcpu=arm7tdmi -mtune=arm7tdmi -masm-syntax-unified\ -mcpu=arm7tdmi -mtune=arm7tdmi -masm-syntax-unified\
$(ARCH) $(ARCH)
CFLAGS += $(INCLUDE) CFLAGS += $(INCLUDE) -ffunction-sections -fdata-sections
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=c++20 -Wno-volatile -D_GLIBCXX_USE_CXX20_ABI=0
ASFLAGS := -g $(ARCH) ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) -Wl,--gc-sections
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project # any extra libraries we wish to link with the project
@ -85,10 +85,10 @@ SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
ifneq ($(strip $(MUSIC)),) #ifneq ($(strip $(MUSIC)),)
export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir)) # export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir))
BINFILES += soundbank.bin # BINFILES += soundbank.bin
endif #endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C # use CXX for linking C++ projects, CC for standard C
@ -154,9 +154,9 @@ $(OFILES_SOURCES) : $(HFILES)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# rule to build soundbank from music files # rule to build soundbank from music files
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
soundbank.bin soundbank.h : $(AUDIOFILES) #soundbank.bin soundbank.h : $(AUDIOFILES)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@mmutil $^ -osoundbank.bin -hsoundbank.h # @mmutil $^ -osoundbank.bin -hsoundbank.h
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# This rule links in binary data with the .bin extension # This rule links in binary data with the .bin extension

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1020 B

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1011 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1011 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1019 B

View File

@ -1,3 +1,3 @@
# #
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48 -gB4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 277 B

View File

@ -1,3 +1,3 @@
# #
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48 -gB4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 292 B

BIN
graphics/button_edge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

View File

@ -1,3 +0,0 @@
#
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 B

View File

@ -1,3 +1,3 @@
# #
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. # Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48.
-gB4 -ps32 -pe48 -gB4 -ps0 -pe16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 254 B

View File

@ -1,3 +1,3 @@
# #
# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. # Button : 4bpp, not compressed.
-gB4 -ps32 -pe48 -gB4 -ps0 -pe16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/emerald_cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

5
graphics/fr_cart.grit Normal file
View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/fr_cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

5
graphics/lg_cart.grit Normal file
View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/lg_cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

5
graphics/link_blobs.grit Normal file
View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/link_blobs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/link_frame1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/link_frame2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/link_frame3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

6
graphics/menu_bars.grit Normal file
View File

@ -0,0 +1,6 @@
#
# Text Box (Background) : 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 2, copy from 32 to 48.
#
-gt -gB4 -mR4 -mLs -mp2 -ps0 -pe16

BIN
graphics/menu_bars.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

5
graphics/ruby_cart.grit Normal file
View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/ruby_cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

View File

@ -0,0 +1,5 @@
#
# 64x64t, 4bpp, SBB-layout, not compressed.
# Pallet bank 1
#
-gB4 -ps0 -pe16

BIN
graphics/sapphire_cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,14 +0,0 @@
//{{BLOCK(pkmn_font)
#ifndef __PKMN_FONT__
#define __PKMN_FONT__
extern const TFont pkmn_fontFont;
#define pkmn_fontGlyphsLen 2048
extern const unsigned int pkmn_fontGlyphs[512];
#endif // __PKMN_FONT__
//}}BLOCK(pkmn_font)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

View File

@ -2,17 +2,17 @@
#define DEBUG_MODE_H #define DEBUG_MODE_H
#define DEBUG_MODE false #define DEBUG_MODE false
#define IGNORE_GAME_PAK false #define IGNORE_GAME_PAK true
#define IGNORE_LINK_CABLE true #define IGNORE_LINK_CABLE false
#define IGNORE_MG_E4_FLAGS false #define IGNORE_MG_E4_FLAGS true
#define IGNORE_UNRECEIVED_PKMN false #define IGNORE_UNRECEIVED_PKMN true
#define FORCE_TUTORIAL false #define FORCE_TUTORIAL false
#define DONT_REMOVE_PKMN false #define DONT_REMOVE_PKMN true
#define SHOW_INVALID_PKMN false #define SHOW_INVALID_PKMN false
#define IGNORE_DEX_COMPLETION false #define IGNORE_DEX_COMPLETION false
#define DEBUG_GAME FIRERED_ID #define DEBUG_GAME LEAFGREEN_ID
#define DEBUG_VERS VERS_1_1 #define DEBUG_VERS VERS_1_0
#define DEBUG_LANG LANG_ENG #define DEBUG_LANG LANG_ENG
#define ENABLE_MATCH_PID true #define ENABLE_MATCH_PID true

View File

@ -1,8 +1,15 @@
#ifndef GLOBAL_FRAME_CONTROLLER_H #ifndef GLOBAL_FRAME_CONTROLLER_H
#define GLOBAL_FRAME_CONTROLLER_H #define GLOBAL_FRAME_CONTROLLER_H
#define STATE_CONNECTION 1
#define STATE_TRANSFER 2
#define STATE_NO_ANIM 3
void global_next_frame(); void global_next_frame();
int get_frame_count(); int get_frame_count();
void set_menu_sprite_pal(int frame);
void run_link_cable_animation(int frame);
void link_animation_state(int state);
void determine_fennel_blink();
#endif #endif

View File

@ -266,7 +266,7 @@ class mystery_gift_script
public: public:
mystery_gift_script(); mystery_gift_script();
void build_script(Pokemon_Party &incoming_box_data); void build_script(Pokemon_Party &incoming_box_data);
void build_script_old(Pokemon_Party &incoming_box_data); //void build_script_old(Pokemon_Party &incoming_box_data);
u8 get_script_value_at(int index); u8 get_script_value_at(int index);
u8 get_section30_value_at(int index); u8 get_section30_value_at(int index);
u32 calc_checksum32(); u32 calc_checksum32();

View File

@ -21,6 +21,8 @@ struct Simplified_Pokemon
byte nickname[10]; byte nickname[10];
bool is_valid; bool is_valid;
bool is_transferred; bool is_transferred;
bool is_shiny;
int unown_letter;
}; };
class Pokemon class Pokemon
@ -31,7 +33,7 @@ public:
int ot_size = 0; int ot_size = 0;
int nickname_size = 0; int nickname_size = 0;
int nature_mod = 0; int nature_mod = 0;
byte unown_letter = -1; int unown_letter = -1;
Pokemon(); Pokemon();
void load_data(int index, byte *party_data, int game, int lang); void load_data(int index, byte *party_data, int game, int lang);
void convert_to_gen_three(bool simplified, bool stabilize_mythical); void convert_to_gen_three(bool simplified, bool stabilize_mythical);
@ -49,6 +51,7 @@ public:
byte get_dex_number(); byte get_dex_number();
bool get_validity(); bool get_validity();
bool get_is_new(); bool get_is_new();
bool get_is_shiny();
Simplified_Pokemon get_simple_pkmn(); Simplified_Pokemon get_simple_pkmn();
u8 get_letter_from_pid(u32 pid); u8 get_letter_from_pid(u32 pid);
u8 get_nature_from_pid(u32 pid); u8 get_nature_from_pid(u32 pid);

View File

@ -49,7 +49,7 @@ extern const std::string_view NAMES[252];
extern const u16 JPN_NAMES[252][6]; extern const u16 JPN_NAMES[252][6];
extern const u8 EVOLUTIONS[252]; extern const u8 EVOLUTIONS[252];
extern const u8 POWER_POINTS[252]; extern const u8 POWER_POINTS[252];
extern const u8 MENU_SPRITES[252]; extern const u8 MENU_SPRITE_PALS[252 + 26][2];
extern const byte gen_1_index_array[191]; extern const byte gen_1_index_array[191];
extern const u16 gen_1_Jpn_char_array[256]; extern const u16 gen_1_Jpn_char_array[256];
extern const u16 gen_1_Eng_char_array[256]; extern const u16 gen_1_Eng_char_array[256];

View File

@ -48,12 +48,12 @@ class textbox_var : public xse_var
{ {
public: public:
using xse_var::xse_var; using xse_var::xse_var;
void set_text(std::u16string_view nText); void set_text(std::u8string_view nText);
void insert_text(u8 mg_array[]); void insert_text(u8 mg_array[]);
void set_start(); void set_start();
void insert_virtual_text(u8 mg_array[]); void insert_virtual_text(u8 mg_array[]);
void set_virtual_start(); void set_virtual_start();
std::u16string_view text; std::u8string_view text;
}; };
class movement_var : public xse_var class movement_var : public xse_var

View File

@ -5,34 +5,19 @@
#include "pokemon.h" #include "pokemon.h"
#include "pokemon_data.h" #include "pokemon_data.h"
#include "pokemon_party.h" #include "pokemon_party.h"
#include "rom_data.h"
#define FENNEL_SHIFT 4
extern OBJ_ATTR obj_buffer[128]; extern OBJ_ATTR obj_buffer[128];
extern OBJ_AFFINE *obj_aff_buffer; extern OBJ_AFFINE *obj_aff_buffer;
extern int num_sprites; extern int num_sprites;
// #include "metr.h"
// extern OBJ_ATTR *testroid;
#include "btn_t_l.h"
extern OBJ_ATTR *btn_t_l;
#include "btn_t_r.h"
extern OBJ_ATTR *btn_t_r;
#include "btn_p_l.h"
extern OBJ_ATTR *btn_p_l;
#include "btn_p_r.h"
extern OBJ_ATTR *btn_p_r;
#include "btn_c_l.h"
extern OBJ_ATTR *btn_c_l;
#include "btn_c_r.h"
extern OBJ_ATTR *btn_c_r;
#include "btn_d_l.h"
extern OBJ_ATTR *btn_d_l;
#include "btn_d_r.h"
extern OBJ_ATTR *btn_d_r;
#include "button_yes.h" #include "button_yes.h"
extern OBJ_ATTR *button_yes; extern OBJ_ATTR *button_yes;
#include "button_no.h" #include "button_no.h"
extern OBJ_ATTR *button_no; extern OBJ_ATTR *button_no;
#include "button_game_select_edge.h" #include "button_edge.h"
#include "types.h" #include "types.h"
extern OBJ_ATTR *type_sprites[14]; extern OBJ_ATTR *type_sprites[14];
@ -64,7 +49,7 @@ extern OBJ_ATTR *up_arrow;
extern OBJ_ATTR *down_arrow; extern OBJ_ATTR *down_arrow;
extern OBJ_ATTR *point_arrow; extern OBJ_ATTR *point_arrow;
#include "duel_frame_menu_sprites.h" #include "unique_duel_frame_menu_sprites.h"
extern OBJ_ATTR *party_sprites[30]; extern OBJ_ATTR *party_sprites[30];
#include "box_select.h" #include "box_select.h"
extern OBJ_ATTR *box_select; extern OBJ_ATTR *box_select;
@ -80,28 +65,54 @@ extern OBJ_ATTR *ptgb_logo_l;
#include "ptgb_logo_r.h" #include "ptgb_logo_r.h"
extern OBJ_ATTR *ptgb_logo_r; extern OBJ_ATTR *ptgb_logo_r;
#include "ruby_cart.h"
#include "sapphire_cart.h"
#include "fr_cart.h"
#include "lg_cart.h"
#include "emerald_cart.h"
extern OBJ_ATTR *gba_cart;
#include "link_frame1.h"
extern OBJ_ATTR *link_frame1;
#include "link_frame2.h"
extern OBJ_ATTR *link_frame2;
#include "link_frame3.h"
extern OBJ_ATTR *link_frame3;
#include "link_blobs.h"
extern OBJ_ATTR *link_blob1;
extern OBJ_ATTR *link_blob2;
extern OBJ_ATTR *link_blob3;
#define BG2VOF_SMALL_TEXTBOX 96 #define BG2VOF_SMALL_TEXTBOX 96
#define BG2VOF_LARGE_TEXTBOX 0 #define BG2VOF_LARGE_TEXTBOX 0
#define METR_PAL 0 #define BTN_PAL 0
#define PROF_PAL 1 #define BTN_LIT_PAL 1
#define BTN_PAL 2 #define LOGO_PAL 2
#define BTN_LIT_PAL 3 #define TYPES_PAL1 3
#define MENU_SPRITE_PAL 4 #define TYPES_PAL2 4
#define LOGO_PAL 5 #define GB_CART_PAL 5
#define TYPES_PAL1 6 #define FLAG_PAL 6
#define TYPES_PAL2 7 #define MENU_PAL_RED 7
#define CART_PAL 8 #define MENU_PAL_BLU 8
#define FLAG_PAL 9 #define MENU_PAL_GRN 9
#define MENU_PAL_BRN 10
#define MENU_PAL_PNK 11
#define MENU_PAL_START MENU_PAL_RED
#define GBA_CART_PAL 12
#define LINK_CABLE_PAL 13
#define BG_OPENING 0 #define BG_OPENING 0
#define BG_FENNEL 1 #define BG_FENNEL 1
#define BG_DEX 2 #define BG_DEX 2
#define BG_MAIN_MENU 3
extern rom_data curr_rom;
void load_sprite(OBJ_ATTR *sprite, const unsigned int objTiles[], int objTilesLen, void load_sprite(OBJ_ATTR *sprite, const unsigned int objTiles[], int objTilesLen,
u32 &tile_id, u32 pal_bank, int attr0, int attr1, u32 priority); u32 &tile_id, u32 pal_bank, int attr0, int attr1, u32 priority);
void load_background(); void load_background();
void modify_background_pal(bool dark); void set_background_pal(int curr_rom_id, bool dark);
void load_textbox_background(); void load_textbox_background();
void load_flex_background(int background_id, int layer); void load_flex_background(int background_id, int layer);
void load_eternal_sprites(); void load_eternal_sprites();
@ -109,7 +120,9 @@ void load_temp_box_sprites(Pokemon_Party party_data);
void load_type_sprites(int pkmn_index, int dex_offset, bool is_caught); void load_type_sprites(int pkmn_index, int dex_offset, bool is_caught);
void add_menu_box(int options); void add_menu_box(int options);
void reload_textbox_background(); void reload_textbox_background();
void load_cart(int game_id, int lang); void load_select_sprites(int game_id, int lang);
void load_flag(int lang_id); void fennel_blink(int frame);
void fennel_speak(int frame);
int get_curr_flex_background();
void update_y_offset();
#endif #endif

View File

@ -1,5 +1,5 @@
#include <tonc.h> #include <tonc.h>
#include "main_menu.h" #include "button_menu.h"
#include "button_handler.h" #include "button_handler.h"
#include "save_data_manager.h" #include "save_data_manager.h"
#include "global_frame_controller.h" #include "global_frame_controller.h"
@ -17,10 +17,6 @@ int Box_Menu::box_main(Pokemon_Party party_data)
REG_BG2VOFS = BG2VOF_LARGE_TEXTBOX; REG_BG2VOFS = BG2VOF_LARGE_TEXTBOX;
REG_BG2VOFS = 0; REG_BG2VOFS = 0;
load_temp_box_sprites(party_data); load_temp_box_sprites(party_data);
for (int i = 0; i < 30; i++)
{
obj_unhide(party_sprites[i], 0);
}
Button cancel_button(button_cancel_left, button_cancel_right, 64); Button cancel_button(button_cancel_left, button_cancel_right, 64);
Button confirm_button(button_confirm_left, button_confirm_right, 64); Button confirm_button(button_confirm_left, button_confirm_right, 64);
cancel_button.set_location(32, 112); cancel_button.set_location(32, 112);
@ -115,20 +111,26 @@ int Box_Menu::box_main(Pokemon_Party party_data)
int index = x + (y * 10); int index = x + (y * 10);
obj_set_pos(box_select, 40 + (x * 16), 24 + (y * 16)); obj_set_pos(box_select, 40 + (x * 16), 24 + (y * 16));
tte_erase_rect(40, 72, 220, 88); tte_erase_rect(40, 72, 220, 88);
if (party_data.get_simple_pkmn(index).is_valid) Simplified_Pokemon curr_pkmn = party_data.get_simple_pkmn(index);
if (curr_pkmn.is_valid)
{ {
char nickname[10] = {}; char nickname[11] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\0'};
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
nickname[i] = gen_3_Intern_char_array[party_data.get_simple_pkmn(index).nickname[i]]; nickname[i] = gen_3_Intern_char_array[curr_pkmn.nickname[i]];
} }
tte_set_pos(40, 72); tte_set_pos(40, 72);
tte_write(nickname); tte_write(nickname);
if (curr_pkmn.is_shiny)
{
tte_set_pos(40, 80);
tte_write("*");
}
tte_set_pos(48, 80); tte_set_pos(48, 80);
tte_write(NAMES[party_data.get_simple_pkmn(index).dex_number].data()); tte_write(NAMES[curr_pkmn.dex_number].data());
tte_set_pos(146, 80); tte_set_pos(146, 80);
tte_write("Lv: "); tte_write("Lv: ");
tte_write(std::to_string(party_data.get_simple_pkmn(index).met_level).c_str()); tte_write(std::to_string(curr_pkmn.met_level).c_str());
update_pos = false; update_pos = false;
} }
} }

View File

@ -1,4 +1,5 @@
#include "button_handler.h" #include "button_handler.h"
#include "sprite_data.h"
Button::Button(){ Button::Button(){
@ -33,12 +34,12 @@ void Button::set_location(int nx, int ny)
void Button::set_highlight(bool highlight) void Button::set_highlight(bool highlight)
{ {
button_L->attr2 &= ~ATTR2_PALBANK_MASK; button_L->attr2 &= ~ATTR2_PALBANK_MASK;
button_L->attr2 |= ATTR2_PALBANK(highlight ? 3 : 2); button_L->attr2 |= ATTR2_PALBANK(highlight ? BTN_LIT_PAL : BTN_PAL);
if (isWide) if (isWide)
{ {
button_R->attr2 &= ~ATTR2_PALBANK_MASK; button_R->attr2 &= ~ATTR2_PALBANK_MASK;
button_R->attr2 |= ATTR2_PALBANK(highlight ? 3 : 2); button_R->attr2 |= ATTR2_PALBANK(highlight ? BTN_LIT_PAL : BTN_PAL);
} }
} }
void Button::hide() void Button::hide()

View File

@ -1,5 +1,5 @@
#include <tonc.h> #include <tonc.h>
#include "main_menu.h" #include "button_menu.h"
#include "button_handler.h" #include "button_handler.h"
#include "save_data_manager.h" #include "save_data_manager.h"
#include "global_frame_controller.h" #include "global_frame_controller.h"

View File

@ -60,22 +60,22 @@ int zero_count;
int state; int state;
int mosi_delay = 4; // inital delay, speeds up once sending PKMN int mosi_delay = 4; // inital delay, speeds up once sending PKMN
std::string out_array[10]; std::string spi_text_out_array[10];
void print(std::string str) void print(std::string str)
{ {
for (int i = 10; i > 0; i--) for (int i = 10; i > 0; i--)
{ {
out_array[i] = out_array[i - 1]; spi_text_out_array[i] = spi_text_out_array[i - 1];
} }
out_array[0] = str + "\n"; spi_text_out_array[0] = str + "\n";
tte_erase_rect(LEFT, TOP, RIGHT, BOTTOM); tte_erase_rect(LEFT, TOP, RIGHT, BOTTOM);
tte_set_pos(LEFT, 0); tte_set_pos(LEFT, 0);
for (int j = 0; j < 10; j++) for (int j = 0; j < 10; j++)
{ {
tte_write("#{cx:0xE000}"); tte_write("#{cx:0xE000}");
tte_write(out_array[j].c_str()); tte_write(spi_text_out_array[j].c_str());
} }
} }
@ -167,6 +167,7 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_
tte_erase_screen(); tte_erase_screen();
tte_set_pos(40, 24); tte_set_pos(40, 24);
tte_write("\n\n\nLink was successful!\n\n Waiting for trade"); tte_write("\n\n\nLink was successful!\n\n Waiting for trade");
link_animation_state(STATE_NO_ANIM);
state = pretrade; state = pretrade;
data_counter = 0; data_counter = 0;
return in; return in;
@ -200,6 +201,7 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_
tte_erase_screen(); tte_erase_screen();
tte_set_pos(40, 24); tte_set_pos(40, 24);
tte_write("\n\n\nTransferring data...\n please wait!"); tte_write("\n\n\nTransferring data...\n please wait!");
link_animation_state(STATE_TRANSFER);
mosi_delay = 1; mosi_delay = 1;
state = party_preamble; state = party_preamble;
} }
@ -229,6 +231,7 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_
tte_erase_screen(); tte_erase_screen();
tte_set_pos(40, 24); tte_set_pos(40, 24);
tte_write("\n\nPlease press A or B\n twice on the other\n GameBoy system"); tte_write("\n\nPlease press A or B\n twice on the other\n GameBoy system");
link_animation_state(STATE_NO_ANIM);
mosi_delay = 3; mosi_delay = 3;
state = wait_to_resend; state = wait_to_resend;
} }
@ -267,6 +270,7 @@ byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_
tte_erase_screen(); tte_erase_screen();
tte_set_pos(40, 24); tte_set_pos(40, 24);
tte_write("\n\n\nTransferring data...\n please wait!"); tte_write("\n\n\nTransferring data...\n please wait!");
link_animation_state(STATE_TRANSFER);
state = resend_payload; state = resend_payload;
data_counter = 0x1B4; data_counter = 0x1B4;
} }
@ -334,7 +338,7 @@ int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, Simpli
} }
out_data = handleIncomingByte(in_data, box_data_storage, curr_payload, curr_gb_rom, curr_simple_array, cancel_connection); out_data = handleIncomingByte(in_data, box_data_storage, curr_payload, curr_gb_rom, curr_simple_array, cancel_connection);
if (FF_count > (5 * 60)) if (FF_count > (15 * 60))
{ {
return COND_ERROR_DISCONNECT; return COND_ERROR_DISCONNECT;
} }

View File

@ -9,6 +9,10 @@
int global_frame_count = 0; int global_frame_count = 0;
bool rand_enabled = true; bool rand_enabled = true;
int cable_frame = 0;
int curr_link_animation_state = 0;
int fennel_blink_timer = 0;
int fennel_blink_state = 0;
void global_next_frame() void global_next_frame()
{ {
@ -17,11 +21,14 @@ void global_next_frame()
// tte_set_pos(0, 0); // tte_set_pos(0, 0);
// tte_write(std::to_string(get_rand_u32()).c_str()); // tte_write(std::to_string(get_rand_u32()).c_str());
background_frame(global_frame_count); background_frame(global_frame_count);
determine_fennel_blink();
update_y_offset();
oam_copy(oam_mem, obj_buffer, num_sprites); oam_copy(oam_mem, obj_buffer, num_sprites);
VBlankIntrWait(); VBlankIntrWait();
// mmFrame(); //Music // mmFrame(); //Music
if (global_frame_count % 60 == 0) if (global_frame_count % 60 == 0)
{ {
set_menu_sprite_pal(0);
if (!curr_rom.verify_rom()) if (!curr_rom.verify_rom())
{ {
REG_BG0CNT = (REG_BG0CNT & ~BG_PRIO_MASK) | BG_PRIO(3); REG_BG0CNT = (REG_BG0CNT & ~BG_PRIO_MASK) | BG_PRIO(3);
@ -34,10 +41,24 @@ void global_next_frame()
tte_write("\n\n#{cx:0xF000}The Pok@mon game was\nremoved. Please turn\noff the system and\nrestart the program."); tte_write("\n\n#{cx:0xF000}The Pok@mon game was\nremoved. Please turn\noff the system and\nrestart the program.");
// obj_hide_multi(testroid, 128); // obj_hide_multi(testroid, 128);
oam_copy(oam_mem, obj_buffer, num_sprites); oam_copy(oam_mem, obj_buffer, num_sprites);
while(true){}; while (true)
{
};
} }
} }
else if (global_frame_count % 60 == 30)
{
set_menu_sprite_pal(1);
}
if (global_frame_count % (40 / curr_link_animation_state) == 0)
{
cable_frame = (cable_frame + 1) % 12;
if (curr_link_animation_state > 0)
{
run_link_cable_animation(cable_frame);
}
}
global_frame_count++; global_frame_count++;
}; };
@ -55,3 +76,148 @@ void disable_auto_random()
{ {
rand_enabled = false; rand_enabled = false;
} }
const unsigned short MENU_PALS[5][4] = {
{RGB15(31, 31, 31), RGB15(31, 19, 10), RGB15(31, 7, 01), RGB15(00, 00, 00)}, // Red
{RGB15(31, 31, 31), RGB15(31, 19, 10), RGB15(10, 9, 31), RGB15(00, 00, 00)}, // Blue
{RGB15(31, 31, 31), RGB15(31, 19, 10), RGB15(07, 23, 03), RGB15(00, 00, 00)}, // Green
{RGB15(31, 31, 31), RGB15(31, 19, 10), RGB15(15, 10, 03), RGB15(00, 00, 00)}, // Brown
{RGB15(31, 31, 31), RGB15(31, 19, 10), RGB15(29, 5, 13), RGB15(00, 00, 00)}, // Pink
};
void set_menu_sprite_pal(int frame)
{
for (int i = 0; i < 5; i++)
{
unsigned short curr_pal[16] = {
// frame: 1 | 2
MENU_PALS[i][(!frame ? 0 : 0)],
MENU_PALS[i][(!frame ? 0 : 1)],
MENU_PALS[i][(!frame ? 0 : 2)],
MENU_PALS[i][(!frame ? 0 : 3)],
MENU_PALS[i][(!frame ? 1 : 0)],
MENU_PALS[i][(!frame ? 1 : 1)],
MENU_PALS[i][(!frame ? 1 : 2)],
MENU_PALS[i][(!frame ? 1 : 3)],
MENU_PALS[i][(!frame ? 2 : 0)],
MENU_PALS[i][(!frame ? 2 : 1)],
MENU_PALS[i][(!frame ? 2 : 2)],
MENU_PALS[i][(!frame ? 2 : 3)],
MENU_PALS[i][(!frame ? 3 : 0)],
MENU_PALS[i][(!frame ? 3 : 1)],
MENU_PALS[i][(!frame ? 3 : 2)],
MENU_PALS[i][(!frame ? 3 : 3)],
};
memcpy(pal_obj_mem + ((MENU_PAL_START + i) * 16), curr_pal, 32);
}
}
int path[12][2] = {{19, 18}, {19, 19}, {18, 19}, {17, 19}, {16, 19}, {15, 19}, {14, 19}, {13, 19}, {12, 19}, {11, 19}, {10, 19}, {24, 24}};
void run_link_cable_animation(int frame)
{
switch (curr_link_animation_state)
{
case STATE_CONNECTION:
frame %= 4;
obj_hide_multi(link_frame1, 4);
obj_unhide_multi(link_frame1, 0, frame);
break;
case STATE_TRANSFER:
obj_set_pos(link_blob1, path[frame][0] * 8, path[frame][1] * 8);
obj_set_pos(link_blob2, path[frame][0] * 8, path[frame][1] * 8);
obj_set_pos(link_blob3, path[frame][0] * 8, path[frame][1] * 8);
obj_hide_multi(link_blob1, 3);
switch (frame % 3)
{
case 0:
obj_unhide(link_blob1, 0);
break;
case 1:
obj_unhide(link_blob2, 0);
break;
case 2:
obj_unhide(link_blob3, 0);
break;
}
break;
}
}
void link_animation_state(int state)
{
cable_frame = 0;
switch (state)
{
case STATE_CONNECTION:
obj_unhide(gba_cart, 0);
obj_set_pos(gba_cart, 17 * 8, 14 * 8);
obj_unhide(cart_shell, 0);
obj_set_pos(cart_shell, (8 * 8), (11 * 8) + 11);
obj_unhide(cart_label, 0);
obj_set_pos(cart_label, (8 * 8) + 8, (11 * 8) + 11 + 13);
obj_set_pos(link_frame1, 17 * 8, 17 * 8);
obj_set_pos(link_frame2, 13 * 8, 19 * 8);
obj_set_pos(link_frame3, 9 * 8, 18 * 8);
break;
case STATE_TRANSFER:
obj_unhide_multi(link_blob1, 0, 3);
case STATE_NO_ANIM:
obj_unhide(gba_cart, 0);
obj_set_pos(gba_cart, 17 * 8, 14 * 8);
obj_unhide(cart_shell, 0);
obj_set_pos(cart_shell, (8 * 8), (11 * 8) + 11);
obj_unhide(cart_label, 0);
obj_set_pos(cart_label, (8 * 8) + 8, (11 * 8) + 11 + 13);
obj_unhide(link_frame1, 0);
obj_set_pos(link_frame1, 17 * 8, 17 * 8);
obj_unhide(link_frame2, 0);
obj_set_pos(link_frame2, 13 * 8, 19 * 8);
obj_unhide(link_frame3, 0);
obj_set_pos(link_frame3, 9 * 8, 18 * 8);
break;
default:
obj_hide_multi(link_frame1, 3);
obj_hide_multi(link_blob1, 3);
obj_hide(gba_cart);
obj_hide(cart_shell);
obj_hide(cart_label);
break;
}
curr_link_animation_state = state;
}
void determine_fennel_blink()
{
if (get_curr_flex_background() == BG_FENNEL)
{
if (fennel_blink_timer == 0)
{
fennel_blink(fennel_blink_state);
fennel_blink_state = (fennel_blink_state + 1) % 4;
if (fennel_blink_state == 3) // Wait a random amount of time
{
fennel_blink_timer = get_rand_range(4 * 60, 8 * 60);
}
else // Continue with the animation
{
fennel_blink_timer = 4;
}
}
else
{
fennel_blink_timer--;
}
}
else
{
fennel_blink_timer = get_rand_range(4 * 60, 8 * 60);
}
}

View File

@ -15,10 +15,10 @@
#include "script_array.h" #include "script_array.h"
#include "sprite_data.h" #include "sprite_data.h"
#include "button_handler.h" #include "button_handler.h"
#include "main_menu.h" #include "button_menu.h"
#include "debug_mode.h" #include "debug_mode.h"
#include "soundbank.h" // #include "soundbank.h"
#include "soundbank_bin.h" // #include "soundbank_bin.h"
#include "dex_handler.h" #include "dex_handler.h"
#include "pokedex.h" #include "pokedex.h"
#include "global_frame_controller.h" #include "global_frame_controller.h"
@ -46,9 +46,9 @@ TODO:
*/ */
int delay_counter = 0; int delay_counter = 0;
int curr_selection = 0;
bool skip = true; bool skip = true;
rom_data curr_rom; rom_data curr_rom;
Button_Menu main_menu(2, 2, 96, 32, false);
Button_Menu yes_no_menu(1, 2, 40, 24, false); Button_Menu yes_no_menu(1, 2, 40, 24, false);
/* /*
@ -81,6 +81,9 @@ int test_main(void) Music
} }
*/ */
// (R + G*32 + B*1024)
#define RGB(r, g, b) (r + (g * 32) + (b * 1024))
template <typename I> template <typename I>
std::string n2hexstr(I w, size_t hex_len = sizeof(I) << 1) std::string n2hexstr(I w, size_t hex_len = sizeof(I) << 1)
{ {
@ -100,14 +103,6 @@ void load_graphics()
load_textbox_background(); load_textbox_background();
load_eternal_sprites(); load_eternal_sprites();
// Set up main menu
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_c_l, btn_c_r, 48), BTN_CREDITS);
main_menu.set_xy_min_max(0, H_MAX, 48, V_MAX);
// Set up global yes no button // Set up global yes no button
yes_no_menu.clear_vector(); yes_no_menu.clear_vector();
yes_no_menu.add_button(Button(button_yes), true); yes_no_menu.add_button(Button(button_yes), true);
@ -177,7 +172,7 @@ void first_load_message(void)
{ {
tte_set_pos(8, 0); tte_set_pos(8, 0);
tte_set_ink(10); tte_set_ink(10);
tte_write("#{cx:0xE000}\n\nHello! Thank you for using\nPok@ Transporter GB!\n\nJust as a word of caution- \nPok@ Transporter GB WILL\nmodify both the GameBoy and GameBoy Advance save files.\n\nPlease note that Pok@\nTransporter GB is still in\nbeta, so save file backups\nare HIGHLY recommended\nbefore using. With that all\nbeing said, please enjoy!\n\n -The Gears of Progress"); tte_write("#{cx:0xD000}\n\nHello! Thank you for using\nPok@ Transporter GB!\n\nJust as a word of caution- \nPok@ Transporter GB WILL\nmodify both the GameBoy and GameBoy Advance save files.\n\nPlease note that Pok@\nTransporter GB is still in\nbeta, so save file backups\nare HIGHLY recommended\nbefore using. With that all\nbeing said, please enjoy!\n\n -The Gears of Progress");
while (!key_hit(KEY_A)) while (!key_hit(KEY_A))
{ {
global_next_frame(); global_next_frame();
@ -291,6 +286,57 @@ int credits()
} }
}; };
#define NUM_MENU_OPTIONS 3
int main_menu_loop()
{
bool update = true;
std::string_view menu_options[NUM_MENU_OPTIONS] = {"Transfer Pok@mon", "Dream Dex", "Credits"};
int return_values[NUM_MENU_OPTIONS] = {BTN_TRANSFER, BTN_POKEDEX, BTN_CREDITS};
while (true)
{
if (update)
{
for (int i = 0; i < NUM_MENU_OPTIONS; i++)
{
int x = (6 + ((18 - menu_options[i].length()) / 2)) * 8;
tte_set_pos(x, ((i * 2) + 10) * 8);
if (i == curr_selection)
{
tte_write("#{cx:0xD000}");
}
else
{
tte_write("#{cx:0xE000}");
}
tte_write(menu_options[i].data());
}
}
update = true;
if (key_hit(KEY_DOWN))
{
curr_selection = ((curr_selection + 1) % NUM_MENU_OPTIONS);
}
else if (key_hit(KEY_UP))
{
curr_selection = ((curr_selection + (NUM_MENU_OPTIONS - 1)) % NUM_MENU_OPTIONS);
}
else if (key_hit(KEY_A))
{
tte_erase_rect(0, 0, H_MAX, V_MAX);
tte_write("#{cx:0xF000}");
return return_values[curr_selection];
}
else
{
update = false;
}
global_next_frame();
}
}
int main(void) int main(void)
{ {
initalization_script(); initalization_script();
@ -313,17 +359,21 @@ int main(void)
initalize_save_data(); initalize_save_data();
} }
// Set colors based on current ROM
set_background_pal(curr_rom.gamecode, false);
pal_bg_bank[14][15] = pal_bg_mem[3];
// Legal mumbo jumbo // Legal mumbo jumbo
tte_set_pos(8, 0); tte_set_pos(8, 0);
tte_write("#{cx:0xE000}\n\nPok@ Transporter GB was made\nout of love and appreciation\nfor the Pokemon franchise\nwith no profit in mind.\nIt will ALWAYS be free.\n\nPlease support the original developers-\nNintendo and GAME FREAK.\n\nAll Pokemon names, sprites, and music are owned by \nNintendo, Creatures Inc, and\nGAME FREAK Inc."); tte_write("#{cx:0xE000}\n\nPok@ Transporter GB was made\nout of love and appreciation\nfor the Pokemon franchise\nwith no profit in mind.\nIt will ALWAYS be free.\n\nPlease support the original developers-\nNintendo and GAME FREAK.\n\nAll Pokemon names, sprites, and music are owned by \nNintendo, Creatures Inc, and\nGAME FREAK Inc.\n\n\n Press A to continue");
tte_write("#{cx:0xF000}"); // Set the color to grey tte_write("#{cx:0xF000}"); // Set the color to grey
while (delay_counter < (15 * 60)) bool wait = true;
while (wait)
{ {
global_next_frame(); global_next_frame();
delay_counter++;
if (key_hit(KEY_A)) if (key_hit(KEY_A))
{ {
delay_counter = (15 * 60); wait = false;
} }
} }
@ -355,7 +405,8 @@ int main(void)
obj_set_pos(ptgb_logo_l, 56, 12); obj_set_pos(ptgb_logo_l, 56, 12);
obj_set_pos(ptgb_logo_r, 56 + 64, 12); obj_set_pos(ptgb_logo_r, 56 + 64, 12);
obj_unhide_multi(ptgb_logo_l, 1, 2); obj_unhide_multi(ptgb_logo_l, 1, 2);
switch (main_menu.button_main()) load_flex_background(BG_MAIN_MENU, 2);
switch (main_menu_loop())
{ {
case (BTN_TRANSFER): case (BTN_TRANSFER):
obj_hide_multi(ptgb_logo_l, 2); obj_hide_multi(ptgb_logo_l, 2);
@ -366,11 +417,11 @@ int main(void)
if (IGNORE_MG_E4_FLAGS || read_flag(curr_rom.e4_flag)) if (IGNORE_MG_E4_FLAGS || read_flag(curr_rom.e4_flag))
{ {
load_flex_background(BG_DEX, 2); load_flex_background(BG_DEX, 2);
modify_background_pal(true); set_background_pal(curr_rom.gamecode, true);
obj_hide_multi(ptgb_logo_l, 2); obj_hide_multi(ptgb_logo_l, 2);
pokedex_loop(); pokedex_loop();
load_flex_background(BG_DEX, 3); load_flex_background(BG_DEX, 3);
modify_background_pal(false); set_background_pal(curr_rom.gamecode, false);
} }
break; break;
case (BTN_CREDITS): case (BTN_CREDITS):

View File

@ -133,7 +133,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data)
{ {
if (is_caught(i)) if (is_caught(i))
{ {
// first_time = false; first_time = false;
break; break;
} }
} }
@ -152,35 +152,35 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data)
switch (curr_rom.gamecode) switch (curr_rom.gamecode)
{ {
case RUBY_ID: case RUBY_ID:
textGreet.set_text(u"When I was young, I traveled the worldŇas a POKéMON TRAINER."); textGreet.set_text(u8"When I was young, I traveled the worldŇas a POKéMON TRAINER.");
textMoveBox.set_text(u"ȆÀËOh, of course, I have to unlockŇthe door. Silly me!"); textMoveBox.set_text(u8"ȆÀËOh, of course, I have to unlockŇthe door. Silly me!");
textWeHere.set_text(u"ȆÀËLOOKER: I am here in Hoenn to findŇthe leader MAXIE.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!"); textWeHere.set_text(u8"ȆÀËLOOKER: I am here in Hoenn to findŇthe leader MAXIE.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!");
break; break;
case SAPPHIRE_ID: case SAPPHIRE_ID:
textGreet.set_text(u"When I was young, I traveled the worldŇas a POKéMON TRAINER."); textGreet.set_text(u8"When I was young, I traveled the worldŇas a POKéMON TRAINER.");
textMoveBox.set_text(u"ȆÀËOh, of course, I have to unlockŇthe door. Silly me!"); textMoveBox.set_text(u8"ȆÀËOh, of course, I have to unlockŇthe door. Silly me!");
textWeHere.set_text(u"ȆÀËLOOKER: I am here in Hoenn to findŇthe leader ARCHIE.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!"); textWeHere.set_text(u8"ȆÀËLOOKER: I am here in Hoenn to findŇthe leader ARCHIE.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!");
break; break;
case FIRERED_ID: case FIRERED_ID:
case LEAFGREEN_ID: case LEAFGREEN_ID:
textGreet.set_text(u"I may not look like much now,Ňbut when I was younger…"); textGreet.set_text(u8"I may not look like much now,Ňbut when I was younger…");
textMoveBox.set_text(u"ȆÀËOh, of course, I have to moveŇthe boxes. Silly me!"); textMoveBox.set_text(u8"ȆÀËOh, of course, I have to moveŇthe boxes. Silly me!");
textWeHere.set_text(u"ȆÀËLOOKER: I am here in the Sevii IslandsŇto find the leader GIOVANNI.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!"); textWeHere.set_text(u8"ȆÀËLOOKER: I am here in the Sevii IslandsŇto find the leader GIOVANNI.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!");
break; break;
case EMERALD_ID: case EMERALD_ID:
textGreet.set_text(u"When I was young, I traveled the worldŇas a POKéMON TRAINER."); textGreet.set_text(u8"When I was young, I traveled the worldŇas a POKéMON TRAINER.");
textMoveBox.set_text(u"ȆÀËOh, of course, I have to moveŇthe plants. Silly me!"); textMoveBox.set_text(u8"ȆÀËOh, of course, I have to moveŇthe plants. Silly me!");
textWeHere.set_text(u"ȆÀËLOOKER: I am here in Hoenn to findŇthe leaders MAXIE and ARCHIE.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!"); textWeHere.set_text(u8"ȆÀËLOOKER: I am here in Hoenn to findŇthe leaders MAXIE and ARCHIE.ȼHowever, in the meantime, I amŇhelping my friend Professor FENNEL.ȼThis is why you are here, no?ȼI shall contact her and tell herŇyou are ready.ŞCome! Allons y!");
break; break;
} }
textReceived.set_text(u"ȆÀÁƲÀS POKéMON were sent to theŇPC!"); textReceived.set_text(u8"ȆÀÁƲÀS POKéMON were sent to theŇPC!");
textYouMustBe.set_text(first_time ? u"Ah! You must be ƲÀ!ŇI was told youd be coming.ȼOh! I still wear my disguise! Pardon!ŇOr, rather, let me introduce myself." : u"Ah, ƲÀ! Welcome back!ŇGood to see you again!ȼOh! I still wear my disguise! Pardon!"); textYouMustBe.set_text(first_time ? u8"Ah! You must be ƲÀ!ŇI was told youd be coming.ȼOh! I still wear my disguise! Pardon!ŇOr, rather, let me introduce myself." : u8"Ah, ƲÀ! Welcome back!ŇGood to see you again!ȼOh! I still wear my disguise! Pardon!");
textIAm.set_text(first_time ? u"ȆÀËI am a globe-trotting elite of theŇInternational Police.ȼMy name…ŞAh, no, I shall inform you of myŇcode name only.ȼMy code name, it is LOOKER.ŇIt is how I am called!" : u"ȆÀËIt is I, globe-trotting elite of theŇInternational Police.ȼMy code name, it is LOOKER.ŇIt is how I am called!"); textIAm.set_text(first_time ? u8"ȆÀËI am a globe-trotting elite of theŇInternational Police.ȼMy name…ŞAh, no, I shall inform you of myŇcode name only.ȼMy code name, it is LOOKER.ŇIt is how I am called!" : u8"ȆÀËIt is I, globe-trotting elite of theŇInternational Police.ȼMy code name, it is LOOKER.ŇIt is how I am called!");
textPCConvo.set_text(u"ȆÀÉFENNEL: Ah, LOOKER! Good to hear fromŇyou! I take it ƲÀ has arrived?ȼȆÀËLOOKER: Indeed! Theyre here andŇready to receive their POKéMON!ȼȆÀÉFENNEL: Excellent! Ill be sending themŇover momentarily… stand by!"); // ȼDont worry ƲÀ,Ňyou wont have to do a thing!"); textPCConvo.set_text(u8"ȆÀÉFENNEL: Ah, LOOKER! Good to hear fromŇyou! I take it ƲÀ has arrived?ȼȆÀËLOOKER: Indeed! Theyre here andŇready to receive their POKéMON!ȼȆÀÉFENNEL: Excellent! Ill be sending themŇover momentarily… stand by!"); // ȼDont worry ƲÀ,Ňyou wont have to do a thing!");
textPCThanks.set_text(u"ȆÀÉFENNEL: It looks like everything wasŇsent to your PC successfully!ȼThanks again for your help ƲÀ!ŇSee you around, LOOKER!"); textPCThanks.set_text(u8"ȆÀÉFENNEL: It looks like everything wasŇsent to your PC successfully!ȼThanks again for your help ƲÀ!ŇSee you around, LOOKER!");
textThank.set_text(u"ȆÀËThanks for stopping by, ƲÀ!ȼIf youll excuse me, I need toŇreturn to my disguise.ŞUntil our paths cross again!"); textThank.set_text(u8"ȆÀËThanks for stopping by, ƲÀ!ȼIf youll excuse me, I need toŇreturn to my disguise.ŞUntil our paths cross again!");
textPCFull.set_text(u"ȆÀÉFENNEL: Hm, it seems like the PC is full!ȼGo make some room, and I can sendŇover the rest of your POKéMON."); textPCFull.set_text(u8"ȆÀÉFENNEL: Hm, it seems like the PC is full!ȼGo make some room, and I can sendŇover the rest of your POKéMON.");
textLookerFull.set_text(u"ȆÀËLOOKER: Speak to me again afterŇyouve made room, ƲÀ!ȼIn the meantime, I will return toŇmy disguise."); textLookerFull.set_text(u8"ȆÀËLOOKER: Speak to me again afterŇyouve made room, ƲÀ!ȼIn the meantime, I will return toŇmy disguise.");
const int movementSlowSpinArray[16] = { const int movementSlowSpinArray[16] = {
MOVEMENT_ACTION_FACE_LEFT, MOVEMENT_ACTION_FACE_LEFT,
@ -782,6 +782,7 @@ void mystery_gift_script::build_script(Pokemon_Party &incoming_box_data)
} }
}; };
/*
void mystery_gift_script::build_script_old(Pokemon_Party &incoming_box_data) void mystery_gift_script::build_script_old(Pokemon_Party &incoming_box_data)
{ {
std::vector<script_var *> asm_variable_list; std::vector<script_var *> asm_variable_list;
@ -996,7 +997,7 @@ void mystery_gift_script::build_script_old(Pokemon_Party &incoming_box_data)
} }
} }
}; };
*/
u8 mystery_gift_script::get_script_value_at(int i) u8 mystery_gift_script::get_script_value_at(int i)
{ {
return mg_script[i]; return mg_script[i];
@ -1410,6 +1411,7 @@ void mystery_gift_script::changePaletteMacro(u8 npcId, u8 palNum)
* *
* @param register_list Is the list of registers to be stored, separated by commas and surrounded by { and }. The list is encoded in the register_list field of the instruction, by setting bit[i] to 1 if register Ri is included in the list and to 0 otherwise, for each of i=0 to 7. The R bit (bit[8]) is set to 1 if the LR is in the list and to 0 otherwise. * @param register_list Is the list of registers to be stored, separated by commas and surrounded by { and }. The list is encoded in the register_list field of the instruction, by setting bit[i] to 1 if register Ri is included in the list and to 0 otherwise, for each of i=0 to 7. The R bit (bit[8]) is set to 1 if the LR is in the list and to 0 otherwise.
*/ */
void mystery_gift_script::push(u16 register_list) void mystery_gift_script::push(u16 register_list)
{ {
add_asm((0b1011010 << 9) | register_list); add_asm((0b1011010 << 9) | register_list);

View File

@ -17,7 +17,7 @@ bool inject_mystery(Pokemon_Party &incoming_box_data)
mystery_gift_script script; mystery_gift_script script;
if (ENABLE_OLD_EVENT) if (ENABLE_OLD_EVENT)
{ {
script.build_script_old(incoming_box_data); //script.build_script_old(incoming_box_data);
} }
else else
{ {

View File

@ -204,11 +204,11 @@ byte *generate_payload(GB_ROM curr_rom, int type, bool debug)
// our final code is. // our final code is.
// Update all the pointers // Update all the pointers
for (int i = 0; i < var_vector.size(); i++) for (unsigned int i = 0; i < var_vector.size(); i++)
{ {
var_vector.at(i)->update_ptrs(); var_vector.at(i)->update_ptrs();
} }
for (int i = 0; i < jump_vector.size(); i++) for (unsigned int i = 0; i < jump_vector.size(); i++)
{ {
jump_vector.at(i)->update_jumps(); jump_vector.at(i)->update_jumps();
} }
@ -436,11 +436,11 @@ byte *generate_payload(GB_ROM curr_rom, int type, bool debug)
// our final code is. // our final code is.
// Update all the pointers // Update all the pointers
for (int i = 0; i < var_vector.size(); i++) for (unsigned int i = 0; i < var_vector.size(); i++)
{ {
var_vector.at(i)->update_ptrs(); var_vector.at(i)->update_ptrs();
} }
for (int i = 0; i < jump_vector.size(); i++) for (unsigned int i = 0; i < jump_vector.size(); i++)
{ {
jump_vector.at(i)->update_jumps(); jump_vector.at(i)->update_jumps();
} }
@ -719,11 +719,11 @@ byte *generate_payload(GB_ROM curr_rom, int type, bool debug)
// our final code is. // our final code is.
// Update all the pointers // Update all the pointers
for (int i = 0; i < var_vector.size(); i++) for (unsigned int i = 0; i < var_vector.size(); i++)
{ {
var_vector.at(i)->update_ptrs(); var_vector.at(i)->update_ptrs();
} }
for (int i = 0; i < jump_vector.size(); i++) for (unsigned int i = 0; i < jump_vector.size(); i++)
{ {
jump_vector.at(i)->update_jumps(); jump_vector.at(i)->update_jumps();
} }
@ -744,6 +744,7 @@ byte *generate_payload(GB_ROM curr_rom, int type, bool debug)
// which is the rival's name. This code fixes the stack and jumps to the patchlist, which is where // which is the rival's name. This code fixes the stack and jumps to the patchlist, which is where
// our final code is. // our final code is.
} }
return nullptr;
}; };
int test_main() // Rename to "main" to send the payload to test_payload.txt int test_main() // Rename to "main" to send the payload to test_payload.txt

View File

@ -27,7 +27,7 @@ pkmn_fontGlyphs:
.word 0x00000000,0x00000000,0x3C3C3C18,0x18180018,0x00003636,0x00000000,0x00000000,0x00000000 .word 0x00000000,0x00000000,0x3C3C3C18,0x18180018,0x00003636,0x00000000,0x00000000,0x00000000
.word 0x043C243C,0x040E040E,0x00000000,0x00000000,0x4C16160C,0x005E335A,0x08101818,0x00000000 .word 0x043C243C,0x040E040E,0x00000000,0x00000000,0x4C16160C,0x005E335A,0x08101818,0x00000000
.word 0x04040830,0x00300804,0x2020100C,0x000C1020,0x00000000,0x00000000,0x00000000,0x00000000 .word 0x04040830,0x00300804,0x2020100C,0x000C1020,0xE0420702,0x081C0840,0x00000000,0x00000000
.word 0x00000000,0x04080C0C,0x00000000,0x0000007E,0x00000000,0x000C0C00,0x08102040,0x00010204 .word 0x00000000,0x04080C0C,0x00000000,0x0000007E,0x00000000,0x000C0C00,0x08102040,0x00010204
.word 0x63321C00,0x001C2663,0x0C0E0C00,0x003F0C0C,0x70633E00,0x007F073E,0x1C307E00,0x003E6360 .word 0x63321C00,0x001C2663,0x0C0E0C00,0x003F0C0C,0x70633E00,0x007F073E,0x1C307E00,0x003E6360
.word 0x363C3800,0x00307F33,0x3F013F00,0x003E6360,0x3F033E00,0x003E6363,0x30637F00,0x000C0C18 .word 0x363C3800,0x00307F33,0x3F013F00,0x003E6360,0x3F033E00,0x003E6363,0x30637F00,0x000C0C18

View File

@ -212,6 +212,26 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical)
*(vu32 *)exp = get_max_exp(species_index_struct); *(vu32 *)exp = get_max_exp(species_index_struct);
} }
// 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 == 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 (simplified)
{ {
if ((species_index_struct == 151 || species_index_struct == 251) && *(vu32 *)exp < 560) // Minimum EXP for level 10 if ((species_index_struct == 151 || species_index_struct == 251) && *(vu32 *)exp < 560) // Minimum EXP for level 10
@ -353,10 +373,7 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical)
copy_from_to(&trainer_id[0], &gen_3_pkmn[4], 2, true); copy_from_to(&trainer_id[0], &gen_3_pkmn[4], 2, true);
// Check if the Pokemon is shiny // Check if the Pokemon is shiny
if ( // Is shiny if (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
{ {
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[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; secret_id[1] = trainer_id[0] ^ pid[1] ^ pid[3] ^ 0x0;
@ -628,24 +645,15 @@ byte *Pokemon::convert_text(byte *text_array, int size, int gen, int lang)
u32 Pokemon::generate_pid_iv_match(byte pid_species_index, byte nature, byte *pid_dvs) u32 Pokemon::generate_pid_iv_match(byte pid_species_index, byte nature, byte *pid_dvs)
{ {
u32 new_pid = 0; u32 new_pid = 0;
int letter = -1;
int gen2_gender_threshold = get_gender_threshold(pid_species_index, false); int gen2_gender_threshold = get_gender_threshold(pid_species_index, false);
int gen3_gender_threshold = get_gender_threshold(pid_species_index, true); int gen3_gender_threshold = get_gender_threshold(pid_species_index, true);
bool gender = (((pid_dvs[0] >> 4) & 0b1111) < gen2_gender_threshold); bool gender = (((pid_dvs[0] >> 4) & 0b1111) < gen2_gender_threshold);
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;
}
do do
{ {
new_pid = get_rand_u16() | (get_rand_u16() << 16); new_pid = get_rand_u16() | (get_rand_u16() << 16);
} while (!( } while (!(
(letter != -1 ? get_letter_from_pid(new_pid) == letter : true) && (unown_letter != -1 ? get_letter_from_pid(new_pid) == unown_letter : true) &&
get_nature_from_pid(new_pid) == nature && get_nature_from_pid(new_pid) == nature &&
(gen2_gender_threshold != -1 (gen2_gender_threshold != -1
? ((get_gender_from_pid(new_pid) < gen3_gender_threshold) == gender) ? ((get_gender_from_pid(new_pid) < gen3_gender_threshold) == gender)
@ -677,12 +685,6 @@ u32 Pokemon::generate_pid_save_iv(byte pid_species_index, byte nature, byte *pid
u32 new_pid = 0; u32 new_pid = 0;
if (pid_species_index == 0xC9) // Checks if the Pokemon is Unown if (pid_species_index == 0xC9) // Checks if the Pokemon is Unown
{ {
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, unown_letter); byte letter_mod = rand_reverse_mod(28, unown_letter);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
@ -751,6 +753,11 @@ bool Pokemon::get_validity()
return is_valid; return is_valid;
} }
bool Pokemon::get_is_shiny()
{
return is_shiny;
}
bool Pokemon::get_is_new() bool Pokemon::get_is_new()
{ {
return (is_valid ? is_new : false); return (is_valid ? is_new : false);
@ -767,6 +774,8 @@ Simplified_Pokemon Pokemon::get_simple_pkmn()
} }
curr_pkmn.is_valid = get_validity(); curr_pkmn.is_valid = get_validity();
curr_pkmn.is_transferred = false; curr_pkmn.is_transferred = false;
curr_pkmn.is_shiny = get_is_shiny();
curr_pkmn.unown_letter = unown_letter;
return curr_pkmn; return curr_pkmn;
} }
@ -931,4 +940,3 @@ void Pokemon::set_to_event(byte nature)
alocate_data_chunks(data_section_G, data_section_A, data_section_E, data_section_M); alocate_data_chunks(data_section_G, data_section_A, data_section_E, data_section_M);
return; return;
} }

View File

@ -5130,259 +5130,291 @@ const u8 POWER_POINTS[252]{
10, // Beat-up 10, // Beat-up
}; };
const u8 MENU_SPRITES[252] = { #define ICON_RED 0
0, // Offset the list to remove "off by one" errors #define ICON_BLU 1
22, // Bulbasaur #define ICON_GRN 2
22, // Ivysaur #define ICON_BRN 3
22, // Venusaur #define ICON_PNK 4
23, // Charmander
23, // Charmeleon const u8 MENU_SPRITE_PALS[252 + 26][2] = {
38, // Charizard {ICON_BLU, ICON_RED}, // MISSINGNO
21, // Squirtle {ICON_GRN, ICON_GRN}, // BULBASAUR
21, // Wartortle {ICON_GRN, ICON_GRN}, // IVYSAUR
21, // Blastoise {ICON_GRN, ICON_GRN}, // VENUSAUR
24, // Caterpie {ICON_RED, ICON_BRN}, // CHARMANDER
24, // Metapod {ICON_RED, ICON_PNK}, // CHARMELEON
30, // Butterfree {ICON_RED, ICON_BLU}, // CHARIZARD
24, // Weedle {ICON_BLU, ICON_GRN}, // SQUIRTLE
24, // Kakuna {ICON_BLU, ICON_GRN}, // WARTORTLE
11, // Beedrill {ICON_BLU, ICON_GRN}, // BLASTOISE
7, // Pidgey {ICON_GRN, ICON_BRN}, // CATERPIE
7, // Pidgeotto {ICON_GRN, ICON_BRN}, // METAPOD
7, // Pidgeot {ICON_PNK, ICON_GRN}, // BUTTERFREE
15, // Rattata {ICON_RED, ICON_PNK}, // WEEDLE
15, // Raticate {ICON_BRN, ICON_GRN}, // KAKUNA
7, // Spearow {ICON_RED, ICON_GRN}, // BEEDRILL
7, // Fearow {ICON_BRN, ICON_GRN}, // PIDGEY
19, // Ekans {ICON_BRN, ICON_GRN}, // PIDGEOTTO
19, // Arbok {ICON_RED, ICON_GRN}, // PIDGEOT
4, // Pikachu {ICON_PNK, ICON_GRN}, // RATTATA
4, // Raichu {ICON_BRN, ICON_RED}, // RATICATE
8, // Sandshrew {ICON_BRN, ICON_GRN}, // SPEAROW
8, // Sandslash {ICON_BRN, ICON_GRN}, // FEAROW
15, // Nidoran♀ {ICON_PNK, ICON_GRN}, // EKANS
15, // Nidorina {ICON_PNK, ICON_BRN}, // ARBOK
8, // Nidoqueen {ICON_RED, ICON_PNK}, // PIKACHU
15, // Nidoran♂ {ICON_RED, ICON_BRN}, // RAICHU
15, // Nidorino {ICON_BRN, ICON_GRN}, // SANDSHREW
8, // Nidoking {ICON_BRN, ICON_RED}, // SANDSLASH
9, // Clefairy {ICON_BLU, ICON_PNK}, // NIDORAN_F
9, // Clefable {ICON_BLU, ICON_PNK}, // NIDORINA
15, // Vulpix {ICON_BLU, ICON_GRN}, // NIDOQUEEN
15, // Ninetales {ICON_PNK, ICON_BLU}, // NIDORAN_M
2, // Jigglypuff {ICON_PNK, ICON_BLU}, // NIDORINO
2, // Wigglytuff {ICON_PNK, ICON_BLU}, // NIDOKING
31, // Zubat {ICON_PNK, ICON_GRN}, // CLEFAIRY
31, // Golbat {ICON_PNK, ICON_GRN}, // CLEFABLE
10, // Oddish {ICON_RED, ICON_BRN}, // VULPIX
10, // Gloom {ICON_BRN, ICON_BLU}, // NINETALES
10, // Vileplume {ICON_PNK, ICON_GRN}, // JIGGLYPUFF
11, // Paras {ICON_PNK, ICON_GRN}, // WIGGLYTUFF
11, // Parasect {ICON_BLU, ICON_GRN}, // ZUBAT
24, // Venonat {ICON_BLU, ICON_GRN}, // GOLBAT
30, // Venomoth {ICON_GRN, ICON_BRN}, // ODDISH
3, // Diglett {ICON_RED, ICON_BRN}, // GLOOM
3, // Dugtrio {ICON_RED, ICON_BRN}, // VILEPLUME
15, // Meowth {ICON_RED, ICON_GRN}, // PARAS
15, // Persian {ICON_RED, ICON_GRN}, // PARASECT
8, // Psyduck {ICON_PNK, ICON_BLU}, // VENONAT
8, // Golduck {ICON_PNK, ICON_BLU}, // VENOMOTH
27, // Mankey {ICON_BRN, ICON_BLU}, // DIGLETT
27, // Primeape {ICON_BRN, ICON_BLU}, // DUGTRIO
15, // Growlithe {ICON_BRN, ICON_PNK}, // MEOWTH
15, // Arcanine {ICON_BRN, ICON_PNK}, // PERSIAN
1, // Poliwag {ICON_BRN, ICON_BLU}, // PSYDUCK
1, // Poliwhirl {ICON_BLU, ICON_BLU}, // GOLDUCK
1, // Poliwrath {ICON_BRN, ICON_GRN}, // MANKEY
14, // Abra {ICON_BRN, ICON_GRN}, // PRIMEAPE
14, // Kadabra {ICON_RED, ICON_GRN}, // GROWLITHE
14, // Alakazam {ICON_RED, ICON_GRN}, // ARCANINE
27, // Machop {ICON_BLU, ICON_BLU}, // POLIWAG
27, // Machoke {ICON_BLU, ICON_BLU}, // POLIWHIRL
27, // Machamp {ICON_BLU, ICON_GRN}, // POLIWRATH
10, // Bellsprout {ICON_BRN, ICON_PNK}, // ABRA
10, // Weepinbell {ICON_BRN, ICON_PNK}, // KADABRA
10, // Victreebel {ICON_BRN, ICON_PNK}, // ALAKAZAM
29, // Tentacool {ICON_BLU, ICON_BRN}, // MACHOP
29, // Tentacruel {ICON_BLU, ICON_GRN}, // MACHOKE
26, // Geodude {ICON_BLU, ICON_GRN}, // MACHAMP
26, // Graveler {ICON_GRN, ICON_BRN}, // BELLSPROUT
26, // Golem {ICON_GRN, ICON_BRN}, // WEEPINBELL
16, // Ponyta {ICON_GRN, ICON_BRN}, // VICTREEBEL
16, // Rapidash {ICON_BLU, ICON_GRN}, // TENTACOOL
36, // Slowpoke {ICON_BLU, ICON_GRN}, // TENTACRUEL
36, // Slowbro {ICON_BRN, ICON_RED}, // GEODUDE
20, // Magnemite {ICON_BRN, ICON_RED}, // GRAVELER
20, // Magneton {ICON_BRN, ICON_RED}, // GOLEM
7, // Farfetch'd {ICON_RED, ICON_PNK}, // PONYTA
7, // Doduo {ICON_RED, ICON_PNK}, // RAPIDASH
7, // Dodrio {ICON_PNK, ICON_BLU}, // SLOWPOKE
13, // Seel {ICON_PNK, ICON_BLU}, // SLOWBRO
13, // Dewgong {ICON_BLU, ICON_BRN}, // MAGNEMITE
18, // Grimer {ICON_BLU, ICON_BRN}, // MAGNETON
18, // Muk {ICON_BRN, ICON_GRN}, // FARFETCH_D
37, // Shellder {ICON_BRN, ICON_GRN}, // DODUO
37, // Cloyster {ICON_BRN, ICON_GRN}, // DODRIO
12, // Gastly {ICON_RED, ICON_PNK}, // SEEL
12, // Haunter {ICON_RED, ICON_PNK}, // DEWGONG
12, // Gengar {ICON_PNK, ICON_GRN}, // GRIMER
19, // Onix {ICON_PNK, ICON_GRN}, // MUK
14, // Drowzee {ICON_PNK, ICON_BRN}, // SHELLDER
14, // Hypno {ICON_PNK, ICON_BLU}, // CLOYSTER
17, // Krabby {ICON_PNK, ICON_BLU}, // GASTLY
17, // Kingler {ICON_PNK, ICON_BLU}, // HAUNTER
20, // Voltorb {ICON_RED, ICON_BLU}, // GENGAR
20, // Electrode {ICON_BRN, ICON_GRN}, // ONIX
10, // Exeggcute {ICON_BRN, ICON_PNK}, // DROWZEE
10, // Exeggutor {ICON_BRN, ICON_PNK}, // HYPNO
8, // Cubone {ICON_RED, ICON_GRN}, // KRABBY
8, // Marowak {ICON_RED, ICON_GRN}, // KINGLER
27, // Hitmonlee {ICON_RED, ICON_BLU}, // VOLTORB
27, // Hitmonchan {ICON_RED, ICON_BLU}, // ELECTRODE
8, // Lickitung {ICON_PNK, ICON_GRN}, // EXEGGCUTE
18, // Koffing {ICON_GRN, ICON_BRN}, // EXEGGUTOR
18, // Weezing {ICON_BRN, ICON_GRN}, // CUBONE
16, // Rhyhorn {ICON_BRN, ICON_GRN}, // MAROWAK
8, // Rhydon {ICON_BRN, ICON_GRN}, // HITMONLEE
9, // Chansey {ICON_BRN, ICON_GRN}, // HITMONCHAN
10, // Tangela {ICON_PNK, ICON_GRN}, // LICKITUNG
8, // Kangaskhan {ICON_PNK, ICON_BLU}, // KOFFING
6, // Horsea {ICON_PNK, ICON_BLU}, // WEEZING
6, // Seadra {ICON_BLU, ICON_BRN}, // RHYHORN
6, // Goldeen {ICON_BLU, ICON_BLU}, // RHYDON
6, // Seaking {ICON_PNK, ICON_GRN}, // CHANSEY
5, // Staryu {ICON_BLU, ICON_GRN}, // TANGELA
5, // Starmie {ICON_BRN, ICON_GRN}, // KANGASKHAN
14, // Mr. Mime {ICON_BLU, ICON_PNK}, // HORSEA
11, // Scyther {ICON_BLU, ICON_PNK}, // SEADRA
14, // Jynx {ICON_RED, ICON_BRN}, // GOLDEEN
14, // Electabuzz {ICON_RED, ICON_BRN}, // SEAKING
14, // Magmar {ICON_BRN, ICON_BLU}, // STARYU
11, // Pinsir {ICON_PNK, ICON_BLU}, // STARMIE
16, // Tauros {ICON_PNK, ICON_GRN}, // MR__MIME
6, // Magikarp {ICON_GRN, ICON_GRN}, // SCYTHER
35, // Gyarados {ICON_RED, ICON_PNK}, // JYNX
13, // Lapras {ICON_BRN, ICON_GRN}, // ELECTABUZZ
18, // Ditto {ICON_RED, ICON_PNK}, // MAGMAR
15, // Eevee {ICON_BRN, ICON_BLU}, // PINSIR
15, // Vaporeon {ICON_BRN, ICON_GRN}, // TAUROS
15, // Jolteon {ICON_RED, ICON_GRN}, // MAGIKARP
15, // Flareon {ICON_BLU, ICON_RED}, // GYARADOS
20, // Porygon {ICON_BLU, ICON_PNK}, // LAPRAS
17, // Omanyte {ICON_PNK, ICON_BLU}, // DITTO
17, // Omastar {ICON_BRN, ICON_BLU}, // EEVEE
17, // Kabuto {ICON_BLU, ICON_PNK}, // VAPOREON
17, // Kabutops {ICON_BRN, ICON_GRN}, // JOLTEON
7, // Aerodactyl {ICON_RED, ICON_BRN}, // FLAREON
32, // Snorlax {ICON_PNK, ICON_BLU}, // PORYGON
7, // Articuno {ICON_BLU, ICON_BRN}, // OMANYTE
7, // Zapdos {ICON_BLU, ICON_BRN}, // OMASTAR
7, // Moltres {ICON_BRN, ICON_GRN}, // KABUTO
19, // Dratini {ICON_BRN, ICON_GRN}, // KABUTOPS
19, // Dragonair {ICON_PNK, ICON_BLU}, // AERODACTYL
38, // Dragonite {ICON_RED, ICON_BLU}, // SNORLAX
14, // Mewtwo {ICON_BLU, ICON_BLU}, // ARTICUNO
14, // Mew {ICON_BRN, ICON_RED}, // ZAPDOS
10, // Chikorita {ICON_RED, ICON_PNK}, // MOLTRES
10, // Bayleef {ICON_BLU, ICON_PNK}, // DRATINI
10, // Meganium {ICON_BLU, ICON_PNK}, // DRAGONAIR
15, // Cyndaquil {ICON_RED, ICON_GRN}, // DRAGONITE
15, // Quilava {ICON_PNK, ICON_GRN}, // MEWTWO
15, // Typhlosion {ICON_PNK, ICON_BLU}, // MEW
8, // Totodile {ICON_GRN, ICON_BRN}, // CHIKORITA
8, // Croconaw {ICON_GRN, ICON_BRN}, // BAYLEEF
8, // Feraligatr {ICON_GRN, ICON_BRN}, // MEGANIUM
15, // Sentret {ICON_RED, ICON_PNK}, // CYNDAQUIL
15, // Furret {ICON_RED, ICON_PNK}, // QUILAVA
7, // Hoothoot {ICON_RED, ICON_PNK}, // TYPHLOSION
7, // Noctowl {ICON_BLU, ICON_GRN}, // TOTODILE
11, // Ledyba {ICON_BLU, ICON_GRN}, // CROCONAW
11, // Ledian {ICON_BLU, ICON_GRN}, // FERALIGATR
11, // Spinarak {ICON_BRN, ICON_PNK}, // SENTRET
11, // Ariados {ICON_BRN, ICON_PNK}, // FURRET
31, // Crobat {ICON_BRN, ICON_GRN}, // HOOTHOOT
6, // Chinchou {ICON_BRN, ICON_GRN}, // NOCTOWL
6, // Lanturn {ICON_RED, ICON_BRN}, // LEDYBA
4, // Pichu {ICON_RED, ICON_BRN}, // LEDIAN
9, // Cleffa {ICON_GRN, ICON_PNK}, // SPINARAK
2, // Igglybuff {ICON_RED, ICON_PNK}, // ARIADOS
9, // Togepi {ICON_PNK, ICON_PNK}, // CROBAT
7, // Togetic {ICON_BLU, ICON_BLU}, // CHINCHOU
7, // Natu {ICON_BLU, ICON_PNK}, // LANTURN
7, // Xatu {ICON_RED, ICON_BRN}, // PICHU
15, // Mareep {ICON_PNK, ICON_GRN}, // CLEFFA
8, // Flaaffy {ICON_PNK, ICON_GRN}, // IGGLYBUFF
8, // Ampharos {ICON_RED, ICON_BLU}, // TOGEPI
10, // Bellossom {ICON_RED, ICON_BLU}, // TOGETIC
2, // Marill {ICON_GRN, ICON_GRN}, // NATU
2, // Azumarill {ICON_GRN, ICON_GRN}, // XATU
27, // Sudowoodo {ICON_BLU, ICON_BLU}, // MAREEP
1, // Politoed {ICON_PNK, ICON_PNK}, // FLAAFFY
10, // Hoppip {ICON_BRN, ICON_BLU}, // AMPHAROS
10, // Skiploom {ICON_GRN, ICON_BLU}, // BELLOSSOM
10, // Jumpluff {ICON_BLU, ICON_GRN}, // MARILL
8, // Aipom {ICON_BLU, ICON_BRN}, // AZUMARILL
10, // Sunkern {ICON_GRN, ICON_PNK}, // SUDOWOODO
10, // Sunflora {ICON_GRN, ICON_BLU}, // POLITOED
11, // Yanma {ICON_PNK, ICON_GRN}, // HOPPIP
8, // Wooper {ICON_GRN, ICON_PNK}, // SKIPLOOM
8, // Quagsire {ICON_BLU, ICON_PNK}, // JUMPLUFF
15, // Espeon {ICON_PNK, ICON_PNK}, // AIPOM
15, // Umbreon {ICON_GRN, ICON_BRN}, // SUNKERN
7, // Murkrow {ICON_GRN, ICON_BRN}, // SUNFLORA
36, // Slowking {ICON_RED, ICON_BLU}, // YANMA
12, // Misdreavus {ICON_BLU, ICON_PNK}, // WOOPER
25, // Unown {ICON_BLU, ICON_PNK}, // QUAGSIRE
12, // Wobbuffet {ICON_PNK, ICON_GRN}, // ESPEON
16, // Girafarig {ICON_BRN, ICON_BLU}, // UMBREON
11, // Pineco {ICON_BLU, ICON_PNK}, // MURKROW
11, // Forretress {ICON_PNK, ICON_BLU}, // SLOWKING
19, // Dunsparce {ICON_BLU, ICON_BRN}, // MISDREAVUS
11, // Gligar {ICON_BRN, ICON_BLU}, // UNOWN
19, // Steelix {ICON_BLU, ICON_PNK}, // WOBBUFFET
8, // Snubbull {ICON_PNK, ICON_BLU}, // GIRAFARIG
8, // Granbull {ICON_GRN, ICON_RED}, // PINECO
6, // Qwilfish {ICON_RED, ICON_GRN}, // FORRETRESS
11, // Scizor {ICON_BLU, ICON_PNK}, // DUNSPARCE
11, // Shuckle {ICON_PNK, ICON_BLU}, // GLIGAR
11, // Heracross {ICON_BLU, ICON_BRN}, // STEELIX
15, // Sneasel {ICON_PNK, ICON_BLU}, // SNUBBULL
8, // Teddiursa {ICON_PNK, ICON_BLU}, // GRANBULL
8, // Ursaring {ICON_BLU, ICON_PNK}, // QWILFISH
18, // Slugma {ICON_RED, ICON_GRN}, // SCIZOR
18, // Magcargo {ICON_RED, ICON_BLU}, // SHUCKLE
16, // Swinub {ICON_BLU, ICON_PNK}, // HERACROSS
16, // Piloswine {ICON_BLU, ICON_PNK}, // SNEASEL
17, // Corsola {ICON_BRN, ICON_GRN}, // TEDDIURSA
6, // Remoraid {ICON_BRN, ICON_GRN}, // URSARING
6, // Octillery {ICON_RED, ICON_BLU}, // SLUGMA
8, // Delibird {ICON_RED, ICON_BLU}, // MAGCARGO
6, // Mantine {ICON_BRN, ICON_BLU}, // SWINUB
7, // Skarmory {ICON_BRN, ICON_GRN}, // PILOSWINE
15, // Houndour {ICON_PNK, ICON_BLU}, // CORSOLA
15, // Houndoom {ICON_BLU, ICON_BLU}, // REMORAID
38, // Kingdra {ICON_RED, ICON_GRN}, // OCTILLERY
16, // Phanpy {ICON_RED, ICON_PNK}, // DELIBIRD
16, // Donphan {ICON_BLU, ICON_BLU}, // MANTINE
20, // Porygon2 {ICON_RED, ICON_GRN}, // SKARMORY
16, // Stantler {ICON_RED, ICON_BLU}, // HOUNDOUR
8, // Smeargle {ICON_RED, ICON_BLU}, // HOUNDOOM
27, // Tyrogue {ICON_BLU, ICON_PNK}, // KINGDRA
27, // Hitmontop {ICON_BLU, ICON_BLU}, // PHANPY
14, // Smoochum {ICON_BLU, ICON_RED}, // DONPHAN
14, // Elekid {ICON_PNK, ICON_BLU}, // PORYGON2
14, // Magby {ICON_BRN, ICON_GRN}, // STANTLER
16, // Miltank {ICON_GRN, ICON_PNK}, // SMEARGLE
9, // Blissey {ICON_PNK, ICON_BLU}, // TYROGUE
15, // Raikou {ICON_BRN, ICON_BLU}, // HITMONTOP
15, // Entei {ICON_PNK, ICON_PNK}, // SMOOCHUM
15, // Suicune {ICON_BRN, ICON_BRN}, // ELEKID
8, // Larvitar {ICON_RED, ICON_BRN}, // MAGBY
8, // Pupitar {ICON_PNK, ICON_BLU}, // MILTANK
8, // Tyranitar {ICON_PNK, ICON_PNK}, // BLISSEY
34, // Lugia {ICON_BRN, ICON_BRN}, // RAIKOU
33, // Ho-Oh {ICON_RED, ICON_RED}, // ENTEI
14, // Celebi {ICON_BLU, ICON_BLU}, // SUICUNE
{ICON_GRN, ICON_GRN}, // LARVITAR
{ICON_BLU, ICON_PNK}, // PUPITAR
{ICON_GRN, ICON_PNK}, // TYRANITAR
{ICON_BLU, ICON_PNK}, // LUGIA
{ICON_RED, ICON_BRN}, // HO_OH
{ICON_GRN, ICON_PNK}, // CELEBI
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
{ICON_BRN, ICON_BLU}, // UNOWN
}; };
extern const byte EVENT_PKMN[8][80]{ extern const byte EVENT_PKMN[8][80]{

View File

@ -91,7 +91,7 @@ byte gen2_debug_box_data[0x44E] = {
// Num of Pokemon // Num of Pokemon
0x14, 0x14,
// Pokemon 1-20 // Pokemon 1-20
0xD5, 0x7B, 0xE3, 0x9D, 0xC3, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xFF, 0xD5, 0x7B, 0xE3, 0x9D, 0xC3, 0xD5, 0xD5, 0xC9, 0xC9, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xD5, 0xFF,
// Pokemon list // Pokemon list
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0x7B, 0x00, 0x62, 0x2B, 0x74, 0xE4, 0xBB, 0x4C, 0x00, 0x08, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0xF9, 0x1E, 0x1E, 0x1E, 0x14, 0x46, 0x00, 0x00, 0x00, 0x0D, 0x7B, 0x00, 0x62, 0x2B, 0x74, 0xE4, 0xBB, 0x4C, 0x00, 0x08, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0xF9, 0x1E, 0x1E, 0x1E, 0x14, 0x46, 0x00, 0x00, 0x00, 0x0D,
@ -100,8 +100,8 @@ byte gen2_debug_box_data[0x44E] = {
0xC3, 0x1B, 0xD6, 0x27, 0x15, 0x37, 0xBB, 0x4C, 0x00, 0x1F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x10, 0x0A, 0x1E, 0x14, 0x19, 0x4C, 0x00, 0x00, 0x00, 0x14, 0xC3, 0x1B, 0xD6, 0x27, 0x15, 0x37, 0xBB, 0x4C, 0x00, 0x1F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x10, 0x0A, 0x1E, 0x14, 0x19, 0x4C, 0x00, 0x00, 0x00, 0x14,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x2A, 0xAA, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x2A, 0xAA, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xC9, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x22, 0x22, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xC9, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x44, 0x44, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,
0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10, 0xD5, 0x00, 0x84, 0x6E, 0x23, 0xE3, 0xBB, 0x4C, 0x00, 0x0A, 0x4E, 0x00, 0x20, 0x00, 0x32, 0x00, 0x23, 0x00, 0x34, 0x00, 0x28, 0x9C, 0x90, 0x23, 0x28, 0x14, 0x05, 0x58, 0x00, 0x00, 0x00, 0x10,

View File

@ -2,7 +2,7 @@
#include "save_data_manager.h" #include "save_data_manager.h"
#include "flash_mem.h" #include "flash_mem.h"
#include "debug_mode.h" #include "debug_mode.h"
#include "main_menu.h" #include "button_menu.h"
#include "pokemon_data.h" #include "pokemon_data.h"
#include "libraries/Pokemon-Gen3-to-Gen-X/include/save.h" #include "libraries/Pokemon-Gen3-to-Gen-X/include/save.h"

View File

@ -1,5 +1,5 @@
#include "script_array.h" #include "script_array.h"
#include "main_menu.h" #include "button_menu.h"
#include "text_engine.h" #include "text_engine.h"
#include "mystery_gift_injector.h" #include "mystery_gift_injector.h"
#include "sprite_data.h" #include "sprite_data.h"
@ -279,9 +279,11 @@ bool run_conditional(int index)
case CMD_START_LINK: case CMD_START_LINK:
load_flex_background(BG_FENNEL, 3); load_flex_background(BG_FENNEL, 3);
link_animation_state(STATE_CONNECTION);
party_data.start_link(); party_data.start_link();
set_textbox_small(); set_textbox_small();
load_flex_background(BG_FENNEL, 2); load_flex_background(BG_FENNEL, 2);
link_animation_state(0);
return true; return true;
case CMD_IMPORT_POKEMON: case CMD_IMPORT_POKEMON:
@ -333,7 +335,7 @@ bool run_conditional(int index)
case CMD_SLIDE_PROF_LEFT: case CMD_SLIDE_PROF_LEFT:
for (int i = 0; i <= (8 * 7); i += 2) for (int i = 0; i <= (8 * 7); i += 2)
{ {
REG_BG1HOFS = i; REG_BG1HOFS = i + FENNEL_SHIFT;
if (!DEBUG_MODE) if (!DEBUG_MODE)
{ {
global_next_frame(); global_next_frame();
@ -344,7 +346,7 @@ bool run_conditional(int index)
case CMD_SLIDE_PROF_RIGHT: case CMD_SLIDE_PROF_RIGHT:
for (int i = (8 * 7); i >= 0; i -= 2) for (int i = (8 * 7); i >= 0; i -= 2)
{ {
REG_BG1HOFS = i; REG_BG1HOFS = i + FENNEL_SHIFT;
if (!DEBUG_MODE) if (!DEBUG_MODE)
{ {
global_next_frame(); global_next_frame();

View File

@ -136,7 +136,7 @@ u32 xse_var::get_loc_in_sec30()
// TEXTBOX VAR // TEXTBOX VAR
void textbox_var::set_text(std::u16string_view nText) void textbox_var::set_text(std::u8string_view nText)
{ {
text = nText; text = nText;
} }

View File

@ -20,9 +20,13 @@ int Select_Menu::select_menu_main()
key_poll(); // Reset the buttons key_poll(); // Reset the buttons
bool update = true;
while (true) while (true)
{ {
obj_set_pos(point_arrow, 19 * 8, (2 + curr_selection) * 8); obj_set_pos(point_arrow, 19 * 8, (2 + curr_selection) * 8);
if (update)
{
if (return_values[curr_selection] == -1) if (return_values[curr_selection] == -1)
{ {
switch (menu_type) switch (menu_type)
@ -41,19 +45,23 @@ int Select_Menu::select_menu_main()
switch (menu_type) switch (menu_type)
{ {
case CART_MENU: case CART_MENU:
load_cart(return_values[curr_selection], lang); load_select_sprites(return_values[curr_selection], lang);
obj_unhide(cart_shell, 0);
obj_unhide(cart_label, 0);
break; break;
case LANG_MENU: case LANG_MENU:
load_flag(return_values[curr_selection]); load_select_sprites(0, return_values[curr_selection]);
obj_unhide(flag, 0);
break; break;
} }
} }
}
update = true;
if (key_hit(KEY_DOWN)) if (key_hit(KEY_DOWN))
{ {
curr_selection = ((curr_selection + 1) % menu_options.size()); curr_selection = ((curr_selection + 1) % menu_options.size());
} }
else if (key_hit(KEY_UP)) else if (key_hit(KEY_UP))
{ {
curr_selection = ((curr_selection + (menu_options.size() - 1)) % menu_options.size()); curr_selection = ((curr_selection + (menu_options.size() - 1)) % menu_options.size());
@ -68,6 +76,10 @@ int Select_Menu::select_menu_main()
hide_menu(); hide_menu();
return -1; return -1;
} }
else
{
update = false;
}
global_next_frame(); global_next_frame();
} }

View File

@ -1,46 +1,17 @@
#include <tonc.h> #include <tonc.h>
#include <cstring> #include <cstring>
#include <cmath>
#include "sprite_data.h" #include "sprite_data.h"
#include "debug_mode.h" #include "debug_mode.h"
#include "gba_rom_values/base_gba_rom_struct.h"
#define SPRITE_CHAR_BLOCK 4 #define SPRITE_CHAR_BLOCK 4
OBJ_ATTR obj_buffer[128]; OBJ_ATTR obj_buffer[128];
OBJ_AFFINE *obj_aff_buffer = (OBJ_AFFINE *)obj_buffer; OBJ_AFFINE *obj_aff_buffer = (OBJ_AFFINE *)obj_buffer;
int curr_flex_background;
// These are the two pallets used by the menu sprites, int y_offset = 0;
// it's easier to set them up this way instead of through grit int y_offset_timer = 0;
// (R + G*32 + B*1024) int y_offset_direction = 1;
#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,
RED, RED, RED, RED,
BLACK, BLACK, BLACK, BLACK};
const unsigned short frame_two_pal[16] = {
WHITE,
YELLOW,
RED,
BLACK,
WHITE,
YELLOW,
RED,
BLACK,
WHITE,
YELLOW,
RED,
BLACK,
WHITE,
YELLOW,
RED,
BLACK,
};
// BACKGROUNDS // BACKGROUNDS
#include "background.h" #include "background.h"
@ -58,21 +29,54 @@ void load_background()
REG_BG0CNT = BG_CBB(CBB) | BG_SBB(SBB) | BG_4BPP | BG_REG_32x32 | BG_PRIO(3); REG_BG0CNT = BG_CBB(CBB) | BG_SBB(SBB) | BG_4BPP | BG_REG_32x32 | BG_PRIO(3);
} }
void modify_background_pal(bool dark) void set_background_pal(int curr_rom_id, bool dark)
{ {
if (dark) switch (curr_rom_id)
{ {
memcpy(pal_bg_mem, &backgroundPal[4], 16); case RUBY_ID:
} pal_bg_mem[1] = (!dark ? RGB15(12, 3, 9) : RGB15(8, 2, 6));
else pal_bg_mem[2] = (!dark ? RGB15(18, 6, 11) : RGB15(12, 4, 7));
{ pal_bg_mem[3] = (!dark ? RGB15(26, 12, 15) : RGB15(16, 8, 9));
memcpy(pal_bg_mem, backgroundPal, backgroundPalLen); pal_bg_mem[4] = (!dark ? RGB15(28, 19, 21) : RGB15(18, 12, 13));
break;
case SAPPHIRE_ID:
pal_bg_mem[1] = (!dark ? RGB15(7, 6, 13) : RGB15(4, 4, 8));
pal_bg_mem[2] = (!dark ? RGB15(7, 9, 21) : RGB15(4, 6, 13));
pal_bg_mem[3] = (!dark ? RGB15(13, 15, 28) : RGB15(8, 10, 18));
pal_bg_mem[4] = (!dark ? RGB15(20, 21, 28) : RGB15(13, 13, 18));
break;
case FIRERED_ID:
pal_bg_mem[1] = (!dark ? RGB15(15, 4, 4) : RGB15(9, 3, 3));
pal_bg_mem[2] = (!dark ? RGB15(19, 8, 6) : RGB15(12, 5, 4));
pal_bg_mem[3] = (!dark ? RGB15(24, 13, 10) : RGB15(15, 8, 6));
pal_bg_mem[4] = (!dark ? RGB15(28, 23, 21) : RGB15(17, 14, 13));
break;
case LEAFGREEN_ID:
pal_bg_mem[1] = (!dark ? RGB15(5, 11, 5) : RGB15(3, 7, 3));
pal_bg_mem[2] = (!dark ? RGB15(9, 17, 7) : RGB15(6, 11, 4));
pal_bg_mem[3] = (!dark ? RGB15(17, 22, 11) : RGB15(10, 14, 7));
pal_bg_mem[4] = (!dark ? RGB15(24, 26, 19) : RGB15(15, 16, 12));
break;
case EMERALD_ID:
pal_bg_mem[1] = (!dark ? RGB15(5, 10, 10) : RGB15(3, 6, 6));
pal_bg_mem[2] = (!dark ? RGB15(7, 15, 13) : RGB15(5, 9, 8));
pal_bg_mem[3] = (!dark ? RGB15(11, 22, 13) : RGB15(7, 14, 8));
pal_bg_mem[4] = (!dark ? RGB15(20, 26, 20) : RGB15(12, 16, 13));
break;
default:
memcpy(pal_bg_mem, &backgroundPal[dark ? 8 : 0], backgroundPalLen);
break;
} }
(pal_obj_mem + (BTN_LIT_PAL * 16))[7] = pal_bg_mem[1];
(pal_obj_mem + (BTN_LIT_PAL * 16))[8] = pal_bg_mem[1];
(pal_obj_mem + (BTN_LIT_PAL * 16))[9] = pal_bg_mem[1];
(pal_obj_mem + (BTN_LIT_PAL * 16))[10] = pal_bg_mem[3];
} }
#include "openingBG.h" #include "openingBG.h"
#include "fennelBG.h" #include "fennelBG.h"
#include "dexBG.h" #include "dexBG.h"
#include "menu_bars.h"
void load_flex_background(int background_id, int layer) void load_flex_background(int background_id, int layer)
{ {
int CBB = 1; // CBB is the tiles that make up the sprite int CBB = 1; // CBB is the tiles that make up the sprite
@ -95,7 +99,7 @@ void load_flex_background(int background_id, int layer)
memcpy(&tile_mem[CBB][0], fennelBGTiles, fennelBGTilesLen); memcpy(&tile_mem[CBB][0], fennelBGTiles, fennelBGTilesLen);
// Load map into SBB 0 // Load map into SBB 0
memcpy(&se_mem[SBB][0], fennelBGMap, fennelBGMapLen); memcpy(&se_mem[SBB][0], fennelBGMap, fennelBGMapLen);
REG_BG1VOFS = 0; REG_BG1VOFS = FENNEL_SHIFT;
break; break;
case (BG_DEX): case (BG_DEX):
// Load palette // Load palette
@ -106,11 +110,19 @@ void load_flex_background(int background_id, int layer)
memcpy(&se_mem[SBB][0], dexBGMap, dexBGMapLen); memcpy(&se_mem[SBB][0], dexBGMap, dexBGMapLen);
REG_BG1VOFS = 0; REG_BG1VOFS = 0;
break; break;
case (BG_MAIN_MENU):
// Load palette
memcpy(pal_bg_mem + 32, pal_bg_mem, backgroundPalLen);
// Load tiles into CBB 0
memcpy(&tile_mem[CBB][0], menu_barsTiles, menu_barsTilesLen);
// Load map into SBB 0
memcpy(&se_mem[SBB][0], menu_barsMap, menu_barsMapLen);
REG_BG1VOFS = 0;
break;
} }
REG_BG1CNT = BG_CBB(CBB) | BG_SBB(SBB) | BG_4BPP | BG_REG_32x32 | BG_PRIO(layer); REG_BG1CNT = BG_CBB(CBB) | BG_SBB(SBB) | BG_4BPP | BG_REG_32x32 | BG_PRIO(layer);
curr_flex_background = background_id;
} }
#include "textboxBG.h" #include "textboxBG.h"
void load_textbox_background() void load_textbox_background()
{ {
@ -258,35 +270,44 @@ OBJ_ATTR *button_cancel_right = &obj_buffer[num_sprites++];
OBJ_ATTR *button_confirm_left = &obj_buffer[num_sprites++]; OBJ_ATTR *button_confirm_left = &obj_buffer[num_sprites++];
OBJ_ATTR *button_confirm_right = &obj_buffer[num_sprites++]; OBJ_ATTR *button_confirm_right = &obj_buffer[num_sprites++];
OBJ_ATTR *gba_cart = &obj_buffer[num_sprites++];
OBJ_ATTR *link_frame1 = &obj_buffer[num_sprites++];
OBJ_ATTR *link_frame2 = &obj_buffer[num_sprites++];
OBJ_ATTR *link_frame3 = &obj_buffer[num_sprites++];
OBJ_ATTR *link_blob1 = &obj_buffer[num_sprites++];
OBJ_ATTR *link_blob2 = &obj_buffer[num_sprites++];
OBJ_ATTR *link_blob3 = &obj_buffer[num_sprites++];
u32 global_tile_id_end = 0; u32 global_tile_id_end = 0;
void load_eternal_sprites() void load_eternal_sprites()
{ {
memcpy(pal_obj_mem + (BTN_PAL * 16), btn_t_lPal, btn_t_lPalLen); memcpy(pal_obj_mem + (BTN_PAL * 16), button_noPal, button_noPalLen);
memcpy(pal_obj_mem + (BTN_LIT_PAL * 16), btn_t_rPal, btn_t_rPalLen); memcpy(pal_obj_mem + (BTN_LIT_PAL * 16), button_yesPal, button_yesPalLen);
memcpy(pal_obj_mem + (LOGO_PAL * 16), ptgb_logo_lPal, ptgb_logo_lPalLen); memcpy(pal_obj_mem + (LOGO_PAL * 16), ptgb_logo_lPal, ptgb_logo_lPalLen);
memcpy(pal_obj_mem + (TYPES_PAL1 * 16), typesPal, typesPalLen); memcpy(pal_obj_mem + (TYPES_PAL1 * 16), typesPal, typesPalLen);
memcpy(pal_obj_mem + (LINK_CABLE_PAL * 16), link_frame1Pal, link_frame1PalLen);
u32 curr_tile_id = 0; u32 curr_tile_id = 0;
load_sprite(ptgb_logo_l, ptgb_logo_lTiles, ptgb_logo_lTilesLen, curr_tile_id, LOGO_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); load_sprite(ptgb_logo_l, ptgb_logo_lTiles, ptgb_logo_lTilesLen, curr_tile_id, LOGO_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1);
load_sprite(ptgb_logo_r, ptgb_logo_rTiles, ptgb_logo_rTilesLen, curr_tile_id, LOGO_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); load_sprite(ptgb_logo_r, ptgb_logo_rTiles, ptgb_logo_rTilesLen, curr_tile_id, LOGO_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1);
load_sprite(btn_t_l, btn_t_lTiles, btn_t_lTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(btn_t_r, btn_t_rTiles, btn_t_rTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(btn_p_l, btn_p_lTiles, btn_p_lTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(btn_p_r, btn_p_rTiles, btn_p_rTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(btn_c_l, btn_c_lTiles, btn_c_lTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(btn_c_r, btn_c_rTiles, btn_c_rTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(btn_d_l, btn_d_lTiles, btn_d_lTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
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_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_no, button_noTiles, button_noTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(cart_label, &Label_GreenTiles[8], Label_GreenTilesLen - 32, curr_tile_id, CART_PAL, ATTR0_SQUARE, ATTR1_SIZE_32x32, 1); load_sprite(cart_label, &Label_GreenTiles[8], Label_GreenTilesLen - 32, curr_tile_id, GB_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(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(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); load_sprite(up_arrow, &arrowsTiles[16], 64, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_16x8, 1);
load_sprite(link_frame1, link_frame1Tiles, link_frame1TilesLen, curr_tile_id, LINK_CABLE_PAL, ATTR0_SQUARE, ATTR1_SIZE_32x32, 1);
load_sprite(link_frame2, link_frame2Tiles, link_frame2TilesLen, curr_tile_id, LINK_CABLE_PAL, ATTR0_WIDE, ATTR1_SIZE_8x32, 1);
load_sprite(link_frame3, link_frame3Tiles, link_frame3TilesLen, curr_tile_id, LINK_CABLE_PAL, ATTR0_WIDE, ATTR1_SIZE_16x32, 1);
load_sprite(link_blob1, &link_blobsTiles[0], 32, curr_tile_id, LINK_CABLE_PAL, ATTR0_SQUARE, ATTR1_SIZE_8x8, 1);
load_sprite(link_blob2, &link_blobsTiles[8], 32, curr_tile_id, LINK_CABLE_PAL, ATTR0_SQUARE, ATTR1_SIZE_8x8, 1);
load_sprite(link_blob3, &link_blobsTiles[16], 32, curr_tile_id, LINK_CABLE_PAL, ATTR0_SQUARE, ATTR1_SIZE_8x8, 1);
global_tile_id_end = curr_tile_id;
obj_set_pos(down_arrow, 14 * 8, 17 * 8); obj_set_pos(down_arrow, 14 * 8, 17 * 8);
obj_set_pos(up_arrow, 14 * 8, 3 * 8); obj_set_pos(up_arrow, 14 * 8, 3 * 8);
global_tile_id_end = curr_tile_id;
} }
void load_temp_box_sprites(Pokemon_Party party_data) void load_temp_box_sprites(Pokemon_Party party_data)
@ -296,16 +317,23 @@ void load_temp_box_sprites(Pokemon_Party party_data)
{ {
if (party_data.get_simple_pkmn(i).is_valid || SHOW_INVALID_PKMN) if (party_data.get_simple_pkmn(i).is_valid || SHOW_INVALID_PKMN)
{ {
load_sprite(party_sprites[i], &duel_frame_menu_spritesTiles[(MENU_SPRITES[party_data.get_simple_pkmn(i).dex_number] - 1) * 32], 256, curr_tile_id, MENU_SPRITE_PAL, ATTR0_SQUARE, ATTR1_SIZE_16x16, 1); Simplified_Pokemon curr_pkmn = party_data.get_simple_pkmn(i);
int dex_num = curr_pkmn.dex_number;
if (dex_num == 201)
{
dex_num = 252 + curr_pkmn.unown_letter;
}
load_sprite(party_sprites[i], &unique_duel_frame_menu_spritesTiles[dex_num * 32], 256, curr_tile_id, MENU_SPRITE_PALS[dex_num][curr_pkmn.is_shiny] + MENU_PAL_START, ATTR0_SQUARE, ATTR1_SIZE_16x16, 1);
obj_set_pos(party_sprites[i], (16 * (i % 10)) + 40, (16 * (i / 10)) + 24); obj_set_pos(party_sprites[i], (16 * (i % 10)) + 40, (16 * (i / 10)) + 24);
obj_unhide(party_sprites[i], 0);
} }
curr_tile_id += 4; curr_tile_id += 4;
} }
load_sprite(box_select, box_selectTiles, box_selectTilesLen, curr_tile_id, BTN_PAL, ATTR0_SQUARE, ATTR1_SIZE_16x16, 0); load_sprite(box_select, box_selectTiles, box_selectTilesLen, curr_tile_id, BTN_PAL, ATTR0_SQUARE, ATTR1_SIZE_16x16, 0);
load_sprite(button_cancel_left, button_cancel_leftTiles, button_cancel_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); load_sprite(button_cancel_left, button_cancel_leftTiles, button_cancel_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_cancel_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); load_sprite(button_cancel_right, button_edgeTiles, button_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1);
load_sprite(button_confirm_left, button_confirm_leftTiles, button_confirm_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); load_sprite(button_confirm_left, button_confirm_leftTiles, button_confirm_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_confirm_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1); load_sprite(button_confirm_right, button_edgeTiles, button_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1);
} }
void load_type_sprites(int pkmn_index, int dex_offset, bool is_caught) void load_type_sprites(int pkmn_index, int dex_offset, bool is_caught)
@ -345,18 +373,19 @@ void load_sprite(OBJ_ATTR *sprite, const unsigned int objTiles[], int objTilesLe
obj_hide(sprite); obj_hide(sprite);
}; };
void load_cart(int game_id, int lang) void load_select_sprites(int game_id, int lang)
{ {
u32 curr_tile_id = global_tile_id_end;
// Alpha Shadow Main Color Grey Black Mid // 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 jpn_gb_pal[6] = {RGB15(0, 0, 0), RGB15(10, 9, 10), RGB15(17, 17, 17), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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_red_pal[6] = {RGB15(0, 0, 0), RGB15(16, 1, 0), RGB15(27, 6, 5), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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_blue_pal[6] = {RGB15(0, 0, 0), RGB15(0, 4, 16), RGB15(5, 10, 24), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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_yellow_pal[6] = {RGB15(0, 0, 0), RGB15(18, 12, 0), RGB15(27, 21, 5), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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_gold_pal[6] = {RGB15(0, 0, 0), RGB15(13, 10, 2), RGB15(22, 18, 8), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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 eng_silver_pal[6] = {RGB15(0, 0, 0), RGB15(11, 12, 14), RGB15(20, 22, 23), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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 crystal_pal[6] = {RGB15(0, 0, 0), RGB15(9, 13, 17), RGB15(16, 21, 25), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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_gold_pal[6] = {RGB15(0, 0, 0), RGB15(0, 0, 0), RGB15(5, 7, 12), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(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 short jpn_silver_pal[6] = {RGB15(0, 0, 0), RGB15(5, 4, 5), RGB15(11, 10, 10), RGB15(22, 22, 22), RGB15(0, 0, 0), RGB15(8, 7, 7)};
const unsigned int *label_tiles = 0; const unsigned int *label_tiles = 0;
const unsigned short *label_palette = 0; const unsigned short *label_palette = 0;
@ -460,26 +489,17 @@ void load_cart(int game_id, int lang)
cart_palette = crystal_pal; cart_palette = crystal_pal;
break; break;
} }
u32 curr_tile_id = global_tile_id_end;
memcpy(pal_obj_mem + (CART_PAL * 16), cart_palette, 12); memcpy(pal_obj_mem + (GB_CART_PAL * 16), cart_palette, 12);
memcpy(pal_obj_mem + (CART_PAL * 16) + 6, label_palette + 6, 20); memcpy(pal_obj_mem + (GB_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_shell, cart_tiles, GB_ShellTilesLen, curr_tile_id, GB_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); load_sprite(cart_label, &label_tiles[8], Label_GreenTilesLen - 32, curr_tile_id, GB_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_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_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 int *flag_tiles = 0;
const unsigned short *flag_palette = 0; const unsigned short *flag_palette = 0;
switch (lang_id) switch (lang)
{ {
case JPN_ID: case JPN_ID:
flag_tiles = flag_jpnTiles; flag_tiles = flag_jpnTiles;
@ -513,7 +533,133 @@ void load_flag(int lang_id)
load_sprite(flag, flag_tiles, flag_jpnTilesLen, curr_tile_id, FLAG_PAL, ATTR0_WIDE, ATTR1_SIZE_32x64, 1); 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. 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_set_pos(flag, (8 * 12) + 4, (8 * 4) + 19 + y_offset);
obj_unhide(flag, 0);
const unsigned int *gba_cart_tiles = 0;
const unsigned short *gba_cart_palette = 0;
switch (curr_rom.gamecode)
{
case RUBY_ID:
gba_cart_tiles = ruby_cartTiles;
gba_cart_palette = ruby_cartPal;
break;
case SAPPHIRE_ID:
gba_cart_tiles = sapphire_cartTiles;
gba_cart_palette = sapphire_cartPal;
break;
case FIRERED_ID:
gba_cart_tiles = fr_cartTiles;
gba_cart_palette = fr_cartPal;
break;
case LEAFGREEN_ID:
gba_cart_tiles = lg_cartTiles;
gba_cart_palette = lg_cartPal;
break;
case EMERALD_ID:
gba_cart_tiles = lg_cartTiles;
gba_cart_palette = lg_cartPal;
break;
}
load_sprite(gba_cart, gba_cart_tiles, 1024, curr_tile_id, GBA_CART_PAL, ATTR0_WIDE, ATTR1_SIZE_32x64, 1);
memcpy(pal_obj_mem + (GBA_CART_PAL * 16), gba_cart_palette, 32);
}
// tile ID, VH Flip, Palette Bank
#define FEN_BLI_L00 (34 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_L01 (35 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_L10 (140 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_L11 (141 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_L20 (143 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_L21 (144 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_R0 (37 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_R1 (142 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_BLI_R2 (145 | (0b00 << 0xA) | (2 << 0xC))
void fennel_blink(int frame)
{
int SBB = 15; // SSB is the array of which tile goes where
switch (frame)
{
case 0:
se_mem[SBB][12 + (5 * 32)] = FEN_BLI_L20;
se_mem[SBB][13 + (5 * 32)] = FEN_BLI_L21;
se_mem[SBB][15 + (5 * 32)] = FEN_BLI_R2;
break;
case 1:
case 3:
se_mem[SBB][12 + (5 * 32)] = FEN_BLI_L10;
se_mem[SBB][13 + (5 * 32)] = FEN_BLI_L11;
se_mem[SBB][15 + (5 * 32)] = FEN_BLI_R1;
break;
case 2:
se_mem[SBB][12 + (5 * 32)] = FEN_BLI_L00;
se_mem[SBB][13 + (5 * 32)] = FEN_BLI_L01;
se_mem[SBB][15 + (5 * 32)] = FEN_BLI_R0;
break;
}
}
// tile ID, VH Flip, Palette Bank
#define FEN_SPE_00 (46 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_01 (56 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_10 (146 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_11 (56 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_20 (147 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_21 (149 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_30 (148 | (0b00 << 0xA) | (2 << 0xC))
#define FEN_SPE_31 (150 | (0b00 << 0xA) | (2 << 0xC))
void fennel_speak(int frame)
{
int SBB = 15; // SSB is the array of which tile goes where
switch (frame)
{
case 0:
se_mem[SBB][14 + (6 * 32)] = FEN_SPE_00;
se_mem[SBB][14 + (7 * 32)] = FEN_SPE_01;
break;
case 1:
se_mem[SBB][14 + (6 * 32)] = FEN_SPE_10;
se_mem[SBB][14 + (7 * 32)] = FEN_SPE_11;
break;
case 2:
case 4:
se_mem[SBB][14 + (6 * 32)] = FEN_SPE_20;
se_mem[SBB][14 + (7 * 32)] = FEN_SPE_21;
break;
case 3:
se_mem[SBB][14 + (6 * 32)] = FEN_SPE_30;
se_mem[SBB][14 + (7 * 32)] = FEN_SPE_31;
break;
}
}
int get_curr_flex_background()
{
return curr_flex_background;
}
void update_y_offset()
{
if (y_offset_timer == 0)
{
y_offset += y_offset_direction;
if (y_offset == 6 || y_offset == 2)
{
y_offset_timer = 6;
}
else
{
y_offset_timer = 4;
}
}
if (y_offset == 8 || y_offset == 0)
{
y_offset_direction *= -1;
y_offset += y_offset_direction;
y_offset_timer = 12;
}
y_offset_timer--;
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_set_pos(flag, (8 * 12) + 4, (8 * 4) + 19 + y_offset);
} }

View File

@ -7,7 +7,8 @@
#include "pkmn_font.h" #include "pkmn_font.h"
#include "script_array.h" #include "script_array.h"
#include "debug_mode.h" #include "debug_mode.h"
#include "main_menu.h" #include "button_menu.h"
#include "sprite_data.h"
#define TEXT_CBB 3 #define TEXT_CBB 3
#define TEXT_SBB 28 #define TEXT_SBB 28
@ -26,8 +27,7 @@ void init_text_engine()
tte_set_pos(LEFT, TOP); tte_set_pos(LEFT, TOP);
pal_bg_bank[13][15] = CLR_WHITE; pal_bg_bank[13][15] = CLR_WHITE;
pal_bg_bank[14][15] = 0b0000001001111111; pal_bg_bank[15][15] = 0b0000110001100010;
pal_bg_bank[15][15] = 0b0001100011100110;
// Set default variables // Set default variables
char_index = 0; char_index = 0;
@ -71,6 +71,10 @@ int text_loop(int script)
} }
tte_erase_rect(LEFT, TOP, RIGHT, BOTTOM); tte_erase_rect(LEFT, TOP, RIGHT, BOTTOM);
tte_write(curr_text.substr(0, char_index).c_str()); tte_write(curr_text.substr(0, char_index).c_str());
if (get_curr_flex_background() == BG_FENNEL)
{
fennel_speak(((char_index / 4) % 4) + 1);
}
} }
} }
else else
@ -99,6 +103,10 @@ int text_loop(int script)
} }
char_index = 0; char_index = 0;
} }
if (get_curr_flex_background() == BG_FENNEL)
{
fennel_speak(0);
}
} }
if (text_exit) if (text_exit)
{ {

View File

@ -1 +1 @@
nm --size-sort Poke_Transporter_GB_mb.elf > Poke_Transporter_GB_mb.sym objdump -t Poke_Transporter_GB_mb.elf > Poke_Transporter_GB_mb.sym