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 Coding > problem playing music/sids
2012-10-04 15:11
nomistake

Registered: Apr 2011
Posts: 29
problem playing music/sids

hello everyone,

i have a question. sometimes when i save sids as c64 data file and want to use them in a programm they don't work "the usual way". most of the files have an ini and a play address and if i jump to the ini first and then to the play adress i hear a note everytime i jump to the play address. but this one for example : Spy vs Spy is different. the ini is supposed to be at $3015 but it doesn't work when i just jump to it. and the play address is supposed to be at $954e ... so - how does that work if the file starts at $3000 and the size is only $0bb0 ?? i am confused. how can i get this (an other sids like that) to play?
2012-10-04 15:56
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
some sids unpack and relocate into original place in ram, when init. then you have to find out what ram they use, and maybe disable the IRQ installed in the init, if you want to use it in your own prog.
2012-10-04 15:58
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
such sids were placed in various ram spaces, and would be a 234 blocks file. then the parts were moved to 1 block by the ripper, and the init unpacks them back to where they should be, in order to work.
2012-10-04 16:00
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
spy vs spy unpacks data on the init to 9000 area, then does the init of the music, and the play address is located in 9000+ area.

the sids are not crunched, they are just raw-pack to one contiguous file.

you will have to examine the init/unpack code to find out where in ram the various pieces of the tune will be located after unpack.
2012-10-04 16:04
nomistake

Registered: Apr 2011
Posts: 29
Quote: spy vs spy unpacks data on the init to 9000 area, then does the init of the music, and the play address is located in 9000+ area.

the sids are not crunched, they are just raw-pack to one contiguous file.

you will have to examine the init/unpack code to find out where in ram the various pieces of the tune will be located after unpack.


well, yes - usually... but when i jump to the ini address it crashes... and i looked at the code (just briefly) and i couldn't find a reloc routine... well at least not at $3015 where the ini is supposed to be. i guess i need to take a closer look.
2012-10-04 18:28
iAN CooG

Registered: May 2002
Posts: 3136
Quote: well, yes - usually... but when i jump to the ini address it crashes... and i looked at the code (just briefly) and i couldn't find a reloc routine... well at least not at $3015 where the ini is supposed to be. i guess i need to take a closer look.

No reloc routine found? Very beginning:
3000  48        PHA
3001  A6 02     LDX $02
3003  A0 00     LDY #$00
3005  B1 FB     LDA ($FB),Y
3007  91 FD     STA ($FD),Y
3009  C8        INY
300A  D0 F9     BNE $3005

300C  E6 FC     INC $FC
300E  E6 FE     INC $FE
3010  CA        DEX
3011  D0 F0     BNE $3003

3013  68        PLA
3014  60        RTS

what do you think is this? =) The code at $3015 sets the pointers and calls this reloc to move 4 small pieces around the memory before calling the real init address, and when this is finished, the player is where is supposed to be, hence the play address works. It's true that could have been made better or even recoded to have all data pieces near the player, but this was the fastest way the ripper could think of when he did this.

Here's a clean version, you can relocate it safely with sidreloc if you want.
http://iancoog.altervista.org/Spy_vs_Spy.sid
2012-10-04 21:26
nomistake

Registered: Apr 2011
Posts: 29
well ok then. but when i load it and jump to $3015 my emulator(vice) just crashes - i must be doing something wrong. thanks anyway. i guess i'll figure it out eventually and use other sids until then.
2012-10-04 21:29
iAN CooG

Registered: May 2002
Posts: 3136
you are loading it wrong, works perfectly. Have you stripped the PSID header?
2012-10-04 22:06
nomistake

Registered: Apr 2011
Posts: 29
i loaded it with sidplay and saved it as a .dat file. this usually works fine for most of the sids.
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
Unlock/Padua/Albion
Picrard/Mayday
goto80/HT
zscs
Valsary/BD/ESM
Honesty/Covenant/Ons..
celticdesign/G★P/M..
Guests online: 90
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.04 sec.