mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-01-20 09:20:13 +00:00
add debugging capability with syslogger
This commit is contained in:
parent
013d637983
commit
d918ee3fae
5 changed files with 46 additions and 9 deletions
4
Makefile
4
Makefile
|
@ -45,7 +45,9 @@ CFLAGS := -Wall -O2 \
|
|||
-ffast-math \
|
||||
$(ARCH) $(DEFINES)
|
||||
|
||||
CFLAGS += $(INCLUDE) -DSWITCH
|
||||
TIMESTAMP := $(shell date "+%m/%d %I:%M%p")
|
||||
|
||||
CFLAGS += $(INCLUDE) -DSWITCH -DBUILD_TS='"$(TIMESTAMP)"'
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -g3 -fno-rtti -Wno-parentheses -Wno-write-strings -Wno-int-to-pointer-cast -std=gnu++11
|
||||
|
||||
|
|
|
@ -80,20 +80,15 @@ void set_rebound_replace(u64 module_accessor, bool rebound) {
|
|||
}
|
||||
} // namespace app::lua_bind::GrabModule
|
||||
|
||||
Vector3f EffectModule_last_get_scale_w(u64 effect_module) {
|
||||
Vector3f ret;
|
||||
void EffectModule_last_get_scale_w(u64 effect_module, Vector3f* scale) {
|
||||
uint handle = *(uint *)(effect_module + 36);
|
||||
if (handle && (signed int)handle >= 1) {
|
||||
u64 effect = LOAD64(effect_manager_addr) + 768 * (handle >> 24);
|
||||
bool is_exist_effect = effect && *(uint *)(effect + 4) == handle;
|
||||
if (is_exist_effect) {
|
||||
float *scale = (float *)(effect + 256);
|
||||
ret.x = *(float *)(scale);
|
||||
ret.y = *(float *)(scale + 1);
|
||||
ret.z = *(float *)(scale + 2);
|
||||
*scale = *(Vector3f *)(effect + 256);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void generate_hitbox_effects(L2CAgent *l2c_agent, L2CValue *bone,
|
||||
|
|
|
@ -73,7 +73,11 @@ int sprintf_intercept(char* s, const char* format, ...) {
|
|||
minor = va_arg(vl, int);
|
||||
patch = va_arg(vl, int);
|
||||
va_end(vl);
|
||||
#if defined(DEBUG) && defined(BUILD_TS)
|
||||
return vsprintf(s, BUILD_TS, vl);
|
||||
#else
|
||||
return vsprintf(s, "Training Mods v1.5", vl);
|
||||
#endif
|
||||
}
|
||||
va_list vl;
|
||||
va_start(vl,format);
|
||||
|
@ -117,5 +121,16 @@ int main(int argc, char* argv[]) {
|
|||
SaltySDCore_fclose(f);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
f = SaltySDCore_fopen("sdmc:/SaltySD/syslog.conf", "w");
|
||||
if (f) {
|
||||
SaltySD_printf("Writing config file...\n");
|
||||
char buffer[20];
|
||||
snprintf(buffer, 20, "%lx", (u64)&logger);
|
||||
SaltySDCore_fwrite(buffer, strlen(buffer), 1, f);
|
||||
SaltySDCore_fclose(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
__libnx_exit(0);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,22 @@
|
|||
#include "useful/const_value_table.h"
|
||||
#include "../taunt_toggles.h"
|
||||
|
||||
// Uncomment the line below to debug using syslogger.
|
||||
// #define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
struct LogPacket
|
||||
{
|
||||
bool dirty = false;
|
||||
bool to_sd = false;
|
||||
char buffer[256];
|
||||
} logger;
|
||||
|
||||
#define syslog(...) snprintf(logger.buffer, 256, __VA_ARGS__); logger.dirty = true; logger.to_sd = true;
|
||||
#else
|
||||
#define syslog(...)
|
||||
#endif
|
||||
|
||||
using namespace app::lua_bind;
|
||||
|
||||
int major, minor, patch;
|
||||
|
|
|
@ -152,6 +152,15 @@ bool check_button_on(u64 module_accessor, int button, bool& replace) {
|
|||
}
|
||||
}
|
||||
|
||||
if (button == CONTROL_PAD_BUTTON_ATTACK || button == CONTROL_PAD_BUTTON_CATCH) {
|
||||
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
||||
if (menu.MASH_STATE == MASH_ATTACK && menu.ATTACK_STATE == MASH_GRAB && is_in_shieldstun(module_accessor)) {
|
||||
replace = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
replace = false;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue