Author: musuruan
Update of /cvs/free/rpms/osmose/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv3164/devel
Modified Files:
.cvsignore sources
Added Files:
osmose-0.8.2-fixppcaudio.patch osmose-0.8.2-gcc43fix.patch
osmose-0.8.2-newtimer.patch
osmose-0.8.2-usesystemlibraries.patch osmose.spec
Log Message:
First import
osmose-0.8.2-fixppcaudio.patch:
--- NEW FILE osmose-0.8.2-fixppcaudio.patch ---
--- Osmose/OsmoseCore.cpp.orig 2007-06-08 08:38:34.000000000 +0100
+++ Osmose/OsmoseCore.cpp 2008-01-29 20:11:31.000000000 +0000
@@ -598,7 +598,7 @@
void OsmoseCore::setupAudioFormat()
{
format.freq = 22050;
- format.format = AUDIO_S16LSB;
+ format.format = AUDIO_S16MSB;
format.channels = 1;
format.samples = SAMPLE_SIZE;
format.callback = sndCallback;
osmose-0.8.2-gcc43fix.patch:
--- NEW FILE osmose-0.8.2-gcc43fix.patch ---
--- Osmose/MemoryMapper.cpp.orig 2006-11-27 17:56:30.000000000 +0000
+++ Osmose/MemoryMapper.cpp 2008-02-01 21:31:34.000000000 +0000
@@ -16,6 +16,8 @@
#include "Options.h"
#include "RomSpecificOption.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern Options opt;
--- Osmose/Options.cpp.orig 2006-11-24 10:35:30.000000000 +0000
+++ Osmose/Options.cpp 2008-02-01 21:30:20.000000000 +0000
@@ -14,6 +14,7 @@
*****************************************************************************/
#include "Options.h"
#include "MemoryMapper.h"
+#include <string.h>
void Options::reset()
{
--- Osmose/WaveWriter.cpp.orig 2006-11-06 11:08:38.000000000 +0000
+++ Osmose/WaveWriter.cpp 2008-02-01 21:42:32.000000000 +0000
@@ -13,6 +13,7 @@
* URL:
http://bcz.emu-france.com/
*****************************************************************************/
#include "WaveWriter.h"
+#include <stdlib.h>
/*----------------------------------------------------------------------*/
/* Constructor: Initialise structures ChunkFormat, Data Format, and */
osmose-0.8.2-newtimer.patch:
--- NEW FILE osmose-0.8.2-newtimer.patch ---
--- Osmose/PrecisionTimer.cpp.orig 2006-11-06 11:08:38.000000000 +0000
+++ Osmose/PrecisionTimer.cpp 2008-02-01 21:39:17.000000000 +0000
@@ -12,8 +12,45 @@
* URL:
http://bcz.emu-france.com/
*****************************************************************************/
#include "PrecisionTimer.h"
+#include <stdlib.h>
-#define rdtsc(val) __asm__ __volatile__ ("rdtsc" : "=A" (val))
+#if defined(__i386__)
+static __inline__ unsigned long long rdtsc(void)
+{
+ unsigned long long int x;
+ __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
+ return x;
+}
+
+#elif defined(__x86_64__)
+static __inline__ unsigned long long rdtsc(void)
+{
+ unsigned hi, lo;
+ __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
+ return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
+}
+
+#elif defined(__powerpc__)
+static __inline__ unsigned long long rdtsc(void)
+{
+ unsigned long long int result=0;
+ unsigned long int upper, lower,tmp;
+ __asm__ volatile(
+ "0: \n"
+ "\tmftbu %0 \n"
+ "\tmftb %1 \n"
+ "\tmftbu %2 \n"
+ "\tcmpw %2,%0 \n"
+ "\tbne 0b \n"
+ : "=r"(upper),"=r"(lower),"=r"(tmp)
+ );
+ result = upper;
+ result = result<<32;
+ result = result|lower;
+
+ return(result);
+}
+#endif
/*--------------------------------------------------------------------*/
/* Default Constructor initialise values to -1; */
@@ -43,9 +80,9 @@
{
cout << "Calibrating:" << dec<< s << "
seconds." << endl;
}
- rdtsc(start);
+ start=rdtsc();
PORTABLE_SLEEP_FUNC;
- rdtsc(stop);
+ stop=rdtsc();
tick_per_second = (unsigned long long) ( stop - start );
tick_per_second = (tick_per_second / s);
if (verbose)
@@ -60,7 +97,7 @@
/*--------------------------------------------------------------------*/
void PrecisionTimer::start()
{
- rdtsc(T0);
+ T0=rdtsc();
}
/*--------------------------------------------------------------------*/
@@ -74,7 +111,7 @@
{
bool ret = false;
- rdtsc(T1);
+ T1=rdtsc();
if (mode == CUMULATIVE)
{
cumulative_buffer[cumul_buffer_index] = getOneShotDuration();
osmose-0.8.2-usesystemlibraries.patch:
--- NEW FILE osmose-0.8.2-usesystemlibraries.patch ---
diff -durN Osmose.orig/Makefile Osmose/Makefile
--- Osmose.orig/Makefile 2006-11-29 16:18:08.000000000 +0100
+++ Osmose/Makefile 2008-01-19 14:14:44.000000000 +0100
@@ -1,11 +1,3 @@
-#Zlib
-Z_LIB_DIR= ./zlib/
-Z_LIB = $(Z_LIB_DIR)libz.a
-
-#unzip based on zlib.
-UNZIP_DIR= ./unzip/
-UNZIP_LIB= $(UNZIP_DIR)unzip.a
-
DISASM_DIR = ./z80_disasm
# Uncomment these lines before builting with internal debugger.
@@ -54,7 +46,7 @@
# Compiler/Linker Flags
# add -O3 to CFLAGS for speedup -pg on LFLAGS and CFLAGS for gprof
CFLAGS = -Wall -D__USE_UNIX98 -O3
-LFLAGS = -lSDL
+LFLAGS = -lz -lminizip -lSDL
AFLAGS = -f elf
CC = g++
C_COMP = gcc
@@ -64,10 +56,10 @@
.cpp.o:
$(CC) $(CFLAGS) -c $*.cpp -o $*.o
-all: libs disasm osmose stripexe
+all: disasm osmose
osmose: $(z80_lib) $(OSM_OBJS) $(OPT_OBJS)
- $(CC) $(CFLAGS) $(OSM_OBJS) $(Z80_LIB) $(OPT_OBJS) $(UNZIP_LIB) $(Z_LIB) -o $(OSM_EXE)
$(LFLAGS)
+ $(CC) $(CFLAGS) $(OSM_OBJS) $(Z80_LIB) $(OPT_OBJS) -o $(OSM_EXE) $(LFLAGS)
disasm: $(DISASM_OBJS)
@@ -78,19 +70,12 @@
rm -f $(DISASM_DIR)/*.o
rm -f ./cpu/*.o
rm -f *.o core $(OSM_EXE)
- rm -f $(Z_LIB_DIR)*.o $(Z_LIB_DIR)*.a
- rm -f $(UNZIP_DIR)*.o $(UNZIP_DIR)*.a
-# Clear all objects except ./cpu and zlib.
+# Clear all objects except ./cpu.
# This is done because compilation of CPU is long.
miniclean:
rm -f *.o core $(OSM_EXE)
-libs:
- cd $(Z_LIB_DIR) && make libz.a
- cd $(UNZIP_DIR) && make unzip.a
-
-
diff -durN Osmose.orig/MemoryMapper.h Osmose/MemoryMapper.h
--- Osmose.orig/MemoryMapper.h 2006-11-27 18:52:42.000000000 +0100
+++ Osmose/MemoryMapper.h 2008-01-19 12:21:57.000000000 +0100
@@ -17,7 +17,7 @@
#include <iostream>
#include <fstream>
#include <iomanip>
-#include "unzip/unzip.h"
+#include <minizip/unzip.h>
#include "Options.h"
#include "Definitions.h"
#include "DebugEventThrower.h"
--- NEW FILE osmose.spec ---
%define pkgversion %(echo %version|sed s/\\\\\./-/g)
Name: osmose
Version: 0.8.2
Release: 3%{?dist}
Summary: A Sega Master System / Game Gear emulator
Group: Applications/Emulators
License: GPLv2+
URL:
http://bcz.emu-france.com/%{name}.htm
Source:
http://bcz.emu-france.com/%{name}/%{name}-%{pkgversion}-src.zip
# Andrea Musuruane
Patch0: %{name}-0.8.2-usesystemlibraries.patch
# Ian Chapman
Patch1: %{name}-0.8.2-newtimer.patch
Patch2: %{name}-0.8.2-fixppcaudio.patch
Patch3: %{name}-0.8.2-gcc43fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel
BuildRequires: minizip-devel
%description
Osmose is another Sega Master System / Gamegear emulator.
%prep
%setup -q -n Osmose
%patch0 -p1
%patch1 -p1
%ifarch ppc ppc64
%patch2 -p1
%endif
%patch3 -p1
# Fix end-of-line encoding
sed -i 's/\r//' *.txt *.{cpp,h} cpu/*.{cpp,h}
# Fix spurious executable permissions
chmod 644 cpu/*.{cpp,h}
%build
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
%install
rm -rf %{buildroot}
install -d -m 0755 %{buildroot}%{_bindir}
install -m 755 %{name} %{buildroot}%{_bindir}/%{name}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%doc changes.txt license.txt readme.txt
%changelog
* Sat Feb 02 2008 Andrea Musuruane <musuruan(a)gmail.com> - 0.8.2-3
- Added a patch by Ian Chapman to compile with gcc 4.3.
- Timer timer patch has been updated by Ian to compile with gcc 4.3.
* Wed Jan 30 2008 Andrea Musuruane <musuruan(a)gmail.com> - 0.8.2-2
- Improved macro usage.
- Corrected License tag to reflect statement in main.cpp.
- Added patches by Ian Chapman to make osmose work on ppc.
* Sat Jan 19 2008 Andrea Musuruane <musuruan(a)gmail.com> - 0.8.2-1
- First release for Dribble/RPM Fusion.
- Made a patch to use system libraries and not to strip binary file.
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/osmose/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 1 Jun 2008 12:19:01 -0000 1.1
+++ .cvsignore 19 Jul 2008 19:04:43 -0000 1.2
@@ -0,0 +1 @@
+osmose-0-8-2-src.zip
Index: sources
===================================================================
RCS file: /cvs/free/rpms/osmose/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 1 Jun 2008 12:19:01 -0000 1.1
+++ sources 19 Jul 2008 19:04:43 -0000 1.2
@@ -0,0 +1 @@
+f1b3ba02f1641eb88e15b16b0caabbe6 osmose-0-8-2-src.zip