Skip to content

Commit

Permalink
Added a script to automatically fix certain downloaded files so that …
Browse files Browse the repository at this point in the history
…they can

be converted to ROMs.
  • Loading branch information
dboddie committed May 5, 2019
1 parent 2a39c18 commit ba7640b
Show file tree
Hide file tree
Showing 58 changed files with 777 additions and 557 deletions.
10 changes: 5 additions & 5 deletions Fixes/Adventure_Quest/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Adventure Quest UEF file> <patched UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Adventure Quest UEF file> <patched UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0 temp
UEFtrans.py "$1" extract 0 temp

python patch_file.py

UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/LOADER,temp/QUEST
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/LOADER,temp/QUEST
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Anarchy_Zone/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Anarchy Zone UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Anarchy Zone UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5 temp

# Fix the loader to remove attempts to disable keyboard scanning.
python -c 't = open("temp/ZONE", "rb").read(); t = t.replace("FX178", "*****"); open("temp/ZONE", "wb").write(t)'

UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/ZONE,temp/ZONE#1,temp/ZONE#2,temp/ZONE#3,temp/ZONE#4,temp/ZONE#5
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/ZONE,temp/ZONE#1,temp/ZONE#2,temp/ZONE#3,temp/ZONE#4,temp/ZONE#5
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Ballistix/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Ballistix UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Ballistix UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5,6 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5,6 temp
./balls.py
distance_pair.py --compress temp/STIX temp/STIXDATA
distance_pair.py --compress temp/BALLS1 temp/BALLS1DATA
Expand All @@ -19,6 +19,6 @@ python -c 'open("temp/BALLS.inf", "w").write("$.BALLS\t1900\t8023\t%x" % len(ope
python -c 'open("temp/stix.inf", "w").write("$.STIX\t2300\t2300\t%x" % len(open("temp/stix").read()))'
# Put the code above HIMEM (0x2700) in the BALLS loader.
python -c 'open("temp/BALLS1.inf", "w").write("$.BALLS1\t2700\t2700\t%x" % len(open("temp/BALLS1").read()))'
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/BALLISTIX,temp/BALLS,temp/stix,temp/BALLS1,temp/BALLS2,temp/BALLS3,temp/BALLS4
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/BALLISTIX,temp/BALLS,temp/stix,temp/BALLS1,temp/BALLS2,temp/BALLS3,temp/BALLS4
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Baron/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Baron UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Baron UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5,6,7,8 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5,6,7,8 temp
./loader.py
#distance_pair.py --compress temp/BARSCR temp/SCRDATA
cp SCRDATA temp/
ophis -o temp/screen screen.oph
cat temp/screen temp/SCRDATA > temp/SCREEN
python -c 'open("temp/SCREEN.inf", "w").write("$.BARSCR\t4200\t4200\t%x" % len(open("temp/SCREEN").read()))'
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/BARON,temp/BARON3,temp/SCREEN,temp/MAIN002,temp/MAIN,temp/MAIN000,temp/MAIN001,temp/MAIN003,temp/SCREEN2
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/BARON,temp/BARON3,temp/SCREEN,temp/MAIN002,temp/MAIN,temp/MAIN000,temp/MAIN001,temp/MAIN003,temp/SCREEN2
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/BoneCruncher/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <BoneCruncher UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <BoneCruncher UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5,6,7 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5,6,7 temp
./loader.py
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append 'temp/LOADER,temp/Bone_2,temp/SCREEN 1,temp/SCREEN 2,temp/SCREEN 3,temp/SCREEN 4'
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append 'temp/LOADER,temp/Bone_2,temp/SCREEN 1,temp/SCREEN 2,temp/SCREEN 3,temp/SCREEN 4'
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Boulder_Dash/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Boulder Dash ADF file> <patched UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Boulder Dash ADF file> <patched UEF file>"
exit 1
fi

ADF2INF.py $1 temp
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/Boulder,temp/Screen,temp/DASH
ADF2INF.py "$1" temp
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/Boulder,temp/Screen,temp/DASH
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Bug_Eyes_2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Bug Eyes 2 SSD file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Bug Eyes 2 SSD file> <stripped UEF file>"
exit 1
fi

mkdir temp
SSD2UEF.py $1 be.uef $.LOADER,$.BUGLOAD,$.BUGEYES,$.SCREEN
SSD2UEF.py "$1" be.uef $.LOADER,$.BUGLOAD,$.BUGEYES,$.SCREEN
UEFtrans.py be.uef extract 0,1,2,3 temp

