Skip to content

Commit 75ea7a2

Browse files
authored
Merge branch 'shadps4-emu:main' into Main
2 parents ea11f5f + 10d29cc commit 75ea7a2

File tree

19 files changed

+431
-109
lines changed

19 files changed

+431
-109
lines changed

.reuse/dep5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ License: MIT
5858
Files: externals/tracy/*
5959
Copyright: 2017-2024 Bartosz Taudul <[email protected]>
6060
License: BSD-3-Clause
61+
62+
Files: src/imgui/renderer/fonts/NotoSansJP-Regular.ttf
63+
Copyright: 2012 Google Inc. All Rights Reserved.
64+
License: OFL-1.1

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ set(COMMON src/common/logging/backend.cpp
360360
src/common/debug.h
361361
src/common/disassembler.cpp
362362
src/common/disassembler.h
363+
src/common/elf_info.h
363364
src/common/endian.h
364365
src/common/enum.h
365366
src/common/io_file.cpp
@@ -810,6 +811,11 @@ add_subdirectory(${HOST_SHADERS_INCLUDE})
810811
add_dependencies(shadps4 host_shaders)
811812
target_include_directories(shadps4 PRIVATE ${HOST_SHADERS_INCLUDE})
812813

814+
# ImGui resources
815+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/renderer)
816+
add_dependencies(shadps4 ImGui_Resources)
817+
target_include_directories(shadps4 PRIVATE ${IMGUI_RESOURCES_INCLUDE})
818+
813819
if (ENABLE_QT_GUI)
814820
set_target_properties(shadps4 PROPERTIES
815821
# WIN32_EXECUTABLE ON

LICENSES/OFL-1.1.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
SIL OPEN FONT LICENSE
2+
3+
Version 1.1 - 26 February 2007
4+
5+
PREAMBLE
6+
7+
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
8+
9+
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
10+
11+
DEFINITIONS
12+
13+
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
14+
15+
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
16+
17+
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
18+
19+
"Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
20+
21+
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
22+
23+
PERMISSION & CONDITIONS
24+
25+
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
26+
27+
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
28+
29+
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
30+
31+
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
32+
33+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
34+
35+
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
36+
37+
TERMINATION
38+
39+
This license becomes null and void if any of the above conditions are not met.
40+
41+
DISCLAIMER
42+
43+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

src/common/elf_info.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
2+
// SPDX-License-Identifier: GPL-2.0-or-later
3+
4+
#pragma once
5+
6+
#include <string>
7+
#include <string_view>
8+
9+
#include "assert.h"
10+
#include "singleton.h"
11+
#include "types.h"
12+
13+
namespace Core {
14+
class Emulator;
15+
}
16+
17+
namespace Common {
18+
19+
class ElfInfo {
20+
friend class Core::Emulator;
21+
22+
bool initialized = false;
23+
24+
std::string game_serial{};
25+
std::string title{};
26+
std::string app_ver{};
27+
u32 firmware_ver = 0;
28+
u32 raw_firmware_ver = 0;
29+
30+
public:
31+
static constexpr u32 FW_15 = 0x1500000;
32+
static constexpr u32 FW_16 = 0x1600000;
33+
static constexpr u32 FW_17 = 0x1700000;
34+
static constexpr u32 FW_20 = 0x2000000;
35+
static constexpr u32 FW_25 = 0x2500000;
36+
static constexpr u32 FW_30 = 0x3000000;
37+
static constexpr u32 FW_40 = 0x4000000;
38+
static constexpr u32 FW_45 = 0x4500000;
39+
static constexpr u32 FW_50 = 0x5000000;
40+
static constexpr u32 FW_80 = 0x8000000;
41+
42+
static ElfInfo& Instance() {
43+
return *Singleton<ElfInfo>::Instance();
44+
}
45+
46+
[[nodiscard]] std::string_view GameSerial() const {
47+
ASSERT(initialized);
48+
return Instance().game_serial;
49+
}
50+
51+
[[nodiscard]] std::string_view Title() const {
52+
ASSERT(initialized);
53+
return title;
54+
}
55+
56+
[[nodiscard]] std::string_view AppVer() const {
57+
ASSERT(initialized);
58+
return app_ver;
59+
}
60+
61+
[[nodiscard]] u32 FirmwareVer() const {
62+
ASSERT(initialized);
63+
return firmware_ver;
64+
}
65+
66+
[[nodiscard]] u32 RawFirmwareVer() const {
67+
ASSERT(initialized);
68+
return raw_firmware_ver;
69+
}
70+
};
71+
72+
} // namespace Common

src/core/libraries/kernel/file_system.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) {
8989
}
9090
// RW, then scekernelWrite is called and savedata is written just fine now.
9191
e = file->f.Open(file->m_host_name, Common::FS::FileAccessMode::ReadWrite);
92+
} else if (write) {
93+
e = file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Write);
9294
} else {
9395
UNREACHABLE();
9496
}

src/core/libraries/kernel/libkernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "common/assert.h"
1010
#include "common/debug.h"
11+
#include "common/elf_info.h"
1112
#include "common/logging/log.h"
1213
#include "common/polyfill_thread.h"
1314
#include "common/singleton.h"
@@ -243,8 +244,7 @@ int PS4_SYSV_ABI sceKernelConvertUtcToLocaltime(time_t time, time_t* local_time,
243244
}
244245

245246
int PS4_SYSV_ABI sceKernelGetCompiledSdkVersion(int* ver) {
246-
auto* param_sfo = Common::Singleton<PSF>::Instance();
247-
int version = param_sfo->GetInteger("SYSTEM_VER").value_or(0x4700000);
247+
int version = Common::ElfInfo::Instance().RawFirmwareVer();
248248
LOG_INFO(Kernel, "returned system version = {:#x}", version);
249249
*ver = version;
250250
return (version > 0) ? ORBIS_OK : ORBIS_KERNEL_ERROR_EINVAL;

src/core/libraries/save_data/dialog/savedatadialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
22
// SPDX-License-Identifier: GPL-2.0-or-later
33

4+
#include "common/elf_info.h"
45
#include "common/logging/log.h"
56
#include "core/libraries/libs.h"
67
#include "core/libraries/system/commondialog.h"

0 commit comments

Comments
 (0)