Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

11
emulators/Cygne-SDL/DESCR Normal file
View File

@@ -0,0 +1,11 @@
Originally Cygne was developed by Dox as a Bandai Wonderswan (Colour)
emulator for Windows systems. From version 2.1 Dox decided to
release the Windows sources to the public in GPL form which allows
others to use the source and hack it :)
Cygne/SDL is a Cygne port using the Simple Directmedia Layer (SDL)
library. Cygne/SDL is released as OpenSource under the GPL license.
It uses code from the orignal Cygne (allthough a bit modified),
code from the MAME NEC CPU core as well as portions from several
SDLemu emulation projects. Anybody may hack the current sourcecode
if they like or can make additional changes into it.

View File

@@ -0,0 +1,40 @@
# $NetBSD: Makefile,v 1.19 2013/04/13 19:08:27 dholland Exp $
#
DISTNAME= Cygne-SDL-0.1-src
PKGNAME= ${DISTNAME:S/-src//}
PKGREVISION= 6
CATEGORIES= emulators
MASTER_SITES= http://sdlemu.ngemu.com/OpenProjects/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://icculus.org/Cygne-SDL/
COMMENT= Bandai Wonderswan Color handheld emulator
# 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
NO_CONFIGURE= yes
BUILD_DIRS= src
USE_LANGUAGES= c c++
USE_TOOLS+= zip
INSTALLATION_DIRS= bin share/Cygne-SDL share/doc/Cygne-SDL
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} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/Cygne-SDL
${INSTALL_DATA} ${WRKSRC}/WonderSnake/Wondersnake.txt \
${DESTDIR}${PREFIX}/share/Cygne-SDL
${INSTALL_DATA} ${WRKSRC}/WonderSnake/Wondersnake.zip \
${DESTDIR}${PREFIX}/share/Cygne-SDL
.include "../../devel/SDL/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View File

@@ -0,0 +1,5 @@
@comment $NetBSD: PLIST,v 1.3 2009/06/14 17:51:00 joerg Exp $
bin/Cygne-SDL
share/Cygne-SDL/Wondersnake.txt
share/Cygne-SDL/Wondersnake.zip
share/doc/Cygne-SDL/README

View File

@@ -0,0 +1,10 @@
$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) = 65f8a9b50150dbbb65f20999e457ef31ff196c9b
SHA1 (patch-ab) = 775f303626193bec32d2964ad7c63e528bc831b3
SHA1 (patch-ac) = 5d73fc40a43a83aff312a86e077f28b1d52955c9
SHA1 (patch-ad) = 0869496464d90d3b6db932d0279e4ac1328a3332
SHA1 (patch-src_mainsdl.cpp) = 53cceb4a6b2b9c36b64414e8be621b0baa9470d1

View File

