diff --git a/README.md b/README.md index cf8fa54..6625268 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,8 @@ Memory Map | 0x10000000 | 0x1fffffff | 0x0fffffff | Memory-mapped SPI chip | | ?????????? | ?????????? | ?????????? | ??????????????????????????????????? | | 0x70000000 | 0x7000cfff | 0xcfff | On-chip SRAM (maybe cache?) | +| 0x70008000 | 0x7000A400 | 0x00002400 | SRAM CODE area | +| 0x7000A400 | 0x7000B000 | 0x00000C00 | SRAM DATA area | | ?????????? | ?????????? | ?????????? | ??????????????????????????????????? | | 0x80000000 | 0x80000008 | 0x08 | Config block (chip version, etc.) | | 0x82000000 | 0x82d00000 | ?????????? | Modem system stuff | diff --git a/pnm2bin.pl b/pnm2bin.pl new file mode 100644 index 0000000..4ced617 --- /dev/null +++ b/pnm2bin.pl @@ -0,0 +1,43 @@ +#!/bin/perl + +print "pnm2bin.pl picture.pnm picture.bin\n"; +print "converts a picture in the format 240x320 PNM to the RGB-565 format necessary for Fernvale\n"; + +my $infile=$ARGV[0] || "picture.pnm"; +my $outfile=$ARGV[1] || "picture.bin"; + +open IN,"<$infile"; +my $header=; $header=~s/\s*$//; +if($header=~m/^P[36]/) +{ + print "$header PNM Format detected. Good. Converting ...\n"; + my $size=; + while($size=~m/^#/) + { + $size=; + } + if($size=~m/^(\d+) (\d+)/) + { + my $xsize=$1; my $ysize=$2; + print "Format: $1x$2\n"; + my $value=; + open OUT,">$outfile"; + + foreach(0 .. ($ysize-1)) + { + foreach(0 .. ($xsize-1)) + { + my $r=($header eq "P6")?unpack("C",getc(IN)):; $r>>=3; + my $g=($header eq "P6")?unpack("C",getc(IN)):; $g>>=2; + my $b=($header eq "P6")?unpack("C",getc(IN)):; $b>>=3; + + my $p1=(($g&7)<<5) | ($b); + my $p2=($r<<3) | ($g>>3); + print OUT pack("C",$p1); + print OUT pack("C",$p2); + } + } + close OUT; + } +} +close IN; diff --git a/splashscreen.sh b/splashscreen.sh new file mode 100644 index 0000000..cba9c9b --- /dev/null +++ b/splashscreen.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "splashscreen.sh " +echo Converting any 240x320 image to PNM +convert $1 picture.pnm +echo Converting from PNM to Fernvale Framebuffer format +perl ./pnm2bin.pl picture.pnm picture.bin +echo Telling fernvale to load the image +echo "load 0x40000 153600" >/dev/fernvale +echo Loading the image +cat picture.bin >/dev/fernvale +echo Displaying image +echo "lcd run" >/dev/fernvale +echo Done