Make stuff work maybe

This commit is contained in:
suchmememanyskill
2023-07-22 17:59:29 +02:00
parent ee6ea3e64c
commit 83b49299b4
4 changed files with 32 additions and 19 deletions

View File

@@ -26,18 +26,17 @@ Input_t *hidRead(){
u8 right_connected = 0;
if (controller != NULL){
if (controller->home && !h_cfg.t210b01)
RebootToPayloadOrRcm();
if (controller->cap)
TakeScreenshot();
inputs.buttons = controller->buttons;
left_connected = controller->conn_l;
right_connected = controller->conn_r;
}
if (right_connected && controller->home && !h_cfg.t210b01)
RebootToPayloadOrRcm();
if (left_connected && controller->cap)
TakeScreenshot();
u8 btn = btn_read();
inputs.volp = (btn & BTN_VOL_UP) ? 1 : 0;
@@ -45,15 +44,23 @@ Input_t *hidRead(){
inputs.power = (btn & BTN_POWER) ? 1 : 0;
if (left_connected){
/*
if ((LbaseX == 0 || LbaseY == 0) || controller->l3){
LbaseX = controller->lstick_x;
LbaseY = controller->lstick_y;
}
inputs.up = (controller->up || (controller->lstick_y > LbaseY + 500)) ? 1 : 0;
inputs.down = (controller->down || (controller->lstick_y < LbaseY - 500)) ? 1 : 0;
inputs.left = (controller->left || (controller->lstick_x < LbaseX - 500)) ? 1 : 0;
inputs.right = (controller->right || (controller->lstick_x > LbaseX + 500)) ? 1 : 0;
inputs.up = (controller->up || (controller->lstick_y > LbaseY + 10000)) ? 1 : 0;
inputs.down = (controller->down || (controller->lstick_y < LbaseY - 10000)) ? 1 : 0;
inputs.left = (controller->left || (controller->lstick_x < LbaseX - 10000)) ? 1 : 0;
inputs.right = (controller->right || (controller->lstick_x > LbaseX + 10000)) ? 1 : 0;
*/
inputs.up = controller->up ? 1 : 0;
inputs.down = controller->down ? 1 : 0;
inputs.left = controller->left ? 1 : 0;
inputs.right = controller->right ? 1 : 0;
}
else {
inputs.up = inputs.volp;
@@ -61,6 +68,7 @@ Input_t *hidRead(){
}
if (right_connected){
/*
if ((RbaseX == 0 || RbaseY == 0) || controller->r3){
RbaseX = controller->rstick_x;
RbaseY = controller->rstick_y;
@@ -70,6 +78,7 @@ Input_t *hidRead(){
inputs.rDown = (controller->rstick_y < RbaseY - 500) ? 1 : 0;
inputs.rLeft = (controller->rstick_x < RbaseX - 500) ? 1 : 0;
inputs.rRight = (controller->rstick_x > RbaseX + 500) ? 1 : 0;
*/
}
else
inputs.a = inputs.power;

View File

@@ -227,6 +227,8 @@ void ipl_main()
h_cfg.emummc_force_disable = false;
h_cfg.t210b01 = !!(hw_get_chip_id() == GP_HIDREV_MAJOR_T210B01);
max77620_rtc_prep_read();
display_init();
// Mount SD Card.
@@ -238,7 +240,7 @@ void ipl_main()
// Train DRAM and switch to max frequency.
if (TConf.minervaEnabled) //!TODO: Add Tegra210B01 support to minerva.
h_cfg.errors |= ERR_LIBSYS_MTC;
minerva_change_freq(FREQ_1600);
minerva_change_freq(FREQ_800);
u32 *fb = display_init_framebuffer_pitch();
gfx_init_ctxt(fb, 720, 1280, 720);
@@ -249,7 +251,7 @@ void ipl_main()
display_backlight_brightness(100, 1000);
// Overclock BPMP.
bpmp_clk_rate_set(BPMP_CLK_DEFAULT_BOOST);
bpmp_clk_rate_set(h_cfg.t210b01 ? BPMP_CLK_DEFAULT_BOOST : BPMP_CLK_LOWER_BOOST);
emummc_load_cfg();
// Ignore whether emummc is enabled.