1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

Add cygne-sdl 0.1, the SDL port of Cygne, a free Bandai Wonderswan

emulator.

PR:		ports/96805
Submitted by:	Li-Lun Wang <llwang@infor.org>
This commit is contained in:
Cheng-Lung Sung 2006-05-27 15:55:40 +00:00
parent a3f2f5df9f
commit 6b905a398b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=163619
8 changed files with 350 additions and 0 deletions

View File

@ -14,6 +14,7 @@
SUBDIR += cingb
SUBDIR += cpmemu
SUBDIR += cpmtools
SUBDIR += cygne-sdl
SUBDIR += darcnes
SUBDIR += dgen-sdl
SUBDIR += dlx

View File

@ -0,0 +1,28 @@
# New ports collection makefile for: Cygne/SDL
# Date created: 4 May 2006
# Whom: Li-Lun Wang <llwang@infor.org>
#
# $FreeBSD$
#
PORTNAME= cygne-sdl
PORTVERSION= 0.1
CATEGORIES= emulators
MASTER_SITES= http://sdlemu.ngemu.com/OpenProjects/
DISTNAME= Cygne-SDL-${PORTVERSION}-src
MAINTAINER= llwang@infor.org
COMMENT= The SDL port of Cygne, a free Bandai Wonderswan emulator
USE_SDL= sdl
USE_GMAKE= yes
ONLY_FOR_ARCHS= i386
WRKSRC= ${WRKDIR}/Cygne-SDL-${PORTVERSION}/src
post-patch:
${CP} ${FILESDIR}/Makefile.bsd ${WRKSRC}/Makefile
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/cygne ${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (Cygne-SDL-0.1-src.tar.gz) = c3198a0e92c652597004e7bd71f6f805
SHA256 (Cygne-SDL-0.1-src.tar.gz) = 2a4efa91a241d9039359c142860c33d5451986561c6b6c2359082e985268fd77
SIZE (Cygne-SDL-0.1-src.tar.gz) = 106448

View File

@ -0,0 +1,43 @@
LD = ${CXX}
### 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)
TARGET = cygne
OBJ = ddrawsdl.o filessdl.o gfx.o nec.o tcache.o memory.o mainsdl.o zlib/unzip.o
LIBS = `${SDL_CONFIG} --libs` -lz
all: $(TARGET)
INCS = -I. `${SDL_CONFIG} --cflags`
THECC = $(CC) $(CFLAGS) $(INCS)
THECXX = $(CXX) $(CFLAGS) $(INCS)
%.o: %.asm
$(NASM) -f elf -o $@ $<
%.o: %.c
$(THECC) -c $< -o $@
%.o: %.cpp
$(THECXX) -c $< -o $@
cygne: $(OBJ) Makefile
$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
clean:
rm -f cygne *.o zlib/*.o

View File

@ -0,0 +1,25 @@
--- Usage.h.orig Tue Mar 26 09:55:20 2002
+++ Usage.h Thu May 4 18:27:46 2006
@@ -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,241 @@
--- ddrawsdl.cpp.orig Tue Mar 26 09:02:25 2002
+++ ddrawsdl.cpp Thu May 4 18:18:12 2006
@@ -174,67 +174,67 @@
{
switch(fBlitterMode) {
case 1:
- __asm__ __volatile__(".align 32
- cld
- rep
- movsw"
+ __asm__ __volatile__(".align 32\n\t"
+ "cld\n\t"
+ "rep\n\t"
+ "movsw"
:
:"S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"((g_pDDSPrimary->h * g_pDDSPrimary->pitch)>>1));
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
- 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"
:
: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(144));
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
- 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"
:
: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(144));
break;
@@ -418,66 +418,66 @@
{
switch(fBlitterMode) {
case 1:
- __asm__ __volatile__(".align 32
- cld
- rep
- movsw"
+ __asm__ __volatile__(".align 32\n\t"
+ "cld\n\t"
+ "rep\n\t"
+ "movsw"
:
:"S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"((g_pDDSPrimary->h * g_pDDSPrimary->pitch)>>1));
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
- 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"
:
: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(224));
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
- 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"
:
: "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(224));
break;

View File

@ -0,0 +1,8 @@
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/
-- Li-Lun Wang
llwang@infor.org

View File

@ -0,0 +1 @@
bin/cygne