Author Topic: Scroller wavelength  (Read 19874 times)

0 Members and 1 Guest are viewing this topic.

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #20 on: September 08, 2011 »
Attachment missing.  :whisper:

Good point, it's there now.... ;D
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Scroller wavelength
« Reply #21 on: September 08, 2011 »
LOL that guitar player is brilliant! K+ for that. The rest is extremely slow on my machine though. :-\  (XP, Celeron 2,66Ghz, GeForceFX5200 - and yep it's crap, I know.  ;D ) Honestly you should try Sprite3D. It's faaaaaaast, even on lousy computers. ;)
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #22 on: September 08, 2011 »
LOL that guitar player is brilliant! K+ for that. The rest is extremely slow on my machine though. :-\  (XP, Celeron 2,66Ghz, GeForceFX5200 - and yep it's crap, I know.  ;D ) Honestly you should try Sprite3D. It's faaaaaaast, even on lousy computers. ;)
I though it would be too slow on some systems so i'm already re-coding it for Sprite3D. 
btw. The sprite is from the Transbeuace I Demo I ripped years ago.  Attached here if you want to use it.
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Scroller wavelength
« Reply #23 on: September 08, 2011 »
Hey thanks! :) I'm sure I can use it some time. I was in need for band sprites so badly when making this. But all I found was Mario. Didn't even think of these then. So, maybe I'll use them for my next Xmas demo. I'll credit you for ripping them of course. ;)
Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Scroller wavelength
« Reply #24 on: September 08, 2011 »
Yep you should use Sprite3D. You got too much "sprites" to display!

on my machine, the 3 background scrolls seem to run in 2 frames, but not the big blue one on top ??? They should all runs in 2 or 1 frames...

By the way, really cool remake!!!  :clap:
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Scroller wavelength
« Reply #25 on: September 08, 2011 »
Really good work :)

I love all those scrollers.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
Re: Scroller wavelength
« Reply #26 on: September 08, 2011 »
Fantastic, that was great despite a few hiccups!  :clap:
www.kirl.nl
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #27 on: September 09, 2011 »
Fantastic, that was great despite a few hiccups!  :clap:

Thanks guys,
Looking back at it now it's hard to believe it was originally on an 8mhz machine with 512k ram !!
Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Scroller wavelength
« Reply #28 on: September 11, 2011 »
Looking back at it now it's hard to believe it was originally on an 8mhz machine with 512k ram !!

Most remakes of Atari ST effects prove that this machine was fantastic. When you see all the code you have to do just for simple rasters, or bitplanes transparency...
And when you think even with a Pentium (wich is more than 100 time faster thant a 68000!)  and a simple gfx card on PC, it is you have to make some optimisation to make all work in 1 frame... :bfuck2:
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroll Massacre Demo
« Reply #29 on: January 21, 2012 »
Ok, i've dug out my code again and added lots of Sprite3d functions and removed a few glitches in the multi-scroller now and got it running from 40fps to 60fps in both modes on my Win7 x86 laptop. Specs are :Dual Core, 2,2Ghz, 3GB ram, Onboard 1GB Intel video just as a comparison.
It's still in 640x480 but that's another step to take if I want to convert it all to 800x600 as that's a lot of font resizing and other headaches.
I haven't had a chance to test it on any other systems yet so it will be interesting to see if it works at all anywhere else.
Voluteers please ? ;)
Best run under Win7, XP on my PC runs it pretty crap.
« Last Edit: January 26, 2012 by KrazyK »
Challenge Trophies Won:

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 267
  • Karma: 7
    • View Profile
Re: Scroller wavelength
« Reply #30 on: January 22, 2012 »
very nice, works fine here. winxp, c2duo, 2gig ram, gt440 nvidia.

screen got quite hectic with all those scrollers but still ran fairly smooth, and the tune is nice also.

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #31 on: January 22, 2012 »
Nice one, glad to see it works on WinXp smoothly too.  I'll try it on my test PCs at work on monday which are also WinXP and Win7 x64 to see what happens. Thanks for testing.  :cheers:
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Scroller wavelength
« Reply #32 on: January 24, 2012 »
Great to run this again, it works fine on Win 7 64 bit.

