Changing background and fixing bugs

This commit is contained in:
The Gears of Progress 2024-07-02 16:55:47 -04:00
parent 8f07b1ebdb
commit e5ad1e25cf
11 changed files with 1278 additions and 191 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -2,10 +2,10 @@
#define DEBUG_MODE_H
#define DEBUG_MODE false
#define IGNORE_GAME_PAK false
#define IGNORE_LINK_CABLE false
#define IGNORE_MG_E4_FLAGS false
#define IGNORE_UNRECEIVED_PKMN false
#define IGNORE_GAME_PAK true
#define IGNORE_LINK_CABLE true
#define IGNORE_MG_E4_FLAGS true
#define IGNORE_UNRECEIVED_PKMN true
#define FORCE_TUTORIAL false
#define DONT_REMOVE_PKMN false
#define SHOW_INVALID_PKMN false

View File

@ -26,7 +26,10 @@ public:
bool get_contains_mythical();
void set_mythic_stabilization(bool stabilize);
bool contains_valid = false;
bool contains_invalid = false;
int get_game_gen();
int get_num_pkmn();
bool get_contains_invalid();
private:
byte box_data_array[0x462];

View File

@ -41,8 +41,9 @@
#define DIA_WHAT_GAME_EVENT 32
#define DIA_K_DEX_NOT_FULL 33
#define DIA_J_DEX_NOT_FULL 34
#define DIA_SOME_INVALID_PKMN 35
#define DIA_SIZE 35
#define DIA_SIZE 36
#define DIA_END DIA_SIZE
// Commands
@ -86,8 +87,9 @@
#define COND_CHECK_MYTHIC CMDS_END + 14
#define COND_CHECK_DEX CMDS_END + 15
#define COND_CHECK_KANTO CMDS_END + 16
#define COND_SOME_INVALID_PKMN CMDS_END + 17
#define COND_SIZE 17
#define COND_SIZE 18
#define COND_END CMDS_END + COND_SIZE
// Ends

View File

