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


Forums > C64 Coding > SID file: ZP usage and model detection
2018-01-15 19:43
Zirias

Registered: Jan 2014
Posts: 20
SID file: ZP usage and model detection

Hi all,

I just had the idea to build a SID file directly from my game's source. This seemed to work fine in a win32 sid player I tried, still I have two questions:

- my play routine uses *a lot* of zeropage (all internal state plus a set of shadow registers), just because I had enough available in my game. Could this be a problem with some players? Are there some guidelines about zp usage?

- the init routine contains a model detection using the method from here: http://codebase64.org/doku.php?id=base:detecting_sid_type_-_saf.. -- can I safely keep this in a sid file or should I remove it?
2018-01-16 10:16
iAN CooG

Registered: May 2002
Posts: 2000
zp can be safely used as you want, $02-$ff. Don't assume it's zeroed, always init the locations.
The detection could fail in older players, as you check VIC regs and rely on correct SID emulation, so don't count on it working everywhere.
I sometime onefile sids released as 2 sids, 6581 and 8580 versions of the same tune, but appear just altered in few bytes to adjust instruments, I add a routine to patch those bytes depending on the selected subtune, tune 0 for 6581 and tune 1 for 8580, so one can just change the sidmodel in his sidplayer and choose which to play, also leaving him the freedom to listen to each with the WRONG sidmodel if he wants. =)
2018-01-16 12:21
Zirias

Registered: Jan 2014
Posts: 20
Thanks, that's a nice idea! My code only self-mods a pointer to the filter table depending on the SID model, so I could easily adapt this to use the tune number instead.
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
Visage/Lethargy
Impetigo/Crescent
Merlin/JAM
Stack J./Triumwyrat,..
ΛΛdZ
Inge/HVSC
ghost/excess
rail slave/Hokuto Fo..
Krill/Plush
Ant (Anthony Stiller)
Flavioweb/🇮🇹ASR/HF🇮🇹..
Curlin
Tom-Cat/Nostalgia
blendo75
Marq/Fit^Lieves!Tuor..
Guests online: 57
Top Demos
1 Uncensored  (9.7)
2 Comaland 100%  (9.7)
3 Edge of Disgrace  (9.7)
4 Coma Light 13  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 We Come in Peace  (9.6)
8 Lunatico  (9.6)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Party Horse  (9.6)
3 Daah, Those Acid Pil..  (9.5)
4 Pandemoniac Part 2 o..  (9.5)
5 Treu Love [reu]  (9.5)
6 Arok 20 Invitation  (9.5)
7 Merry Xmas 2017  (9.4)
8 Dawnfall V1.1  (9.4)
9 In Memoriam BHF  (9.4)
10 Dawnfall  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.9)
2 Veto  (9.8)
3 Mirage  (9.7)
4 Jailbird  (9.6)
5 Hein  (9.5)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.052 sec.