That music is excellent.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Scroller wavelength
« Reply #33 on: January 26, 2012 »
Still working fine here ;) what about Padman??? Paddddddddddd!!!!!
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #34 on: January 26, 2012 »
Made some slight fixes to make is faster on WinXP and fixed some odd sprite anomolies. Original link updated a few posts below
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Scroller wavelength
« Reply #35 on: January 26, 2012 »
Runs fine here on my new laptop with Win7 x64 and Radeon Gfx. Can't test it on my old XP PC, since it refuses to boot atm... :whack: Does this still use DX 7, since it turns off some visual  stuff on Win7 in order to run?
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #36 on: January 26, 2012 »
 There are no directx7 routines used as such but the subsytem is included as it ran like crap without it included in the compiler options.  With only directx9 it ran really badly on win7. Its still slow on xp but who has xp now eh?    :-X   
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Scroller wavelength
« Reply #37 on: January 26, 2012 »
Yeah, nice scroller inferno ;-) ... works great on my laptop!

Wel done - love the music btw!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Scroller wavelength
« Reply #38 on: January 31, 2012 »
KrazyK, as I told you in PM, here is the code for the multiscroll. I put it here for everyone  ;D. I will use it also for my Empire remake, as soon as I will get time to rip the wave sine for the scrolls and also put off my finger from my ass...  :boxer:

Code: [Select]
Structure D3DTLVERTEX
  x.f
  y.f
  z.f
  rhw.f
  Color.l
  tu.f
  tv.f
EndStructure

Structure PB_DX9Sprite3D
  TexRes.l ; TexRes
  Vertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
  TmpVertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
  Width.l ; width set with ZoomSprite3D()
  Height.l ; height set with ZoomSprite3D()
  RealWidth.l
  RealHeight.l
  Angle.f
  Transformed.l
EndStructure


Procedure ClipSprite3D(Sprite3D,ClipX,ClipY,ClipWidth,ClipHeight)
  Protected *ptr.PB_DX9Sprite3D = IsSprite3D(Sprite3D)
 
  If *ptr = 0 : ProcedureReturn #False : EndIf
 
  If ClipX < 0 : ClipX = 0 : EndIf
  If ClipY < 0 : ClipY = 0 : EndIf
 
  If ClipWidth < 0 : ClipWidth = 0 : EndIf
  If ClipHeight < 0 : ClipHeight = 0 : EndIf
 
  If ClipX > *ptr\RealWidth : ClipX = *ptr\RealWidth : EndIf
  If ClipY > *ptr\RealHeight : ClipY = *ptr\RealHeight : EndIf
 
  If ClipX + ClipWidth > *ptr\RealWidth : ClipWidth = *ptr\RealWidth - ClipX : EndIf
  If ClipY + ClipHeight > *ptr\RealHeight : ClipHeight = *ptr\RealHeight - ClipY : EndIf
 
  *ptr\Vertice[0]\tu = ClipX / *ptr\RealWidth
  *ptr\Vertice[0]\tv = ClipY / *ptr\RealHeight
 
  *ptr\Vertice[1]\tu = (ClipX + ClipWidth) / *ptr\RealWidth
  *ptr\Vertice[1]\tv = ClipY / *ptr\RealHeight
 
  *ptr\Vertice[2]\tu = ClipX / *ptr\RealWidth
  *ptr\Vertice[2]\tv = (ClipY + ClipHeight) / *ptr\RealHeight
 
  *ptr\Vertice[3]\tu = (ClipX + ClipWidth) / *ptr\RealWidth
  *ptr\Vertice[3]\tv = (ClipY + ClipHeight) / *ptr\RealHeight
 
  ProcedureReturn #True
EndProcedure



Global  xres.w , yres.w , loop.w ,xp.w , yp.w ,  tptr.w , sco.b

 
xres  = 800       
yres  = 600         
deportx = (xres-640)/2
deporty = (yres-480)/2


InitSprite()
InitSprite3D()
InitKeyboard()


If fullscreen=#PB_Checkbox_Checked
  window = OpenScreen( xres , yres , 32 , "MultiScroll effect")     
  If window = 0                                           
    MessageRequester("Error", "This is fucked up, I can't open the window", 0)       
    End                                                   
  EndIf
Else
  If OpenWindow(0,0,0,xres,yres, "MultiScroll effect",#PB_Window_BorderLess | #PB_Window_ScreenCentered   )
      ;ButtonGadget(0, 170, 135, 45, 20, "Quitter")
     If OpenWindowedScreen(WindowID(0), 0, 0,  xres , yres,false,0,0,#PB_Screen_SmartSynchronization) =0   
        MessageRequester("Error", "This is fucked up, I can't open the window", 0)       
        End                                                   
      EndIf
  Else
       MessageRequester("Error", "This is fucked up, I can't create the window", 0)       
  EndIf
EndIf

;text.s = " ! #$%&' ()*+ ,-./0 1 2 3 4 5 6 7 8 8 9 :;<=>?@ a bcdefghijklmnopqrstuvwxyz"
text.s = "                 THE EMPIRE PRESENT YOU A NEW INTRO BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA"

Dim gfxfont(60) ; buffer for the fonts' pointers
font = CatchImage (#PB_Any, ?fontes)   
For loop =0 To 59                               
  gfxfont(loop) = GrabImage(font,#PB_Any,loop*8,0,8,7)   ;grab an image for each letter
Next

sizeScroll = Len(text)*8  ;total size of the "scroll sprite"

CreateSprite(2,sizeScroll,7,#PB_Sprite_Texture)
CreateSprite3D(21,2)
ZoomSprite3D(21,sizeScroll,7) ; have to zoom it, overwise ther is a bug at display

; this part is the "scroll sprite" creation. In PureBasic, you can't make sprite into a sprite with the StartDrawing(SpriteOutPut()) method
; so we have to draw into it ! That why we created a font for each letter.
StartDrawing (SpriteOutput(2))
  For cc.w = 1 To Len(text)
    letter = (Asc(UCase(Mid(text, cc, 1)))-32)    ; get letter index
    DrawImage (ImageID(gfxfont(letter)), (cc-1)*8, 0) ; draw into sprite at letter position
  Next
StopDrawing()

xScroll = 0

Repeat
  ClearScreen(0)
 
  StartDrawing(ScreenOutput())
  Start3D()
  angPos = 0
  For yscroll = 0 To 24
    xClip = xScroll+4*yscroll         ; position to clip the "scroll sprite"
    If (sizeScroll - xClip) < 320     ; if the part left is too small (less than 320 pixels), it will zoom instead
      lClip = sizeScroll - xClip      ; so we have to correct it
    Else
      lClip = 320                     ; when the part left is over 320 pixel, not problems.
    EndIf
    ClipSprite3D(21,xClip,0,lClip,7)  ; clipping the sprite
    ZoomSprite3D(21,lClip*2,14)       ;zooming at the good size
    DisplaySprite3D(21,deportx,deporty+yscroll*16)  ;displaying at the good position :D
  Next
 
  xScroll = xScroll + 1       ; moving stuff
  If xScroll > sizeScroll
    xScroll = 0
  EndIf
   
  Stop3D()
  StopDrawing()
 
  Gosub fps:
 
  FlipBuffers() 

  If fullscreen<>#PB_Checkbox_Checked
    Event = WindowEvent()
  EndIf
  ExamineKeyboard() :
 
Until KeyboardPushed (#PB_Key_Escape)           

End
fps:
  If Val ( FormatDate ( "%ss" , Date ()))=sek ; regardez pas là, c'est trop compliqué. Arrêtez j'vous dis! Bon ben, je
       ; vous aurez prévenu...
      fps+1
  Else
      FPS$= Str (fps)
      fps=0
  EndIf
  sek= Val ( FormatDate ( "%ss" , Date ()))
   
  StartDrawing ( ScreenOutput ())
  DrawingMode (1)
  FrontColor ( RGB (255,255,255))
  DrawText (1,1, "FPS: " +FPS$+", "+Str((B-A)*100)+"->"+StrF(angleY))
  StopDrawing ()
Return
DataSection
fontes: IncludeBinary "font.bmp"
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Scroller wavelength
« Reply #39 on: January 31, 2012 »
Big thanks Jace. I'l see if I can use it in any of my future projects (and credit you obviously) to speed things up.
 :cheers:
Challenge Trophies Won: