Skip to content

Commit 08053a3

Browse files
committed
Doc: Create mkdocs-based documentation
Also adds CMake code to build and install the documentation into our ZIP packages. CMake files now get a fancy license header.
1 parent 1c31386 commit 08053a3

File tree

22 files changed

+322
-108
lines changed

22 files changed

+322
-108
lines changed

.github/workflows/autobuild.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ on: [ push, pull_request ]
77
# branches: [ master ]
88
# workflow_dispatch:
99

10+
# todo: maybe a job to update and push to gh-pages branch
11+
# if a commit modifies files in docs/ or /mkdocs.yml
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
1316

1417
steps:
1518
- uses: actions/checkout@v2
1619

17-
# This techinically also "Installs" it too.
20+
# This techinically also "Installs" ps2sdk too.
1821
# TODO: CACHE THIS SO I DON'T KEEP HITTING GITHUB SERVERS.
19-
- name: Fetch and setup ps2sdk
22+
- name: Fetch and setup dependencies
2023
run: |
2124
export PS2DEV=$HOME/ps2dev
2225
export PS2SDK=$PS2DEV/ps2sdk
@@ -31,15 +34,18 @@ jobs:
3134
echo "PS2DEV=$PS2DEV" >> $GITHUB_ENV
3235
echo "PS2SDK=$PS2SDK" >> $GITHUB_ENV
3336
echo "GSKIT=$GSKIT" >> $GITHUB_ENV
37+
pip install mkdocs
3438
3539
- name: Build elfldr (release) and package
3640
run: |
3741
cmake -B build -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain/ps2.cmake -DCMAKE_BUILD_TYPE=Release
42+
cmake --build build -t docs
3843
cmake --build build -t package
3944
4045
- name: Build elfldr (debug) and package
4146
run: |
4247
cmake -B build_debug -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain/ps2.cmake -DCMAKE_BUILD_TYPE=Debug
48+
cmake --build build -t docs
4349
cmake --build build_debug -t package
4450
4551
- name: Upload elfldr artifacts (release)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build/
33
cmake-build-*
44

55
/publish.sh
6+
/site

CMakeLists.txt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#
2+
# SSX-Elfldr
3+
#
4+
# (C) 2021-2022 Lily/modeco80 <[email protected]>
5+
# under the terms of the MIT license.
6+
#
7+
18
cmake_minimum_required(VERSION 3.19)
29

310
##if(NOT CMAKE_SYSTEM_NAME STREQUAL "Playstation2")
@@ -13,7 +20,8 @@ if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
1320
message(FATAL_ERROR "In-source-tree builds are strictly prohibited. Please don't do them.")
1421
endif()
1522

16-
include(${CMAKE_SOURCE_DIR}/cmake/Policies.cmake)
23+
include(cmake/CMakeNewPolicy.cmake)
24+
1725
project(elfldr
1826
LANGUAGES CXX
1927
DESCRIPTION "HostFS enabling Mod/ELF loader for the SSX games on PS2"
@@ -34,6 +42,9 @@ add_custom_target(__elfldr_gittag
3442
SOURCES ${PROJECT_BINARY_DIR}/Version.h)
3543
set_source_files_properties(${PROJECT_BINARY_DIR}/Version.h PROPERTIES GENERATED TRUE)
3644

45+
# ElfLdr mkdocs
46+
include(MkDocs)
47+
3748
# Include elfldr modules
3849
add_subdirectory(src/runtime)
3950
add_subdirectory(src/utils)
@@ -50,12 +61,20 @@ add_subdirectory(src/sampleerl)
5061
set(CMAKE_INSTALL_PREFIX /)
5162
set(CPACK_SET_DESTDIR ON)
5263

53-
install(TARGETS elfldr)
54-
5564
# documentation
56-
install(FILES ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX})
65+
install(FILES ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/LICENSE DESTINATION /)
66+
67+
# Install static mkdocs documentation
68+
# if documentation build is enabled
69+
if(MkDocs_FOUND)
70+
install(DIRECTORY ${PROJECT_SOURCE_DIR}/site/ DESTINATION /doc)
71+
endif()
72+
5773
# todo: mkdocs generated page in /doc
5874

75+
install(TARGETS elfldr)
76+
77+
5978
## CPack (used by GitHub Actions to package releases)
6079

6180
if(NOT DEFINED CPACK_GENERATOR)

