Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mods
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-10-02 21:29:51 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-10-02 21:29:51 +0300
commitd104914142b9904e39d6597a738be5284c504f35 (patch)
tree5f0c424127fbe3fa62ebafef0f4c884dcedd7eca /mods
parent4307c299bd8784c538aa212813f81eee6f34e3a2 (diff)
copyleft.hmod update for SNES Mini
Diffstat (limited to 'mods')
-rw-r--r--mods/hmods/copyleft.hmodbin543 -> 502 bytes
-rw-r--r--mods/mod_hakchi/bin/busyboxbin608480 -> 0 bytes
-rw-r--r--mods/mod_hakchi/bin/rsyncbin463320 -> 0 bytes
-rw-r--r--mods/mod_hakchi/hakchi/config2
-rw-r--r--mods/mod_hakchi/hakchi/init20
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/bin/chmenu38
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/bin/clover-kachikachi-wr12
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/init.d/S78clvcon47
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/inittab2
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/preinit4
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0000_defines36
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0010_functions39
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/p0000_config2
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/pa100_games6
-rw-r--r--mods/mod_hakchi/hakchi/script/base19
-rw-r--r--mods/mod_hakchi/hakchi/script/games1
-rw-r--r--mods/mod_hakchi/hakchi/script/install11
-rw-r--r--mods/mod_hakchi/hakchi/script/transfer9
18 files changed, 143 insertions, 105 deletions
diff --git a/mods/hmods/copyleft.hmod b/mods/hmods/copyleft.hmod
index b0607809..de0e607a 100644
--- a/mods/hmods/copyleft.hmod
+++ b/mods/hmods/copyleft.hmod
Binary files differ
diff --git a/mods/mod_hakchi/bin/busybox b/mods/mod_hakchi/bin/busybox
deleted file mode 100644
index e71f5823..00000000
--- a/mods/mod_hakchi/bin/busybox
+++ /dev/null
Binary files differ
diff --git a/mods/mod_hakchi/bin/rsync b/mods/mod_hakchi/bin/rsync
deleted file mode 100644
index d37b2b8d..00000000
--- a/mods/mod_hakchi/bin/rsync
+++ /dev/null
Binary files differ
diff --git a/mods/mod_hakchi/hakchi/config b/mods/mod_hakchi/hakchi/config
index 4efc5ca1..91ce3847 100644
--- a/mods/mod_hakchi/hakchi/config
+++ b/mods/mod_hakchi/hakchi/config
@@ -1,4 +1,4 @@
local cf_backup_dummy='n'
local cf_backup='n'
local cf_backup_nandc='n'
-local cf_shutdown='n'
+local cf_shutdown='y'
diff --git a/mods/mod_hakchi/hakchi/init b/mods/mod_hakchi/hakchi/init
index ac0ebf1f..e885e8e0 100644
--- a/mods/mod_hakchi/hakchi/init
+++ b/mods/mod_hakchi/hakchi/init
@@ -2,16 +2,16 @@ init(){
echo
/bin/busybox --install -s /bin/
-local modname=hakchi
-local modpath=/$modname
-local mountpoint=/newroot
-local installpath=$mountpoint/var/lib/$modname
-local firmwarepath=$installpath/firmware
-local rootfs=$installpath/rootfs
-local preinit=$rootfs/etc/preinit
-local preinitpath=$preinit.d
-local gamepath=/usr/share/games/nes/kachikachi
-local temppath=/tmp
+local modname="hakchi"
+local modpath="/$modname"
+local mountpoint="/newroot"
+local installpath
+local firmwarepath
+local rootfs
+local preinit
+local preinitpath
+local gamepath
+local temppath="/tmp"
mkdir -p "$temppath"
diff --git a/mods/mod_hakchi/hakchi/rootfs/bin/chmenu b/mods/mod_hakchi/hakchi/rootfs/bin/chmenu
deleted file mode 100644
index dfff917b..00000000
--- a/mods/mod_hakchi/hakchi/rootfs/bin/chmenu
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-source /etc/preinit
-script_init
-
-state_file=$installpath/menu
-
-[ -z "$1" ] && exit 1
-[ -f "$state_file" ] && prev_code=$(cat "$state_file") || prev_code=000
-[ "$1" == "$prev_code" ] && exit 1
-
-echo Switching to menu $1
-if [ "$1" == "000" ]; then
- targetpath=$rootfs$gamepath
-else
- targetpath=$rootfs$gamepath/$1
-fi
-
-[ -d "$targetpath" ] || exit 1
-echo $1 > "$state_file"
-
-echo New directory: $targetpath
-
-if [ "$1" != "000" ]; then
- if [ ! -f "$targetpath/title.fnt" ]; then
- ln -s "$rootfs$gamepath/title.fnt" "$targetpath/title.fnt"
- fi
- if [ ! -f "$targetpath/copyright.fnt" ]; then
- ln -s "$rootfs$gamepath/copyright.fnt" "$targetpath/copyright.fnt"
- fi
-fi
-
-pkill -KILL clover-mcp
-pkill -KILL ReedPlayer-Clover
-rm -rf /var/cache/clover
-
-overmount_games
-
-exec clover-mcp
diff --git a/mods/mod_hakchi/hakchi/rootfs/bin/clover-kachikachi-wr b/mods/mod_hakchi/hakchi/rootfs/bin/clover-kachikachi-wr
deleted file mode 100644
index d8ff9899..00000000
--- a/mods/mod_hakchi/hakchi/rootfs/bin/clover-kachikachi-wr
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Wrapper for kachikachi
-# You can add extra command line arguments to all games at once
-# using "cfg_nes_extra_args" variable in p0000_config
-# or disable epilepsy protection using "cfg_disable_armet=y"
-
-source /etc/preinit
-script_init
-
-args="$@ $cfg_nes_extra_args"
-[ "$cfg_disable_armet" == "y" ] && args="$(echo $args | sed 's/--enable-armet//g')"
-exec /usr/bin/clover-kachikachi $args
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/init.d/S78clvcon b/mods/mod_hakchi/hakchi/rootfs/etc/init.d/S78clvcon
new file mode 100644
index 00000000..9b47abc4
--- /dev/null
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/init.d/S78clvcon
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+CLV_BOARD_NAME=$(cat /etc/clover/boardtype)
+MODULE="clvcon"
+[ -f "/lib/modules/$(uname -r)/extra/$MODULE.ko" ] || MODULE="clovercon"
+
+start()
+{
+ echo "$MODULE: starting driver"
+ case "${CLV_BOARD_NAME}" in
+ fp)
+ # inverted c1/c2 detect lines
+ MODULE_PARAMS="2,195,1,194"
+ ;;
+ ep|dp-nes|dp-shvc)
+ # regular setup w/ detect lines
+ MODULE_PARAMS="1,195,2,194"
+ ;;
+ dp-hvc)
+ # no detect lines
+ MODULE_PARAMS="1,-1,2,-1"
+ ;;
+ esac
+ modprobe "$MODULE" module_params=$MODULE_PARAMS
+}
+
+stop()
+{
+ echo "$MODULE: stopping driver"
+ modprobe -r "$MODULE"
+}
+
+case "$1" in
+start)
+ start
+;;
+stop)
+ stop
+;;
+restart)
+ stop
+ start
+;;
+*)
+ echo "$MODULE: Please use start, stop, or restart."
+ exit 1
+esac
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/inittab b/mods/mod_hakchi/hakchi/rootfs/etc/inittab
index 8bba3546..ee87e540 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/inittab
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/inittab
@@ -5,7 +5,7 @@ null::sysinit:/bin/mkdir -p /var/cache /var/lock /var/log /var/spool
null::sysinit:/bin/ln -s /tmp /var/tmp
null::sysinit:/bin/ln -s /run /var/run
-null::sysinit:/bin/mkdir -p /var/cache/clover/reed-libs/tmp /var/lib/clover/profiles/0/home-menu /var/lib/clover/config/reed-libs
+null::sysinit:/bin/mkdir -p /var/cache/clover/reed-libs/tmp /var/lib/clover/profiles/0/home-menu /var/lib/clover/config/reed-libs /var/lib/profiling-data
null::sysinit:/etc/init.d/rcS
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/preinit b/mods/mod_hakchi/hakchi/rootfs/etc/preinit
index 47a0de3a..a0452250 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/preinit
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/preinit
@@ -3,6 +3,8 @@ rand(){
}
source_parts(){
+ [ -z "$temppath" ] && local temppath=/tmp
+ mkdir -p "$temppath"
local script=$temppath/script_$(rand)
rm -f "$script"
local searchpath=$(dirname "$1")
@@ -46,8 +48,6 @@ save_config(){
}
script_init(){
- [ -z "$temppath" ] && temppath=/tmp
- mkdir -p "$temppath"
source_base
source_config
}
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0000_defines b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0000_defines
index 59c101ec..47c72734 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0000_defines
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0000_defines
@@ -1,9 +1,27 @@
-modname=hakchi
-modpath=/$modname
-installpath=$mountpoint/var/lib/$modname
-firmwarepath=$installpath/firmware
-rootfs=$installpath/rootfs
-preinit=$rootfs/etc/preinit
-preinitpath=$preinit.d
-gamepath=/usr/share/games/nes/kachikachi
-temppath=/tmp
+set_gamepath(){
+ local feck="$mountpoint/var/lib/clover/profiles/0/home-menu/save/system-save.json"
+ if [ -f "$mountpoint/etc/clover/version/canoe" ]; then
+# echo "SNES gamepath"
+ gamepath="/usr/share/games"
+ [ -f "$feck" ] && mv -f "$feck" "$feck.nes"
+ [ -d "$feck.snes" ] && rm -rf "$feck" && mv "$feck.snes" "$feck"
+ else
+# echo "NES gamepath"
+ gamepath="/usr/share/games/nes/kachikachi"
+ [ -d "$feck" ] && rm -rf "$feck.snes" && mv "$feck" "$feck.snes"
+ [ -f "$feck.nes" ] && mv -f "$feck.nes" "$feck"
+ fi
+}
+
+modname="hakchi"
+modpath="/$modname"
+#mountpoint="/newroot"
+installpath="$mountpoint/var/lib/$modname"
+firmwarepath="$installpath/firmware"
+rootfs="$installpath/rootfs"
+preinit="$rootfs/etc/preinit"
+preinitpath="$preinit.d"
+gamepath=""
+set_gamepath
+temppath="/tmp"
+
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0010_functions b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0010_functions
index 6ae5fee5..2689c24e 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0010_functions
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0010_functions
@@ -10,6 +10,34 @@ umount_base(){
umount "$mountpoint/var"
}
+remove_old(){
+ [ -d "$1" ] || return 1
+ [ -f "$modpath/script/removed" ] || return 0
+ local basepath="$1"
+ source "$modpath/script/removed"
+}
+
+mod_repair_etc(){
+ remove_old "$rootfs"
+ rm -f "$modpath/rootfs/etc/preinit.d/p0000_config"
+ chown -R 0:0 $modpath/
+
+ local etc="$temppath/etc"
+ rm -rf "$etc"
+ mkdir -p "$etc"
+ copy "$mountpoint/etc/" "$etc/"
+ if [ "$1" == "full" ]; then
+ copy "$modpath/rootfs/etc/" "$etc/"
+ else
+ copy "$rootfs/etc/inittab" "$etc/inittab"
+ fi
+ copy "$etc/" "$rootfs/etc/"
+}
+
+mod_repair_modules(){
+ restore "/lib/modules/$(uname -r)/"
+}
+
remount_root(){
[ -z "$(mount | grep -F loop)" ] || return 1
@@ -29,7 +57,16 @@ load_firmware(){
[ -d "$firmwarepath" ] || return 0
local firmware=$(find "$firmwarepath" -type f -name "*.hsqs" | sort | head -n 1)
[ -f "$firmware" ] || return 0
- remount_root "$firmware" && cryptsetup close root-crypt
+ mod_repair_modules
+ remount_root "$firmware" || return 0
+ cryptsetup close root-crypt
+ mod_repair_etc
+ if [ -d "$rootfs/lib/modules/$(uname -r)" ]; then
+ overmount "/lib/modules"
+ else
+ echo "no modules for loaded kernel $(uname -r)"
+ fi
+ set_gamepath
}
shutdown(){
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/p0000_config b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/p0000_config
index 39ae5dba..68e938f6 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/p0000_config
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/p0000_config
@@ -1,2 +1,4 @@
cfg_boot_stock_firmware='n'
cfg_boot_stock='n'
+cfg_disable_armet='y'
+cfg_nes_extra_args='--ppu-palette 2'
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/pa100_games b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/pa100_games
index d0df2442..73cf7716 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/pa100_games
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/pa100_games
@@ -1 +1,5 @@
-overmount_games
+if [ -z "$(ls $rootfs$gamepath/CLV-* 2>/dev/null)" ]; then
+ echo "no romz found"
+else
+ overmount_games
+fi
diff --git a/mods/mod_hakchi/hakchi/script/base b/mods/mod_hakchi/hakchi/script/base
index 5e439906..db197dd0 100644
--- a/mods/mod_hakchi/hakchi/script/base
+++ b/mods/mod_hakchi/hakchi/script/base
@@ -1,17 +1,2 @@
-mount_base(){
- mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs "$mountpoint/var"
- mkdir -p "$mountpoint/var/lib"
- mount -o defaults,nosuid,nodev,noatime /dev/nandc "$mountpoint/var/lib"
-}
-
-umount_base(){
- sync
- umount "$mountpoint/var/lib"
- umount "$mountpoint/var"
-}
-
-remove_old(){
- [ -d "$1" ] || return 1
- local basepath="$1"
- source "$modpath/script/removed"
-}
+source "$modpath/rootfs/etc/preinit"
+source_base "$modpath/rootfs/etc/preinit.d"
diff --git a/mods/mod_hakchi/hakchi/script/games b/mods/mod_hakchi/hakchi/script/games
index 157033fc..fe3ddf5f 100644
--- a/mods/mod_hakchi/hakchi/script/games
+++ b/mods/mod_hakchi/hakchi/script/games
@@ -51,6 +51,7 @@ transfer_games(){
transfer_original_games "$1/original"
echo transfering new games...
# this is simple
+ [ "$gamepath" == "/usr/share/games" ] && find "$1" -name *.desktop -exec sed -i -e 's/\/games\/nes\/kachikachi/\/games/g' {} +
copy_mask "$1/*" "$target_dir"
# need to reset menu state
rm -f $installpath/menu
diff --git a/mods/mod_hakchi/hakchi/script/install b/mods/mod_hakchi/hakchi/script/install
index 70bfac70..f8d6d0a7 100644
--- a/mods/mod_hakchi/hakchi/script/install
+++ b/mods/mod_hakchi/hakchi/script/install
@@ -6,14 +6,15 @@ mod_uninstall(){
}
mod_repair(){
- restore "/etc/clover/"
- restore "/etc/issue"
- rm -f "$modpath/rootfs/etc/preinit.d/p0000_config"
- chown -R 0:0 $modpath/
+ mod_repair_etc full
chmod 755 $modpath/rootfs/bin/*
- copy "$modpath/rootfs/" "$rootfs/"
copy "/bin/" "$rootfs/bin/"
copy "/sbin/cryptsetup" "$rootfs/bin/cryptsetup"
+ copy "$modpath/rootfs/" "$rootfs/"
+
+ # This file required by hakchi2 kernel...
+ echo "hakchi_enabled=y" > "$temppath/config"
+ copy "$temppath/config" "$installpath/"
}
mod_install(){
diff --git a/mods/mod_hakchi/hakchi/script/transfer b/mods/mod_hakchi/hakchi/script/transfer
index 8d17a07b..0ec983c7 100644
--- a/mods/mod_hakchi/hakchi/script/transfer
+++ b/mods/mod_hakchi/hakchi/script/transfer
@@ -7,16 +7,9 @@ backup_nandc
mount_base
backup
-remove_old "$modpath/rootfs"
-remove_old "$rootfs"
-
-source "$modpath/rootfs/etc/preinit"
-source_base "$modpath/rootfs/etc/preinit.d"
source_config
-remove_old "$rootfs"
-
-local transferpath=$modpath/transfer
+local transferpath="$modpath/transfer"
[ -f "$transferpath/earlybird" ] && source "$transferpath/earlybird"
rm -f "$transferpath/earlybird"