diff --git a/src/defs.h b/src/defs.h index 5e3e2a1a..f320d4f1 100644 --- a/src/defs.h +++ b/src/defs.h @@ -42,6 +42,7 @@ #define BIT_CAL_COUNT 0x800 #define BIT_DEINT_MODE_0 0x100000 #define BIT_DEINT_MODE_1 0x200000 +#define BIT_DEBUG 0x400000 // Note, due to a hack, bits 16, 19 and 26 are unavailale // as the are used for switch change detection diff --git a/src/osd.c b/src/osd.c index 73b5d096..dc0a6706 100644 --- a/src/osd.c +++ b/src/osd.c @@ -158,7 +158,6 @@ static param_t features[] = { static int info = INFO_VERSION; static int palette = PALETTE_DEFAULT; static int mux = 0; -static int debug = 0; uint32_t *osd_get_palette() { int m; @@ -219,8 +218,8 @@ uint32_t *osd_get_palette() { } else { palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r; } - if (debug) { - palette_data[i] |= 0x00202020; + if (get_debug()) { + palette_data[i] |= 0x00101010; } } return palette_data; @@ -298,7 +297,7 @@ static int get_feature(int num) { return get_nbuffers(); #endif case F_DEBUG: - return debug; + return get_debug(); } return -1; } @@ -337,7 +336,7 @@ static void set_feature(int num, int value) { break; #endif case F_DEBUG: - debug = value; + set_debug(value); update_palette(); break; } diff --git a/src/osd.h b/src/osd.h index f5bed7ed..53e92fcd 100644 --- a/src/osd.h +++ b/src/osd.h @@ -28,6 +28,8 @@ void set_deinterlace(int value); int get_deinterlace(); void set_elk(int on); int get_elk(); +void set_debug(int on); +int get_debug(); void set_vsync(int on); int get_vsync(); void set_pllh(int val); diff --git a/src/rgb_to_fb.S b/src/rgb_to_fb.S index 7000a496..6e6fdcd9 100644 --- a/src/rgb_to_fb.S +++ b/src/rgb_to_fb.S @@ -287,6 +287,10 @@ process_chars_loop_7\@: and r9, r8, #(7 << (PIXEL_BASE + 9)) orr r10, r10, r9, lsl #(15 - PIXEL_BASE) + tst r3, #BIT_DEBUG + orrne r10, r10, #0x01000000 + orrne r10, r10, #0x00000010 + tst r3, #(BIT_OSD | BIT_CALIBRATE) moveq r9,#0 ldrne r9, [r12] // preload old pixel value from video buffer diff --git a/src/rgb_to_hdmi.c b/src/rgb_to_hdmi.c index 96b4ff7b..df750168 100644 --- a/src/rgb_to_hdmi.c +++ b/src/rgb_to_hdmi.c @@ -57,6 +57,7 @@ static int nbuffers; #endif static double pllh_clock = 0; static int elk; +static int debug; static int mode7; static int clear; static int scanlines = 0; @@ -723,6 +724,14 @@ int get_elk() { return elk; } +void set_debug(int on) { + debug = on; +} + +int get_debug() { + return debug; +} + void set_vsync(int on) { vsync = on; } @@ -863,6 +872,9 @@ void rgb_to_hdmi_main() { if (elk & !mode7) { flags |= BIT_ELK; } + if (debug) { + flags |= BIT_DEBUG; + } if (scanlines) { flags |= BIT_SCANLINES; }