aboutsummaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2014-02-07 13:12:37 +0000
committerMartin Wilke <miwi@FreeBSD.org>2014-02-07 13:12:37 +0000
commit05c94d0e6def919a03b1b9bd29ab3afcc1213ad1 (patch)
tree304d282c4d49027264b137de374e53d960ced291 /emulators
parent1af1afd6af1da1840a6e1eb145230cd88fee416b (diff)
downloadports-05c94d0e6def919a03b1b9bd29ab3afcc1213ad1.tar.gz
ports-05c94d0e6def919a03b1b9bd29ab3afcc1213ad1.zip
Notes
Diffstat (limited to 'emulators')
-rw-r--r--emulators/cygne-sdl/Makefile30
-rw-r--r--emulators/cygne-sdl/files/Makefile.bsd34
-rw-r--r--emulators/cygne-sdl/files/patch-src-ddrawsdl.cpp258
-rw-r--r--emulators/cygne-sdl/files/patch-src__mainsdl.cpp26
-rw-r--r--emulators/cygne-sdl/files/patch-src__zlib__unzip.h13
-rw-r--r--emulators/cygne-sdl/pkg-descr2
-rw-r--r--emulators/cygne-sdl/pkg-plist1
7 files changed, 223 insertions, 141 deletions
diff --git a/emulators/cygne-sdl/Makefile b/emulators/cygne-sdl/Makefile
index 02a4de0a3cec..e490b03a4e13 100644
--- a/emulators/cygne-sdl/Makefile
+++ b/emulators/cygne-sdl/Makefile
@@ -9,18 +9,34 @@ MASTER_SITES= http://sdlemu.ngemu.com/OpenProjects/
DISTNAME= Cygne-SDL-${PORTVERSION}-src
MAINTAINER= ports@FreeBSD.org
-COMMENT= The SDL port of Cygne, a free Bandai Wonderswan emulator
+COMMENT= SDL port of Cygne, a free Bandai Wonderswan emulator
+
+LICENSE= GPLv2
+
+WRKSRC= ${WRKDIR}/Cygne-SDL-${PORTVERSION}/src
USE_SDL= sdl
-USE_GMAKE= yes
-ONLY_FOR_ARCHS= i386
-WRKSRC= ${WRKDIR}/Cygne-SDL-${PORTVERSION}/src
-NO_STAGE= yes
+PLIST_FILES= bin/cygne
+
+OPTIONS_DEFINE_i386= OPTIMIZED_CFLAGS
+OPTIONS_DEFAULT_i386= OPTIMIZED_CFLAGS
+OPTIMIZED_CFLAGS_CFLAGS=\
+ -fomit-frame-pointer -fexpensive-optimizations \
+ -funroll-loops -funroll-all-loops -fschedule-insns2 \
+ -fstrength-reduce -malign-double -mfancy-math-387 \
+ -ffast-math -fforce-addr
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "i386"
+USE_GCC= any
+.endif
+
post-patch:
${CP} ${FILESDIR}/Makefile.bsd ${WRKSRC}/Makefile
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/cygne ${PREFIX}/bin
+ (cd ${WRKSRC} && ${INSTALL_PROGRAM} cygne ${STAGEDIR}${PREFIX}/bin)
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/emulators/cygne-sdl/files/Makefile.bsd b/emulators/cygne-sdl/files/Makefile.bsd
index bb697e380867..168171a906b3 100644
--- a/emulators/cygne-sdl/files/Makefile.bsd
+++ b/emulators/cygne-sdl/files/Makefile.bsd
@@ -1,22 +1,11 @@
-LD = ${CXX}
+NASM = nasm
### Include and lib stuff ####
-#STDINCLUDE = /usr/include
-#STDLIB = /usr/lib
-#SDLINCLUDE = /usr/local/include/SDL
-#SDLLIB = /usr/local/lib
-
-CFLAGS+= -DUNIX -DTARGET_UNIX -DGCC -DUSES_16BIT_ONLY -D__SDL__ -fomit-frame-pointer \
- -fexpensive-optimizations -funroll-loops -funroll-all-loops -pipe \
- -fschedule-insns2 -fstrength-reduce -malign-double -mfancy-math-387 -ffast-math -fforce-addr \
- -fforce-mem `${SDL_CONFIG} --cflags`# \
-# -L$(STDLIB) -L$(SDLLIB) -I$(STDINCLUDE) -I$(SDLINCLUDE)
-
-#LDFLAGS = $(CFLAGS)
+CPPFLAGS+= -DUNIX -DTARGET_UNIX -DGCC -DUSES_16BIT_ONLY -D__SDL__
TARGET = cygne
-OBJ = ddrawsdl.o filessdl.o gfx.o nec.o tcache.o memory.o mainsdl.o zlib/unzip.o
+OBJ = ddrawsdl.o filessdl.o gfx.o nec.o tcache.o memory.o mainsdl.o unzip.o
LIBS = `${SDL_CONFIG} --libs` -lz
@@ -24,20 +13,25 @@ all: $(TARGET)
INCS = -I. `${SDL_CONFIG} --cflags`
-THECC = $(CC) $(CFLAGS) $(INCS)
-THECXX = $(CXX) $(CFLAGS) $(INCS)
+THECC = $(CC) $(CFLAGS) $(INCS) $(CPPFLAGS)
+THECXX = $(CXX) $(CXXFLAGS) $(INCS) $(CPPFLAGS)
-%.o: %.asm
+.SUFFIXES: .asm
+
+.asm.o:
$(NASM) -f elf -o $@ $<
-%.o: %.c
+.c.o:
$(THECC) -c $< -o $@
-%.o: %.cpp
+.cpp.o:
$(THECXX) -c $< -o $@
+unzip.o:
+ $(THECC) -c zlib/unzip.c -o $@
+
cygne: $(OBJ) Makefile
- $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+ $(CXX) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
clean:
rm -f cygne *.o zlib/*.o
diff --git a/emulators/cygne-sdl/files/patch-src-ddrawsdl.cpp b/emulators/cygne-sdl/files/patch-src-ddrawsdl.cpp
index b84f9c03ed1b..5781de1e6625 100644
--- a/emulators/cygne-sdl/files/patch-src-ddrawsdl.cpp
+++ b/emulators/cygne-sdl/files/patch-src-ddrawsdl.cpp
@@ -1,19 +1,30 @@
--- ddrawsdl.cpp.orig Tue Mar 26 09:02:25 2002
+++ ddrawsdl.cpp Thu May 4 18:18:12 2006
-@@ -174,67 +174,67 @@
+@@ -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
-- movsw"
-+ __asm__ __volatile__(".align 32\n\t"
-+ "cld\n\t"
-+ "rep\n\t"
-+ "movsw"
++#if defined(__i386__) || defined(__amd64__) || 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
@@ -39,33 +50,37 @@
- leal (%1, %2, 4), %1
- jnz sum
- emms
-- popa"
-+ __asm__ __volatile__("pusha\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "movl $448, %%ebx\n\t"
-+ "emms\n\t"
-+ "sum:\n\t"
-+ "movq (%0, %%eax, 1), %%mm0\n\t"
-+ "movq %%mm0, %%mm1\n\t"
-+ "punpcklwd %%mm0, %%mm0\n\t"
-+ "addl $8, %%eax\n\t"
-+ "punpckhwd %%mm1,%%mm1\n\t"
-+ "movq %%mm0, -16(%1, %%eax, 2)\n\t"
-+ "cmpl %%ebx, %%eax\n\t"
-+
-+ "movq %%mm1, -8(%1, %%eax, 2)\n\t"
-+ "jnz sum\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+
-+ "addl %2, %0\n\t"
-+ "decl %%edx\n\t"
-+
-+ "leal (%1, %2, 4), %1\n\t"
-+ "jnz sum\n\t"
-+ "emms\n\t"
-+ "popa"
++#if defined(__i386__)
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $448, %%ebx \n\
++ emms\n\
++ sum:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sum\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sum\n\
++ emms\n\
+ 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,48 +107,57 @@
- leal (%1, %2, 4), %1
- jnz sum3
- emms
-- popa"
-+ __asm__ __volatile__("pusha\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "movl $896, %%ebx\n\t"
-+ "emms\n"
-+ "sum3:\n\t"
-+ "movq (%0, %%eax, 1), %%mm0\n\t"
-+ "movq %%mm0, %%mm1\n\t"
-+ "punpcklwd %%mm0, %%mm0\n\t"
-+ "addl $8, %%eax\n\t"
-+ "punpckhwd %%mm1,%%mm1\n\t"
-+ "movq %%mm0, -16(%1, %%eax, 2)\n\t"
-+ "cmpl %%ebx, %%eax\n\t"
-+ "\n\t"
-+ "movq %%mm1, -8(%1, %%eax, 2)\n\t"
-+ "jnz sum3\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "\n\t"
-+ "addl %2, %0\n\t"
-+ "decl %%edx\n\t"
-+ "\n\t"
-+ "leal (%1, %2, 4), %1\n\t"
-+ "jnz sum3\n\t"
-+ "emms\n\t"
-+ "popa"
++#if defined(__i386__)
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $896, %%ebx \n\
++ emms\n\
++ sum3:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sum3\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sum3\n\
++ emms\n\
+ 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;
-@@ -418,66 +418,66 @@
+ }
+ //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
-- movsw"
-+ __asm__ __volatile__(".align 32\n\t"
-+ "cld\n\t"
-+ "rep\n\t"
-+ "movsw"
++#if defined(__i386__) || defined(__amd64__) || 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
@@ -159,33 +183,37 @@
- leal (%1, %2, 4), %1
- jnz sumb
- emms
-- popa"
-+ __asm__ __volatile__("pusha\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "movl $288, %%ebx\n\t"
-+ "emms\n"
-+ "sumb:\n\t"
-+ "movq (%0, %%eax, 1), %%mm0\n\t"
-+ "movq %%mm0, %%mm1\n\t"
-+ "punpcklwd %%mm0, %%mm0\n\t"
-+ "addl $8, %%eax\n\t"
-+ "punpckhwd %%mm1,%%mm1\n\t"
-+ "movq %%mm0, -16(%1, %%eax, 2)\n\t"
-+ "cmpl %%ebx, %%eax\n\t"
-+ "\n\t"
-+ "movq %%mm1, -8(%1, %%eax, 2)\n\t"
-+ "jnz sumb\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "\n\t"
-+ "addl %2, %0\n\t"
-+ "decl %%edx\n\t"
-+ "\n\t"
-+ "leal (%1, %2, 4), %1\n\t"
-+ "jnz sumb\n\t"
-+ "emms\n\t"
-+ "popa"
++#if defined(__i386__)
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $288, %%ebx \n\
++ emms\n\
++ sumb:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sumb\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sumb\n\
++ emms\n\
+ 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
@@ -211,31 +239,37 @@
- leal (%1, %2, 4), %1
- jnz sumc
- emms
-- popa"
-+ __asm__ __volatile__("pusha\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "movl $576, %%ebx\n\t"
-+ "emms\n"
-+ "sumc:\n\t"
-+ "movq (%0, %%eax, 1), %%mm0\n\t"
-+ "movq %%mm0, %%mm1\n\t"
-+ "punpcklwd %%mm0, %%mm0\n\t"
-+ "addl $8, %%eax\n\t"
-+ "punpckhwd %%mm1,%%mm1\n\t"
-+ "movq %%mm0, -16(%1, %%eax, 2)\n\t"
-+ "cmpl %%ebx, %%eax\n\t"
-+ "\n\t"
-+ "movq %%mm1, -8(%1, %%eax, 2)\n\t"
-+ "jnz sumc\n\t"
-+ "xorl %%eax, %%eax\n\t"
-+ "\n\t"
-+ "addl %2, %0\n\t"
-+ "decl %%edx\n\t"
-+ "\n\t"
-+ "leal (%1, %2, 4), %1\n\t"
-+ "jnz sumc\n\t"
-+ "emms\n\t"
-+ "popa"
++#if defined(__i386__)
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $576, %%ebx \n\
++ emms\n\
++ sumc:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sumc\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sumc\n\
++ emms\n\
+ 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);
diff --git a/emulators/cygne-sdl/files/patch-src__mainsdl.cpp b/emulators/cygne-sdl/files/patch-src__mainsdl.cpp
new file mode 100644
index 000000000000..3a6d4ecc71f1
--- /dev/null
+++ b/emulators/cygne-sdl/files/patch-src__mainsdl.cpp
@@ -0,0 +1,26 @@
+--- mainsdl.cpp.orig
++++ 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) {
diff --git a/emulators/cygne-sdl/files/patch-src__zlib__unzip.h b/emulators/cygne-sdl/files/patch-src__zlib__unzip.h
new file mode 100644
index 000000000000..43804cce0fbe
--- /dev/null
+++ b/emulators/cygne-sdl/files/patch-src__zlib__unzip.h
@@ -0,0 +1,13 @@
+--- zlib/unzip.h.orig
++++ zlib/unzip.h
+@@ -49,6 +49,10 @@ extern "C" {
+ #include "zlib.h"
+ #endif
+
++#ifndef OF
++#define OF(a) a
++#endif
++
+ #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+ /* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */
diff --git a/emulators/cygne-sdl/pkg-descr b/emulators/cygne-sdl/pkg-descr
index da11df5101f2..5366baf0db31 100644
--- a/emulators/cygne-sdl/pkg-descr
+++ b/emulators/cygne-sdl/pkg-descr
@@ -2,4 +2,4 @@ Cygne/SDL is the Simple Directmedia Layer (or SDL) port of the Windows
version of Cygne, a free and now OpenSource (since 12-03-2002) Bandai
Wonderswan Color handheld software based emulator.
-WWW: http://icculus.org/Cygne-SDL/
+WWW: http://icculus.org/Cygne-SDL/
diff --git a/emulators/cygne-sdl/pkg-plist b/emulators/cygne-sdl/pkg-plist
deleted file mode 100644
index d35b500760f8..000000000000
--- a/emulators/cygne-sdl/pkg-plist
+++ /dev/null
@@ -1 +0,0 @@
-bin/cygne