summaryrefslogtreecommitdiff
path: root/apps/plugins/midi/midiutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/midi/midiutil.c')
-rw-r--r--apps/plugins/midi/midiutil.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/apps/plugins/midi/midiutil.c b/apps/plugins/midi/midiutil.c
index 65ba9c8989..3cb4a9e0fb 100644
--- a/apps/plugins/midi/midiutil.c
+++ b/apps/plugins/midi/midiutil.c
@@ -135,25 +135,32 @@ int eof(int fd)
135// Here is a hacked up printf command to get the output from the game. 135// Here is a hacked up printf command to get the output from the game.
136int printf(const char *fmt, ...) 136int printf(const char *fmt, ...)
137{ 137{
138 static int p_xtpt = 0; 138 static int p_xtpt = 0;
139 char p_buf[50]; 139 char p_buf[50];
140 bool ok; 140 bool ok;
141 va_list ap; 141 va_list ap;
142 142
143 va_start(ap, fmt); 143 va_start(ap, fmt);
144 ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap); 144 ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap);
145 va_end(ap); 145 va_end(ap);
146 146
147 rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); 147 int i=0;
148 rb->lcd_update(); 148
149 149 /* Device LCDs display newlines funny. */
150 p_xtpt+=8; 150 for(i=0; p_buf[i]!=0; i++)
151 if(p_xtpt>LCD_HEIGHT-8) 151 if(p_buf[i] == '\n')
152 { 152 p_buf[i] = ' ';
153 p_xtpt=0; 153
154 rb->lcd_clear_display(); 154 rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf);
155 } 155 rb->lcd_update();
156 return 1; 156
157 p_xtpt+=8;
158 if(p_xtpt>LCD_HEIGHT-8)
159 {
160 p_xtpt=0;
161 rb->lcd_clear_display();
162 }
163 return 1;
157} 164}
158 165
159void exit(int code) 166void exit(int code)