Updating DreamDex

This commit is contained in:
The Gears of Progress 2024-06-28 16:24:01 -04:00
parent a8a8edefb3
commit 290fdf22a4
25 changed files with 526 additions and 544 deletions

File diff suppressed because it is too large Load Diff

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

View File

@ -6,8 +6,9 @@
class Button
{
public:
Button();
Button(OBJ_ATTR *L, OBJ_ATTR *R, int nLeft_button_width); // wide buttons
Button(OBJ_ATTR *B); // short button
Button(OBJ_ATTR *B); // short button
bool isWide;
void set_location(int x, int y);
void set_highlight(bool highlight);

View File

@ -10,8 +10,8 @@
#define DONT_REMOVE_PKMN false
#define SHOW_INVALID_PKMN false
#define DEBUG_GAME RUBY_ID
#define DEBUG_VERS VERS_1_1
#define DEBUG_GAME EMERALD_ID
#define DEBUG_VERS VERS_1_0
#define DEBUG_LANG LANG_ENG
#define ENABLE_MATCH_PID true

View File

@ -8,7 +8,7 @@ typedef unsigned int u32, word, uint, eint;
typedef unsigned long long u64;
#define PAYLOAD_SIZE 672
#define NUM_PAYLOADS 5
#define NUM_GB_ROMS 5
#define GB_TILE_WIDTH 20

View File

@ -9,7 +9,7 @@
#define BTN_MAIN_MENU 0
#define BTN_TRANSFER 1
#define BTN_POKEDEX 2
#define BTN_LANGUAGE 3
#define BTN_EVENTS 3
#define BTN_CREDITS 4
#define BUTTON_CANCEL -1

View File

@ -17,7 +17,7 @@ public:
void set_game(int nGame);
void set_lang(int nLang);
int get_lang();
bool load_payload();
bool load_gb_rom();
GB_ROM curr_gb_rom;
void show_sprites();
Simplified_Pokemon simple_pkmn_array[30];
@ -26,7 +26,7 @@ public:
bool get_contains_mythical();
void set_mythic_stabilization(bool stabilize);
bool contains_valid = false;
int get_game_gen();
private:
byte box_data_array[0x462];

View File

@ -29,4 +29,5 @@ int get_def_lang_num();
bool get_tutorial_flag();
void set_tutorial_flag(bool value);
void initalize_save_data();
int get_dex_completion(int gen, bool include_mythicals);
#endif

View File

@ -30,37 +30,42 @@
#define DIA_MG_OTHER_EVENT 21
#define DIA_PKMN_TO_COLLECT 22
#define DIA_NO_VALID_PKMN 23
#define DIA_WHAT_GAME 24
#define DIA_WHAT_LANG 25
#define DIA_WHAT_GAME_TRANS 24
#define DIA_WHAT_LANG_TRANS 25
#define DIA_ASK_QUEST 26
#define DIA_NO_PAYLOAD 27
#define DIA_NO_GB_ROM 27
#define DIA_IN_BOX 28
#define DIA_MYTHIC_CONVERT 29
#define DIA_CANCEL 30
#define DIA_WHAT_LANG_EVENT 31
#define DIA_WHAT_GAME_EVENT 32
#define DIA_K_DEX_NOT_FULL 33
#define DIA_J_DEX_NOT_FULL 34
#define DIA_SIZE 31
#define DIA_SIZE 35
#define DIA_END DIA_SIZE
// Commands
#define SCRIPT_START DIA_END + 0
#define CMD_START_LINK DIA_END + 1
#define CMD_IMPORT_POKEMON DIA_END + 2 // This one is special because it can be true or false
#define CMD_BACK_TO_MENU DIA_END + 3
#define CMD_SHOW_PROF DIA_END + 4
#define CMD_HIDE_PROF DIA_END + 5
#define CMD_SET_TUTOR_TRUE DIA_END + 6
#define CMD_END_SCRIPT DIA_END + 7
#define CMD_GAME_MENU DIA_END + 8
#define CMD_LANG_MENU DIA_END + 9
#define CMD_SLIDE_PROF_LEFT DIA_END + 10
#define CMD_SLIDE_PROF_RIGHT DIA_END + 11
#define CMD_CONTINUE_LINK DIA_END + 12
#define CMD_BOX_MENU DIA_END + 13
#define CMD_MYTHIC_MENU DIA_END + 14
#define CMD_LOAD_SIMP DIA_END + 15
#define CMD_CANCEL_LINK DIA_END + 16
#define T_SCRIPT_START DIA_END + 0
#define E_SCRIPT_START DIA_END + 1
#define CMD_START_LINK DIA_END + 2
#define CMD_IMPORT_POKEMON DIA_END + 3 // This one is special because it can be true or false
#define CMD_BACK_TO_MENU DIA_END + 4
#define CMD_SHOW_PROF DIA_END + 5
#define CMD_HIDE_PROF DIA_END + 6
#define CMD_SET_TUTOR_TRUE DIA_END + 7
#define CMD_END_SCRIPT DIA_END + 8
#define CMD_GAME_MENU DIA_END + 9
#define CMD_LANG_MENU DIA_END + 10
#define CMD_SLIDE_PROF_LEFT DIA_END + 11
#define CMD_SLIDE_PROF_RIGHT DIA_END + 12
#define CMD_CONTINUE_LINK DIA_END + 13
#define CMD_BOX_MENU DIA_END + 14
#define CMD_MYTHIC_MENU DIA_END + 15
#define CMD_LOAD_SIMP DIA_END + 16
#define CMD_CANCEL_LINK DIA_END + 17
#define CMD_SIZE 17
#define CMD_SIZE 18
#define CMDS_END DIA_END + CMD_SIZE
// Conditionals
@ -77,17 +82,20 @@
#define COND_IS_FRLGE CMDS_END + 10
#define COND_MG_OTHER_EVENT CMDS_END + 11
#define COND_PKMN_TO_COLLECT CMDS_END + 12
#define COND_PAYLOAD_EXISTS CMDS_END + 13
#define COND_GB_ROM_EXISTS CMDS_END + 13
#define COND_CHECK_MYTHIC CMDS_END + 14
#define COND_CHECK_DEX CMDS_END + 15
#define COND_CHECK_KANTO CMDS_END + 16
#define COND_SIZE 15
#define COND_SIZE 17
#define COND_END CMDS_END + COND_SIZE
// Ends
#define SCRIPT_SIZE COND_END
extern script_obj script[];
extern script_obj transfer_script[];
extern script_obj event_script[];
extern rom_data curr_rom;
void populate_script();

View File

@ -10,8 +10,8 @@ extern OBJ_ATTR obj_buffer[128];
extern OBJ_AFFINE *obj_aff_buffer;
extern int num_sprites;
#include "metr.h"
extern OBJ_ATTR *testroid;
//#include "metr.h"
//extern OBJ_ATTR *testroid;
#include "prof.h"
extern OBJ_ATTR *prof;
#include "btn_t_l.h"
@ -34,6 +34,11 @@ extern OBJ_ATTR *btn_d_r;
extern OBJ_ATTR *button_yes;
#include "button_no.h"
extern OBJ_ATTR *button_no;
#include "button_blank_left.h"
extern OBJ_ATTR *button_blank_left;
extern OBJ_ATTR *button_blank_right;
extern OBJ_ATTR *button_blank_left_2;
extern OBJ_ATTR *button_blank_right_2;
#define SPRITE_BATCH_DEX 0
#include "dex_l.h"

View File

@ -15,7 +15,7 @@
#define BOTTOM V_MAX
void init_text_engine();
int text_loop();
int text_loop(int script);
int text_next_obj_id(script_obj current_line);
void show_text_box();
void hide_text_box();

View File

@ -1,5 +1,9 @@
#include "button_handler.h"
Button::Button(){
}
Button::Button(OBJ_ATTR *L, OBJ_ATTR *R, int nLeft_button_width)
{
button_L = L;

View File

@ -34,7 +34,7 @@ void global_next_frame()
tte_set_margins(40, 24, 206, 104);
set_textbox_large();
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);
while(true){};
}

