/// Shared input macros extern unsigned char input_shot; extern bool input_ok; #define input_func_bool(var) { var = true; } else { var = false; } // REIIDEN.EXE and FUUIN.EXE // ------------------------- // [input_lr] flagsā€¦ hey, at least two inputs merged into a single variable. // It's a start. #define INPUT_RIGHT 0x01 #define INPUT_LEFT 0x02 extern unsigned char input_up; extern unsigned char input_down; extern unsigned char input_lr; extern unsigned char input_strike; extern bool input_mem_enter; extern bool input_mem_leave; extern unsigned char paused; extern bool done; extern bool input_bomb; // Updates all input-related variables if the held state of their associated // keys changed compared to the last input. void input_sense(bool16 reset_repeat); // Resets all input-related variables, then updates them according to the // keyboard state. void input_reset_sense(void); #define input_func_flag(var, flag) { var |= flag; } else { var &= ~flag; } #define input_onchange(prev_slot, cur_sensed, if_pressed) \ if(input_prev[prev_slot] != (cur_sensed)) { \ if(cur_sensed) if_pressed \ } \ input_prev[prev_slot] = (cur_sensed); #define input_onchange_bool(prev_slot, var, cur_sensed) \ input_onchange(prev_slot, cur_sensed, input_func_bool(var)) #define input_onchange_flag(prev_slot, var, flag, cur_sensed) \ input_onchange(prev_slot, cur_sensed, input_func_flag(var, flag)) #define input_onchange_2( \ prev_slot_1, prev_slot_2, cur_sensed_1, cur_sensed_2, if_pressed \ ) \ if( \ input_prev[prev_slot_1] != (cur_sensed_1) || \ input_prev[prev_slot_2] != (cur_sensed_2) \ ) { \ if(cur_sensed_1 || (cur_sensed_2)) if_pressed \ } \ input_prev[prev_slot_1] = (cur_sensed_1); \ input_prev[prev_slot_2] = (cur_sensed_2); #define input_onchange_bool_2( \ prev_slot_1, prev_slot_2, var, cur_sensed_1, cur_sensed_2 \ ) \ input_onchange_2(prev_slot_1, prev_slot_2, \ cur_sensed_1, cur_sensed_2, input_func_bool(var) \ ) #define input_onchange_flag_2( \ prev_slot_1, prev_slot_2, var, flag, cur_sensed_1, cur_sensed_2 \ ) \ input_onchange_2(prev_slot_1, prev_slot_2, \ cur_sensed_1, cur_sensed_2, input_func_flag(var, flag) \ ) #define input_pause_ok_sense(prev_slot_esc, prev_slot_ok, group0, group3) \ group0 = key_sense(0); \ group3 = key_sense(3); \ group0 |= key_sense(0); \ group3 |= key_sense(3); \ input_onchange(prev_slot_esc, (group0 & K0_ESC), { \ paused = (1 - paused); \ }) \ input_onchange(prev_slot_ok, (group3 & K3_RETURN), { \ if((paused == true) && (input_shot == true)) { \ done = true; \ } \ input_ok = true; \ } else { \ input_ok = false; \ }); // -------------------------