Commodore 64 (C64) Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Assembler Beginner.

 
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> Help & Support
View previous topic :: View next topic  
Author Message
Pixel
Newbie


Joined: 30 Jul 2002
Posts: 44
Location: United Kingdom

PostPosted: Tue Jul 30, 2002 2:38 pm    Post subject: Assembler Beginner. Reply with quote

I will probably be asking a lot of beginner related questions on this board so here goes.....

How can I load a SID tune into the memory?
1. From a monitor and
2. in Turbo assembler

Well theres one question for now...

Razz

Thanks
Back to top
View user's profile Send private message Visit poster's website
puterman
Groupie
Groupie


Joined: 26 May 2002
Posts: 224

PostPosted: Tue Jul 30, 2002 3:33 pm    Post subject: Reply with quote

Strip off the psid header (the first 124 bytes) and you have a .prg file, which you load from BASIC or the monitor, ie. with

load "file",8,1

or

.l "file",08
Back to top
View user's profile Send private message
hollowman
Groupie
Groupie


Joined: 05 Jul 2002
Posts: 228
Location: Göteborg,Sweden

PostPosted: Tue Jul 30, 2002 6:51 pm    Post subject: Reply with quote

2. in turbo assembler:

lda #$08
tax
tay
jsr $ffba
lda #nameend-name
ldx #<name
ldy#>name
jsr $ffbd
lda #$00
jsr $ffd5
rts
name .text "filename"
nameend
Back to top
View user's profile Send private message
Pixel
Newbie


Joined: 30 Jul 2002
Posts: 44
Location: United Kingdom

PostPosted: Tue Jul 30, 2002 7:11 pm    Post subject: Thanks Reply with quote

How can you specify a memory location to load it into. In a monitor and in Turbo Assembler again??

For example: In this tutorial I saw it says "Load your tune into $1000"

Thanks
Back to top
View user's profile Send private message Visit poster's website
puterman
Groupie
Groupie


Joined: 26 May 2002
Posts: 224

PostPosted: Tue Jul 30, 2002 8:23 pm    Post subject: Reply with quote

A .prg file includes a load address, so if the tune loads to $1000, by loading it from BASIC (with ,8,1) or from the monitor, it'll end up at $1000 if that's the load address of the file, and most tunes have $1000 as the load address.

I suggest you read the documentation for your monitor.
Back to top
View user's profile Send private message
Stryyker
Groupie in Training
Groupie in Training


Joined: 22 Jul 2002
Posts: 121

PostPosted: Wed Jul 31, 2002 12:35 pm    Post subject: Reply with quote

I suggest you go to the SIDPlay home, I can't remember where and download the docs. In the header if you don't use SIDPlay to save as C64 data then you'll need to hunt around and there is an offset. Some tunes may be have PSID 1 header although most would have PSID 2 header. I suggest you get Programmers Reference Guide from http://project64.c64.org/ as it has some light Kernal ROM jump table descriptions then sit abd practise.
Back to top
View user's profile Send private message
WiDDY
Master of C64
Master of C64


Joined: 28 Dec 2001
Posts: 1201
Location: Germany, Munich

PostPosted: Wed Jul 31, 2002 12:42 pm    Post subject: Re: Thanks Reply with quote

Pixel wrote:
How can you specify a memory location to load it into. In a monitor and in Turbo Assembler again??

For example: In this tutorial I saw it says "Load your tune into $1000"

Thanks


L"<filename>",<drivenum>,<startadress>

For example, if you want to load the file "music" from drive 8 to $1000, enter

L"music",08,1000


WiDDY.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hollowman
Groupie
Groupie


Joined: 05 Jul 2002
Posts: 228
Location: Göteborg,Sweden

PostPosted: Wed Jul 31, 2002 2:50 pm    Post subject: Re: Thanks Reply with quote

Pixel wrote:
How can you specify a memory location to load it into. In a monitor and in Turbo Assembler again??

For example: In this tutorial I saw it says "Load your tune into $1000"

Thanks

lda #$08
tax
ldy #$00
jsr $ffba
lda #nameend-name
ldx #<name
ldy#>name
jsr $ffbd
lda #$00
ldx #<$1000
ldy #>$1000
jsr $ffd5
rts
name .text "filename"
nameend
Back to top
View user's profile Send private message
TMR
Grandmaster of C64
Grandmaster of C64


Joined: 19 Mar 2002
Posts: 2310
Location: Leeds, UK Twonk: qazi

PostPosted: Wed Jul 31, 2002 3:44 pm    Post subject: Reply with quote

i've not been paying attention, has anyone mentioned yet that, if a tune isn't originally located at $1000, a forced load to that address won't automatically make it work there...?

SIDPlay Win has an option to save .SID files out without the headers too, just load 'em up and select "C64 data (*.dat)" in the "Save as" option. The file that gets saved is a PRG file (just rename it) with the correct headers.
Back to top
View user's profile Send private message Visit poster's website
MorGor
Groupie
Groupie


Joined: 30 Dec 2001
Posts: 234
Location: Espańa

PostPosted: Wed Jul 31, 2002 10:39 pm    Post subject: Reply with quote

