| |
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?
|
|
| |
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. |
| |
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. |
| |
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. |
| |
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. |
| |
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 |
| |
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. |
| |
iAN CooG
Registered: May 2002 Posts: 3194 |
you are loading it wrong, works perfectly. Have you stripped the PSID header? |
| |
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. |