Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Jedfox ! (Registered 2024-05-28) You are not logged in - nap
CSDb User Forums


Forums > CSDb Discussions > Music Inclusion, Request?
2007-03-17 19:00
Endurion

Registered: Mar 2007
Posts: 72
Music Inclusion, Request?

Hi,

this is my first post here.

I've just started to play with C64 assembly a few weeks ago and am working on my first game. It's no very technical sophisticated game so far but i'd really like to include some nifty music.

I'm working with ACME on Windows right now and included a goat tracker song for testing purposes. A working alpha can be downloaded from http://www.georg-rottensteiner.de/webmisc/joegunn-alpha.zip

It's an egypt tomb exploring game with some adventure elements. I'm looking for some egypt incluenced music.

Any hints on where i can find some for inclusion or better, anyone who wants to work with me on that one?

Thanks for any feedback and critics!

 
... 20 posts hidden. Click here to view all posts....
 
2007-03-21 15:24
Endurion

Registered: Mar 2007
Posts: 72
Hey, i'm glad for any answer, as i get something to play with :)

I doubt that i would've gotten so far without forums.
2007-03-21 15:25
Mace

Registered: May 2002
Posts: 1799
Well... after thinking it over once more; you could of course just include the code of or the JSR to the keyboard-scan subroutine in your own IRQ, without all the other stuff.

But hey... I think you're smart enough to find all the options yourself ;-)
2007-03-23 15:20
Endurion

Registered: Mar 2007
Posts: 72
Ok, i've found the next problem :)

Due to my code size i wish to relocate the sound player routine. Previously it sat at $9000, now i want it to be at $a000.

Since this area is overshadowed by the basic ROM which i do not use (i think) i turned it off with

lda $01
and #$f8
sta $01

But it looks when i start copying to $a000 (the music weighs in at $aa0 bytes right now) everything hangs.
I suspect the copy routine, but it worked before with the old values. If i skip it everything works (but the music, duh).

Am i missing something?

Edit: To be sure, here's the copy routine:

CURADD, CURADD2 and CURADD3 are addresses residing in the zero page:

CURADD = $FB
CURADD2 = $FD
CURADD3 = $2F


prepare_sound_player          

          ;remove the lowest three bits to show all RAM
          lda $01
          and #$f8
          sta $01
          
          lda #$00
          sta CURADD2
          lda #$a0
          sta CURADD2+1
          ;lobyte size (not really used)
          lda #$a0
          sta CURADD
          ;highbyte size
          lda #$0a
          sta CURADD+1
          lda #<goat_player
          sta CURADD3
          lda #>goat_player
          sta CURADD3+1

          ldy #0          
copy_sound_loop          
          lda (CURADD3),y
          sta (CURADD2),y
          iny
          bne copy_sound_loop
          
          ;256 bytes done
          inc CURADD2+1
          inc CURADD3+1
          dec CURADD+1
          bne copy_sound_loop
          
          ;copy rest
copy_sound_loop_b
          lda (CURADD3),y
          sta (CURADD2),y
          iny
          
          ;lobyte groesse
          cpy #$a0
          bne copy_sound_loop_b

copy_sound_done
2007-03-23 15:52
Mace

Registered: May 2002
Posts: 1799
Have you done a SEI before changing register $01?
2007-03-23 16:35
yago

Registered: May 2002
Posts: 332
You cant just copy a music-player, located at $9000, to $a000.

For examples, the first few lines of the music-player might be:

$9000 jmp $9107
$9003 jmp $9235

now, if you copy that code to $a000, it will still jump to $9107!!

you need to relocate the music, or just ask the musician to save it to a different address.

Have Fun,
Zed
2007-03-23 16:50
Hein

Registered: Apr 2004
Posts: 933
at the end, before leaving your transfer routine:

lda $01
ora #$07
sta $01
2007-03-23 16:53
Oswald

Registered: Apr 2002
Posts: 5029
you might fall back to my irq routine, as some1 pointed out, all you have to do is put $37 into $01 and call SCNKEY from the irq, then put $35 back. keeping $01 at $35 for the "main" program will make it possible to use all the ram under the code roms. It is even possiblee to use $34 which turns off all roms, AND turns on ram at the $d000-$e000 area. In case of $34 make sure to store the value of 01, and restore it at the end of the irq, so your code outside the irq may set 01 for itself.

yago is right, every piece of 6510 code is tied to the memory place it is assembled to, due to the heavy use of absolute adressing.

either you have to ask the musician to assemble the music to a new location.

or you may try with these ones:

http://noname.c64.org/csdb/search/?content=all&search=relocator..

if nothing is working I suggest opening a new topic here with the problem, and asking wether someone can recognize the player the music uses, and relocate it.
2007-03-23 16:56
Oswald

Registered: Apr 2002
Posts: 5029
http://cadaver.homeftp.net/

click on rants, there you have lots of extremely well written tutorials about game programming on the c64.
2007-03-23 17:02
Endurion

Registered: Mar 2007
Posts: 72
Whoa, lots of hints :)

Looks like SEI/CLI did the trick. So i need to disallow interrupts while switching the ROM/RAM flags.

@yago: Thanks, i had the routine relocated already. I'm copying the routine to the player location since i think you can't have more than one org commands inside a source code? Therefore the copy loop simply copies the music to the target routine (so i know where it's located at). Maybe later i don't have to do that if its still completely in "free" RAM.

I'm using sample songs of goat tracker; so i can simply have it relocate the player to a different address by exporting it.

I also had the error that i simply turned off ALL roms so the music player could not access the SID.

Everything works now, thanks guys! You're awesome!
2007-03-23 17:38
Oswald

Registered: Apr 2002
Posts: 5029
You dont need to sei, only make sure the d000 area is not ram, but the chip registers. All irqs needs to acess either VIC or the CIA to acknowledge the irq, if the IRQ pending state is not cleared then you'll get another irq right after exiting from your current one. Kernal assumes that d000 is always on, dont fool it :)
Previous - 1 | 2 | 3 - Next
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
Retroluzzer/Quantum
Sentinel/Excess/TREX
Mythus/Delysid
Hoild/Ultimate Newco..
wil
TheRyk/MYD!
Guests online: 128
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Aliens in Wonderland  (9.6)
6 Edge of Disgrace  (9.6)
7 No Bounds  (9.6)
8 Comaland 100%  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Happy Birthday Dr.J  (9.7)
2 Layers  (9.6)
3 It's More Fun to Com..  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (9.6)
6 Copper Booze  (9.6)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Rainbow Connection  (9.5)
9 Dawnfall V1.1  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.6)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

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