View File

@ -102,7 +102,7 @@ void load_graphics()
main_menu.clear_vector();
main_menu.add_button(Button(btn_t_l, btn_t_r, 48), BTN_TRANSFER);
main_menu.add_button(Button(btn_p_l, btn_p_r, 48), BTN_POKEDEX);
// main_menu.add_button(Button(btn_d_l, btn_d_r), BTN_LANGUAGE);
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);
@ -208,7 +208,7 @@ int credits()
set_textbox_large();
tte_write(credits_array[curr_credits_num].c_str());
if (key_hit(KEY_B))
{
{
hide_text_box();
set_textbox_small();
return 0;
@ -293,7 +293,7 @@ int main(void)
{
case (BTN_TRANSFER):
obj_hide_multi(ptgb_logo_l, 2);
text_loop();
text_loop(BTN_TRANSFER);
break;
case (BTN_POKEDEX):
obj_hide_multi(ptgb_logo_l, 2);
@ -306,6 +306,10 @@ int main(void)
obj_set_pos(ptgb_logo_r, 56 + 64, 108);
credits();
break;
case (BTN_EVENTS):
obj_hide_multi(ptgb_logo_l, 2);
text_loop(BTN_EVENTS);
break;
default:
global_next_frame();
}

View File

@ -34,8 +34,8 @@ int Button_Menu::button_main()
organize_buttons();
show_buttons();
button_vector.at(curr_position).set_highlight(true);
int curr_x;
int curr_y;
int curr_x = 0;
int curr_y = 0;
key_poll(); // Reset the buttons

View File

@ -8,14 +8,24 @@
#include "pokemon_data.h"
#include "global_frame_controller.h"
#include "save_data_manager.h"
#include "button_handler.h"
Dex dex_array[DEX_MAX];
int dex_shift = 0;
int dex_x_cord = 48;
int dex_x_cord = 8;
int speed = 0;
int delay = 0;
int count = 0;
int leading_zeros = 0;
Button kanto_count;
Button johto_count;
int kanto_dex_num;
int johto_dex_num;
int kanto_offset;
int johto_offset;
bool mew_caught;
bool celebi_caught;
bool missingno_caught = false;
void pokedex_init()
{
@ -24,6 +34,36 @@ void pokedex_init()
dex_array[i] = Dex(dex_sprites[DEX_SPRITE_LEFT][i], dex_sprites[DEX_SPRITE_MID][i], dex_sprites[DEX_SPRITE_RIGHT][i]);
dex_array[i].set_location(dex_x_cord, (i * (8 * 3)) + 8);
}
kanto_count = Button(button_blank_left, button_blank_right, 64);
johto_count = Button(button_blank_left_2, button_blank_right_2, 64);
kanto_dex_num = get_dex_completion(1, true);
johto_dex_num = get_dex_completion(2, true);
if (kanto_dex_num >= 100)
{
kanto_offset = 0;
}
else if (kanto_dex_num >= 10)
{
kanto_offset = 1;
}
else
{
kanto_offset = 2;
}
if (johto_dex_num >= 100)
{
johto_offset = 0;
}
else if (johto_dex_num >= 10)
{
johto_offset = 1;
}
else
{
johto_offset = 2;
}
mew_caught = is_caught(151);
celebi_caught = is_caught(251);
}
int pokedex_loop()
@ -31,11 +71,13 @@ int pokedex_loop()
load_temp_sprites(SPRITE_BATCH_DEX);
pokedex_init();
pokedex_show();
// TODO: For some reason there is screen tearing here. Probably not noticable on console,
// TODO: For some reason there is screen tearing here. Probably not noticable on console,
// but it should be removed at some point
while (true)
{
if (key_hit(KEY_B)){
if (key_hit(KEY_B))
{
pokedex_hide();
return 0;
}
@ -73,29 +115,33 @@ int pokedex_loop()
count = 0;
}
if (dex_shift > DEX_SHIFT_MAX)
if (dex_shift > DEX_SHIFT_MAX - !celebi_caught)
{
dex_shift = DEX_SHIFT_MAX;
dex_shift = DEX_SHIFT_MAX - !celebi_caught;
}
else if (dex_shift < 0)
else if (dex_shift < 0 - missingno_caught)
{
dex_shift = 0;
dex_shift = 0 - missingno_caught;
}
tte_erase_rect(0, 0, 240, 160);
int mythic_skip = 0;
for (int i = 0; i < DEX_MAX; i++)
{
if (dex_shift + i + 1 == 151 && !mew_caught){
mythic_skip++;
}
tte_set_pos(dex_x_cord + (1 * 8), (i * 8 * 3) + 16);
tte_write(is_caught(dex_shift + i + 1) ? "^" : " ");
tte_write(is_caught(dex_shift + i + 1 + mythic_skip) ? "^" : " ");
tte_set_pos(dex_x_cord + (3 * 8), (i * 8 * 3) + 16);
tte_write(is_caught(dex_shift + i + 1) ? std::string(NAMES[dex_shift + i + 1]).data() : "----------");
tte_write(is_caught(dex_shift + i + 1 + mythic_skip) ? std::string(NAMES[dex_shift + i + 1]).data() : "----------");
tte_set_pos(dex_x_cord + (14 * 8), (i * 8 * 3) + 16);
tte_write("000");
if (dex_shift + i + 1 < 10)
if (dex_shift + i + 1 + mythic_skip < 10)
{
leading_zeros = 2;
}
else if (dex_shift + i + 1 < 100)
else if (dex_shift + i + 1 + mythic_skip < 100)
{
leading_zeros = 1;
}
@ -104,8 +150,22 @@ int pokedex_loop()
leading_zeros = 0;
}
tte_set_pos(dex_x_cord + ((14 + leading_zeros) * 8), (i * 8 * 3) + 16);
tte_write(std::to_string(dex_shift + i + 1).c_str());
tte_write(std::to_string(dex_shift + i + 1 + mythic_skip).c_str());
}
tte_set_pos(176, 48);
tte_write("KANTO");
tte_set_pos(168 + (8 * kanto_offset), 56);
tte_write(std::to_string(kanto_dex_num).c_str());
tte_write("/");
tte_write(mew_caught ? "151" : "150");
tte_set_pos(176, 96);
tte_write("JOHTO");
tte_set_pos(168 + (8 * johto_offset), 104);
tte_write(std::to_string(johto_dex_num).c_str());
tte_write("/");
tte_write(celebi_caught ? "100" : "99");
global_next_frame();
}
}
@ -116,6 +176,10 @@ void pokedex_show()
{
dex_array[i].show();
}
kanto_count.set_location(160, 40);
johto_count.set_location(160, 88);
kanto_count.show();
johto_count.show();
}
void pokedex_hide()
@ -125,4 +189,6 @@ void pokedex_hide()
tte_erase_rect(0, 0, 240, 160);
dex_array[i].hide();
}
kanto_count.hide();
johto_count.hide();
}