@ -32,20 +32,11 @@
/*
TODO:
- Rename to PokeTransporter GB
- Add in putting item from Pkmn to bag in gen 2
- Stablize link cable (switch between slave and master)
- Fix double transfer glitch
- Remove global variables
- Better custom sprites (Progress, Fennel, Title)
- Add a % or x/250 for the Dream Dex
- Determine if transfered Shiny Pokemon are square/star sparkles
- Music and sound effects
- Simplify the sprite initalization
- Smoother transitions
- Wii Channel
- Events
- ignore Mew/Celebi
- MissingNo/Enigma Berry
- Text translations
- Add support for other languages
@ -102,7 +93,7 @@ void load_graphics()
main_menu.clear_vector();
main_menu.add_button(Button(btn_t_l, btn_t_r, 48), BTN_TRANSFER);
main_menu.add_button(Button(btn_p_l, btn_p_r, 48), BTN_POKEDEX);
//main_menu.add_button(Button(btn_d_l, btn_d_r, 48), BTN_EVENTS);
// main_menu.add_button(Button(btn_d_l, btn_d_r, 48), BTN_EVENTS);
main_menu.add_button(Button(btn_c_l, btn_c_r, 48), BTN_CREDITS);
main_menu.set_xy_min_max(0, H_MAX, 48, V_MAX);
@ -242,7 +233,7 @@ int main(void)
initalize_memory_locations();
load_custom_save_data();
if (get_tutorial_flag() == false || FORCE_TUTORIAL)
if (!IGNORE_MG_E4_FLAGS && (!get_tutorial_flag() || !read_flag(curr_rom.e4_flag) || FORCE_TUTORIAL))
{
first_load_message();
initalize_save_data();
@ -297,8 +288,11 @@ int main(void)
text_loop(BTN_TRANSFER);
break;
case (BTN_POKEDEX):
obj_hide_multi(ptgb_logo_l, 2);
pokedex_loop();
if (IGNORE_MG_E4_FLAGS || read_flag(curr_rom.e4_flag))
{
obj_hide_multi(ptgb_logo_l, 2);
pokedex_loop();
}
break;
case (BTN_CREDITS):
set_textbox_large();

View File

@ -134,7 +134,7 @@ int pokedex_loop()
tte_set_pos(dex_x_cord + (1 * 8), (i * 8 * 3) + 16);
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 + mythic_skip) ? 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 + mythic_skip]).data() : "----------");
tte_set_pos(dex_x_cord + (14 * 8), (i * 8 * 3) + 16);
tte_write("000");
if (dex_shift + i + 1 + mythic_skip < 10)

View File

@ -139,7 +139,7 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical)
if (species_index_struct > 251 || // Checks if the Pokemon is beyond Celebi
species_index_struct == 0 || // Checks that the Pokemon isn't a blank party space
species_index_struct != species_index_party || // Checks that the Pokemon isn't a hybrid or an egg
index_in_box >= num_in_box) // Checks that we're not reading beyond the Pokemon in the box
index_in_box >= num_in_box) // Checks that we're not reading beyond the Pokemon in the box
{
is_valid = false;
return;
@ -343,22 +343,24 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical)
copy_from_to(&trainer_id[0], &gen_3_pkmn[4], 2, true);
// Check if the Pokemon 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] & 0b11000000) >> 6) | (((dvs[0] & 0b00110000) >> 2) > 7))) // Reorganizes the Attack DV bits so that they will be >7 if the Pokemon 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[0] ^ pid[0] ^ pid[2] ^ 0xFF;
secret_id[1] = trainer_id[1] ^ pid[1] ^ pid[3] ^ 0xFF;
secret_id[0] = trainer_id[1] ^ pid[0] ^ pid[2] ^ 0x0; // This value at the end should be random between 0 - 15, if that is to be implemented
secret_id[1] = trainer_id[0] ^ pid[1] ^ pid[3] ^ 0x0;
// Randomly shift by 16 (maybe)
}
else // Not shiny, make sure it isn't
{
secret_id[0] = dvs[0];
secret_id[1] = dvs[1];
if (((trainer_id[0] ^ secret_id[0] ^ pid[0] ^ pid[2]) == 0) &&
((trainer_id[1] ^ secret_id[1] ^ pid[1] ^ pid[3]) < 8))
{
secret_id[0] = 0xFF;
secret_id[1] = 0xFF;
secret_id[1] += 8;
}
}
copy_from_to(&secret_id[0], &gen_3_pkmn[6], 2, false); // Set SID

File diff suppressed because it is too large Load Diff

View File

@ -70,10 +70,10 @@ void initalize_save_data()
}
int get_dex_completion(int gen, bool include_mythicals){
int num = (gen == 1 ? 151 : 100);
int offset = (gen == 1 ? 1 : 152);
int stop = (gen == 1 ? 151 : 251);
int start = (gen == 1 ? 1 : 152);
int count = 0;
for (int i = 0; i < num; i++){
for (int i = start; i < stop + include_mythicals; i++){
if (is_caught(i)){
count++;
}

View File

@ -47,8 +47,9 @@ void populate_dialogue()
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_MYTHIC_CONVERT] = "It looks like you have a\nrare Mythical Pok@mon!|Due to their rarity, it\nseems they've overloaded 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!";
dialogue[DIA_SOME_INVALID_PKMN] = "I see there is at least one\ninvalid Pok@mon in your\ncurrent box.|Invalid Pok@mon won't be\nable to be transfered, but\nthe rest will transfer with no problems!";
dialogue[DIA_ERROR_COLOSSEUM] = "It looks like you went to\nthe colosseum instead of the\ntrading room!|Let's try that again!";
dialogue[DIA_ERROR_COM_ENDED] = "Communication with the other\ndevice was terminated.|Let's try that again!";
@ -108,8 +109,10 @@ void populate_script()
transfer_script[DIA_ERROR_DISCONNECT] = script_obj(dialogue[DIA_ERROR_DISCONNECT], DIA_START);
// Pause the transfer and show the user their box data
transfer_script[CMD_LOAD_SIMP] = script_obj(CMD_LOAD_SIMP, COND_CHECK_MYTHIC, DIA_NO_VALID_PKMN);
transfer_script[CMD_LOAD_SIMP] = script_obj(CMD_LOAD_SIMP, COND_SOME_INVALID_PKMN, DIA_NO_VALID_PKMN);
transfer_script[DIA_NO_VALID_PKMN] = script_obj(dialogue[DIA_NO_VALID_PKMN], CMD_CANCEL_LINK);
transfer_script[COND_SOME_INVALID_PKMN] = script_obj(COND_SOME_INVALID_PKMN, DIA_SOME_INVALID_PKMN, COND_CHECK_MYTHIC);
transfer_script[DIA_SOME_INVALID_PKMN] = script_obj(dialogue[DIA_SOME_INVALID_PKMN], COND_CHECK_MYTHIC);
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);
@ -269,6 +272,9 @@ bool run_conditional(int index)
case COND_CHECK_KANTO:
return party_data.get_game_gen() == 1;
case COND_SOME_INVALID_PKMN:
return party_data.get_contains_invalid();
case CMD_START_LINK:
obj_hide(prof);
party_data.start_link();