notification on core change?
notification on core change?
Hi, does MiSTer have some kind of state eventing system on the linux side.
My problem. I am working on a raspberry pi touch screen solution for various different system keyboards.
The main problem I face atm is. If I switch for instance from C64 to AtariXL how can I notify my external keyboard that such a switch has happened.
The switch side itself is easy probably the easiest is simply to send a network udp message or something similar which notifies the keygboard that the system was switched to Atari XL.
However I have now clue if there is some kind of hook where I can hook a shell script in so that some external conditions can be adjusted according to the state MiSTer is about to enter.
My problem. I am working on a raspberry pi touch screen solution for various different system keyboards.
The main problem I face atm is. If I switch for instance from C64 to AtariXL how can I notify my external keyboard that such a switch has happened.
The switch side itself is easy probably the easiest is simply to send a network udp message or something similar which notifies the keygboard that the system was switched to Atari XL.
However I have now clue if there is some kind of hook where I can hook a shell script in so that some external conditions can be adjusted according to the state MiSTer is about to enter.
- bootsector
- Posts: 170
- Joined: Sun May 24, 2020 6:58 pm
- Has thanked: 4 times
- Been thanked: 30 times
Re: notification on core change?
You could write a little "daemon" on MiSTer side that checks for changes inside /tmp/CORENAME (this file holds the name of the current loaded core).
- venice
- Top Contributor
- Posts: 788
- Joined: Tue Jun 16, 2020 9:29 am
- Location: Germany
- Has thanked: 278 times
- Been thanked: 278 times
Re: notification on core change?
Hi,
If I run tail -f /tmp/CORENAME 2> /dev/null I get this shown
Any chance to get rid of "file truncate" and the doubled core name using console commands?
I like to send the output to an Arduino.
Thx
if I run a simple tail -f /tmp/CORENAME i get the following outputbootsector wrote: ↑Thu Jun 04, 2020 6:55 pm You could write a little "daemon" on MiSTer side that checks for changes inside /tmp/CORENAME (this file holds the name of the current loaded core).
Code: Select all
/root# tail -f /tmp/CORENAME
MENUtail: /tmp/CORENAME: file truncated
ATARI2600tail: /tmp/CORENAME: file truncated
ATARI2600tail: /tmp/CORENAME: file truncated
ATARI5200tail: /tmp/CORENAME: file truncated
ATARI5200
Code: Select all
/root# tail -f /tmp/CORENAME 2> /dev/null
ATARI2600ATARI5200ATARI5200NESNES
I like to send the output to an Arduino.
Thx
- venice
- Top Contributor
- Posts: 788
- Joined: Tue Jun 16, 2020 9:29 am
- Location: Germany
- Has thanked: 278 times
- Been thanked: 278 times
Re: notification on core change?
I figured it out using
Code: Select all
while true do
newcore=$(cat /tmp/CORENAME)
sleep 2
done
- Newsdee
- Top Contributor
- Posts: 873
- Joined: Mon May 25, 2020 1:07 am
- Has thanked: 104 times
- Been thanked: 239 times
Re: notification on core change?
This sounds super interesting! Good luck and hope you can share details about it