working dos vga writes!
This commit is contained in:
1 parent
5789cafd4e
commit
55ac075e4d
25 files changed
+454
-149
No files matched your search
+5
-5
@@ -23,9 +23,6 @@ typedef int32_t com_fix_t;
|
||||
|
||||
extern const uint16_t com_fix_sin_lut[128];
|
||||
|
||||
void com_fix_run_tests(void);
|
||||
void com_fix_run_bench(void);
|
||||
|
||||
static inline com_fix_t com_fix_add(com_fix_t a, com_fix_t b) { return a + b; }
|
||||
|
||||
static inline com_fix_t com_fix_sub(com_fix_t a, com_fix_t b) { return a - b; }
|
||||
@@ -64,6 +61,7 @@ static inline com_fix_t com_fix_floor(com_fix_t const a) {
|
||||
com_fix_t com_fix_sqrt(com_fix_t a);
|
||||
|
||||
/* Approximated using LUT. */
|
||||
/* Integer part only houses sign. */
|
||||
/* TODO: test whether linearly interpolated version could be default. */
|
||||
/* things like camera movement can be jarring if done without.*/
|
||||
/* https://namoseley.wordpress.com/2015/07/26/sincos-generation-using-table-lookup-and-iterpolation/
|
||||
@@ -90,9 +88,11 @@ static inline com_fix_t com_fix_sin(com_fix_t q) {
|
||||
}
|
||||
}
|
||||
|
||||
static inline com_fix_t com_fix_sin_from_lut(uint8_t l) {
|
||||
return com_fix_sin_lut[l];
|
||||
}
|
||||
|
||||
/* Implemented over sin, as to share one single LUT. */
|
||||
/* Additionally, optimizer probably can collapse some math for combined sincos
|
||||
* case. */
|
||||
static inline com_fix_t com_fix_cos(com_fix_t a) {
|
||||
return com_fix_sin(a + COM_FIX_PIHALF);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user