Author Topic: [Retroremake] Amstrad CPC for fun  (Read 1127 times)

0 Members and 1 Guest are viewing this topic.

Offline waste

  • C= 64
  • **
  • Posts: 46
  • Karma: 2
    • View Profile
[Retroremake] Amstrad CPC for fun
« on: October 13, 2017 »
hi,

a very simple retroremake of the second demo by Logon System,

yes, i know, you won't learn anything with this code, it's for fun

no exe compiled, diy

if you know a way to rip font stuff from Amstrad it interests me ! you can see looking to the scrolltext that i find a dirty way to implement it !


original : https://www.youtube.com/watch?v=VBMEDJZ46zc

Code: [Select]

; Retro remake Démo n°2 Logon system @mstrad CPC 1988
; jmg@2017

Enumeration
  #scroll
  #chiptune1
EndEnumeration 

;-------------------------------Init---------------------------------------

InitMovie()
InitSprite()
EP_InitFXLib()
UsePNGImageDecoder()

text.s ="                                                             salut tous, petit retroremake purebasic Amstrad cpc " +
        "de la demo numero deux de  logon system je n'ai pas repris le texte du scrolling car trop long a taper de plus a cette epoque " +
        "le texte ne servait qu a illustrer les capacites techniques du scrolling la par exemple je fais du remplissage pour que vous " +
        "puissiez apprecier la musique qui d apres l auteur certaienement serge alias longshot est du jeu rampage "+
        "en fait c est rampart ce qui est pareil que rampage mais avec des chevaliers a la place des dinosaures bref "+
        "je vais m attaquer a un peu plus technique comme retroremake la prochaine fois j en profite pour remercier google " +
        "de m avoir supprime mon compte developpeur pour des raisons obscures  ce jour     c est pas demain que je vais faire " +
        "fortune avec mes applis android    pas grave l espoir fait vivre             "

MP_Graphics3D (759,545,0,1)
SetWindowTitle(0, "Logon Sytem démon N°2 1988 JmG@2017")

EP_CatchFont32(0,?font,?endfont-?font)

EP_SetScrollText(0,text )
EP_Create32Scroll(0, 0, 0, 485)
EP_SetScroll32Speed(0, 8)

