Author: belegdol
Update of /cvs/free/rpms/bsnes/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv30764
Modified Files:
.cvsignore bsnes.spec sources
Added Files:
bsnes-0.079-crashfix.patch bsnes-0.079-gcc46.patch
bsnes-0.079-nocheats.patch
Removed Files:
bsnes-0.064-systemlibs.patch bsnes-0.068-newppcelf.patch
bsnes-0.068-noppcelfppc64.patch
Log Message:
* Tue Jun 21 2011 Julian Sikorski <belegdol(a)fedoraproject.org> - 0.079-1
- Updated to 0.079
- Dropped subpackages, they are too small to be worth it
- Updated the Fedora readme
- Added patches by Themaister
bsnes-0.079-crashfix.patch:
amd64.c | 130 +++++++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 84 insertions(+), 46 deletions(-)
--- NEW FILE bsnes-0.079-crashfix.patch ---
diff -up bsnes_v079-source/bsnes/libco/amd64.c.crashfix
bsnes_v079-source/bsnes/libco/amd64.c
--- bsnes_v079-source/bsnes/libco/amd64.c.crashfix 2011-06-04 05:55:17.000000000 +0200
+++ bsnes_v079-source/bsnes/libco/amd64.c 2011-06-21 00:09:44.398210519 +0200
@@ -13,52 +13,94 @@
extern "C" {
#endif
+// ASM co_swap.
+void co_swap(cothread_t new_active, cothread_t old_active);
+
static thread_local long long co_active_buffer[64];
static thread_local cothread_t co_active_handle = 0;
-static void (*co_swap)(cothread_t, cothread_t) = 0;
#ifdef _WIN32
- //ABI: Win64
- static unsigned char co_swap_function[] = {
- 0x48, 0x89, 0x22, 0x48, 0x8B, 0x21, 0x58, 0x48, 0x89, 0x6A, 0x08, 0x48, 0x89, 0x72,
0x10, 0x48,
- 0x89, 0x7A, 0x18, 0x48, 0x89, 0x5A, 0x20, 0x4C, 0x89, 0x62, 0x28, 0x4C, 0x89, 0x6A,
0x30, 0x4C,
- 0x89, 0x72, 0x38, 0x4C, 0x89, 0x7A, 0x40, 0x48, 0x81, 0xC2, 0x80, 0x00, 0x00, 0x00,
0x48, 0x83,
- 0xE2, 0xF0, 0x0F, 0x29, 0x32, 0x0F, 0x29, 0x7A, 0x10, 0x44, 0x0F, 0x29, 0x42, 0x20,
0x44, 0x0F,
- 0x29, 0x4A, 0x30, 0x44, 0x0F, 0x29, 0x52, 0x40, 0x44, 0x0F, 0x29, 0x5A, 0x50, 0x44,
0x0F, 0x29,
- 0x62, 0x60, 0x44, 0x0F, 0x29, 0x6A, 0x70, 0x44, 0x0F, 0x29, 0xB2, 0x80, 0x00, 0x00,
0x00, 0x44,
- 0x0F, 0x29, 0xBA, 0x90, 0x00, 0x00, 0x00, 0x48, 0x8B, 0x69, 0x08, 0x48, 0x8B, 0x71,
0x10, 0x48,
- 0x8B, 0x79, 0x18, 0x48, 0x8B, 0x59, 0x20, 0x4C, 0x8B, 0x61, 0x28, 0x4C, 0x8B, 0x69,
0x30, 0x4C,
- 0x8B, 0x71, 0x38, 0x4C, 0x8B, 0x79, 0x40, 0x48, 0x81, 0xC1, 0x80, 0x00, 0x00, 0x00,
0x48, 0x83,
- 0xE1, 0xF0, 0x0F, 0x29, 0x31, 0x0F, 0x29, 0x79, 0x10, 0x44, 0x0F, 0x29, 0x41, 0x20,
0x44, 0x0F,
- 0x29, 0x49, 0x30, 0x44, 0x0F, 0x29, 0x51, 0x40, 0x44, 0x0F, 0x29, 0x59, 0x50, 0x44,
0x0F, 0x29,
- 0x61, 0x60, 0x44, 0x0F, 0x29, 0x69, 0x70, 0x44, 0x0F, 0x29, 0xB1, 0x80, 0x00, 0x00,
0x00, 0x44,
- 0x0F, 0x29, 0xB9, 0x90, 0x00, 0x00, 0x00, 0xFF, 0xE0,
- };
-
- #include <windows.h>
-
- void co_init() {
- DWORD old_privileges;
- VirtualProtect(co_swap_function, sizeof co_swap_function, PAGE_EXECUTE_READWRITE,
&old_privileges);
- }
+asm (
+ ".text\n"
+ ".globl co_swap\n"
+ "co_swap:\n"
+
+ "movq %rsp, (%rdx) # Save stack pointer and pop old back\n"
+ "movq (%rcx), %rsp\n"
+
+ "popq %rax # Pop saved PC to %rax\n"
+
+ "movq %rbp, 0x8(%rdx) # Save non-volatile registers\n"
+ "movq %rsi, 0x10(%rdx)\n"
+ "movq %rdi, 0x18(%rdx)\n"
+ "movq %rbx, 0x20(%rdx)\n"
+ "movq %r12, 0x28(%rdx)\n"
+ "movq %r13, 0x30(%rdx)\n"
+ "movq %r14, 0x38(%rdx)\n"
+ "movq %r15, 0x40(%rdx)\n"
+
+ "addq $0x80, %rdx\n"
+ "andq $0xfffffffffffffff0, %rdx # Align buffer to 16 bytes (SSE).\n"
+ "movaps %xmm6, (%rdx) # Also save non-volatile vector registers.\n"
+ "movaps %xmm7, 0x10(%rdx)\n"
+ "movaps %xmm8, 0x20(%rdx)\n"
+ "movaps %xmm9, 0x30(%rdx)\n"
+ "movaps %xmm10, 0x40(%rdx)\n"
+ "movaps %xmm11, 0x50(%rdx)\n"
+ "movaps %xmm12, 0x60(%rdx)\n"
+ "movaps %xmm13, 0x70(%rdx)\n"
+ "movaps %xmm14, 0x80(%rdx)\n"
+ "movaps %xmm15, 0x90(%rdx)\n"
+
+ "movq 0x8(%rcx), %rbp # Pop back our saved registers and vector
registers.\n"
+ "movq 0x10(%rcx), %rsi\n"
+ "movq 0x18(%rcx), %rdi\n"
+ "movq 0x20(%rcx), %rbx\n"
+ "movq 0x28(%rcx), %r12\n"
+ "movq 0x30(%rcx), %r13\n"
+ "movq 0x38(%rcx), %r14\n"
+ "movq 0x40(%rcx), %r15\n"
+
+ "addq $0x80, %rcx\n"
+ "andq $0xfffffffffffffff0, %rcx\n"
+ "movaps %xmm6, (%rcx)\n"
+ "movaps %xmm7, 0x10(%rcx)\n"
+ "movaps %xmm8, 0x20(%rcx)\n"
+ "movaps %xmm9, 0x30(%rcx)\n"
+ "movaps %xmm10, 0x40(%rcx)\n"
+ "movaps %xmm11, 0x50(%rcx)\n"
+ "movaps %xmm12, 0x60(%rcx)\n"
+ "movaps %xmm13, 0x70(%rcx)\n"
+ "movaps %xmm14, 0x80(%rcx)\n"
+ "movaps %xmm15, 0x90(%rcx)\n"
+ "jmpq *%rax # Jump back to old saved PC.\n"
+);
#else
- //ABI: SystemV
- static unsigned char co_swap_function[] = {
- 0x48, 0x89, 0x26, 0x48, 0x8B, 0x27, 0x58, 0x48, 0x89, 0x6E, 0x08, 0x48, 0x89, 0x5E,
0x10, 0x4C,
- 0x89, 0x66, 0x18, 0x4C, 0x89, 0x6E, 0x20, 0x4C, 0x89, 0x76, 0x28, 0x4C, 0x89, 0x7E,
0x30, 0x48,
- 0x8B, 0x6F, 0x08, 0x48, 0x8B, 0x5F, 0x10, 0x4C, 0x8B, 0x67, 0x18, 0x4C, 0x8B, 0x6F,
0x20, 0x4C,
- 0x8B, 0x77, 0x28, 0x4C, 0x8B, 0x7F, 0x30, 0xFF, 0xE0,
- };
-
- #include <unistd.h>
- #include <sys/mman.h>
-
- void co_init() {
- unsigned long long addr = (unsigned long long)co_swap_function;
- unsigned long long base = addr - (addr % sysconf(_SC_PAGESIZE));
- unsigned long long size = (addr - base) + sizeof co_swap_function;
- mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC);
- }
+asm (
+ ".text\n"
+ ".globl co_swap\n"
+ ".globl _co_swap\n"
+ "_co_swap:\n"
+ "co_swap:\n"
+ "movq %rsp, (%rsi) # Save stack pointer, and pop the old one back.\n"
+ "movq (%rdi), %rsp\n"
+ "popq %rax\n"
+
+ "movq %rbp, 0x8(%rsi) # Save our non-volatile registers to buffer.\n"
+ "movq %rbx, 0x10(%rsi)\n"
+ "movq %r12, 0x18(%rsi)\n"
+ "movq %r13, 0x20(%rsi)\n"
+ "movq %r14, 0x28(%rsi)\n"
+ "movq %r15, 0x30(%rsi)\n"
+
+ "movq 0x8(%rdi), %rbp # Pop back our saved registers.\n"
+ "movq 0x10(%rdi), %rbx\n"
+ "movq 0x18(%rdi), %r12\n"
+ "movq 0x20(%rdi), %r13\n"
+ "movq 0x28(%rdi), %r14\n"
+ "movq 0x30(%rdi), %r15\n"
+ "jmpq *%rax # Jump back to saved PC.\n"
+);
#endif
static void crash() {
@@ -72,15 +114,11 @@ cothread_t co_active() {
cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
cothread_t handle;
- if(!co_swap) {
- co_init();
- co_swap = (void (*)(cothread_t, cothread_t))co_swap_function;
- }
if(!co_active_handle) co_active_handle = &co_active_buffer;
size += 512; /* allocate additional space for storage */
size &= ~15; /* align stack to 16-byte boundary */
- if(handle = (cothread_t)malloc(size)) {
+ if((handle = (cothread_t)malloc(size))) {
long long *p = (long long*)((char*)handle + size); /* seek to top of stack */
*--p = (long long)crash; /* crash if entrypoint returns */
*--p = (long long)entrypoint; /* start of function */
bsnes-0.079-gcc46.patch:
snes/chip/icd2/interface/interface.cpp | 2 +-
ui/input/input.cpp | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
--- NEW FILE bsnes-0.079-gcc46.patch ---
diff -up bsnes_v079-source/bsnes/snes/chip/icd2/interface/interface.cpp.gcc46
bsnes_v079-source/bsnes/snes/chip/icd2/interface/interface.cpp
--- bsnes_v079-source/bsnes/snes/chip/icd2/interface/interface.cpp.gcc46 2011-05-08
13:14:20.000000000 +0200
+++ bsnes_v079-source/bsnes/snes/chip/icd2/interface/interface.cpp 2011-06-21
00:02:22.972853738 +0200
@@ -101,7 +101,7 @@ bool ICD2::input_poll(unsigned id) {
case 3: data = ~r6007; break;
}
- switch(id) {
+ switch((GameBoy::Input)id) {
case GameBoy::Input::Start: return data & 0x80;
case GameBoy::Input::Select: return data & 0x40;
case GameBoy::Input::B: return data & 0x20;
diff -up bsnes_v079-source/bsnes/ui/input/input.cpp.gcc46
bsnes_v079-source/bsnes/ui/input/input.cpp
--- bsnes_v079-source/bsnes/ui/input/input.cpp.gcc46 2011-03-24 19:33:58.000000000 +0100
+++ bsnes_v079-source/bsnes/ui/input/input.cpp 2011-06-21 00:02:22.971853731 +0200
@@ -82,7 +82,7 @@ void InputMapper::Gamepad::create(const
}
int16_t InputMapper::Gamepad::poll(unsigned id) {
- switch(id) {
+ switch((SNES::Input::JoypadID)id) {
case SNES::Input::JoypadID::Up: return up.poll();
case SNES::Input::JoypadID::Down: return down.poll() & !up.poll();
case SNES::Input::JoypadID::Left: return left.poll();
@@ -118,7 +118,7 @@ void InputMapper::Mouse::create(const ch
}
int16_t InputMapper::Mouse::poll(unsigned id) {
- switch(id) {
+ switch((SNES::Input::MouseID)id) {
case SNES::Input::MouseID::X: return x.poll();
case SNES::Input::MouseID::Y: return y.poll();
case SNES::Input::MouseID::Left: return left.poll();
@@ -150,7 +150,7 @@ void InputMapper::SuperScope::create(con
}
int16_t InputMapper::SuperScope::poll(unsigned id) {
- switch(id) {
+ switch((SNES::Input::SuperScopeID)id) {
case SNES::Input::SuperScopeID::X: return x.poll();
case SNES::Input::SuperScopeID::Y: return y.poll();
case SNES::Input::SuperScopeID::Trigger: return trigger.poll();
@@ -182,7 +182,7 @@ void InputMapper::Justifier::create(cons
}
int16_t InputMapper::Justifier::poll(unsigned id) {
- switch(id) {
+ switch((SNES::Input::JustifierID)id) {
case SNES::Input::JustifierID::X: return x.poll();
case SNES::Input::JustifierID::Y: return y.poll();
case SNES::Input::JustifierID::Trigger: return trigger.poll();
bsnes-0.079-nocheats.patch:
Makefile | 3 ---
1 file changed, 3 deletions(-)
--- NEW FILE bsnes-0.079-nocheats.patch ---
diff -up bsnes_v079-source/bsnes/ui/Makefile.nocheats bsnes_v079-source/bsnes/ui/Makefile
--- bsnes_v079-source/bsnes/ui/Makefile.nocheats 2011-03-15 00:58:22.000000000 +0100
+++ bsnes_v079-source/bsnes/ui/Makefile 2011-06-08 00:09:34.125573793 +0200
@@ -96,9 +96,6 @@ ifeq ($(platform),x)
endif
install -D -m 644 data/bsnes.png $(DESTDIR)$(prefix)/share/pixmaps/bsnes.png
install -D -m 644 data/bsnes.desktop
$(DESTDIR)$(prefix)/share/applications/bsnes.desktop
- mkdir -p ~/.config/bsnes
- cp data/cheats.xml ~/.config/bsnes/cheats.xml
- chmod 777 ~/.config/bsnes ~/.config/bsnes/cheats.xml
uninstall:
ifeq ($(platform),x)
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/bsnes/devel/.cvsignore,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- .cvsignore 21 Nov 2010 19:41:21 -0000 1.29
+++ .cvsignore 20 Jun 2011 22:50:43 -0000 1.30
@@ -1 +1 @@
-bsnes_v072.tar.bz2
+bsnes_v079-source.tar.bz2
Index: bsnes.spec
===================================================================
RCS file: /cvs/free/rpms/bsnes/devel/bsnes.spec,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- bsnes.spec 21 Nov 2010 19:41:21 -0000 1.40
+++ bsnes.spec 20 Jun 2011 22:50:44 -0000 1.41
@@ -1,4 +1,4 @@
-%global vernumber 072
+%global vernumber 079
Name: bsnes
Version: 0.%{vernumber}
@@ -8,12 +8,11 @@
Group: Applications/Emulators
License: GPLv2
URL:
http://byuu.org/bsnes/
-Source0:
http://bsnes.googlecode.com/files/%{name}_v%{vernumber}.tar.bz2
+Source0:
http://bsnes.googlecode.com/files/%{name}_v%{vernumber}-source.tar.bz2
Source2: README.bsnes
-Patch0: bsnes-0.072-nocheats.patch
-Patch1: bsnes-0.068-newppcelf.patch
-Patch2: bsnes-0.068-noppcelfppc64.patch
-Patch3: bsnes-0.064-systemlibs.patch
+Patch0: bsnes-0.079-gcc46.patch
+Patch1: bsnes-0.079-crashfix.patch
+Patch2: bsnes-0.079-nocheats.
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#bsnes does not use system snes_ntsc because the modified video processing
@@ -28,6 +27,9 @@
BuildRequires: qt-devel
Obsoletes: %{name}-pixelshaders < 0.064
+Obsoletes: %{name}-snesfilter < 0.079
+Obsoletes: %{name}-snesreader < 0.079
+Obsoletes: %{name}-supergameboy < 0.079
%description
bsnes is an emulator that began development on 2004-10-14. The purpose of the
@@ -37,77 +39,45 @@
includes speed and game-specific hacks for compatibility. As a result, the
minimum system requirements for bsnes are quite high.
-%package snesfilter
-Summary: Visual filters for %{name}
-Group: Applications/Emulators
-Requires: %{name} = %{version}-%{release}
-
-%description snesfilter
-This subpackage contains various video filters for bsnes.
-
-%package snesreader
-Summary: Compressed ROM images support for %{name}
-Group: Applications/Emulators
-Requires: %{name} = %{version}-%{release}
-
-%description snesreader
-This subpackage enables support for various compressed images, like .zip, .7z,
-.rar and others.
-
-%package supergameboy
-Summary: Super Game Boy emulation for %{name}
-Group: Applications/Emulators
-Requires: %{name} = %{version}-%{release}
-
-%description supergameboy
-This package includes gambatte-based Super Game Boy emulation.
-
%prep
-%setup -qc
-%patch0 -p1 -b .nocheats
-%patch1 -p1 -b .newppcelf
-%patch2 -p1 -b .noppcelfppc64
-%patch3 -p1 -b .systemlibs
+%setup -q -n %{name}_v%{vernumber}-source
+%patch0 -p1 -b .gcc46
+%patch1 -p1 -b .crashfix
+%patch2 -p1 -b .nocheats
+
#fix permissions
find . -type f -not -name \*.sh -exec chmod 644 {} \;
#use system optflags
-for sourcedir in snesfilter snesreader bsnes supergameboy
-do
- pushd $sourcedir
- sed -i "s#-O3#$RPM_OPT_FLAGS#" Makefile
- popd
-done
+sed -i "s/-O3/$RPM_OPT_FLAGS/" bsnes/Makefile
+sed -i "s/-O3/$RPM_OPT_FLAGS -fPIC/" snesfilter/Makefile
+sed -i "s/-O3/$RPM_OPT_FLAGS/" snespurify/cc-qt.sh
#don't strip the binaries prematurely
-for sourcedir in snesfilter snesreader bsnes supergameboy
-do
- pushd $sourcedir
- sed -i "s/link += -s/link +=/" Makefile
- popd
-done
+sed -i "s/link += -s/link +=/" bsnes/Makefile
+sed -i "s/link := -s/link :=/" snesfilter/Makefile
+sed -i "s/-s //" snespurify/cc-qt.sh
+
+#use the proper compiler and moc commands
+sed -i "s/g++-4.5/g++/" snespurify/cc-qt.sh
+sed -i "s/moc/moc-qt4/" snespurify/cc-qt.sh
#install fedora-specific readme
install -pm 644 %{SOURCE2} README.Fedora
-#pulseaudio on fedora 11 is too old
-%if 0%{?fedora} < 12
-sed -i "s(a)audio.pulseaudio @@" bsnes/ui_qt/Makefile
-%endif
-
%build
-for sourcedir in snesfilter snesreader supergameboy
-do
- pushd $sourcedir
- make %{?_smp_mflags} moc=moc-qt4 compiler=gcc
- popd
-done
-
pushd bsnes
-make %{?_smp_mflags} platform=x compiler=gcc moc=moc-qt4 profile=compatibility ui=ui-qt
+make %{?_smp_mflags} compiler=gcc
+popd
+pushd snesfilter
+make %{?_smp_mflags} compiler=gcc
+popd
+pushd snespurify
+./cc-qt.sh
+popd
%install
@@ -118,61 +88,36 @@
--delete-original --dir $RPM_BUILD_ROOT%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/bsnes.desktop
popd
-install -d $RPM_BUILD_ROOT%{_libdir}
install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
-for sourcedir in snesfilter snesreader supergameboy
-do
- pushd $sourcedir
- install -pm 755 lib$sourcedir.so $RPM_BUILD_ROOT%{_libdir}/lib$sourcedir.so
- popd
-done
-
+install -pm 644 bsnes/data/cheats.xml $RPM_BUILD_ROOT%{_datadir}/%{name}
+install -d $RPM_BUILD_ROOT%{_libexecdir}/%{name}/filters
+install -pm 755 snesfilter/out/*.filter $RPM_BUILD_ROOT%{_libexecdir}/%{name}/filters
+install -pm 755 snespurify/snespurify-qt $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/shaders
+install -pm 644 snesshader/*.shader $RPM_BUILD_ROOT%{_datadir}/%{name}/shaders
%clean
rm -rf $RPM_BUILD_ROOT
-%post snesfilter -p /sbin/ldconfig
-
-
-%postun snesfilter -p /sbin/ldconfig
-
-
-%if %{with snesreader}
-%post snesreader -p /sbin/ldconfig
-
-
-%postun snesreader -p /sbin/ldconfig
-%endif
-
-
-%post supergameboy -p /sbin/ldconfig
-
-
-%postun supergameboy -p /sbin/ldconfig
-
-
%files
%defattr(-,root,root,-)
-%doc README.Fedora bsnes/ui-qt/data/*.html
+%doc README.Fedora
%{_bindir}/bsnes
+%{_bindir}/snespurify-qt
+%{_libexecdir}/bsnes
+%{_datadir}/bsnes
%{_datadir}/pixmaps/bsnes.png
%{_datadir}/applications/rpmfusion-bsnes.desktop
-%files snesfilter
-%defattr(-,root,root,-)
-%{_libdir}/libsnesfilter.so
-
-%files snesreader
-%defattr(-,root,root,-)
-%{_libdir}/libsnesreader.so
-
-%files supergameboy
-%defattr(-,root,root,-)
-%{_libdir}/libsupergameboy.so
-
%changelog
+* Tue Jun 21 2011 Julian Sikorski <belegdol(a)fedoraproject.org> - 0.079-1
+- Updated to 0.079
+- Dropped subpackages, they are too small to be worth it
+- Updated the Fedora readme
+- Added patches by Themaister
+
* Sun Nov 21 2010 Julian Sikorski <belegdol(a)fedoraproject.org> - 0.072-1
- Updated to 0.072
- Dropped gconf patch, added cheats one
Index: sources
===================================================================
RCS file: /cvs/free/rpms/bsnes/devel/sources,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- sources 21 Nov 2010 19:41:21 -0000 1.29
+++ sources 20 Jun 2011 22:50:44 -0000 1.30
@@ -1 +1 @@
-dcbd0f2a88682fb25d409a8276576983 bsnes_v072.tar.bz2
+22513f713e29824a85a0fe193298f9f2 bsnes_v079-source.tar.bz2
--- bsnes-0.064-systemlibs.patch DELETED ---
--- bsnes-0.068-newppcelf.patch DELETED ---
--- bsnes-0.068-noppcelfppc64.patch DELETED ---