-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
391 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,7 @@ cd %~dp0\PokemonSwSh | |
cd %~dp0\PokemonBDSP | ||
@call !Cleanup.cmd | ||
|
||
cd %~dp0\PokemonSV | ||
@call !Cleanup.cmd | ||
|
||
|
42 changes: 42 additions & 0 deletions
42
NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* Pokemon Automation Push Button Framework | ||
* | ||
* From: https://github.com/PokemonAutomation/Arduino-Source | ||
* | ||
*/ | ||
|
||
#ifndef PokemonAutomation_NintendoSwitch_GameEntry_H | ||
#define PokemonAutomation_NintendoSwitch_GameEntry_H | ||
|
||
#include "NintendoSwitch_PushButtons.h" | ||
|
||
void close_game(void){ | ||
// Use mashing to ensure that the X press succeeds. If it fails, the SR | ||
// will fail and can kill a den for the autohosts. | ||
pbf_mash_button(BUTTON_X, 100); // Close game | ||
pbf_mash2_button(BUTTON_X, BUTTON_A, 50); // Confirm close game | ||
pbf_mash_button(BUTTON_X, 50); | ||
pbf_mash_button(BUTTON_B, 350); | ||
} | ||
void resume_game_no_interact(uint16_t delay, bool tolerate_update_menu){ | ||
if (tolerate_update_menu){ | ||
pbf_press_button(BUTTON_HOME, 10, delay); | ||
pbf_press_dpad(DPAD_DOWN, 10, 10); | ||
pbf_press_dpad(DPAD_UP, 10, 10); | ||
pbf_press_button(BUTTON_A, 10, delay); | ||
}else{ | ||
pbf_press_button(BUTTON_HOME, 10, delay); | ||
} | ||
} | ||
void resume_game_back_out(uint16_t delay, bool tolerate_update_menu, uint16_t mash_B_time){ | ||
if (tolerate_update_menu){ | ||
pbf_press_button(BUTTON_HOME, 10, delay); | ||
pbf_press_dpad(DPAD_DOWN, 10, 10); | ||
pbf_press_dpad(DPAD_UP, 10, 10); | ||
pbf_press_button(BUTTON_A, 10, delay); | ||
pbf_mash_button(BUTTON_B, mash_B_time); | ||
}else{ | ||
pbf_press_button(BUTTON_HOME, 10, delay); | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* Pokemon Sword & Shield Arduino Programs | ||
* | ||
* From: https://github.com/PokemonAutomation/Arduino-Source | ||
* | ||
*/ | ||
|
||
#include "Common/PokemonSwSh/PokemonProgramIDs.h" | ||
#include "NativePrograms/DeviceFramework/DeviceSettings.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/FrameworkSettings.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_Device.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h" | ||
#include "NativePrograms/PokemonSwSh/Libraries/PokemonSwSh_Settings.h" | ||
//#include "NativePrograms/PokemonSwSh/Libraries/PokemonSwSh_GameEntry_Core.h" | ||
#include "NativePrograms/NintendoSwitch/Programs/TurboA.h" | ||
|
||
int main(void){ | ||
start_program_callback(); | ||
initialize_framework(0); | ||
|
||
start_program_flash(CONNECT_CONTROLLER_DELAY); | ||
grip_menu_connect_go_home(); | ||
resume_game_no_interact(3 * TICKS_PER_SECOND, TOLERATE_SYSTEM_UPDATE_MENU_FAST); | ||
|
||
// the resume game sequence opens the camera in Scarlet/Violet | ||
// mashing B closes the camera | ||
pbf_mash_button(BUTTON_B, 100); | ||
while (true){ | ||
pbf_press_button(BUTTON_A, 5, 5); | ||
} | ||
|
||
pbf_press_button(BUTTON_HOME, 10, PokemonSwSh_GAME_TO_HOME_DELAY_SAFE); | ||
end_program_callback(); | ||
end_program_loop(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_GameEntry_Core.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/* Game Entry Routines | ||
* | ||
* From: https://github.com/PokemonAutomation/Arduino-Source | ||
* | ||
*/ | ||
|
||
#ifndef PokemonAutomation_PokemonBDSP_GameEntry_Core_H | ||
#define PokemonAutomation_PokemonBDSP_GameEntry_Core_H | ||
|
||
#include "NativePrograms/NintendoSwitch/Libraries/FrameworkSettings.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h" | ||
#include "NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_Settings.h" | ||
|
||
void PokemonBDSP_resume_game_no_interact(bool tolerate_update_menu){ | ||
if (tolerate_update_menu){ | ||
pbf_press_button(BUTTON_HOME, 10, PokemonBDSP_HOME_TO_GAME_DELAY); | ||
pbf_move_right_joystick(128, 255, 10, 10); | ||
pbf_move_right_joystick(128, 0, 10, 10); | ||
pbf_press_button(BUTTON_A, 10, PokemonBDSP_HOME_TO_GAME_DELAY); | ||
}else{ | ||
pbf_press_button(BUTTON_HOME, 10, PokemonBDSP_HOME_TO_GAME_DELAY); | ||
} | ||
} | ||
|
||
|
||
void PokemonBDSP_openedgame_to_gamemenu(uint16_t timeout){ | ||
pbf_wait(timeout); | ||
} | ||
void PokemonBDSP_gamemenu_to_ingame( | ||
uint16_t mash_duration, uint16_t enter_game_timeout | ||
){ | ||
pbf_mash_button(BUTTON_A, mash_duration); | ||
pbf_wait(enter_game_timeout); | ||
} | ||
void PokemonBDSP_openedgame_to_ingame( | ||
uint16_t load_game_timeout, | ||
uint16_t mash_duration, uint16_t enter_game_timeout, | ||
uint16_t post_wait_time | ||
){ | ||
PokemonBDSP_openedgame_to_gamemenu(load_game_timeout); | ||
PokemonBDSP_gamemenu_to_ingame(mash_duration, enter_game_timeout); | ||
pbf_wait(post_wait_time); | ||
} | ||
|
||
void PokemonBDSP_move_to_user(uint8_t user_slot){ | ||
if (user_slot != 0){ | ||
// Move to correct user. | ||
for (uint8_t c = 0; c < 8; c++){ | ||
pbf_press_dpad(DPAD_LEFT, 7, 7); | ||
} | ||
// pbf_wait(50); | ||
for (uint8_t c = 1; c < user_slot; c++){ | ||
pbf_press_dpad(DPAD_RIGHT, 7, 7); | ||
} | ||
} | ||
} | ||
|
||
void PokemonBDSP_start_game_from_home( | ||
bool tolerate_update_menu, | ||
uint8_t game_slot, | ||
uint8_t user_slot, | ||
uint16_t start_game_mash | ||
){ | ||
if (game_slot != 0){ | ||
pbf_press_button(BUTTON_HOME, 10, SETTINGS_TO_HOME_DELAY - 10); | ||
for (uint8_t c = 1; c < game_slot; c++){ | ||
pbf_press_dpad(DPAD_RIGHT, 5, 5); | ||
} | ||
} | ||
|
||
if (tolerate_update_menu){ | ||
// If the update menu isn't there, these will get swallowed by the opening | ||
// animation for the select user menu. | ||
pbf_press_button(BUTTON_A, 5, 175); // Choose game | ||
pbf_press_dpad(DPAD_UP, 5, 0); // Skip the update window. | ||
PokemonBDSP_move_to_user(user_slot); | ||
} | ||
|
||
// cout << "START_GAME_REQUIRES_INTERNET = " << START_GAME_REQUIRES_INTERNET << endl; | ||
if (!START_GAME_REQUIRES_INTERNET && user_slot == 0){ | ||
// Mash your way into the game. | ||
pbf_mash_button(BUTTON_A, start_game_mash); | ||
}else{ | ||
pbf_press_button(BUTTON_A, 5, 175); // Enter select user menu. | ||
PokemonBDSP_move_to_user(user_slot); | ||
pbf_press_button(BUTTON_A, 5, 5); // Enter game | ||
|
||
// Switch to mashing ZR instead of A to get into the game. | ||
// Mash your way into the game. | ||
uint16_t duration = start_game_mash; | ||
if (START_GAME_REQUIRES_INTERNET){ | ||
// Need to wait a bit longer for the internet check. | ||
duration += START_GAME_INTERNET_CHECK_DELAY; | ||
} | ||
pbf_mash_button(BUTTON_ZR, duration); | ||
} | ||
} | ||
|
||
|
||
|
||
void PokemonBDSP_reset_game_from_home( | ||
bool tolerate_update_menu, | ||
uint16_t post_wait_time | ||
){ | ||
if (START_GAME_REQUIRES_INTERNET || tolerate_update_menu){ | ||
close_game(); | ||
PokemonBDSP_start_game_from_home( | ||
tolerate_update_menu, | ||
0, 0, | ||
PokemonBDSP_START_GAME_MASH | ||
); | ||
}else{ | ||
pbf_press_button(BUTTON_X, 50, 0); | ||
pbf_mash_button(BUTTON_A, PokemonBDSP_START_GAME_MASH); | ||
} | ||
PokemonBDSP_openedgame_to_ingame( | ||
PokemonBDSP_START_GAME_WAIT, | ||
PokemonBDSP_ENTER_GAME_MASH, | ||
PokemonBDSP_ENTER_GAME_WAIT, | ||
post_wait_time | ||
); | ||
} | ||
|
||
void PokemonBDSP_save_game(void){ | ||
pbf_press_button(BUTTON_X, 10, PokemonBDSP_OVERWORLD_TO_MENU_DELAY); | ||
pbf_press_button(BUTTON_R, 10, 2 * TICKS_PER_SECOND); | ||
pbf_press_button(BUTTON_A, 10, 5 * TICKS_PER_SECOND); | ||
} | ||
|
||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* Pokemon BDSP: Mass Release | ||
* | ||
* From: https://github.com/PokemonAutomation/Arduino-Source | ||
* | ||
*/ | ||
|
||
#include "NativePrograms/DeviceFramework/DeviceSettings.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/FrameworkSettings.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_Device.h" | ||
#include "NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h" | ||
#include "NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_GameEntry_Core.h" | ||
#include "NativePrograms/PokemonBDSP/Programs/MassRelease.h" | ||
|
||
|
||
|
||
void release(void){ | ||
pbf_press_button(BUTTON_ZL, 20, 50); | ||
pbf_move_right_joystick(128, 0, 20, 10); | ||
pbf_move_right_joystick(128, 0, 20, 10); | ||
pbf_press_button(BUTTON_ZL, 20, 105); | ||
pbf_move_right_joystick(128, 255, 20, 10); | ||
pbf_mash_button(BUTTON_ZL, 120); | ||
pbf_wait(30); | ||
} | ||
void release_box(uint16_t box_scroll_delay){ | ||
for (uint8_t row = 0; row < 5; row++){ | ||
if (row != 0){ | ||
pbf_press_dpad(DPAD_DOWN, 20, box_scroll_delay); | ||
pbf_press_dpad(DPAD_RIGHT, 20, box_scroll_delay); | ||
pbf_press_dpad(DPAD_RIGHT, 20, box_scroll_delay); | ||
} | ||
for (uint8_t col = 0; col < 6; col++){ | ||
if (col != 0){ | ||
pbf_press_dpad(DPAD_RIGHT, 20, box_scroll_delay); | ||
} | ||
release(); | ||
} | ||
} | ||
} | ||
void release_boxes( | ||
uint8_t boxes, | ||
uint16_t box_scroll_delay, | ||
uint16_t box_change_delay | ||
){ | ||
if (boxes == 0){ | ||
return; | ||
} | ||
release_box(box_scroll_delay); | ||
for (uint8_t box = 1; box < boxes; box++){ | ||
pbf_press_dpad(DPAD_DOWN, 20, box_scroll_delay); | ||
pbf_press_dpad(DPAD_DOWN, 20, box_scroll_delay); | ||
pbf_press_dpad(DPAD_DOWN, 20, box_scroll_delay); | ||
pbf_press_dpad(DPAD_RIGHT, 20, box_scroll_delay); | ||
pbf_press_dpad(DPAD_RIGHT, 20, box_scroll_delay); | ||
pbf_press_button(BUTTON_R, 20, box_change_delay); | ||
release_box(box_scroll_delay); | ||
} | ||
} | ||
|
||
|
||
|
||
int main(void){ | ||
start_program_callback(); | ||
initialize_framework(0); | ||
|
||
start_program_flash(CONNECT_CONTROLLER_DELAY); | ||
grip_menu_connect_go_home(); | ||
PokemonBDSP_resume_game_no_interact(DODGE_SYSTEM_UPDATE_WINDOW); | ||
|
||
release_boxes(BOXES_TO_RELEASE, PokemonBDSP_BOX_SCROLL_DELAY, PokemonBDSP_BOX_CHANGE_DELAY); | ||
pbf_press_button(BUTTON_HOME, 20, PokemonBDSP_GAME_TO_HOME_DELAY); | ||
|
||
end_program_callback(); | ||
end_program_loop(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.