From a458e5996d1cc372b823964b408921d91e9d5554 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b871894f-2f95-9b40-918c-086798483c85> Date: Mon, 2 Feb 2009 11:10:19 +0000 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E9=80=9F=E3=82=A8=E3=83=9F=E3=83=A5?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=A7=E3=81=AE=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=89=E7=94=A8=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E7=94=9F=E6=88=90=E3=83=84=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@246 b871894f-2f95-9b40-918c-086798483c85 --- trunk/bootrom/build/buildtools/modulerules | 4 ++++ trunk/bootrom/tools/bin/bin2palladium.pl | 25 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 trunk/bootrom/tools/bin/bin2palladium.pl 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); +} + +