summaryrefslogtreecommitdiff
path: root/uisimulator/uibasic.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/uibasic.c')
-rw-r--r--uisimulator/uibasic.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/uisimulator/uibasic.c b/uisimulator/uibasic.c
index 4ea453c82e..74b09f7e9a 100644
--- a/uisimulator/uibasic.c
+++ b/uisimulator/uibasic.c
@@ -41,7 +41,7 @@
41 41
42/* -- -- */ 42/* -- -- */
43 43
44static GC draw_gc, erase_gc; 44GC draw_gc, erase_gc;
45static Colormap cmap; 45static Colormap cmap;
46static XColor color_track, color_car; 46static XColor color_track, color_car;
47 47
@@ -163,6 +163,27 @@ void drawline(int color, int x1, int y1, int x2, int y2)
163 (int)(y2*track_zoom)); 163 (int)(y2*track_zoom));
164} 164}
165 165
166void drawdot(int color, int x, int y)
167{
168 if (color==0) {
169 XSetForeground(dpy, draw_gc,
170 get_pixel_resource("background", "Background", dpy, cmap));
171 }
172 else
173 XSetForeground(dpy, draw_gc,
174 get_pixel_resource("foreground", "Foreground", dpy, cmap));
175
176 XDrawPoint(dpy, window, draw_gc, x, y);
177}
178
179void drawdots(XPoint *points, int count)
180{
181 XSetForeground(dpy, draw_gc,
182 get_pixel_resource("foreground", "Foreground", dpy, cmap));
183
184 XDrawPoints(dpy, window, draw_gc, points, count, CoordModeOrigin);
185}
186
166void drawtext(int color, int x, int y, char *text) 187void drawtext(int color, int x, int y, char *text)
167{ 188{
168 if (color==0) { 189 if (color==0) {
@@ -199,11 +220,10 @@ screenhack (Display *the_dpy, Window the_window)
199 220
200 init_window(); 221 init_window();
201 222
202 drawtext(1, 20, 20, PROGNAME);
203 drawline(1, 0, 0, 40, 50);
204
205 Logf("Rockbox will kill ya!"); 223 Logf("Rockbox will kill ya!");
206 224
225 lcd_string( PROGNAME, 0);
226
207 while (1) { 227 while (1) {
208 /* deal with input here */ 228 /* deal with input here */
209 229
@@ -214,7 +234,18 @@ screenhack (Display *the_dpy, Window the_window)
214 234
215void screen_redraw() 235void screen_redraw()
216{ 236{
217 /* does nothing yet */ 237 int y, x;
218 drawtext(1, 20, 20, PROGNAME); 238
219 drawline(1, 0, 0, 40, 50); 239 lcd_update();
240
241#if 0
242 /* does nothing "real" yet */
243 /* drawtext(1, 20, 20, PROGNAME);*/
244
245 for(y=0; y< 112; y++)
246 for(x=0; x<64; x++)
247 drawdot(1, x+16, y+16);
248 /* drawline(1, 0, 0, 40, 50); */
249#endif
220} 250}
251