Author Topic: Skid Row remake + PureBasic source code  (Read 8146 times)

0 Members and 1 Guest are viewing this topic.

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 982
  • Karma: 258
    • View Profile
Skid Row remake + PureBasic source code
« on: October 04, 2014 »
Hi all,

Well, what can I say. I was bored, so I decided to code something. This is the outcome.

Required files + compiled executable available in the ZIP archive.

Enjoy!  :cheers:

Code: [Select]
;******************************************************************************************
;* Pretty much a 1:1 conversion of Ayoros' CODEF remake at http://www.wab.com/?screen=245 *
;* with some minor modifications.                                                         *
;* SC68 tune originally ripped by Stormbringer                                            *
;* Quickly hacked together & compiled with PureBasic 5.30 x86 by Padman in 2014.          *                                                   
;* Exe size ~75Kb UPX'ed. Not too bad, eh? ^^                                             *
;******************************************************************************************


XIncludeFile "sc68_replay.pbi"

If InitSprite() = 0 Or InitKeyboard() = 0
  MessageRequester("Error", "Sprite system can't be initialized", 0)
  End
EndIf



If OpenScreen(800, 600, 32, "Skid Row Remake")

  CatchSprite(0,?s) : CatchSprite(1,?k) : CatchSprite(2,?i) : CatchSprite(3,?d) : CatchSprite (4,?r) : CatchSprite(5,?o) : CatchSprite(6,?w)
  CatchSprite(7,?txt1) : CatchSprite (8,?txt2) :CatchSprite(10,?backgr)
 
  For sprite = 0 To 6
    TransparentSpriteColor(sprite,$FFFFFF)   ; Set transparency to white
  Next
 
  TransparentSpriteColor(7,$FF00FF) :  TransparentSpriteColor(8,$FF00FF) ; Set transparency to purple
 
  CreateSprite(20,720,249)  ; Create sprite for scanline effect
  StartDrawing(SpriteOutput(20))
  Box(0,0,720,240,$FFFFFF)
  For i=0 To 240 Step 2
    Line(0,i,720,1,$000000)
  Next
  StopDrawing()
  TransparentSpriteColor(20,$FFFFFF) ; Set transparency to white
 
   
 sc68replay_Init(?tune , ?tuneend-?tune, #SC68Replay_Memory)   ; Init tune
 sc68replay_Play() ; Start tune
 
 
Repeat
   
   
   
    FlipBuffers()
   
    ClearScreen(RGB(0,0,0))
   
        DisplaySprite(10,40,180)  ; Background

        DisplayTransparentSprite(0,350 + 270 * Sin(angle.f), 190+15,fade)    ;S
        DisplayTransparentSprite(1,360 + 190 * Sin(angle.f), 197+15,fade)    ;k
        DisplayTransparentSprite(2,386 + 130 * Sin(angle.f), 209+15,fade)    ;i
        DisplayTransparentSprite(3,360 + 70 *  Sin(angle.f), 197+15,fade)    ;d
   
        DisplayTransparentSprite(6,340 - 260 * Sin(angle.f), 254+15,fade)     ;R
        DisplayTransparentSprite(5,350 - 166 * Sin(angle.f), 255+15,fade)     ;o
        DisplayTransparentSprite(4,340 - 70 *  Sin(angle.f), 198+15,fade)     ;w
   
    angle.f= angle.f+ 0.035
   

   
   
  If vbl>=200 And  vbl<700 :  DisplayTransparentSprite(7,40,165+25) : EndIf  ; Text page 1
  If vbl>=700 And  vbl<1100 : DisplayTransparentSprite(8,40,164+15) : EndIf  ; Text page 2
  If vbl>=1100 : vbl=0 : EndIf
 
  vbl=vbl+1
  If fade<255
      fade=fade+5
   Else 
      fade=255
  EndIf 
 
       DisplayTransparentSprite(20,40,180)
  ExamineKeyboard()
  Until KeyboardPushed(#PB_Key_Escape)
 
  sc68replay_Stop()  ; Stop tune
   
 Else
  MessageRequester("Error", "Can't open a 800*600 - 32 bit screen !", 0)
  EndIf


DataSection
 
  backgr:   
  IncludeBinary "res/backgr.bmp"
  txt1:   
  IncludeBinary "res/txt1.bmp"
  txt2:   
  IncludeBinary "res/txt2.bmp"
  s:     
  IncludeBinary "res/s.bmp"
  k:     
  IncludeBinary "res/k.bmp"
  i:     
  IncludeBinary "res/i.bmp"
  d:     
  IncludeBinary "res/d.bmp"
  r:
  IncludeBinary "res/r.bmp"
  o:
  IncludeBinary "res/o.bmp"
  w:
  IncludeBinary "res/w.bmp"
  tune:
  IncludeBinary "res/tune.sc68"
  tuneend:
 
EndDataSection 

[Edit] Typos and other cock-ups fixed.  ::)
« Last Edit: October 04, 2014 by padman »
Challenge Trophies Won:

Offline Majikeyric

  • ZX 81
  • *
  • Posts: 2
  • Karma: 1
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #1 on: October 04, 2014 »
Very nice! :carrot:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #2 on: October 05, 2014 »
Nice one padman and love the music :)

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 982
  • Karma: 258
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #3 on: October 05, 2014 »
Thanks guys! :)

@inc: Thanks mate, but to keep my thread clean I moved your post here.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1200
  • Karma: 230
    • View Profile
    • Homepage
Re: Skid Row remake + PureBasic source code
« Reply #4 on: October 05, 2014 »
Hoi, very nice! Excellent work good sir!  :cheers:
I was thinking how this came at exactly the right time, until I realised that any time is good demo time! That said, perfect timing! ;)

I also had a long lost memory popup about how I laboriously typed over a tunnel flying game in visual basic (I think it was) in hopes of learning programming. This was way before more succesfull efforts. Random memory popup...  :)
www.kirl.nl
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 982
  • Karma: 258
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #5 on: October 06, 2014 »
Quote
any time is good demo time!

Word! Thanks mate! :)
Challenge Trophies Won:

Offline Dr.Death

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 435
  • Karma: 8
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #6 on: October 07, 2014 »
Good job mate. It's nice to see something off you  :updance:
Proud member of DAWN

Offline ttemper

  • Atari ST
  • ***
  • Posts: 209
  • Karma: 7
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #7 on: October 11, 2014 »
very nice :) simple but effective.

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1150
  • Karma: 174
    • View Profile
    • Raizor's Dev Blog
Re: Skid Row remake + PureBasic source code
« Reply #8 on: October 15, 2014 »
Very cool! I remember watching the original, many years ago. Lovely as always, Padman :) K++
raizor

Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 982
  • Karma: 258
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #9 on: October 17, 2014 »
Thanks guys!  :)
Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Skid Row remake + PureBasic source code
« Reply #10 on: October 17, 2014 »
Nice :D
I would have code something, but... I'm too lazyyyyyy  :crutches:
Challenge Trophies Won:

Offline Dad1916

  • Atari ST
  • ***
  • Posts: 110
  • Karma: 3
    • View Profile
    • Quadriga demo group
Re: Skid Row remake + PureBasic source code
« Reply #11 on: December 04, 2014 »
Nice and thanks for sharing.

When attempting to compile I am having a problem with sc68replay.lib . I believe it's built for something other than Mac Os X. Is my assumption correct? I've search but am unsure as to where  I download and compile this lib.

thnkas.

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 261
  • Karma: 19
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #12 on: December 04, 2014 »
You may compile the source in Windows. Also Check your purebasic Version.

Cheers
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Dad1916

  • Atari ST
  • ***
  • Posts: 110
  • Karma: 3
    • View Profile
    • Quadriga demo group
