Jump to content
IGNORED

Sinusoid


Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 !

 

sine9c.gif

 

:)

 

 

  • Like 2
Link to comment
Share on other sites

Thanks for feedback. :)

 

Remember this one ?

 

sine6.png

 

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

 

sine11b.gif

 

:)

Link to comment
Share on other sites

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.

 

sine12b.gif

 

:)

 

 

  • Like 2
Link to comment
Share on other sites

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.

 

sine13b.gif

 

:cool:

 

 

Edited by sometimes99er
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 3 months later...

plasma.jpg

 

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.

 

:)

 

http://www.youtube.com/watch?v=8WC-FpB9XDg

Edited by sometimes99er
Link to comment
Share on other sites

  • 1 month later...

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

 

0374.png

 

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
Link to comment
Share on other sites

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.

ORBIT.tiff

Link to comment
Share on other sites

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.

 


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).

 

icon_smile.gif

Edited by sometimes99er
Link to comment
Share on other sites

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:

 

http://www.youtube.com/watch?v=8HHRCA6CS8k

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...