Skip to content

Commit 3ff7350

Browse files
committed
exceptions: setup the console & framebuffer correctly
1 parent 1c08166 commit 3ff7350

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

libogc/exception.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ distribution.
4343
#include "gx.h"
4444
#include "pad.h"
4545
#include "consol.h"
46+
#include "color.h"
4647
#include "console_internal.h"
4748
#include "lwp_threads.h"
4849
#include "ios.h"
50+
#include "video.h"
4951

5052
#include "ogc/video_types.h"
5153

@@ -69,6 +71,7 @@ extern void irq_exceptionhandler(frame_context*);
6971
extern void dec_exceptionhandler(frame_context*);
7072
extern void default_exceptionhandler(frame_context*);
7173
extern void VIDEO_SetFramebuffer(void *);
74+
extern void __VIClearFramebuffer(void*, u32, u32);
7275
extern void __reload(void);
7376

7477
extern s8 exceptionhandler_start[],exceptionhandler_end[],exceptionhandler_patch[];
@@ -237,9 +240,13 @@ static void waitForReload(void)
237240
//just implement core for unrecoverable exceptions.
238241
void c_default_exceptionhandler(frame_context *pCtx)
239242
{
243+
const u16 console_height = 680;
244+
const u16 console_width = 574;
245+
240246
GX_AbortFrame();
241247
VIDEO_SetFramebuffer(exception_xfb);
242-
__console_init(exception_xfb,20,20,640,574,1280);
248+
__VIClearFramebuffer(exception_xfb, console_height * console_width * VI_DISPLAY_PIX_SZ, COLOR_BLACK);
249+
__console_init(exception_xfb, 20, 20, console_height-40, console_width-40, 1280);
243250
CON_EnableGecko(1, true);
244251

245252
kprintf("\n\n\n\tException (%s) occurred!\n", exception_name[pCtx->EXCPT_Number]);

0 commit comments

Comments
 (0)