mirror of
https://github.com/GearsProgress/Poke_Transporter_GB.git
synced 2026-10-24 00:13:40 -05:00
Applying formatting and moving libraries into specific folders
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#include <tonc.h>
|
||||
#include "ptgb_save_data_manager.h"
|
||||
#include "flash_mem.h"
|
||||
#include "dbg/debug_mode.h"
|
||||
#include "button_menu.h"
|
||||
#include "pokemon_data.h"
|
||||
#include "dbg/debug_mode.h"
|
||||
#include "flash_mem.h"
|
||||
#include "libraries/Pokemon-Gen3-to-Gen-X/include/save.h"
|
||||
#include "pokemon_data.h"
|
||||
#include "script_array.h"
|
||||
#include <tonc.h>
|
||||
|
||||
byte save_data_array[SAVE_DATA_SIZE];
|
||||
|
||||
@@ -27,7 +27,9 @@ void write_custom_save_data()
|
||||
|
||||
bool is_caught(int dex_num)
|
||||
{
|
||||
return (((save_data_array[CAUGHT_DATA + (dex_num / 8)]) >> dex_num % 8) & 1) || g_debug_options.force_all_caught;
|
||||
return (((save_data_array[CAUGHT_DATA + (dex_num / 8)]) >> dex_num % 8) &
|
||||
1) ||
|
||||
g_debug_options.force_all_caught;
|
||||
}
|
||||
|
||||
void set_caught(int dex_num)
|
||||
@@ -36,28 +38,17 @@ void set_caught(int dex_num)
|
||||
{
|
||||
newPkmn |= true;
|
||||
}
|
||||
save_data_array[CAUGHT_DATA + (dex_num / 8)] = save_data_array[CAUGHT_DATA + (dex_num / 8)] | (1 << (dex_num % 8));
|
||||
save_data_array[CAUGHT_DATA + (dex_num / 8)] =
|
||||
save_data_array[CAUGHT_DATA + (dex_num / 8)] | (1 << (dex_num % 8));
|
||||
}
|
||||
|
||||
int get_def_lang_num()
|
||||
{
|
||||
return save_data_array[DEFAULT_LANGUAGE];
|
||||
}
|
||||
int get_def_lang_num() { return save_data_array[DEFAULT_LANGUAGE]; }
|
||||
|
||||
void set_def_lang(int nLang)
|
||||
{
|
||||
save_data_array[DEFAULT_LANGUAGE] = nLang;
|
||||
}
|
||||
void set_def_lang(int nLang) { save_data_array[DEFAULT_LANGUAGE] = nLang; }
|
||||
|
||||
void set_tutorial_flag(bool value)
|
||||
{
|
||||
save_data_array[TUTORIAL_FLAG] = value;
|
||||
}
|
||||
void set_tutorial_flag(bool value) { save_data_array[TUTORIAL_FLAG] = value; }
|
||||
|
||||
bool get_tutorial_flag()
|
||||
{
|
||||
return save_data_array[TUTORIAL_FLAG];
|
||||
}
|
||||
bool get_tutorial_flag() { return save_data_array[TUTORIAL_FLAG]; }
|
||||
|
||||
void initialize_save_data()
|
||||
{
|
||||
@@ -86,7 +77,8 @@ bool check_can_save()
|
||||
byte data_buffer[8] = {};
|
||||
byte test_buffer[8] = {0xC7, 0xCF, 0xCA, 0xCA, 0xBF, 0xCE, 0xA4, 0xBE};
|
||||
|
||||
// Copy the current bytes and save them to the data buffer, and replace them with the test_buffer
|
||||
// Copy the current bytes and save them to the data buffer, and replace them
|
||||
// with the test_buffer
|
||||
copy_save_to_ram(HALL_OF_FAME + 0x1000, &global_memory_buffer[0], 0x1000);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
@@ -96,7 +88,8 @@ bool check_can_save()
|
||||
erase_sector(HALL_OF_FAME + 0x1000);
|
||||
copy_ram_to_save(&global_memory_buffer[0], HALL_OF_FAME + 0x1000, 0x1000);
|
||||
|
||||
// Overwrite the data in the global memory buffer to make sure that it isn't still there when testing
|
||||
// Overwrite the data in the global memory buffer to make sure that it isn't
|
||||
// still there when testing
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
global_memory_buffer[HOF_SECTION + i] = 0;
|
||||
@@ -111,7 +104,8 @@ bool check_can_save()
|
||||
// Did not save correctly, return false
|
||||
return false;
|
||||
}
|
||||
// Set the byte in the memory buffer back in preperation for saving it back again
|
||||
// Set the byte in the memory buffer back in preperation for saving it
|
||||
// back again
|
||||
global_memory_buffer[HOF_SECTION + i] = data_buffer[i];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user