Skip to content

Commit 706e995

Browse files
authored
The source code of the website (#1)
1 parent e82f78b commit 706e995

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4555
-0
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ---> Rust
2+
# Generated by Cargo
3+
# will have compiled files and executables
4+
debug/
5+
target/
6+
7+
# These are backup files generated by rustfmt
8+
**/*.rs.bk
9+
10+
# MSVC Windows builds of rustc generate these, which store debugging information
11+
*.pdb
12+
13+
.vscode
14+
stuff.txt
15+
.idea
16+
*.db
17+
.htaccess
18+
updater/images/
19+
updater/config/config.toml
20+
stats.json

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Obliteration.net
2+
3+
The website for Obliteration

mdbook/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
book

mdbook/book.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[book]
2+
authors = ["OBHQ"]
3+
description = "The wiki for Obliteration"
4+
language = "en"
5+
multilingual = false
6+
src = "src"
7+
8+
[rust]
9+
edition = "2018"
10+
11+
[build]
12+
build-dir = 'D:\Website\public_html\Gamma-Boi\wiki'
13+
create-missing = false

mdbook/src/SUMMARY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Introduction](./home.md)
2+
3+
- [Common Issues](./common_issues/common_issues.md)
4+
- [Couldn't Create a Hypervisor](./common_issues/couldnt_create_hypervisor.md)
5+
- [Compilation & Development](./compilation_development/compilation_development.md)
6+
- [Compilation](./compilation_development/compilation.md)
7+
- [Development](./compilation_development/development.md)
8+
- [Firmware Setup Guide](./firmware_setup/firmware_setup.md)
9+
- [Using FTP](./firmware_setup/using_ftp.md)
10+
- [Using Local Files](./firmware_setup/using_localfiles.md)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h1 align="center">
2+
<b>Common Issues</b>
3+
<br>
4+
<sub><sup>A list of issues with potential solutions that occur in common scenarios!</sup></sub>
5+
<br>
6+
</h1>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Couldn't Create a Hypervisor
2+
---
3+
4+
This error commonly occurs on machines that don't have virtualization enabled.
5+
6+
The way to fix this issue is to access the UEFI and enable virtualization.
7+
The name depends on what motherboard you use, it could be called AMD-V, SMV, Intel VTT, Intel VT-d, and more! Always look at documentation if you don't know how to enable virtualization!
8+
9+
If the error persists on Windows, go to Windows Features and enable Virtual Machine Platform, then reboot.*
10+
* Note, most Windows 10 and 11 installations come with VMP already installed, and only need the UEFI setting enabled.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Building from source
2+
---
3+
### Windows prerequisites
4+
5+
- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)
6+
- `Desktop development with C++` workload is required
7+
- [Rust on the latest stable channel](https://www.rust-lang.org/tools/install)
8+
- [CMake 3.21+](https://cmake.org/download/)
9+
- Make sure you have `Add CMake to the system PATH` selected when installing
10+
- [Ninja](https://ninja-build.org)
11+
- Make sure Ninja is added to `PATH`
12+
- Note, if you're having trouble, you can install `ninja` using [Chocolatey](https://chocolatey.org/install) with `choco install ninja`!
13+
14+
### Linux prerequisites
15+
16+
- GCC 9.4+
17+
- Rust on the latest stable channel
18+
- CMake 3.21+
19+
20+
### macOS prerequisites
21+
22+
- macOS 12+
23+
- Homebrew
24+
- Clang 13+
25+
- Rust on the latest stable channel
26+
- CMake 3.21+
27+
28+
### Install Qt 6
29+
30+
You need to install Qt 6 on your system before you proceed. The minimum version is 6.5. You also need to enable SVG support when installing.
31+
32+
#### Windows-specific requirements
33+
34+
You need `Qt Online Installer` for open-source to install Qt, downloaded from https://www.qt.io. The installer will ask you to sign in with a Qt account, which you can create for free. You need to check `Custom installation` and do not check `Qt for desktop development` that is using the MinGW toolchain. Make sure you have checked the `MSVC 2019 64-bit` component in the `Select Components` page for the version you wish to install and uncheck all of the other components.
35+
36+
Once installation is completed you need to set the `CMAKE_PREFIX_PATH` environment variable to the full path of the installed version (e.g. `C:\Qt\6.5.1\msvc2019_64`). To set an environment variable:
37+
38+
1. Open a run dialog with <kbd>Win</kbd> + <kbd>R</kbd>.
39+
2. Enter `sysdm.cpl` then click `OK`.
40+
3. Go to the `Advanced` tab then click on `Environment Variables...`.
41+
4. Click `New...` to create a new environment variable. Just create for either `User variables` or `System variables`, not both.
42+
5. Restart your terminal or IDE to load the new PATH.
43+
44+
#### Install Qt with Homebrew (macOS only)
45+
46+
```sh
47+
brew install qt@6
48+
```
49+
50+
### Configure build system
51+
52+
```sh
53+
cmake --preset PRESET .
54+
```
55+
56+
The value of `PRESET` will depend on your platform and the build configuration you want to use. The current available presets are:
57+
58+
- windows-release
59+
- windows-debug
60+
- linux-release
61+
- linux-debug
62+
- mac-release
63+
- mac-debug
64+
65+
If all you want is to use the emulator, choose `[YOUR-PLATFORM]-release` for optimized outputs. But if you want to edit the code, choose `*-debug`.
66+
67+
### Build
68+
69+
```sh
70+
cmake --build --preset PRESET
71+
```
72+
73+
You can use `-j` to enable parallel building (e.g. `cmake --build --preset PRESET -j 2`). Each parallel build on Linux consumes a lot of memory so don't use the number of your CPU cores otherwise your system might crash due to out of memory. On Windows and macOS it seems like it is safe to use the number of your CPU cores.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h1 align="center">
2+
<b>Compilation & Development</b>
3+
<br>
4+
<sub><sup>A tutorial on how to compile Obliteration, and what you will need to begin developing!</sup></sub>
5+
<br>
6+
</h1>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Development
2+
---
3+
### Recommended Code Editor
4+
Before proceeding, make sure the build preset you are using is `*-debug`. We recommend [Visual Studio Code](https://code.visualstudio.com/Download) as a code editor with the following extensions:
5+
6+
- CMake Tools ([Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) | [Open VSX](https://open-vsx.org/extension/ms-vscode/cmake-tools))
7+
- clangd ([Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) | [Open VSX](https://open-vsx.org/extension/llvm-vs-code-extensions/vscode-clangd))
8+
- rust-analyzer ([Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) | [Open VSX](https://open-vsx.org/extension/rust-lang/rust-analyzer))
9+
- CodeLLDB ([Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) | [Open VSX](https://open-vsx.org/extension/vadimcn/vscode-lldb))
10+
11+
Then open this folder with VS Code. It will ask which CMake preset to use and you need to choose the same one that you were using when building. Everything should work out of the box (e.g. code completion, debugging, etc).
12+
13+
### macOS debugging issues
14+
15+
If you can't launch or debug Obliteration from VS Code, try [this](https://github.com/vadimcn/codelldb/discussions/456#discussioncomment-874122) solution.
16+
17+
### Get a homebrew application for testing
18+
19+
If you don't have a PS4 application for testing you can download PS Scene Quiz for free [here](https://pkg-zone.com/details/LAPY10010).
20+
21+
### Rules for Rust sources
22+
23+
- Use unsafe code only when you know what you are doing. When you do try to wrap it in a safe function so other people who are not familiar with unsafe code can have a safe life.
24+
- Don't chain method calls without an intermediate variable if the result code is hard to follow. We encourage code readability as a pleasure when writing so try to make it easy to read and understand for other people.
25+
- Do not blindly cast an integer. Make sure the value can fit in a destination type. We don't have any plans to support non-64-bit systems so the pointer size and its related types like `usize` are always 64-bits.
26+
- Beware of deadlock and memory leak. Rust can protect us from most mistakes, except those two. Deadlock can be happen easily in Rust because Rust requires us to wrap the data we want to protect with a mutex and get a mutable reference through it. The problem with this is it become natural for you to lock the mutex to operate on the inner data, which can easily cause a deadlock if you are not aware when there are another locks being active. The only cases for memory leak you need to aware is when working with `Arc`. Just make sure you don't create a reference cycle that will never be dropped.
27+
28+
### Rules for C++ sources
29+
30+
Just follow how Qt is written (e.g. coding style, etc.). Always prefers Qt classes over `std` when possible so you don't need to handle exceptions. Do not use the Qt `ui` file to design the UI because it will break on a high-DPI screen.
31+
32+
### Starting point
33+
34+
The application consists of 2 binaries:
35+
36+
#### Frontend
37+
38+
This is what users will see when they launch Obliteration. Its entry point is inside `src/main.cpp`.
39+
40+
#### Kernel
41+
42+
This is where emulation takes place. Its entry point is inside `src/kernel/src/main.rs`.
43+
44+
### Debugging the kernel
45+
46+
Create `.kernel-debug` in the root of the repository. The contents of this file is YAML and the kernel will deserialize it to the `Args` struct in `src/kernel/src/main.rs` when passing the `--debug` flag to the kernel. See `Args` struct for available options.
47+
48+
We already provide a launch configuration for VS Code so all you need to do is choose `Debug - Kernel` as the configuration and start debugging.
49+
50+
### Code contribution
51+
52+
If you want to make some contributions but don't know what to work on you can look for `TODO` comment or `todo!` macro invocation in the source code. You can also take a look at unassigned issues.
53+
54+
### Additional informations
55+
56+
[PS4 Developer Wiki](https://www.psdevwiki.com/ps4) has a lot of useful information about the PS4 internal. We also have a PS4 reverse engineering [project](https://github.com/obhq/reverse-engineering).

0 commit comments

Comments
 (0)