/*
* QEMU JAZZ LED emulator.
- *
+ *
* Copyright (c) 2007 Hervé Poussineau
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* THE SOFTWARE.
*/
-#include "vl.h"
+#include "hw.h"
+#include "mips.h"
+#include "console.h"
#include "pixel_ops.h"
//#define DEBUG_LED
printf("jazz_led_screen_dump() not implemented\n");
}
+static void jazz_led_text_update(void *opaque, console_ch_t *chardata)
+{
+ LedState *s = opaque;
+ char buf[2];
+
+ dpy_cursor(s->ds, -1, -1);
+ dpy_resize(s->ds, 2, 1);
+
+ /* TODO: draw the segments */
+ snprintf(buf, 2, "%02hhx\n", s->segments);
+ console_write_ch(chardata++, 0x00200100 | buf[0]);
+ console_write_ch(chardata++, 0x00200100 | buf[1]);
+
+ dpy_update(s->ds, 0, 0, 2, 1);
+}
+
void jazz_led_init(DisplayState *ds, target_phys_addr_t base)
{
LedState *s;
io = cpu_register_io_memory(0, led_read, led_write, s);
cpu_register_physical_memory(s->base, 1, io);
- graphic_console_init(ds, jazz_led_update_display, jazz_led_invalidate_display, jazz_led_screen_dump, s);
+ graphic_console_init(ds, jazz_led_update_display,
+ jazz_led_invalidate_display, jazz_led_screen_dump,
+ jazz_led_text_update, s);
}