| |
Quiss
Registered: Nov 2016 Posts: 52 |
sidplay detection?
Is there a way to, from within the code of a .sid, detect whether it's called from sidplay?
I have a .sid with samples, and I'd like to turn off the screen if it's only playing through sidplay, but refrain from touching (most of) the VIC if it's not. |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11493 |
officially - no
In practise? Yes sir. Write a small test which checks if the SHX/Y dependency on DMA works as expected - none of the players is accurate enough to emulate this. |
| |
Quiss
Registered: Nov 2016 Posts: 52 |
Gosh, checking SHX/SHY correctness is a pretty big hammer.
I was hoping for something simple, like maybe looking at the return address on the stack. (Which always seems to end with 7E, but the high byte changes, depending on where your .sid lives) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11493 |
now that i think of it... i think jsidplay might actually be accurate enough to emulate that stuff too :)
I dont think you can rely on simple things like stack address... there are various players, all using different implementations.
That said, what are you trying to achieve anyway? Can't you just provide a separate .sid version and be done with it? |
| |
Quiss
Registered: Nov 2016 Posts: 52 |
Just trying to be nice to players like PSID64 that want to display something on a (C64) screen. And at the same time, if the player doesn't have a display attached, I would like those badline cycles, please.
But yes, that means the sid will sound differently, depending on which player you use. So your idea of doing two separate sids sounds like a path forward, too. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11493 |
Interesting idea to detect sidplay though. Could be abused for some fun stuff (play calypso.sid) :) |
| |
WVL
Registered: Mar 2002 Posts: 916 |
This sounds like the best way to do a Rick Roll! |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1421 |
Alternately (and I realise this is not answering the question asked), you could use OSC3 to check if you're losing cycles to DMA, and only turn off the display if you are?
That way you're only killing the DMA if you're either on real hardware, or something emulating real hardware closely enough to be impacting your playback.
(lol @ rickrolling) |