From 5f43b9f39225e522fdd060f529c095a44d187585 Mon Sep 17 00:00:00 2001 From: UNSTOP4BLE Date: Thu, 4 Apr 2024 23:56:44 +0200 Subject: [PATCH] fix broken hitwindows --- build_all.sh | 7 ++++--- build_chart.sh | 1 + src/main.cpp | 2 ++ src/playstate.cpp | 12 ++++++------ src/psp/input.cpp | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/build_all.sh b/build_all.sh index 673665d..7ac8abd 100644 --- a/build_all.sh +++ b/build_all.sh @@ -1,5 +1,6 @@ -export PSPDEV=/usr/local/pspdev -export PATH=$PATH:$PSPDEV/bin -cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE="${PSPDEV}/psp/share/pspdev.cmake" +#!/bin/bash +cmake -S ./cht2bin -B ./cht2bin/build +cmake --build ./cht2bin/build +cmake --preset "psp-release" cmake --build ./build ./build_chart.sh diff --git a/build_chart.sh b/build_chart.sh index 91d8c71..527ca31 100644 --- a/build_chart.sh +++ b/build_chart.sh @@ -1,3 +1,4 @@ +#!/bin/bash cht2bin/build/cht2bin assets/songs/bopeebo/bopeebo.json build/assets/songs/bopeebo/bopeebo.bin cht2bin/build/cht2bin assets/songs/fresh/fresh.json build/assets/songs/fresh/fresh.bin cht2bin/build/cht2bin assets/songs/frostbite/frostbite.json build/assets/songs/frostbite/frostbite.bin diff --git a/src/main.cpp b/src/main.cpp index a7bd262..0b1c2cc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,7 +78,9 @@ int main() auto last = std::chrono::high_resolution_clock::now(); GFX::clear(app->screenCol); +#ifndef PSP SDL_PumpEvents(); +#endif /* if (Input::windowClosed()) { // all this should probably be moved to app->quit() or a similar function diff --git a/src/playstate.cpp b/src/playstate.cpp index 4171de3..3bb9a08 100644 --- a/src/playstate.cpp +++ b/src/playstate.cpp @@ -100,11 +100,11 @@ void PlayStateScreen::initscr(std::string song) { notePos.opponent[3] = {147, 14}; //set up ratings and timings (kinda stolen off of psych engine lmao) - //setRating(Rating &rating, std::string name, int score, bool splash, float ratingmod, int hitwindow) - ratingData.emplace_back("sick", 350, true, 1, 45); - ratingData.emplace_back("good", 200, false, 0.7, 90); - ratingData.emplace_back("bad", 100, false, 0.4, 135); - ratingData.emplace_back("shit", 50, false, 0, 165); + //Rating(std::string name, int hitwindow, float ratingmod, int score, bool splash); + ratingData.emplace_back("sick", 45, 1, 350, true); + ratingData.emplace_back("good", 90, 0.7, 200, false); + ratingData.emplace_back("bad", 135, 0.4, 100, false); + ratingData.emplace_back("shit", 165, 0, 50, false); app->parser.chartdata.speed /= 5; } @@ -167,7 +167,7 @@ void PlayStateScreen::update(void) } else { - app->parser.songTime += app->timer.elapsedS()*1000; + app->parser.songTime += app->timer.elapsedS(); //song start if (app->parser.curStep <= 0) diff --git a/src/psp/input.cpp b/src/psp/input.cpp index e023703..a890db5 100644 --- a/src/psp/input.cpp +++ b/src/psp/input.cpp @@ -12,8 +12,8 @@ namespace Input { #ifdef PSP static const uint32_t pspMapping[NUM_BUTTONS]{ - PSP_CTRL_UP | PSP_CTRL_TRIANGLE, // GAME_UP - PSP_CTRL_DOWN | PSP_CTRL_CROSS, // GAME_DOWN + PSP_CTRL_UP | PSP_CTRL_TRIANGLE | PSP_CTRL_RTRIGGER, // GAME_UP + PSP_CTRL_DOWN | PSP_CTRL_CROSS | PSP_CTRL_LTRIGGER, // GAME_DOWN PSP_CTRL_LEFT | PSP_CTRL_SQUARE, // GAME_LEFT PSP_CTRL_RIGHT | PSP_CTRL_CIRCLE, // GAME_RIGHT PSP_CTRL_START, // GAME_PAUSE