# Fix the loaders to disable VDU and re-enable it after loading.
Expand All @@ -17,7 +17,7 @@ sed -i s/14b/14f/g temp/LOADER.inf
python -c 't = open("temp/BUGLOAD", "rb").read(); t = t.replace("\x4c\x0a\x1e", "\x4c\xb8\x04") + "\xa9\x06\x20\xee\xff\x4c\x0a\x1e"; open("temp/BUGLOAD", "wb").write(t)'
sed -i s/b8/c0/g temp/BUGLOAD.inf

UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/LOADER,temp/BUGLOAD,temp/BUGEYES,temp/SCREEN
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/LOADER,temp/BUGLOAD,temp/BUGEYES,temp/SCREEN
rm -r temp
rm be.uef
10 changes: 10 additions & 0 deletions Fixes/By_Fair_Means_Or_Foul/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <By Fair Means Or Foul SSD file> <UEF file>"
exit 1
fi

SSD2UEF.py -s C. "$1" "$2" $.LOADER,$.TITLE,$.1,$.2,$.3,$.PB
10 changes: 5 additions & 5 deletions Fixes/Camelot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Camelot UEF file> <patched UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Camelot UEF file> <patched UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5 temp
python -c 't = open("temp/QLOAD").read(); t = t.replace("FX178,255,255", "*************"); open("temp/QLOAD", "w").write(t)'
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/CAMELOT,temp/QLOAD,temp/SCREEN,temp/QUEST21,temp/QUEST22,temp/QUEST23
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/CAMELOT,temp/QLOAD,temp/SCREEN,temp/QUEST21,temp/QUEST22,temp/QUEST23
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Codename_Droid/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Codename: Droid UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Codename: Droid UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5 temp
distance_pair.py --compress temp/RUN3 temp/RUN3DATA
ophis -o temp/loader loader.oph
cat temp/loader temp/RUN3DATA > temp/LOADER
python -c 'open("temp/LOADER.inf", "w").write("$.LOADER\t3100\t3100\t%x" % len(open("temp/LOADER").read()))'
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/LOADER,temp/DROID
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/LOADER,temp/DROID
rm -r temp
12 changes: 6 additions & 6 deletions Fixes/Confuzion/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Confuzion UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Confuzion UEF file> <stripped UEF file>"
exit 1
fi

cp $1 $2
UEFtrans.py $1 extract 1 temp
cp "$1" "$2"
UEFtrans.py "$1" extract 1 temp

python patch_checks.py

# Replace the original CONFUZION file with the patched version.
UEFtrans.py $2 remove 1
UEFtrans.py $2 insert 1 temp/CONFUZION
UEFtrans.py "$2" remove 1
UEFtrans.py "$2" insert 1 temp/CONFUZION
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Crazee_Rider/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Crazee Rider UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Crazee Rider UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5,6 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5,6 temp
#distance_pair.py --compress temp/CrazeeScr temp/SCRDATA
cp SCRDATA temp/
ophis -o temp/screen screen.oph
cat temp/screen temp/SCRDATA > temp/SCREEN
python -c 'open("temp/SCREEN.inf", "w").write("$.CrazeeScr\t48f0\t48f0\t%x" % len(open("temp/SCREEN").read()))'
python -c 'import os; os.rename("temp/Game\x84\x7f", "temp/Game"); os.rename("temp/Game\x84\x7f.inf", "temp/Game.inf")'
UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/Crazee,temp/CrazeeR,temp/SCREEN,temp/CrazeePan,temp/CrazeeMod,temp/CRider,temp/Game
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/Crazee,temp/CrazeeR,temp/SCREEN,temp/CrazeePan,temp/CrazeeMod,temp/CRider,temp/Game
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Dunjunz/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Dunjunz UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Dunjunz UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 temp

# Fix the level loading addresses so that we don't have to specify them all.
sed -i s/6b/3b/g temp/Level*.inf
Expand All @@ -16,6 +16,6 @@ sed -i s/6b/3b/g temp/Level*.inf
# loader to skip the level data check.
python unscramble.py

UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/DUNK,temp/LOADER,temp/TITLE,temp/Dunjunz,temp/Level1,temp/Level2,temp/Level3,temp/Level4,temp/Level5,temp/Level6,temp/Level7,temp/Level8,temp/Level9,temp/Level10,temp/Level11,temp/Level12,temp/Level13,temp/Level14,temp/Level15,temp/Level16,temp/Level17,temp/Level18,temp/Level19,temp/Level20,temp/Level21,temp/Level22,temp/Level23,temp/Level24,temp/Level25
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/DUNK,temp/LOADER,temp/TITLE,temp/Dunjunz,temp/Level1,temp/Level2,temp/Level3,temp/Level4,temp/Level5,temp/Level6,temp/Level7,temp/Level8,temp/Level9,temp/Level10,temp/Level11,temp/Level12,temp/Level13,temp/Level14,temp/Level15,temp/Level16,temp/Level17,temp/Level18,temp/Level19,temp/Level20,temp/Level21,temp/Level22,temp/Level23,temp/Level24,temp/Level25
rm -r temp
10 changes: 10 additions & 0 deletions Fixes/Eddie_Kidd_Jump_Challenge/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Eddie Kidd Jump Challenge SSD file> <UEF file>"
exit 1
fi

