You've already forked hackerlibultra
mirror of
https://github.com/HackerN64/hackerlibultra.git
synced 2026-01-21 10:37:53 -08:00
Adjust viint.h macros to accept negative values (#47)
* Adjust viint.h macros to accept negative values * review * update macro
This commit is contained in:
@@ -24,17 +24,17 @@
|
||||
#define VI_SUBPIXEL_SH 0x10
|
||||
|
||||
#define BURST(hsync_width, color_width, vsync_width, color_start) \
|
||||
(hsync_width | (color_width << 8) | (vsync_width << 16) | (color_start << 20))
|
||||
#define WIDTH(v) v
|
||||
#define VSYNC(v) v
|
||||
#define HSYNC(duration, leap) (duration | (leap << 16))
|
||||
#define LEAP(upper, lower) ((upper << 16) | lower)
|
||||
#define START(start, end) ((start << 16) | end)
|
||||
(((u32)(hsync_width) & 0xFF) | (((u32)(color_width) & 0xFF) << 8) | (((u32)(vsync_width) & 0xF) << 16) | (((u32)(color_start) & 0xFFFF) << 20))
|
||||
#define WIDTH(v) (v)
|
||||
#define VSYNC(v) (v)
|
||||
#define HSYNC(duration, leap) (((u32)(leap) << 16) | ((u32)(duration) & 0xFFFF))
|
||||
#define LEAP(upper, lower) (((u32)(upper) << 16) | ((u32)(lower) & 0xFFFF))
|
||||
#define START(start, end) (((u32)(start) << 16) | ((u32)(end) & 0xFFFF))
|
||||
|
||||
#define FTOFIX(val, i, f) ((u32)(val * (f32)(1 << f)) & ((1 << (i + f)) - 1))
|
||||
#define FTOFIX(val, i, f) ((u32)((val) * (f32)(1 << (f))) & ((1 << ((i) + (f))) - 1))
|
||||
|
||||
#define F210(val) FTOFIX(val, 2, 10)
|
||||
#define SCALE(scaleup, off) (F210((1.0f / (f32)scaleup)) | (F210((f32)off) << 16))
|
||||
#define SCALE(scaleup, off) (F210((1.0f / (f32)(scaleup))) | (F210((f32)(off)) << 16))
|
||||
|
||||
#define VCURRENT(v) v //seemingly unused
|
||||
#define ORIGIN(v) v
|
||||
|
||||
Reference in New Issue
Block a user