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 > Four split rasterbar with moving color and music
2009-10-28 20:56
8bitforever
Account closed

Registered: Oct 2009
Posts: 48
Four split rasterbar with moving color and music

Eight hours ago I proudly coded a wonderful stable four split rasterbar with the colors moving within the rasterbar with different timing.
The stable raster was provided by http://www.ffd2.com/fridge/vic/stableraster.txt.

Three hours ago I got the idea to play some music to.
I tried to place jsr $1003 in irq3. I tried to place jsr $1003 in the main or hold loop and start it at a specific raster location. The music plays fine with both methods but my wonderful four split rasterbar starting location seems to move by 1 or 2 cycles. This makes the rasterbar move slightly to the right and back. It almost moves to the music.

Question 1) What is the reason for this ?
Question 2) What can be done to make it stable again ?




2009-10-28 21:06
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Forget it all.

Learn to code it yourself, or forget it all.
2009-10-28 21:15
plagueis
Account closed

Registered: Dec 2007
Posts: 48
This guy has been communicating with me via PM, and I've told him the same. The fun part is going through great frustration, sometimes for hours at a time, and then feeling that great release when your routine finally does what you want.

@8bitforever,

Like I said in my last letter...relax. Learn to code a 1x1 scroller. Make your own character set. Pixel a logo, learn to display it on the screen. Swing it, tech it, enjoy yourself. Try not to be so eager to show out and leech.

-DP
2009-10-28 21:19
8bitforever
Account closed

Registered: Oct 2009
Posts: 48
Come on guys...
What´s is the point of a coding forum if you cannot at least give a small hint or answer to the subject in some way ?

Please give me something on question 1 or question 2.
I´m working hard to learn.
2009-10-28 21:36
plagueis
Account closed

Registered: Dec 2007
Posts: 48
Then we harshly differ on the proper way to learn. I spelled it out for you once in a private message and mentioned that I am relatively new to demos on the c64 as well, but you don't seem to reply to the important things I say either, such as my advice that you start with the basics, and aim to learn about how the VIC works before worrying about impressing people.

Intelligent questions are a great thing, after you've showed a penchant for hard work. But with you it keeps coming back to one thing, asking for a handout. I actually haven't posted much on this forum, because I'm usually too busy coding, so what you ought to do is forget stable rasters for now, and just set up some routines on the screen using $d012 polling wait loops.

When I ask more experienced coders questions, I expect a reply which gives an explanation of the procedure of how to pull off an effect, or even a partial one. Like a verbal flow chart...an algorithm. It's no fun when the most exciting aspects of coding are given away from the outset. In addition, it often takes longer to reverse engineer source than to code something from scratch (at least for me).

-DP
2009-10-28 21:47
8bitforever
Account closed

Registered: Oct 2009
Posts: 48
IRQ instable with music playing?!

The music problem has been discussed here before.
Is there something more to add to this subject matter ?
2009-10-28 22:16
Mr. SID

Registered: Jan 2003
Posts: 424
2009-10-28 22:33
Stryyker

Registered: Dec 2001
Posts: 465
Look for what a proper stable raster interrupt is. There have been discussions on this forum about them. I found double interrupt the easiest to use especially if there are no sprites. There are some docs somewhere that description what the processor does when an interrupt is triggered.

I suspect what has happened is without the music the rest of the code falls in to nice cycle use. Music will be much more variable.

Do you use PAL or NTSC configurations?
2009-10-28 22:49
8bitforever
Account closed

Registered: Oct 2009
Posts: 48

Stryyker, I use PAL.
Yes, the split rasterbars are perfect without the music.
Where should I put the music to be able to handle it´s variable cycles ?
The music seems to push the starting point of the rasterbar by one or two cycles variable. The rasterbar jumps to the right and then back.
The rasterbar is in irq2.
The music in irq3.
2009-10-28 23:11
8bitforever
Account closed

Registered: Oct 2009
Posts: 48
Thanks PAL, :-)

You lead me to it Stryyker !

The NOP:s I forgot to remove in fungus code.
; nop ;<--- remove 1 NOP for PAL

Very simple !
Problem Solved.
Now the music plays and the split rasterbar is stable.



2009-10-28 23:48
plagueis
Account closed

Registered: Dec 2007
Posts: 48
Nice, a little bit longer and you would have solved that completely on your own.

Here's something that will help you with simple visualization of basic timing issues:

In your IRQ's (or $d012 wait loops) do this:

IRQ:

inc $d020
jsr music
dec $d020

dec $d020
jsr effect
inc $d020

...
etc.

