FANDOM


Tiny mod for ASCII Sector 0.7.2, Linux, 64 bits that redecorates the Galaxy ship's interior a bit to make it look friendlier. No gameplay change i.e. ship won't get faster or anything, it's just how the ship looks inside.

Save this code to a file, mark it as executable and run it in ASCII Sector's top directory. The script makes backups of all files it changes, still, no guarantees. Doesn't apply to any other version (aborts before doing harm). Savegames remain valid.

#!/bin/bash -e
test $# = 0 ||exec cat <<\EOF
 Patches ASCII Sector 0.7.2, Linux, 64 bits to make the Galaxy ship's interior
 design a bit more cozy. :-)					--JR03/2019

 The Galaxy with cargo expansion has a lonely table crammed in at the end of a
 long, narrow corridor. Who'd want to sit there, this looks uncomfortable. And
 who'd walk this far from the cockpit? And there are no plants, that's unhealty!
 Execute this script to patch the ship's layout: one of the 3 bedrooms is moved,
 making better use of available space and adding a nice, friendly sitting corner
 with a window. And the cockpit gets a wide panorama pane. The un-cargo-expanded
 Galaxy has the same changes, plus the 3rd bedroom is quite luxurious.

 The total ship space doesn't change, that would be unrealistic: of course we
 can't expand sideways into the engines. And of course the Galaxy's performance
 parameters (speed, cargo space, etc.) don't change at all, that would be
 cheating. This is just cosmetics to make my favorite ship look more cozy.
 Old savegames remain valid.

 Unfortunately ASCII Sector is programmed sloppily, much of the ships is
 hardcoded instead of properly putting it in the ships' data files. Which means
 we have to patch the main asciisec binary. This means this patch is specific
 to 1 exact version of the binary. :-( Sorry! And it means I might have messed
 up and some other ship is affected, too, because it shares its cargo expansion
 code with the Galaxy? This would have been easy to miss, I didn't have
 sources, just 38 MB worth of disassembly. I tested some other ships, but not
 all of them. But as far as I can tell everything is fine.

 The script does some basic checking and backs up the files before changing.
 Still, use at your own risk.
EOF

unset FILE
while read ADDR DATA; do
  test "${ADDR#\#}" = "$ADDR" ||continue
  set -- $DATA
  if [ "$ADDR" = FILE ]; then
    SIZE="$1"; shift; FILE="$*"
    if ! [ -f "$FILE" -a -w "$FILE" ]; then
      echo "Error: Can't find '$FILE' or can't write. Aborted!" >&2
      exit 1
    fi
    if [ "$(stat -c%s "$FILE")" != "$SIZE" ]; then
      echo "Error: '$FILE' not the size this script expects. Aborted!" >&2
      exit 1
    fi
    if [ -e "$FILE.bak" ]; then
      echo "Backup '$FILE.bak' already exists. Bailing out!" >&2
      exit 1
    fi
    cp -av "$FILE" "$FILE.bak"
  else
    for DATA; do
      test "${DATA#\#}" = "$DATA" ||break
      echo -ne "\\x$DATA"
    done | dd seek=$((0x$ADDR)) bs=1 of="$FILE" conv=notrunc status=none
  fi
done <<\EOF
# ASCII Sector 0.7.2, Linux, 64 bits
FILE 3576144 asciisec
# *.shp files only contain ships' basic layouts, changes due to cargo expansions
# etc. are unfortunately hardcoded in the binary. For the Galaxy, the code puts
# a table with chair in the SW corner. My new design calls for a bed instead.
1F8017 B1 # table->bed
1F803A 0F # white
1F805D B1 # chair->bed
1F8080 0F # brown->white
# Redecorate the Galaxy ship itself. Unfortunately, to keep the file's
# encryption intact we have to patch a lot more bytes than we actually change.
FILE 2980 data/4.shp
# Main map
003D 5C C7 D5 91 52 97 71 2E 15 3C BA CA F4 75 A9 CB B5 22 3F 0B 1F 1C 15 0F
0055 42 4E A4 1F C7 9A 37 B8 24 74 A0 79 A0 28 74 5D 3D
0067 8D DD B5 80 26 0B 0B AF CF 25 EE 5F 5F 97 8E FA AC 34 C5 08 3C 1D D0 75
007F C6 7F 15 B2 4B 02 A0 CA 59 91 7A 8D 6C B2 F1 60 E5 67 56 45 4C 4E 73 14
0097 50 CF F0 92 CC CF CA A9 9A 8D 4F 08 CF 0F 04 E7 E5 ED B4 C1 65 65 2B 0B
00AF 5C 6C 91 20 EC D0 B1 63 D9 B7 C3 5A 20 C1 34 7D 4F 33 E5 82 91 11 AA DB
00C7 3E 0B 8B 9B 96 CC E4 45 A2 CB BA F9 45 AD 95 F3 0B D4 2F E8 17 BE E0 49
00DF CD DC 0A 4E F2 65 C9 D4 6B B1 96 CC E4 45 A2 CB BA 94 B9 91 DF 01 61 04
00F7 D8 65
0125 50 63 D9 DD ED EF E0 5A EC 25 E2 A8 0F 25 88 CF 73 81 4B E1 A0 8B AD A7
013D 8B B5 99 45 06 3F CE 5B 7A 35 1C 06 89 E5 43 78 BD 18
0150 70 D7 57 FC 45 37 37 BA F0 27 87 B3 04 75 3A E9 1A 8C 2B 21 95 69 8A 3E
0168 50 C7 F9 F1 BF D6 FA E3 29 07 6D BA 44 3F 97 D8 61 D6 6A F1 D7 64 80 9D
0180 EA 17 C0 96 DE 05 1C D9 3E 98 D6 17 5E D8 C7 98 1D 89 68 A5 D1 02 EB 4E
0198 83 5A AC C2 BD 84 84 5A 60 72 22 5F BF 6B 09 CD 5B F7 39 59 E3 B9 22 DA
01B0 4E A1 CC 4E 91 0C 4E 22 EE A2 42 CC BA EF B3 83 15 17 29 9F 16 17 2F 8C
01C8 F8 FB 79 39 7F F1 B7 CE 77 AA A6 F1 A7 4F 71 1A AC A5 7F E3 C3 6B AD 46
01E0 9D 85 9E 5A 82 E0 F9 93 B1 26 12 C8 85 63 95 65 73 D6
01F5 AF 98 CD 4C 8F 1D 21 27 12 C8 58 C6 36 9D AD 99 7F D1 7D 6E BF CD 7E 11
020D 8F F2 30 EE 01 59 50 E8 06 0B 2A 19 6A 81 E5 45 49 04 B5 BF 53 EF E4 15
0225 BE 40 B7 B4 28 4C 4E 9C 7E 3D 8A DC C1 A4 74 C8 2F 90 0A 3E 39 88 90 EC
023D 0A 77 0B C8 3D AC EE 20 E3 01 B0 FA E7 56 F3 7E E0 C0 ED FA 7A FC D6 B1
0255 03 07 5A 4B 9B 88 52 11 84 62 EE C5 97 B2 35 D3 5A 40 2C BF A3 14 91 49
026D AC 6C E8 E7 9F 65 63 47 65 80 9C 68 DE AA 69 9D 26 47 A0 BE B2 D2 0F 83
0285 60 BA 67 4E A8 42 98 94 FC 3B 23 1E E7 B6 29 6C 09 A2 84 B1 2D 55 EF B6
029D 24 65 73 0C 69 5A B5 7C D1 4F 2F 06 A2 FF CA 2D 91 8E 29 EF 88 27 6D E0
02B5 36 C8 83 A3 D8 4B 9C 1C DE 04 37 D4 4B E3 60 6F 64 18 1C 27 E8 49 99 B1
02CD 41 96 E4 87 54 73 DA C8 9E C2 15 A1 B9 C9 37 5B 66 29 5A AA B7 19 3E 7E
02E5 B2 7E CE EF 84 FF
# Color map
03B6 EA 79 BC D6 92 02 F9 46 29 41 10 2A E4 3D 18 EB AC 98 54 7D FF FD 75 C6
03CE 49 2F 8E 5D AE BA 9E 8A 28 74 5D 3D 3D 8D B0 9D DB 66 48 DB A1 61
04AF DB 70 47 0A BE 42 D8 1A 0E 43 CC 3B 51 18
04BE DF D7 64 50 D4 F9 2E D7 28 B7 E1 9E AA 22 80 7D EF 61 2E F5 7C F4 F2 EE
04D6 1D E6 C9 5F 26 B9 4A
051F D2 5A 70 3D A5 04 14 20 6D 00 A7 94 92 BF E7 F3 54 0F 24 F9 15 58 49 8E
0537 7A 14 BD 46 1E E8 01 AD 5C 9F 28 83 05 6B 8F F7 0A 5B 15 64 E1 36 2D C2
054F 0D 6C 87 76 4A 45 73 CF BF 1F E7 48 B1 F8 44 BC 8F 46 B8 41 3D B3 B1 40
0567 5D 8C F9 9F 8B E9 67 54 F6 77 8A 30 AD B3 3C F9 BE 5F 01 A6 73 E8 23 05
057F 4E 7F 4E F6 AF 10 68 E2 DF 73 58 97 4B 67 73 CF C6 CF 88 67 08 83 E0 40
0597 05
0599 94 BF E5 33 67 D8 C2 47 FE 5E 73 62 8B E8 51 88 B5 89 83 D8 47 B7 13 67
05B1 B4 4D B6 C3 67 F6 77 8D 78 21 DF D9 87
05BF 41 B2 2B FC B1 73 48 ED F9 80 8B A5 99 17 B1 6A 5A
05D1 81 3F B3 7C D7 64 F9 CD C8 98 C2 BC 78 F6 D4 D9 83 F7 E5 27 BA 0D 08 69
05E9 C0 C7 4C F5 7B F0 15 B7 91 72 00 BE B3 C7 A2 F5 08 1A BF 6E 87 02 C5 A7
0601 DD DB AB A0 94 22 08 CC 79 67 D6 60 3F 62 F8 DA 50 D4 B6 8B 49 B8 A4 7D
0619 46 8D 04 F6 BE E1 86 48 93 7B 24 DC 6C D2 F0 6C 95 E0 EB 12 72 29 BB 55
0631 05 CB 5A F9 42 25 44 05 07 09 E7 71 20 8D 1D 0D FB 6C DB BF A9 2D 0F D0
0649 81 7C 0E E2 BF 66 E9 A5 A7 74 54 20 23 CF 7A 80
065A 7D E0 E2 E2 55 20
0661 D4 6B C4 59 DB F7 A4 6C D7 BF B8 DD D8 D5 E2 F3 C5 FA 39 84 58 82 9F 41
0679 D2 69 4B 1F E7 F9 D4 6B C4 59 DB F7 A4 6C D7 BF B8 DD D8 D5 E2 FB 7E 47
0691 64 AD AB 4A 77 D3 4B CD BE FF 86 B8 06 D8 C9 FC 20 73 C6 BC 7D E3 2D 64
06A9 A8 E0 1A 50 38 91 F1 97 8E 09 0A B9 84 27 F3 5E 07 96 35 6E AC F8 40 7C
06C1 1A D7 3C E8 D9 D2 CC 68 BF C8 52 F3 87 30
# Room map
091C 40 86 C0 33 E2 5C 26 11 B3 D9 94 40 D9 B8 05 C4 17 98 CB 1C 3D B0 6D 06
0934 92 B8 2F 79 5D 34 FB E2 49 3C 52 22 BB BB C8 77 1B 25 17 87 25 23 8D 91
094C 66 0C 39 8D 56 15 D6 BA FB 8F E9 7E
0959 B6 6E 2E 91 95 17 FE 0C 8F EC 08 17 C7 E6 1F 78 3F 1B CB C3 AB 80 A3 7D
0971 CF 09 DB 7B BE 74 B9 14 42 95 4E BB 77 0E 65 E5 1C 3F 35 76 99 96 37 42
0989 A9 53 2B 85
098E BF 88 02 B5 38 C3 BB 5C B9 C5 18 AD B2 F8 4F ED 4E B2 FC E8 A2 FD 2C 48
09A6 23 0C 45 75 85 00 7E CF 2D E3 91 AC D9 7D 6D 8F BD A0 77 F6
09D5 F9 E5 55 CB 6E FB F4 7E B2 E9 27 C7 0E 50 6B 86 03 6B AE 1A 82 11 48 42
09ED 7B 4F 9B 08 24 85 01 69 97 37 42 74 AA 76 BF 0A ED E7 FF 64 3F E7 73 6B
0A05 CA 7B D7 57 58 62 AB 05 60 25 A8 D9 24 B5 4E C1 CB 06 B5 06 3B 46 AA B8
0A1D 2D C2 2C A3 4E 37 D7 D4 66 C0 84 AE BD F7 6A 58 B7 7C 88 71 C7 D1 00 16
0A35 05 31 9E EF E6 8F E0 15 3C 23 37 8E 7E 7F AF 5F 0B B2 0B 2C B1 F4 1A D0
0A4D E0 DD 73 2E 45 BA 99 52 34 AA 7E 67 BA 2E 5B A1 5A ED AE D8 57 FC 3D F6
0A65 B1 D9 CF 80 5D E3 53 00 2C 1F F8 ED 8C 33 2E 8F C6 E8 A6 39 49 33 45 D1
0A7D 68 3C 2C FD C7 50 14 48 4F EF DD 20 34 6F 54 6B 7D 29 16 43 92 0E 4E EE
0A95 E0 CF 89 4B 18 28 6D 6B 67 67 E7 C9 0B 44 9D DC E2 54 9A D1 F5 62 87 2A
0AAD 13 73 35 7D 4C 36
EOF
echo "Done."
Community content is available under CC-BY-SA unless otherwise noted.