Compare commits

..

12 Commits

Author SHA1 Message Date
lizzie 8c96d59e4b fix some dumb mods 2026-09-03 00:46:19 +00:00
lizzie 018210b756 ok fix for realsies 2026-09-02 23:30:50 +00:00
lizzie 4fc754a5b7 fuix2 2026-09-02 22:52:34 +00:00
lizzie 0b9770764f negative fix 2026-09-02 22:52:34 +00:00
lizzie 3f6e73290f rework to be better pointer logic 2026-09-02 22:52:34 +00:00
lizzie a4184b440f fix negative pointers 2026-09-02 22:52:34 +00:00
lizzie 367884e453 fumbling sv ctor again 2026-09-02 22:52:34 +00:00
lizzie f7a09f04dd me when messup 2026-09-02 22:52:34 +00:00
lizzie 5581da1fb6 fuck windows 2026-09-02 22:52:34 +00:00
lizzie b58a265336 fix sv construct 2026-09-02 22:52:34 +00:00
lizzie d8832cef70 fix tomo again 2026-09-02 22:52:34 +00:00
lizzie f86995a3b4 [ips_layer] fix TLTD 60 FPS mod specifically
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-09-02 22:52:34 +00:00
4 changed files with 19 additions and 19 deletions
+12 -5
View File
@@ -120,7 +120,7 @@ std::array<u8, 32> IPSwitchCompiler::GetBuildID() const {
static IPSwitchRecord EscapeStringSequences(std::string_view sv) {
IPSwitchRecord r{};
for (auto it = sv.cbegin(); it != sv.cend(); ) {
for (auto it = sv.cbegin(); it < sv.cend(); ) {
if (*it == '\\' && it + 1 < sv.cend()) {
switch (it[1]) {
case 'a': r.data[r.count] = '\a'; break;
@@ -198,6 +198,8 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
LOG_WARNING(Loader, "Unknown flag {}", line);
break;
}
} else if (patches.empty()) {
LOG_WARNING(Loader, "Invalid line not in a patch {}", line);
} else {
size_t offset = size_t(std::strtoul(line.data(), nullptr, 16));
offset += size_t(offset_shift);
@@ -253,25 +255,30 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
// now make a nominal preprocessed line: remove comments
char quote = '\0';
auto const sline_start = p;
auto last_char = p;
for (; p < sline.cend(); ) {
// we dont check for "//", IPS checks for '/' only...
if ((!quote && p[0] == '/')
if (std::isspace(*p)) {
++p;
} else if ((!quote && p[0] == '/')
|| (!quote && p[0] == '#')) {
break;
} else if (p[0] == '\"' || p[0] == '\'') {
quote = (p[0] == quote) ? '\0' : p[0];
++p;
last_char = p;
} else if (p + 1 < sline.cend() && p[0] == '\\') {
p += 2;
last_char = p;
} else {
++p;
last_char = p;
}
}
// now we have the preprocessed string ;)
std::string_view pp_str(sline_start, p);
if (pp_str.size() > 0 && !parse_line(pp_str)) {
std::string_view const pp_str(sline_start, last_char);
if (pp_str.size() > 0 && !parse_line(pp_str))
break;
}
}
}
}
+7 -5
View File
@@ -552,13 +552,15 @@ void GRenderWindow::ConstrainMouse() {
const auto pos = mapFromGlobal(QCursor::pos());
const int new_pos_x = std::clamp(pos.x(), 0, width());
const int new_pos_y = std::clamp(pos.y(), 0, height());
QCursor::setPos(mapToGlobal(QPoint{new_pos_x, new_pos_y}));
} else {
const int center_x = width() / 2;
const int center_y = height() / 2;
QCursor::setPos(mapToGlobal(QPoint{center_x, center_y}));
return;
}
input_subsystem->GetMouse()->NotifyChanged(); // required to reset mouse once it's no longer moved
const int center_x = width() / 2;
const int center_y = height() / 2;
QCursor::setPos(mapToGlobal(QPoint{center_x, center_y}));
}
void GRenderWindow::wheelEvent(QWheelEvent* event) {
@@ -37,16 +37,10 @@ EmuWindow_SDL3::EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Co
SDL_SetWindowTitle(this_->render_window, title.c_str());
return 2000;
}, this);
mouse_timer = SDL_AddTimer(100, [](void *userdata, SDL_TimerID, Uint32) -> Uint32 {
auto* this_ = (EmuWindow_SDL3*)userdata;
this_->input_subsystem->GetMouse()->NotifyChanged();
return 100;
}, this);
}
EmuWindow_SDL3::~EmuWindow_SDL3() {
SDL_RemoveTimer(titlebar_timer);
SDL_RemoveTimer(mouse_timer);
system.HIDCore().UnloadInputDevices();
input_subsystem->Shutdown();
SDL_Quit();
@@ -84,9 +84,6 @@ protected:
/// Periodic changer of titlebar (independent of event loop)
SDL_TimerID titlebar_timer;
// Mouse resetter once it
SDL_TimerID mouse_timer;
/// Is the window still open?
bool is_open = true;