This will help you determine how much raster time a subroutine takes up, and where in the frame it occurs. Also, it will point out on what line a raster collision between two routines occurs. This is a common basic technique, known to basically everyone when they are starting out. Many people told me about this simple technique and showed it to me 2 years ago when I was starting out, and it is well known. It helps greatly for NTSC/PAL fixing projects as well. Of course, beginning to familiarize yourself with how many cycles common opcodes use in their various addressing modes is the most beneficial toward this end.

-DP
2009-10-29 12:53
pmc
Account closed

Registered: Sep 2009
Posts: 5
@ Darth Plagueis - I couldn't agree more with the things you said about the process of learning to code.

I've been coding for about two years now too - my stuff is mainly on the Amiga - I'm in the process of working on a megademo for A500 with a couple of other guys that will be released soon we hope.

I did do a 1x1 scroller for the C64 a while back though in KickAssembler and read the VIC article and some other things cos I'd like to maybe do something for the C64 too one day.

When I code something I, just like you, code it *myself* and if I ask for help I want pointers, not a slab of source code that I don't understand to paste onto the screen and kid myself I'm a coder... There's no fun in that and whatever got produced that way would only ever be one thing: L A M E

I personally think that coding the C64 is a real challange with all the cycle exact requirements and tricks you can do with the hardware and stuff and I'm always really impressed by what all the guys on here can do with that cool little machine.

Anyways, I'll stop rambling now.

Keep going with your coding journey DP - I enjoyed your Hallowfoe demo and I hope there's more to come! :-)
2009-10-29 16:09
plagueis
Account closed

Registered: Dec 2007
Posts: 48
PMC,

Thank you for your compliments regarding FOE's recent release. The Phantom's sprite DYCP in the borders was something really nice too, and his methods for stabilization are quite different than mine, yet his code works just as well.

Yeah, regarding the cut and paste coding...he'll only damage his own fun by taking this route...and true, some of what he's said and done is the very definition of lameness, yet - I can't well complain about that type of behavior unless I (esp. as a new/intermediate coder) have tried to do or say something to guide him in a more productive direction. Well, I've done that (both in PM and on the forum), and he seems to have ignored the bulk of what I've said, not to mention the others who have given the advice of shutting up and starting at the beginning. So, I suppose for now, he's on his own.

-DP
2009-10-29 16:22
Oswald

Registered: Apr 2002
Posts: 5034
I have used little routines I havent coded myself ever since I started coding. The very first one I had no idea how worked, did set up an irq. Still it did not stop me making my rasterbars, fld (also ripped without knowing how works), split rasters (also ripped) etc. Even today I dont know how the loader works, the music works, how the packer & depacker works I use, and often use Ninja's help (=routines) on timing critical stuff.

Stop with the witchhunt please. The guy has moved from rasters to 4 rastersplit within days, thats a nice progress and shows enough willingness to learn IMHO. If he could do that he will work out how a stable raster works aswell. WHEN he feels/needs/wants to.
2009-10-29 16:27
plagueis
Account closed

Registered: Dec 2007
Posts: 48
Oswald,

It's not a witch hunt. I'm a dude who has only released a few demos, and tried to give advice to a guy who actually asked me for it in several PM's. I thought he would be more receptive if the discourse was continued here where he could receive a diversity of opinions. I thought he could benefit from the words of a less experienced coder. I was being semi-harsh but honest.

Funny that you would choose now to try and force the thread closed, yet when you scroll up you see veteran sceners completely engaged in sarcastic ridicule.

I gave honest advice. You had seen what was to be my last post. But I'm not going to be accused of engaging in a witch hunt. I was trying to give novice to novice advice.

-DP
2009-10-29 16:32
chatGPZ

Registered: Dec 2001
Posts: 11164
come on. you DO know how a loader works, i am very sure. and i am also sure you could code one yourself if you wanted. this is even more true for a music player. knowing how something works doesnt mean to know every register setting by heart, or beeing able to code it from scratch without looking at some references. it means to understand the basic problem and getting the idea on how to solve it. and someone who copies stable rastercode verbatim, and then patches the irq vectors from $fffe to $0314, and then wonders why adding music makes it unstable again, obviously didnt understand either.

also the fact that many of us (me too) started by ripping and blindly using code from others doesnt mean that its a good thing, and that actually learning it properly isnt a better idea. dont forget that back in the days the reason for doing it like we did wasnt that we didnt want to know how it works, but because noone was there who could explain it to us. atleast for me it was like that :)
2009-10-29 16:53
plagueis
Account closed

Registered: Dec 2007
Posts: 48
Oswald,

I would like to kindly point out that 8bit moved from rasters to 4 split rasters 45 minutes after he asked me how to code them, as he'd seen a part I released with splits in it. I said:

"You change $d021/20, but do it more than once per line"

