mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-05-25 07:22:44 -04:00
23b6bd2643
* All segments are now extracted from the base ROM; the base ROM is no longer a compile time dependency * ROM segments are now positioned relatively to each rather than with hard coded addresses * Piracy checksums are calculated during build
13 lines
356 B
Bash
Executable File
13 lines
356 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Extracts a segment from the binary that was produced by ld.
|
|
|
|
segment=$1
|
|
|
|
pos=$(grep "^\.$segment " $B_DIR/pd.map | awk '{print $6}')
|
|
len=$(grep "^\.$segment " $B_DIR/pd.map | awk '{print $3}')
|
|
|
|
mkdir -p $B_DIR/segments
|
|
dd if=$B_DIR/stage2.bin of=$B_DIR/segments/$segment.bin skip=$(($pos)) iflag=skip_bytes bs=$(($len)) count=1 status=none
|
|
|