diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-06-06 12:47:03 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-06-06 12:47:03 +0000 |
commit | f43490a86eb7cf9a2a050d584fc9e201bcc89b5f (patch) | |
tree | f515a5845437a2a7a787df572b988f9bc764f386 | |
parent | c7e367545787db484154362cc1cd72f1219078d2 (diff) | |
download | rockbox-f43490a86eb7cf9a2a050d584fc9e201bcc89b5f.tar.gz rockbox-f43490a86eb7cf9a2a050d584fc9e201bcc89b5f.zip |
when doing lcd_puts() on a simulated player, we now truncate the string at
the right edge instead of wrapping down to the next line, as the target
will not behave that way!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@899 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/lcd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index fa71617fbf..c394bfab0d 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c | |||
@@ -471,6 +471,18 @@ void lcd_setmargins(int x, int y) | |||
471 | */ | 471 | */ |
472 | void lcd_puts(int x, int y, char *str) | 472 | void lcd_puts(int x, int y, char *str) |
473 | { | 473 | { |
474 | #ifdef SIMULATOR | ||
475 | /* We make the simulator truncate the string if it reaches the right edge, | ||
476 | as otherwise it'll wrap. The real target doesn't wrap. */ | ||
477 | |||
478 | char buffer[12]; | ||
479 | if((x < 11) && (strlen(str) > (11-x)) ) { | ||
480 | memcpy(str, buffer, 11-x); | ||
481 | buffer[11-x]=0; | ||
482 | str = buffer; | ||
483 | } | ||
484 | #endif | ||
485 | |||
474 | lcd_putsxy( xmargin + x*fonts[font], | 486 | lcd_putsxy( xmargin + x*fonts[font], |
475 | ymargin + y*fontheight[font], | 487 | ymargin + y*fontheight[font], |
476 | str, font ); | 488 | str, font ); |