Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gaasedelen committed Apr 3, 2022
2 parents 7d6dd70 + 869ea27 commit 713f318
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 31 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/package-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Package Project

on: push

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Download workflow artifact
uses: dawidd6/[email protected]
with:

# the target repo for external artifacts (built libs)
repo: gaasedelen/keystone
branch: master

# token to fetch artifacts from the repo
github_token: ${{secrets.KEYSTONE_PATCHING_TOKEN}}

# which workflow to search for artifacts
workflow: python-publish.yml
workflow_conclusion: success

- name: Package distributions
shell: bash
run: |
mkdir dist && cd dist
mkdir win32 && cp -r ../titan ./win32/ && cp ../*.py ./win32/ && cp -r ../artifact/keystone_win32/* ./win32/titan/keystone && cd ./win32 && zip -r ../titan_win32.zip ./* && cd ..
mkdir linux && cp -r ../titan ./linux/ && cp ../*.py ./linux/ && cp -r ../artifact/keystone_linux/* ./linux/titan/keystone && cd ./linux && zip -r ../titan_linux.zip ./* && cd ..
mkdir darwin && cp -r ../titan ./darwin/ && cp ../*.py ./darwin/ && cp -r ../artifact/keystone_darwin/* ./darwin/titan/keystone && cd ./darwin && zip -r ../titan_macos.zip ./* && cd ..
- uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/dist/*.zip
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,46 @@ Some additional notes about Titan are as follows:
* Titan is essentially hardcoded to use a 'F (Partition 6) Takes All'-esque partitioning scheme
* Titan could be extended to support additional partitions, but it seems unnecessary
* **Clusters**
* Titan allows increased cluster sizes of 128kb, 256kb and 512kb
* Titan allows increased cluster sizes of 128kb, 256kb, 512kb, 1mb
* **It is strongly recommended to format large disks (2TB+) with 1024 sectors per cluster (512kb)**
* Matt's [FATX](https://github.com/mborgerson/fatx) is the only tool that can currently format disks with larger clusters
* Matt's [FATX](https://github.com/mborgerson/fatx) is the only tool that can currently format disks with larger clusters
* Due to how the kernel caches file information in-memory, partitions are limited to 2^24 clusters
* 128kb clusters - up to 2TB partition size
* 256kb clusters - up to 4TB partition size
* 512kb clusters - up to 8TB partition size
* 1mb clusters - up to 16TB partition size
* Increased cluster sizes dramatically increases the speed of mounting FATX volumes (faster bootup)
* Increased cluster sizes will ensure more linear reads on the disk (faster file reads, game loading, etc.)
* Increased cluster sizes allows for more items in the root disk directory (8192 items at 512kb clusters)
* If you're using Titan, you can afford the luxury of bigger clusters so stop complaining about wasted space
* Increased cluster sizes were never the issue for limiting drive/partition sizes, this is FUD
* 64kb clusters should work on the Titan partition but bootup/mounting WILL be slow for large disks
* **UDMA**
* Titan can change the [UDMA](https://en.wikipedia.org/wiki/UDMA) transfer mode used by the kernel with `--udma N`
* Increasing the UDMA mode has been profiled to improve some game load times in excess of 20%
* Increasing the UDMA mode will require an 80pin IDE cable
* A full benchmark with SSD + StarTech shows disk IO is 70-100% faster across the board
* Increasing the UDMA mode will require an 80 wire IDE cable
* The retail Xbox uses UDMA 2 (33mb/s) by default (as do many/all (?) modified BIOS')
* The maximum supported UDMA mode by the Xbox southbridge is UDMA 5 (100mb/s HDD <--> CPU)
* **UDMA 5 DOES NOT WORK WITH ALL IDE TO SATA ADAPTERS**
* UDMA 5 has been confirmed working with Startech adapters but has not been properly benchmarked
* UDMA 5 is confirmed to be working and stable with StarTech adapters
* UDMA 5 is unstable on RXD-629A7-7 based adapters, but UDMA 4 seems okay
* WLXKG-863B are the 'worst' adapters I have experienced working on Titan and are largely untested
* **Games**
* A random assortment of games have been tested to ensure some baseline on system stability
* I don't expect major issues here, but more testing should be obviously be done
* **Dashboards**
* XBMC seems to work fine
* DVD drive status can be flakey in XBMC under higher UDMA modes (SMBus issues? most likely)
* EvoX seems to work fine
* EvoX displays the incorrect disk size because it [performs](https://github.com/gaasedelen/titan/blob/main/screenshots/evox_bug.png) a modulus of 'available gigabytes' by 1000
* This does not mean that you formatted incorrectly, or that the HDD is corrupt
* This does not mean that you formatted incorrectly, or that the HDD is corrupt
* FTP seems okay?
* Dashboard-based FTPs are probably much safer than BIOS-based FTP (eg. XeniumOS)
* Consider all other dashboards as untested
* **Other Homebrew Notes**
* DVD2Xbox works fine
* FTP via XeniumOS is probably risky. I would only use it to transfer files onto RETAIL partitions (C or E)
* Anything booting into a BFM BIOS (PBL, Hexen?) is totally unsupported for accessing the Titan partition (F)
* It should be possible to tweak M8+Titan with a modified version of EVTool (will release more info soon)
* Consider all other homebrew as untested
* **Patches**
* Titan is only supported on the M8+ kernel. M8+ is a modified version of the final retail kernel (5838)
Expand Down
45 changes: 22 additions & 23 deletions titan/patches/m8.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class Patch_HddPartitionCreate(XboxPatch):
ASSEMBLY = \
"""
; eax:edx = g_HddSectors
; edx:eax = g_HddSectors
load_size:
mov edx, dword ptr ds:[0x8003C3B8+4]
mov eax, dword ptr ds:[0x8003C3B8]
Expand All @@ -273,15 +273,19 @@ class Patch_HddPartitionCreate(XboxPatch):
compute_f_length:
; RemainingSectors = g_HddSectors - 0xEE8AB0
sub eax, 0xEE8AB0
sbb edx, 0
; push SectorSize (64bit)
push 0
push 0x200
; push g_HddSectors (64bit)
; push RemainingSectors (64bit)
push edx
push eax
; mul64(g_HddSectors, SectorSize)
; mul64(RemainingSectors, SectorSize)
call 0x8002E030
"""

Expand Down Expand Up @@ -328,27 +332,22 @@ class Patch_HddCreate(XboxPatch):
mov dword ptr ds:[0x8003C3B8+4], ecx
"""

class Patch_FatxParseSupeblock(XboxPatch):
class Patch_FatxProcessBootSector(XboxPatch):
TYPE = PatchType.JUMP
HOOK_ADDRESS = 0x80027143
HOOK_RETURN = 0x800271D9
HOOK_ADDRESS = 0x80027116
HOOK_RETURN = 0x80027149

ASSEMBLY = \
"""
; 128 clusters per sector
jz 0x80027149
; 256 clusters per sector
sub ecx, 128
jz 0x80027149
; 512 clusters per sector
sub ecx, 256
jz 0x80027149
; 1024 clusters per sector
sub ecx, 512
jz 0x80027149
; Check if sectors per cluster is 0 and error if so
cmp eax, 0
je 0x800271D9
; Check if sectors per cluster is a power of 2, and error if not
mov ecx, eax
sub ecx, 1
and ecx, eax
cmp ecx, 0
jne 0x800271D9
"""

class Patch_FatxStartAsyncIo(XboxPatch):
Expand Down Expand Up @@ -450,10 +449,10 @@ class Patch_FatxAsyncIo(XboxPatch):
Patch_HddCreateQuick,
Patch_HddCreate,

# allow larger cluster sizes (up to 512kb)
Patch_FatxParseSupeblock,
# allow larger cluster sizes
Patch_FatxProcessBootSector,

# smuggle sector bits for async disk IO
Patch_FatxStartAsyncIo,
Patch_FatxAsyncIo
]
]
2 changes: 1 addition & 1 deletion tpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from titan.patches.m8 import KERNEL_PATCHES
from titan.patches.common import PatchType

VERSION = '1.0.1'
VERSION = '1.1.0'
AUTHOR = 'Markus Gaasedelen'

#------------------------------------------------------------------------------
Expand Down

0 comments on commit 713f318

Please sign in to comment.