| |
Jack-Paw-Judi Account closed
Registered: May 2021 Posts: 6 |
Converting SDI PRG to SID
Hi, I've finished an SDI tune, assembled it in s.sdi21-spd50 (it's an 8x speed tune). In the music player it plays as expected, but when converting it in Sidedit I can't get it to work. It sounds like a bunch of farts.
Tried everything for a couple of days, realC64, playSid, different start- + init adresses to no avail. All parameters are adjusted: flags, names etc.
I loaded an 6R6 multispeed to view the Sid data and it shows a TAX at 0fff. I tried running it through PRG2SID which places a TAX at 0fff, but this also didn't have any effect.
N.B. when converting a 1 speed song it works.
Does anyone have an idea what the solution is? There must be something I'm overlooking. Is the TAX preferable at 000f? is using PRG2SID the right way?
Thank you! |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
for anything multispeed you'll need to code a little startup code that sets the cia timers accordingly, and then convert to a .sid that uses cia timer. there is no automatic way to doit. |
| |
Jack-Paw-Judi Account closed
Registered: May 2021 Posts: 6 |
ok, sounds good. As I'm quite new to this and not a coder, is there anything you can point to? Would an assembly course be a good thing or would copy an pasting such a code from another SID be an option? Saw the coder of prg2sid talk about that, if I remember correctly. |
| |
iAN CooG
Registered: May 2002 Posts: 3132 |
You can borrow code from another 8x SDI tune, for example
/MUSICIANS/B/Blues_Muz/Gallefoss_Glenn/Sidastic.sid
Filetype: PSID Offset: 0x7c
Init: $0fe5 Play: $0ff5
TITLE: Sidastic
AUTHOR: Glenn Rune Gallefoss
RELEASED: 1999 SHAPE/Blues Muz'
Filename: Sidastic.sid
Loading address: $0FE5
; this is the new init, sets CIA timers for ($4cc8/8)-1 cycles which is the time taken to trigger exactly 8 play calls in the same frame
0FE5 AA TAX
0FE6 A9 98 LDA #$98
0FE8 8D 04 DC STA $DC04
0FEB A9 09 LDA #$09
0FED 8D 05 DC STA $DC05
0FF0 8E F9 0F STX $0FF9
0FF3 D0 0B BNE $1000
; this is the new play address, it calls one time $1003 and 7 times $1009, then loops
0FF5 EE F9 0F INC $0FF9
0FF8 A9 00 LDA #$00
0FFA 29 07 AND #$07
0FFC F0 05 BEQ $1003
0FFE D0 09 BNE $1009
; the actual tune code starts here
1000 4C 6A 20 JMP $206A
1003 4C D0 19 JMP $19D0
1006 4C CE 20 JMP $20CE
1009 AD D3 19 LDA $19D3
[...]
|
| |
Jack-Paw-Judi Account closed
Registered: May 2021 Posts: 6 |
Great, will give that a go! |
| |
iAN CooG
Registered: May 2002 Posts: 3132 |
Also, remember to set the sid header speed field to 0x00000001 at offset 0x12, which means "subtune 1 play routine is called using CIA timers, instead of once per vertical blank"
00000000: 50 53 49 44-00 02 00 7C-00 00 0F E5-0F F5 00 01 PSID ☻ | ☼Õ☼§ ☺
00000010: 00 01 00 00-00 01 53 69-64 61 73 74-69 63 00 00 ☺ ☺Sidastic
|
| |
Jack-Paw-Judi Account closed
Registered: May 2021 Posts: 6 |
ok thanks! will let know as soon as I've fixed it. |
| |
Jack-Paw-Judi Account closed
Registered: May 2021 Posts: 6 |
Ok, so I've been flying around a lot but have not landed yet. I've downloaded Ultra-edit, read the Sid-file-format.txt and studied it with the Sidastic sid. (in the hex editor) Also I read Ripping for dummies on the HVSC site, there a couple of markers that are mentioned which relate to changes in the volume register. (cgkoty or aeinrw) I'll come back to that.
I tried to copy and paste the data in the editor from Sidastic and paste it in my file, Which didn't work. When I load it in Sidedit it doesn't look like something was added but messed up.
Also, When following the Sid-file-format.txt it says at a certain point "end of the header" (Offset 7d if I remember correctly) But in Sidastic there is a lot more information before the music data including the cgkoty code. (which my file doesn't contain)
So my questions would be:
1. Do I convert the prg to a sid file first in sidedit, or load the prg directly in Ultra-edit? and then load it in sidedit to save as a .sid?
2.Am I on the right track by trying to copy paste the data between files? and if so, until what exact location? Or is it only adjusting certain locations 1 by 1?
3. Also you mentioned setting the sid header speed field, but wouldn't that allready be the correct setting if I copied from Sidastic? This is a little bit confusing.
4. What things are done in sidedit and what things in Ultra-edit? The copying and pasting doesn't seem to work.
5. Do I have to use the padding in Sidedit to add extra code in front of the present code and then open it in Hex editor?
this is Sidastic
;0FE5 AA TAX
;0FE6 A9 98 LDA #$98
;0FE8 8D 04 DC STA $DC04
;0FEB A9 09 LDA #$09
;0FED 8D 05 DC STA $DC05
;0FF0 8E F9 0F STX $0FF9
;0FF3 D0 0B BNE $1000
;0FF5 EE F9 0F INC $0FF9
;0FF8 A9 00 LDA #$00
;0FFA 29 07 AND #$07
;0FFC F0 05 BEQ $1003
;0FFE D0 09 BNE $1009
;1000 4C 6A 20 JMP $206A
;-------------------------------
;1003 4C D0 19 JMP $19D0
My Sid after copy/paste (which is useless)
;4CE5 60 RTS
;-------------------------------
;4CE6 1A ***
;4CE7 4C 8C 13 JMP $138C
;-------------------------------
;4CEA 4C 17 1B JMP $1B17
;-------------------------------
;4CED 4C FC 10 JMP $10FC
;-------------------------------
;4CF0 2D 53 50 AND $5053
;4CF3 45 45 EOR $45
;4CF5 44 ***
;4CF6 50 4C BVC $4D44
;4CF8 41 59 EOR ($59,X)
;4CFA 45 52 EOR $52
;4CFC 20 56 32 JSR $3256
;4CFF 2E 31 20 ROL $2031
;4D02 42 ***
;4D03 59 20 47 EOR $4720,Y
Hope this all makes sense, as I said I'm not a coder. I hope I'm overcomplicating things and there is clear way to do it.
Thank you. |
| |
iAN CooG
Registered: May 2002 Posts: 3132 |
ok you clearly have no clue where to even start, but don't worry, not everyone has coding experience.
Send the compiled SDI tune to me at hvsc@c64.org and I'll make a sid for you. |
| |
Jack-Paw-Judi Account closed
Registered: May 2021 Posts: 6 |
thanks Ian, Sent! |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
I srsly wonder why noone made a little tool for this yet :) |