From bee8004b7490dfd2205dc8063fb730049d23ebaa Mon Sep 17 00:00:00 2001 From: Kostas Missos Date: Sat, 23 Jun 2018 07:07:53 +0300 Subject: [PATCH] [GFX] Add position saving and muting --- ipl/gfx.c | 11 ++++++++++- ipl/gfx.h | 3 +++ ipl/hos.c | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ipl/gfx.c b/ipl/gfx.c index ec08942..a9a4661 100755 --- a/ipl/gfx.c +++ b/ipl/gfx.c @@ -141,9 +141,12 @@ void gfx_con_init(gfx_con_t *con, gfx_ctxt_t *ctxt) con->gfx_ctxt = ctxt; con->x = 0; con->y = 0; + con->savedx = 0; + con->savedy = 0; con->fgcol = 0xFFCCCCCC; con->fillbg = 0; con->bgcol = 0xFF1B1B1B; + con->mute = 0; } void gfx_con_setcol(gfx_con_t *con, u32 fgcol, int fillbg, u32 bgcol) @@ -198,7 +201,7 @@ void gfx_putc(gfx_con_t *con, char c) void gfx_puts(gfx_con_t *con, const char *s) { - if (!s) + if (!s || con->mute) return; for (; *s; s++) @@ -238,6 +241,9 @@ static void _gfx_putn(gfx_con_t *con, u32 v, int base, char fill, int fcnt) void gfx_printf(gfx_con_t *con, const char *fmt, ...) { + if (con->mute) + return; + va_list ap; int fill, fcnt; @@ -309,6 +315,9 @@ void gfx_printf(gfx_con_t *con, const char *fmt, ...) void gfx_hexdump(gfx_con_t *con, u32 base, const u8 *buf, u32 len) { + if (con->mute) + return; + for(u32 i = 0; i < len; i++) { if(i % 0x10 == 0) diff --git a/ipl/gfx.h b/ipl/gfx.h index 9e5b4a3..c54dfea 100755 --- a/ipl/gfx.h +++ b/ipl/gfx.h @@ -33,9 +33,12 @@ typedef struct _gfx_con_t gfx_ctxt_t *gfx_ctxt; u32 x; u32 y; + u32 savedx; + u32 savedy; u32 fgcol; int fillbg; u32 bgcol; + int mute; } gfx_con_t; void gfx_init_ctxt(gfx_ctxt_t *ctxt, u32 *fb, u32 width, u32 height, u32 stride); diff --git a/ipl/hos.c b/ipl/hos.c index 061fd1c..6ba3bbe 100755 --- a/ipl/hos.c +++ b/ipl/hos.c @@ -384,7 +384,8 @@ int hos_launch(ini_sec_t *cfg) memset(&ctxt, 0, sizeof(launch_ctxt_t)); list_init(&ctxt.kip1_list); - gfx_clear_grey(&gfx_ctxt, 0x1B); + if (!gfx_con.mute) + gfx_clear_grey(&gfx_ctxt, 0x1B); gfx_con_setpos(&gfx_con, 0, 0); //Try to parse config if present.