Re: Erstelltes Programm läuft nicht überall
Verfasst: 11.05.2016 21:23
dann weis ich auch nicht was ich falsch mache.
ich poste mal den Code. er benötigt die MP3d Lib (Links zu den Libs und Includes im Code).. aber evtl. kann jemand so, erkennen was denn dann bei mir falsch ist?
wäre natürlich sehr verbunden. Ich bin mit meinem Latain am Ende.
EDIT:
DIES IST NUN DER LAUFFÄHIGE CODE, besonderes DANKE AN "
" und ALLE DIE GEHOLFEN HABEN
ich poste mal den Code. er benötigt die MP3d Lib (Links zu den Libs und Includes im Code).. aber evtl. kann jemand so, erkennen was denn dann bei mir falsch ist?
wäre natürlich sehr verbunden. Ich bin mit meinem Latain am Ende.
EDIT:
DIES IST NUN DER LAUFFÄHIGE CODE, besonderes DANKE AN "


Code: Alles auswählen
;======================================================================================
;
;
; FIRST OF ALL:
; install the whole FXlibs -> MP3D Lib
; http://www.inc-games-design.de/Tools/Mp3dLib_installer.rar
;
; than
; Goto: Compiler -> Compiler Options -> Library Subsystem and input: DX9
;
; 2nd (SIDPLAY LIB):
; http://www.inc-games-design.de/Tools/bitMapFontCreator.rar
;
; copy from: TitchiSID Purebasic V1.2beta
; Folder -> UserLibraries -> Titchysid_V1_2_Beta -> to PureBasic -> UserLibraries
; Folder -> Compilers -> masm32.lib & titchysid_extras.lib -> to PureBasic -> Compilers
; http://www.inc-games-design.de/Tools/TitchiSID Purebasic V1.2beta.rar
;
;
; ALL INCLUDE FILES:
; http://www.inc-games-design.de/Tools/Nebulus.rar
;
; TO CREATE OTHER CUSTOM FONTS (ignore AntivirusFalse Alert),
; USE:
; bitMapFontCreator -> choose Fontsize and save as *.png with black background.
; black will be always set as transparency AlphaColorBlend -> RGB(0,0,0)
;
;
; REtro-LOad V0.2 by inc 2016
;
; PureBasic v5.30
; tested with Windows 7 64+32 bit & Windows XP 32 bit
;
;
;======================================================================================
InitKeyboard()
InitSprite()
EP_InitFXLib(); Handle Scroller
UsePNGImageDecoder()
;UseJPEGImageDecoder(); no *.jpg used yet
Enumeration
#Wndw
#Exit_btn
#Gadget_exit
#Title
#Title_Font
EndEnumeration
Define event.i, EventID
;Define Exit Button
CreateImage(#Exit_btn,22,22)
StartDrawing(ImageOutput(#Exit_btn))
FillArea(0,0,RGB(51, 66, 212),RGB(51, 66, 212))
Line(3,18,16,-16,RGB(196, 196, 196))
Line(3,3,17,17,RGB(196, 196, 196))
StopDrawing()
; Define Tool Start Up Effect
#AW_CENTER = $10 ;Makes the window appear To collapse inward If AW_HIDE is used Or expand outward If the AW_HIDE is not used.
DataSection
;{ Background Pic
Background_Pic:
IncludeBinary "GFX\relo-nebulus.png"
Background_Pic_End:
;}
;{ Scanlines
Scanlines:
IncludeBinary "GFX\scan3.png"
Scanlines_End:
;}
;{ Font
Font:
IncludeBinary "Font\font_16x16.png"
FontEnd:
;}
;{ *.Sid Sound
SidStart:
IncludeBinary "Sound\84.sid"
sidend:
;}
;- ADD AMIGA EMU, FILES AND GAME
;{ AmigaEmulator
Winuae:
IncludeBinary "Nebulus\winuae.exe"
Winuae_End:
;}
;{ AmigaGame Nebulus
Nebulus:
IncludeBinary "Nebulus\Nebulus (1988)(Hewson).adf"
Nebulus_End:
;}
;{ WinuaeINI
WinuaeINI:
IncludeBinary "Nebulus\winuae.ini"
WinuaeINI_End:
;}
;{ Nebulus-Start3.uae
NebulusStart3:
IncludeBinary "Nebulus\nebulus-start3.uae"
NebulusStart3_End:
;}
;{ Nebulus-Start3_Win.uae
NebulusStart3Win:
IncludeBinary "Nebulus\nebulus-start3_win.uae"
NebulusStart3Win_End:
;}
EndDataSection
; Load Winuae.exe into Mem
Procedure WinuaeExtract(fileName.s)
If CreateFile(1, fileName) ; create file
L1 = ?Winuae_End - ?Winuae ; get size of included binary
WriteData(1, ?Winuae, L1) ; write included binary to file
CloseFile(1) ; close file
Else
MessageRequester("Error", "Schreibfehler! Keine Schreibrechte auf C:?", 0)
EndIf
ProcedureReturn 1
EndProcedure
; Load Nebulus Game into Mem
Procedure Nebulus_Game_Extract(fileName.s)
If CreateFile(2, fileName) ; create file
L2 = ?Nebulus_End - ?Nebulus ; get size of included binary
WriteData(2, ?Nebulus, L2) ; write included binary to file
CloseFile(2) ; close file
Else
MessageRequester("Error", "Schreibfehler! Keine Schreibrechte auf C:?", 0)
EndIf
ProcedureReturn 1
EndProcedure
; Load WinuaeINI into Mem
Procedure WinuaeINI_Extract(fileName.s)
If CreateFile(3, fileName) ; create file
L3 = ?WinuaeINI_End - ?WinuaeINI ; get size of included binary
WriteData(3, ?WinuaeINI, L3) ; write included binary to file
CloseFile(3) ; close file
Else
MessageRequester("Error", "Schreibfehler! Keine Schreibrechte auf C:?", 0)
EndIf
ProcedureReturn 1
EndProcedure
; Load Nebulus-Start3.uae into Mem
Procedure NebulusStart3_Extract(fileName.s)
If CreateFile(4, fileName) ; create file
L4 = ?NebulusStart3_End - ?NebulusStart3 ; get size of included binary
WriteData(4, ?NebulusStart3, L4) ; write included binary to file
CloseFile(4) ; close file
Else
MessageRequester("Error", "Schreibfehler! Keine Schreibrechte auf C:?", 0)
EndIf
ProcedureReturn 1
EndProcedure
; Load Nebulus-Start3_Win.uae into Mem
Procedure NebulusStart3Win_Extract(fileName.s)
If CreateFile(5, fileName) ; create file
L5 = ?NebulusStart3Win_End - ?NebulusStart3Win ; get size of included binary
WriteData(5, ?NebulusStart3Win, L5) ; write included binary to file
CloseFile(5) ; close file
Else
MessageRequester("Error", "Schreibfehler! Keine Schreibrechte auf C:?", 0)
EndIf
ProcedureReturn 1
EndProcedure
; EXTRACT ALL GAME- & EMU FILES INTO TEMP DIR
Procedure WriteToTempDir()
temp$ = GetTemporaryDirectory();returns the path of the temp directory
WinuaeExtract(temp$+"winuae.exe")
Nebulus_Game_Extract(temp$+"Nebulus (1988)(Hewson).adf")
WinuaeINI_Extract(temp$+"winuae.ini")
NebulusStart3_Extract(temp$+"nebulus-start3.uae");FullScreen Mode Game File
NebulusStart3Win_Extract(temp$+"nebulus-start3_win.uae");WindowMode Game File
EndProcedure
; Delete all extracted Files from Temp Dir
Procedure DeleteFromTempDir()
temp$ = GetTemporaryDirectory(); returns the path of the temp directory
DeleteFile(temp$+"winuae.exe")
DeleteFile(temp$+"Nebulus (1988)(Hewson).adf")
DeleteFile(temp$+"winuae.ini")
DeleteFile(temp$+"nebulus-start3.uae")
DeleteFile(temp$+"nebulus-start3_win.uae")
EndProcedure
;////////////////////////////////////
;- MAIN WINDOW / WINDOWED SCREEN
;////////////////////////////////////
OpenWindow(#Wndw, 0, 0, 640, 502, "", #PB_Window_ScreenCentered | #PB_Window_BorderLess | #PB_Window_Invisible)
SetActiveWindow(#Wndw) ;keep our Tool active and wait for Keyboard input
;////////////////////////////////////
;- OPENWINDOWED SCREEN
;////////////////////////////////////
If OpenWindowedScreen(WindowID(#Wndw), 0, 0, 640, 502, #True, 0, 0, #PB_Screen_WaitSynchronization)
;////////////////////////////////////
;- HANDLE 3D DX SCREEN
;////////////////////////////////////
MP_ScreenToHandle(WindowID(#Wndw)) ;handle Window #Wndw as Demo 3D Effect screen
x = 0 : y = 22 : xw = 640 : yw = 480 ;DEFINE SIZE OF THE DEMO EFFECT SCREEN HERE
MP_Viewport(x,y,xw,yw)
MP_AmbientSetLight (RGB(4, 0, 15)) ;Demo Screen Background Color
;////////////////////////////////////
;-3D QUBE
;////////////////////////////////////
camera=MP_CreateCamera() ;CREATE CAM
light=MP_CreateLight(1) ;MAKE LIGHT
Mesh=MP_CreateCube() ;CREATE QUBE
MP_PositionEntity (Mesh,0,0,3.5) ;POSITION QUBE, last number makes the size and Z Index of a qube
MP_Wireframe(1) ;QUBE AS WIREFRAME. IF THIS LINE IS DISABLED: QUBE HAVE A TEXTURE
If CreateImage(0, 5, 5) ;Create coloured Wireframe
MP_CreateImageColored(0,0,RGB(245, 176, 0),RGB(44, 31, 96),RGB(25, 12, 74),RGB(100, 89, 87)) ;going to orange and blue wireframe
MP_EntitySetTexture (mesh, MP_ImageToTexture(0))
FreeImage(0)
EndIf
;////////////////////////////////////
;- EXIT BUTTON
;////////////////////////////////////
ImageGadget(#Gadget_exit,WindowWidth(#Wndw)-22,0,22,22,ImageID(#Exit_btn))
;////////////////////////////////////
;////////////////////////////////////
;- TOOL TITLE
;////////////////////////////////////
TextGadget(#Title,WindowWidth(0)-640, 0, 618, 22, " REtro-LOad V0.2",#SS_CENTERIMAGE)
SetGadgetFont(#Title, LoadFont(#Title_Font, "Arial", 8, #PB_Font_HighQuality))
SetGadgetColor(#Title , #PB_Gadget_BackColor, RGB(42, 94, 198)) ;TEXT Background Color
SetGadgetColor(#Title , #PB_Gadget_FrontColor, RGB(248, 248, 248));TEXT Color
;////////////////////////////////////
;- SINUS FONT
;////////////////////////////////////
EP_CatchFont16(FontSprite,?Font, ?FontEnd)
EP_SetScrollText(FontSprite, " RETROLOADER V0.2 BY Inc... PLAY NEBULUS (AMIGA-VERSION) BY TRIFFIX ENTERTAINMENT 1987 +++ SIDTUNE STOLEN FROM HIGH VOLTAGE SID COLLECTION - TRACK: UNKOWN84 +++ GREETINGS TO CYRA - KAOS - NORTH - APPRENTICE - RETROBLAH - INFINITY(NES) - ZERSTAMPFER - JENS64 - HOUDINI - BRUN0 - CLASSIC-VIDEOGAMES - ARCADEZENTRUM - ARCADEINFO - CIRCUIT-BOARD - AND ALL PEOPLE OVER THE WORLD :D... reload ")
EP_Create16Scroll(FontSprite, 0, 0,455, 0,700)
EP_SetSinScroll16(FontSprite, 3, 0 , 20, 10) ;DEFINE BEHAVIOR BY SINUS: 3=?, 0= Letter height (0=Default) , 20= SinusHeight, 10= SinusWidth
;////////////////////////////////////
;- BACKGROUND PICTURE
;////////////////////////////////////
Background = MP_CatchSprite(?Background_Pic, ?Background_Pic_End - ?Background_Pic)
;////////////////////////////////////
;- SCANLINES OVERLAYER
;////////////////////////////////////
Scanlines = MP_CatchSprite(?Scanlines, ?Scanlines_End - ?Scanlines)
;////////////////////////////////////
;- READ SID FILE AND PLAY
;////////////////////////////////////
SIDOpen(?SidStart,?sidend-?SidStart,1,2,1)
SIDPlay()
;////////////////////////////////////
;- USE TOOL START UP EFFECT
;////////////////////////////////////
AnimateWindow_(WindowID(0),300,#AW_CENTER)
HideWindow(0,#False)
;////////////////////////////////////
;- EXTRACT ALL GAME- & EMU FILES INTO TEMP DIR
;////////////////////////////////////
WriteToTempDir()
;////////////////////////////////////
;
;- MAIN
;
;////////////////////////////////////
Repeat
Event = WindowEvent()
EventGadget = EventGadget()
ExamineKeyboard()
KeyboardMode(#PB_Keyboard_Qwerty)
If Not MP_DeviceStatus(0)
MessageRequester("Information", "Es ist keine Tastatur vorhanden", 0);
End
EndIf
;////////////////////////////////////
;-START AMIGA GAME IN FULLSCREEN
;////////////////////////////////////
If MP_KeyDown(#PB_Key_1) Or MP_KeyDown(#PB_Key_Pad1)
SIDClose(); Close Sidplayer
;start Amiga EMU + Amiga GAME in Fullscreen Mode
RunProgram(temp$ + "winuae.exe", "-f nebulus-start3.uae", "")
End ;Close Demo-Tool
EndIf
;////////////////////////////////////
;-START AMIGA GAME IN WINDOW MODE
;////////////////////////////////////
If MP_KeyDown(#PB_Key_2) Or MP_KeyDown(#PB_Key_Pad2)
SIDClose(); Close Sidplayer
;start Amiga EMU + Amiga GAME in WindowMode
RunProgram(temp$ + "winuae.exe", "nebulus-start3_win.uae", "")
End ;Close Demo-Tool
EndIf
;-
;////////////////////////////////////
;-DRAG TOOL WITH MOUSE
;////////////////////////////////////
Select Event
Case #PB_Event_Gadget
Case #WM_LBUTTONDOWN
SendMessage_(WindowID(#Wndw), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
EndSelect
;////////////////////////////////////
;-EXIT BUTTON/ CLOSE TOOL
;////////////////////////////////////
If Event=#PB_Event_Gadget
If EventGadget()= #Gadget_exit
SIDClose(); Close Sidplayer
;- delete file from temp dir on exit
DeleteFromTempDir()
End
EndIf
EndIf
;////////////////////////////////////
;-ESCAPE -> EXIT BUTTON/ CLOSE TOOL
;////////////////////////////////////
If Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
SIDClose(); Close Sidplayer
;- delete file from temp dir on exit
DeleteFromTempDir()
End
EndIf
;////////////////////////////////////
;-CREATE 3D WORLD
;////////////////////////////////////
MP_RenderBegin()
;////////////////////////////////////
;-SCROLL TEXT NOW
;////////////////////////////////////
EP_Move16Scroll(0)
;////////////////////////////////////
;-BACKGROUND PICTURE
;////////////////////////////////////
MP_DrawSprite(Background, 0, 22); SHOW BACKGROUND PICTURE
MP_SpriteSetZ(Background, 9) ; 9 = Z INDEX
;////////////////////////////////////
;-SCANLINES OVERLAYER
;////////////////////////////////////
MP_DrawSprite(Scanlines, 0, 22); SHOW BACKGROUND PICTURE
MP_SpriteSetZ(Scanlines, 0) ; 0 = Z INDEX
MP_SpriteBlendingMode(Scanlines, 4 , 6); SET BLEND MODE FOR SCANLINES
;////////////////////////////////////
;-3d QUBE
;////////////////////////////////////
MP_TurnEntity (Mesh,0.9,0.9,0.9); spinning speed
;{ move 3D Qube from left to right and back
X_Add.f + 1
Cam_SX.f = Sin((X_Add.f * #PI / 180)) * 1
MP_PositionEntity (Camera, Cam_SX , -0.5, 0)
;}
;////////////////////////////////////
;-CREATE 3D WORLD and RUN IT
;////////////////////////////////////
MP_Render2D()
MP_RenderSprite()
MP_RenderText()
MP_RenderMesh(mesh)
MP_RenderEnd()
MP_Flip() ;FLIP BUFFERS
ForEver
EndIf