First grai scale, now SOUND!!!!!
Moderator: MaxCoderz Staff
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
The main reason to have a table in the first place is that's it's a lot faster to do an addition and maybe one multiplication (if it's a 2-dimensional LUT) to do a calculation rather than the calculation itself.Merthsoft wrote:Wouldn't a caluculation be smaller, and maybe faster then a table?
A good example of this is a 3D tunnel effect, such as:
Now, you could go through each pixel, calculate which angle it's at and how far away it is and then do the colour lookup. This is far too slow to do in realtime. A much better plan would be to have two tables - one for angles, one for distances. Now, as you go through each pixel you look up the angle and add on the rotation (constant per frame) and then look up the distance and add on the distance travelled (constant per frame) and then do the pixel colour magic.
Or, on the TI (where doing all those calculations would be too slow and complex to bother with anyway) you could precompute them all and compile the tables into your source. (in my case, for "Pixel Madness", I quartered each table so it only showed the top-left corner and expanded it to fill the full buffers before loading - this saved a lot of space!)
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
Yeah thats right. Besides doing square roots in asm takes time i don't want to think about 12th root.
Anyway, I just realised a fatal(yes FATAL) flaw with using my routine as a TSR. The thing is that if something causes an IM 1(archive, power off), tios normal interrupt won't clear the crystal timer interrupts and interrupts would execute constantly. So the only way to prevent this is a hook of some kind, and I am in no mood to play with hooks, I got a migrane the last time I did.
Sorry, I tried, I really did.
Well as far as this and the grat scale goes I start work on a shell and see where it goes from there. But i'm working on one more thing before starting that, so wish me luck.
Anyway, I just realised a fatal(yes FATAL) flaw with using my routine as a TSR. The thing is that if something causes an IM 1(archive, power off), tios normal interrupt won't clear the crystal timer interrupts and interrupts would execute constantly. So the only way to prevent this is a hook of some kind, and I am in no mood to play with hooks, I got a migrane the last time I did.
Sorry, I tried, I really did.
Well as far as this and the grat scale goes I start work on a shell and see where it goes from there. But i'm working on one more thing before starting that, so wish me luck.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
Well yes thats how it is now, but there are two problems I see.
One it is repetative code that doesn't need to waste space.
Two if there is a flaw I don't know about, it could be fixed via shell update, most of my info on the extra hardware comes from Michael and from what i can tell there are still some unkowns to workout.
I've only found a workaround for the halt bug, but not an actual fix. But yeah I should really release that code officially, I should probably just mimic Ducks gpp because of it's popularity.
On that note, some time ago duck reminded me that bit interlacing produces less noise than any other form. So I decided to rewrite ducks copy routine, the 70,000 clocks is a bit much. After a bit of work I brought the size down a little and it runs in 61,000 clocks. I know not much, but every bit counts.
I really should release code.
One it is repetative code that doesn't need to waste space.
Two if there is a flaw I don't know about, it could be fixed via shell update, most of my info on the extra hardware comes from Michael and from what i can tell there are still some unkowns to workout.
I've only found a workaround for the halt bug, but not an actual fix. But yeah I should really release that code officially, I should probably just mimic Ducks gpp because of it's popularity.
On that note, some time ago duck reminded me that bit interlacing produces less noise than any other form. So I decided to rewrite ducks copy routine, the 70,000 clocks is a bit much. After a bit of work I brought the size down a little and it runs in 61,000 clocks. I know not much, but every bit counts.
I really should release code.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
Sorry for the double post, but I made one last demo for this, err...well I didn't make the demo but I fused the game with sound.
Its Galaxian by Patrick Davidson & Sam Heald, plus the starfox song by Paul Marks, plus my interrupt sound by me. What s really cool about this is that the CPU speed is still at 6MHZ, I didn't need to step it up. So you can imagine a lot more is possible.
I also reduced the frequency of BPM timer so now on average ther are only 1500 interrupts per second. Meaning more speed.
The sound quality diminished in the game alittle b/c it's running at 6mhz but I think with all things considered it's still pretty good.
I included some source with it so you can see what going on in the sound routine and how the format works. It is not a finally version, please do distribute.
I'm going to give that tsr one last shot, but it will still be affected by that issue.
Oh...almost foregot the link
http://www.geocities.com/jimm09876/calc/GALAXAN2.zip
Its Galaxian by Patrick Davidson & Sam Heald, plus the starfox song by Paul Marks, plus my interrupt sound by me. What s really cool about this is that the CPU speed is still at 6MHZ, I didn't need to step it up. So you can imagine a lot more is possible.
I also reduced the frequency of BPM timer so now on average ther are only 1500 interrupts per second. Meaning more speed.
The sound quality diminished in the game alittle b/c it's running at 6mhz but I think with all things considered it's still pretty good.
I included some source with it so you can see what going on in the sound routine and how the format works. It is not a finally version, please do distribute.
I'm going to give that tsr one last shot, but it will still be affected by that issue.
Oh...almost foregot the link
http://www.geocities.com/jimm09876/calc/GALAXAN2.zip
Yeah, I realized how slow it would be for real time output after thinking about it last night, and making a little piano program in QuickBasic, or QBASIC, or one of those types of BASIC things. Instead of having a predfined table right from the start, I had it make the table right in the beginning, but that took a bit of time, but using a bunch of DATA commands made it faster, and surprisingly didn't take much time...Or, on the TI (where doing all those calculations would be too slow and complex to bother with anyway) you could precompute them all and compile the tables into your source.
This is amazing, that's all I can realy think to say...I made one last demo for this
Shaun
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
Ok, for all you 83+ owners out there i tried to rework the routine so it runs an 83+. I did and it works. The problem, it's SUPER SHITTY. WHY?, well Interrupts are unbalanced in their placement, they don't care as long as the proper amount of interrupts occur. So here is yet another galaxian demo but this time for the 83+ers. So keep in mind when you listen it will be crappy, but on the se you probably would be able tell the difference my routine and calcmod.
Source included so if an 83 programmer wants to port the demo down thats ok, you would have to change the location the interrupt is copied to.
This is only for 83+, NOT the SE
http://www.geocities.com/jimm09876/calc/GALAXAN3.zip
Hmmm... are any 83+ owners even reading this thread, oh well...
Source included so if an 83 programmer wants to port the demo down thats ok, you would have to change the location the interrupt is copied to.
This is only for 83+, NOT the SE
http://www.geocities.com/jimm09876/calc/GALAXAN3.zip
Hmmm... are any 83+ owners even reading this thread, oh well...
- Madskillz
- Calc Wizard
- Posts: 745
- Joined: Fri 17 Dec, 2004 10:22 pm
- Location: Wandering around in the Jungle...
- Contact:
wow...simply amazing man! This is awesome...
edit: I don't know if this works on everyone's calc, but when you hit the "on" button while the song is playing, it shuts the song off...but you cant turn it back on...I only tried this in the first download, not the galaxan game.
edit: I don't know if this works on everyone's calc, but when you hit the "on" button while the song is playing, it shuts the song off...but you cant turn it back on...I only tried this in the first download, not the galaxan game.
The Revolution is here...
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
Well I looked at it again over the weekend and I decided that it's safe for the 83(+), but you won't be able to choose the frequency like I did with the glaxian SE demo
These would be the frequencies:
560 ;MAYBE..
280
172
140
124
86
70
63
59
43
35
31
21.5
17.5
15.5
10.75 ; Brown Noise any one
But for SE quality sound, you would need app.
This is on hold untill I finish the greyscale project.
These would be the frequencies:
560 ;MAYBE..
280
172
140
124
86
70
63
59
43
35
31
21.5
17.5
15.5
10.75 ; Brown Noise any one
But for SE quality sound, you would need app.
This is on hold untill I finish the greyscale project.
Build one. Take a calculator cord and headphones, chop um up. Then connect the wires (correctly)... It'll be quiet, but it works... IT isn't like that time I put 12v into the calc's link port cool, but it works....Shadow Phoenix wrote:my speakers cable doesnt fit =)
****************************
where can I find adapters?
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.