diff --git a/Makefile b/Makefile index 693bdbd..7c8588d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -SOURCES := $(wildcard [0-9]*x[0-9]*.S) +SOURCES := $(filter-out edid.S, $(wildcard *.S)) BIN := $(patsubst %.S, %.bin, $(SOURCES)) @@ -16,7 +16,7 @@ clean: cc -c -DCRC="0x00" -o $@ $^ %.bin.nocrc: %.o - objcopy -Obinary $^ $@ + objcopy -j .data -Obinary $^ $@ %.crc: %.bin.nocrc cat $^ | edid-decode \ @@ -26,7 +26,7 @@ clean: cc -c -DCRC="$$(cat $*.crc)" -o $@ $*.S %.bin: %.p - objcopy -Obinary $^ $@ + objcopy -j .data -Obinary $^ $@ %.bin.ihex: %.p objcopy -Oihex $^ $@ diff --git a/modeline2edid b/modeline2edid index 56c5e4b..da623e3 100755 --- a/modeline2edid +++ b/modeline2edid @@ -32,6 +32,7 @@ template-S() { local name="${1//\"}" [[ -z "$name" ]] && echo "Could not parse modeline: $@" >&2 && return 1 + [[ "${#name}" -gt 12 ]] && echo "Name cannot be longer than 12 characters: $name is ${#name} characters long" >&2 && return 1 local fn="${name}.S" local -F pixel_clock_mhz=$2 @@ -47,8 +48,8 @@ template-S() { local arg for arg in "$@"; do case "${(L)arg}" in - [-+]hsync) [[ "${arg:1:1}" == "-" ]] || hsync_polarity=1 ;; - [-+]vsync) [[ "${arg:1:1}" == "-" ]] || vsync_polarity=1 ;; + [-+]hsync) [[ "${arg:0:1}" == "-" ]] || hsync_polarity=1 ;; + [-+]vsync) [[ "${arg:0:1}" == "-" ]] || vsync_polarity=1 ;; ratio=*|xy_ratio=*) ratio="${arg#*=}" ;; dpi=*) dpi="${arg#*=}" ;; edid_version=*) edid_version="${arg#*=}" ;; @@ -60,7 +61,7 @@ template-S() { case $ratio in compute) ratio=$(find-supported-ratio $hdisp $vdisp 'UNKNOWN') - printf 'Computed ratio: %s' $ratio + printf 'Computed ratio: %s\n' $ratio [[ $ratio != 'UNKNOWN' ]] || return 1 ;; esac