README.md

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -4,109 +4,12 @@ A patching game loader for the SSX games on PS2, providing the ability to run th
44

55
It also provides a general patching/function hooking framework for mod developers to use.
66

7-
## Game Support Table
8-
9-
Note that game regions/versions or whole games that are marked as Unsupported are planned to be supported later in development..
10-
11-
| Game | Region/Version | Support Status |
12-
|---------------|---------------------|----------------|
13-
| SSX OG (2000) | USA (1.0) ||
14-
| SSX OG (2000) | USA (Greatest Hits) ||
15-
| SSX OG (2000) | PAL (1.0) ||
16-
| SSX OG (2000) | NTSC-J (1.0) ||
17-
| SSX Tricky | USA (1.0) ||
18-
| SSX Tricky | PAL/NTSC-J ||
19-
| SSX 3 | OPSM2 Demo | 🧩️ |
20-
| SSX 3 | KR Demo | 🧩 |
21-
| SSX 3 | PAL/NTSC-J ||
22-
| SSX On Tour | (N/A) ||
23-
24-
#### Legend
25-
26-
| Symbol | Definition |
27-
|--------|------------------------|
28-
| ✅️ | Supported |
29-
| 🧩️ | Partial/In development |
30-
| ❌️ | Unsupported |
31-
|| Unknown |
7+
## Documentation
8+
9+
See the /docs directory for documentation, or the /doc directory in a release package.
3210

3311
## Releases
3412

