mrchrisster / MiSTer_SAM

149 stars 22 forks source link

CLI tools just straight don't work #104

Closed codefaux closed 2 years ago

codefaux commented 2 years ago

Hi there. Loving SAM, it's fantastic. Getting right to it, though; the CLI interface for running instances does not and cannot work as intended.

/media/fat/Scripts# ./MiSTer_SAM_on.sh monitor Attaching MiSTer SAM to current shell.../tmp/gdbcmd.84QL:3: Error in sourced command file: 'open' has unknown return type; cast the call to its declared return type ./MiSTer_SAM_on.sh: line 865: warn: command not found Monitor just won't work -- can't work, given that it's a) coded wrong, and b) trying to access a command not included with the MiSTer-FPGA Linux distribution.

/media/fat/Scripts# ./MiSTer_SAM_on.sh stop Stopping other running instances of MiSTer_SAM_on.sh... Done! Thanks for playing!

/media/fat/Scripts# ps aux | grep SAM 724 root {MiSTer_SAM_MCP} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_MCP 753 root inotifywait --quiet --monitor --event create --event delete /dev/input/ --outfile /tmp/.SAM_Joy_Change 754 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh 759 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh 762 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1 764 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1 1387 root grep SAM Stop doesn't work -- it doesn't close things properly. Games continue to cycle and change. Also somehow there's two copies of the monitors running?

/media/fat/Scripts# ./MiSTer_SAM_on.sh start Stopping other running instances of MiSTer_SAM_on.sh... Done! Let Mortal Kombat begin! Starting now on the NEC TurboGrafx-16 / PC Engine: Zero 4 Champ (Japan) Next game in 134... After stopping SAM using the prior command, then starting, two instances are running, so it changes twice per period, each instance waiting the proper time but not caring that it was already recently changed by SAM.

EDIT: Sorry for newline breakage, apparently Github's "Insert Code" formatting doesn't respect code formatting characters like newline, etc. -- it all shows properly before I hit Send or Update

mrchrisster commented 2 years ago

Thanks, the monitor command not working is a known issue. Trust me, it was working fine a year ago ;) It's fixed in the test branch of Mister SAM. You can try it out by enabling test branch (last line of Mister_SAM.ini)

I noticed stop command not working properly. Happy to look at a PR if you like to improve it?

Update reason: clarity

codefaux commented 2 years ago

Roger that. Switching to test branch now.

codefaux commented 2 years ago

Update; Switched to 'test' branch, rebooted. Monitor command does not work.

`/media/fat# Scripts/MiSTer_SAM_on.sh monitor Attaching MiSTer SAM to current shell.../tmp/gdbcmd.yz6w:3: Error in sourced command file: 'open' has unknown return type; cast the call to its declared return type Scripts/MiSTer_SAM_on.sh: line 865: warn: command not found

/media/fat# ps aux | grep SAM

722 root {MiSTer_SAM_MCP} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_MCP

751 root inotifywait --quiet --monitor --event create --event delete /dev/input/ --outfile /tmp/.SAM_Joy_Change

752 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh

757 root {MiSTer_SAM_mous} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_mouse.sh

760 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1

762 root {MiSTer_SAM_keyb} /bin/bash /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_keyboard.sh hidraw1

1009 root {MiSTer_SAM_on.s} /bin/bash /media/fat/Scripts/MiSTer_SAM_on.sh start

1114 root grep SAM`

mrchrisster commented 2 years ago

That suggests you're not on the test branch. Did you update after enabling it in the ini?

codefaux commented 2 years ago

I asked it to, but I didn't delete stuff then re-run it from scratch.

PR #105 covers all concerns

mrchrisster commented 2 years ago

Great thanks, I'll take a look tomorrow.

mrchrisster commented 2 years ago

This is fixed in the most recent release