| View previous topic :: View next topic |
| Author |
Message |
Newbie

Joined: 30 Jul 2002 Posts: 44 Location: United Kingdom
|
Posted: Tue Jul 30, 2002 2:38 pm Post subject: Assembler Beginner. |
|
|
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...
Thanks |
|
| Back to top |
|
 |
Groupie

Joined: 26 May 2002 Posts: 224
|
Posted: Tue Jul 30, 2002 3:33 pm Post subject: |
|
|
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 |
|
 |
Groupie


Joined: 05 Jul 2002 Posts: 228 Location: Göteborg,Sweden
|
Posted: Tue Jul 30, 2002 6:51 pm Post subject: |
|
|
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 |
|
 |
Newbie

Joined: 30 Jul 2002 Posts: 44 Location: United Kingdom
|
Posted: Tue Jul 30, 2002 7:11 pm Post subject: Thanks |
|
|
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 |
|
 |
Groupie

Joined: 26 May 2002 Posts: 224
|
Posted: Tue Jul 30, 2002 8:23 pm Post subject: |
|
|
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 |
|
 |
Groupie in Training


Joined: 22 Jul 2002 Posts: 121
|
Posted: Wed Jul 31, 2002 12:35 pm Post subject: |
|
|
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 |
|
 |
Master of C64


Joined: 28 Dec 2001 Posts: 1201 Location: Germany, Munich
|
Posted: Wed Jul 31, 2002 12:42 pm Post subject: Re: Thanks |
|
|
| 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 |
|
 |
Groupie


Joined: 05 Jul 2002 Posts: 228 Location: Göteborg,Sweden
|
Posted: Wed Jul 31, 2002 2:50 pm Post subject: Re: Thanks |
|
|
| 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 |
|
 |
Grandmaster of C64


Joined: 19 Mar 2002 Posts: 2310 Location: Leeds, UK Twonk: qazi
|
Posted: Wed Jul 31, 2002 3:44 pm Post subject: |
|
|
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 |
|
 |
Groupie


Joined: 30 Dec 2001 Posts: 234 Location: Espańa
|
Posted: Wed Jul 31, 2002 10:39 pm Post subject: |
|
|
| 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 |
|
 |
Groupie

Joined: 26 May 2002 Posts: 224
|
Posted: Wed Jul 31, 2002 10:55 pm Post subject: |
|
|
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 |
|
 |
Groupie in Training


Joined: 22 Jul 2002 Posts: 121
|
Posted: Thu Aug 01, 2002 8:25 am Post subject: |
|
|
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 |
|
 |
Groupie

Joined: 26 May 2002 Posts: 224
|
|
| Back to top |
|
 |
Grandmaster of C64


Joined: 19 Mar 2002 Posts: 2310 Location: Leeds, UK Twonk: qazi
|
Posted: Thu Aug 01, 2002 10:16 am Post subject: |
|
|
| 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 |
|
 |
Groupie in Training


Joined: 22 Jul 2002 Posts: 121
|
|
| Back to top |
|
 |
Groupie


Joined: 18 Jun 2002 Age: 27 Posts: 259 Location: Macedonia
|
Posted: Thu Aug 08, 2002 10:42 am Post subject: |
|
|
| 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 |
|
 |
Newbie

Joined: 30 Jul 2002 Posts: 44 Location: United Kingdom
|
Posted: Thu Aug 08, 2002 10:49 am Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
Master of C64


Joined: 28 Dec 2001 Age: 38 Posts: 1261 Location: 6502
|
Posted: Sat Aug 10, 2002 12:25 am Post subject: ... |
|
|
I use LeechFTP by Jan Debis. |
|
| Back to top |
|
 |
Groupie in Training


Joined: 11 Feb 2002 Posts: 124 Location: SWEDEN (Sandviken)
|
Posted: Wed Aug 14, 2002 6:38 am Post subject: |
|
|
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 |
|
 |
Groupie in Training


Joined: 22 Jul 2002 Posts: 121
|
|
| Back to top |
|
 |
|