less than an hour later he claimed success. I didn't give him any of my code, but I pointed out he could load my demo and hit the button on his cartridge. All the code would be there.

Also, look at post #11 in this forum. I give sincere help to the guy...a snippet of non-proprietary code for his toolkit which really helped me when I was starting out to visualize raster time and position.

-DP
2009-10-29 17:15
Oswald

Registered: Apr 2002
Posts: 5034
Everyone has their part of the truth here. I agree with all the newly made points. All I'd like to say is that dont scare the guy away. There's no golden way on how to learn coding, and we were all guilty of using code we dont know how works.

At first my thoughts were the same as yours, but seeing how fast he have solved the first problem, then moved up to split rasters - and again found the bug fast on his own - convinced me he is wanting to do his homework.
2009-10-29 17:43
plagueis
Account closed

Registered: Dec 2007
Posts: 48
Quote: Everyone has their part of the truth here. I agree with all the newly made points. All I'd like to say is that dont scare the guy away. There's no golden way on how to learn coding, and we were all guilty of using code we dont know how works.

At first my thoughts were the same as yours, but seeing how fast he have solved the first problem, then moved up to split rasters - and again found the bug fast on his own - convinced me he is wanting to do his homework.


Well I agree (and always have). I wanted to ensure he was not only asking questions, but also on the path to finding the answers.

-DP
2009-10-29 20:35
8bitforever
Account closed

Registered: Oct 2009
Posts: 48
Thanks Oswald for noticing that I coded the four split rasterbar myself. I learned a lesson in cycle counting and badlines. I'm using fungus stable rastercode mostly to make it easy for you guys here to understand what kind of framework I´m doing my stuff in. In that way I can focus my questions to what I'm actually doing or trying to do for the moment. I respect that many of you are years ahead of me. I started coding a few days ago. I would appreciate though if you could focus more on my questions. I apologize if they are to easy for you. But think of how many other beginners you might be helping when helping me with my startup questions. I think it's good to make this kind of knowledge documented in this forum.
2009-10-30 13:13
MagerValp

Registered: Dec 2001
Posts: 1060
Quoting 8bitforever
I would appreciate though if you could focus more on my questions.


And we would appreciate though if you could focus more on our answers. Every question you have asked have been answered several times over, yet you insist on asking us to write the code for you.
2009-10-30 14:02
8bitforever
Account closed

Registered: Oct 2009
Posts: 48
Magervalp,
I have not asked you to code anything in this thread.
Please read my posts and you will see for yourself.

Once again, what´s the point of the forums coding section if you cannot talk about code and coding ?



2009-10-30 15:59
Skate

Registered: Jul 2003
Posts: 492
@8bitforever: point is, if you've learned how stable raster works, you wouldn't *forget* to remove that NOP. You forgot it there, because you used someone else's code without understanding it (even not reading the source code comments carefully). if csdb ppl complains about your questions, there is an obvious reason, think about it.
2009-10-30 21:25
Oswald

Registered: Apr 2002
Posts: 5034
Quote: @8bitforever: point is, if you've learned how stable raster works, you wouldn't *forget* to remove that NOP. You forgot it there, because you used someone else's code without understanding it (even not reading the source code comments carefully). if csdb ppl complains about your questions, there is an obvious reason, think about it.

anyone could forget it, so you have no point here, apart from bitching someone who miracously found interest in c64 coding.
2009-10-30 21:34
TPM

Registered: Jan 2004
Posts: 109
i only coded stuff i understood.. cycle counting, badlines, countless nops, open sideborders, stable tech tech crunch flexible bad line anti position bars: wtf?! Did alot of research, carefully looked how others did all these tricks, talked to experts "you've got to place some nops there, duh", stared to fully 64kb memories filled with nops, incs/decs and flipping $d011s.. all useless. Just do your thing, give it some time to understand what you are doing, try to be creative within your capabilities and slightly beyond of that. Time by time you'll explore new worlds.
By the way.. have no life: code day and night, get boozed, stoned, whatever and try further :)
2009-10-31 09:44
chatGPZ

Registered: Dec 2001
Posts: 11164
Quote:
By the way.. have no life

that sums it up quite well =D
2009-10-31 14:08
Angel of Death

Registered: Apr 2008
Posts: 210
Back at ya, TPM.
Amen!
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
Xiny6581/Dees Produc..
t0m3000/HF^BOOM!^IBX
bugjam
grass/LETHARGY
Didi/Laxity
jmin
zscs
LightSide
Sentinel/Excess/TREX
tlr
Guests online: 107
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Diskmag Editors
1 Magic  (9.4)
2 Jazzcat  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 Remix  (9.1)

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