@@ -0,0 +1,67 @@
$NetBSD: patch-aa,v 1.4 2013/04/13 19:06:13 dholland Exp $
- configure for pkgsrc
- avoid unnecessary gmake syntax
--- src/Makefiles/Makefile.unix.orig 2002-03-26 16:50:55.000000000 +0000
+++ src/Makefiles/Makefile.unix
@@ -1,24 +1,15 @@
-CC = gcc
-LD = gcc
+#LD = g++
NASM = nasm
### Include and lib stuff ####
-STDINCLUDE = /usr/include
-STDLIB = /usr/lib
-SDLINCLUDE = /usr/local/include/SDL
-SDLLIB = /usr/local/lib
-
-CFLAGS = -O1 -DUNIX -DTARGET_UNIX -DGCC -DUSES_16BIT_ONLY -D__SDL__ -fomit-frame-pointer -march=pentium \
- -mpentium -finline-functions -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)
+CFLAGS += -DUNIX -DTARGET_UNIX -DGCC -DUSES_16BIT_ONLY -D__SDL__
+
+LDFLAGS += `sdl-config --libs`
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
@@ -28,17 +19,22 @@ INCS = -I. `sdl-config --cflags`
THECC = $(CC) $(CFLAGS) $(INCS)
-%.o: %.asm
+.SUFFIXES: .asm
+
+.asm.o:
$(NASM) -f elf -o $@ $<
-%.o: %.c
- $(THECC) -c $< -o $@
+.c.o:
+ $(CC) $(CFLAGS) $(INCS) -c $< -o $@
+
+.cpp.o:
+ $(CXX) $(CFLAGS) $(INCS) -c $< -o $@
-%.o: %.cpp
- $(THECC) -c $< -o $@
+unzip.o:
+ $(CC) $(CFLAGS) $(INCS) -c zlib/unzip.c -o $@
-cygne: $(OBJ) Makefile
- $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+cygne: $(OBJ)
+ $(CXX) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
clean:
rm -f cygne *.o zlib/*.o

View File

@@ -0,0 +1,29 @@
$NetBSD: patch-ab,v 1.3 2013/04/13 19:07:21 dholland Exp $
- Fix C syntax (string constants continued onto the next line must
have a backslash)
--- src/Usage.h.orig 2002-03-26 16:55:20.000000000 +0100
+++ src/Usage.h
@@ -1,13 +1,13 @@
void Usage()
{
printf(
-"Usage: ./cygne romfile options
- Where options are:
-
- romfile : Filename of the romfile. It can have several
- extensions (.ws/.wsc/.rom/.bin). Gzipped and
- zipped (.gz and .zip) are also supported.
- -double : Scale the screen 2 times the normal size.
- -scanline : Allows scanline output with scaling.
+"Usage: ./cygne romfile options\n\
+ Where options are:\n\
+\n\
+ romfile : Filename of the romfile. It can have several\n\
+ extensions (.ws/.wsc/.rom/.bin). Gzipped and\n\
+ zipped (.gz and .zip) are also supported.\n\
+ -double : Scale the screen 2 times the normal size.\n\
+ -scanline : Allows scanline output with scaling.\n\
");
}

View File

@@ -0,0 +1,284 @@
$NetBSD: patch-ac,v 1.3 2013/04/13 19:08:27 dholland Exp $
- 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
@@ -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
- xorl %%eax, %%eax
- movl $448, %%ebx
- emms
- sum:
- movq (%0, %%eax, 1), %%mm0
- movq %%mm0, %%mm1
- punpcklwd %%mm0, %%mm0
- addl $8, %%eax
- punpckhwd %%mm1,%%mm1
- movq %%mm0, -16(%1, %%eax, 2)
- cmpl %%ebx, %%eax
-
- movq %%mm1, -8(%1, %%eax, 2)
- jnz sum
- xorl %%eax, %%eax
-
- addl %2, %0
- decl %%edx
-
- leal (%1, %2, 4), %1
- jnz sum
- emms
+#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:
- __asm__ __volatile__("pusha
- xorl %%eax, %%eax
- movl $896, %%ebx
- emms
- sum3:
- movq (%0, %%eax, 1), %%mm0
- movq %%mm0, %%mm1
- punpcklwd %%mm0, %%mm0
- addl $8, %%eax
- punpckhwd %%mm1,%%mm1
- movq %%mm0, -16(%1, %%eax, 2)
- cmpl %%ebx, %%eax
-
- movq %%mm1, -8(%1, %%eax, 2)
- jnz sum3
- xorl %%eax, %%eax
-
- addl %2, %0
- decl %%edx
-
- leal (%1, %2, 4), %1
- jnz sum3
- emms
+#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;
}
//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
- xorl %%eax, %%eax
- movl $288, %%ebx
- emms
- sumb:
- movq (%0, %%eax, 1), %%mm0
- movq %%mm0, %%mm1
- punpcklwd %%mm0, %%mm0
- addl $8, %%eax
- punpckhwd %%mm1,%%mm1
- movq %%mm0, -16(%1, %%eax, 2)
- cmpl %%ebx, %%eax
-
- movq %%mm1, -8(%1, %%eax, 2)
- jnz sumb
- xorl %%eax, %%eax
-
- addl %2, %0
- decl %%edx
-
- leal (%1, %2, 4), %1
- jnz sumb
- emms
+#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
- xorl %%eax, %%eax
- movl $576, %%ebx
- emms
- sumc:
- movq (%0, %%eax, 1), %%mm0
- movq %%mm0, %%mm1
- punpcklwd %%mm0, %%mm0
- addl $8, %%eax
- punpckhwd %%mm1,%%mm1
- movq %%mm0, -16(%1, %%eax, 2)
- cmpl %%ebx, %%eax
-
- movq %%mm1, -8(%1, %%eax, 2)
- jnz sumc
- xorl %%eax, %%eax
-
- addl %2, %0
- decl %%edx
-
- leal (%1, %2, 4), %1
- jnz sumc
- emms
+#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);

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-ad,v 1.3 2013/04/13 19:07:21 dholland Exp $
- Fix build.
--- src/zlib/unzip.h.orig 2002-03-21 19:42:46.000000000 +0100
+++ src/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 */

View File

@@ -0,0 +1,31 @@
$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) {