| |
Starfox
Registered: Jul 2014 Posts: 42 |
Coding a small demo. Rules about music?
Hello,
I'm coding a small demo, after having coded the last one 27 years ago (lol), and while coding it I have used an older GREAT placeholder tune. Now, I could keep using that tune in the release as I got in contact with the composer, and he said I could use it, no problem.
But the music routine is taking a bit too much rastertime (peaks at around 30 lines), and that's just too much - since my effect takes up almost all available rastertime, and because of that I have to cut back the size of the effect, which is a bummer.
I know there are more optimized routines out there today that take much less rastertime, but I am concerned that since it is of newer date, that it would not be acceptable to just use one of those tunes?
I also got the idea that maybe I could transplant the music data from the placeholder tune into a newer more optimized player, but it seems like a bit of a challenge lol.
Anyone have any ideas as to what I could do?
Peter |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
just take a tune that you like. |
| |
Starfox
Registered: Jul 2014 Posts: 42 |
Okay, so I guess the scene is still relaxed about using other people's tunes as long as credit is given =) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
most people are, some will give you the shits and spawn drama. just like in 1986 =) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
you can just record the sid register writes, if you have the memory. then find a good looping point :)
also there is a 1 rasterline player by hermit, and a lots of tunes made for it.
Visage - 1 Rasterline Cover
One Rasterline Tracker V0.9 |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
You can try to optimize main demo code for speed, and if you have some free memory, just unrolling some loops can give you sufficient time to play the music.
30 rasterlines isn't the world fastest player, but isn't very very bad after all... if you are coding on a PAL environment. |
| |
Starfox
Registered: Jul 2014 Posts: 42 |
Interesting idea oswald =), and I will look into that player. Btw, wouldn't I need to record more than once per frame. I mean arpeggio etc. isn't that some kind of loop in the music routine that changes notes or whatever over a predefined amount of time in the same frame?
Flavioweb:
Yes it's PAL =)
I have optimized it as much as I think I can within reason.
If I completely unroll it where it is only absolute adresses like: LDA ADDR - STA ADDR, it would take like 30kb with 0 cycles overhead.
I have another version using indexed adressing (LDA ADDR,X - STA ADDR,Y) taking 17kb with 390 cycles overhead for the entire runthrough.
And a more practical version taking a few kb with 676 cycles overhead (using the same indexing).
I was surprised I could even make it work using indexed because of the way the data has to be stored. It isn't just LDA ADDR,Y - STA ADDR,Y for X amount of bytes. The load is from sequential addresses, but the store isn't.
Also, the rastertime used to display the effect is almost dead, which is why I need every last cycle almost lol.
Maybe I can put a link to the routine. I'm sure there's more or better ways to optimize it. |
| |
Hate Bush
Registered: Jul 2002 Posts: 465 |
AFAIR, if a tune is singlespeed (called once per frame), you need to record the registers only once per frame. |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
What you mean exactly with
Quote:Also, the rastertime used to display the effect is almost dead ?
Do you calculate fx data somewhere and display they somewhere else in mem? |
| |
Starfox
Registered: Jul 2014 Posts: 42 |
Randall: Ok, I will have to try to find out then =)
Flavioweb: Yeah, after the raster is done displaying the effect, the draw routine takes data from tables and places them in the display data area. Then next frame the display will show the changes.
There's pretty much 0 cycles left in the area where the effect is displayed because of the way it works, so I can only really optimize the draw routine and have a faster music routine =)
Here's a small snippet of one of the draw routines:
https://dl.dropboxusercontent.com/u/4130839/new%20draw%202.txt |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
...mmm...
But when "raster display data"... the code is working on something or just "waiting"? |
... 17 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |