Skip to content

Commit

Permalink
Did I fix it?
Browse files Browse the repository at this point in the history
  • Loading branch information
Round-Pi committed Feb 7, 2023
1 parent 8d19fb8 commit 13fb316
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
6 changes: 3 additions & 3 deletions application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ App(
entry_point="tama_p1_app",
cdefines=["APP_TAMA_P1"],
requires=["gui", "storage"],
stack_size=1 * 1024,
order=215,
stack_size= 2 * 1024,
order = 215,
fap_icon="tamaIcon2.png",
fap_category="Games",
fap_category="my_games",
)
63 changes: 33 additions & 30 deletions tama_p1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,40 +1086,41 @@ int32_t tama_p1_app(void* p) {
break;
case menu_items - 1:
default:
switch(sub_menu_last) {
case 0: // close menu
in_menu = false;
break;
case 1: // Save
if(speed != 1) {
// uint8_t temp = speed;
// speed = 1;
tamalib_set_speed(1);
tama_p1_save_state();
// speed = temp;
tamalib_set_speed(speed);
} else {
if(event.input.type == InputTypePress) {
switch(sub_menu_last) {
case 0: // close menu
in_menu = false;
break;
case 1: // Save
if(speed != 1) {
// uint8_t temp = speed;
// speed = 1;
tamalib_set_speed(1);
tama_p1_save_state();
// speed = temp;
tamalib_set_speed(speed);
} else {
tama_p1_save_state();
}
// in_menu = false;
break;
case 2: // Save & Exit
if(speed != 1) {
// speed = 1;
// tamalib_set_speed(speed);
tamalib_set_speed(1);
}
furi_timer_stop(timer);
tama_p1_save_state();
running = false;
break;
default:
break;
}
// in_menu = false;
break;
case 2: // Save & Exit
if(speed != 1) {
// speed = 1;
// tamalib_set_speed(speed);
tamalib_set_speed(1);
}
furi_timer_stop(timer);
tama_p1_save_state();
running = false;
break;
default:
break;
}
break;
}
}

} else { // out of menu // TODO: clean up code -.-
if(event.input.key == InputKeyBack && event.input.type == InputTypeLong) {
if(speed != 1) {
Expand All @@ -1141,9 +1142,11 @@ int32_t tama_p1_app(void* p) {
} else {
tama_btn_state = BTN_STATE_RELEASED;
}
if(event.input.key == m) {
tama_btn_state = BTN_STATE_RELEASED;
if(event.input.key == m && event.input.type == InputTypePress) {
in_menu = true;
// if(speed == 1) speed = 4;
// else speed = 1;
// tamalib_set_speed(speed);
} else if(event.input.key == a) {
tamalib_set_button(BTN_LEFT, tama_btn_state);
} else if(event.input.key == b) {
Expand Down

0 comments on commit 13fb316

Please sign in to comment.