Jump to content



3

Sinusoid


47 replies to this topic

#26 retroclouds OFFLINE  

retroclouds

    Stargunner

  • 1,095 posts
  • Location:Germany

Posted Tue Mar 15, 2011 12:30 PM

Quote

Not many downloads - apart from my own quality check. Oh well, thought you should see it anyway ...

It's real interesting what you are doing and I'm planning on trying it out. Except for some lurking I haven't had any TI time lately. :(
Have some family business I need to take care of. Hoping I'll be back in the saddle in a couple of weeks.

#27 Opry99er OFFLINE  

Opry99er

    River Patroller

  • 3,019 posts
  • Location:Elizabethtown, KY

Posted Tue Mar 15, 2011 1:34 PM

We miss ya Filip!! Your little Atariage experiment here is doing quite well, wouldn't you say?? :)

#28 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Wed Mar 16, 2011 2:55 AM

There's more TI activity here than anywhere else (based on 11.2009 to 10.2010) and we're not just talking, we're getting things done around here. Yep, nice little experiment.

I guess I try and adapt or something. I'll continue with animations instead of binaries, reply on lurkers generally, and hopefully end up with a few good assembler routines for someone to enjoy.

:)

Edited by sometimes99er, Thu Mar 17, 2011 2:27 AM.


#29 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Thu Mar 17, 2011 2:10 AM

Optimized plot routine and saved 6 instructions (now using EA page 336). About 15 percent boost in overall performance. Another 7 instructions can be saved if I "inline" instead of using subroutines (calling plot (save return), calling VDP read, and calling VDP write).

Wonder if dropping the VDP read, and instead updating a 6K buffer would help. Using SOCB for plot (and SZCB for unplot) - that's one instruction for reading and writing the buffer. Both the VDP read and VDP write set the VDP address (actually the same address (in one call to the plot routine)). Would have to clear the buffer initially. And of course adding the need for 32K memory expansion.

:)

Edited by sometimes99er, Thu Mar 17, 2011 3:48 AM.


#30 unhuman OFFLINE  

unhuman

    Dragonstomper

  • 784 posts
  • Location:Vienna, VA

Posted Thu Mar 17, 2011 6:43 AM

View Postsometimes99er, on Wed Mar 16, 2011 2:55 AM, said:

There's more TI activity here than anywhere else (based on 11.2009 to 10.2010) and we're not just talking, we're getting things done around here. Yep, nice little experiment.

Is that all I am here? A pawn in the game? A cog in the whatever-cogs-go-in? Just an experiment? Well then, I wanna be a placebo!

#31 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Fri Mar 18, 2011 2:15 AM

Full screen fluid animation ? Yes, you could say so.

So this is what I did ...

  • Only half the pixels per circle. That's 128 instead of 256.
  • A new pixel don't care about any prior pixels. A byte in the bitmap has no or one pixel.
  • Not clearing the screen between circles. This would slow the animation and also introduce flicker. Strange patterns are left on the screen.
  • The circle is stretched horizontally (192*8/6=256), so DIV is actually in action for every pixel.
I think the GIF animation below is only 15 frames per second, so try out the attached cartridge for a more real experience. Looks fluid to me. And hey, don't try CPU Overdrive !

Posted Image

:)

Attached File  sinec.bin   8K   7 downloads

#32 ti99userclub OFFLINE  

ti99userclub

    Moonsweeper

  • 280 posts
  • Location:Italy

Posted Fri Mar 18, 2011 2:57 AM

WOW ! it's a wonderful effect ! :D ... Great ! ...

#33 InsaneMultitasker OFFLINE  

InsaneMultitasker

    Chopper Commander

  • 210 posts

Posted Sat Mar 19, 2011 1:05 AM

View Postsometimes99er, on Tue Mar 15, 2011 6:41 AM, said:

Not many downloads - apart from my own quality check. Oh well, thought you should see it anyway ...
If I'm in the mood, I might go'n explore further late tonight.

:cool:
Not much time for TI things lately -- so I don't download but do watch the demos Very nice :)

#34 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Sun Mar 20, 2011 1:46 AM

Thanks for feedback. :)

Remember this one ?

Posted Image

It's back from post #18 using this formula

Plot( X, ( 2*Sin(X+48) + Sin(X*2) + Sin(X/2) ) /4 )

Now instead of drawing a circle like this

Plot( Cos(X), Sin(X) )

I'll inject the above formula (variation on the sine wave). I'll get this and actually do all the calculations

Plot(( 2*Cos(X+48) + Cos(X*2) + Cos(X/2) ) /4, ( 2*Sin(X+48) + Sin(X*2) + Sin(X/2) ) /4 )

I'm really not having a cosinus function, but just using this from post #21

Cos(X) = Sin(X+64)

So I'm doing this in assembler

Plot(( 2*Sin(X+48+64) + Sin((X+64)*2) + Sin((X+64)/2) ) /4, ( 2*Sin(X+48) + Sin(X*2) + Sin(X/2) ) /4 )

Still drawn in less than 1/15th of a second, and this is the result

Posted Image

:)

#35 Tursi OFFLINE  

Tursi

    Stargunner

  • 1,448 posts
  • Location:SJC

Posted Sun Mar 20, 2011 4:22 AM

I like the animated effect - and the spirals are nice too! hehe.

I haven't been downloading, I just love your animated previews since they save me from needing to.

#36 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Tue Mar 22, 2011 1:52 AM

Thanks for feedback. :)

All I'm doing now for a simple snake like effect is one plot (set bit) and one unplot (clear bit) every frame. The plot is 37 pixels ahead of the unplot. First I tried with 17, but the snake was much too small, then I tried 37 (as another prime number), and it looked fine to me. Any longer and I think the feel of "movement" might be lost.

The GIF animation is about 10 fps (frames per second), while I think Classic99 does it at 60 fps. I guess the overall speed should appear about the same, but it looks way more fluid in Classic99.

Posted Image

:)

Attached File  sinec.bin   8K   5 downloads

#37 retroclouds OFFLINE  

retroclouds

    Stargunner

  • 1,095 posts
  • Location:Germany

Posted Tue Mar 22, 2011 5:04 AM

Very nice. Kinda reminds me of the trail used by the enemies in Gyruss.
Think it was in one of the challenge stages.

#38 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Tue Mar 22, 2011 6:27 AM

Thanks for feedback. :)

I thought about having a sparkling snail tail, turning on and off the last 5 or 6 pixels, but then went for another idea about taking the x and y values and doing simple mirror and flip on those values. For every frame update I'm calculating 2 plots and hitting the plot routine 8 times. My estimate is, that the demo takes less than 10 percent of 9900 power.

Posted Image

:cool:

Attached File  sinec.bin   8K   4 downloads

Edited by sometimes99er, Tue Mar 22, 2011 1:42 PM.


#39 unhuman OFFLINE  

unhuman

    Dragonstomper

  • 784 posts
  • Location:Vienna, VA

Posted Tue Mar 22, 2011 6:59 AM

View Postsometimes99er, on Tue Mar 22, 2011 1:52 AM, said:

Posted Image


Star Castle? Should've watched it longer, but just the circle snake reminded me of the shields...

Edited by unhuman, Tue Mar 22, 2011 7:00 AM.


#40 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Tue Mar 22, 2011 7:36 AM

View Postunhuman, on Tue Mar 22, 2011 6:59 AM, said:

Star Castle? Should've watched it longer, but just the circle snake reminded me of the shields...
Hehe, looks cool. Loved Asteroids, but Star Castle didn't do it for me back then in the arcades. :cool:



#41 Tursi OFFLINE  

Tursi

    Stargunner

  • 1,448 posts
  • Location:SJC

Posted Tue Mar 22, 2011 10:49 AM

View Postsometimes99er, on Tue Mar 22, 2011 6:27 AM, said:

I thought about having a sparkling snail tail, turning on and off the last 5 or 6 pixels, but then went for another idea about taking the x and y values and doing simple mirror and flip on those values. For every frame update I'm calculating 2 plots and hitting the plot routine 8 times. My estimate is, that the demo takes less than 10 percent of 9900 power.

Starting to get a nice kaleidescope effect there - very nice!

Very cool to see some line animation on the TI - it is far too rare!

#42 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Tue Jun 28, 2011 10:59 PM

Posted Image

The intent was indeed to develop this thread/the sine wave functionality into some classical old school effects, especially the plasma one. I was working on it, but got a bit sidetracked (again). Homebrew 6809 Computer has now done it using the 9918A. Still an effect for me to do on the TI-99/4A.

:)


Edited by sometimes99er, Wed Jun 29, 2011 2:02 PM.


#43 matthew180 OFFLINE  

matthew180

    Stargunner

  • 1,242 posts
  • Location:Marshall, Michigan

Posted Wed Jun 29, 2011 7:42 AM

And the MSX BOLD demo beat them...


Edited by matthew180, Wed Jun 29, 2011 8:37 AM.


#44 virios OFFLINE  

virios

    Combat Commando

  • 3 posts

Posted Wed Jun 29, 2011 11:38 AM

View Postmatthew180, on Wed Jun 29, 2011 7:42 AM, said:

And the MSX BOLD demo beat them...


wonderfull!!! :D :D :D

#45 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Sun Aug 28, 2011 6:55 AM

Sinewave #5 (post #16) got UnderExtended to do this nice graphic mod ...

Posted Image

Looks like bits from Lunar Lander (1979 Arcade) and Scorched Earth (1991 DOS)/Worms (1995 Amiga). By the way, Jupiter Lander (C64) has a cool (or functional) speedometer at the right.

Anyway, UnderExtended has the ability to come up with some quite stunning graphics. Looks like we'll have to start an open source game collaboration project soon. He's got "dial up", so posting here takes forever or something.

:)

Edited by sometimes99er, Mon Aug 29, 2011 12:40 AM.


#46 orion1052003 OFFLINE  

orion1052003

    Chopper Commander

  • 140 posts

Posted Sun Sep 4, 2011 8:42 PM

Since this thread is about the use of SINE, i figured I should post it here:

I have a sprite planet orbiting a stationary "sun". It orbits in a diamond shape
by using call motion. Is there a way to produce a circular or even elliptical
orbit? Maybe by using SINE somehow?

James