LoadMovie(#chiptune1,"chiptune1.mp3")


one = MP_CatchSprite(?sprite,?endsprite-?sprite)
PlayMovie(#chiptune1,1)


Repeat
 
  event=WindowEvent()
 
  MP_DrawSprite(one,0,0)
 
  EP_Move32Scroll(0)
 
  MP_RenderWorld()
  MP_Flip () 
   
Until GetAsyncKeyState_(#VK_ESCAPE)



DataSection
  sprite:
  IncludeBinary "scr1.png"
  endsprite:
  chiptune:
  IncludeBinary "chiptune1.mp3"
  endchiptune:
  font:
  IncludeBinary "fnt.bmp"
  endfont:
EndDataSection


; End PB
; PureBasic 5.42 LTX (x86)


« Last Edit: February 15, 2018 by waste »

Offline ~Ar-S~

  • C= 64
  • **
  • Posts: 33
  • Karma: 3
  • Demo RuleZ
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #1 on: February 12, 2018 »
Please add all libs needed in your zip...
~ Ar-S ~

Offline waste

  • C= 64
  • **
  • Posts: 46
  • Karma: 2
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #2 on: February 15, 2018 »
hi,

i don't know how to midify the previous .zip in attachment

mp3d needed

http://www.flasharts.de/mpz/mp33_beta/MP3D_Installer.exe



Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #3 on: February 16, 2018 »
 delete the attachment,  create a new zip with all needed files and attach it to your created post while Click on modify.
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Bobo220673

  • C= 64
  • **
  • Posts: 29
  • Karma: 9
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #4 on: February 16, 2018 »
Hi!
Here is the Intro without Lib....

Code: [Select]
InitSprite()
InitKeyboard()
InitMovie()
UsePNGImageDecoder()

#SCREEN_CX=759
#SCREEN_CY=545

text.s =UCase("                                                             salut tous, petit retroremake purebasic Amstrad cpc" +
        " de la demo numero deux de  logon system je n'ai pas repris le texte du scrolling car trop long a taper de plus a cette epoque " +
        "le texte ne servait qu a illustrer les capacites techniques du scrolling la par exemple je fais du remplissage pour que vous " +
        "puissiez apprecier la musique qui d apres l auteur certaienement serge alias longshot est du jeu rampage "+
        "en fait c est rampart ce qui est pareil que rampage mais avec des chevaliers a la place des dinosaures bref "+
        "je vais m attaquer a un peu plus technique comme retroremake la prochaine fois j en profite pour remercier google " +
        "de m avoir supprime mon compte developpeur pour des raisons obscures  ce jour     c est pas demain que je vais faire " +
        "fortune avec mes applis android    pas grave l espoir fait vivre             ")

;Create Window
OpenWindow(0, 0, 0, #SCREEN_CX, 545, "Logon Sytem démon N°2 1988 JmG@2017", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, #SCREEN_CX, #SCREEN_CY)
SetFrameRate(60)
;Create Window End

;Create Logo
SpriteLogo_1 = CatchSprite(#PB_Any,?Sprite)
;Create Logo

;Create Scroller
Dim spriteFonts.l(65)
fnt=CatchImage(#PB_Any, ? Font)
For i = 0 To 65
  yCharPos = i / 10 *32
  xCharPos = i % 10 *32
  tempImage_Scroll = GrabImage(fnt , #PB_Any, xCharPos, yCharPos, 32, 32)
  spriteFonts(i) = CreateSprite(#PB_Any, 32, 32)
  StartDrawing(SpriteOutput(spriteFonts(i)))
  DrawAlphaImage(ImageID(tempImage_Scroll), 0, 0)
  StopDrawing()
Next
FreeImage(fnt)
FreeImage(tempImage_Scroll)
VirtualLength_Scroll.l = Len(Text)*32
;Create Scroller End

;Create MP3 Sound
CreateFile(1,GetTemporaryDirectory()+"Sound.mp3")
WriteData(1, ?chiptune, ?endchiptune-?chiptune)
CloseFile(1)
LoadMovie(0, GetTemporaryDirectory()+"Sound.mp3")
PlayMovie(0,0)
;Create MP3 Sound End

Repeat
  ExamineKeyboard()
  While WindowEvent() : Wend
 
  ;Loop MP3 Aound
  If MovieStatus(0)=0
    PlayMovie(0,0)
    Repeat
    Until MovieStatus(0)>1
  EndIf
  ;Loop MP3 Sound End
   
  ClearScreen(RGB(0,0,0))
 
  ;Display Logo
  DisplaySprite (SpriteLogo_1, 0, 0)
  ;Display Logo End
 
  ;Display Scrolltext
  Scroll_x=Scroll_x-10
  If Scroll_x<-VirtualLength_Scroll
    Scroll_x=#SCREEN_CX+64
  EndIf
  For i = 1 To Len(Text)
    LetterID_Scroll.b = Asc(Mid(Text, i, 1))-32
    XPositionScroll.w = Scroll_x + ((i-1)*32)
    If XPositionScroll>#SCREEN_CX+64
      Break
    EndIf
    If XPositionScroll> -32
      DisplaySprite(spriteFonts(LetterID_Scroll),XPositionScroll,485)
    EndIf
  Next i
  ;Display Scrolltext End
       
  FlipBuffers()
       
Until Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
;Delete Temp MP3 Sound
DeleteFile(GetTemporaryDirectory()+"sound.mp3")
;Delete Temp MP3 Sound End

DataSection
  sprite:
  IncludeBinary "scr1.png"
  endsprite:
  chiptune:
  IncludeBinary "chiptune1.mp3"
  endchiptune:
  Font:
  IncludeBinary "fnt.bmp"
  endfont:
EndDataSection

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 977
  • Karma: 258
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #5 on: February 18, 2018 »
... and here's my attempt. With original font, scrolltext and AY music. Couldn't be bothered to include the DLL in the exe and run it from memory though. If you want a single exe, this could also be added easily. Would love to see some more CPC remakes!  :cheers:

Code: [Select]
;##########################################################################################
;# Original CPC remake by JmG / This version by Padman (02/2018)                          #
;# Font ripped by MIC of CPCCRACKERS                                                      #
;# "St_sound.dll" by Leonard / Oxygene                                                    #                                       
;# Scroller code initially by Shockwave / vain!                                           #
;########################################################################################## 


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

OpenLibrary(0, "st_sound.dll")
IncludeFile "scroll.pbi"                             

xres  = 768           
yres  = 540         
sco   = 0
tptr  = 1

;#### Init stuff
InitSprite()                     
InitKeyboard()                 

;#### Open the window
OpenWindow(1,0,0,xres,yres,"CPC Demo Remake",#PB_Window_ScreenCentered  | #PB_Window_BorderLess )
OpenWindowedScreen(WindowID(1),0,0,xres,yres,0,0,0)

;#### Catch the pic sprite and zoom it
CatchSprite(0,?pic)
ZoomSprite(0,SpriteWidth(0)*2,SpriteHeight(0)*2)

;#### Catch the font pic sprite
CatchSprite(1,?font)

;#### Init and start the music replay
*YM_Start = GetFunction(0, "_STS_Play@4")
*YM_Start_Mem= GetFunction(0,"_STS_Play_Mem@8")
*YM_Stop = GetFunction(0, "_STS_Stop@0")

CallFunctionFast(*YM_Start_Mem,?Ym,?YmEnd-?YM)
 
Repeat

WaitWindowEvent(1)
 
ClearScreen($0)                                       

;#### This displays the pic

DisplaySprite(0,0,0)

; #### This draws the scroller
 
cco = 0

  For cc = 0 To 40
    letter   = Asc(UCase(Mid(t.s, tptr+cc, 1)))-32
 
    yCharPos = letter / 20
    xCharPos = letter % 20

   ClipSprite(1, xCharPos*16, yCharPos*14, 16,14)
   
    ZoomSprite(1,SpriteWidth(1)*2,SpriteHeight(1)*2)
     DisplayTransparentSprite(1, (sco+cco),485)
 
   
    cco = cco + 32
  Next
 
     
  sco = sco -3
   
  If sco < -32
    tptr = tptr + 1
    sco = sco + 32
  EndIf
     
  If tptr > Len(t.s)-32
    tptr = 0
  EndIf

ExamineKeyboard()

FlipBuffers()                                       

Until KeyboardPushed (#PB_Key_Escape)               

;#### If [ESC] was pressed stop the music and close the DLL
 
  CallFunctionFast(*YM_Stop)
  CloseLibrary(0)

End

DataSection
  font:
  IncludeBinary "font.bmp"
  pic:
  IncludeBinary "screen.bmp"
  Ym:
  IncludeBinary "rampart.ym"
  YmEnd:

EndDataSection
Challenge Trophies Won:

Offline ~Ar-S~

  • C= 64
  • **
  • Posts: 33
  • Karma: 3
  • Demo RuleZ
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #6 on: March 03, 2018 »
Thanks padman. It working with 5.62 x86 (but invalid access mem to the callFunctionFast with x64)  :clap:
~ Ar-S ~

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 977
  • Karma: 258
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #7 on: March 03, 2018 »
You are right, I should have mentioned that it only works when compiled with PB x86. The DLL is 32 bit and you can't call it from a x64 application. But I guess 32 bit is enough for a CPC remake anyways... ;)
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 255
  • Karma: 97
    • View Profile
    • KrazyK Remakes
Re: [Retroremake] Amstrad CPC for fun
« Reply #8 on: March 04, 2018 »
Nice work padman.  And here's the memory loaded dll version for a single exe file.  Added and changed a few lines to keep the window on top, hide the cursor and stop the crashing when clicking outside the window.  Still only x86 as Padmans says as there's no x64 dll.



Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 977
  • Karma: 258
    • View Profile
Re: [Retroremake] Amstrad CPC for fun
« Reply #9 on: March 04, 2018 »
Nice work mate  :goodpost: Didn't know WaitWindowEvent() could cause a crash as it doesn't crash here no matter how often I click outside the window. But as it obviously can K+ for the fix.
Challenge Trophies Won: