Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console: forgot to substract the offset from the console size #147

Merged
merged 1 commit into from
Mar 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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