Skip to content

Commit

Permalink
console: forgot to substract the offset from the console size (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
DacoTaco committed Mar 18, 2023
1 parent d92c4aa commit d259a0d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libogc/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static const unsigned int color_table[] =
0xEB80EB80, // 37 bright white
};

static u32 do_xfb_copy = FALSE;
static bool do_xfb_copy = false;
static struct _console_data_s stdcon;
static struct _console_data_s *curr_con = NULL;
static void *_console_buffer = NULL;
Expand All @@ -82,7 +82,7 @@ void __console_vipostcb(u32 retraceCnt)
u32 *fb,*ptr;
u32 offset;

do_xfb_copy = TRUE;
do_xfb_copy = true;

offset = (curr_con->target_y*curr_con->tgt_stride) + curr_con->target_x*VI_DISPLAY_PIX_SZ;
ptr = curr_con->destbuffer+offset;
Expand All @@ -98,7 +98,7 @@ void __console_vipostcb(u32 retraceCnt)
fb += fb_stride;
}

do_xfb_copy = FALSE;
do_xfb_copy = false;
}


Expand All @@ -113,7 +113,7 @@ static void __console_drawc(int c)
unsigned int fgcolor, bgcolor;
unsigned int nextline;

if(do_xfb_copy==TRUE) return;
if(do_xfb_copy==true) return;
if(!curr_con) return;
con = curr_con;

Expand Down Expand Up @@ -264,8 +264,8 @@ void __console_init(void *framebuffer,int xstart,int ystart,int xres,int yres,in
con->destbuffer = framebuffer;
con->con_xres = xres;
con->con_yres = yres;
con->con_cols = xres / FONT_XSIZE;
con->con_rows = yres / FONT_YSIZE;
con->con_cols = (xres - xstart) / FONT_XSIZE;
con->con_rows = (yres - ystart) / FONT_YSIZE;
con->con_stride = con->tgt_stride = stride;
con->target_x = xstart;
con->target_y = ystart;
Expand Down Expand Up @@ -305,8 +305,8 @@ void __console_init_ex(void *conbuffer,int tgt_xstart,int tgt_ystart,int tgt_str
con->con_yres = con_yres;
con->tgt_stride = tgt_stride;
con->con_stride = con_stride;
con->con_cols = con_xres / FONT_XSIZE;
con->con_rows = con_yres / FONT_YSIZE;
con->con_cols = (con_xres - tgt_xstart) / FONT_XSIZE;
con->con_rows = (con_yres - tgt_ystart) / FONT_YSIZE;
con->cursor_row = 0;
con->cursor_col = 0;
con->saved_row = 0;
Expand Down

0 comments on commit d259a0d

Please sign in to comment.