3513
Stable releases are available [at the Releases tab](https://github.com/SSXModding/SSX-ElfLdr/releases).
3614

37-
Automatic unstable builds of Elfldr are available [via Github Actions](https://github.com/SSXModding/SSX-ElfLdr/actions).
38-
39-
40-
## Setup
41-
42-
**NOTE:** A graphical setup program which automatically handles ISO/physical disc extraction will be provided soon.
43-
44-
For now:
45-
46-
- Follow the game specific instructions first (they are below this initial step).
47-
- Copy `bin/elfldr.elf` from the release .zip file alongside the main game ELF in the directory you chose.
48-
- In PCSX2:
49-
- Enable HostFS by checking "System->Game Settings->Enable Host Filesystem".
50-
- File->Run ELF the `elfldr.elf` file for the game you extracted.
51-
- Enjoy your ElfLdr-enhanced game!
52-
53-
### SSX OG
54-
55-
- Extract the game's files from the ISO or physical disk into a directory of your choosing.
56-
- Using a .BIG extraction tool of your choice, extract the .BIG archives in `data/models`.
57-
- Once done, copy the files from the newly-made `data/models` to the actual `data/models` directory.
58-
59-
### SSX Tricky
60-
61-
- Extract the game's files from the ISO or physical disk into a directory of your choosing.
62-
- Using a .BIG extraction tool of your choice, extract the .BIG archives in `data/models`.
63-
- Once done, copy the files from the newly-made `data/models` to the actual `data/models` directory.
64-
65-
### SSX 3
66-
67-
- Extract the game's files from the ISO or physical disk into a directory of your choosing.
68-
- (Up to you) Remove the two .PAD files, they are not needed by the game.
69-
70-
## Patch Descriptions
71-
72-
### HostFS Patch
73-
74-
This patch allows the game to load files entirely from a folder on your computer.
75-
76-
This makes it easier for modders to tinker with the game.
77-
78-
It also makes it easier for players to install mods.
79-
80-
It finally also solves legality issues as mods no longer need to be distributed as the full game.
81-
82-
### MemClr patch
83-
84-
This patch disables the memory clear pattern the SSX games do, which is a byproduct of some debugging code left in from
85-
the REAL (REwritten EA Library?) library's custom memory allocator.
86-
87-
### Experimental patch
88-
89-
This patch is mostly a dumping ground for very untested code, and as of right now serves as an ERL loader.
90-
91-
It also registers the heap allocator used by elfldr (for now).
92-
93-
## Building from source
94-
95-
You need PS2SDK installed (the PS2DEV/open source one, not the Sony one).
96-
97-
It can be gathered [here](https://github.com/ps2dev/ps2toolchain) if you do not have it installed.
98-
99-
To build:
100-
101-
```bash
102-
$ cmake -B build -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/ps2.cmake
103-
$ cmake --build build
104-
# Profit? (elfldr.elf in build/)
105-
```
106-
107-
Generating a package
108-
109-
```bash
110-
$ cmake --build build -t package
111-
# check build/packages for the generated zip file
112-
```
15+
Automatic unstable builds of Elfldr are available [via GitHub Actions](https://github.com/SSXModding/SSX-ElfLdr/actions).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#
2+
# SSX-Elfldr
3+
#
4+
# (C) 2021-2022 Lily/modeco80 <[email protected]>
5+
# under the terms of the MIT license.
6+
#
7+
18
# CMake policy configuration
29

310
if(POLICY CMP0026)

cmake/FindMkDocs.cmake

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#.rst:
2+
# FindMkDocs
3+
# -----------
4+
#
5+
# This module looks for MkDocs and is based on the FindDoxygen module
6+
#
7+
# MkDocs is a static site generator that's geared towards building project documentation.
8+
# http://www.mkdocs.org
9+
#
10+
# This modules defines the following variables:
11+
#
12+
# ::
13+
#
14+
# MKDOCS_EXECUTABLE = The path to the MkDocs command.
15+
# MKDOCS_FOUND = Was MkDocs found or not?
16+
# MKDOCS_VERSION = The version reported by mkdocs --version
17+
#
18+
19+
#
20+
# Find MkDocs...
21+
#
22+
23+
find_program(MKDOCS_EXECUTABLE
24+
NAMES mkdocs
25+
PATHS
26+
/usr/bin
27+
/usr/local/bin
28+
$ENV{HOME}/.local/bin
29+
DOC "MkDocs documentation generation tool (http://www.mkdocs.org)"
30+
)
31+
32+
if(MKDOCS_EXECUTABLE)
33+
execute_process(COMMAND ${MKDOCS_EXECUTABLE} "--version" OUTPUT_VARIABLE MKDOCS_VERSION_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
34+
string(REGEX MATCH "[0-9*]\.*" MKDOCS_VERSION ${MKDOCS_VERSION_OUTPUT})
35+
endif()
36+
37+
include(FindPackageHandleStandardArgs)
38+
find_package_handle_standard_args(MkDocs DEFAULT_MSG MKDOCS_EXECUTABLE MKDOCS_VERSION)
39+
40+
mark_as_advanced(MKDOCS_EXECUTABLE)

cmake/GitTag.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/cmake -P
22

3+
#
4+
# SSX-Elfldr
5+
#
6+
# (C) 2021-2022 Lily/modeco80 <[email protected]>
7+
# under the terms of the MIT license.
8+
#
9+
310
#
411
# Headless script to generate git versioning with only cmake installed
512
#

cmake/MkDocs.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# SSX-Elfldr
3+
#
4+
# (C) 2021-2022 Lily/modeco80 <[email protected]>
5+
# under the terms of the MIT license.
6+
#
7+
8+
# Semi-hack to build documentation.
9+
10+
find_package(MkDocs)
11+
12+
if(MkDocs_FOUND)
13+
set(DOCS_ENABLED TRUE)
14+
message(STATUS "Enabling documentation build")
15+
add_custom_target(docs ALL ${MKDOCS_EXECUTABLE} build
16+
WORKING_DIRECTORY ..
17+
COMMENT "Generating HTML documentation" VERBATIM)
18+
else()
19+
set(DOCS_ENABLED FALSE)
20+
endif()

cmake/Toolchain/Platform/Playstation2.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#
2+
# SSX-Elfldr
3+
#
4+
# (C) 2021-2022 Lily/modeco80 <[email protected]>
5+
# under the terms of the MIT license.
6+
#
7+
18
# CMake platform settings for PlayStation 2
29

310
set(CMAKE_EXECUTABLE_SUFFIX ".elf")

cmake/Toolchain/ps2.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#
2+
# SSX-Elfldr
3+
#
4+
# (C) 2021-2022 Lily/modeco80 <[email protected]>
5+
# under the terms of the MIT license.
6+
#
7+
18
# Based off the shipped ps2dev.cmake toolchain file
29
# in the ps2sdk source tree, modified for elfldr
310

@@ -9,6 +16,7 @@ set(CMAKE_SYSTEM_PROCESSOR "mips64r5900el")
916
# our PlayStation2 platform. Otherwise, CMake will yell
1017
# and complain (rightfully.)
1118
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
19+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
1220

1321
set(CMAKE_C_COMPILER mips64r5900el-ps2-elf-gcc)
1422
set(CMAKE_CXX_COMPILER mips64r5900el-ps2-elf-g++)

0 commit comments

Comments
 (0)