notification on core change?

Kernel, Main, Utilities & Apps, Misc Devices.
werpu
Posts: 13
Joined: Sun May 24, 2020 7:37 pm

notification on core change?

Unread post by werpu »

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.
User avatar
bootsector
Posts: 93
Joined: Sun May 24, 2020 6:58 pm
Has thanked: 2 times
Been thanked: 3 times

Re: notification on core change?

Unread post by bootsector »

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).
werpu
Posts: 13
Joined: Sun May 24, 2020 7:37 pm

Re: notification on core change?

Unread post by werpu »

thx... I will check this out.
venice
Posts: 21
Joined: Tue Jun 16, 2020 9:29 am
Has thanked: 12 times
Been thanked: 4 times

Re: notification on core change?

Unread post by venice »

Hi,
bootsector 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).
if I run a simple tail -f /tmp/CORENAME i get the following output

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
If I run tail -f /tmp/CORENAME 2> /dev/null I get this shown

Code: Select all

/root# tail -f /tmp/CORENAME 2> /dev/null
ATARI2600ATARI5200ATARI5200NESNES
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
My tty2oled Add-On
venice
Posts: 21
Joined: Tue Jun 16, 2020 9:29 am
Has thanked: 12 times
Been thanked: 4 times

Re: notification on core change?

Unread post by venice »

I figured it out using

Code: Select all

while true do 
  newcore=$(cat /tmp/CORENAME)
  sleep 2
done
My tty2oled Add-On
User avatar
Newsdee
Posts: 282
Joined: Mon May 25, 2020 1:07 am
Has thanked: 2 times
Been thanked: 18 times

Re: notification on core change?

Unread post by Newsdee »

werpu wrote: Thu Jun 04, 2020 5:44 pm I am working on a raspberry pi touch screen solution for various different system keyboards.
This sounds super interesting! Good luck and hope you can share details about it :mrgreen:
Post Reply