From 6ac699ba9734464d22dfe64e64da5a9a6a73c9a6 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Fri, 22 Jul 2011 18:31:42 +0000 Subject: [PATCH] Added VisualBoy advance; a gameboy/gameboy color/gameboy advance emulator svn path=/nixpkgs/trunk/; revision=27904 --- .../emulators/VisualBoyAdvance/default.nix | 16 ++++++++++ pkgs/misc/emulators/VisualBoyAdvance/fix.diff | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 49 insertions(+) create mode 100644 pkgs/misc/emulators/VisualBoyAdvance/default.nix create mode 100644 pkgs/misc/emulators/VisualBoyAdvance/fix.diff diff --git a/pkgs/misc/emulators/VisualBoyAdvance/default.nix b/pkgs/misc/emulators/VisualBoyAdvance/default.nix new file mode 100644 index 000000000000..720cc2083c26 --- /dev/null +++ b/pkgs/misc/emulators/VisualBoyAdvance/default.nix @@ -0,0 +1,16 @@ +{stdenv, fetchurl, zlib, libpng, SDL, nasm}: + +stdenv.mkDerivation { + name = "VisualBoyAdvance-1.7.2"; + src = fetchurl { + url = mirror://sourceforge/vba/VisualBoyAdvance-src-1.7.2.tar.gz; + sha256 = "1dr9w5i296dyq2gbx7sijk6p375aqnwld2n6rwnbzm2g3a94y4gl"; + }; + patches = [ ./fix.diff ]; # patch to shut up lost of precision errors + preConfigure = '' + # Fix errors with invalid conversion from 'const char*' to 'char*' + sed -i -e "s|char \* p = strrchr|const char * p = strrchr|g" src/GBA.cpp + sed -i -e "s|char \* p = strrchr|const char * p = strrchr|g" src/Util.cpp + ''; + buildInputs = [ zlib libpng SDL ] ++ stdenv.lib.optional (stdenv.system == "i686-linux") nasm; +} diff --git a/pkgs/misc/emulators/VisualBoyAdvance/fix.diff b/pkgs/misc/emulators/VisualBoyAdvance/fix.diff new file mode 100644 index 000000000000..646db9c45e66 --- /dev/null +++ b/pkgs/misc/emulators/VisualBoyAdvance/fix.diff @@ -0,0 +1,31 @@ +diff -urN ../tmp-orig/visualboyadvance-1.7.2/src/sdl/debugger.cpp +./src/sdl/debugger.cpp +--- ../tmp-orig/visualboyadvance-1.7.2/src/sdl/debugger.cpp 2004-05-13 +16:13:14.000000000 +0200 ++++ ./src/sdl/debugger.cpp 2005-03-21 21:57:06.000000000 +0100 +@@ -950,9 +950,9 @@ + { + u32 address = 0; + if(mem >= (u32*)&workRAM[0] && mem <= (u32*)&workRAM[0x3ffff]) +- address = 0x2000000 + ((u32)mem - (u32)&workRAM[0]); ++ address = 0x2000000 + ((unsigned long)mem - (unsigned long)&workRAM[0]); + else +- address = 0x3000000 + ((u32)mem - (u32)&internalRAM[0]); ++ address = 0x3000000 + ((unsigned long)mem - (unsigned long)&internalRAM[0]); + + if(size == 2) + printf("Breakpoint (on write) address %08x old:%08x new:%08x\n", +diff -urN ../tmp-orig/visualboyadvance-1.7.2/src/prof/prof.cpp +./src/prof/prof.cpp +--- ../tmp-orig/visualboyadvance-1.7.2/src/prof/prof.cpp 2004-05-13 +16:31:58.000000000 +0200 ++++ ./src/prof/prof.cpp 2005-03-21 21:56:27.000000000 +0100 +@@ -266,7 +266,7 @@ + for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) { + if(profWrite8(fd, GMON_TAG_CG_ARC) || + profWrite32(fd, (u32)frompc) || +- profWrite32(fd, (u32)tos[toindex].selfpc) || ++ profWrite32(fd, (unsigned long)tos[toindex].selfpc) || + profWrite32(fd, tos[toindex].count)) { + systemMessage(0, "mcount: arc"); + fclose(fd); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d4f38f8c42f1..8aa78da2090f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8133,6 +8133,8 @@ let vice = callPackage ../misc/emulators/vice { }; + VisualBoyAdvance = callPackage ../misc/emulators/VisualBoyAdvance { }; + # Wine cannot be built in 64-bit; use a 32-bit build instead. wine = callPackage_i686 ../misc/emulators/wine { };