Skip to content

Commit

Permalink
v1.4
Browse files Browse the repository at this point in the history
- New xdvdfs build: Version 0.8.2 includes a new copy-out command that we use to replace the default get xbe function.
- Fixed some typos in the Title ID and Game ID arrays.
- Updating the game directory would fail if default.xbe is sliced between split xISOs. Therefore, we check for the Title ID, and if it's empty, we will: (1) skip adding artworks, and (2) use the filename as the game's title.
  • Loading branch information
Sahri Riza Umami committed Sep 27, 2024
1 parent 812d36c commit 78b478b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 36 deletions.
9 changes: 3 additions & 6 deletions bin/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is Virtual disc attacher by rmenhal.
If combined with NKPatcher or Cerbios this utility will enabled us to boot XISOs
directly from ogxbox's disk.

MD5SUM: e658735e0a533d2a9f5dfb60b8334fc7
SHA1: c120ae196df1767adfb9f49698492813eb9a5938

Taken from driveimageutils-v1.0.1 package.
The license is GPL, so I guess can redistribute the binary with this repo.
Expand All @@ -17,13 +17,10 @@ xdvdfs
xdvdfs is an original Xbox DVD Filesystem library and management tool.
Link: https://github.com/antangelo/xdvdfs

The include binary was built from this commit:
https://github.com/antangelo/xdvdfs/commit/2bbf8f797e8aab71cc8f24b281572a6f05a8c9a2

And why it's smaller than normal build:
And why the included binary is smaller than the official build:
https://github.com/antangelo/xdvdfs/issues/61.

MD5SUM: 1b290ae7d19d6f744430ae2513c7429f
SHA1: de39dfeb5008dc970284bd5f5168471e8ba0a624

You can also get xdvdfs binary from its release page or by build it yourself:
sudo apt install cargo
Expand Down
Binary file modified bin/xdvdfs
Binary file not shown.
8 changes: 8 additions & 0 deletions changes.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v1.4 - 20240928
- New xdvdfs build: Version 0.8.2 includes a new copy-out command that we use to
replace the default get xbe function.
- Fixed some typos in the Title ID and Game ID arrays.
- Updating the game directory would fail if default.xbe is sliced between split
xISOs. Therefore, we check for the Title ID, and if it's empty, we will:
(1) skip adding artworks, and (2) use the filename as the game's title.

v1.3.1 - 20231203
- New xdvdfs build that fix https://github.com/antangelo/xdvdfs/issues/64
- Fix Metal Slug entry in TITLENAME array
Expand Down
1 change: 0 additions & 1 deletion docs/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
- https://www.epforums.org/showthread.php?87071-XBOX-FATX-limitations-and-notes
- http://www.caustik.com/cxbx/download/xbe.htm
- https://github.com/multimediamike/xbfuse
- [Xbox Artwork Installer](https://drive.google.com/file/d/1Y3_21N8yDqYJ1CznaP6ceMM87JHpTHwd/view?usp=sharing)
- https://github.com/antangelo/xdvdfs
8 changes: 6 additions & 2 deletions docs/xdvdfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

# How to

## 1. Build
## 1. Download Releases

Go to https://github.com/antangelo/xdvdfs/releases/latest to download the latest relese.

## 2. Build

```sh
sudo apt install cargo
Expand All @@ -24,7 +28,7 @@ codegen-units = 1
panic = "abort"
```

### 2. Install from [crates.io](https://crates.io/)
### 3. Install from [crates.io](https://crates.io/)

```sh
sudo apt install cargo
Expand Down
57 changes: 30 additions & 27 deletions redump2x
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ IFS=$'\n\t'
# - CISO support

# Get the current working directory.
HERE=$(dirname "$(readlink -f "${0}")")
HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

# Checking dependencies:
# 1. xdvdfs: https://github.com/antangelo/xdvdfs
Expand All @@ -46,7 +46,7 @@ HERE=$(dirname "$(readlink -f "${0}")")
# 3. attach.xbe
# Get it from driveimageutils-v1.0.1 package from "the usual place".
declare -a DEPS=(7z 'attach.xbe' dd grep xdvdfs xxd)
for ((NUM=${#DEPS[@]},i=0; i<NUM;i++)); do
for ((NUM=${#DEPS[@]}, i=0; i<NUM; i++)); do
if command -v "${DEPS[i]}" &>/dev/null || [[ -f $HERE/bin/${DEPS[i]} ]]; then
unset -v 'DEPS[i]'
fi
Expand All @@ -71,6 +71,7 @@ INPUT="$HOME"
OUTPUT="$HOME"
# Split the output file.
SPLIT=0
SPLITTED=false
# Script will extract input archive into this temporary directory.
# Pay attention if you mount tmpfs on /tmp.
TMPDIR=$(mktemp -d)
Expand All @@ -80,8 +81,10 @@ UPDATE=false
# FUNCTIONS --------------------------------------------------------------------

add_artworks() {
if [[ -z $1 ]]; then
print_w 'Canceling add_artworks: missing Title ID.'
# Artwork for UnleashX dashboard.
if [[ -f $ARTWORKS ]]; then
elif [[ -f $ARTWORKS ]]; then
mapfile -t ICON < <(7z l -slt "$ARTWORKS" | grep -oP "(?<=Path = ${1}).*?(?=$)")
if [[ ${#ICON[@]} -eq 0 ]]; then
print_w 'No artwork found.'
Expand Down Expand Up @@ -424,6 +427,7 @@ get_title() {
["54540089"]="Ford vs. Chevy"
["49470074"]="Forgotten Realms: Demon Stone"
["4D53006E"]="Forza Motorsport"
["584C8014"]="Forza Motorsport"
["48450004"]="Frankie Dettori Racing"
["4D570007"]="Freaky Flyers"
["4541002E"]="Freedom Fighters"
Expand Down Expand Up @@ -818,7 +822,7 @@ get_title() {
["48500005"]="Rugby Challenge 2006"
["48450001"]="Rugby League"
["48450005"]="Rugby League 2"
["5340000"]="Samurai Shodown V"
["534E0004"]="Samurai Shodown V"
["4B4F0006"]="Samurai Warriors"
["5454007A"]="Scaler"
["4C530002"]="SCAR : Squadra Corse Alfa Romeo"
Expand Down Expand Up @@ -920,7 +924,7 @@ get_title() {
["53450038"]="Super Monkey Ball Deluxe"
["454100A0"]="Superman Returns"
["49470016"]="Superman: The Man of Steel"
["5340"]="SVC Chaos: SNK vs. Capcom"
["534E0001"]="SVC Chaos: SNK vs. Capcom"
["56560025"]="SWAT: Global Strike Team"
["41430010"]="SX Superstar"
["4D490006"]="Syberia"
Expand Down Expand Up @@ -971,10 +975,10 @@ get_title() {
["54510028"]="The Incredibles"
["545100F6"]="The Incredibles: Rise of the Underminer"
["4553000E"]="The Italian Job"
["534000000"]="The King of Fighters 2002"
["534000"]="The King of Fighters 2003"
["534E0006"]="The King of Fighters 2002"
["534E0003"]="The King of Fighters 2003"
["534E000A"]="The King of Fighters Neowave"
["5340000000"]="The King of Fighters: Maximum Impact: Maniax"
["534E0007"]="The King of Fighters: Maximum Impact: Maniax"
["5655004A"]="The Legend of Spyro: A New Beginning"
["56550004"]="The Lord of the Rings: The Fellowship of the Ring"
["4541003E"]="The Lord of the Rings: The Return of the King"
Expand Down Expand Up @@ -1137,13 +1141,18 @@ get_title() {
["5454008C"]="Zathura"
["53540001"]="ZillerNet"
)
local CN FATXCHARS
local CN FATXCHARS DIRNAME SINGLE
# Get game's Title Name based on its Title ID
if [[ -v 'TITLENAME[$1]' ]]; then
if [[ -v TITLENAME[$1] ]]; then
TITLE="${TITLENAME[$1]}"
else
TITLE="$2"
# Use redump's filename as xiso's filename.
TITLE="${2##*/}"
if [[ ${2:(-6)} == '.0.iso' ]] && [[ -f ${2:0:(-6)}.1.iso ]]; then
TITLE="${2:0:(-6)}"
fi
TITLE="${TITLE##*/}"
TITLE="${TITLE%.*}"
TITLE="${TITLE%%(*}"
fi
# FATX only support characters below (include space):
Expand All @@ -1163,27 +1172,21 @@ get_title() {
fi
done
fi
# Remove trailing whitespace.
shopt -s extglob
CN="${CN%%+([[:space:]])}"

DIRNAME="${CN:0:41}"
SINGLE="${CN:0:37}"
SPLITTED="${CN:0:35}"
# FATX only support 42 characters for filename (that include spaces).
# [0]: 42 chars for dir, [1]: 38 chars for single xiso, [2]: 36 chars for splitted xisos.
TITLE=( "${CN:0:41}" "${CN:0:37}" "${CN:0:35}" )
# Remove trailing whitespace.
shopt -s extglob
TITLE=( "${DIRNAME%%+([[:space:]])}" "${SINGLE%%+([[:space:]])}" "${SPLITTED%%+([[:space:]])}" )
}

get_xbe() {
local BASE CERT DATALOC RTID XBEBIN
local BASE CERT RTID XBEBIN
XBEBIN="${TMPDIR}/default.xbe"
# Extract default.xbe
DATALOC=$("$HERE/bin/xdvdfs" info "$1" /default.xbe | grep -oP '(?<=Sector ).*?(?= bytes)')
if [[ $XTYPE == 'redump' ]]; then
# Redump image has a video partition as big as 387 MB or 405798912 Bytes (1024*1024*387).
dd if="$XISOIN" of="$XBEBIN" skip="$(((${DATALOC%% *}*2048)+405798912))" count="${DATALOC##*\(}" iflag=skip_bytes,count_bytes status=none
elif [[ $XTYPE == 'xiso' ]]; then
dd if="$XISOIN" of="$XBEBIN" skip="$((${DATALOC%% *}*2048))" count="${DATALOC##*\(}" iflag=skip_bytes,count_bytes status=none
fi

"$EXISO" copy-out "$XISOIN" default.xbe "$XBEBIN"
# Get base address.
BASE="$(xxd -e -l 4 -s 0x104 "$XBEBIN")"
BASE="0x${BASE:10:8}"
Expand All @@ -1202,7 +1205,7 @@ install_artworks() {
7z x -bso0 "$1" -o"$TMPDIR"
mapfile -t COVER < <(find "$TMPDIR/$ARTDIR" -size +1k -type f -name '_resources.zip')

for ((NUM=${#COVER[@]},i=0; i<NUM;i++)); do
for ((NUM=${#COVER[@]}, i=0; i<NUM; i++)); do
if [[ -f ${COVER[i]%/*}/detials.txt ]]; then
TID=$(<"${COVER[i]%/*}/detials.txt")
# Remove N/A string if title doesn't have an ID.
Expand All @@ -1227,7 +1230,7 @@ patch_attach() {
XBEPATCH="${ATTACHER}.hexpatch"
# Adjust offset from game's default/game.xbe to attach.xbe's offset.
SHIFT=$((0x00010178-XBE[2]))
print 'Patching attacher.'
echo ':: Patching attacher.'
# Create certificate patch.
xxd -c1 -l 464 -s $((XBE[2]-XBE[1])) -o "$SHIFT" "$ATTACHER" > "$XBEPATCH"
# Create certificate version patch.
Expand Down

0 comments on commit 78b478b

Please sign in to comment.