/* brightness level : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 */
//static const uint8_t brightness_tbl[] = {20, 100, 120, 140, 160, 180, 200, 220, 230, 240};
-static const uint8_t brightness_tbl[] = {0, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120,
+static const uint8_t brightness_tbl[] = {20, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120,
130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240};
extern uint32_t brightness_level;
+extern uint32_t brightness_off;
#endif
static void vga_draw_graphic(VGACommonState *s, int full_update)
}
}
- if (brightness_level < 24) {
- dst_sub = s->ds->surface->data + addr;
- dst = (uint32_t*)(s->ds->surface->data + addr);
+ if( brightness_off ) {
+ alpha = 0x00;
+ }else if (brightness_level < 24) {
+ alpha = brightness_tbl[brightness_level];
+ }
- alpha = brightness_tbl[brightness_level];
+ if ( brightness_off || brightness_level < 24 ) {
+ dst_sub = s->ds->surface->data + addr;
+ dst = (uint32_t*)(s->ds->surface->data + addr);
- for (i=0; i < disp_width; i++, dst_sub += 4, dst++) {
- *dst = ((alpha * dst_sub[0]) >> 8) |
- ((alpha * dst_sub[1]) & 0xFF00) |
- (((alpha * dst_sub[2]) & 0xFF00) << 8);
- }
+ for (i=0; i < disp_width; i++, dst_sub += 4, dst++) {
+ *dst = ((alpha * dst_sub[0]) >> 8) |
+ ((alpha * dst_sub[1]) & 0xFF00) |
+ (((alpha * dst_sub[2]) & 0xFF00) << 8);
+ }
}
#endif /* TARGET_I386 */
enum {
BRIGHTNESS_LEVEL = 0x00,
+ BRIGHTNESS_OFF = 0x04,
};
//uint8_t* brightness_ptr; // pointer in qemu space
uint32_t brightness_level = 24;
+uint32_t brightness_off = 0;
//#define DEBUG_BRIGHTNESS
fprintf(stderr, "brightness_reg_write: Invalide brightness level.\n");
}
- switch (addr & 0xFF) {
- case BRIGHTNESS_LEVEL:
- brightness_level = val;
- return;
- default:
- fprintf(stderr, "wrong brightness register write - addr : %d\n", addr);
- }
+ switch (addr & 0xFF) {
+ case BRIGHTNESS_LEVEL:
+ brightness_level = val;
+ return;
+ case BRIGHTNESS_OFF:
+ DEBUG_PRINT(("Brightness off : %d\n", val));
+ brightness_off = val;
+ return;
+ default:
+ fprintf(stderr, "wrong brightness register write - addr : %d\n", addr);
+ }
}
static CPUReadMemoryFunc * const brightness_reg_readfn[3] = {