working dos vga writes!
This commit is contained in:
1 parent
5789cafd4e
commit
55ac075e4d
25 files changed
+454
-149
No files matched your search
+18
-14
@@ -6,6 +6,8 @@
|
||||
#ifndef COM_STD_H
|
||||
#define COM_STD_H
|
||||
|
||||
#include "def.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -40,20 +42,6 @@ void com_std_close(com_std_fd fd);
|
||||
/* Note: Freeing is done by passing 0 size to pointer. */
|
||||
void *com_std_alloc(void *ptr, size_t size);
|
||||
|
||||
/* Note: Functions listed below are only available for dev builds. */
|
||||
/* Trigonometry functions are for reference testing of our own fixed point
|
||||
* implementations. Do not use otherwise. */
|
||||
#define com_std_assert(p_h) \
|
||||
do { \
|
||||
if (!(p_h)) { \
|
||||
const char msg[] = \
|
||||
"Assertion failed at "__FILE__ \
|
||||
":" COM_DEF_STRLIT(__LINE__) ": " COM_DEF_STRLIT(p_h); \
|
||||
com_std_print_str(msg, sizeof msg, true); \
|
||||
com_std_exit(-1); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
Basic printing utility that doesn't utilize format string.
|
||||
Instead a vector of arguments is passed and concatenated, based on type.
|
||||
@@ -81,9 +69,25 @@ void com_std_print_(int32_t start, ...);
|
||||
#define com_std_print(...) com_std_print_(__VA_ARGS__, '.')
|
||||
void com_std_print_str(char const *str, uint32_t len, bool newline);
|
||||
|
||||
#define COM_STD_PIF ((float)3.14159265358979323846)
|
||||
|
||||
double com_std_sqrt(double v);
|
||||
double com_std_fabs(double v);
|
||||
double com_std_sin(double v);
|
||||
double com_std_cos(double v);
|
||||
|
||||
/* Note: Functions listed below are only available for dev builds. */
|
||||
/* Trigonometry functions are for reference testing of our own fixed point
|
||||
* implementations. Do not use otherwise. */
|
||||
#define com_std_assert(p_h) \
|
||||
do { \
|
||||
if (!(p_h)) { \
|
||||
const char msg[] = \
|
||||
"Assertion failed at "__FILE__ \
|
||||
":" COM_DEF_STRLIT(__LINE__) ": " COM_DEF_STRLIT(p_h); \
|
||||
com_std_print_str(msg, sizeof msg, true); \
|
||||
com_std_exit(-1); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user