TMR wrote:
i've not been paying attention, has anyone mentioned yet that, if a tune isn't originally located at $1000, a forced load to that address won't automatically make it work there...?


Of course a tune located at $8000 would not run if you simply loaded it to $1000. All table pointers would point to nirvana, most "jmp"s and "jsr" as well, etc.
Relocating tunes is possible, but I would not call that a beginner's task (unless you happen to possess a relocating tool for the specific player routine you are dealing with, but that will hardly be the case if you use freshly downloaded .sid files).
Back to top
View user's profile Send private message
puterman
Groupie
Groupie


Joined: 26 May 2002
Posts: 224

PostPosted: Wed Jul 31, 2002 10:55 pm    Post subject: Reply with quote

It isn't actually very difficult to relocate a tune by hand. All you have to do is to change all absolute addresses that point to locations within the tune (code, data) itself. I've done this a couple of times, but only with JCH's player, I think (I might have done it with some DMC tune as well, but I can't really remember).
Back to top
View user's profile Send private message
Stryyker
Groupie in Training
Groupie in Training


Joined: 22 Jul 2002
Posts: 121

PostPosted: Thu Aug 01, 2002 8:25 am    Post subject: Reply with quote

for many tunes it's easy to hand do but once anything more than the highest 4 bits of a 16 bit address needs to be changed then it gets a little harder. Worst of all is something where all 16 bits of absolute addresses need changing. That's wh you write a small 512 byte routine which checks for for absolute addressing and then checks if it's in a range to move then add/subtract. It's easier than it seems. The only hard bit then is changing internal tables for the music routine like sectors/sequence tables and more.
Back to top
View user's profile Send private message
puterman
Groupie
Groupie


Joined: 26 May 2002
Posts: 224

PostPosted: Thu Aug 01, 2002 10:09 am    Post subject: Reply with quote

Yes, that's obviously harder, but how often do you need you tune to start at $33b5? Smile
Back to top
View user's profile Send private message
TMR
Grandmaster of C64
Grandmaster of C64


Joined: 19 Mar 2002
Posts: 2310
Location: Leeds, UK Twonk: qazi

PostPosted: Thu Aug 01, 2002 10:16 am    Post subject: Reply with quote

puterman wrote:
Yes, that's obviously harder, but how often do you need you tune to start at $33b5? :-)


It's more a case of moving a tune from $33b5 to $1000 - like what the SIDBurners series have (and no, i didn't relocate any of the tunes in SB5! =-)
Back to top
View user's profile Send private message Visit poster's website
Stryyker
Groupie in Training
Groupie in Training


Joined: 22 Jul 2002
Posts: 121

PostPosted: Thu Aug 01, 2002 10:57 am    Post subject: Reply with quote

You're right TMR, I remember a Reyn tune from Dutch Breeze. I actually did it by hand and hope to never need to do that again Smile
Back to top
View user's profile Send private message
Laze Ristoski
Groupie
Groupie


Joined: 18 Jun 2002
Age: 27
Posts: 259
Location: Macedonia

PostPosted: Thu Aug 08, 2002 10:42 am    Post subject: Reply with quote

puterman wrote:
Strip off the psid header


I made a little piece of code for this. It supports both versions of the header and adds a player. But it doesn't support DIGIs...

Unfortunately, I don't have a site where I can upload it.
I don't even have any experiences with uploading. :oops:

I heard about CuteFTP, but I would like to know what you guys think about it. What's the tool you use for uploading.
Back to top
View user's profile Send private message
Pixel
Newbie


Joined: 30 Jul 2002
Posts: 44
Location: United Kingdom

PostPosted: Thu Aug 08, 2002 10:49 am    Post subject: Reply with quote

I use CuteFTP pro. I only have the trial version though. It's pretty good and easy to use.

Try www.download.com to get it. I think I got my copy from there. Wink
Back to top
View user's profile Send private message Visit poster's website
Rough
Master of C64
Master of C64


Joined: 28 Dec 2001
Age: 38
Posts: 1261
Location: 6502

PostPosted: Sat Aug 10, 2002 12:25 am    Post subject: ... Reply with quote

I use LeechFTP by Jan Debis.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
XTRO
Groupie in Training
Groupie in Training


Joined: 11 Feb 2002
Posts: 124
Location: SWEDEN (Sandviken)

PostPosted: Wed Aug 14, 2002 6:38 am    Post subject: Reply with quote

OT: Or you can use Internet Explorer like this:
ftp://username:password@ftp.server.com/
and just copy your files ...
_________________
/XTRO of Whoop!
()xxxxxx][>>>>>>>>>>>>>
Back to top
View user's profile Send private message Send e-mail
Stryyker
Groupie in Training
Groupie in Training


Joined: 22 Jul 2002
Posts: 121

PostPosted: Wed Aug 14, 2002 12:24 pm    Post subject: Reply with quote

I made a rough prg > sid DOS tool that only supports 1 tune though and uses PSID2 header. It can do multispeed (evenly spaced) tunes but no digi. Current, atleast old method is not nice digi handling Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> Help & Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Tip: Get C64 Forever for super-comfy C64 emulation with pre-installed games, demos and other goodies!


Powered by phpBB © 2001, 2005 phpBB Group