summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2010-02-13 12:49:05 +0100
committerSegher Boessenkool <segher@kernel.crashing.org>2010-02-13 12:49:05 +0100
commit1826ba315eec152039807af396e824b4c83b66ff (patch)
treeb92a1bc8770ebe7fa60875bc15de6c89bbeb4d1a
parente5b821dca7e60e1e4fe3eff8f52ef22688046285 (diff)
Add (back) some inlines for very frequently used functions
Some compilers aren't smart enough, help them out a bit.
-rw-r--r--emu.c6
-rw-r--r--video.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/emu.c b/emu.c
index 878462a..0581810 100644
--- a/emu.c
+++ b/emu.c
@@ -105,18 +105,18 @@ static u16 load(u32 addr)
return io_load(addr);
}
-static u32 cs_pc(void)
+static inline u32 cs_pc(void)
{
return ((reg[6] & 0x3f) << 16) | reg[7];
}
-static void set_cs_pc(u32 x)
+static inline void set_cs_pc(u32 x)
{
reg[7] = x;
reg[6] = (reg[6] & ~0x3f) | ((x >> 16) & 0x3f);
}
-static void inc_cs_pc(s16 x)
+static inline void inc_cs_pc(s16 x)
{
if (unsp_version < 11)
reg[7] += x;
diff --git a/video.c b/video.c
index ab33a4a..d98e6f0 100644
--- a/video.c
+++ b/video.c
@@ -242,26 +242,26 @@ u16 video_load(u32 addr)
}
-static u8 x58(u32 x)
+static inline u8 x58(u32 x)
{
x &= 31;
return (x << 3) | (x >> 2);
}
-static void set_pixel(u32 offset, u16 rgb)
+static inline void set_pixel(u32 offset, u16 rgb)
{
screen_r[offset] = x58(rgb >> 10);
screen_g[offset] = x58(rgb >> 5);
screen_b[offset] = x58(rgb);
}
-static u8 mix_channel(u8 old, u8 new)
+static inline u8 mix_channel(u8 old, u8 new)
{
u8 alpha = mem[0x282a];
return ((4 - alpha)*old + alpha*new) / 4;
}
-static void mix_pixel(u32 offset, u16 rgb)
+static inline void mix_pixel(u32 offset, u16 rgb)
{
screen_r[offset] = mix_channel(screen_r[offset], x58(rgb >> 10));
screen_g[offset] = mix_channel(screen_g[offset], x58(rgb >> 5));