mrchrisster / MiSTer_SAM

154 stars 23 forks source link

tty2oled CMD Mode changed with Greyscale Support #95

Closed venice1200 closed 2 years ago

venice1200 commented 2 years ago

Hi, with the release of the Greyscale Support within tty2oled we changed the CMDTEXT and CMDGEO commands a bit.

Old CMD Mode: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command New CMD Mode: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command_v2

Text Changes: 0,1 = 1,15,0 1,1 = 2,15,0 2,1 = 3,15,0

Geo, there is no Ellipse any longer. Try something different like rounded edges.

Cheers

MilanPolle commented 2 years ago

I fixed it like this (the ellipse shape doesn't exist anymore, made it into a circle with changing greyscale:

` Intro echo "CMDCLS" > "${ttydevice}" echo "CMDTXT,0,15,0,0,9, Welcome to..." > "${ttydevice}" sleep 0.2 echo "CMDCLS" > "${ttydevice}" echo "CMDTXT,0,15,0,0,9, Welcome to..." > "${ttydevice}" sleep 0.2 echo "CMDCLS" > "${ttydevice}" echo "CMDTXT,0,15,0,0,9, Welcome to..." > "${ttydevice}" sleep 0.2 echo "CMDTXT,2,15,0,47,27, Super" > "${ttydevice}" sleep 0.2 echo "CMDTXT,2,15,0,47,45, Attract" > "${ttydevice}" sleep 0.2 echo "CMDTXT,2,15,0,47,61, Mode!" > "${ttydevice}"

    Transition effect
    echo "CMDGEO,6,4,127,31,31,0,0,0" > "${ttydevice}"
    sleep 0.2                                        
    echo "CMDGEO,6,8,127,31,63,0,0,0" > "${ttydevice}"
    sleep 0.2                                        
    echo "CMDGEO,6,12,127,31,127,0,0,0" > "${ttydevice}"
    sleep 0.2                                        
    echo "CMDGEO,6,15,127,31,255,0,0,0" > "${ttydevice}"
    sleep 0.2
    echo "CMDGEO,6,14,127,31,31,0,0,0" > "${ttydevice}"
    sleep 0.2                                        
    echo "CMDGEO,6,10,127,31,63,0,0,0" > "${ttydevice}"
    sleep 0.2                                        
    echo "CMDGEO,6,6,127,31,127,0,0,0" > "${ttydevice}"
    sleep 0.2                                        
    echo "CMDGEO,6,0,127,31,255,0,0,0" > "${ttydevice}"
    sleep 0.2

`

MilanPolle commented 2 years ago

Man, that code pasting system is horrible

MilanPolle commented 2 years ago

More correct and complete:

        echo "CMDCLS" > "${ttydevice}"
        echo "CMDTXT,1,15,0,0,9, Welcome to..." > "${ttydevice}"
        sleep 0.2
        echo "CMDCLS" > "${ttydevice}"
        echo "CMDTXT,1,15,0,0,9, Welcome to..." > "${ttydevice}"
        sleep 0.2
        echo "CMDCLS" > "${ttydevice}"
        echo "CMDTXT,1,15,0,0,9, Welcome to..." > "${ttydevice}"
        sleep 0.2
        echo "CMDTXT,3,15,0,47,27, Super" > "${ttydevice}"
        sleep 0.2
        echo "CMDTXT,3,15,0,47,45, Attract" > "${ttydevice}"
        sleep 0.2
        echo "CMDTXT,3,15,0,47,61, Mode!" > "${ttydevice}"
    fi
}

function tty_update() { # tty_update core game
    if [ "${ttyenable,,}" == "yes" ]; then
        # Wait for tty2oled daemon to show the core logo
        inotifywait -e modify /tmp/CORENAME
        sleep 10

        # Transition effect
        echo "CMDGEO,6,4,127,31,31,0,0,0" > "${ttydevice}"
        sleep 0.2                                        
        echo "CMDGEO,6,8,127,31,63,0,0,0" > "${ttydevice}"
        sleep 0.2                                        
        echo "CMDGEO,6,12,127,31,127,0,0,0" > "${ttydevice}"
        sleep 0.2                                        
        echo "CMDGEO,6,15,127,31,255,0,0,0" > "${ttydevice}"
        sleep 0.2
        echo "CMDGEO,6,14,127,31,31,0,0,0" > "${ttydevice}"
        sleep 0.2                                        
        echo "CMDGEO,6,10,127,31,63,0,0,0" > "${ttydevice}"
        sleep 0.2                                        
        echo "CMDGEO,6,6,127,31,127,0,0,0" > "${ttydevice}"
        sleep 0.2                                        
        echo "CMDGEO,6,0,127,31,255,0,0,0" > "${ttydevice}"
        sleep 0.2                                      

        # Split long lines - length is approximate since fonts are variable width!
        if [ ${#2} -gt 23 ]; then
            echo "CMDTXT,3,15,0,0,20,${2:0:20}..." > "${ttydevice}"
            echo "CMDTXT,3,15,0,0,40, ${2:20}" > "${ttydevice}"
        else
            echo "CMDTXT,3,15,0,0,20,${2}" > "${ttydevice}"
        fi
        echo "CMDTXT,2,5,0,0,60,on ${1}" > "${ttydevice}"
venice1200 commented 2 years ago

A tty2oled Update was released which supports more interesting commands like clear the display with transition effects.

mrchrisster commented 2 years ago

Ttyoled support is currently broken. Since my ttyoled setup isn't working I'm looking for some help on fixing this in the most recent SAM release

venice1200 commented 2 years ago

I will double check the current SAM version. How can I help with your hardware?

venice1200 commented 2 years ago

I have updated SAM to the current version and it works quite well for me. But you need to have the latest FW on your tty2oled device as the SAM Script uses now "waitforttyack" which waits for a tty2oled response back to the MiSTer to tell the MiSTer "command done, proceed".

The only issue I have with SAM is that I get autoplay enabled with every SAM update.

..and sometimes SAM hangs on TGFX games.

venice1200 commented 2 years ago

I think we can close this ticket!