source: PlatformSupport/Deprecated/pcores/user_io_board_controller_plbw_v1_01_a/mdlsrc/user_io_board_controller_init.m

Last change on this file was 1051, checked in by murphpo, 16 years ago

Updated LCD controller with line/character offsets

File size: 25.5 KB
Line 
1font5x7 = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 242 0 0 0 224 0 224 0 40 254 40 254 40 36 84 254 84 72 196 200 16 38 70 108 146 170 68 10 0 160 192 0 0 0 56 68 130 0 0 130 68 56 0 40 16 124 16 40 16 16 124 16 16 0 10 12 0 0 16 16 16 16 16 0 6 6 0 0 4 8 16 32 64 124 138 146 162 124 0 66 254 2 0 66 134 138 146 98 132 130 162 210 140 24 40 72 254 8 228 162 162 162 156 60 82 146 146 12 128 142 144 160 192 108 146 146 146 108 96 146 146 148 120 0 108 108 0 0 0 106 108 0 0 16 40 68 130 0 40 40 40 40 40 0 130 68 40 16 64 128 138 144 96 76 146 158 130 124 126 136 136 136 126 254 146 146 146 108 124 130 130 130 68 254 130 130 68 56 254 146 146 146 130 254 144 144 144 128 124 130 146 146 94 254 16 16 16 254 0 130 254 130 0 4 2 130 252 128 254 16 40 68 130 254 2 2 2 2 254 64 48 64 254 254 32 16 8 254 124 130 130 130 124 254 144 144 144 96 124 130 138 132 122 254 144 152 148 98 98 146 146 146 140 128 128 254 128 128 252 2 2 2 252 248 4 2 4 248 252 2 12 2 252 198 40 16 40 198 224 16 14 16 224 134 138 146 162 194 0 254 130 130 0 64 32 16 8 4 0 130 130 254 0 32 64 128 64 32 2 2 2 2 2 0 128 64 32 0 4 42 42 42 30 254 18 18 18 12 28 34 34 34 34 12 18 18 18 254 28 42 42 42 26 0 16 126 144 64 18 42 42 42 60 254 16 16 16 14 0 0 94 0 0 4 2 2 188 0 0 254 8 20 34 0 130 254 2 0 62 32 28 32 62 62 16 32 32 30 28 34 34 34 28 62 40 40 40 16 16 40 40 40 62 62 16 32 32 16 18 42 42 42 36 32 32 252 34 36 60 2 2 2 60 56 4 2 4 56 60 2 12 2 60 34 20 8 20 34 32 18 12 16 32 34 38 42 50 34 0 16 108 130 130 0 0 238 0 0 130 130 108 16 0 32 64 64 64 128 168 104 62 104 168 190 42 42 42 162 0 32 80 160 0 4 34 124 160 64 132 252 4 0 32 254 2 2 18 2 28 34 20 8 54 78 62 96 64 64 12 18 82 178 28 8 28 42 42 42 248 64 64 60 2 124 146 146 124 0 66 68 56 4 2 32 62 32 62 34 16 32 60 34 32 24 36 126 36 24 28 34 12 34 28 130 198 170 146 130 58 70 64 70 58 84 84 84 84 84 68 40 16 40 68 16 16 84 16 16 0 112 136 136 112 96 144 138 128 64 254 254 146 146 146 10 26 42 74 138 138 74 42 26 10 40 44 56 104 40 4 254 128 128 128 76 146 146 124 0 4 2 124 128 64 56 68 56 68 56 170 84 170 84 170 0 0 0 0 0 0 0 190 0 0 56 68 254 68 0 18 126 146 146 66 186 68 68 68 186 168 104 62 104 168 0 0 238 0 0 80 170 170 170 20 0 128 0 128 0 124 186 170 170 124 18 170 170 170 122 16 40 84 170 68 128 128 128 128 192 0 0 0 0 0 124 170 186 130 124 128 128 128 128 128 0 224 160 224 0 34 34 250 34 34 0 72 152 168 72 0 0 168 168 112 0 0 64 128 0 4 248 16 16 224 96 254 128 254 128 0 0 16 16 0 8 0 2 4 0 0 72 248 8 0 0 232 168 232 0 68 170 84 40 16 240 4 12 20 46 240 0 18 38 26 254 254 254 254 254 12 18 162 2 4 30 168 104 40 30 30 40 104 168 30 30 168 168 168 30 158 168 168 168 158 158 40 40 40 158 30 104 168 104 30 126 144 254 146 146 112 138 140 136 136 62 170 106 42 34 62 42 106 170 34 62 170 170 170 34 190 42 42 42 162 0 162 126 34 0 0 34 126 162 0 0 162 190 162 0 0 162 62 162 0 16 254 146 130 124 190 144 136 132 190 28 162 98 34 28 28 34 98 162 28 28 162 162 162 28 156 162 162 162 156 156 34 34 34 156 68 40 16 40 68 58 76 84 100 184 60 130 66 2 60 60 2 66 130 60 60 130 130 130 60 188 2 2 2 188 96 16 78 144 96 254 68 68 68 56 126 164 164 88 0 4 170 106 42 30 4 42 106 170 30 4 170 170 170 30 132 170 170 170 158 4 170 42 170 30 4 106 170 106 30 46 42 28 42 58 48 74 76 72 0 28 170 106 42 26 28 42 106 170 26 28 170 170 170 26 28 170 42 170 26 0 128 94 0 0 0 0 94 128 0 0 64 94 64 0 0 64 30 64 0 12 18 82 178 28 190 144 160 160 158 12 146 82 18 12 12 18 82 146 12 12 82 82 82 12 76 82 82 82 76 12 82 18 82 12 16 16 16 84 16 24 38 60 100 24 28 130 66 2 28 28 2 66 130 28 28 66 66 66 28 28 66 2 66 28 32 18 76 144 32 254 72 72 48 0 32 146 12 144 32];
2
3numCharacters = 94; %Load ASCII characters 33 through 126 (! to ~)
4chars_5x7 = font5x7(166:166+5*numCharacters-1);
5chars_5x7 = reshape(chars_5x7,5,numCharacters).';
6chars_8x8 = [zeros(numCharacters,1) chars_5x7 zeros(numCharacters,2)];
7
8for charNum = 1:size(chars_8x8,1)
9    x = chars_8x8(charNum, :);
10    for rowNum = 0:7
11        outChars(charNum, 8-rowNum) = sum( (bitand(x,2^rowNum.*ones(size(x)))>0) .* (repmat(2.^[0:7],size(x,1),1)));
12    end
13end
14
15black = hex2dec('00');
16white = hex2dec('FF');
17red = hex2dec('E0');
18green = hex2dec('1C');
19blue = hex2dec('03');
20
21colorChars_low = [ ...
22repmat(black, 1, 64) ...
23repmat(white, 1, 64) ...
24repmat(red, 1, 64) ...
25repmat(green, 1, 64) ...
26repmat(blue, 1, 64) ...
27repmat(red+green, 1, 64) ...
28repmat(red+blue, 1, 64) ...
29repmat(blue+green, 1, 64) ...
30[repmat(red, 1, 32) repmat(black, 1, 32)] ...
31[repmat(black, 1, 32) repmat(red, 1, 32)] ...
32[repmat(green, 1, 32) repmat(black, 1, 32)] ...
33[repmat(black, 1, 32) repmat(green, 1, 32)] ...
34[repmat(blue, 1, 32) repmat(black, 1, 32)] ...
35[repmat(black, 1, 32) repmat(blue, 1, 32)] ...
36[repmat(red+green, 1, 32) repmat(black, 1, 32)] ...
37[repmat(black, 1, 32) repmat(red+green, 1, 32)] ...
38[repmat(red+blue, 1, 32) repmat(black, 1, 32)] ...
39[repmat(black, 1, 32) repmat(red+blue, 1, 32)] ...
40[repmat(blue+green, 1, 32) repmat(black, 1, 32)] ...
41[repmat(black, 1, 32) repmat(blue+green, 1, 32)] ...
42[repmat(red, 1, 32) repmat(white, 1, 32)] ...
43[repmat(white, 1, 32) repmat(red, 1, 32)] ...
44[repmat(green, 1, 32) repmat(white, 1, 32)] ...
45[repmat(white, 1, 32) repmat(green, 1, 32)] ...
46[repmat(blue, 1, 32) repmat(white, 1, 32)] ...
47[repmat(white, 1, 32) repmat(blue, 1, 32)] ...
48[repmat(red+green, 1, 32) repmat(white, 1, 32)] ...
49[repmat(white, 1, 32) repmat(red+green, 1, 32)] ...
50[repmat(red+blue, 1, 32) repmat(white, 1, 32)] ...
51[repmat(white, 1, 32) repmat(red+blue, 1, 32)] ...
52[repmat(blue+green, 1, 32) repmat(white, 1, 32)] ...
53[repmat(white, 1, 32) repmat(blue+green, 1, 32)] ...
54repmat(black, 1, 64) ...
55];
56
57colorChars_high = [ ...
58repmat( [repmat(red, 1, 4) repmat(black, 1, 4)],1,8) ...
59repmat( [repmat(black, 1, 4) repmat(red, 1, 4)],1,8) ...
60repmat( [repmat(green, 1, 4) repmat(black, 1, 4)],1,8) ...
61repmat( [repmat(black, 1, 4) repmat(green, 1, 4)],1,8) ...
62repmat( [repmat(blue, 1, 4) repmat(black, 1, 4)],1,8) ...
63repmat( [repmat(black, 1, 4) repmat(blue, 1, 4)],1,8) ...
64repmat( [repmat(red+green, 1, 4) repmat(black, 1, 4)],1,8) ...
65repmat( [repmat(black, 1, 4) repmat(red+green, 1, 4)],1,8) ...
66repmat( [repmat(red+blue, 1, 4) repmat(black, 1, 4)],1,8) ...
67repmat( [repmat(black, 1, 4) repmat(red+blue, 1, 4)],1,8) ...
68repmat( [repmat(blue+green, 1, 4) repmat(black, 1, 4)],1,8) ...
69repmat( [repmat(black, 1, 4) repmat(blue+green, 1, 4)],1,8) ...
70repmat( [repmat(red, 1, 4) repmat(white, 1, 4)],1,8) ...
71repmat( [repmat(white, 1, 4) repmat(red, 1, 4)],1,8) ...
72repmat( [repmat(green, 1, 4) repmat(white, 1, 4)],1,8) ...
73repmat( [repmat(white, 1, 4) repmat(green, 1, 4)],1,8) ...
74repmat( [repmat(blue, 1, 4) repmat(white, 1, 4)],1,8) ...
75repmat( [repmat(white, 1, 4) repmat(blue, 1, 4)],1,8) ...
76repmat( [repmat(red+green, 1, 4) repmat(white, 1, 4)],1,8) ...
77repmat( [repmat(white, 1, 4) repmat(red+green, 1, 4)],1,8) ...
78repmat( [repmat(red+blue, 1, 4) repmat(white, 1, 4)],1,8) ...
79repmat( [repmat(white, 1, 4) repmat(red+blue, 1, 4)],1,8) ...
80repmat( [repmat(blue+green, 1, 4) repmat(white, 1, 4)],1,8) ...
81repmat( [repmat(white, 1, 4) repmat(blue+green, 1, 4)],1,8) ...
82];
83
84%ORIG
85%asciiChars = reshape(outChars.', 1, prod(size(outChars)));
86%asciiChars_endianFlip = reshape(flipud(reshape(asciiChars,4,length(asciiChars)/4)),1,length(asciiChars));
87%asciiChars_expanded = (bitand(repmat(asciiChars_endianFlip, 1, 8), repmat( 2.^[0:7], 1, 752))>1).*255;
88
89asciiChars = reshape(outChars.', 1, numel(outChars));
90asciiChars_endianFlip = reshape(flipud(reshape(asciiChars,4,length(asciiChars)/4)),1,length(asciiChars));
91asciiChars_expanded_mat = (bitand(repmat(asciiChars_endianFlip, 8, 1), repmat( 2.^[0:7].', 1, 752))>1).*255;
92asciiChars_expanded_vec = reshape(asciiChars_expanded_mat, 1, numel(asciiChars_expanded_mat));
93
94%asciiChars_bin = fliplr(dec2bin(asciiChars_endianFlip.',8));
95%Then find 1, replace with 0xFF,
96%Then find 0, replace with 0x00,
97
98colorChars_low_endianFlip = reshape(flipud(reshape(colorChars_low,4,length(colorChars_low)/4)),1,length(colorChars_low));
99
100colorChars_high_endianFlip = reshape(flipud(reshape(colorChars_high,4,length(colorChars_high)/4)),1,length(colorChars_high));
101
102NewAsciiChars = [0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,0,0,0,0,0,255,0,255,0,0,0,0,0,255,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,0,0,0,0,0,255,0,255,0,0,0,0,255,255,255,255,255,0,0,0,0,255,0,255,0,0,0,0,255,255,255,255,255,0,0,0,0,255,0,255,0,0,0,0,0,255,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,255,0,0,0,255,0,255,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,255,0,255,0,0,0,255,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,255,255,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,255,255,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,255,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,255,0,255,0,0,0,255,0,0,255,0,0,0,0,0,255,255,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,255,0,255,0,255,0,0,0,0,255,255,255,0,0,0,0,255,0,255,0,255,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,255,255,0,0,0,255,0,255,0,255,0,0,0,255,255,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,0,0,0,0,0,255,0,255,0,0,0,0,255,0,0,255,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,255,255,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,255,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,255,0,0,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,255,0,255,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,255,0,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,255,0,255,0,0,0,0,0,255,0,0,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,255,0,255,255,0,0,0,255,0,255,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,0,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,0,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,0,255,0,0,0,0,0,255,255,0,255,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,255,0,255,0,0,0,0,0,255,0,0,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,255,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,255,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,255,0,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,255,0,255,0,0,0,0,0,255,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,255,255,0,0,0,255,0,255,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,255,0,0,0,0,255,255,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,255,0,0,0,0,255,255,0,0,255,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,255,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,255,0,255,0,0,0,255,0,255,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,255,0,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,0,255,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,255,255,255,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
103NewAsciiChars_endianFlip = reshape(flipud(reshape(NewAsciiChars.',4,length(NewAsciiChars)/4)),1,length(NewAsciiChars));
104
105%charMap = [colorChars_low_endianFlip NewAsciiChars_endianFlip colorChars_high_endianFlip];
106charMap = [colorChars_low NewAsciiChars colorChars_high];
107
108charMap_reshape = flipud(reshape(charMap, 4, length(charMap)/4));
109charMap_32b = sum( charMap_reshape .* repmat([1;2^8;2^16;2^24],1,size(charMap_reshape,2)));
110
111%Default set of commands to put the LCD in a useable state; these can be overwritten by user code anytime
112%These commands match the default initialization from Sid's lcd_util.c and lcd_util.h
113%Each entry corresponds to a 16-bit command; this vector gets reshaped to 32-bit words to use as the BRAM init value
114defaultCommands = [458, 3, 32, 12, 0, 443, 1, 465, 404, 385, 25, 3, 288, 15, 423, 444, 5, 0, 1, 0, 462, 0, 2, 4, 6, 8, 10, 12, 15, 0, 2, 4, 6, 8, 10, 12, 15, 0, 4, 9, 15, 293, 373, 2, 130, 277, 2, 130, 431, 348];
115
116%Reshape the vector so each column corresponds to a 32-bit memory init value
117defaultCommands_reshape = reshape(defaultCommands, 2, length(defaultCommands)/2);
118
119%Shift each entry in the second row left 16-bits and sum up the colums
120defaultCommands_32b = sum( defaultCommands_reshape .* repmat([1;2^16],1,size(defaultCommands_reshape,2)));
121
122%Default characters; this buffer has room for 8 distinct screens of 255 characters each (2048 characters total)
123% 0 - display the character map (characters=[0:255])
124% 1 - display all black
125% 2 - display all white
126% 3 - display all blue
127% 4 - display all green
128% 5 - display all red
129% 6 - display all yellow (red+green)
130% 7 - display all purple (red+blue)
131charBuf_0 = [0:255];
132charBuf_1 = repmat(0, 1, 256); %Character 0x0 - defined as black in default charMap
133charBuf_2 = repmat(1, 1, 256); %Character 0x1 - defined as white in default charMap
134charBuf_3 = repmat(2, 1, 256); %Character 0x2 - defined as red in default charMap
135charBuf_4 = repmat(3, 1, 256); %Character 0x3 - defined as green in default charMap
136charBuf_5 = repmat(4, 1, 256); %Character 0x4 - defined as blue in default charMap
137charBuf_6 = repmat(5, 1, 256); %Character 0x5 - defined as yellow in default charMap
138charBuf_7 = repmat(6, 1, 256); %Character 0x6 - defined as purple in default charMap
139charBuf = [charBuf_0 charBuf_1 charBuf_2 charBuf_3 charBuf_4 charBuf_5 charBuf_6 charBuf_7];
140
141%Reshape the vector so each column corresponds to a 32-bit memory init value
142charBuf_reshape = flipud(reshape(charBuf, 4, length(charBuf)/4));
143
144%Shift each entry in rows(2,3,4) by 2^(8,16,24) and sum up the columns
145charBuf_32b = sum( charBuf_reshape .* repmat([1;2^8;2^16;2^24],1,size(charBuf_reshape,2)));
146
147%Define the initial values for the three shared memory blocks
148% Each block is a 32-bit memory
149sharedMem_commands_init = defaultCommands_32b;
150
151%Endian-flip the character buffer, so memcpy's from user code work without reordering bytes in code
152%sharedMem_characters_init =   reshape(flipud(reshape(charBuf_32b, 4, length(charBuf_32b)/4)), 1, length(charBuf_32b));
153%Don't endian flip? who knows...
154sharedMem_characters_init =   charBuf_32b;
155
156%Don't endian-flip the character map for now
157%sharedMem_charactermap_init = reshape(flipud(reshape(charMap_32b, 4, length(charMap_32b)/4)), 1, length(charMap_32b));
158sharedMem_charactermap_init = charMap_32b;
Note: See TracBrowser for help on using the repository browser.