diff --git a/bootloader/gfx/gfx.c b/bootloader/gfx/gfx.c index e1231ab..dcc272b 100644 --- a/bootloader/gfx/gfx.c +++ b/bootloader/gfx/gfx.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2020 CTCaer + * Copyright (c) 2018-2021 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -397,11 +397,13 @@ void gfx_printf(const char *fmt, ...) va_end(ap); } -void gfx_hexdump(u32 base, const u8 *buf, u32 len) +void gfx_hexdump(u32 base, const void *buf, u32 len) { if (!gfx_con_init_done || gfx_con.mute) return; + u8 *buff = (u8 *)buf; + u8 prevFontSize = gfx_con.fntsz; gfx_con.fntsz = 8; for(u32 i = 0; i < len; i++) @@ -413,7 +415,7 @@ void gfx_hexdump(u32 base, const u8 *buf, u32 len) gfx_puts("| "); for(u32 j = 0; j < 0x10; j++) { - u8 c = buf[i - 0x10 + j]; + u8 c = buff[i - 0x10 + j]; if(c >= 32 && c <= 126) gfx_putc(c); else @@ -423,7 +425,7 @@ void gfx_hexdump(u32 base, const u8 *buf, u32 len) } gfx_printf("%08x: ", base + i); } - gfx_printf("%02x ", buf[i]); + gfx_printf("%02x ", buff[i]); if (i == len - 1) { int ln = len % 0x10 != 0; @@ -437,7 +439,7 @@ void gfx_hexdump(u32 base, const u8 *buf, u32 len) gfx_puts("| "); for(u32 j = 0; j < (ln ? k : k + 1); j++) { - u8 c = buf[i - k + j]; + u8 c = buff[i - k + j]; if(c >= 32 && c <= 126) gfx_putc(c); else diff --git a/bootloader/gfx/gfx.h b/bootloader/gfx/gfx.h index ddcfd74..fe1b979 100644 --- a/bootloader/gfx/gfx.h +++ b/bootloader/gfx/gfx.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2020 CTCaer + * Copyright (c) 2018-2021 CTCaer * Copyright (c) 2018 M4xw * * This program is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ void gfx_con_setpos(u32 x, u32 y); void gfx_putc(char c); void gfx_puts(char *s); void gfx_printf(const char *fmt, ...); -void gfx_hexdump(u32 base, const u8 *buf, u32 len); +void gfx_hexdump(u32 base, const void *buf, u32 len); void gfx_set_pixel(u32 x, u32 y, u32 color); void gfx_line(int x0, int y0, int x1, int y1, u32 color); diff --git a/nyx/nyx_gui/gfx/gfx.c b/nyx/nyx_gui/gfx/gfx.c index 47a0a32..3c225f2 100644 --- a/nyx/nyx_gui/gfx/gfx.c +++ b/nyx/nyx_gui/gfx/gfx.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2020 CTCaer + * Copyright (c) 2018-2021 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -379,11 +379,13 @@ void gfx_printf(const char *fmt, ...) va_end(ap); } -void gfx_hexdump(u32 base, const u8 *buf, u32 len) +void gfx_hexdump(u32 base, const void *buf, u32 len) { if (gfx_con.mute) return; + u8 *buff = (u8 *)buf; + u8 prevFontSize = gfx_con.fntsz; gfx_con.fntsz = 8; for(u32 i = 0; i < len; i++) @@ -395,7 +397,7 @@ void gfx_hexdump(u32 base, const u8 *buf, u32 len) gfx_puts("| "); for(u32 j = 0; j < 0x10; j++) { - u8 c = buf[i - 0x10 + j]; + u8 c = buff[i - 0x10 + j]; if(c >= 32 && c <= 126) gfx_putc(c); else @@ -405,7 +407,7 @@ void gfx_hexdump(u32 base, const u8 *buf, u32 len) } gfx_printf("%08x: ", base + i); } - gfx_printf("%02x ", buf[i]); + gfx_printf("%02x ", buff[i]); if (i == len - 1) { int ln = len % 0x10 != 0; @@ -419,7 +421,7 @@ void gfx_hexdump(u32 base, const u8 *buf, u32 len) gfx_puts("| "); for(u32 j = 0; j < (ln ? k : k + 1); j++) { - u8 c = buf[i - k + j]; + u8 c = buff[i - k + j]; if(c >= 32 && c <= 126) gfx_putc(c); else diff --git a/nyx/nyx_gui/gfx/gfx.h b/nyx/nyx_gui/gfx/gfx.h index e5abe81..ce289d4 100644 --- a/nyx/nyx_gui/gfx/gfx.h +++ b/nyx/nyx_gui/gfx/gfx.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2020 CTCaer + * Copyright (c) 2018-2021 CTCaer * Copyright (c) 2018 M4xw * * This program is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ void gfx_con_setpos(u32 x, u32 y); void gfx_putc(char c); void gfx_puts(char *s); void gfx_printf(const char *fmt, ...); -void gfx_hexdump(u32 base, const u8 *buf, u32 len); +void gfx_hexdump(u32 base, const void *buf, u32 len); void gfx_set_pixel(u32 x, u32 y, u32 color);