-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassert.c
More file actions
35 lines (30 loc) · 697 Bytes
/
Copy pathassert.c
File metadata and controls
35 lines (30 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <string.h>
#include "env.h"
#include "graphics.h"
#include "halt.h"
#include "text.h"
#include "util.h"
#include "defs.h"
void AssertFail(const char *message, const char *filename, unsigned line, Byte type)
{
Pen pen = {0, 0, {0, 0, 255, 195}};
clear_screen(ink_white | paper_blue, ink_blue);
DrawText(&pen, "BUILD " __DATE__);
pen.x = 0;
++pen.y;
if (type == AssertType_audit) {
DrawText(&pen, "AUDIT ");
}
DrawText(&pen, "ASSERTION ERROR\n\n");
DrawText(&pen, filename);
DrawText(&pen, ":");
PrintDecimal(&pen, line);
pen.x = 0;
pen.y += 2;
DrawText(&pen, message);
// TODO allow "press any key to continue"
// Do not exit
for (;;) {
Halt();
}
}