summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNascher2015-08-12 16:22:45 +0000
committerNascher2015-08-12 16:22:45 +0000
commit9f15a739336c7114e0b13db2439ad9c3b029a104 (patch)
tree37902a9946629d6e1242781420193a254831fa49
downloadaur-9f15a739336c7114e0b13db2439ad9c3b029a104.tar.gz
Initial import
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD65
-rw-r--r--configure-gamepad-fix.patch144
-rw-r--r--doukutsu50
-rw-r--r--doukutsu-config.desktop10
-rw-r--r--doukutsu.desktop10
-rw-r--r--doukutsu.pngbin0 -> 411 bytes
7 files changed, 311 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7489d21535d5
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = doukutsu
+ pkgdesc = Japanese freeware PC side-scrolling platformer game (aka Cave Story)
+ pkgver = 1.2
+ pkgrel = 6
+ url = http://www.cavestory.org/
+ arch = i686
+ arch = x86_64
+ license = custom:freeware
+ depends = bash
+ depends = sdl
+ depends = fltk
+ depends = libxinerama
+ depends = libxft
+ source = http://www.cavestory.org/downloads/linuxdoukutsu-1.01.tar.bz2
+ source = http://www.cavestory.org/downloads/linuxDoukutsu-1.2.zip
+ source = http://www.cavestory.org/downloads/DoConfigure-r2.zip
+ source = configure-gamepad-fix.patch
+ source = doukutsu.desktop
+ source = doukutsu-config.desktop
+ source = doukutsu.png
+ source = doukutsu
+ md5sums = ec08da7c45419bc7740b8149ec7340cf
+ md5sums = e73d7330fba3cc5c15f0eeb239df586f
+ md5sums = 9f5e96d5ff9671691b7c8a41f8fa5880
+ md5sums = d4f9cdcd06058177671bd741b5bf5fa4
+ md5sums = d2633fb77949eb404f3199191e328bf3
+ md5sums = ca872e3276959cb523f57f0785c1a034
+ md5sums = 5262f9ff9bc528c790bf424016e6305f
+ md5sums = 4407e1feab85bd6ea5f18d5e7d91a747
+
+pkgname = doukutsu
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..05fa97a06c79
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer: Nascher <kevin at nascher.org>
+# Contributor: Anton Larionov <diffident dot cat at gmail dot com>
+# Contributor: Victor Feight <vrfeight3 at gmail dot com>
+# Contributor: Frozen Fox <frozenfoxz at gmail dot com>
+
+pkgname=doukutsu
+pkgver=1.2
+pkgrel=6
+pkgdesc='Japanese freeware PC side-scrolling platformer game (aka Cave Story)'
+url='http://www.cavestory.org/'
+arch=('i686' 'x86_64')
+license=('custom:freeware')
+depends=('bash' 'sdl' 'fltk' 'libxinerama' 'libxft')
+
+source=('http://www.cavestory.org/downloads/linuxdoukutsu-1.01.tar.bz2'
+ 'http://www.cavestory.org/downloads/linuxDoukutsu-1.2.zip'
+ 'http://www.cavestory.org/downloads/DoConfigure-r2.zip'
+ 'configure-gamepad-fix.patch'
+ 'doukutsu.desktop'
+ 'doukutsu-config.desktop'
+ 'doukutsu.png'
+ 'doukutsu')
+
+md5sums=('ec08da7c45419bc7740b8149ec7340cf'
+ 'e73d7330fba3cc5c15f0eeb239df586f'
+ '9f5e96d5ff9671691b7c8a41f8fa5880'
+ 'd4f9cdcd06058177671bd741b5bf5fa4'
+ 'd2633fb77949eb404f3199191e328bf3'
+ 'ca872e3276959cb523f57f0785c1a034'
+ '5262f9ff9bc528c790bf424016e6305f'
+ '4407e1feab85bd6ea5f18d5e7d91a747')
+
+prepare() {
+ cd "$srcdir"
+
+ # Fix DoConfigure utility bug where gamepad configurations are not saved correctly
+ # source: http://www.desura.com/games/cave-story/forum/thread/problems-remapping-the-joystick-under-linux
+ patch -Np0 -i "$srcdir/configure-gamepad-fix.patch"
+}
+
+build() {
+ cd "${srcdir}"
+ rm DoConfigure
+ g++ DoConfig.cpp -o DoConfigure -s $(fltk-config --cxxflags --ldflags)
+}
+
+package() {
+ cd "${srcdir}/linuxDoukutsu-1.01"
+
+ install -dm755 "${pkgdir}"/{opt/${pkgname},usr/share/{doc/${pkgname},applications}}
+ cp -r {Config.dat,data,doc,doukutsu} "${pkgdir}/opt/${pkgname}/"
+
+ if [ "$CARCH" == "i686" ]; then
+ install -Dm755 "${srcdir}/linuxDoukutsu-1.2/doukutsu_32bits" "${pkgdir}/opt/${pkgname}/doukutsu.bin"
+ else
+ install -Dm755 "${srcdir}/linuxDoukutsu-1.2/doukutsu_64bits" "${pkgdir}/opt/${pkgname}/doukutsu.bin"
+ fi
+
+ install -Dm644 "${srcdir}"/*.desktop "${pkgdir}/usr/share/applications/"
+ install -Dm644 "${srcdir}/doukutsu.png" "${pkgdir}/usr/share/pixmaps/doukutsu.png"
+ install -Dm644 doc/* "${pkgdir}/usr/share/doc/${pkgname}/"
+
+ install -Dm755 "${srcdir}/DoConfigure" "${pkgdir}/opt/${pkgname}/DoConfigure"
+ install -Dm755 "${srcdir}/doukutsu" "${pkgdir}/usr/bin/doukutsu"
+}
diff --git a/configure-gamepad-fix.patch b/configure-gamepad-fix.patch
new file mode 100644
index 000000000000..e7ce8e07346a
--- /dev/null
+++ b/configure-gamepad-fix.patch
@@ -0,0 +1,144 @@
+--- DoConfig.cpp 2011-04-26 10:42:52.000000000 +0400
++++ DoConfig.cpp.new 2014-04-06 11:21:16.000000000 +0400
+@@ -3,10 +3,10 @@
+ * and/or modify it under the terms of the Do What The F*** You Want
+ * To Public License, Version 2, as published by Sam Hocevar. See
+ * http://sam.zoy.org/wtfpl/COPYING for more details. */
+-
++
+ #include <cstdlib>
+ #include <iostream>
+-#include <fstream>
++#include <fstream>
+ #include <cstring>
+ #include "FL/Fl.H"
+ #include "FL/Fl_Window.H"
+@@ -66,6 +66,98 @@
+ this->buttons[input]->setonly();
+ }
+
++/**
++ * Action code values are a bit mixed up - on the screen they don't follow in the same
++ * way they are coded in Config.dat file.
++ *
++ * this is how hex dump of the last 4x8 bytes of the
++ * Config.dat file looks when the controller settings
++ * are saved in the following way:
++ * 1=[0]Jump(1)
++ * 2=[1]Attack(2)
++ * 3=[2]Weapon+(3)
++ * 4=[3]Weapon-(6)
++ * 5=[4]Items(4)
++ * 6=[5]Map(5)
++ * 7=[0]Jump(1)
++ * 8=[1]Attack(2)
++ * 01 00 00 00 02 00 00 00 03 00 00 00
++ * 06 00 00 00 04 00 00 00 05 00 00 00 01 00 00 00
++ * 02 00 00 00
++ */
++int screenIndexToFileIndex(int screenIndex) {
++ int fileIndex;
++ switch(screenIndex) {
++ case 0: // Jump on screen
++ fileIndex = 1; //Jump in file
++ break;
++ case 1: // Attack on screen
++ fileIndex = 2; // Attack in file
++ break;
++ case 2: // Weapon+ on screen
++ fileIndex = 3; // Weapon+ in file
++ break;
++ case 3: // Weapon- on screen
++ fileIndex = 6; // Weapon- in file
++ break;
++ case 4: // Items on screen
++ fileIndex = 4; // Items in file
++ break;
++ case 5: // Map on screen
++ fileIndex = 5; // Map in file
++ break;
++ default:
++ fileIndex = 0;
++ }
++ return fileIndex;
++}
++
++/**
++ * Action code values are a bit mixed up - on the screen they don't follow in the same
++ * way they are coded in Config.dat file.
++ *
++ * this is how hex dump of the last 4x8 bytes of the
++ * Config.dat file looks when the controller settings
++ * are saved in the following way:
++ * 1=[0]Jump(1)
++ * 2=[1]Attack(2)
++ * 3=[2]Weapon+(3)
++ * 4=[3]Weapon-(6)
++ * 5=[4]Items(4)
++ * 6=[5]Map(5)
++ * 7=[0]Jump(1)
++ * 8=[1]Attack(2)
++ * 01 00 00 00 02 00 00 00 03 00 00 00
++ * 06 00 00 00 04 00 00 00 05 00 00 00 01 00 00 00
++ * 02 00 00 00
++ */
++int fileIndexToScreenIndex(int fileIndex) {
++ int screenIndex;
++ switch(fileIndex) {
++ case 1: // Jump in file
++ screenIndex = 0; //Jump on screen
++ break;
++ case 2: // Attack in file
++ screenIndex = 1; // Attack on screen
++ break;
++ case 3: // Weapon+ in file
++ screenIndex = 2; // Weapon+ on screen
++ break;
++ case 4: // Items in file
++ screenIndex = 4; // Items on screen
++ break;
++ case 5: // Map in file
++ screenIndex = 5; // Map on screen
++ break;
++ case 6: // Weapon- in file
++ screenIndex = 3; // Weapon- on screen
++ break;
++ default:
++ screenIndex = 0;
++ }
++ return screenIndex;
++}
++
+ Fl_Round_Button *movear;
+ Fl_Round_Button *movegt;
+
+@@ -117,10 +209,9 @@
+ if( !config.useJoy ){
+ joystuffcontainer->deactivate();
+ }
+- for(char i=0;i<8;i++){
+- if(config.buttons[i]<9 && config.buttons[i]>0){
+- joyRows[i]->value(config.buttons[i] -1);
+- }
++
++ for(char i=0;i<8;i++){
++ joyRows[i]->value(fileIndexToScreenIndex(config.buttons[i]));
+ }
+ fd.close();
+ }
+@@ -141,7 +232,7 @@
+ config.display = displaychoice->value();
+ config.useJoy = joychoice->value();
+ for(char i =0;i<8;i++){
+- config.buttons[i] = joyRows[i]->value();
++ config.buttons[i] = screenIndexToFileIndex(joyRows[i]->value());
+ }
+ fd.write((char*)&config, 148);
+ fd.close();
+@@ -227,4 +318,4 @@
+ read_Config();
+ Fl::option(Fl::OPTION_VISIBLE_FOCUS, false);
+ return Fl::run();
+-}
++}
+\ No newline at end of file
diff --git a/doukutsu b/doukutsu
new file mode 100644
index 000000000000..942dcbecccbf
--- /dev/null
+++ b/doukutsu
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+
+# This script replicates the Doukutsu working folder in a specified directory
+# (defaults to ~/.doukutsu) by creating symbolic links to the installed
+# files. This allows the game to store saves and configuration files
+# without write permissions in the install folder and lets every user on
+# system keep their own saves/settings. It then launches the game or
+# configuration tool.
+
+INSTALLDIR=/opt/doukutsu
+USERDATADIR=$HOME/.doukutsu
+
+function create_structure {
+ mkdir -p $USERDATADIR
+ ln -s -t $USERDATADIR $INSTALLDIR/{doukutsu,doukutsu.bin,DoConfigure,data,doc}
+ cp $INSTALLDIR/Config.dat $USERDATADIR
+ cd $USERDATADIR
+}
+
+function integrity_check {
+ USERFILECOUNT=`find $USERDATADIR -maxdepth 1 | grep -v Profile.dat | grep -v error.log | wc -l`
+ SYSTEMFILECOUNT=`find $INSTALLDIR -maxdepth 1 | grep -v Profile.dat | grep -v error.log | wc -l`
+ if [ $USERFILECOUNT != $SYSTEMFILECOUNT ];
+ then create_structure;
+ fi
+}
+
+while getopts "ch" options; do
+ case $options in
+ c)
+ integrity_check
+ cd $USERDATADIR
+ ./DoConfigure
+ exit 0;;
+ h|*)
+ printf "Usage: doukutsu [-h] [-c]\n"
+ exit 0;;
+ esac
+done
+
+if [ -d $USERDATADIR ]; then
+ integrity_check
+
+ cd $USERDATADIR
+ exec ./doukutsu $@
+else
+ create_structure
+
+ exec ./doukutsu $@
+fi
diff --git a/doukutsu-config.desktop b/doukutsu-config.desktop
new file mode 100644
index 000000000000..8dcece4c3402
--- /dev/null
+++ b/doukutsu-config.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Cave Story Configuration
+Comment=Configuration utility for Cave Story
+Exec=doukutsu -c
+Icon=doukutsu
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=Game;AdventureGame;
+Encoding=UTF-8
diff --git a/doukutsu.desktop b/doukutsu.desktop
new file mode 100644
index 000000000000..e2c07a8541ce
--- /dev/null
+++ b/doukutsu.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Cave Story
+Comment=Traditional 2D platformer
+Exec=/usr/bin/doukutsu
+Icon=doukutsu
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=Game;AdventureGame;
+Encoding=UTF-8
diff --git a/doukutsu.png b/doukutsu.png
new file mode 100644
index 000000000000..4598e145e4c7
--- /dev/null
+++ b/doukutsu.png
Binary files differ