| |
Technotron
Registered: Sep 2014 Posts: 23 |
help needed for simple demo
hi all,
first of all I have to tell that I'm pretty newbie in the scene, so bear with me.
I have coded a simple scroller in assembler located at $c000 and it works. now I would like to add some music located at $1003 but I don't know how to proceed. I need a small routine that could be called with JSR and that returns to the scroller after some bits of music is played.
I have tried with the following routine but it doesn't work since it continues playing without returning to the scroller:
c010 lda $d012
cmp #$80
bne $c010
inc $d020
jsr $1003
dec $d020
rts
can anybody help me? |
|
... 29 posts hidden. Click here to view all posts.... |
| |
Technotron
Registered: Sep 2014 Posts: 23 |
thanks to all those who replied.
@Conrad
Quote:... makes me assume that the branch condition (BNE) is checking if Y is not 0? If so, then you need to put code in to remember the Y register state
before it calls $1003. 99% of music routines will be using all A, X and Y registers.
yes that makes sense. I've added the lines you showed me but to no avail. I can't return from the sound routine.
@Oswald
Quote:also:
c008 ldy #$00
sty $c100
jsr $c100
this will put a BRK at c100, and then jsr it. not good.
also why jsr to $c100 in several loops which run for 255 times?
yes you are right. so, I put the sound routine to $0801 instead of $c100 but the problem is always that I cannot return to the scroller routine from the music routine.
@ The Phantom
I don't understand exactly what you mean. could you please write the full code in plain assembler so that I can write it to Hexmon? I use Hexmon to insert code in the c64.
@ Robo
Quote:
your code looks really strange to me, you must call the music player only once per frame.
I'm sorry for that, but like I said, I'm a newbie in the C=64 scene. Could you please write the full code in a manner that I could insert it in Hexmon? |
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
hi technotron, the example from the phantom is the one who makes the most sense, except that i would swap the jsr scroll and jsr music, since your scroller moves at $0400 ($d012 #$32) |
| |
Technotron
Registered: Sep 2014 Posts: 23 |
@ Testa
Unfortunately I don't understand exactly what the phantom said. I see there is the instruction SEI that sets the interrupt. but Interrupts are too much for my small knowledge of c=64 coding. I dare to ask what I've already asked before: could you please write the full assembler code that I can use with Hexmon?
Thanks in advance for your reply. |
| |
Oswald
Registered: Apr 2002 Posts: 5095 |
sei disables interrupts. and dont code in monitor do yourself a favor. use atlest the native (runs on c64) turbo assembler.
Getting started with Turbo Assembler
save / reload state to get back to source in emulator fast. its much easyer to relocate code (labels) this way. |
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
yeah use turbo assembler and a good cartridge like action replay... good luck
edit: you can get as much sources as you want from me but turbo assembler please... |
| |
lft
Registered: Jul 2007 Posts: 369 |
Quoting Technotronthis is the source code for the scroller:
c000 ldx #$4f
stx $fb
ldx #$c0
stx $fc
...
Many playroutines use fb/fc. Perhaps this is contributing to your trouble.
(Context: http://www.linusakesson.net/software/sidreloc/ ) |
| |
Technotron
Registered: Sep 2014 Posts: 23 |
@ Testa
Quote:edit: you can get as much sources as you want from me but turbo assembler please...
ok for turbo assembler. can you give me the sources of what you would do to make the scroller work with the music?
Thanks in advance
@ lft
Quote:Many playroutines use fb/fc. Perhaps this is contributing to your trouble.
thanks for pointing me to this I'll check out. |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
@Technotron... I don't think I could get any more basic than what I've commented.
I'd suggest you do some reading. There are a lot of materials on this site that will help you in this task.
Coders World 1, 2 or 3. C=hacking. ML Lessons.. To name very few.
While I hate plugging my past magazine, it seems to have played a GREAT role in exactly what you want to do. While it won't show you everything, it will give you a grasp of some basic routines and how to use them. All 3 magazines I've mentioned will help you greatly. |
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
technotron, okay give me your email adress or give me a PM.. |
| |
Technotron
Registered: Sep 2014 Posts: 23 |
@ The Phantom
Quote:Coders World 1, 2 or 3. C=hacking. ML Lessons.. To name very few.
these issues are very much appreciated. I don't think I would have found them without your quoting. If you have others please do suggest them, they may be of help to many beginners like myself.
@Oswald
good links are always welcome ;) |
Previous - 1 | 2 | 3 | 4 - Next |