diff --git a/.github/workflows/package-project.yaml b/.github/workflows/package-project.yaml new file mode 100644 index 0000000..76e5d66 --- /dev/null +++ b/.github/workflows/package-project.yaml @@ -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/action-download-artifact@v2.16.0 + 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 \ No newline at end of file diff --git a/README.md b/README.md index d006e18..8f24a2b 100644 --- a/README.md +++ b/README.md @@ -62,23 +62,27 @@ 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** @@ -86,9 +90,10 @@ Some additional notes about Titan are as follows: * 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 @@ -96,6 +101,7 @@ Some additional notes about Titan are as follows: * 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) diff --git a/titan/patches/m8.py b/titan/patches/m8.py index 62686f9..01b0e99 100644 --- a/titan/patches/m8.py +++ b/titan/patches/m8.py @@ -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] @@ -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 """ @@ -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): @@ -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 -] \ No newline at end of file +] diff --git a/tpatch.py b/tpatch.py index aed3fc6..e21c3f5 100644 --- a/tpatch.py +++ b/tpatch.py @@ -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' #------------------------------------------------------------------------------