summaryrefslogtreecommitdiff
path: root/emulators/gcube
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2013-03-02 18:13:14 +0000
committerjoerg <joerg@pkgsrc.org>2013-03-02 18:13:14 +0000
commit50a74e48c373d69e3c153dd28d768cf182280266 (patch)
treed44d09747d96017c3cb6e25e0909c74e695c7d5c /emulators/gcube
parent90f63543006b7bb06e3281f6cdc821792de90e7b (diff)
downloadpkgsrc-50a74e48c373d69e3c153dd28d768cf182280266.tar.gz
Fix inline use. Avoid variable length types.
Diffstat (limited to 'emulators/gcube')
-rw-r--r--emulators/gcube/distinfo9
-rw-r--r--emulators/gcube/patches/patch-ae51
-rw-r--r--emulators/gcube/patches/patch-ag127
-rw-r--r--emulators/gcube/patches/patch-general.c13
-rw-r--r--emulators/gcube/patches/patch-general.h13
-rw-r--r--emulators/gcube/patches/patch-gx__transform.h32
6 files changed, 234 insertions, 11 deletions
diff --git a/emulators/gcube/distinfo b/emulators/gcube/distinfo
index 672d3ebb305..b354b6478bd 100644
--- a/emulators/gcube/distinfo
+++ b/emulators/gcube/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2011/11/29 06:17:57 sbd Exp $
+$NetBSD: distinfo,v 1.6 2013/03/02 18:13:14 joerg Exp $
SHA1 (gcube-0.4-src.tar.bz2) = dae967f8aedfc2115c3720dfe2c523128fddc8b6
RMD160 (gcube-0.4-src.tar.bz2) = 9a7c13ed611da22705f960686eea225e30b61dc6
@@ -7,6 +7,9 @@ SHA1 (patch-aa) = 6568ce5f29e26c80f8537f20a5babaa212a9a3f8
SHA1 (patch-ab) = 8907f650214bec5cdbf032464a1be39cccea5d81
SHA1 (patch-ac) = 24e52c1b863d858863317de1c34fe9a917f83599
SHA1 (patch-ad) = 2d21a509b768d6aa269cb30e1adf01279d98bc41
-SHA1 (patch-ae) = ca03b45a7e2e05371b3a495c55af8268d17f80c3
+SHA1 (patch-ae) = 2f0d6ff8e3e7937c48990822b692cc2532789c34
SHA1 (patch-af) = 295f3c06b5942d19b8e9ad41c220fac42c3fb7f5
-SHA1 (patch-ag) = c84e395b61a849ca3cb6318a2c15aa8b5346a0bc
+SHA1 (patch-ag) = 886676b737029566b4e314465750fcd0db4c176c
+SHA1 (patch-general.c) = 05bf7b82fa224f68fc63ba63116746442218e9d7
+SHA1 (patch-general.h) = 0d6a737c5967179faeb94105592285dc7bf9638a
+SHA1 (patch-gx__transform.h) = 8b0e3b4f202f0a998cdd712eecad4c664d1b0dda
diff --git a/emulators/gcube/patches/patch-ae b/emulators/gcube/patches/patch-ae
index 119c87be6b3..5203d4e8a82 100644
--- a/emulators/gcube/patches/patch-ae
+++ b/emulators/gcube/patches/patch-ae
@@ -1,9 +1,18 @@
-$NetBSD: patch-ae,v 1.1 2006/06/26 10:56:57 rillig Exp $
+$NetBSD: patch-ae,v 1.2 2013/03/02 18:13:14 joerg Exp $
Thou shalt not use reserved identifiers.
---- gx_transform.c.orig 2005-01-12 02:23:37.000000000 +0100
-+++ gx_transform.c 2006-06-26 12:46:19.000000000 +0200
+--- gx_transform.c.orig 2005-01-12 01:23:37.000000000 +0000
++++ gx_transform.c
+@@ -34,7 +34,7 @@ float vdq, ndq, tdq[8];
+
+
+
+-inline __u32 color_unpack_rgb565 (__u32 X)
++__u32 color_unpack_rgb565 (__u32 X)
+ {
+ #ifdef LIL_ENDIAN
+ return (((X & 0xf800) >> 8) | ((X & 0xe000) >> 13) |
@@ -52,15 +52,15 @@ inline __u32 color_unpack_rgb565 (__u32
inline __u32 color_unpack_rgba4 (__u32 X)
@@ -24,3 +33,39 @@ Thou shalt not use reserved identifiers.
}
+@@ -111,7 +111,7 @@ inline __u32 color_unpack_rgb4a3 (__u32
+ }
+
+
+-inline __u32 color_unpack_rgb5a3 (__u32 X)
++__u32 color_unpack_rgb5a3 (__u32 X)
+ {
+ if (X & 0x8000)
+ return (color_unpack_rgb555 (X) | MASK_ALPHA);
+@@ -128,7 +128,7 @@ inline __u32 color_unpack_i4 (__u32 X)
+ }
+
+
+-inline __u32 color_unpack_i8 (__u32 X)
++__u32 color_unpack_i8 (__u32 X)
+ {
+ X |= X << 8;
+ return (X | (X << 16));
+@@ -151,7 +151,7 @@ inline __u32 color_unpack_ia4 (__u32 X)
+ }
+
+
+-inline __u32 color_unpack_ia8 (__u32 X)
++__u32 color_unpack_ia8 (__u32 X)
+ {
+ __u32 a = X & 0xff00;
+
+@@ -5663,7 +5663,7 @@ inline GXLight *xf_get_light (int i)
+ }
+
+
+-inline void calc_color (float outcolor[4], float incolor[4], int chn, float pos[3], float normal[3])
++static inline void calc_color (float outcolor[4], float incolor[4], int chn, float pos[3], float normal[3])
+ {
+ float lightsum[4], lcolor[4], tcolor[4];
+ __u32 lmask;
diff --git a/emulators/gcube/patches/patch-ag b/emulators/gcube/patches/patch-ag
index 6073e6dada0..45868d26516 100644
--- a/emulators/gcube/patches/patch-ag
+++ b/emulators/gcube/patches/patch-ag
@@ -1,9 +1,9 @@
-$NetBSD: patch-ag,v 1.1 2006/06/26 10:56:57 rillig Exp $
+$NetBSD: patch-ag,v 1.2 2013/03/02 18:13:14 joerg Exp $
Thou shalt not use reserved identifiers.
---- tplx.c.orig 2004-12-27 16:57:42.000000000 +0100
-+++ tplx.c 2006-06-26 12:50:49.000000000 +0200
+--- tplx.c.orig 2004-12-27 15:57:42.000000000 +0000
++++ tplx.c
@@ -37,13 +37,13 @@
# define BSWAP_16(B)\
@@ -22,9 +22,41 @@ Thou shalt not use reserved identifiers.
})
#ifdef LIL_ENDIAN
-@@ -135,15 +135,15 @@ inline __u32 color_unpack_rgb565 (__u32
+@@ -103,21 +103,17 @@ typedef struct
+ __u32 offset;
+ } TPLPaletteHeader;
- inline __u32 color_unpack_rgba4 (__u32 X)
+-
+-#define TPLHeader(n) \
+- struct\
+- {\
+- __u32 magic;\
+- __u32 ntextures;\
+- __u32 texture_size;\
+- TPLTexture textures[n];\
+- }\
+-
++struct tplheader {
++ __u32 magic;
++ __u32 ntextures;
++ __u32 texture_size;
++ TPLTexture textures[];
++};
+
+ __u8 texbuff[1024*1024*4];
+
+
+-inline __u32 color_unpack_rgb565 (__u32 X)
++__u32 color_unpack_rgb565 (__u32 X)
+ {
+ #ifdef LIL_ENDIAN
+ return (((X & 0xf800) >> 8) | ((X & 0xe000) >> 13) |
+@@ -133,21 +129,21 @@ inline __u32 color_unpack_rgb565 (__u32
+ }
+
+
+-inline __u32 color_unpack_rgba4 (__u32 X)
++__u32 color_unpack_rgba4 (__u32 X)
{
- __u32 _X = X;
+ __u32 m_X = X;
@@ -42,3 +74,88 @@ Thou shalt not use reserved identifiers.
}
+-inline __u32 color_unpack_rgba6 (__u32 X)
++__u32 color_unpack_rgba6 (__u32 X)
+ {
+ #ifdef LIL_ENDIAN
+ return ((X & 0xfc0000) >> 16) | ((X & 0xc00000) >> 22) |
+@@ -163,7 +159,7 @@ inline __u32 color_unpack_rgba6 (__u32 X
+ }
+
+ // RGB5 1rrr rrgg gggb bbbb
+-inline __u32 color_unpack_rgb555 (__u32 X)
++__u32 color_unpack_rgb555 (__u32 X)
+ {
+ #ifdef LIL_ENDIAN
+ return ((X & 0x7c00) >> 7) | ((X & 0x7000) >> 12) |
+@@ -178,7 +174,7 @@ inline __u32 color_unpack_rgb555 (__u32
+
+
+ // RGB4A3 0aaa rrrr gggg bbbb
+-inline __u32 color_unpack_rgb4a3 (__u32 X)
++__u32 color_unpack_rgb4a3 (__u32 X)
+ {
+ #ifdef LIL_ENDIAN
+ return ((X & 0x0f00) >> 4) | ((X & 0x0f00) >> 8) |
+@@ -194,7 +190,7 @@ inline __u32 color_unpack_rgb4a3 (__u32
+ }
+
+
+-inline __u32 color_unpack_rgb5a3 (__u32 X)
++__u32 color_unpack_rgb5a3 (__u32 X)
+ {
+ if (X & 0x8000)
+ return (color_unpack_rgb555 (X) | MASK_ALPHA);
+@@ -203,7 +199,7 @@ inline __u32 color_unpack_rgb5a3 (__u32
+ }
+
+
+-inline __u32 color_unpack_i4 (__u32 X)
++__u32 color_unpack_i4 (__u32 X)
+ {
+ X |= X << 4;
+ X |= X << 8;
+@@ -211,14 +207,14 @@ inline __u32 color_unpack_i4 (__u32 X)
+ }
+
+
+-inline __u32 color_unpack_i8 (__u32 X)
++__u32 color_unpack_i8 (__u32 X)
+ {
+ X |= X << 8;
+ return (X | (X << 16));
+ }
+
+
+-inline __u32 color_unpack_ia4 (__u32 X)
++__u32 color_unpack_ia4 (__u32 X)
+ {
+ __u32 a = X & 0xf0;
+
+@@ -234,7 +230,7 @@ inline __u32 color_unpack_ia4 (__u32 X)
+ }
+
+
+-inline __u32 color_unpack_ia8 (__u32 X)
++__u32 color_unpack_ia8 (__u32 X)
+ {
+ __u32 a = X & 0xff00;
+
+@@ -826,7 +822,7 @@ int extract_textures (char *buff)
+ {
+ char temp[256];
+ int i;
+- TPLHeader (1) *hdr = (void *)buff;
++ struct tplheader *hdr = (void *)buff;
+
+
+ if (BSWAP32 (hdr->magic) != TPL_MAGIC)
+@@ -839,7 +835,7 @@ int extract_textures (char *buff)
+ {
+ int n = BSWAP32 (((__u32 *)buff)[1]);
+ // using variable length array
+- TPLHeader (n) *hdr = (void *) buff;
++ struct tplheader *hdr = (void *)buff;
+ TPLTextureHeader *texhdr = (void *) &buff[BSWAP32 (hdr->textures[0].texture_header_offset)];
+ TPLPaletteHeader *palhdr;
+
diff --git a/emulators/gcube/patches/patch-general.c b/emulators/gcube/patches/patch-general.c
new file mode 100644
index 00000000000..9410cfb841a
--- /dev/null
+++ b/emulators/gcube/patches/patch-general.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-general.c,v 1.1 2013/03/02 18:13:14 joerg Exp $
+
+--- general.c.orig 2013-03-01 16:14:43.000000000 +0000
++++ general.c
+@@ -187,7 +187,7 @@ __u32 round_up (__u32 a, __u32 b)
+ }
+
+
+-inline int is_power_of_two (__u32 a)
++int is_power_of_two (__u32 a)
+ {
+ int i = 0;
+
diff --git a/emulators/gcube/patches/patch-general.h b/emulators/gcube/patches/patch-general.h
new file mode 100644
index 00000000000..8875af6c887
--- /dev/null
+++ b/emulators/gcube/patches/patch-general.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-general.h,v 1.1 2013/03/02 18:13:14 joerg Exp $
+
+--- general.h.orig 2013-03-01 16:14:47.000000000 +0000
++++ general.h
+@@ -81,7 +81,7 @@ char *kill_extension (char *filename);
+ char *get_home_dir (void);
+
+ __u32 round_up (__u32 a, __u32 b);
+-inline int is_power_of_two (__u32 a);
++int is_power_of_two (__u32 a);
+
+ __u32 crc_setup (unsigned int bits);
+ __u32 crc_iterate (__u32 crc, __u8 d);
diff --git a/emulators/gcube/patches/patch-gx__transform.h b/emulators/gcube/patches/patch-gx__transform.h
new file mode 100644
index 00000000000..9070de01052
--- /dev/null
+++ b/emulators/gcube/patches/patch-gx__transform.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-gx__transform.h,v 1.1 2013/03/02 18:13:14 joerg Exp $
+
+--- gx_transform.h.orig 2013-03-01 16:11:32.000000000 +0000
++++ gx_transform.h
+@@ -2,17 +2,16 @@
+ #define __GX_TRANSFORM_H 1
+
+
+-
+-inline __u32 color_unpack_rgb565 (__u32 X);
+-inline __u32 color_unpack_rgba4 (__u32 X);
+-inline __u32 color_unpack_rgba6 (__u32 X);
+-inline __u32 color_unpack_rgb555 (__u32 X);
+-inline __u32 color_unpack_rgb4a3 (__u32 X);
+-inline __u32 color_unpack_rgb5a3 (__u32 X);
+-inline __u32 color_unpack_i4 (__u32 X);
+-inline __u32 color_unpack_i8 (__u32 X);
+-inline __u32 color_unpack_ia4 (__u32 X);
+-inline __u32 color_unpack_ia8 (__u32 X);
++__u32 color_unpack_rgb565 (__u32 X);
++__u32 color_unpack_rgba4 (__u32 X);
++__u32 color_unpack_rgba6 (__u32 X);
++__u32 color_unpack_rgb555 (__u32 X);
++__u32 color_unpack_rgb4a3 (__u32 X);
++__u32 color_unpack_rgb5a3 (__u32 X);
++__u32 color_unpack_i4 (__u32 X);
++__u32 color_unpack_i8 (__u32 X);
++__u32 color_unpack_ia4 (__u32 X);
++__u32 color_unpack_ia8 (__u32 X);
+
+ unsigned int gx_draw (__u32 mem, int prim, int n, int vat);
+