Merge branch 'features' into net-things

This commit is contained in:
igor725 2024-04-20 13:49:49 +03:00
commit 0d91f282fb
No known key found for this signature in database
GPG Key ID: 46F13BBE46F8569D
23 changed files with 153 additions and 81 deletions

View File

@ -8,10 +8,10 @@ AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignEscapedNewlines: Right
AlignOperands: Align
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
PackConstructorInitializers: NextLine
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
@ -57,14 +57,12 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 160
CommentPragmas: '^ IWYU pragma:'
ColumnLimit: 160
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
SeparateDefinitionBlocks: Always
@ -73,40 +71,17 @@ ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
- FOR
- FOR_HASH
StatementAttributeLikeMacros:
- Q_EMIT
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(Kyty)/'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^"(Emulator)/'
- Regex: '^<'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^"(gtest)/'
Priority: 4
SortPriority: 0
CaseSensitive: false
- Regex: '^<Q'
Priority: 5
SortPriority: 0
CaseSensitive: false
- Regex: '"ui_'
Priority: 6
SortPriority: 0
CaseSensitive: false
- Regex: '^<'
Priority: 7
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '$'
@ -117,21 +92,16 @@ IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 2
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
@ -142,8 +112,8 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
ReflowComments: true
SortIncludes: true
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
@ -158,28 +128,21 @@ SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesInParensOptions:
InEmptyParentheses: false
InCStyleCasts: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: true
UseTab: Never
Standard: Latest
LineEnding: LF
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

View File

@ -2,6 +2,7 @@ name: upload wiki
on:
push:
branches: [main]
paths:
- '.github/workflows/upwiki.yml'
- 'docs/wiki/**'
@ -30,7 +31,7 @@ jobs:
- name: Push wiki content
run: |
rsync -av --delete main_repo/docs/wiki/ wiki_repo/ --exclude .git;
rsync -av --delete main_repo/docs/wiki/markdown/ wiki_repo/ --exclude .git;
cd wiki_repo;
git add .;
if git commit -m "Update wiki content"; then

View File

@ -3,12 +3,11 @@
#include "pthread.h"
#include "semaphore.h"
#include <queue>
#include <boost/chrono.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/mutex.hpp>
#include <map>
#include <queue>
LOG_DEFINE_MODULE(Semaphore);

View File

@ -85,7 +85,11 @@ struct HttpConnection {
ip::tcp::socket* socket = nullptr;
HttpConnection(HttpTemplate* parentTemplate, const char* serverName, const char* scheme, uint16_t port, int isEnableKeepalive, bool shouldFreeStrings)
: parentTemplate(parentTemplate), serverName(serverName), scheme(scheme), port(port), isEnableKeepalive(isEnableKeepalive),
: parentTemplate(parentTemplate),
serverName(serverName),
scheme(scheme),
port(port),
isEnableKeepalive(isEnableKeepalive),
shouldFreeStrings(shouldFreeStrings) {}
};

View File

@ -20,8 +20,6 @@
#include "modules_include/common.h"
#include "vulkan/vulkanHelper.h"
#include <queue>
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
#include <algorithm>
@ -34,6 +32,7 @@
#include <memory>
#include <mutex>
#include <optick.h>
#include <queue>
#include <thread>
LOG_DEFINE_MODULE(VideoOut);

23
docs/README.md Normal file
View File

@ -0,0 +1,23 @@
# Docs README
## Wiki update rules
### General rules
1. You should not put anything to root wiki directory (`docs/wiki/`);
2. All the `.md` files should go to `docs/wiki/markdown/` folder;
3. Your links should not lead to shady sites;
4. If you removed screenshot from the markdown code then delete the image itself in the `docs/wiki/markdown/images/` folder.
### Name your wiki files properly!
1. Do not use the following characters in your wiki page's titles: `\ / : * ? " < > |`;
2. Use `-` sign instead of space;
3. Too long name is not good at all, keep it ~32 chars long maximum;
4. It's cool that GitHub's markup engine supports so much markup languages, but keep it `md` for consistency, please. Markdowns are the easiest to maintain and most common pretty everywhere;
5. You should write wiki pages **only** in English. We also do not accept translated pages there since GitHub does not support them. The wiki would be a mess if we did accept these changes.
### Add screenshots if needed!
1. Don't do it too often;
2. Add screenshots that will actually help;
3. Draw eye directing arrows or circles of some kind on them, if possible and necessary;
4. Screenshots should be uploaded to this repository only, there are special folder for these: `docs/wiki/images/`, just use relative \(`/docs/wiki/images/image.png`\) links to add them in your markdown page;
5. Give your screenshots meaningful file names and put them in sub-directories so they don't get lost.

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

View File

