From f43490a86eb7cf9a2a050d584fc9e201bcc89b5f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 Jun 2002 12:47:03 +0000 Subject: 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 --- firmware/drivers/lcd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) */ void lcd_puts(int x, int y, char *str) { +#ifdef SIMULATOR + /* We make the simulator truncate the string if it reaches the right edge, + as otherwise it'll wrap. The real target doesn't wrap. */ + + char buffer[12]; + if((x < 11) && (strlen(str) > (11-x)) ) { + memcpy(str, buffer, 11-x); + buffer[11-x]=0; + str = buffer; + } +#endif + lcd_putsxy( xmargin + x*fonts[font], ymargin + y*fontheight[font], str, font ); -- cgit v1.2.3