mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-14 02:16:10 +00:00
Merge branch 'master' of https://github.com/jugeeya/UltimateTrainingModpack
This commit is contained in:
commit
88eacb89c5
2 changed files with 130 additions and 2 deletions
|
@ -20,7 +20,7 @@ namespace app::lua_bind {
|
|||
u64 get_attack_hi3_fb_kind(u64) asm("_ZN3app8lua_bind42ControlModule__get_attack_hi3_fb_kind_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_attack_lw3_fb_kind(u64) asm("_ZN3app8lua_bind42ControlModule__get_attack_lw3_fb_kind_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_clatter_time(u64,int) asm("_ZN3app8lua_bind36ControlModule__get_clatter_time_implEPNS_26BattleObjectModuleAccessorEi") LINKABLE;
|
||||
u64 get_command_flag_cat(u64,int) asm("_ZN3app8lua_bind40ControlModule__get_command_flag_cat_implEPNS_26BattleObjectModuleAccessorEi") LINKABLE;
|
||||
int get_command_flag_cat(u64,int) asm("_ZN3app8lua_bind40ControlModule__get_command_flag_cat_implEPNS_26BattleObjectModuleAccessorEi") LINKABLE;
|
||||
u64 get_command_life(u64,int,int) asm("_ZN3app8lua_bind36ControlModule__get_command_life_implEPNS_26BattleObjectModuleAccessorEii") LINKABLE;
|
||||
u64 get_down_stand_fb_kind(u64) asm("_ZN3app8lua_bind42ControlModule__get_down_stand_fb_kind_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_flick_no_reset_x(u64) asm("_ZN3app8lua_bind40ControlModule__get_flick_no_reset_x_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
|
@ -30,7 +30,7 @@ namespace app::lua_bind {
|
|||
u64 get_flick_x_dir(u64) asm("_ZN3app8lua_bind35ControlModule__get_flick_x_dir_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_flick_y(u64) asm("_ZN3app8lua_bind31ControlModule__get_flick_y_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_flick_y_dir(u64) asm("_ZN3app8lua_bind35ControlModule__get_flick_y_dir_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_pad_flag(u64) asm("_ZN3app8lua_bind32ControlModule__get_pad_flag_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
int get_pad_flag(u64) asm("_ZN3app8lua_bind32ControlModule__get_pad_flag_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_stick_angle(u64) asm("_ZN3app8lua_bind35ControlModule__get_stick_angle_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_stick_dir(u64) asm("_ZN3app8lua_bind33ControlModule__get_stick_dir_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 get_stick_prev_y(u64) asm("_ZN3app8lua_bind36ControlModule__get_stick_prev_y_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
|
|
128
source/training/input_recorder.hpp
Normal file
128
source/training/input_recorder.hpp
Normal file
|
@ -0,0 +1,128 @@
|
|||
#pragma once
|
||||
#include "common.hpp"
|
||||
|
||||
typedef struct FrameInput {
|
||||
int cat1_flag;
|
||||
int cat2_flag;
|
||||
int cat3_flag;
|
||||
int cat4_flag;
|
||||
int pad_flag;
|
||||
float stick_x;
|
||||
float stick_y;
|
||||
} FrameInput;
|
||||
|
||||
#define NUM_FRAME_INPUTS 60
|
||||
FrameInput frame_inputs[NUM_FRAME_INPUTS];
|
||||
int curr_frame = 0;
|
||||
|
||||
#define NUM_PRE_FRAME 60
|
||||
int curr_pre_frame = 0;
|
||||
|
||||
#define INPUT_PRE_RECORDING 1
|
||||
#define INPUT_RECORDING 2
|
||||
#define INPUT_PLAYBACK 3
|
||||
int INPUT_RECORD_STATE = NONE;
|
||||
|
||||
namespace InputRecorder {
|
||||
|
||||
int get_command_flag_cat(u64 module_accessor, int category, int flag, bool& replace) {
|
||||
if (is_training_mode()) {
|
||||
if (is_operation_cpu(module_accessor)) {
|
||||
if (INPUT_RECORD_STATE == INPUT_PRE_RECORDING)
|
||||
; // Set color overlay to red
|
||||
|
||||
if (INPUT_RECORD_STATE == INPUT_RECORDING ||
|
||||
INPUT_RECORD_STATE == INPUT_PLAYBACK) {
|
||||
if (INPUT_RECORD_STATE == INPUT_RECORDING)
|
||||
; // Set color overlay to blue
|
||||
else {
|
||||
; // Reset color overlay
|
||||
replace = true;
|
||||
if (category == 0)
|
||||
return frame_inputs[curr_frame].cat1_flag;
|
||||
else if (category == 1)
|
||||
return frame_inputs[curr_frame].cat2_flag;
|
||||
else if (category == 2)
|
||||
return frame_inputs[curr_frame].cat3_flag;
|
||||
else if (category == 3)
|
||||
return frame_inputs[curr_frame].cat4_flag;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (INPUT_RECORD_STATE == NONE) {
|
||||
if (ControlModule::check_button_on(module_accessor, CONTROL_PAD_BUTTON_CATCH) &&
|
||||
ControlModule::check_button_trigger(module_accessor, CONTROL_PAD_BUTTON_APPEAL_S_L))
|
||||
INPUT_RECORD_STATE = INPUT_PRE_RECORDING;
|
||||
} else if (INPUT_RECORD_STATE == INPUT_PRE_RECORDING) {
|
||||
if (category == FIGHTER_PAD_COMMAND_CATEGORY1) {
|
||||
curr_pre_frame++;
|
||||
if (curr_pre_frame == NUM_PRE_FRAME - 1) {
|
||||
INPUT_RECORD_STATE = INPUT_RECORDING;
|
||||
curr_pre_frame = 0;
|
||||
}
|
||||
}
|
||||
} else if (INPUT_RECORD_STATE == INPUT_RECORDING) {
|
||||
if (category == FIGHTER_PAD_COMMAND_CATEGORY1) {
|
||||
curr_frame++;
|
||||
frame_inputs[curr_frame] = FrameInput{
|
||||
flag,
|
||||
ControlModule::get_command_flag_cat(module_accessor, 1),
|
||||
ControlModule::get_command_flag_cat(module_accessor, 2),
|
||||
ControlModule::get_command_flag_cat(module_accessor, 3),
|
||||
ControlModule::get_pad_flag(module_accessor),
|
||||
ControlModule::get_stick_x(module_accessor),
|
||||
ControlModule::get_stick_y(module_accessor),
|
||||
};
|
||||
|
||||
if (curr_frame == NUM_FRAME_INPUTS - 1) {
|
||||
INPUT_RECORD_STATE = INPUT_PLAYBACK;
|
||||
curr_frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
replace = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_pad_flag(u64 module_accessor, bool& replace) {
|
||||
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
||||
if (INPUT_RECORD_STATE == INPUT_RECORDING ||
|
||||
INPUT_RECORD_STATE == INPUT_PLAYBACK) {
|
||||
replace = true;
|
||||
return frame_inputs[curr_frame].pad_flag;
|
||||
}
|
||||
}
|
||||
|
||||
replace = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
float get_stick_x(u64 module_accessor, bool& replace) {
|
||||
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
||||
if (INPUT_RECORD_STATE == INPUT_RECORDING ||
|
||||
INPUT_RECORD_STATE == INPUT_PLAYBACK) {
|
||||
replace = true;
|
||||
return frame_inputs[curr_frame].stick_x;
|
||||
}
|
||||
}
|
||||
|
||||
replace = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
float get_stick_y(u64 module_accessor, bool& replace) {
|
||||
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
||||
if (INPUT_RECORD_STATE == INPUT_RECORDING ||
|
||||
INPUT_RECORD_STATE == INPUT_PLAYBACK) {
|
||||
replace = true;
|
||||
return frame_inputs[curr_frame].stick_y;
|
||||
}
|
||||
}
|
||||
|
||||
replace = false;
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue