Exploring screen saver functionality

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
dominicgarcia
Posts: 1
Joined: Thu Oct 10, 2024 3:02 am

Exploring screen saver functionality

Post by dominicgarcia »

I started thinking about screensavers, and then wondered if Vera could toggle the monitor on/off by setting a register perhaps? It would also be very cool if a screen saver routing could be loaded from a memory bank if there were no input signals detected from the kernal after so many minutes...
User avatar
ahenry3068
Posts: 1144
Joined: Tue Apr 04, 2023 9:57 pm

Re: Exploring screen saver functionality

Post by ahenry3068 »

dominicgarcia wrote: Thu Oct 10, 2024 3:04 am I started thinking about screensavers, and then wondered if Vera could toggle the monitor on/off by setting a register perhaps? It would also be very cool if a screen saver routing could be loaded from a memory bank if there were no input signals detected from the kernal after so many minutes...
Vera can turn it's layer's on & off. It's actually pretty simple. You could create a memory resident program that hooked the interrupt Vector. You could peek Keyboard Input but detecting Mouse Activity without clearing the activity would be a little harder but is probably doable. The only problem with such a program would be it would rob processor cycles more noticeably than on a faster platform.
DragWx
Posts: 345
Joined: Tue Mar 07, 2023 9:07 pm

Re: Exploring screen saver functionality

Post by DragWx »

If you set VERA Output Mode ($9F29) to 0 (video disabled), I'd wager that a VGA monitor will enter power-saving mode. If I'm reading the VERA's verilog correctly (in top.v), "video disabled" mode still uses the VGA mode vblank pulses for IRQs, even though there's nothing output on the connector, so vblank IRQs should still work.

You probably don't want to do that in composite or RGB mode, so just blanking the screen yourself (disable the layers and set the background color to black) would be what you do there.

If you want to show a screen saver animation, you could probably just turn off the layers, then show some sprites on the screen moving around.

The catch-all thing many SNES games do is that they just dim the screen by darkening the palette, usually when you pause. I know at least one game, Blackthorne, that actually has a screensaver animation when you leave the game alone for long enough.
mortarm
Posts: 302
Joined: Tue May 16, 2023 6:21 pm

Re: Exploring screen saver functionality

Post by mortarm »

Unless your using a CRT, screensavers are unnecessary. If you just want to blank the screen, it'd be easier to do so from the monitor itself.
User avatar
ahenry3068
Posts: 1144
Joined: Tue Apr 04, 2023 9:57 pm

Re: Exploring screen saver functionality

Post by ahenry3068 »

mortarm wrote: Sat Oct 26, 2024 3:49 am Unless your using a CRT, screensavers are unnecessary. If you just want to blank the screen, it'd be easier to do so from the monitor itself.
You may still want to do it on an unattended basis. I recently added that capability to Volume Control (My Audio Book Manager). My logic for doing it there was that I actually use Audio books as a go to sleep tool once in awhile. Why leave the monitor lit when your just listening. Now I did just disable the layers to blank the screen, I was actually concerned that Disable Video Output would mess with the VBlank IRQ. After reading this thread I may change that to actually doing a Video disable rather than just blanking the layers.
TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

Re: Exploring screen saver functionality

Post by TomXP411 »

Just to make things interesting.... LCDs work in reverse of CRT monitors.

That is, when an LCD cell is energized, it is black. So a a proper screen saver on an LCD panel would be an all-white screen.

However, as others have suggested, the correct way to put the monitor into power save mode is to turn off the VGA signal. The monitor should detect this and (eventually) enter power save mode. Some monitors will turn blue first, but every VGA LCD I've used will eventually enter power save mode after the VGA signal is lost.
DragWx
Posts: 345
Joined: Tue Mar 07, 2023 9:07 pm

Re: Exploring screen saver functionality

Post by DragWx »

I just played around for a bit, and here's what I found.

I'm currently using my TV with my X16, and my TV will enter power saving mode (with a message first) anytime there's no signal on the VGA port, regardless of whether a cable is physically connected.

Since I also use my TV for audio (3.5mm audio jack), I lose audio when this happens, so just FYI to keep video power saving configurable and not hardcoded if you're writing an audio-only program. Users who plug in separate speakers won't have this issue.

While video output is disabled, I can still type and execute BASIC commands, including FMPLAY, so vblank IRQs must still be working. Remember, the VERA has two slightly different vblank timings depending on whether you're on VGA or composite/RGB mode, and "video off" mode uses the VGA timings even though nothing is output on the VGA port.



And now for a point of interest: VGA monitors have the VESA Display Power Management Signaling (or DPMS) specification. It interestingly specifies 3 levels of sleep, with "off" being when both hsync and vsync are missing, which is what happens when you turn the VERA's video output off.

The article also mentions a competing standard, where a monitor detects when the video signal is valid but just a black screen for too long.
User avatar
ahenry3068
Posts: 1144
Joined: Tue Apr 04, 2023 9:57 pm

Re: Exploring screen saver functionality

Post by ahenry3068 »

DragWx wrote: Sat Oct 26, 2024 6:27 pm I just played around for a bit, and here's what I found.

I'm currently using my TV with my X16, and my TV will enter power saving mode (with a message first) anytime there's no signal on the VGA port, regardless of whether a cable is physically connected.

Since I also use my TV for audio (3.5mm audio jack), I lose audio when this happens, so just FYI to keep video power saving configurable and not hardcoded if you're writing an audio-only program. Users who plug in separate speakers won't have this issue.

While video output is disabled, I can still type and execute BASIC commands, including FMPLAY, so vblank IRQs must still be working. Remember, the VERA has two slightly different vblank timings depending on whether you're on VGA or composite/RGB mode, and "video off" mode uses the VGA timings even though nothing is output on the VGA port.



And now for a point of interest: VGA monitors have the VESA Display Power Management Signaling (or DPMS) specification. It interestingly specifies 3 levels of sleep, with "off" being when both hsync and vsync are missing, which is what happens when you turn the VERA's video output off.

The article also mentions a competing standard, where a monitor detects when the video signal is valid but just a black screen for too long.
Pretty much what I found. One interesting side effect on the Emulator if the 'VGA Signal' is turned off on the Emulator the screen will be blue, regardless of color settings or whatever was on the screen previously. Obviously on actual Hardware this is not the case.
Post Reply