@ -7,44 +7,44 @@
When you open psOff repository with VSCode for the first time, it will show you the notification about installing recommended extensions. You should click `Show Recommenadtions` there.
![Code_2024-03-31_18-53-20](https://github.com/igor725/psOff_public/assets/40758030/cf68c43d-880e-455d-861f-e79dd5fbc346)
![recomends_btn](/docs/wiki/images/vsbuild/recomends_btn.png)
If you missed this notification, then press `Ctrl+Shift+P` and type `Focus on Workspace Recommendations View` and perss this button.
![WindowsSandboxClient_2024-03-31_18-57-38](https://github.com/igor725/psOff_public/assets/40758030/0f880db8-99d3-45a8-bf58-ffd670c83ae7)
![recomends_help](/docs/wiki/images/vsbuild/recomends_help.png)
Now you'll see the sidebar with all the recommended extensions, you should install all of them. Or just press the `Install Workspace Recommended Extensions` button above, the one with the cloud icon.
![WindowsSandboxClient_2024-03-31_18-53-44](https://github.com/igor725/psOff_public/assets/40758030/f26d29ef-6d83-4dcd-9b6d-54a123f1730f)
![recomends_install](/docs/wiki/images/vsbuild/recomends_install.png)
It is recommended to restart the VSCode after you finish installing all the recommended extensions.
All you have to do now is switch the default compiler to `clang-cl` if it didn't set automatically and set build target to Release.
![WindowsSandboxClient_2024-03-31_18-55-18](https://github.com/igor725/psOff_public/assets/40758030/07a06620-e44a-4ab9-a98d-d44abd770551)
![default_compiler](/docs/wiki/images/vsbuild/default_compiler.png)
![WindowsSandboxClient_2024-03-31_18-55-26](https://github.com/igor725/psOff_public/assets/40758030/4b1c1821-d2b4-459f-905f-b06d057dcd38)
![default_compiler_popup](/docs/wiki/images/vsbuild/default_compiler_popup.png)
Make sure the CMake Extension uses it too:
![Code_2024-03-31_19-44-08](https://github.com/igor725/psOff_public/assets/40758030/d801a28f-8e57-4c1a-9c66-f45861b78e7f)
![default_compiler_sure](/docs/wiki/images/vsbuild/default_compiler_sure.png)
> [!WARNING]
> You won't be able to build the Debug version of emulator, you should switch CMake target to Release. But worry not, this target already uses debug symbols the only thing you should do to improve your debugging experience - disable compiler optimizations, open the main `CMakeLists.txt` file and change `CMAKE_CXX_FLAGS_RELEASE` flag `-Ofast` to `-O0`.
>
> ![Code_2024-03-31_19-44-15](https://github.com/igor725/psOff_public/assets/40758030/0ba33d03-31c7-4b36-814d-df8b5dd90545)
> ![Code_2024-04-03_11-09-31](https://github.com/igor725/psOff_public/assets/40758030/525039ee-97e5-48d1-8aef-411e78c26466)
> ![debug_warning](/docs/wiki/images/vsbuild/debug_warning.png)
> ![optimizations](/docs/wiki/images/vsbuild/optimizations.png)
If you reading this, it seems you all set! So now you can use VSCode to build psOff modules. Just press `Ctrl+Shift+P` and type `CMake Focus` and press `CMake: Focus on Project Status View` then click on the `Configure` button first:
![firefox_2024-04-03_11-16-29](https://github.com/igor725/psOff_public/assets/40758030/446c7fb1-a4e7-4b21-8ce5-2a3586e95042)
![cmake_configure](/docs/wiki/images/vsbuild/cmake_configure.png)
Then the `Build` one:
![image](https://github.com/igor725/psOff_public/assets/40758030/e890e20c-cc88-416c-8549-c55764a0dd88)
![cmake_build](/docs/wiki/images/vsbuild/cmake_build.png)
You can add these command to `Pinned Commands` list and use them there:
![2024-04-03_11-17-57](https://github.com/igor725/psOff_public/assets/40758030/1b83e2ed-d570-437a-bb2b-8b3ccd3cf084)
![cmake_pins](/docs/wiki/images/vsbuild/cmake_pins.png)
In fact, the only button you need is `Install`. When you press it, cmake will configure the project, build it and then copy ready to use files to `_build/_Install` directory.

View File

@ -68,6 +68,23 @@ You can change the layout now in _controls.json_, if you want to.
## general.json
```jsonc
{
"netEnabled": false, // Wether enable networking features or not. Better to keep it disabled, not ready for the actual use.
"netMAC": "00:00:00:00:00:00", // Your ethernet adapter's MAC address. Zero-MAC means "first usable device".
"profiles": [ // User profiles, you can change your name there
{
"color": "blue",
"name": "Anon"
},
// More users here...
],
"systemlang": 0, // System langauge, see the list below to get these indexes
"userIndex": 1 // Current user index
}
```
Game language can be changed with systemlang : *, default is EnglishUS. Game must support it.
Japanese = 0 \
@ -103,11 +120,30 @@ Game language can be changed with systemlang : *, default is EnglishUS. Game mus
## audio.json
You can specify the audio device here and adjust the master volume
```jsonc
{
"device": "[default]", // Audio device name, [default] means system default output device
"volume": 0.05 // Master volume, 0...1
}
```
## graphics.json
Not implemented yet, no parameters there
> [!WARNING]
> The emulator updates this file every time you gracefully stop the emulation \(by closing the emulator window\)!
```jsonc
{
"display": 1, // Your display index, starting from 0
"fullscreen": false, // Wether emulator will run in fullscreen mode or not
"height": 1080, // The emulator window dimensions, ignored in fullscreen mode
"width": 1920,
"xpos": -1, // The emulator window position, -1 means center
"ypos": -1
}
```
## logging.json
@ -116,7 +152,7 @@ Not implemented yet, no parameters there
// Log output
// Possible values:
// 1) Baical - to Baical server over network
// 2) FileBin - to local binary file
// 2) FileBin - to local binary file (you should use this format to post compatibility reports)
// 3) FileTxt - to local text file
// 4) Syslog - to system log server
// 5) Console - to console

View File

@ -17,10 +17,9 @@ extern "C" {
#include <libswscale/swscale.h>
}
#include <queue>
#include <condition_variable>
#include <mutex>
#include <queue>
LOG_DEFINE_MODULE(AvPlayer);

View File

@ -77,33 +77,77 @@ EXPORT SYSV_ABI errno_t __NID(memcmp)(void* mem1, const void* mem2, size_t size)
}
EXPORT SYSV_ABI size_t __NID(strlen)(const char* str) {
return std::strlen(str);
return ::strlen(str);
}
EXPORT SYSV_ABI size_t __NID(strnlen)(const char* str, size_t max) {
return ::strnlen(str, max);
}
EXPORT SYSV_ABI errno_t __NID(strnlen_s)(const char* str, size_t max) {
return ::strnlen_s(str, max);
}
EXPORT SYSV_ABI char* __NID(strncat)(char* dst, const char* src, size_t size) {
return std::strncat(dst, src, size);
return ::strncat(dst, src, size);
}
EXPORT SYSV_ABI char* __NID(strstr)(char* haystack, const char* needle) {
return std::strstr(haystack, needle);
return ::strstr(haystack, needle);
}
EXPORT SYSV_ABI int __NID(strncmp)(const char* str1, const char* str2, size_t size) {
return std::strncmp(str1, str2, size);
return ::strncmp(str1, str2, size);
}
EXPORT SYSV_ABI char* __NID(strncpy)(char* dst, char* src, size_t len) {
return std::strncpy(dst, src, len);
return ::strncpy(dst, src, len);
}
EXPORT SYSV_ABI errno_t __NID(strncpy_s)(char* dst, size_t dstsz, const char* src, size_t count) {
return ::strncpy_s(dst, dstsz, src, count);
}
EXPORT SYSV_ABI int __NID(strcmp)(const char* str1, const char* str2) {
return std::strcmp(str1, str2);
return ::strcmp(str1, str2);
}
EXPORT SYSV_ABI char* __NID(strcpy)(char* dst, const char* src) {
return ::strcpy(dst, src);
}
EXPORT SYSV_ABI errno_t __NID(strcpy_s)(char* dst, size_t size, const char* src) {
return ::strcpy_s(dst, size, src);
}
EXPORT SYSV_ABI const char* __NID(strchr)(const char* str, int val) {
return ::strchr(str, val);
}
EXPORT SYSV_ABI errno_t __NID(strcat_s)(char* dst, size_t sz, const char* src) {
return ::strcat_s(dst, sz, src);
}
EXPORT SYSV_ABI const char* __NID(strcat)(char* dst, const char* src) {
return ::strcat(dst, src);
}
EXPORT SYSV_ABI const char* __NID(strtok)(char* str, const char* delim) {
return ::strtok(str, delim);
}
EXPORT SYSV_ABI int __NID(strcasecmp)(const char* dst, const char* src) {
return _stricmp(dst, src);
}
EXPORT SYSV_ABI char* __NID(strdup)(const char* src) {
return _strdup(src);
}
EXPORT SYSV_ABI int __NID(strncasecmp)(const char* dst, const char* src, size_t num) {
return _strnicmp(dst, src, num);
}
EXPORT SYSV_ABI float __NID(expf)(float val) {
return std::expf(val);
}
@ -116,6 +160,10 @@ EXPORT SYSV_ABI float __NID(cosf)(float val) {
return std::cosf(val);
}
EXPORT SYSV_ABI float __NID(sqrtf)(float val) {
return std::sqrtf(val);
}
EXPORT SYSV_ABI int __NID(setjmp)(unwinding_jmp_buf* jb) {
return 0;
}