From 781098624303f00301bb04ac8845a847d2755b26 Mon Sep 17 00:00:00 2001 From: Alexander Yee Date: Sun, 18 Aug 2024 02:35:01 -0700 Subject: [PATCH] Native programs update. --- NativePrograms/Cleanup.cmd | 3 + .../Libraries/NintendoSwitch_GameEntry.h | 42 ++++++ .../Libraries/NintendoSwitch_PushButtons.h | 2 + .../NintendoSwitch/Programs/TurboA_Core.c | 36 +++++ NativePrograms/NintendoSwitch/makefile | 10 +- .../Libraries/PokemonBDSP_GameEntry_Core.h | 133 ++++++++++++++++++ .../PokemonBDSP/Programs/MassRelease_Core.c | 76 ++++++++++ NativePrograms/PokemonBDSP/makefile | 10 +- NativePrograms/PokemonSV/makefile | 10 +- .../PokemonSwSh/Programs/BallThrower_Core.c | 34 +++++ .../PokemonSwSh/Programs/ClothingBuyer_Core.c | 41 ++++++ NativePrograms/PokemonSwSh/makefile | 10 +- 12 files changed, 391 insertions(+), 16 deletions(-) create mode 100644 NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h create mode 100644 NativePrograms/NintendoSwitch/Programs/TurboA_Core.c create mode 100644 NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_GameEntry_Core.h create mode 100644 NativePrograms/PokemonBDSP/Programs/MassRelease_Core.c create mode 100644 NativePrograms/PokemonSwSh/Programs/BallThrower_Core.c create mode 100644 NativePrograms/PokemonSwSh/Programs/ClothingBuyer_Core.c diff --git a/NativePrograms/Cleanup.cmd b/NativePrograms/Cleanup.cmd index 2e32c2b2d..e391968f6 100644 --- a/NativePrograms/Cleanup.cmd +++ b/NativePrograms/Cleanup.cmd @@ -8,4 +8,7 @@ cd %~dp0\PokemonSwSh cd %~dp0\PokemonBDSP @call !Cleanup.cmd +cd %~dp0\PokemonSV +@call !Cleanup.cmd + diff --git a/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h b/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h new file mode 100644 index 000000000..ff1fc3fee --- /dev/null +++ b/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_GameEntry.h @@ -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 diff --git a/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h b/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h index b3df8a9bf..4268528c5 100644 --- a/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h +++ b/NativePrograms/NintendoSwitch/Libraries/NintendoSwitch_PushButtons.h @@ -40,6 +40,8 @@ void pbf_move_right_joystick(uint8_t x, uint8_t y, uint16_t hold_ticks, uint16_t // specified amount of time. void pbf_mash_button(Button button, uint16_t ticks); +// Alternately mash 2 buttons. +void pbf_mash2_button(Button button0, Button button1, uint16_t ticks); diff --git a/NativePrograms/NintendoSwitch/Programs/TurboA_Core.c b/NativePrograms/NintendoSwitch/Programs/TurboA_Core.c new file mode 100644 index 000000000..7331f7154 --- /dev/null +++ b/NativePrograms/NintendoSwitch/Programs/TurboA_Core.c @@ -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(); +}; + diff --git a/NativePrograms/NintendoSwitch/makefile b/NativePrograms/NintendoSwitch/makefile index d7271d8c2..41a0add38 100644 --- a/NativePrograms/NintendoSwitch/makefile +++ b/NativePrograms/NintendoSwitch/makefile @@ -77,30 +77,32 @@ SRC += $(PATH_PUBLIC)/NativePrograms/NintendoSwitch/FrameworkSettings.c ifneq ("$(wildcard $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c)","") CC_FLAGS += -I$(PATH_INTERNAL) SRC += $(PATH_PUBLIC)/Common/CRC32.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareUSB.c ifeq ($(TARGET), PABotBase) +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart-PABotBase.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueue.c else +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueueNull.c endif SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareSerial.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Controller.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_ScalarButtons.c +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_Superscalar.c else LD_FLAGS += obj/obj-$(MCU)/CRC32.o -LD_FLAGS += obj/obj-$(MCU)/uart.o LD_FLAGS += obj/obj-$(MCU)/HardwareUSB.o ifeq ($(TARGET), PABotBase) +LD_FLAGS += obj/obj-$(MCU)/Uart-PABotBase.o LD_FLAGS += obj/obj-$(MCU)/CommandQueue.o else +LD_FLAGS += obj/obj-$(MCU)/Uart.o LD_FLAGS += obj/obj-$(MCU)/CommandQueueNull.o endif LD_FLAGS += obj/obj-$(MCU)/HardwareSerial.o LD_FLAGS += obj/obj-$(MCU)/Controller.o LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_PushButtons.o -LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_ScalarButtons.o +LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_Superscalar.o endif # Program diff --git a/NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_GameEntry_Core.h b/NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_GameEntry_Core.h new file mode 100644 index 000000000..5f9dfee65 --- /dev/null +++ b/NativePrograms/PokemonBDSP/Libraries/PokemonBDSP_GameEntry_Core.h @@ -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 + diff --git a/NativePrograms/PokemonBDSP/Programs/MassRelease_Core.c b/NativePrograms/PokemonBDSP/Programs/MassRelease_Core.c new file mode 100644 index 000000000..4b4344596 --- /dev/null +++ b/NativePrograms/PokemonBDSP/Programs/MassRelease_Core.c @@ -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(); +}; + diff --git a/NativePrograms/PokemonBDSP/makefile b/NativePrograms/PokemonBDSP/makefile index 9b6186003..eb860827b 100644 --- a/NativePrograms/PokemonBDSP/makefile +++ b/NativePrograms/PokemonBDSP/makefile @@ -77,30 +77,32 @@ SRC += $(PATH_PUBLIC)/NativePrograms/NintendoSwitch/FrameworkSettings.c ifneq ("$(wildcard $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c)","") CC_FLAGS += -I$(PATH_INTERNAL) SRC += $(PATH_PUBLIC)/Common/CRC32.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareUSB.c ifeq ($(TARGET), PABotBase) +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart-PABotBase.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueue.c else +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueueNull.c endif SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareSerial.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Controller.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_ScalarButtons.c +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_Superscalar.c else LD_FLAGS += obj/obj-$(MCU)/CRC32.o -LD_FLAGS += obj/obj-$(MCU)/uart.o LD_FLAGS += obj/obj-$(MCU)/HardwareUSB.o ifeq ($(TARGET), PABotBase) +LD_FLAGS += obj/obj-$(MCU)/Uart-PABotBase.o LD_FLAGS += obj/obj-$(MCU)/CommandQueue.o else +LD_FLAGS += obj/obj-$(MCU)/Uart.o LD_FLAGS += obj/obj-$(MCU)/CommandQueueNull.o endif LD_FLAGS += obj/obj-$(MCU)/HardwareSerial.o LD_FLAGS += obj/obj-$(MCU)/Controller.o LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_PushButtons.o -LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_ScalarButtons.o +LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_Superscalar.o endif # Program diff --git a/NativePrograms/PokemonSV/makefile b/NativePrograms/PokemonSV/makefile index dfae4949a..997449dad 100644 --- a/NativePrograms/PokemonSV/makefile +++ b/NativePrograms/PokemonSV/makefile @@ -77,30 +77,32 @@ SRC += $(PATH_PUBLIC)/NativePrograms/NintendoSwitch/FrameworkSettings.c ifneq ("$(wildcard $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c)","") CC_FLAGS += -I$(PATH_INTERNAL) SRC += $(PATH_PUBLIC)/Common/CRC32.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareUSB.c ifeq ($(TARGET), PABotBase) +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart-PABotBase.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueue.c else +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueueNull.c endif SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareSerial.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Controller.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_ScalarButtons.c +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_Superscalar.c else LD_FLAGS += obj/obj-$(MCU)/CRC32.o -LD_FLAGS += obj/obj-$(MCU)/uart.o LD_FLAGS += obj/obj-$(MCU)/HardwareUSB.o ifeq ($(TARGET), PABotBase) +LD_FLAGS += obj/obj-$(MCU)/Uart-PABotBase.o LD_FLAGS += obj/obj-$(MCU)/CommandQueue.o else +LD_FLAGS += obj/obj-$(MCU)/Uart.o LD_FLAGS += obj/obj-$(MCU)/CommandQueueNull.o endif LD_FLAGS += obj/obj-$(MCU)/HardwareSerial.o LD_FLAGS += obj/obj-$(MCU)/Controller.o LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_PushButtons.o -LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_ScalarButtons.o +LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_Superscalar.o endif # Program diff --git a/NativePrograms/PokemonSwSh/Programs/BallThrower_Core.c b/NativePrograms/PokemonSwSh/Programs/BallThrower_Core.c new file mode 100644 index 000000000..1f43c1b72 --- /dev/null +++ b/NativePrograms/PokemonSwSh/Programs/BallThrower_Core.c @@ -0,0 +1,34 @@ +/* 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/PokemonSwSh/Libraries/PokemonSwSh_Settings.h" +#include "NativePrograms/PokemonSwSh/Programs/BallThrower.h" + + +int main(void){ + start_program_callback(); + initialize_framework(0); + + start_program_flash(CONNECT_CONTROLLER_DELAY); + grip_menu_connect_go_home(); + pbf_press_button(BUTTON_HOME, 10, PokemonSwSh_HOME_TO_GAME_DELAY); + + while (true){ + pbf_press_button(BUTTON_X, 50, 50); + pbf_press_button(BUTTON_A, 50, 50); + pbf_mash_button(BUTTON_B, 100); + } + + pbf_press_button(BUTTON_HOME, 10, PokemonSwSh_GAME_TO_HOME_DELAY_SAFE); + end_program_callback(); + end_program_loop(); +}; + diff --git a/NativePrograms/PokemonSwSh/Programs/ClothingBuyer_Core.c b/NativePrograms/PokemonSwSh/Programs/ClothingBuyer_Core.c new file mode 100644 index 000000000..867df58e1 --- /dev/null +++ b/NativePrograms/PokemonSwSh/Programs/ClothingBuyer_Core.c @@ -0,0 +1,41 @@ +/* Pokemon Sword & Shield Arduino Programs + * + * 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_GameEntry.h" +#include "NativePrograms/PokemonSwSh/Libraries/PokemonSwSh_Settings.h" +#include "NativePrograms/PokemonSwSh/Programs/ClothingBuyer.h" + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Obfuscation Macros +#ifdef OBFUSCATE_SYMBOLS + +#endif +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +int main(void){ + start_program_callback(); + initialize_framework(0); + + start_program_flash(CONNECT_CONTROLLER_DELAY); + grip_menu_connect_go_home(); + resume_game_no_interact(PokemonSwSh_HOME_TO_GAME_DELAY, TOLERATE_SYSTEM_UPDATE_MENU_FAST); + + while (true){ + pbf_press_button(BUTTON_A, 10, 90); + if (CATEGORY_ROTATION){ + pbf_press_dpad(DPAD_RIGHT, 10, 40); + } + pbf_press_button(BUTTON_A, 10, 90); + pbf_press_button(BUTTON_A, 10, 90); + pbf_press_dpad(DPAD_DOWN, 10, 40); + } +} + diff --git a/NativePrograms/PokemonSwSh/makefile b/NativePrograms/PokemonSwSh/makefile index 0aaa59d82..8b9e37d90 100644 --- a/NativePrograms/PokemonSwSh/makefile +++ b/NativePrograms/PokemonSwSh/makefile @@ -77,30 +77,32 @@ SRC += $(PATH_PUBLIC)/NativePrograms/NintendoSwitch/FrameworkSettings.c ifneq ("$(wildcard $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c)","") CC_FLAGS += -I$(PATH_INTERNAL) SRC += $(PATH_PUBLIC)/Common/CRC32.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareUSB.c ifeq ($(TARGET), PABotBase) +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart-PABotBase.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueue.c else +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Uart.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/CommandQueueNull.c endif SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/HardwareSerial.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/Controller.c SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_PushButtons.c -SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_ScalarButtons.c +SRC += $(PATH_INTERNAL)/NativePrograms/NintendoSwitch/Framework/NintendoSwitch_Superscalar.c else LD_FLAGS += obj/obj-$(MCU)/CRC32.o -LD_FLAGS += obj/obj-$(MCU)/uart.o LD_FLAGS += obj/obj-$(MCU)/HardwareUSB.o ifeq ($(TARGET), PABotBase) +LD_FLAGS += obj/obj-$(MCU)/Uart-PABotBase.o LD_FLAGS += obj/obj-$(MCU)/CommandQueue.o else +LD_FLAGS += obj/obj-$(MCU)/Uart.o LD_FLAGS += obj/obj-$(MCU)/CommandQueueNull.o endif LD_FLAGS += obj/obj-$(MCU)/HardwareSerial.o LD_FLAGS += obj/obj-$(MCU)/Controller.o LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_PushButtons.o -LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_ScalarButtons.o +LD_FLAGS += obj/obj-$(MCU)/NintendoSwitch_Superscalar.o endif # Program