| |
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 |
|
... 17 posts hidden. Click here to view all posts.... |
| |
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"? |
| |
Starfox
Registered: Jul 2014 Posts: 42 |
It's doing something that can't really be changed and takes 52 cycles per line (STA/STX/STY) + 9 for "loop" + 2 wasted cycles on a nop to make it 63 cycles. I bet someone can already guess the overall theme of the effect by now.
I guess without the "loop" I would have 11 cycles free per line. Maybe that would be enough to play some notes?? |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
I suppose you need the cycles, both for "normal" play or "dumped" play, almost in a "consistent block", otherwise is useless to -gain- 10/11 cycles per line because you can't execute a "play" here to "dump" and play sounds, or execute code outside irqs...
And if you need to be in cycle-exact timing with raster beam, it's just impossible to "move" cycles from where they "are".
The only thing is to reduce cycles in the "work" part outside visualization area...
Maybe using some precalculated values or so... in the part of code that isn't just lda/sta'ing bytes around...
But you need 1890 cycles... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
1 raster tracker will do if 30 lines tracker almost cuts it. |
| |
Starfox
Registered: Jul 2014 Posts: 42 |
Flavioweb, Yeah, I did consider using the last cycles of 200+ rasterlines to do an LDA ADDR - STA ADDR to help the draw routine, but other problems pop up then, where the effect become kind of distorted because to make it look decent - I have to find the best compromise between the number of real rasterlines, and how many times they are duplicated to make the effect fill as much of the screen as possible. And yeah, I will have to figure out if I can use even more precalculated tables.
But the routine is nothing special, I just wanted to see if I could code a small demo again after all these years =)
Oswald, I checked that player out, and I also tried experimenting with reading the sid registers when the IO area is in ram mode, and then writing them back after switching back to normal mode. The music sounded a little weird and distorted, but it wasn't hard to recognize. I'm not sure it's worth the hassle though as it would take up too much ram, but it is an interesting idea =) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
yup, the timing & order of the sid writes is a sensitive thing. |
| |
Dr.j
Registered: Feb 2003 Posts: 277 |
@Starfox: sorry to interfere but i think the easy and
comfort way is to..simply find another sid from dozens
of HVSD sids that they aren't that big rasters consumers , i believe most of the tunes with Jch player and the latest most used players are okey to use or better to use hermit
1 raster player like Oswald already suggest |
| |
Starfox
Registered: Jul 2014 Posts: 42 |
Ahh, yeah probably screwed up the timing and order of writing the values back =/ I even made some music routines back in the day, but can't remember anything about it lol.
And I guess you are right Dr.J, but I will give just a little more time to see if I can make it work with this tune. And as you suggest, it should be possible to find something. I gotta admit, I only heard a few tunes in that hermit player. They sounded a bit like it was made for a 4k demo =) |
Previous - 1 | 2 | 3 - Next |