SSD2UEF.py -s C. "$1" "$2" $.EDDIE,$.KIDD,$.S
10 changes: 10 additions & 0 deletions Fixes/Exile/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Exile SSD file> <UEF file>"
exit 1
fi

SSD2UEF.py -s C. "$1" "$2" $.EXILE,$.EXILE1,$.EXILE2,$.EXILE3,$.EXILEL,$.ExileMC,$.QSAVE
10 changes: 10 additions & 0 deletions Fixes/Galaforce2/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Play It Again Sam 6 DSD file> <UEF file>"
exit 1
fi

SSD2UEF.py -s A. "$1" "$2" A.LOADER,A.SUP-ACO,A.GALAF2,A.GALA2T,A.G2LOAD,A.GAME,A.GAME2
10 changes: 5 additions & 5 deletions Fixes/Galaxy_Wars/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Galaxy Wars UEF file> <patched UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Galaxy Wars UEF file> <patched UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0 temp
UEFtrans.py "$1" extract 0 temp

# Patch the game.
python patch_file.py

UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/WARS
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/WARS
rm -r temp
10 changes: 5 additions & 5 deletions Fixes/Helter_Skelter/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Helter Skelter UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Helter Skelter UEF file> <stripped UEF file>"
exit 1
fi

UEFtrans.py $1 extract 0,1,2,3,4,5 temp
UEFtrans.py "$1" extract 0,1,2,3,4,5 temp

# Fix the loader to remove the call to disable keyboard scanning.
python -c 't = open("temp/LOADER", "rb").read(); t = t.replace("FX178,0", "*******"); open("temp/LOADER", "wb").write(t)'

UEFtrans.py $2 new Electron 0
UEFtrans.py $2 append temp/LOADER,temp/START,temp/HELTA,temp/GOFORIT,temp/SCRFLB,temp/SCRFLA
UEFtrans.py "$2" new Electron 0
UEFtrans.py "$2" append temp/LOADER,temp/START,temp/HELTA,temp/GOFORIT,temp/SCRFLB,temp/SCRFLA
rm -r temp
6 changes: 3 additions & 3 deletions Fixes/Hyper_Viper/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Hyper Viper SSD file> <UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Hyper Viper SSD file> <UEF file>"
exit 1
fi

SSD2UEF.py $1 $2 $.LOADER,$.VIPER,$.LICENCE
SSD2UEF.py "$1" "$2" $.LOADER,$.VIPER,$.LICENCE
14 changes: 7 additions & 7 deletions Fixes/Icarus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

set -e

if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: `basename $0` <Icarus UEF file> <stripped UEF file>"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: `basename "$0"` <Icarus UEF file> <stripped UEF file>"
exit 1
fi

cp $1 $2
UEFtrans.py $1 extract 3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 temp
cp "$1" "$2"
UEFtrans.py "$1" extract 3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 temp

# Unscramble all the levels to make them easier to compress and patch the
# loader to skip the level data check.
python unscramble.py

# Replace the original Vars file with the patched version.
UEFtrans.py $2 remove 3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
UEFtrans.py $2 insert 3 temp/Vars
UEFtrans.py $2 append temp/DECKA,temp/DECKB,temp/DECKC,temp/DECKD,temp/DECKE,temp/DECKF,temp/DECKG,temp/DECKH,temp/DECKI,temp/DECKJ,temp/DECKK,temp/DECKL,temp/DECKM,temp/DECKN,temp/DECKO,temp/DECKP,temp/DECKQ,temp/DECKR,temp/DECKS,temp/DECKT
UEFtrans.py "$2" remove 3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
UEFtrans.py "$2" insert 3 temp/Vars
UEFtrans.py "$2" append temp/DECKA,temp/DECKB,temp/DECKC,temp/DECKD,temp/DECKE,temp/DECKF,temp/DECKG,temp/DECKH,temp/DECKI,temp/DECKJ,temp/DECKK,temp/DECKL,temp/DECKM,temp/DECKN,temp/DECKO,temp/DECKP,temp/DECKQ,temp/DECKR,temp/DECKS,temp/DECKT
rm -r temp
Loading

0 comments on commit ba7640b

Please sign in to comment.