View File

@ -4114,7 +4114,7 @@ const byte FIRST_MOVES[252] = {
0x49, // Celebi (leech-seed)
};
const std::string_view NAMES[252]{
"", // Offset the list to remove "off by one" errors
"MissingNo", // Offset the list to remove "off by one" errors
"Bulbasaur",
"Ivysaur",
"Venusaur",

View File

@ -9,7 +9,7 @@
#include "box_menu.h"
#include "payload_builder.h"
const GB_ROM *list_of_gb_roms[NUM_PAYLOADS] = {
const GB_ROM *list_of_gb_roms[NUM_GB_ROMS] = {
&ENG_RED_BLUE,
&ENG_YELLOW,
&ENG_GOLD,
@ -223,6 +223,23 @@ void Pokemon_Party::set_game(int nGame)
game = nGame;
}
int Pokemon_Party::get_game_gen()
{
switch(game){
case GREEN_ID:
case RED_ID:
case BLUE_ID:
case YELLOW_ID:
return 1;
case GOLD_ID:
case SILVER_ID:
case CRYSTAL_ID:
default:
return 2;
}
}
void Pokemon_Party::set_lang(int nLang)
{
lang = nLang;
@ -232,8 +249,8 @@ int Pokemon_Party::get_lang(){
return lang;
}
bool Pokemon_Party::load_payload(){
for (int i = 0; i < NUM_PAYLOADS; i++)
bool Pokemon_Party::load_gb_rom(){
for (int i = 0; i < NUM_GB_ROMS; i++)
{
if (lang == list_of_gb_roms[i]->language &&
game == list_of_gb_roms[i]->version)
@ -245,6 +262,7 @@ bool Pokemon_Party::load_payload(){
return false;
}
Simplified_Pokemon Pokemon_Party::get_simple_pkmn(int index){
return simple_pkmn_array[index];
}

View File

@ -67,4 +67,16 @@ void initalize_save_data()
save_data_array[i] = 0;
}
write_custom_save_data();
}
int get_dex_completion(int gen, bool include_mythicals){
int num = (gen == 1 ? 151 : 100);
int offset = (gen == 1 ? 1 : 152);
int count = 0;
for (int i = 0; i < num; i++){
if (is_caught(i)){
count++;
}
}
return count;
}

View File

@ -20,7 +20,8 @@ Button_Menu game_select_jpn(3, 2, 72, 32, true);
Button_Menu game_select_kor(1, 1, 72, 32, true);
Box_Menu box_viewer;
script_obj script[SCRIPT_SIZE];
script_obj transfer_script[SCRIPT_SIZE];
script_obj event_script[SCRIPT_SIZE];
std::string_view dialogue[DIA_SIZE];
void populate_dialogue()
@ -42,9 +43,9 @@ void populate_dialogue()
dialogue[DIA_PKMN_TO_COLLECT] = "Hi Trainer! It looks like\nyou still have Pok@mon to\npick up...|I can't send over new\nPok@mon until you pick those\nup.|Come back after you've\nreceived them!";
dialogue[DIA_NO_VALID_PKMN] = "Sorry Trainer, it doesn't\nlook like you have any valid\nPok@mon in your current box\nright now.|Go double check your current\nbox and we can give it\nanother shot!";
dialogue[DIA_ASK_QUEST] = "Hi trainer! Before we begin,\nI need to ask you a few\nquestions.";
dialogue[DIA_WHAT_GAME] = "And which Game Boy Pok@mon\ngame are you transferring\nfrom?";
dialogue[DIA_WHAT_LANG] = "What language is the Game\nBoy Pok@mon game that you're\ntransferring from?";
dialogue[DIA_NO_PAYLOAD] = "I'm sorry, but that version\nin that language is not\ncurrently supported.";
dialogue[DIA_WHAT_GAME_TRANS] = "And which Game Boy Pok@mon\ngame are you transferring\nfrom?";
dialogue[DIA_WHAT_LANG_TRANS] = "What language is the Game\nBoy Pok@mon game that you're\ntransferring from?";
dialogue[DIA_NO_GB_ROM] = "I'm sorry, but that version\nin that language is not\ncurrently supported.";
dialogue[DIA_IN_BOX] = "Great! Let's take a look at\nthe Pok@mon that will be\ntransfered.|Please remember, once a\nPok@mon is transfered, it\nCANNOT be returned to the\nGame Boy Game Pak.|Select confirm once you're\nready, or select cancel if\nyou want to keep the Pok@mon\non your Game Boy Game Pak.";
dialogue[DIA_MYTHIC_CONVERT] = "It looks like you have a\nrare Mythical Pok@mon!|Due to their rarity, it\nseems they've corrupted the\nmachine.|I can stablize them if you'd\nlike, but it'll change some\nthings like name, Original\nTrainer, and Shininess.|Otherwise I can leave them\nas is, but there's no\nguarentee that they'll be\ntransferrable in the future.|Do you want me to stablize\nthem?";
dialogue[DIA_CANCEL] = "No worries! Feel free to\ncome back if you change your\nmind!|See you around!";
@ -54,78 +55,110 @@ void populate_dialogue()
dialogue[DIA_ERROR_DISCONNECT] = "It looks like the Game Boy\nColor link cable was\ndisconnected...|Let's try that again!";
dialogue[DIA_ERROR_TIME_ONE] = "It looks like the connection\ntimed out...|Let's try that again!";
dialogue[DIA_ERROR_TIME_TWO] = "It seems like the connection\ntimed out...|Let's try that again!";
dialogue[DIA_WHAT_LANG_EVENT] = "What language is the Game\nBoy Pok@mon game that you\nwant to send an event to?";
dialogue[DIA_WHAT_GAME_EVENT] = "And which Game Boy Pok@mon\ngame do you want to send an event to?";
dialogue[DIA_K_DEX_NOT_FULL] = "Sorry trainer, it looks like\nyou haven't caught all 150\nPok@mon from the Kanto\nregion yet.|Go out and catch them all\nand then we'll be able to\nsend over the event!";
dialogue[DIA_J_DEX_NOT_FULL] = "Sorry trainer, it looks like\nyou haven't caught all 99\nnew Pok@mon from the Johto\nregion yet.|Go out and catch them all\nand then we'll be able to\nsend over the event!";
}
void populate_script()
{
// -------- TRANSFER SCRIPT --------
// Check that the conditions are set for the transfer
script[SCRIPT_START] = script_obj(CMD_SHOW_PROF, COND_BEAT_E4);
script[COND_BEAT_E4] = script_obj(COND_BEAT_E4, COND_MG_ENABLED, DIA_E4);
script[DIA_E4] = script_obj(dialogue[DIA_E4], CMD_END_SCRIPT);
script[COND_MG_ENABLED] = script_obj(COND_MG_ENABLED, COND_TUTORIAL_COMPLETE, COND_IS_FRLGE);
script[COND_IS_FRLGE] = script_obj(COND_IS_FRLGE, DIA_MG_FRLGE, DIA_MG_RS);
script[DIA_MG_FRLGE] = script_obj(dialogue[DIA_MG_FRLGE], CMD_END_SCRIPT);
script[DIA_MG_RS] = script_obj(dialogue[DIA_MG_RS], CMD_END_SCRIPT);
script[COND_TUTORIAL_COMPLETE] = script_obj(COND_TUTORIAL_COMPLETE, COND_MG_OTHER_EVENT, DIA_OPEN);
script[DIA_OPEN] = script_obj(dialogue[DIA_OPEN], CMD_SET_TUTOR_TRUE);
script[CMD_SET_TUTOR_TRUE] = script_obj(CMD_SET_TUTOR_TRUE, CMD_END_SCRIPT);
script[COND_MG_OTHER_EVENT] = script_obj(COND_MG_OTHER_EVENT, DIA_MG_OTHER_EVENT, COND_PKMN_TO_COLLECT);
script[COND_PKMN_TO_COLLECT] = script_obj(COND_PKMN_TO_COLLECT, DIA_PKMN_TO_COLLECT, DIA_ASK_QUEST);
script[DIA_MG_OTHER_EVENT] = script_obj(dialogue[DIA_MG_OTHER_EVENT], DIA_ASK_QUEST);
script[DIA_PKMN_TO_COLLECT] = script_obj(dialogue[DIA_PKMN_TO_COLLECT], CMD_END_SCRIPT);
transfer_script[T_SCRIPT_START] = script_obj(CMD_SHOW_PROF, COND_BEAT_E4);
transfer_script[COND_BEAT_E4] = script_obj(COND_BEAT_E4, COND_MG_ENABLED, DIA_E4);
transfer_script[DIA_E4] = script_obj(dialogue[DIA_E4], CMD_END_SCRIPT);
transfer_script[COND_MG_ENABLED] = script_obj(COND_MG_ENABLED, COND_TUTORIAL_COMPLETE, COND_IS_FRLGE);
transfer_script[COND_IS_FRLGE] = script_obj(COND_IS_FRLGE, DIA_MG_FRLGE, DIA_MG_RS);
transfer_script[DIA_MG_FRLGE] = script_obj(dialogue[DIA_MG_FRLGE], CMD_END_SCRIPT);
transfer_script[DIA_MG_RS] = script_obj(dialogue[DIA_MG_RS], CMD_END_SCRIPT);
transfer_script[COND_TUTORIAL_COMPLETE] = script_obj(COND_TUTORIAL_COMPLETE, COND_MG_OTHER_EVENT, DIA_OPEN);
transfer_script[DIA_OPEN] = script_obj(dialogue[DIA_OPEN], CMD_SET_TUTOR_TRUE);
transfer_script[CMD_SET_TUTOR_TRUE] = script_obj(CMD_SET_TUTOR_TRUE, CMD_END_SCRIPT);
transfer_script[COND_MG_OTHER_EVENT] = script_obj(COND_MG_OTHER_EVENT, DIA_MG_OTHER_EVENT, COND_PKMN_TO_COLLECT);
transfer_script[COND_PKMN_TO_COLLECT] = script_obj(COND_PKMN_TO_COLLECT, DIA_PKMN_TO_COLLECT, DIA_ASK_QUEST);
transfer_script[DIA_MG_OTHER_EVENT] = script_obj(dialogue[DIA_MG_OTHER_EVENT], DIA_ASK_QUEST);
transfer_script[DIA_PKMN_TO_COLLECT] = script_obj(dialogue[DIA_PKMN_TO_COLLECT], CMD_END_SCRIPT);
// Ask the user what game and language they're using
script[DIA_WHAT_GAME] = script_obj(dialogue[DIA_WHAT_GAME], CMD_GAME_MENU);
script[CMD_GAME_MENU] = script_obj(CMD_GAME_MENU, COND_PAYLOAD_EXISTS, DIA_WHAT_LANG);
script[DIA_WHAT_LANG] = script_obj(dialogue[DIA_WHAT_LANG], CMD_LANG_MENU);
script[CMD_LANG_MENU] = script_obj(CMD_LANG_MENU, DIA_WHAT_GAME);
script[DIA_ASK_QUEST] = script_obj(dialogue[DIA_ASK_QUEST], CMD_SLIDE_PROF_LEFT);
script[CMD_SLIDE_PROF_LEFT] = script_obj(CMD_SLIDE_PROF_LEFT, DIA_WHAT_LANG);
script[CMD_SLIDE_PROF_RIGHT] = script_obj(CMD_SLIDE_PROF_RIGHT, DIA_LETS_START);
script[COND_PAYLOAD_EXISTS] = script_obj(COND_PAYLOAD_EXISTS, CMD_SLIDE_PROF_RIGHT, DIA_NO_PAYLOAD);
script[DIA_NO_PAYLOAD] = script_obj(dialogue[DIA_NO_PAYLOAD], DIA_WHAT_LANG);
transfer_script[DIA_WHAT_GAME_TRANS] = script_obj(dialogue[DIA_WHAT_GAME_TRANS], CMD_GAME_MENU);
transfer_script[CMD_GAME_MENU] = script_obj(CMD_GAME_MENU, COND_GB_ROM_EXISTS, DIA_WHAT_LANG_TRANS);
transfer_script[DIA_WHAT_LANG_TRANS] = script_obj(dialogue[DIA_WHAT_LANG_TRANS], CMD_LANG_MENU);
transfer_script[CMD_LANG_MENU] = script_obj(CMD_LANG_MENU, DIA_WHAT_GAME_TRANS);
transfer_script[DIA_ASK_QUEST] = script_obj(dialogue[DIA_ASK_QUEST], CMD_SLIDE_PROF_LEFT);
transfer_script[CMD_SLIDE_PROF_LEFT] = script_obj(CMD_SLIDE_PROF_LEFT, DIA_WHAT_LANG_TRANS);
transfer_script[CMD_SLIDE_PROF_RIGHT] = script_obj(CMD_SLIDE_PROF_RIGHT, DIA_LETS_START);
transfer_script[COND_GB_ROM_EXISTS] = script_obj(COND_GB_ROM_EXISTS, CMD_SLIDE_PROF_RIGHT, DIA_NO_GB_ROM);
transfer_script[DIA_NO_GB_ROM] = script_obj(dialogue[DIA_NO_GB_ROM], DIA_WHAT_LANG_TRANS);
// Initiate the transfer and check for errors
script[DIA_LETS_START] = script_obj(dialogue[DIA_LETS_START], DIA_START);
script[DIA_START] = script_obj(dialogue[DIA_START], CMD_START_LINK);
script[CMD_START_LINK] = script_obj(CMD_START_LINK, COND_ERROR_TIMEOUT_ONE);
script[COND_ERROR_TIMEOUT_ONE] = script_obj(COND_ERROR_TIMEOUT_ONE, COND_ERROR_TIMEOUT_TWO, DIA_ERROR_TIME_ONE);
script[DIA_ERROR_TIME_ONE] = script_obj(dialogue[DIA_ERROR_TIME_ONE], DIA_START);
script[COND_ERROR_TIMEOUT_TWO] = script_obj(COND_ERROR_TIMEOUT_TWO, COND_ERROR_COM_ENDED, DIA_ERROR_TIME_TWO);
script[DIA_ERROR_TIME_TWO] = script_obj(dialogue[DIA_ERROR_TIME_TWO], DIA_START);
script[COND_ERROR_COM_ENDED] = script_obj(COND_ERROR_COM_ENDED, COND_ERROR_COLOSSEUM, DIA_ERROR_COM_ENDED);
script[DIA_ERROR_COM_ENDED] = script_obj(dialogue[DIA_ERROR_COM_ENDED], DIA_START);
script[COND_ERROR_COLOSSEUM] = script_obj(COND_ERROR_COLOSSEUM, COND_ERROR_DISCONNECT, DIA_ERROR_COLOSSEUM);
script[DIA_ERROR_COLOSSEUM] = script_obj(dialogue[DIA_ERROR_COLOSSEUM], DIA_START);
script[COND_ERROR_DISCONNECT] = script_obj(COND_ERROR_DISCONNECT, CMD_LOAD_SIMP, DIA_ERROR_DISCONNECT);
script[DIA_ERROR_DISCONNECT] = script_obj(dialogue[DIA_ERROR_DISCONNECT], DIA_START);
transfer_script[DIA_LETS_START] = script_obj(dialogue[DIA_LETS_START], DIA_START);
transfer_script[DIA_START] = script_obj(dialogue[DIA_START], CMD_START_LINK);
transfer_script[CMD_START_LINK] = script_obj(CMD_START_LINK, COND_ERROR_TIMEOUT_ONE);
transfer_script[COND_ERROR_TIMEOUT_ONE] = script_obj(COND_ERROR_TIMEOUT_ONE, COND_ERROR_TIMEOUT_TWO, DIA_ERROR_TIME_ONE);
transfer_script[DIA_ERROR_TIME_ONE] = script_obj(dialogue[DIA_ERROR_TIME_ONE], DIA_START);
transfer_script[COND_ERROR_TIMEOUT_TWO] = script_obj(COND_ERROR_TIMEOUT_TWO, COND_ERROR_COM_ENDED, DIA_ERROR_TIME_TWO);
transfer_script[DIA_ERROR_TIME_TWO] = script_obj(dialogue[DIA_ERROR_TIME_TWO], DIA_START);
transfer_script[COND_ERROR_COM_ENDED] = script_obj(COND_ERROR_COM_ENDED, COND_ERROR_COLOSSEUM, DIA_ERROR_COM_ENDED);
transfer_script[DIA_ERROR_COM_ENDED] = script_obj(dialogue[DIA_ERROR_COM_ENDED], DIA_START);
transfer_script[COND_ERROR_COLOSSEUM] = script_obj(COND_ERROR_COLOSSEUM, COND_ERROR_DISCONNECT, DIA_ERROR_COLOSSEUM);
transfer_script[DIA_ERROR_COLOSSEUM] = script_obj(dialogue[DIA_ERROR_COLOSSEUM], DIA_START);
transfer_script[COND_ERROR_DISCONNECT] = script_obj(COND_ERROR_DISCONNECT, CMD_LOAD_SIMP, DIA_ERROR_DISCONNECT);
transfer_script[DIA_ERROR_DISCONNECT] = script_obj(dialogue[DIA_ERROR_DISCONNECT], DIA_START);
// Pause the transfer and show the user their box data
script[CMD_LOAD_SIMP] = script_obj(CMD_LOAD_SIMP, COND_CHECK_MYTHIC, DIA_NO_VALID_PKMN);
script[DIA_NO_VALID_PKMN] = script_obj(dialogue[DIA_NO_VALID_PKMN], CMD_CANCEL_LINK);
script[COND_CHECK_MYTHIC] = script_obj(COND_CHECK_MYTHIC, DIA_MYTHIC_CONVERT, DIA_IN_BOX);
script[DIA_MYTHIC_CONVERT] = script_obj(dialogue[DIA_MYTHIC_CONVERT], CMD_MYTHIC_MENU);
script[CMD_MYTHIC_MENU] = script_obj(CMD_MYTHIC_MENU, DIA_IN_BOX);
script[DIA_IN_BOX] = script_obj(dialogue[DIA_IN_BOX], CMD_BOX_MENU);
script[CMD_BOX_MENU] = script_obj(CMD_BOX_MENU, CMD_CONTINUE_LINK, DIA_CANCEL);
script[DIA_CANCEL] = script_obj(dialogue[DIA_CANCEL], CMD_CANCEL_LINK);
script[CMD_CONTINUE_LINK] = script_obj(CMD_CONTINUE_LINK, CMD_IMPORT_POKEMON);
script[CMD_CANCEL_LINK] = script_obj(CMD_CANCEL_LINK, CMD_END_SCRIPT);
transfer_script[CMD_LOAD_SIMP] = script_obj(CMD_LOAD_SIMP, COND_CHECK_MYTHIC, DIA_NO_VALID_PKMN);
transfer_script[DIA_NO_VALID_PKMN] = script_obj(dialogue[DIA_NO_VALID_PKMN], CMD_CANCEL_LINK);
transfer_script[COND_CHECK_MYTHIC] = script_obj(COND_CHECK_MYTHIC, DIA_MYTHIC_CONVERT, DIA_IN_BOX);
transfer_script[DIA_MYTHIC_CONVERT] = script_obj(dialogue[DIA_MYTHIC_CONVERT], CMD_MYTHIC_MENU);
transfer_script[CMD_MYTHIC_MENU] = script_obj(CMD_MYTHIC_MENU, DIA_IN_BOX);
transfer_script[DIA_IN_BOX] = script_obj(dialogue[DIA_IN_BOX], CMD_BOX_MENU);
transfer_script[CMD_BOX_MENU] = script_obj(CMD_BOX_MENU, CMD_CONTINUE_LINK, DIA_CANCEL);
transfer_script[DIA_CANCEL] = script_obj(dialogue[DIA_CANCEL], CMD_CANCEL_LINK);
transfer_script[CMD_CONTINUE_LINK] = script_obj(CMD_CONTINUE_LINK, CMD_IMPORT_POKEMON);
transfer_script[CMD_CANCEL_LINK] = script_obj(CMD_CANCEL_LINK, CMD_END_SCRIPT);
// Complete the transfer and give messages based on the transfered Pokemon
script[CMD_IMPORT_POKEMON] = script_obj(CMD_IMPORT_POKEMON, DIA_TRANS_GOOD);
script[DIA_TRANS_GOOD] = script_obj(dialogue[DIA_TRANS_GOOD], COND_NEW_POKEMON);
script[COND_NEW_POKEMON] = script_obj(COND_NEW_POKEMON, DIA_NEW_DEX, DIA_NO_NEW_DEX);
script[DIA_NEW_DEX] = script_obj(dialogue[DIA_NEW_DEX], COND_IS_HOENN);
script[DIA_NO_NEW_DEX] = script_obj(dialogue[DIA_NO_NEW_DEX], COND_IS_HOENN);
script[COND_IS_HOENN] = script_obj(COND_IS_HOENN, DIA_SEND_FRIEND_HOENN, DIA_SEND_FRIEND_KANTO);
script[DIA_SEND_FRIEND_HOENN] = script_obj(dialogue[DIA_SEND_FRIEND_HOENN], DIA_THANK);
script[DIA_SEND_FRIEND_KANTO] = script_obj(dialogue[DIA_SEND_FRIEND_KANTO], DIA_THANK);
script[DIA_THANK] = script_obj(dialogue[DIA_THANK], CMD_END_SCRIPT);
transfer_script[CMD_IMPORT_POKEMON] = script_obj(CMD_IMPORT_POKEMON, DIA_TRANS_GOOD);
transfer_script[DIA_TRANS_GOOD] = script_obj(dialogue[DIA_TRANS_GOOD], COND_NEW_POKEMON);
transfer_script[COND_NEW_POKEMON] = script_obj(COND_NEW_POKEMON, DIA_NEW_DEX, DIA_NO_NEW_DEX);
transfer_script[DIA_NEW_DEX] = script_obj(dialogue[DIA_NEW_DEX], COND_IS_HOENN);
transfer_script[DIA_NO_NEW_DEX] = script_obj(dialogue[DIA_NO_NEW_DEX], COND_IS_HOENN);
transfer_script[COND_IS_HOENN] = script_obj(COND_IS_HOENN, DIA_SEND_FRIEND_HOENN, DIA_SEND_FRIEND_KANTO);
transfer_script[DIA_SEND_FRIEND_HOENN] = script_obj(dialogue[DIA_SEND_FRIEND_HOENN], DIA_THANK);
transfer_script[DIA_SEND_FRIEND_KANTO] = script_obj(dialogue[DIA_SEND_FRIEND_KANTO], DIA_THANK);
transfer_script[DIA_THANK] = script_obj(dialogue[DIA_THANK], CMD_END_SCRIPT);
// Hide the dialouge and professor
script[CMD_END_SCRIPT] = script_obj(CMD_END_SCRIPT, CMD_BACK_TO_MENU);
script[CMD_BACK_TO_MENU] = script_obj(CMD_BACK_TO_MENU, SCRIPT_START);
transfer_script[CMD_END_SCRIPT] = script_obj(CMD_END_SCRIPT, CMD_BACK_TO_MENU);
transfer_script[CMD_BACK_TO_MENU] = script_obj(CMD_BACK_TO_MENU, T_SCRIPT_START);
// -------- EVENTS SCRIPT --------
// Start the dialogue and show the menu
event_script[E_SCRIPT_START] = script_obj(CMD_SHOW_PROF, DIA_ASK_QUEST);
event_script[DIA_ASK_QUEST] = script_obj(dialogue[DIA_ASK_QUEST], CMD_SLIDE_PROF_LEFT);
// Ask the user what game and language they're using
event_script[DIA_WHAT_GAME_EVENT] = script_obj(dialogue[DIA_WHAT_GAME_EVENT], CMD_GAME_MENU);
event_script[CMD_GAME_MENU] = script_obj(CMD_GAME_MENU, COND_GB_ROM_EXISTS, DIA_WHAT_LANG_EVENT);
event_script[DIA_WHAT_LANG_EVENT] = script_obj(dialogue[DIA_WHAT_LANG_EVENT], CMD_LANG_MENU);
event_script[CMD_LANG_MENU] = script_obj(CMD_LANG_MENU, DIA_WHAT_GAME_EVENT);
event_script[DIA_ASK_QUEST] = script_obj(dialogue[DIA_ASK_QUEST], CMD_SLIDE_PROF_LEFT);
event_script[CMD_SLIDE_PROF_LEFT] = script_obj(CMD_SLIDE_PROF_LEFT, DIA_WHAT_LANG_EVENT);
event_script[CMD_SLIDE_PROF_RIGHT] = script_obj(CMD_SLIDE_PROF_RIGHT, COND_CHECK_DEX);
event_script[COND_GB_ROM_EXISTS] = script_obj(COND_GB_ROM_EXISTS, CMD_SLIDE_PROF_RIGHT, DIA_NO_GB_ROM);
event_script[DIA_NO_GB_ROM] = script_obj(dialogue[DIA_NO_GB_ROM], DIA_WHAT_LANG_EVENT);
// Check the player's dex
event_script[COND_CHECK_DEX] = script_obj(COND_CHECK_DEX, 0, COND_CHECK_KANTO);
event_script[COND_CHECK_KANTO] = script_obj(COND_CHECK_KANTO, DIA_K_DEX_NOT_FULL, DIA_J_DEX_NOT_FULL);
event_script[DIA_K_DEX_NOT_FULL] = script_obj(dialogue[DIA_K_DEX_NOT_FULL], CMD_END_SCRIPT);
event_script[DIA_J_DEX_NOT_FULL] = script_obj(dialogue[DIA_J_DEX_NOT_FULL], CMD_END_SCRIPT);
// Hide the dialouge and professor
event_script[CMD_END_SCRIPT] = script_obj(CMD_END_SCRIPT, CMD_BACK_TO_MENU);
event_script[CMD_BACK_TO_MENU] = script_obj(CMD_BACK_TO_MENU, T_SCRIPT_START);
};
void populate_lang_buttons()
@ -217,12 +250,25 @@ bool run_conditional(int index)
case COND_PKMN_TO_COLLECT:
return compare_map_and_npc_data(curr_rom.map_bank, curr_rom.map_id, curr_rom.npc_id) && !read_flag(curr_rom.all_collected_flag) && !IGNORE_UNRECEIVED_PKMN;
case COND_PAYLOAD_EXISTS:
return party_data.load_payload();
case COND_GB_ROM_EXISTS:
return party_data.load_gb_rom();
case COND_CHECK_MYTHIC:
return party_data.get_contains_mythical();
case COND_CHECK_DEX:
if (party_data.get_game_gen() == 1)
{
return get_dex_completion(1, false) == 150;
}
else
{
return get_dex_completion(1, false) == 99;
}
case COND_CHECK_KANTO:
return party_data.get_game_gen() == 1;
case CMD_START_LINK:
obj_hide(prof);
party_data.start_link();
@ -319,7 +365,7 @@ bool run_conditional(int index)
case CMD_LOAD_SIMP:
return party_data.fill_simple_pkmn_array();
case CMD_CANCEL_LINK:
case CMD_CANCEL_LINK:
party_data.continue_link(true);
return true;

View File

@ -91,7 +91,7 @@ void load_textbox_background()
// SPRITES
int num_sprites = 0;
OBJ_ATTR *testroid = &obj_buffer[num_sprites++];
//OBJ_ATTR *testroid = &obj_buffer[num_sprites++];
OBJ_ATTR *prof = &obj_buffer[num_sprites++];
OBJ_ATTR *ptgb_logo_l = &obj_buffer[num_sprites++];
OBJ_ATTR *ptgb_logo_r = &obj_buffer[num_sprites++];
@ -106,6 +106,10 @@ OBJ_ATTR *btn_d_l = &obj_buffer[num_sprites++];
OBJ_ATTR *btn_d_r = &obj_buffer[num_sprites++];
OBJ_ATTR *button_yes = &obj_buffer[num_sprites++];
OBJ_ATTR *button_no = &obj_buffer[num_sprites++];
OBJ_ATTR *button_blank_left = &obj_buffer[num_sprites++];
OBJ_ATTR *button_blank_right = &obj_buffer[num_sprites++];
OBJ_ATTR *button_blank_left_2 = &obj_buffer[num_sprites++];
OBJ_ATTR *button_blank_right_2 = &obj_buffer[num_sprites++];
OBJ_ATTR *dex_sprites[3][6] = { // Fills the dex sprites top to bottom, left to right
{&obj_buffer[num_sprites++], &obj_buffer[num_sprites++], &obj_buffer[num_sprites++],
@ -182,14 +186,14 @@ u32 global_tile_id_end = 0;
void load_eternal_sprites()
{
memcpy(pal_obj_mem + (METR_PAL * 16), metrPal, metrPalLen);
//memcpy(pal_obj_mem + (METR_PAL * 16), metrPal, metrPalLen);
memcpy(pal_obj_mem + (PROF_PAL * 16), profPal, profPalLen);
memcpy(pal_obj_mem + (BTN_PAL * 16), btn_t_lPal, btn_t_lPalLen);
memcpy(pal_obj_mem + (BTN_LIT_PAL * 16), btn_t_rPal, btn_t_rPalLen);
memcpy(pal_obj_mem + (LOGO_PAL * 16), ptgb_logo_lPal, ptgb_logo_lPalLen);
u32 curr_tile_id = 0;
load_sprite(testroid, metrTiles, metrTilesLen, curr_tile_id, METR_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 0);
//load_sprite(testroid, metrTiles, metrTilesLen, curr_tile_id, METR_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 0);
load_sprite(prof, profTiles, profTilesLen, curr_tile_id, PROF_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 2);
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);
@ -203,6 +207,10 @@ void load_eternal_sprites()
load_sprite(btn_d_r, btn_d_rTiles, btn_d_rTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_yes, button_yesTiles, button_yesTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_no, button_noTiles, button_noTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_blank_left, button_blank_leftTiles, button_blank_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_blank_right, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1);
load_sprite(button_blank_left_2, button_blank_leftTiles, button_blank_leftTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1);
load_sprite(button_blank_right_2, button_game_select_edgeTiles, button_game_select_edgeTilesLen, curr_tile_id, BTN_PAL, ATTR0_TALL, ATTR1_SIZE_8x32, 1);
global_tile_id_end = curr_tile_id;
}

View File

@ -1,85 +0,0 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD,
# 0x10
0xFD, 0xFD, 0x85, 0x84, 0x8D, 0x8D, 0x84, 0x8B, 0x50, 0x50, 0x50, 0x50, 0x50, 0x06, 0x15, 0x15,
# 0x20
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x30
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x40
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x50
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x60
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x70
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x80
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x90
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0xA0
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0xB0
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0xC0
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0xD0
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0xE0
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0xF0
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x100
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x110
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x120
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x130
0x15, 0x15, 0x15, 0xC8, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x140
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x150
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x160
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
# 0x170
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0xE3, 0xFF,
# 0x180
0x01, 0xC2, 0x00, 0xCD, 0xCB, 0x1F, 0x3E, 0x1C, 0xCD, 0x7E, 0x3E, 0xCD, 0xFC, 0x79, 0x00, 0x00,
# 0x190
0x00, 0x00, 0x00, 0xCD, 0x24, 0x7A, 0xC3, 0xD6, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0xAA,
# 0x1A0
0xFF, 0x36, 0x02, 0x00, 0x00, 0x00, 0x00, 0x21, 0x61, 0x01, 0x11, 0xD0, 0xC5, 0x18, 0xD1, 0x00,
# 0x1B0
0x00, 0x00, 0x00, 0x00, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFF, 0xFF, 0x3E, 0x01, 0xCD, 0x7E, 0x3E,
# 0x1C0
0xCD, 0xDD, 0x16, 0x21, 0x2E, 0xC4, 0x06, 0x03, 0x0E, 0x0E, 0xCD, 0x67, 0x5B, 0x21, 0x43, 0xC4,
# 0x1D0
0x11, 0x7A, 0xC6, 0xCD, 0x23, 0x17, 0x21, 0xAA, 0xFF, 0x36, 0x02, 0x21, 0x7E, 0xDA, 0x36, 0xFD,
# 0x1E0
0x11, 0x7D, 0xDA, 0x01, 0x64, 0x04, 0x00, 0x00, 0x00, 0x21, 0xAA, 0xFF, 0x36, 0x02, 0x21, 0x61,
# 0x1F0
0x01, 0x11, 0x51, 0xC6, 0x01, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x21, 0x94, 0xCF, 0x36, 0x01, 0xFA,
# 0x200
0x50, 0xC6, 0x5F, 0x16, 0x00, 0x21, 0x51, 0xC6, 0x19, 0x1E, 0xFF, 0x3C, 0xEA, 0x50, 0xC6, 0xFA,
# 0x210
0x7F, 0xDA, 0x47, 0x2A, 0xBB, 0x28, 0x0C, 0xB8, 0x30, 0xE5, 0x21, 0x91, 0xCF, 0x77, 0xCD, 0x0F,
# 0x220
0x7A, 0x18, 0xDC, 0x3E, 0x1C, 0xCD, 0x7E, 0x3E, 0xCD, 0x32, 0x7B, 0xCD, 0x56, 0x7B, 0xC3, 0x05,
# 0x230
0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14,
# 0x240
0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
# 0x250
0x03, 0x02, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x93,
# 0x260
0x91, 0x80, 0x8D, 0x92, 0x85, 0x84, 0x91, 0x91, 0x88, 0x8D, 0x86, 0xF2, 0xF2, 0x4E, 0x7F, 0x8F,
# 0x270
0x8B, 0x84, 0x80, 0x92, 0x84, 0x7F, 0x96, 0x80, 0x88, 0x93, 0xE7, 0x7F, 0x50, 0x00, 0x00, 0x00,
# 0x280
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
# 0x290
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
# 0x2A0

View File

@ -7,6 +7,7 @@
#include "pkmn_font.h"
#include "script_array.h"
#include "debug_mode.h"
#include "main_menu.h"
#define TEXT_CBB 3
#define TEXT_SBB 28
@ -29,15 +30,25 @@ void init_text_engine()
pal_bg_bank[15][15] = 0b0001100011100110;
// Set default variables
curr_line = script[SCRIPT_START];
char_index = 0;
line_char_index = 0;
curr_text = curr_line.get_text();
text_exit = false;
}
int text_loop()
int text_loop(int script)
{
switch (script)
{
case BTN_TRANSFER:
curr_line = transfer_script[T_SCRIPT_START];
break;
case BTN_EVENTS:
curr_line = event_script[E_SCRIPT_START];
break;
}
curr_text = curr_line.get_text();
show_text_box();
tte_set_margins(LEFT, TOP, RIGHT, BOTTOM);
while (true)
@ -75,7 +86,15 @@ int text_loop()
else
{
line_char_index = 0;
curr_line = script[text_next_obj_id(curr_line)];
switch (script)
{
case BTN_TRANSFER:
curr_line = transfer_script[text_next_obj_id(curr_line)];
break;
case BTN_EVENTS:
curr_line = event_script[text_next_obj_id(curr_line)];
break;
}
curr_text = curr_line.get_text();
}
char_index = 0;

View File

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