diff --git a/trunk/bootrom/build/buildtools/modulerules b/trunk/bootrom/build/buildtools/modulerules index 2af3d48..8f6b1b8 100644 --- a/trunk/bootrom/build/buildtools/modulerules +++ b/trunk/bootrom/build/buildtools/modulerules @@ -98,6 +98,10 @@ $(BINDIR)/$(TARGET_BIN_BASENAME).dasm: $(BINDIR)/$(TARGET_BIN_BASENAME).axf $(BINDIR)/$(TARGET_BIN_BASENAME).exo: $(BINDIR)/$(TARGET_BIN_BASENAME).sbin objcopy -I binary -O srec $< $@ +# .ptxt +$(BINDIR)/$(TARGET_BIN_BASENAME).ptxt: $(BINDIR)/$(TARGET_BIN_BASENAME).sbin + $(BROM_TOOLSDIR)/bin/bin2palladium.pl $< > $(BINDIR)/$(TARGET_BIN_BASENAME).ptxt + #---------------------------------------------------------------------------- BROM_MODULERULES_ = TRUE endif # BROM_MODULERULES_ diff --git a/trunk/bootrom/tools/bin/bin2palladium.pl b/trunk/bootrom/tools/bin/bin2palladium.pl new file mode 100644 index 0000000..8215ac1 --- /dev/null +++ b/trunk/bootrom/tools/bin/bin2palladium.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl +use POSIX stdio_h; + +die "Error: Need input file.\n" unless @ARGV; +for $ARGV ( @ARGV ){ + @c; + + open (IN, $ARGV) || die "$ARGV : $!"; + binmode(IN); + + while ( read(IN, $_, 1) ){ + $c[0] = uc( unpack("H2", $_) ); + for ($i=1; $i<8; $i++){ + unless ( read(IN, $_, 1) ){ + $_ = 0; + } + $c[$i] = uc( unpack("H2", $_) ); + } + print STDOUT $c[3],$c[2],$c[1],$c[0],$c[7],$c[6],$c[5],$c[4], "\n"; + } + + close(IN); +} + +