Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Common/Data/Text/Parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ std::string NiceSizeFormat(uint64_t size) {

std::string NiceTimeFormat(int seconds) {
auto di = GetI18NCategory(I18NCat::DIALOG);
if (seconds < 60) {
if (seconds < 120) {
return StringFromFormat(di->T_cstr("%d seconds"), seconds);
} else if (seconds < 60 * 60) {
} else if (seconds < 120 * 60) {
int minutes = seconds / 60;
return StringFromFormat(di->T_cstr("%d minutes"), minutes);
} else {
Expand Down
2 changes: 2 additions & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ struct Config : public ConfigBlock {
Path internalDataDirectory;
Path appCacheDirectory;

Path mountRoot; // Actually, mount as host0. keeping consistent with headless args.

void Load(const char *iniFileName = nullptr, const char *controllerIniFilename = nullptr);
bool Save(const char *saveReason);
void Reload();
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static u32 sceMpegRingbufferConstruct(u32 ringbufferAddr, u32 numPackets, u32 da
if (ring->semaID != 0) {
// I'm starting to think this is just padding or something.
// It's not written by this function.
WARN_LOG(Log::Mpeg, "Detected semaID %d", ring->semaID);
WARN_LOG(Log::Mpeg, "Detected 'semaID' (might not be) %d (%08x)", ring->semaID, ring->semaID);
}
ring->mpeg = 0;
// This isn't in ver 0104, but it is in 0105.
Expand Down
26 changes: 14 additions & 12 deletions UI/Background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,19 @@ class FloatingSymbolsAnimation : public Animation {
}

void Draw(UIContext &dc, double t, float alpha, float x, float y, float z) override {
dc.Flush();
dc.Begin();
float xres = dc.GetBounds().w;
float yres = dc.GetBounds().h;

dc.Flush();
dc.Begin();
if (last_xres != xres || last_yres != yres) {
Regenerate(xres, yres);
}

for (int i = 0; i < COUNT; i++) {
float x = xbase[i] + dc.GetBounds().x;
float y = ybase[i] + dc.GetBounds().y + 40 * cosf(i * 7.2f + t * 1.3f);
float angle = (float)sin(i + t);
for (size_t i = 0; i < base.size(); i++) {
const float x = base[i].x + dc.GetBounds().x;
const float y = base[i].y + dc.GetBounds().y + 40 * cosf(i * 7.2f + t * 1.3f);
const float angle = sinf(i + t);
int n = i & 3;
Color color = is_colored ? colorAlpha(COLORS[n], alpha * 0.25f) : colorAlpha(DEFAULT_COLOR, alpha * 0.1f);
ui_draw2d.DrawImageRotated(SYMBOLS[n], x, y, 1.0f, angle, color);
Expand All @@ -138,22 +139,23 @@ class FloatingSymbolsAnimation : public Animation {
}

private:
static constexpr int COUNT = 100;
static constexpr Color DEFAULT_COLOR = 0xC0FFFFFF;
static constexpr Color COLORS[4] = {0xFFE3B56F, 0xFF615BFF, 0xFFAA88F3, 0xFFC2CC7A,}; // X O D A
static const ImageID SYMBOLS[4];

bool is_colored = false;
float xbase[COUNT]{};
float ybase[COUNT]{};
std::vector<Point2D> base;
float last_xres = 0;
float last_yres = 0;

void Regenerate(int xres, int yres) {
int count = xres * yres / (120.0f * 120.0f);
base.resize(count);

GMRng rng;
for (int i = 0; i < COUNT; i++) {
xbase[i] = rng.F() * xres;
ybase[i] = rng.F() * yres;
rng.Init(time_now_d() * 100239);
for (size_t i = 0; i < base.size(); i++) {
base[i] = { rng.F() * xres, rng.F() * yres };
}

last_xres = xres;
Expand Down
2 changes: 1 addition & 1 deletion UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void EmuScreen::ProcessGameBoot(const Path &filename) {
coreParam.enableSound = g_Config.bEnableSound;
coreParam.fileToStart = filename;
coreParam.mountIso.clear();
coreParam.mountRoot.clear();
coreParam.mountRoot = g_Config.mountRoot;
coreParam.startBreak = !g_Config.bAutoRun;
coreParam.headLess = false;

Expand Down
12 changes: 2 additions & 10 deletions UI/MainScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,7 @@ void GameButton::Draw(UIContext &dc) {
// Super simple drawing for GE dumps.
dc.PushScissor(bounds_);
const std::string currentTitle = ginfo->GetTitle();
dc.SetFontScale(0.6f * g_Config.fGameGridScale, 0.6f * g_Config.fGameGridScale);
dc.DrawText(title_, bounds_.x + 4.0f, bounds_.centerY(), style.fgColor, ALIGN_VCENTER | ALIGN_LEFT);
dc.SetFontScale(1.0f, 1.0f);
title_ = currentTitle;
dc.Draw()->Flush();
dc.PopScissor();
Expand Down Expand Up @@ -479,14 +477,11 @@ void DirButton::Draw(UIContext &dc) {

bool compact = bounds_.w < 180 * (gridStyle_ ? g_Config.fGameGridScale : 1.0);

if (gridStyle_) {
dc.SetFontScale(g_Config.fGameGridScale, g_Config.fGameGridScale);
}
if (compact) {
// No folder icon, except "up"
dc.PushScissor(bounds_);
if (image == ImageID("I_FOLDER") || image == ImageID("I_FOLDER_PINNED")) {
dc.DrawText(text, bounds_.x + 5, bounds_.centerY(), style.fgColor, ALIGN_VCENTER);
dc.DrawTextRect(text, bounds_.Inset(5, 2), style.fgColor, ALIGN_VCENTER | FLAG_WRAP_TEXT);
if (pinned_) {
ImageID pinID = ImageID("I_PIN");
const AtlasImage *pinImg = dc.Draw()->GetAtlas()->getImage(pinID);
Expand All @@ -503,15 +498,12 @@ void DirButton::Draw(UIContext &dc) {
scissor = true;
}
dc.Draw()->DrawImage(image, bounds_.x + 72, bounds_.centerY(), 0.88f*(gridStyle_ ? g_Config.fGameGridScale : 1.0), style.fgColor, ALIGN_CENTER);
dc.DrawText(text, bounds_.x + 150, bounds_.centerY(), style.fgColor, ALIGN_VCENTER);
dc.DrawText(text, bounds_.x + 150, bounds_.centerY(), style.fgColor, ALIGN_VCENTER| FLAG_WRAP_TEXT);

if (scissor) {
dc.PopScissor();
}
}
if (gridStyle_) {
dc.SetFontScale(1.0, 1.0);
}
}

GameBrowser::GameBrowser(int token, const Path &path, BrowseFlags browseFlags, bool portrait, bool *gridStyle, ScreenManager *screenManager, std::string_view lastText, std::string_view lastLink, UI::LayoutParams *layoutParams)
Expand Down
5 changes: 5 additions & 0 deletions UI/NativeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
forceLogLevel = true;
};

// TODO: Need a much better command line argument parser.

for (int i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
#if defined(__APPLE__)
Expand Down Expand Up @@ -581,6 +583,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
g_Config.iForceFullScreen = 1;
System_ToggleFullscreenState("1");
}
if (!strncmp(argv[i], "--root=", strlen("--root=")) && strlen(argv[i]) > strlen("--root=")) {
g_Config.mountRoot = Path(argv[i] + strlen("--root="));
}
if (!strcmp(argv[i], "--windowed")) {
g_Config.iForceFullScreen = 0;
System_ToggleFullscreenState("0");
Expand Down
Loading