Re: Skid Row remake + PureBasic source code
« Reply #13 on: December 04, 2014 »
You may compile the source in Windows. Also Check your purebasic Version.

Cheers
thanks for the reply. I want to compile the lib under Mac os X . I'm using PureBasic 5.31 (MacOS X - x64). Where is the lib source ?

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 261
  • Karma: 19
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #14 on: December 04, 2014 »
maybe "padman" is a gentleman and provide the lib (if he wrote the LIB? ) . you may ask him
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Dad1916

  • Atari ST
  • ***
  • Posts: 110
  • Karma: 3
    • View Profile
    • Quadriga demo group
Re: Skid Row remake + PureBasic source code
« Reply #15 on: December 04, 2014 »
maybe "padman" is a gentleman and provide the lib (if he wrote the LIB? ) . you may ask him

From what I can make out StormBringer wrote the Freebasic version http://www.dbfinteractive.com/forum/index.php?topic=3030.5
I'll pm PadMan and see how I progress.
Thanks.

Offline AmigaJoker

  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #16 on: April 20, 2015 »
A get following error message...

Line 54: DisplayTransparentSprite(): Incorrect numbers of parameters.

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 982
  • Karma: 258
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #17 on: April 20, 2015 »
Quote
A get following error message...

Line 54: DisplayTransparentSprite(): Incorrect numbers of parameters.

I guess you are using a too old version of PB then. The sprite commands have been changed. I think this happened with version 5.20. Make sure to use a current version,  i.e. 5.24 LTS or  5.31, to compile the source.
Challenge Trophies Won:

Offline AmigaJoker

  • ZX 81
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #18 on: April 23, 2015 »

I guess you are using a too old version of PB then. The sprite commands have been changed. I think this happened with version 5.20. Make sure to use a current version,  i.e. 5.24 LTS or  5.31, to compile the source.

Aha... im using a very old version (4.51). So I have to update asap  :cheers:

Offline emook

  • C= 64
  • **
  • Posts: 88
  • Karma: 12
    • View Profile
Re: Skid Row remake + PureBasic source code
« Reply #19 on: April 28, 2015 »
Very nice remake.

I would suggest using a real timer than an incremental variable so that timing is maintained across all cpus :

Code: [Select]
start=(ElapsedMilliseconds()/30)
 
  Repeat
   
    vbl=(ElapsedMilliseconds()/30)-start
   
    FlipBuffers()
   
    ClearScreen(RGB(0,0,0))
   
    DisplaySprite(10,40,180)  ; Background
   
    ssin.f = Sin(angle.f)
   
    DisplayTransparentSprite(0,350 + 270 * ssin, 190+15,fade)    ;S
    DisplayTransparentSprite(1,360 + 190 * ssin, 197+15,fade);k
    DisplayTransparentSprite(2,386 + 130 * ssin, 209+15,fade);i
    DisplayTransparentSprite(3,360 + 70 *  ssin, 197+15,fade);d
   
    DisplayTransparentSprite(6,340 - 260 * ssin, 254+15,fade)     ;R
    DisplayTransparentSprite(5,350 - 166 * ssin, 255+15,fade)     ;o
    DisplayTransparentSprite(4,340 - 70 *  ssin, 198+15,fade)     ;w
   
    angle.f= angle.f+ 0.035

    If vbl>=35 And  vbl<135 :  DisplayTransparentSprite(7,40,165+25) : EndIf  ; Text page 1
    If vbl>=135 And  vbl<265 : DisplayTransparentSprite(8,40,164+15) : EndIf  ; Text page 2
    If vbl>=295 : start=(ElapsedMilliseconds()/30) : EndIf
   
    If fade<255
      fade=fade+5
    Else 
      fade=255
    EndIf 
   
    DisplayTransparentSprite(20,40,180)
    ExamineKeyboard()
   
  Until KeyboardPushed(#PB_Key_Escape)
----

R Tape loading error, 0:1