forked from javiwwweb/MisTerRFID
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ElRojo/adding-rewrite-feature
Adding rewrite feature
- Loading branch information
Showing
7 changed files
with
121 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,14 @@ | ||
#!/bin/bash | ||
|
||
qload_rom() | ||
{ | ||
if [ "$LASTROM" != "$3" ] | ||
then | ||
export LASTROM="$3" | ||
echo "$LASTROM" | ||
play() { | ||
echo "load_core /media/fat/_Arcade/"$1".mra" > /dev/MiSTer_cmd | ||
} | ||
|
||
if [ ! -f /media/fat/Games/"$1"/"$2".mgl ] | ||
then | ||
echo "<mistergamedescription><rbf>_console/"$1"</rbf><file delay=\"2\" type=\"f\" index=\"0\" path=\"../../games/"$1"/"$2"\"/></mistergamedescription>" > "/media/fat/Games/"$1"/"$2".mgl" | ||
fi | ||
echo "load_core /media/fat/Games/"$1"/"$2".mgl" > /dev/MiSTer_cmd | ||
|
||
fi | ||
ha_cmd() { | ||
TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkYmY4ZmIxMWEyNjU0MzVkYmZhODY3NjA0YWIwNTc5OCIsImlhdCI6MTY2MDQ1NjI0NSwiZXhwIjoxOTc1ODE2MjQ1fQ.3Lvgl5ke4m55NNQxnLsEQSMM7OEkyWvL5mtTve6VnhE" | ||
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d $1 $2 | ||
} | ||
|
||
case "$1" in | ||
"2208192798") echo load_core /media/fat/_Arcade/'Robocop (World revision 4).mra' > /dev/MiSTer_cmd;; | ||
"1944463134") echo load_core /media/fat/_Arcade/'Final Fight -World, set 1-.mra' > /dev/MiSTer_cmd;; | ||
"2212386078") echo load_core /media/fat/_Arcade/'Ghosts'\''n Goblins (JT).mra' > /dev/MiSTer_cmd;; | ||
"3841642020") echo load_core /media/fat/_Arcade/'Double Dragon.mra' > /dev/MiSTer_cmd;; | ||
"2788154149") echo load_core /media/fat/_Arcade/'Double Dragon II - The Revenge.mra' > /dev/MiSTer_cmd;; | ||
"2785325093") echo load_core /media/fat/_Arcade/'Kung-Fu Master.mra' > /dev/MiSTer_cmd;; | ||
"2532548645") echo load_core /media/fat/_Arcade/'Shinobi (Set 6, World, S16A) [No Protection].mra' > /dev/MiSTer_cmd;; | ||
"3571898404") echo load_core /media/fat/_Arcade/'R-Type (World).mra' > /dev/MiSTer_cmd;; | ||
"3836830500") echo load_core /media/fat/_Arcade/'Vigilante (World, Rev E).mra' > /dev/MiSTer_cmd;; | ||
"4095029796") echo load_core /media/fat/_Arcade/'Bad Dudes vs. Dragonninja (US revision 1).mra' > /dev/MiSTer_cmd;; | ||
"4100998436") echo load_core /media/fat/_Arcade/"Ghouls'n Ghosts -World-.mra" > /dev/MiSTer_cmd;; | ||
"4095293732") echo load_core /media/fat/_Arcade/'Rush'\''n Attack (US).mra' > /dev/MiSTer_cmd;; | ||
"4097148196") echo load_core /media/fat/_Arcade/'Altered Beast (set 8) (8751 317-0078).mra' > /dev/MiSTer_cmd;; | ||
"3841431588") echo load_core /media/fat/_Arcade/'Golden Axe (set 6, US) (8751 317-123A).mra' > /dev/MiSTer_cmd;; | ||
"3570877988") echo load_core /media/fat/_Arcade/"Street Fighter II' Hyper Fighting -World 921209-.mra" > /dev/MiSTer_cmd;; | ||
"2793426725") echo load_core /media/fat/_Arcade/'Rastan (World Rev 1).mra' > /dev/MiSTer_cmd;; | ||
"2790045733") qload_rom NEOGEO mslugx "$1";; | ||
"3837547300") qload_rom NEOGEO samsho2 "$1";; | ||
|
||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
write_rom() | ||
{ | ||
cardNumber="$1" | ||
runningGame=\"$(ps aux | grep .mra)\" | ||
get_title() { | ||
trimPath=${1##*".rbf /media/fat/_Arcade/"} | ||
removeExtra=${trimPath%%.mra*} | ||
echo $removeExtra | ||
} | ||
gameTitle=$(get_title "$runningGame") | ||
|
||
rfidFile=rfid_process.sh | ||
sed -i "/$cardNumber/d" "$rfidFile" | ||
# '13i...' is the starting line for the case-statement. Change this if you add code or newlines to rfid_process.sh | ||
sed -i "13i \"$cardNumber\") "play" \"$gameTitle\" ;;" "$rfidFile" | ||
} | ||
|
||
write_rom "$1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters