summaryrefslogtreecommitdiff
path: root/firmware/bidi.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/bidi.c')
-rw-r--r--firmware/bidi.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/bidi.c b/firmware/bidi.c
index a7a3211c39..e6a4341f79 100644
--- a/firmware/bidi.c
+++ b/firmware/bidi.c
@@ -43,6 +43,7 @@
43#define _isnewline(c) ((c=='\n' || c=='\r') ? 1 : 0) 43#define _isnewline(c) ((c=='\n' || c=='\r') ? 1 : 0)
44#define XOR(a,b) ((a||b) && !(a&&b)) 44#define XOR(a,b) ((a||b) && !(a&&b))
45 45
46#ifndef BOOTLOADER
46static const arab_t * arab_lookup(unsigned short uchar) 47static const arab_t * arab_lookup(unsigned short uchar)
47{ 48{
48 if (uchar >= 0x621 && uchar <= 0x63a) 49 if (uchar >= 0x621 && uchar <= 0x63a)
@@ -132,14 +133,18 @@ static void arabjoin(unsigned short * stringprt, int length)
132 } 133 }
133 } 134 }
134} 135}
136#endif /* !BOOTLOADER */
135 137
136unsigned short *bidi_l2v(const unsigned char *str, int orientation) 138unsigned short *bidi_l2v(const unsigned char *str, int orientation)
137{ 139{
138 int length = utf8length(str);
139 static unsigned short utf16_buf[SCROLL_LINE_SIZE]; 140 static unsigned short utf16_buf[SCROLL_LINE_SIZE];
141 unsigned short *target, *tmp;
142#ifndef BOOTLOADER
140 static unsigned short bidi_buf[SCROLL_LINE_SIZE]; 143 static unsigned short bidi_buf[SCROLL_LINE_SIZE];
141 unsigned short *heb_str, *target, *tmp; /* *broken_str */ 144 unsigned short *heb_str; /* *broken_str */
142 int block_start, block_end, block_type, block_length, i; 145 int block_start, block_end, block_type, block_length, i;
146 int length = utf8length(str);
147#endif
143 /* 148 /*
144 long max_chars=0; 149 long max_chars=0;
145 int begin, end, char_count, orig_begin; 150 int begin, end, char_count, orig_begin;
@@ -151,6 +156,11 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation)
151 str = utf8decode(str, target++); 156 str = utf8decode(str, target++);
152 *target = 0; 157 *target = 0;
153 158
159#ifdef BOOTLOADER
160 (void)orientation;
161 return utf16_buf;
162
163#else /* !BOOTLOADER */
154 if (target == utf16_buf) /* empty string */ 164 if (target == utf16_buf) /* empty string */
155 return target; 165 return target;
156 166
@@ -282,5 +292,6 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation)
282 return broken_str; 292 return broken_str;
283#endif 293#endif
284 return heb_str; 294 return heb_str;
295#endif /* !BOOTLOADER */
285} 296}
286 297