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: 3194
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: 3194
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
Guests online: 99
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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