aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_unai/gpu_inner_light_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gpu_unai/gpu_inner_light_arm.h')
-rw-r--r--plugins/gpu_unai/gpu_inner_light_arm.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/gpu_unai/gpu_inner_light_arm.h b/plugins/gpu_unai/gpu_inner_light_arm.h
index ac99cf3..a1c3628 100644
--- a/plugins/gpu_unai/gpu_inner_light_arm.h
+++ b/plugins/gpu_unai/gpu_inner_light_arm.h
@@ -12,9 +12,9 @@
// ^ bit 16
// Where 'r,g,b' are integer bits of colors, 'X' fixed-pt, and '0' zero
////////////////////////////////////////////////////////////////////////////////
-GPU_INLINE u16 gpuLightingRGBARM(u32 gCol)
+GPU_INLINE uint_fast16_t gpuLightingRGBARM(u32 gCol)
{
- u16 out = 0x03E0; // don't need the mask after starting to write output
+ uint_fast16_t out = 0x03E0; // don't need the mask after starting to write output
u32 tmp;
asm ("and %[tmp], %[gCol], %[out]\n\t" // tmp holds 0x000000bbbbb00000
@@ -29,9 +29,9 @@ GPU_INLINE u16 gpuLightingRGBARM(u32 gCol)
}
-GPU_INLINE u16 gpuLightingTXTARM(u16 uSrc, u8 r5, u8 g5, u8 b5)
+GPU_INLINE uint_fast16_t gpuLightingTXTARM(uint_fast16_t uSrc, u8 r5, u8 g5, u8 b5)
{
- u16 out = 0x03E0;
+ uint_fast16_t out = 0x03E0;
u32 db, dg;
asm ("and %[dg], %[out], %[src] \n\t"
"orr %[dg], %[dg], %[g5] \n\t"
@@ -42,7 +42,9 @@ GPU_INLINE u16 gpuLightingTXTARM(u16 uSrc, u8 r5, u8 g5, u8 b5)
"orr %[db], %[db], %[b5] \n\t"
"ldrb %[out], [%[lut], %[out]] \n\t"
"ldrb %[db], [%[lut], %[db]] \n\t"
+ "tst %[src], #0x8000\n\t"
"orr %[out], %[out], %[dg], lsl #0x05 \n\t"
+ "orrne %[out], %[out], #0x8000\n\t"
"orr %[out], %[out], %[db], lsl #0x0A \n\t"
: [out] "=&r" (out), [db] "=&r" (db), [dg] "=&r" (dg)
: [r5] "r" (r5), [g5] "r" (g5), [b5] "r" (b5),
@@ -51,9 +53,9 @@ GPU_INLINE u16 gpuLightingTXTARM(u16 uSrc, u8 r5, u8 g5, u8 b5)
return out;
}
-GPU_INLINE u16 gpuLightingTXTGouraudARM(u16 uSrc, u32 gCol)
+GPU_INLINE uint_fast16_t gpuLightingTXTGouraudARM(uint_fast16_t uSrc, u32 gCol)
{
- u16 out = 0x03E0; // don't need the mask after starting to write output
+ uint_fast16_t out = 0x03E0; // don't need the mask after starting to write output
u32 db,dg,gtmp;
asm ("and %[dg], %[out], %[src] \n\t"
"and %[gtmp],%[out], %[gCol], lsr #0x0B \n\t"
@@ -66,7 +68,9 @@ GPU_INLINE u16 gpuLightingTXTGouraudARM(u16 uSrc, u32 gCol)
"orr %[db], %[db], %[gtmp], lsr #0x05 \n\t"
"ldrb %[out], [%[lut], %[out]] \n\t"
"ldrb %[db], [%[lut], %[db]] \n\t"
+ "tst %[src], #0x8000\n\t"
"orr %[out], %[out], %[dg], lsl #0x05 \n\t"
+ "orrne %[out], %[out], #0x8000\n\t"
"orr %[out], %[out], %[db], lsl #0x0A \n\t"
: [out] "=&r" (out), [db] "=&r" (db), [dg] "=&r" (dg),
[gtmp] "=&r" (gtmp) \