| |
Endurion
Registered: Mar 2007 Posts: 73 |
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.... |
| |
Endurion
Registered: Mar 2007 Posts: 73 |
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. |
| |
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 ;-) |
| |
Endurion
Registered: Mar 2007 Posts: 73 |
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
|
| |
Mace
Registered: May 2002 Posts: 1799 |
Have you done a SEI before changing register $01? |
| |
yago
Registered: May 2002 Posts: 333 |
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
|
| |
Hein
Registered: Apr 2004 Posts: 946 |
at the end, before leaving your transfer routine:
lda $01
ora #$07
sta $01 |
| |
Oswald
Registered: Apr 2002 Posts: 5086 |
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. |
| |
Oswald
Registered: Apr 2002 Posts: 5086 |
http://cadaver.homeftp.net/
click on rants, there you have lots of extremely well written tutorials about game programming on the c64. |
| |
Endurion
Registered: Mar 2007 Posts: 73 |
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! |
| |
Oswald
Registered: Apr 2002 Posts: 5086 |
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 |