From 408779bd338625cc4b1eb27f1bb13a8b11d13ae0 Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Mon, 17 Nov 2014 10:57:55 +0000 Subject: [PATCH] Made leds for 320X240 resolution a bit lower --- Makefile.wii | 2 +- src/drawing.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.wii b/Makefile.wii index 85ed64f..368fc7b 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -171,7 +171,7 @@ COMMON_FLAGS := -g -O3 $(MACHDEP) -Wall -W -Wno-unused -Wno-format -Wno-sign-com INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/SDL -I$(PORTLIBS)/include DEFINES := -DOS_WITHOUT_MEMORY_MANAGEMENT -DSAVESTATE -DUSE_SDL -DSUPPORT_THREADS -DCPUEMU_0 -DCPUEMU_5 -DCPUEMU_6 \ -DFPUEMU -DAGA -DAUTOCONFIG -DFILESYS \ - -DTD_START_HEIGHT=20 -DDRIVESOUND -DREGPARAM= + -DTD_START_HEIGHT=16 -DDRIVESOUND -DREGPARAM= CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES) #unused defines: -DCAPS (to enable ipf file) -DFDI2RAW (to enable DFI file) diff --git a/src/drawing.c b/src/drawing.c index e9d0595..5788c00 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -1638,12 +1638,14 @@ static int td_pos = (TD_RIGHT|TD_BOTTOM); # define TD_START_HEIGHT 0 #endif -#define TD_TOTAL_HEIGHT (TD_PADY + TD_NUM_HEIGHT + TD_START_HEIGHT) +#define TD_TOTAL_HEIGHT (TD_PADY*2 + TD_NUM_HEIGHT + TD_START_HEIGHT) #define NUMBERS_NUM 14 #define TD_BORDER 0x333 +int td_total_height_offset = 0; //For GEKKO 320X240 resolution + static const char *numbers = { /* ugly 0123456789CHD% */ "+++++++--++++-+++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++-++++++-++++----++---+" "+xxxxx+--+xx+-+xxxxx++xxxxx++x+-+x++xxxxx++xxxxx++xxxxx++xxxxx++xxxxx++xxxx+-+x++x+-+xxx++-+xx+-+x" @@ -1703,7 +1705,7 @@ static void draw_status_line (int line) else x_start = TD_PADX; - y = line - (gfxvidinfo.height - TD_TOTAL_HEIGHT); + y = line - (gfxvidinfo.height - TD_TOTAL_HEIGHT) - td_total_height_offset; xlinebuffer = gfxvidinfo.linemem; if (xlinebuffer == 0) xlinebuffer = row_map[line]; @@ -1770,7 +1772,7 @@ static void draw_status_line (int line) am = 3; } c = xcolors[on ? on_rgb : off_rgb]; - if (y == 0 || y == TD_TOTAL_HEIGHT - 1) + if (y == 0 || y == TD_TOTAL_HEIGHT - 1 - td_total_height_offset) c = xcolors[TD_BORDER]; x = x_start + pos * TD_WIDTH; @@ -1833,8 +1835,9 @@ void finish_drawing_frame (void) pfield_draw_line (line, where, amiga2aspect_line_map[i1 + 1]); } if (currprefs.leds_on_screen) { - int line = gfxvidinfo.height - TD_TOTAL_HEIGHT; - for (i = TD_TOTAL_HEIGHT; i--; line++) { + if (currprefs.gfx_width_win == 640) td_total_height_offset = 0; else td_total_height_offset = 9; + int line = gfxvidinfo.height - TD_TOTAL_HEIGHT + td_total_height_offset; + for (i = TD_TOTAL_HEIGHT- td_total_height_offset; i--; line++) { draw_status_line (line); do_flush_line (line); }