On Sun, 20 Jul 2003, Phillip Pi wrote:

> Compiling src/vidhrdw/gaiden.c ...
> src/vidhrdw/gaiden.c: In function `draw_sprites':
> src/vidhrdw/gaiden.c:384: parse error before `priority'
> src/vidhrdw/gaiden.c:398: `color' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:398: (Each undeclared identifier is reported only once
> src/vidhrdw/gaiden.c:398: for each function it appears in.)
> src/vidhrdw/gaiden.c:401: `xpos' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:403: `ypos' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:408: `flipx' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:409: `flipy' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:411: `sizex' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:412: `sizey' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:421: `priority' undeclared (first use in this function)
> src/vidhrdw/gaiden.c:423: default label not within a switch statement
> src/vidhrdw/gaiden.c:424: case label not within a switch statement
> src/vidhrdw/gaiden.c:425: case label not within a switch statement
> src/vidhrdw/gaiden.c:426: case label not within a switch statement
> src/vidhrdw/gaiden.c:427: case label not within a switch statement
> src/vidhrdw/gaiden.c:443: `number' undeclared (first use in this function)
> make: *** [xmame.obj/vidhrdw/gaiden.o] Error 1

This is because gaiden.c uses a C99 feature that is not supported by your
compiler (I assume you use an old gcc.  I get the same error with gcc 2.95
on NetBSD).

You can fix this with something like the patch below.

   /Krister

--- src/vidhrdw/gaiden.c.orig   Sat Jul 19 21:01:17 2003
+++ src/vidhrdw/gaiden.c        Sat Jul 19 21:03:44 2003
@@ -378,22 +378,25 @@

                if (attributes & 0x04)
                {
+                       UINT32 priority, flipx, flipy, color, sizex, sizey, number;
+                       int ypos, xpos;
+
                        if (!blend_support && (attributes & 0x20) && 
(cpu_getcurrentframe() & 1))
                                goto skip_sprite;

-                       UINT32 priority = (attributes >> 6) & 3;
-                       UINT32 flipx = (attributes & 1);
-                       UINT32 flipy = (attributes & 2);
+                       priority = (attributes >> 6) & 3;
+                       flipx = (attributes & 1);
+                       flipy = (attributes & 2);

-                       UINT32 color = source[2];
-                       UINT32 sizex = 1 << ((color >> 0) & 3);                        
                 /* 1,2,4,8 */
-                       UINT32 sizey = 1 << ((color >> gaiden_sprite_sizey) & 3);      
 /* 1,2,4,8 */
+                       color = source[2];
+                       sizex = 1 << ((color >> 0) & 3);                               
                 /* 1,2,4,8 */
+                       sizey = 1 << ((color >> gaiden_sprite_sizey) & 3);      /* 
1,2,4,8 */

                        /* raiga needs something like this */
-                       UINT32 number = (source[1] & (sizex > 2 ? 0x7ff8 : 0x7ffc));
+                       number = (source[1] & (sizex > 2 ? 0x7ff8 : 0x7ffc));

-                       int ypos = source[3] & 0x01ff;
-                       int xpos = source[4] & 0x01ff;
+                       ypos = source[3] & 0x01ff;
+                       xpos = source[4] & 0x01ff;

                        color = (color >> 4) & 0x0f;



_______________________________________________
Xmame mailing list
[EMAIL PROTECTED]
http://toybox.twisted.org.uk/mailman/listinfo/xmame

Reply via email to