Sat Apr 13 19:08:27 2013 UTC ()
Lift i386-only restriction.
Does not actually require nasm.
Reduce pkglint.
PKGREVISION -> 6.


(dholland)
diff -r1.18 -r1.19 pkgsrc/emulators/Cygne-SDL/Makefile
diff -r1.4 -r1.5 pkgsrc/emulators/Cygne-SDL/distinfo
diff -r1.2 -r1.3 pkgsrc/emulators/Cygne-SDL/patches/patch-ac
diff -r0 -r1.1 pkgsrc/emulators/Cygne-SDL/patches/patch-src_mainsdl.cpp

cvs diff -r1.18 -r1.19 pkgsrc/emulators/Cygne-SDL/Makefile (expand / switch to context diff)
--- pkgsrc/emulators/Cygne-SDL/Makefile 2012/10/03 12:55:08 1.18
+++ pkgsrc/emulators/Cygne-SDL/Makefile 2013/04/13 19:08:27 1.19
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.18 2012/10/03 12:55:08 asau Exp $
+# $NetBSD: Makefile,v 1.19 2013/04/13 19:08:27 dholland Exp $
 #
 
 DISTNAME=		Cygne-SDL-0.1-src
 PKGNAME=		${DISTNAME:S/-src//}
-PKGREVISION=		5
+PKGREVISION=		6
 CATEGORIES=		emulators
 MASTER_SITES=		http://sdlemu.ngemu.com/OpenProjects/
 
@@ -11,7 +11,8 @@
 HOMEPAGE=		http://icculus.org/Cygne-SDL/
 COMMENT=		Bandai Wonderswan Color handheld emulator
 
-BUILD_DEPENDS+=		nasm>=0.98:../../devel/nasm
+# The makefile mentions nasm but does not actually use it.
+#BUILD_DEPENDS+=	nasm>=0.98:../../devel/nasm
 
 WRKSRC=			${WRKDIR}/Cygne-SDL-0.1
 MAKE_FILE=		Makefiles/Makefile.unix
@@ -20,20 +21,15 @@
 USE_LANGUAGES=		c c++
 USE_TOOLS+=		zip
 
-# Uses i386 assembly code
-ONLY_FOR_PLATFORM=	*-*-i386
+INSTALLATION_DIRS=	bin share/Cygne-SDL share/doc/Cygne-SDL
 
-INSTALLATION_DIRS=	bin
-
 post-build:
 	cd ${WRKSRC}/WonderSnake && \
 		${TOOLS_PATH.zip} Wondersnake.zip Wondersnake.wsc
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/cygne ${DESTDIR}${PREFIX}/bin/Cygne-SDL
-	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/Cygne-SDL
 	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/Cygne-SDL
-	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/Cygne-SDL
 	${INSTALL_DATA} ${WRKSRC}/WonderSnake/Wondersnake.txt \
 		${DESTDIR}${PREFIX}/share/Cygne-SDL
 	${INSTALL_DATA} ${WRKSRC}/WonderSnake/Wondersnake.zip \

cvs diff -r1.4 -r1.5 pkgsrc/emulators/Cygne-SDL/distinfo (expand / switch to context diff)
--- pkgsrc/emulators/Cygne-SDL/distinfo 2005/11/03 21:38:04 1.4
+++ pkgsrc/emulators/Cygne-SDL/distinfo 2013/04/13 19:08:27 1.5
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.4 2005/11/03 21:38:04 rillig Exp $
+$NetBSD: distinfo,v 1.5 2013/04/13 19:08:27 dholland Exp $
 
 SHA1 (Cygne-SDL-0.1-src.tar.gz) = f9c50702d1911d0ff1728e5aa089e67cfdfd0030
 RMD160 (Cygne-SDL-0.1-src.tar.gz) = 6d9fd7195a936f17fc3984a66722272c7e30991a
 Size (Cygne-SDL-0.1-src.tar.gz) = 106448 bytes
-SHA1 (patch-aa) = ee9dd0b364d278a45f2ac8d038b43aaf8f0c5c96
+SHA1 (patch-aa) = 65f8a9b50150dbbb65f20999e457ef31ff196c9b
-SHA1 (patch-ab) = faff74d577fb243635a3aed7e6c17132bc43fe07
+SHA1 (patch-ab) = 775f303626193bec32d2964ad7c63e528bc831b3
-SHA1 (patch-ac) = b8037825c79bd36aa65bf18745a3b09470b34ec0
+SHA1 (patch-ac) = 5d73fc40a43a83aff312a86e077f28b1d52955c9
-SHA1 (patch-ad) = 1bf79e577e70d13fb3032d331235dcd6e2d611f2
+SHA1 (patch-ad) = 0869496464d90d3b6db932d0279e4ac1328a3332
+SHA1 (patch-src_mainsdl.cpp) = 53cceb4a6b2b9c36b64414e8be621b0baa9470d1

cvs diff -r1.2 -r1.3 pkgsrc/emulators/Cygne-SDL/patches/patch-ac (expand / switch to context diff)
--- pkgsrc/emulators/Cygne-SDL/patches/patch-ac 2005/11/03 21:38:04 1.2
+++ pkgsrc/emulators/Cygne-SDL/patches/patch-ac 2013/04/13 19:08:27 1.3
@@ -1,20 +1,39 @@
-$NetBSD: patch-ac,v 1.2 2005/11/03 21:38:04 rillig Exp $
+$NetBSD: patch-ac,v 1.3 2013/04/13 19:08:27 dholland Exp $
 
---- src/ddrawsdl.cpp.orig	2002-03-26 16:02:25.000000000 +0100
+- Fix C syntax (string constants continued onto the next line must
+have a backslash)
+
+- Use the asm blocks only on platforms where they're understood.
+Disable the more elaborate blitter modes on other platforms
+until/unless someone wants to write non-asm equivalents.
+
+--- src/ddrawsdl.cpp.orig	2002-03-26 15:02:25.000000000 +0000
 +++ src/ddrawsdl.cpp
-@@ -174,66 +174,66 @@ void UpdateFrame_h()
+@@ -12,6 +12,7 @@
+ */
+ 
+ #include <SDL.h>
++#include <assert.h>
+ #include "globals.h"
+ #include "gfx.h"
+ 
+@@ -174,69 +175,83 @@ void UpdateFrame_h()
  {
  	switch(fBlitterMode) {
  		case 1:
 -			__asm__ __volatile__(".align 32
 -							 cld
 -							 rep
++#if defined(__i386__) || defined(__x86_64__)
 +			__asm__ __volatile__(".align 32\n\
 +							 cld\n\
 +							 rep\n\
  							 movsw"
  							 :
  							 :"S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"((g_pDDSPrimary->h * g_pDDSPrimary->pitch)>>1));
++#else
++			memcpy(g_pDDSPrimary->pixels, dx_buffer, g_pDDSPrimary->h * g_pDDSPrimary->pitch);
++#endif
  		break;
  		case 2:
 -			__asm__ __volatile__("pusha
@@ -40,6 +59,7 @@
 -								 leal (%1, %2, 4), %1
 -								 jnz sum
 -								 emms
++#if defined(__i386__)
 +			__asm__ __volatile__("pusha\n\
 +								 xorl %%eax, %%eax\n\
 +								 movl $448, %%ebx \n\
@@ -66,6 +86,10 @@
  								 popa"
  			:
  			: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(144));
++#else
++			/* If you put real code here, enable the corresponding option in main() */
++			assert(0);
++#endif
  		break;
  		
  		case 3:
@@ -92,6 +116,7 @@
 -								 leal (%1, %2, 4), %1
 -								 jnz sum3
 -								 emms
++#if defined(__i386__)
 +			__asm__ __volatile__("pusha\n\
 +								 xorl %%eax, %%eax\n\
 +								 movl $896, %%ebx \n\
@@ -118,19 +143,30 @@
  								 popa"
  			:
  			: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(144));
-@@ -418,65 +418,65 @@ void UpdateFrame_v()
++#else
++			/* If you put real code here, enable the corresponding option in main() */
++			assert(0);
++#endif
+ 		break;
+ 	}
+ 	//Niels(adjust to suit) use the asm below, or use standard memcpy/fast_memcpy etc, updateframe_v is not implemented
+@@ -418,68 +433,82 @@ void UpdateFrame_v()
  {
  	switch(fBlitterMode) {
  		case 1:
 -			__asm__ __volatile__(".align 32
 -							 cld
 -							 rep
++#if defined(__i386__) || defined(__x86_64__)
 +			__asm__ __volatile__(".align 32\n\
 +							 cld\n\
 +							 rep\n\
  							 movsw"
  							 :
  							 :"S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"((g_pDDSPrimary->h * g_pDDSPrimary->pitch)>>1));
++#else
++			memcpy(g_pDDSPrimary->pixels, dx_buffer, g_pDDSPrimary->h * g_pDDSPrimary->pitch);
++#endif
  		break;
  		case 2: // double scanlines
 -			__asm__ __volatile__("pusha
@@ -156,6 +192,7 @@
 -								 leal (%1, %2, 4), %1
 -								 jnz sumb
 -								 emms
++#if defined(__i386__)
 +			__asm__ __volatile__("pusha\n\
 +								 xorl %%eax, %%eax\n\
 +								 movl $288, %%ebx \n\
@@ -182,6 +219,10 @@
  								 popa"
  			:
  			: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(224));
++#else
++			/* If you put real code here, enable the corresponding option in main() */
++			assert(0);
++#endif
  		break;
  		case 3: // double stretch mode
 -			__asm__ __volatile__("pusha
@@ -207,6 +248,7 @@
 -								 leal (%1, %2, 4), %1
 -								 jnz sumc
 -								 emms
++#if defined(__i386__)
 +			__asm__ __volatile__("pusha\n\
 +								 xorl %%eax, %%eax\n\
 +								 movl $576, %%ebx \n\
@@ -233,3 +275,10 @@
  								 popa"
  			:
  			: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(224));
++#else
++			/* If you put real code here, enable the corresponding option in main() */
++			assert(0);
++#endif
+ 		break;
+ 	}
+ 	SDL_Flip(g_pDDSPrimary);

File Added: pkgsrc/emulators/Cygne-SDL/patches/patch-src_mainsdl.cpp
$NetBSD: patch-src_mainsdl.cpp,v 1.1 2013/04/13 19:08:27 dholland Exp $

Disable blitter modes 2 and 3 on non-i386 unless/until someone provides
non-asm code for them (see ddrawsdl.cpp / patch-ac)

--- src/mainsdl.cpp~	2002-03-26 16:12:36.000000000 +0000
+++ src/mainsdl.cpp
@@ -322,13 +322,23 @@ int main(int argc, char *argv[])
 	for (i=0; (i < argc || argv[i] != NULL); i++) {
 		
 		if(strcmp(argv[i], "-double") == 0) {
+#if defined(__i386__)
 			fScreenSize = 2;
 			fBlitterMode = 3;
+#else
+			fprintf(stderr, "-double is not supported on this platform\n");
+			exit(1);
+#endif
 		}
 		
 		if(strcmp(argv[i], "-scanline") == 0) {
+#if defined(__i386__)
 			fScreenSize = 2;
 			fBlitterMode = 2;
+#else
+			fprintf(stderr, "-scanline is not supported on this platform\n");
+			exit(1);
+#endif
 		}
 		
 		if (strncmp(argv[i], "-h", 2) == 0) {