100 !SAVE DSK1.ORBIT
110 CALL CLEAR :: CALL SCREEN(2)
120 R=INT(RND*24)+1 :: C=INT(RND*32)+1
130 CALL CHAR(96,"183C7EFF7E3C1800")!CHARSET 9
140 CALL CHAR(88,"FFFFFFFFFFFFFFFF")
150 CALL CHAR(89,"FFFEFCF8F0E0C080")
160 CALL CHAR(90,"FF7F3F1F0F070301")
170 CALL CHAR(91,"80C0E0F0F8FCFEFF")
180 CALL CHAR(92,"0103070F1F3F7FFF")
190 CALL CHAR(104,"0000001818000000")
200 CALL COLOR(8,12,2,10,16,2)
210 RV=0 :: CV=5
220 CALL HCHAR(11,16,88,2)
230 CALL HCHAR(12,15,88,4)
240 CALL HCHAR(13,16,88,2)
250 CALL HCHAR(11,15,92)
260 CALL HCHAR(13,15,90)
270 CALL HCHAR(11,18,91)
280 CALL HCHAR(13,18,89)
285 FOR I=1 TO 30
287 R=INT(RND*24)+1 :: C=INT(RND*32)+1
290 CALL HCHAR(R,C,104)
291 NEXT I
300 CALL SPRITE(#1,96,10,89,121,RV,CV)
310 RV=0 :: CV=5
320 FOR I=1 TO 700 :: NEXT I
330 CALL MOTION(#1,5,-5)
340 FOR I=1 TO 700 :: NEXT I
350 CALL MOTION(#1,-5,-5)
360 FOR I=1 TO 700 :: NEXT I
370 CALL MOTION(#1,-5,5)
380 FOR I=1 TO 700 :: NEXT I
390 CALL MOTION(#1,5,5)
400 GOTO 320

"Drawing a circle requires the use of Cos, Sin and mathematical PI.

If your not savvy with math, you can find code written in BASIC on the web and
use it.

You should store the x and y coordinates in and array for your orbit so XBASIC
won't have to calculate the orbit during run time."



I have no idea how to use sine or any trigometric functions, need an explanation for low math skills.

Attached Files



#47 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,919 posts
  • Location:Denmark

Posted Sun Sep 4, 2011 11:56 PM

A problem with using a series of CALL MOTION in XB like that is, that the sprite tends to go off from where you wanted it. The possibilities of timing isn't too good with XB. Better results might be achieved using CALL SOUND instead of FOR NEXT, but I guess it's just a matter of time before it too goes off.

One could maybe use a series of CALL LOCATE and maybe even have the data series in an array as you suggest to maybe speed things up. I thought about maybe using CALL LOCATE and CALL MOTION in a combination, but I guess it might produce a bit of choppiness. The data series with CALL LOCATE could probably be detailed and pretty smooth.

This explanation of SINE from Wikipedia is perhaps getting too heavy too quickly.

I don't know if this helps, but lets just say, that for any given angle, the SIN and COS will produce coordinates.



Anyway, here's one with the SIN and COS calculations done inside the CALL LOCATE. Looks okay.

110 CALL CLEAR :: CALL SCREEN(2)
130 CALL CHAR(96,"183C7EFF7E3C1800")!CHARSET 9
140 CALL CHAR(88,"FFFFFFFFFFFFFFFF")
150 CALL CHAR(89,"FFFEFCF8F0E0C080")
160 CALL CHAR(90,"FF7F3F1F0F070301")
170 CALL CHAR(91,"80C0E0F0F8FCFEFF")
180 CALL CHAR(92,"0103070F1F3F7FFF")
190 CALL CHAR(104,"0000001818000000")
200 CALL COLOR(8,12,2,10,16,2)
220 CALL HCHAR(11,16,88,2)
230 CALL HCHAR(12,15,88,4)
240 CALL HCHAR(13,16,88,2)
250 CALL HCHAR(11,15,92)
260 CALL HCHAR(13,15,90)
270 CALL HCHAR(11,18,91)
280 CALL HCHAR(13,18,89)
285 FOR I=1 TO 30
287 R=INT(RND*24)+1 :: C=INT(RND*32)+1
290 CALL HCHAR(R,C,104)
291 NEXT I
300 CALL SPRITE(#1,96,10,89,121)
310 FOR A=0 TO 2*PI STEP PI/16
320 CALL LOCATE(#1,89+SIN(A)*40,121+COS(A)*60)
330 NEXT A::GOTO 310
RUN
I get the elliptic shape by multiplying the vertical and horizontal coordinates (SIN and COS always returns values in the range -1 thru 1) with different values (I'm using 40 and 60 here).

:)

Edited by sometimes99er, Mon Sep 5, 2011 12:09 AM.


#48 JamesD OFFLINE  

JamesD

    River Patroller

  • 3,014 posts

Posted Mon Sep 5, 2011 7:24 AM

View Postsometimes99er, on Tue Mar 22, 2011 7:36 AM, said:

View Postunhuman, on Tue Mar 22, 2011 6:59 AM, said:

Star Castle? Should've watched it longer, but just the circle snake reminded me of the shields...
Hehe, looks cool. Loved Asteroids, but Star Castle didn't do it for me back then in the arcades. :cool:


Star Castle was a lot tougher than Asteroids. You had to play it a lot more to get good at it.
Later versions were even tougher because they eliminated some of the strategies used on the early version.


As for the main topic...
I haven't downloaded anything but it looks cool!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users