Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > help needed for simple demo
2014-09-29 07:46
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....
 
2014-09-29 15:58
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?
2014-09-29 16:07
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)
2014-09-29 16:38
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.
2014-09-29 17:28
Oswald

Registered: Apr 2002
Posts: 5017
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.
2014-09-29 18:53
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...
2014-09-29 19:26
lft

Registered: Jul 2007
Posts: 369
Quoting Technotron
this 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/ )
2014-09-30 07:24
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.
2014-09-30 09:24
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.
2014-09-30 11:38
Testa
Account closed

Registered: Oct 2004
Posts: 197
technotron, okay give me your email adress or give me a PM..
2014-09-30 17:50
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
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
HBH.ZTH/Abnormal
Menace/Spaceballs
Guests online: 127
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

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