Evil Avatar  



Go Back   Evil Avatar > Daily Gaming News > News Items

» Sponsored Links


» Recent Threads
Liberals gone wild
Last post by Eats
Today 05:20 PM
4,462 Replies, 980,181 Views
【WE'RE BACK!】RECENT GAME...
Last post by Metal Jesus
Today 04:47 PM
1 Replies, 58 Views
Weekend Gamer: What are...
Last post by Ghostblaze
Today 04:33 PM
4 Replies, 171 Views
PlayStation Announce New...
Last post by Evil Avatar
Today 03:17 PM
1 Replies, 202 Views
Game & Movie Releases...
Last post by PatrickRes9
Today 03:00 PM
3 Replies, 312 Views
Epic Games Store - Free...
Last post by vallor
Today 11:44 AM
2 Replies, 162 Views
Get Your Heart Racing as...
Last post by BenSkywlkr
Today 09:33 AM
6 Replies, 310 Views
Terminator: Resistance...
Last post by Scherge
Today 12:36 AM
3 Replies, 309 Views
Reply
 
Thread Tools
Old 06-03-2019, 09:46 AM   #21
PacerDawn
Choadwanger
 
PacerDawn's Avatar
 
Join Date: Feb 2005
Location: North Carolina
Posts: 3,186
Quote:
Originally Posted by BeardedSonOfNel View Post
The problem with these is that they are not true light-guns. It's basically a mouse pointer ala Wiimote/Playstation Move. That's why there is a crosshair on the screen, as otherwise you would not know where you are aiming. That's the biggest problem with light gun games, there are no true light guns that work with digital displays, they all require a CRT. That's why I still have an old CRT TV to use with my Dreamcast guns. Playing House of the Dead while dual-wielding is awesome.
__________________
Why isn't the word "gullible" in the dictionary?
PacerDawn is offline   Reply With Quote
Old 06-03-2019, 09:52 AM   #22
CthulhuFan
Subscriber
 
CthulhuFan's Avatar
 
Join Date: Aug 2018
Posts: 77
Quote:
Originally Posted by PacerDawn View Post
The problem with these is that they are not true light-guns. It's basically a mouse pointer ala Wiimote/Playstation Move. That's why there is a crosshair on the screen, as otherwise you would not know where you are aiming. That's the biggest problem with light gun games, there are no true light guns that work with digital displays, they all require a CRT. That's why I still have an old CRT TV to use with my Dreamcast guns. Playing House of the Dead while dual-wielding is awesome.
Thanks for posting this, I was wondering how the heck that actually worked right or /close enough/. Now I have to google why CRT works and LCD doesn't but at least I have something to go on.
CthulhuFan is offline   Reply With Quote
Old 06-03-2019, 09:56 AM   #23
PacerDawn
Choadwanger
 
PacerDawn's Avatar
 
Join Date: Feb 2005
Location: North Carolina
Posts: 3,186
One other note: Most of these games are playable online at various sites, including the Internet Archive site:

__________________
Why isn't the word "gullible" in the dictionary?
PacerDawn is offline   Reply With Quote
Old 06-03-2019, 10:05 AM   #24
CthulhuFan
Subscriber
 
CthulhuFan's Avatar
 
Join Date: Aug 2018
Posts: 77
Quote:
Originally Posted by PacerDawn View Post
This is interesting. I haven't modded my cabinet yet because this build doesn't utilize the power switch on the cabinate itself (you have to turn it on and off via the power strip).

You can use the GPIO to wire up an on/off switch that does a *graceful* power down. Here is an example, this is from the super Kintaro case that I run and is their script but you can see the meat and potatoes of what's going on. Sorry for the code spam.
Code:
#!/usr/bin/python3
#Copyright 2017 Michael Kirsch

#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
#to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

try:
    import http.server
    import configparser
    import time
    import os
    import RPi.GPIO as GPIO
    import subprocess
    from configparser import SafeConfigParser
    from enum import Enum
except ImportError:
    raise ImportError('spidev or gpio not installed')

class SNES:

    def __init__(self):

        #GPIOs

        self.led_pin=7
        self.fan_pin=8
        self.reset_pin=3
        self.power_pin=5
        self.check_pin=10

        #vars

        self.fan_hysteresis = 5
        self.fan_starttemp = 60
        self.fan_hysteresis_pwm = 20
        self.fan_starttemp_pwm = 60
        self.reset_hold_short = 100
        self.reset_hold_long = 500
        self.debounce_time = 0.1
        self.counter_time = 0.01
        self.delay_until_reset = 2
        self.is_pwm = False

        #path

        self.kintaro_folder = "/opt/kintaro/"
        self.start_folder = "start/"
        self.intro_video = self.kintaro_folder + self.start_folder + "intro.mp4"
        self.config_file = self.kintaro_folder + self.start_folder + "kintaro.config"
        self.temp_command = 'vcgencmd measure_temp'

        #Check for Update

        Updatevar = self.return_config_bool("Update")
        if Updatevar is "True":
            os.system("sudo apt-get install --only-upgrade kintarosnes")

        #Set the GPIOs

        GPIO.setmode(GPIO.BOARD)  # Use the same layout as the pins
        GPIO.setwarnings(False)
        GPIO.setup(self.led_pin, GPIO.OUT)  # LED Output
        GPIO.setup(self.fan_pin, GPIO.OUT)  # Fan normal Output
        GPIO.setup(self.power_pin, GPIO.IN)  # set pin as input
        GPIO.setup(self.reset_pin, GPIO.IN,
                   pull_up_down=GPIO.PUD_UP)  # set pin as input and switch on internal pull up resistor
        GPIO.setup(self.check_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
        pwm_var = self.return_config_bool("PWM_FAN")
        if pwm_var is not "False":
            if pwm_var is "1":
                self.is_pwm = True
                self.fan_hysteresis_pwm = 20
                self.fan_starttemp_pwm = 50
                self.pwm=GPIO.PWM(self.fan_pin,50)
                self.pwm.start(0)
            if pwm_var is "2":
                self.is_pwm = True
                self.fan_hysteresis_pwm = 20
                self.fan_starttemp_pwm = 60
                self.pwm=GPIO.PWM(self.fan_pin,50)
                self.pwm.start(0)
            if pwm_var is "3":
                self.is_pwm = True
                self.fan_hysteresis_pwm = 20
                self.fan_starttemp_pwm = 70
                self.pwm=GPIO.PWM(self.fan_pin,50)
                self.pwm.start(0)



    def power_interrupt(self, channel):
        time.sleep(self.debounce_time)  # debounce
        if GPIO.input(self.power_pin) == GPIO.HIGH and GPIO.input(
                self.check_pin) == GPIO.LOW:  # shutdown function if the powerswitch is toggled
            self.led(0)  # led and fan off
            os.system("killall emulationstation") #end emulationstation
            self.blink(30, 0.1) #wait for the metadata to be safed
            self.fan(0)
            os.system("sudo shutdown -h now")

    def reset_interrupt(self, channel):
        if GPIO.input(self.reset_pin) == GPIO.LOW:  # reset function
            reset_counter = 0  # counter for the time funktion
            time.sleep(self.debounce_time)  # debounce time
            while GPIO.input(self.reset_pin) == GPIO.LOW:  # while the button is hold the counter counts up
                reset_counter = reset_counter + 1
                time.sleep(self.counter_time)
            if reset_counter > self.reset_hold_short:  # check if its hold more that one second
                if reset_counter <= self.reset_hold_long:  # if you hold it less than 5 sec it will toggle the fan
                    self.change_config_value("fan")
                    self.blink(3, 0.5)
                    self.led(1)
                if reset_counter > self.reset_hold_long:  # if you hold it more than 5 seconds if will toggle the bootupvideo
                    self.change_config_value("video")
                    self.blink(10, 0.5)
                    self.led(1)
            else:
                os.system("killall emulationstation")
                self.blink(15, 0.1)
                os.system("sudo reboot")

    def pcb_interrupt(self, channel):
        GPIO.cleanup()  # when the pcb is pulled clean all the used GPIO pins

    def temp(self):     #returns the gpu temoperature
        res = os.popen(self.temp_command).readline()
        return float((res.replace("temp=", "").replace("'C\n", "")))

    def led(self,status):  #toggle the led on of off
        if status == 0:       #the led is inverted
            GPIO.output(self.led_pin, GPIO.LOW)
        if status == 1:
            GPIO.output(self.led_pin, GPIO.HIGH)

    def blink(self,amount,interval): #blink the led
        for x in range(amount):
            self.led(1)
            time.sleep(interval)
            self.led(0)
            time.sleep(interval)

    def return_config_bool(self,searchterm):
        Config = configparser.ConfigParser()
        Config.read(self.config_file)  # read the configfile
        return Config.getboolean("Boot", searchterm)

    def fan(self,status):  #switch the fan on or off
        if status == 1:
            GPIO.output(self.fan_pin, GPIO.HIGH)
        if status == 0:
            GPIO.output(self.fan_pin, GPIO.LOW)

    def fancontrol_normal(self,hysteresis,starttemp):  #read the temp and have a buildin hysteresis
        if self.temp() > starttemp:
            self.fan(1)
        if self.temp() < starttemp-hysteresis:
            self.fan(0)

    def pwm_fancontrol(self,hysteresis, starttemp, temp):
        perc = 100.0 * ((temp - (starttemp - hysteresis)) / (starttemp - (starttemp - hysteresis)))
        perc=min(max(perc, 0.0), 100.0)
        self.pwm.ChangeDutyCycle(float(perc))

    def change_config_value(self,toggle_this):  #change one of the values in the config file
        parser = configparser.ConfigParser()
        parser.read(self.config_file)
        if self.return_config_bool(toggle_this):
            parser.set('Boot', toggle_this, "False")
            self.fan(0)
        else:
            parser.set('Boot', toggle_this, "True")
        with open(self.config_file, "w+") as configfile:
            parser.write(configfile)

    def check_video(self):
        if self.return_config_bool("video"):
            os.system("omxplayer " + self.intro_video + " &")  # start the bootvideo on start

    def check_fan(self):
        if self.return_config_bool("fan"):  # check if the fan is activated in the config
            if self.is_pwm:
                self.pwm_fancontrol(self.fan_hysteresis_pwm,self.fan_starttemp_pwm,self.temp())
            else:
                self.fancontrol_normal(self.fan_hysteresis,self.fan_starttemp)  # fan starts at 60 degrees and has a 5 degree hysteresis

    def attach_interrupts(self):
        if self.return_config_bool("pcb") and GPIO.input(self.check_pin) == GPIO.LOW:  # check if there is an pcb and if so attach the interrupts
            GPIO.add_event_detect(self.check_pin, GPIO.RISING,callback=self.pcb_interrupt)  # if not the interrupt gets attached
            if GPIO.input(self.power_pin) == GPIO.HIGH: #when the system gets startet in the on position it gets shutdown
                os.system("sudo shutdown -h now")
            else:
                self.led(1)
                GPIO.add_event_detect(self.reset_pin, GPIO.FALLING, callback=self.reset_interrupt)
                GPIO.add_event_detect(self.power_pin, GPIO.RISING, callback=self.power_interrupt)
        else:       #no pcb attached so lets exit
            GPIO.cleanup()
            exit()

snes = SNES()

snes.attach_interrupts()
snes.check_video()

while True:
    time.sleep(5)
    snes.led(1)
    snes.check_fan()

Last edited by CthulhuFan; 06-03-2019 at 10:11 AM.. Reason: Added bit about graceful power down.
CthulhuFan is offline   Reply With Quote
Old 06-03-2019, 01:48 PM   #25
BeardedSonOfNel
Chaotic Neutral
 
BeardedSonOfNel's Avatar
 
Join Date: Jun 2010
Location: MN/WI
Posts: 5,838
Blog Entries: 8
Quote:
Originally Posted by CthulhuFan View Post
Great idea for a thread/series! But, uh, yeah, some of those videos are gonna be VERY short. Just sayin', not that I have experience with that ever
Thanks, and yes some will be short, but on my honor I'll stick to my word.
__________________
None are more hopelessly enslaved than those who falsely believe they are free. Goethe
BeardedSonOfNel is offline   Reply With Quote
Old 06-03-2019, 01:51 PM   #26
BeardedSonOfNel
Chaotic Neutral
 
BeardedSonOfNel's Avatar
 
Join Date: Jun 2010
Location: MN/WI
Posts: 5,838
Blog Entries: 8
Quote:
Originally Posted by PacerDawn View Post
This is interesting. I haven't modded my cabinet yet because this build doesn't utilize the power switch on the cabinate itself (you have to turn it on and off via the power strip).

Thanks for the share. I've been eyeing this up. they have them at my Walmart for 299 right now.
__________________
None are more hopelessly enslaved than those who falsely believe they are free. Goethe
BeardedSonOfNel is offline   Reply With Quote
Old 06-03-2019, 01:52 PM   #27
BeardedSonOfNel
Chaotic Neutral
 
BeardedSonOfNel's Avatar
 
Join Date: Jun 2010
Location: MN/WI
Posts: 5,838
Blog Entries: 8
Quote:
Originally Posted by CthulhuFan View Post
You can use the GPIO to wire up an on/off switch that does a *graceful* power down. Here is an example, this is from the super Kintaro case that I run and is their script but you can see the meat and potatoes of what's going on. Sorry for the code spam.
That's awesome!
__________________
None are more hopelessly enslaved than those who falsely believe they are free. Goethe
BeardedSonOfNel is offline   Reply With Quote
Old 06-03-2019, 06:21 PM   #28
CthulhuFan
Subscriber
 
CthulhuFan's Avatar
 
Join Date: Aug 2018
Posts: 77
Quote:
Originally Posted by BeardedSonOfNel View Post
Thanks, and yes some will be short, but on my honor I'll stick to my word.
Hey, if you're going to subject yourself to this then at least get your joystick in the right config for the game. Right, playing a 4-way game w/an 8-way stick can fuck you; so, legit, get your stick set up right before you just pump a 'quarter' in and roll w/it. Just sayin' ...
CthulhuFan is offline   Reply With Quote
Old 06-03-2019, 06:27 PM   #29
CthulhuFan
Subscriber
 
CthulhuFan's Avatar
 
Join Date: Aug 2018
Posts: 77
Oh, and I vote for Black Tiger or Magic Sword.
CthulhuFan is offline   Reply With Quote
Old 06-03-2019, 08:00 PM   #30
BeardedSonOfNel
Chaotic Neutral
 
BeardedSonOfNel's Avatar
 
Join Date: Jun 2010
Location: MN/WI
Posts: 5,838
Blog Entries: 8
@CthulhuFan Right on!
BeardedSonOfNel is offline   Reply With Quote
Old 06-05-2019, 09:10 AM   #31
Misanthropist
Evil Dead
 
Join Date: Dec 2006
Posts: 327
yay pinball

Quote:
Originally Posted by BeardedSonOfNel View Post
I LOVE pinball, but I have yet to get my wife onboard with getting a table(s). I do play a lot of the emulators like Pinball FX and Pinball Arcade (which are far from the real deal), but they still bring me enjoyment in my home.
I used to play virtual pinball, but then a few years ago i joined a pinball league. best decision ever, So now i play a few hours every week! hangin out, drinkin beers with buddies. Lots of cities have leagues, and you can usually drop in as a sub player midseason to try it out - could be worth looking into.
One machine is all it takes to start a collection
Misanthropist is offline   Reply With Quote
Old 06-05-2019, 09:40 AM   #32
BeardedSonOfNel
Chaotic Neutral
 
BeardedSonOfNel's Avatar
 
Join Date: Jun 2010
Location: MN/WI
Posts: 5,838
Blog Entries: 8
Quote:
Originally Posted by Misanthropist View Post
I used to play virtual pinball, but then a few years ago i joined a pinball league. best decision ever, So now i play a few hours every week! hangin out, drinkin beers with buddies. Lots of cities have leagues, and you can usually drop in as a sub player midseason to try it out - could be worth looking into.
One machine is all it takes to start a collection
That's awesome! Unfortunately I live in the middle of nowhere, and it's very hard to find a machine around here. Any time I do happen to come across one I do play it until my wife drags me away
__________________
None are more hopelessly enslaved than those who falsely believe they are free. Goethe
BeardedSonOfNel is offline   Reply With Quote
Reply

Tags
arcade, mame, one quater one play

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:39 PM.