Author: duncan
Date: Thu Dec 6 15:33:37 2007
New Revision: 10181
Log:
Changed pygoom to allow None
Correctly printing the fast_memcpy method in VERBOSE mode
Added some runtime config.h files
Added:
branches/rel-1/testing/Duncan/pygoom-2k4/config.h-32 (contents, props
changed)
branches/rel-1/testing/Duncan/pygoom-2k4/config.h-64 (contents, props
changed)
branches/rel-1/testing/Duncan/pygoom-2k4/config.h-PIII (contents, props
changed)
Modified:
branches/rel-1/testing/Duncan/pygoom-2k4/ (props changed)
branches/rel-1/testing/Duncan/pygoom-2k4/config.h
branches/rel-1/testing/Duncan/pygoom-2k4/setup.py
branches/rel-1/testing/Duncan/pygoom-2k4/src/aclib_template.c
branches/rel-1/testing/Duncan/pygoom-2k4/src/pygoom.c
Modified: branches/rel-1/testing/Duncan/pygoom-2k4/config.h
==============================================================================
--- branches/rel-1/testing/Duncan/pygoom-2k4/config.h (original)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/config.h Thu Dec 6 15:33:37 2007
@@ -1,3 +1,4 @@
+// config.h for 32 bit systems
// Use fast memcpy
#define USE_FASTMEMCPY
// Use runtime CPU detction
@@ -15,15 +16,15 @@
//#define ARCH_SPARC
//#define ARCH_VAX
#define ARCH_X86
-#define ARCH_X86_64
+//#define ARCH_X86_64
-#define HAVE_3DNOW
-#define HAVE_3DNOWEX
+//#define HAVE_3DNOW
+//#define HAVE_3DNOWEX
//#define HAVE_ALTIVEC 0
#define HAVE_MMX
#define HAVE_MMX2
-#define HAVE_SSE
-#define HAVE_SSE2
+//#define HAVE_SSE
+//#define HAVE_SSE2
// Verbose options keep these disabled
//#define STATISTICS
Added: branches/rel-1/testing/Duncan/pygoom-2k4/config.h-32
==============================================================================
--- (empty file)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/config.h-32 Thu Dec 6
15:33:37 2007
@@ -0,0 +1,35 @@
+// config.h for 32 bit systems
+// Use fast memcpy
+#define USE_FASTMEMCPY
+// Use runtime CPU detction
+#define RUNTIME_CPUDETECT
+
+// The machine architecture
+//#define ARCH_ALPHA
+//#define ARCH_ARMV4L
+//#define ARCH_IA64
+//#define ARCH_PA_RISC
+//#define ARCH_POWERPC
+//#define ARCH_S390
+//#define ARCH_S390X
+//#define ARCH_SGI_MIPS
+//#define ARCH_SPARC
+//#define ARCH_VAX
+#define ARCH_X86
+//#define ARCH_X86_64
+
+//#define HAVE_3DNOW
+//#define HAVE_3DNOWEX
+//#define HAVE_ALTIVEC 0
+#define HAVE_MMX
+#define HAVE_MMX2
+#define HAVE_SSE
+//#define HAVE_SSE2
+
+// Verbose options keep these disabled
+//#define STATISTICS
+//#define VERBOSE
+
+// Some settings in aclib (Advanced C library)
+//#define BLOCK_SIZE 4096
+//#define CONFUSION_FACTOR 0
Added: branches/rel-1/testing/Duncan/pygoom-2k4/config.h-64
==============================================================================
--- (empty file)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/config.h-64 Thu Dec 6
15:33:37 2007
@@ -0,0 +1,35 @@
+// config.h for 64 bit systems
+// Use fast memcpy
+#define USE_FASTMEMCPY
+// Use runtime CPU detction
+#define RUNTIME_CPUDETECT
+
+// The machine architecture
+//#define ARCH_ALPHA
+//#define ARCH_ARMV4L
+//#define ARCH_IA64
+//#define ARCH_PA_RISC
+//#define ARCH_POWERPC
+//#define ARCH_S390
+//#define ARCH_S390X
+//#define ARCH_SGI_MIPS
+//#define ARCH_SPARC
+//#define ARCH_VAX
+#define ARCH_X86
+#define ARCH_X86_64
+
+#define HAVE_3DNOW
+#define HAVE_3DNOWEX
+//#define HAVE_ALTIVEC 0
+#define HAVE_MMX
+#define HAVE_MMX2
+#define HAVE_SSE
+#define HAVE_SSE2
+
+// Verbose options keep these disabled
+//#define STATISTICS
+//#define VERBOSE
+
+// Some settings in aclib (Advanced C library)
+//#define BLOCK_SIZE 4096
+//#define CONFUSION_FACTOR 0
Added: branches/rel-1/testing/Duncan/pygoom-2k4/config.h-PIII
==============================================================================
--- (empty file)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/config.h-PIII Thu Dec 6
15:33:37 2007
@@ -0,0 +1,35 @@
+// config.h for 32 bit systems
+// Use fast memcpy
+#define USE_FASTMEMCPY
+// Use runtime CPU detction
+//#define RUNTIME_CPUDETECT
+
+// The machine architecture
+//#define ARCH_ALPHA
+//#define ARCH_ARMV4L
+//#define ARCH_IA64
+//#define ARCH_PA_RISC
+//#define ARCH_POWERPC
+//#define ARCH_S390
+//#define ARCH_S390X
+//#define ARCH_SGI_MIPS
+//#define ARCH_SPARC
+//#define ARCH_VAX
+#define ARCH_X86
+//#define ARCH_X86_64
+
+//#define HAVE_3DNOW
+//#define HAVE_3DNOWEX
+//#define HAVE_ALTIVEC 0
+#define HAVE_MMX
+#define HAVE_MMX2
+//#define HAVE_SSE
+//#define HAVE_SSE2
+
+// Verbose options keep these disabled
+//#define STATISTICS
+//#define VERBOSE
+
+// Some settings in aclib (Advanced C library)
+//#define BLOCK_SIZE 4096
+//#define CONFUSION_FACTOR 0
Modified: branches/rel-1/testing/Duncan/pygoom-2k4/setup.py
==============================================================================
--- branches/rel-1/testing/Duncan/pygoom-2k4/setup.py (original)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/setup.py Thu Dec 6 15:33:37 2007
@@ -17,14 +17,14 @@
]
# Intel P3 CFLAGS
-CFLAGS = ['-O9', '-march=pentium3', '-mtune=pentium3', '-mmmx', '-msse',
'-fno-pic', '-fomit-frame-pointer', '-Wall']
# AMD 64 CFLAGS
-CFLAGS = ['-O9', '-march=k8', '-mtune=k8', '-mmmx', '-msse', '-fpic',
'-fomit-frame-pointer', '-Wall']
+CFLAGS = ['-O9', '-march=k8', '-mtune=k8', '-mmmx', '-msse', '-msse2',
'-fpic', '-fomit-frame-pointer', '-Wall']
+CFLAGS = ['-O9', '-march=pentium3', '-mtune=pentium3', '-mmmx', '-msse',
'-msse2', '-fno-pic', '-fomit-frame-pointer', '-Wall']
# libraries
libdir = ['/usr/lib/' ]
-libraries = ['goom2', 'SDL', 'glib']
+libraries = ['goom2', 'SDL']
pympav_1 = Extension('pygoom',
include_dirs = includes,
@@ -35,9 +35,9 @@
# Setup #########################################################
-setup ( name = 'pygoom',
- version = '0.2',
- description = 'Goom bindings for Python',
+setup ( name = 'pygoom-2k4',
+ version = '0.1.1',
+ description = 'Goom-2k4 bindings for Python',
ext_modules = [pympav_1]
)
Modified: branches/rel-1/testing/Duncan/pygoom-2k4/src/aclib_template.c
==============================================================================
--- branches/rel-1/testing/Duncan/pygoom-2k4/src/aclib_template.c
(original)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/src/aclib_template.c Thu Dec
6 15:33:37 2007
@@ -133,12 +133,15 @@
#define MIN_LEN 0x40 /* 64-byte blocks */
#endif
+#define __STR(x) #x
+#define STR(x) __STR(x)
+
static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
{
void *retval = to;
size_t i;
#ifdef VERBOSE
- printf("RENAME(fast_memcpy)(%p, %p, %lu)\n", to, from, len);
+ printf(STR(RENAME(fast_memcpy))"(%p, %p, %u)\n", to, from, len);
#endif
#ifdef STATISTICS
{
@@ -370,7 +373,7 @@
void *retval = to;
size_t i;
#ifdef VERBOSE
- printf("RENAME(mem2agpcpy)(%p, %p, %lu)\n", to, from, len);
+ printf(STR(RENAME(mem2agpcpy))"(%p, %p, %u)\n", to, from, len);
#endif
#ifdef STATISTICS
{
Modified: branches/rel-1/testing/Duncan/pygoom-2k4/src/pygoom.c
==============================================================================
--- branches/rel-1/testing/Duncan/pygoom-2k4/src/pygoom.c (original)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/src/pygoom.c Thu Dec 6
15:33:37 2007
@@ -38,7 +38,9 @@
if (!PyArg_ParseTuple(args, "s", &value)) {
return (PyObject*)NULL;
}
- sharedfile = strdup(value);
+ if (value) {
+ sharedfile = strdup(value);
+ }
RETURN_NONE;
}
@@ -82,18 +84,26 @@
return NULL;
}
- /*
- // not sure about these, should perhaps
- // take -1 as well
- if(val>8 || val<1) {
- PyErr_SetString(PyExc_ValueError, "Use values between 1 and
8");
- return NULL;
- }
- else {
- FXMODE = val;
- }
- */
- FXMODE = val;
+ /* from src/goom_filters.h
+ NORMAL_MODE 0
+ WAVE_MODE 1
+ CRYSTAL_BALL_MODE 2
+ SCRUNCH_MODE 3
+ AMULETTE_MODE 4
+ WATER_MODE 5
+ HYPERCOS1_MODE 6
+ HYPERCOS2_MODE 7
+ YONLY_MODE 8
+ SPEEDWAY_MODE 9
+ */
+
+ if (val < -1 || val > 9) {
+ PyErr_SetString(PyExc_ValueError, "Use values between -1 and 9");
+ return NULL;
+ }
+ else {
+ FXMODE = val;
+ }
RETURN_NONE;
}
@@ -113,17 +123,19 @@
free(songtitle);
songtitle = 0;
}
- if (!PyArg_ParseTuple(args, "s", &value)) {
+ if (!PyArg_ParseTuple(args, "z", &value)) {
return (PyObject*)NULL;
}
- songtitle = strdup(value);
+ if (value) {
+ songtitle = strdup(value);
+ }
RETURN_NONE;
}
// Get the song title
static PyObject* pygoom_get_title(PyObject *self, PyObject *args)
{
- return Py_BuildValue("s", songtitle);
+ return Py_BuildValue("z", songtitle);
}
// Set the message
@@ -135,17 +147,19 @@
free(message);
message = 0;
}
- if (!PyArg_ParseTuple(args, "s", &value)) {
+ if (!PyArg_ParseTuple(args, "z", &value)) {
return (PyObject*)NULL;
}
- message = strdup(value);
+ if (value) {
+ message = strdup(value);
+ }
RETURN_NONE;
}
// Get the message
static PyObject* pygoom_get_message(PyObject *self, PyObject *args)
{
- return Py_BuildValue("s", message);
+ return Py_BuildValue("z", message);
}
// Set the frames per second
@@ -187,6 +201,10 @@
#else
memcpy(data, mmap_area + sizeof(data_t), 2048);
#endif
+#ifdef VERBOSE
+ printf ("goomInfo=%p, data=%p, FXMODE=%d, fps=%.1f, songtitle=%s,
message=%s\n",
+ goomInfo, data, FXMODE, fps, songtitle, message);
+#endif
render_data = goom_update(goomInfo, data, FXMODE, fps, songtitle,
message);
if (!render_data) {
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog