From 2dff31a54368afd4ddc338d5b16947e33a258698 Mon Sep 17 00:00:00 2001 From: thesourcerer8 Date: Tue, 9 Jun 2015 17:19:48 +0200 Subject: [PATCH 1/4] Adding a tool to convert images for fernvale This tool converts a PNM image to the framebuffer format of Fernvale --- pnm2bin.pl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pnm2bin.pl diff --git a/pnm2bin.pl b/pnm2bin.pl new file mode 100644 index 0000000..499177c --- /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")?getc(IN):; $r>>=3; + my $g=($header eq "P6")?getc(IN):; $g>>=2; + my $b=($header eq "P6")?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; From e5fedf58bf2d0a49de9e29344b20d79f4bb3fb8f Mon Sep 17 00:00:00 2001 From: thesourcerer8 Date: Tue, 9 Jun 2015 17:35:48 +0200 Subject: [PATCH 2/4] Adding splashscreen to display a splashscreen on Fernvale --- splashscreen.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 splashscreen.sh 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 From 4b7c8099608d96e1e7e9b405ac138956596cae89 Mon Sep 17 00:00:00 2001 From: thesourcerer8 Date: Tue, 9 Jun 2015 17:36:29 +0200 Subject: [PATCH 3/4] Fixed reading P6 fileformat --- pnm2bin.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pnm2bin.pl b/pnm2bin.pl index 499177c..4ced617 100644 --- a/pnm2bin.pl +++ b/pnm2bin.pl @@ -27,9 +27,9 @@ { foreach(0 .. ($xsize-1)) { - my $r=($header eq "P6")?getc(IN):; $r>>=3; - my $g=($header eq "P6")?getc(IN):; $g>>=2; - my $b=($header eq "P6")?getc(IN):; $b>>=3; + 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); From b9cbae0b28056160a044fafb4e99bc8f23e4fefd Mon Sep 17 00:00:00 2001 From: thesourcerer8 Date: Wed, 29 Jul 2015 10:38:06 +0200 Subject: [PATCH 4/4] Added SRAM infos --- README.md | 2 ++ 1 file changed, 2 insertions(+) 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 |