Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > sidplay detection?
2025-04-12 23:50
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.
2025-04-13 00:09
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.
2025-04-13 00:19
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)
2025-04-13 01:23
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?
2025-04-13 05:03
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.
2025-04-13 16:35
chatGPZ

Registered: Dec 2001
Posts: 11493
Interesting idea to detect sidplay though. Could be abused for some fun stuff (play calypso.sid) :)
2025-04-13 18:00
WVL

Registered: Mar 2002
Posts: 916
This sounds like the best way to do a Rick Roll!
2025-04-14 16:33
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)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
uneksija
Knut Clausen/SHAPE/F..
The Syndrom/TIA/Pret..
The Human Co../Maste..
Guests online: 111
Top Demos
1 Signal Carnival  (9.7)
2 Next Level  (9.7)
3 13:37  (9.7)
4 Codeboys & Endians  (9.7)
5 Coma Light 13  (9.6)
6 Mojo  (9.6)
7 Edge of Disgrace  (9.6)
8 The Trip  (9.6)
9 In Surgery  (9.6)
10 Uncensored  (9.6)
Top onefile Demos
1 Nine  (9.8)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 TRSAC, Gabber & Pebe..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.2)
5 Triad  (9.2)
Top Diskmag Editors
1 Magic  (10)
2 Jazzcat  (9.5)
3 Newscopy  (9.2)
4 hedning  (9.2)
5 Elwix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.19 sec.