summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO32
-rw-r--r--.gitignore55
-rw-r--r--PKGBUILD91
-rwxr-xr-xhigan.install11
-rw-r--r--mercury.patch185
-rwxr-xr-xprofilebatch56
-rw-r--r--super-fx-hax.patch11
7 files changed, 441 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cd0a8ac8c753
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = higan-qq
+ pkgdesc = A Nintendo multi-system emulator with quequotion's customizations
+ pkgver = 094.8d4b3cfa
+ pkgrel = 1
+ url = http://byuu.org/higan/
+ install = higan.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ replaces = higan-qq-git
+ source = higan::git+https://github.com/quequotion/higan-qq.git
+ source = profilebatch
+ source = super-fx-hax.patch
+ source = mercury.patch
+ md5sums = SKIP
+ md5sums = 42cf726affe08829b13e843b8d8ae682
+ md5sums = 480577daf0602cd5eabac698a4a2e310
+ md5sums = 6ce8b7fef6432184d50124e26991a374
+
+pkgname = higan-qq
+ depends = openal
+ depends = libgl
+ optdepends = alsa
+ optdepends = pulseaudio
+ optdepends = sdl
+ provides = higan
+ provides = higan-qq
+ conflicts = higan
+ conflicts = bsnes
+
+pkgname = libananke
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..4f928f410811
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,55 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+*.xz
+
+# Archlinux Packaging #
+#######################
+*.tar
+*.tar.*
+*.zip
+*.tgz
+*.log
+*.log.*
+*.sig
+pkg/
+src/
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+*~
+
+# Particulars #
+###############
+higan/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2609f1a51fb4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,91 @@
+pkgbase=higan-qq
+pkgname=('higan-qq' 'libananke')
+pkgver=094.8d4b3cfa
+pkgrel=1
+pkgdesc="A Nintendo multi-system emulator with quequotion's customizations"
+arch=('i686' 'x86_64')
+url=http://byuu.org/higan/
+license=(GPL)
+replaces=('higan-qq-git')
+source=('higan::git+https://github.com/quequotion/higan-qq.git'
+ 'profilebatch'
+ 'super-fx-hax.patch'
+ 'mercury.patch')
+install=higan.install
+md5sums=('SKIP'
+ '42cf726affe08829b13e843b8d8ae682'
+ '480577daf0602cd5eabac698a4a2e310'
+ '6ce8b7fef6432184d50124e26991a374')
+
+_profile="accuracyfast"
+
+pkgver() {
+ cd "higan"
+ echo 094.$( git describe --always | sed 's#-#_#g;s#v##' )
+}
+
+prepare(){
+ cd "${srcdir}/higan"
+
+ #Check out a specific commit (rollback)
+ #git checkout 4e2eb23
+
+ #Local patches (testing before adding to git)
+ #Higan-mercury's inline spam (not useful with pgo?)
+ patch -Np1 < "${srcdir}/mercury.patch"
+
+ #Force Super FX2 Clock (contraversial benefit)
+ patch -Np2 < "${srcdir}/super-fx-hax.patch"
+
+ #Append user's CXXFLAGS and LDFLAGS
+ sed -i "\|^flags += -I. -O3 -fomit-frame-pointer| s|$| -std=gnu++11 $CXXFLAGS|" Makefile
+ sed -i "\|^link +=| s|$| $LDFLAGS|" Makefile
+}
+
+build(){
+ cd "${srcdir}/higan"
+
+# libananke
+ make \
+ compiler=g++ \
+ platform=linux \
+ -C ananke
+
+# higan
+ # Normal build
+ make \
+ compiler=g++ \
+ platform=linux \
+ target=higan \
+ profile=${_profile} \
+ name=higan-${_profile}
+
+ # Profile Guided Optimization build
+ #
+ # Build with profile generation
+ #make pgo=instrument compiler=g++ platform=linux target=higan profile=${_profile} name=higan-${_profile}
+ #
+ # Run all cores and SFC special chips (except the new (famicom variant) nSide systems (Playchoice 10, VS System))
+ #"${srcdir}/profilebatch" "out/higan-${_profile}" "/path/to/your/higan/library"
+ #
+ # Build with profile analysis
+ #make clean
+ #make pgo=optimize compiler=g++ platform=linux target=higan profile=${_profile} name=higan-${_profile}
+}
+
+package_libananke(){
+ cd "${srcdir}/higan"
+ #if [ ! -d ~/.config/ananke ]; then install -d ~/.config/ananke; fi
+ make DESTDIR=${pkgdir} prefix=/usr/lib -C ananke install
+}
+
+package_higan-qq(){
+ provides=(higan{,-qq})
+ conflicts=('higan' 'bsnes')
+ makedepend=('libao' 'git' 'gtksourceview2')
+ depends=('openal' 'libgl')
+ optdepends=('alsa' 'pulseaudio' 'sdl')
+ cd "${srcdir}/higan"
+ make DESTDIR=${pkgdir} prefix=/usr/ name=higan-${_profile} install
+}
+
diff --git a/higan.install b/higan.install
new file mode 100755
index 000000000000..737f345f5cec
--- /dev/null
+++ b/higan.install
@@ -0,0 +1,11 @@
+post_install() {
+ echo "==> Please copy the config files in /usr/share/higan to ~/.config/higan"
+ echo "==> Higan needs these files to run correctly."
+ echo "==> Create a config directory for ananke in ~/.config/ananke"
+}
+
+post_upgrade() {
+ echo "==> Please copy the config files in /usr/share/higan to ~/.config/higan"
+ echo "==> Higan needs these files to run correctly."
+ echo "==> Create a config directory for ananke in ~/.config/ananke"
+}
diff --git a/mercury.patch b/mercury.patch
new file mode 100644
index 000000000000..933b548a2f8d
--- /dev/null
+++ b/mercury.patch
@@ -0,0 +1,185 @@
+diff -ru higan_v094-source/sfc/cpu/timing/timing.cpp bsneshle094/sfc/cpu/timing/timing.cpp
+--- higan_v094-source/sfc/cpu/timing/timing.cpp 2010-12-26 16:16:47.000000000 +0100
++++ bsneshle094/sfc/cpu/timing/timing.cpp 2014-05-26 23:52:03.147625704 +0200
+@@ -8,6 +8,7 @@ unsigned CPU::dma_counter() {
+ }
+
+ void CPU::add_clocks(unsigned clocks) {
++again:
+ status.irq_lock = false;
+ unsigned ticks = clocks >> 1;
+ while(ticks--) {
+@@ -25,7 +26,8 @@ void CPU::add_clocks(unsigned clocks) {
+
+ if(status.dram_refreshed == false && hcounter() >= status.dram_refresh_position) {
+ status.dram_refreshed = true;
+- add_clocks(40);
++ clocks = 40;
++ goto again;
+ }
+
+ #if defined(DEBUGGER)
+diff -ru higan_v094-source/emulator/emulator.hpp bsneshle094/emulator/emulator.hpp
+--- higan_v094-source/emulator/emulator.hpp 2014-01-20 07:36:22.000000000 +0100
++++ bsneshle094/emulator/emulator.hpp 2014-04-26 16:20:16.498065832 +0200
+@@ -143,7 +143,7 @@
+ typedef uint30_t uint30;
+ typedef uint31_t uint31;
+ typedef uint32_t uint32;
+-typedef uint_t<33> uint33;
++typedef nall::uint_t<33> uint33;
+ typedef uint64_t uint64;
+
+ typedef varuint_t<unsigned> varuint;
+diff -ru higan_v094-source/sfc/cpu/timing/timing.hpp bsneshle094/sfc/cpu/timing/timing.hpp
+--- higan_v094-source/sfc/cpu/timing/timing.hpp 2010-12-26 16:16:47.000000000 +0100
++++ bsneshle094/sfc/cpu/timing/timing.hpp 2014-05-26 23:52:03.147625704 +0200
+@@ -1,7 +1,7 @@
+ //timing.cpp
+ unsigned dma_counter();
+
+-void add_clocks(unsigned clocks);
++alwaysinline void add_clocks(unsigned clocks);
+ void scanline();
+
+ alwaysinline void alu_edge();
+diff -ru higan_v094-source/sfc/ppu/background/background.hpp bsneshle094/sfc/ppu/background/background.hpp
+--- higan_v094-source/sfc/ppu/background/background.hpp 2013-05-05 09:31:28.000000000 +0200
++++ bsneshle094/sfc/ppu/background/background.hpp 2014-05-03 23:18:53.731330831 +0200
+@@ -60,21 +60,21 @@
+ uint8 data[8];
+ };
+
+- void frame();
+- void scanline();
+- void begin();
+- void run(bool screen);
+- void reset();
++ inline void frame();
++ inline void scanline();
++ inline void begin();
++ inline void run(bool screen);
++ inline void reset();
+
+- void get_tile();
+- unsigned get_tile_color();
+- unsigned get_tile(unsigned x, unsigned y);
+- signed clip(signed n);
+- void begin_mode7();
+- void run_mode7();
++ inline void get_tile();
++ inline unsigned get_tile_color();
++ inline unsigned get_tile(unsigned x, unsigned y);
++ inline signed clip(signed n);
++ inline void begin_mode7();
++ inline void run_mode7();
+
+- void serialize(serializer&);
+- Background(PPU& self, unsigned id);
++ inline void serialize(serializer&);
++ inline Background(PPU& self, unsigned id);
+
+ PPU& self;
+ friend class PPU;
+diff -ru higan_v094-source/sfc/ppu/screen/screen.hpp bsneshle094/sfc/ppu/screen/screen.hpp
+--- higan_v094-source/sfc/ppu/screen/screen.hpp 2013-05-05 09:36:42.000000000 +0200
++++ bsneshle094/sfc/ppu/screen/screen.hpp 2014-05-03 23:19:20.659331336 +0200
+@@ -29,19 +29,19 @@
+ bool color_halve;
+ } math;
+
+- void scanline();
+- void run();
+- void reset();
++ inline void scanline();
++ inline void run();
++ inline void reset();
+
+- uint16 get_pixel_sub(bool hires);
+- uint16 get_pixel_main();
+- uint16 addsub(unsigned x, unsigned y);
+- uint16 get_color(unsigned palette);
+- uint16 get_direct_color(unsigned palette, unsigned tile);
+- uint16 fixed_color() const;
++ inline uint16 get_pixel_sub(bool hires);
++ inline uint16 get_pixel_main();
++ inline uint16 addsub(unsigned x, unsigned y);
++ inline uint16 get_color(unsigned palette);
++ inline uint16 get_direct_color(unsigned palette, unsigned tile);
++ inline uint16 fixed_color() const;
+
+- void serialize(serializer&);
+- Screen(PPU& self);
++ inline void serialize(serializer&);
++ inline Screen(PPU& self);
+
+ PPU& self;
+ friend class PPU;
+diff -ru higan_v094-source/sfc/ppu/sprite/sprite.hpp bsneshle094/sfc/ppu/sprite/sprite.hpp
+--- higan_v094-source/sfc/ppu/sprite/sprite.hpp 2013-05-05 09:37:44.000000000 +0200
++++ bsneshle094/sfc/ppu/sprite/sprite.hpp 2014-05-03 23:18:08.691329985 +0200
+@@ -60,22 +60,22 @@
+ } output;
+
+ //list.cpp
+- void update(unsigned addr, uint8 data);
+- void synchronize();
++ inline void update(unsigned addr, uint8 data);
++ inline void synchronize();
+
+ //sprite.cpp
+- void address_reset();
+- void set_first_sprite();
+- void frame();
+- void scanline();
+- void run();
+- void tilefetch();
+- void reset();
++ inline void address_reset();
++ inline void set_first_sprite();
++ inline void frame();
++ inline void scanline();
++ inline void run();
++ inline void tilefetch();
++ inline void reset();
+
+- bool on_scanline(SpriteItem&);
++ inline bool on_scanline(SpriteItem&);
+
+- void serialize(serializer&);
+- Sprite(PPU& self);
++ inline void serialize(serializer&);
++ inline Sprite(PPU& self);
+
+ PPU& self;
+ friend class PPU;
+diff -ru higan_v094-source/sfc/ppu/window/window.hpp bsneshle094/sfc/ppu/window/window.hpp
+--- higan_v094-source/sfc/ppu/window/window.hpp 2013-05-05 09:40:42.000000000 +0200
++++ bsneshle094/sfc/ppu/window/window.hpp 2014-05-03 23:19:37.315331649 +0200
+@@ -69,19 +69,19 @@
+ bool two;
+ };
+
+- void scanline();
+- void run();
+- void reset();
++ inline void scanline();
++ inline void run();
++ inline void reset();
+
+- void test(
++ inline void test(
+ bool& main, bool& sub,
+ bool one_enable, bool one_invert,
+ bool two_enable, bool two_invert,
+ uint8 mask, bool main_enable, bool sub_enable
+ );
+
+- void serialize(serializer&);
+- Window(PPU& self);
++ inline void serialize(serializer&);
++ inline Window(PPU& self);
+
+ PPU& self;
+ friend class PPU;
+
diff --git a/profilebatch b/profilebatch
new file mode 100755
index 000000000000..12640efcceac
--- /dev/null
+++ b/profilebatch
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+higan=$1
+romdir=$2
+
+"${higan}" "${romdir}/Super Famicom/SNES Test Program (U) (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Star Fox (U) (V1.2) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Mega Man X 2 (U) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Pilotwings (U) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Soukou Kihei Votoms - The Battling Road (J) (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Ace wo Nerae! (J) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Ballz 3D (U) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Dungeon Master (U) (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/SD Gundam GX (J) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Top Gear 3000 (U) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Metal Combat - Falcon's Revenge (NA) (1.0).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Super Mario RPG - Legend of the Seven Stars (NA) (1.0).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Star Ocean (J) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Daikaijuu Monogatari 2 (J) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Far East of Eden - Tengai Makyou Zero - Shounen Jump no Shou (JP) (1.0).sfc"
+
+"${higan}" "${romdir}/Super Famicom/F1 ROC II - Race of Champions (U) (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Hayazashi Nidan Morita Shougi (J) (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Hayazashi Nidan Morita Shougi 2 (J) (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Super Mario World 2 - Yoshi's Island (U) (M3) (V1.0) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/BS-X - Sore wa Namae o Nusumareta Machi no Monogatari (JP) (1.1).en.sfc"
+
+"${higan}" "${romdir}/Super Famicom/Super Game Boy (JU) (V1.1) [!] (!).sfc"
+
+"${higan}" "${romdir}/Super Famicom/Sufami Turbo (JP) (1.0).sfc"
+
+"${higan}" "${romdir}/Game Boy/Namco Gallery Vol.3 (J) [S] (!).gb"
+
+"${higan}" "${romdir}/Game Boy Advance/Zelda - the Minish Cap (!).gba"
+
+"${higan}" "${romdir}/Game Boy Color/Naminori Yarou! (J) [C][!] (!).gbc"
+
+"${higan}" "${romdir}/Famicom/Rolling Thunder (!).fc"
diff --git a/super-fx-hax.patch b/super-fx-hax.patch
new file mode 100644
index 000000000000..0bb7227a3f51
--- /dev/null
+++ b/super-fx-hax.patch
@@ -0,0 +1,11 @@
+--- src/higan/sfc/chip/superfx/superfx.hpp~ 2015-05-09 22:37:08.287693019 +0900
++++ src/higan/sfc/chip/superfx/superfx.hpp 2015-05-09 23:08:25.110062072 +0900
+@@ -19,7 +19,7 @@
+ void serialize(serializer&);
+
+ privileged:
+- unsigned clockmode = 0; //0 = selectable, 1 = force 10.74mhz, 2 = force 21.48mhz
++ unsigned clockmode = 2; //0 = selectable, 1 = force 10.74mhz, 2 = force 21.48mhz
+ unsigned instruction_counter;
+ };
+