Author Topic: Re: Hello everyone :)  (Read 28152 times)

0 Members and 1 Guest are viewing this topic.

Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Hello everyone :)
« Reply #40 on: December 04, 2008 »
I have fixed the scroller . . .

Code: [Select]
Screenres 640,480,32,2
Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="Hello guys !! ... thank you for everything !! .... your help is priceless !! couldn't have done what you see before you without you guys :) ... "
a=a+"                                                                                                                                              "

Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-2
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)
sleep

:)

Andy
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #41 on: December 04, 2008 »
respect guys to all of you :cheers: :cheers:

i only have 2 questions left and this project is finished thanx to all of you ;D

1: how do i make the scroller restart?
2: how do i add a tune?


Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Hello everyone :)
« Reply #42 on: December 04, 2008 »
The scroller (using my code) will restart.
Music I will hand over to somebody else . . . :)

DrewPee
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Hello everyone :)
« Reply #43 on: December 04, 2008 »
2: how do i add a tune?
Click here.
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #44 on: December 04, 2008 »
@ DrewPee

1: how do i make the scroller restart? discard this one i left in a hurry and noticed it afterwards :P thanx again man ;D

@ hellfire

yes i've read this thread, my question should of been like if there is a way to put music like i did with the Bload command.


Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Hello everyone :)
« Reply #45 on: December 04, 2008 »
what fileformat do you want to play?
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #46 on: December 04, 2008 »
um well the fileformat is not a problem, i mean i can convert it to the one that the command supports if there is such a command.


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Hello everyone :)
« Reply #47 on: December 04, 2008 »
If you are using uFmod, you can use this command to load your .xm song:

hWave = uFMOD_PlaySong(@"your_song.xm",0,XM_FILE)


Below you can find a modified version of uFmod test file:
Code: [Select]

ChDir ExePath

'Includes
#include "windows.bi"
#include "ufmod.bi"

'Variables
Dim hWave As HWAVEOUT
Dim title_ptr as zstring ptr

'Allocate 50 bytes for music title
title_ptr = allocate(50)


'----------------Main

    'Play our music
    hWave = uFMOD_PlaySong(@"Jos-Chpk.xm",0,XM_FILE)
   
    'Get music title
    title_ptr = uFMOD_GetTitle()

    'Set music volume
    uFMOD_SetVolume(60)
   
    cls
    print "Playing ... "; *title_ptr

    While Inkey$() <> Chr$(27)
       
        Locate 3,1
        Print "                            "
        Print "Time: "; uFMOD_GetTime()
        Sleep 500
       
    Wend
   
    uFMOD_StopSong()

'----------------End
 
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #48 on: December 04, 2008 »
thanx rbz :D i'll try and find a decent xm tune to load :cheers:

EDIT: found the xm tune :clap: , i'll go now play with uFmod :stirrer:

EDIT2: i tried to follow the instructions of Shockwave found here ->http://www.dbfinteractive.com/forum/index.php/topic,542.0.html

but i get this


Code: [Select]
Compiler output:
C:/Program Files/FreeBASIC/xmas.bas(2) error 136: Default types or suffixes are only valid in -lang deprecated or fblite or qb, found '.' in 'dim shared XmasAmiga.xm(0 to 162993) as ubyte = { _'
C:/Program Files/FreeBASIC/FBIDETEMP.bas(8) error 41: Variable not declared, Music in 'hWave = uFMOD_PlaySong(@Music(1),50600,XM_MEMORY)'
C:/Program Files/FreeBASIC/FBIDETEMP.bas(8) warning 12(0): Implicit variable allocation, Music

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 0.20.0 (08-10-2008) for win32 (target:win32)
OS:    Windows XP (build 2600, Service Pack 3)

the code i use is this

Quote
Screenres 640,480,32,2

#Include Once "tinyptc.bi"
#include "windows.bi"
#include "ufmod.bi"
#include "xmas.bas"
       Dim hWave As HWAVEOUT
       hWave = uFMOD_PlaySong(@Music(0),50600,XM_MEMORY)

Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="scroller text "
a=a+"                                                "
       
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

sleep

i think i should follow his suggestion too :-\

If you can't figure out how to include ufmod after reading this tut you probably shouldn't be coding.
« Last Edit: December 06, 2008 by bikerboy »


Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Hello everyone :)
« Reply #49 on: December 06, 2008 »
Quote
i think i should follow his suggestion too  :-\

Quote from: Shockwave on August 13, 2006
If you can't figure out how to include ufmod after reading this tut you probably shouldn't be coding.

Programming throws these problems at you, it's up to you as a coder to work them out, I've seen some promising people quit.

By the way, the problem is that the tutorial is for freebasic 1.5

You have a newer version I am guessing, thats why it on't compile without lang deprecated.

So in a nice way I would ask you to stop threatening to give up, you'll get no sympathy that way, instead post your question and don't feel bad about it!

We're happy to help.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #50 on: December 06, 2008 »
Programming throws these problems at you, it's up to you as a coder to work them out, I've seen some promising people quit.

By the way, the problem is that the tutorial is for freebasic 1.5

You have a newer version I am guessing, thats why it on't compile without lang deprecated.

yes i have
Code: [Select]
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 0.20.0 (08-10-2008) for win32 (target:win32)

So in a nice way I would ask you to stop threatening to give up, you'll get no sympathy that way, instead post your question and don't feel bad about it!

We're happy to help.

you misunderstood me mate, i wrote that b/c whatever i do ends up in error, and i feel like a total idiot if ask for everything i do b/c i can't do anything on my own.

i'm not looking for sympathy , i just don't want to bust your b@lls with questions.

i know you guys are happy to help :)

ok so in the version i have how do i load an mp3 file or an xm file or a mod file?

the easiest way ::)


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Hello everyone :)
« Reply #51 on: December 06, 2008 »
Looking at error message you got, you need to change your "xmas.bas" file:

Replace this line:
dim shared XmasAmiga.xm(0 to 162993)
to:
dim shared Music(0 to 162993)

and also on your main .bas file, change this line:
hWave = uFMOD_PlaySong(@Music(0),50601,XM_MEMORY)
to:
hWave = uFMOD_PlaySong(@Music(0),162994,XM_MEMORY)

It should work now...
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #52 on: December 06, 2008 »
ok changed what you said and now i get ->

Code: [Select]
Compiler output:
C:\Program Files\FreeBASIC\FBIDETEMP.o:fake:(.text+0x4d): undefined reference to `uFMOD_PlaySong@12'


the beginning of the xmas.bas


Code: [Select]
'// Created with Bin2Bas V0.22 - by Rbraz (c) 2006
dim shared Music(0 to 162993) as ubyte = { _
&H58,&H6D,&H61,&H73,&H41,&H6D,&H69,&H67,&H61,&H00

and the code

Code: [Select]
Screenres 640,480,32,2

#Include Once "tinyptc.bi"
#include "windows.bi"
#include "ufmod.bi"
#include "xmas.bas"
       Dim hWave As HWAVEOUT
       hWave = uFMOD_PlaySong(@Music(0),162994,XM_MEMORY)

Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="scroller text "
a=a+"                                                "
       
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

sleep


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Hello everyone :)
« Reply #53 on: December 06, 2008 »
Ok, now you have to compile your .bas file with ufmod.o  (object file)

1 - You need to have "ufmod.o" file on same folder of your intro.

2 - Create a .bat file (eg. Compile.bat) and type this line and save:
C:\Program Files\FreeBASIC\fbc -s console ufmod.o your_intro_name.bas
Btw, I'm guessing that your freebasic is installed on this path C:\Program Files\FreeBASIC\ if not just add the correct path.

your_intro_name.bas = your main .bas file

3 - Now, execute your .bat file, it should compile your intro.



« Last Edit: December 06, 2008 by rbz »
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #54 on: December 06, 2008 »
no i didn't have that one in the code ,where should i put it in the code?

Code: [Select]
if xText<(-len(a)*Cool) then xText=632
Loop until xText<((-len(a)*Cool-16))


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Hello everyone :)
« Reply #55 on: December 06, 2008 »
Oh, Ok, it's an 8  :)

The correct is:
Code: [Select]
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #56 on: December 06, 2008 »
* bikerboy is confused ::)

i allready have that in the code

Code: [Select]
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Hello everyone :)
« Reply #57 on: December 06, 2008 »
Ok mate, that part of code is OK now

Now, just compile it using that method of my previous post
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #58 on: December 07, 2008 »
but it gives me this error

Code: [Select]
Compiler output:
C:\Program Files\FreeBASIC\FBIDETEMP.o:fake:(.text+0x4d): undefined reference to `uFMOD_PlaySong@12'

full code i'm using

Code: [Select]
Screenres 640,480,32,2

#Include Once "tinyptc.bi"
#include "windows.bi"
#include "ufmod.bi"
#include "xmas.bas"
       Dim hWave As HWAVEOUT
       hWave = uFMOD_PlaySong(@Music(0),162994,XM_MEMORY)


Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="scroller text "
a=a+"                                                "
       
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

sleep

the start from the xmas.bas

Code: [Select]
'// Created with Bin2Bas V0.22 - by Rbraz (c) 2006
dim shared Music(0 to 162993) as ubyte = { _
&H58,&H6D,&H61,&H73,&H41,&H6D,&H69,&H67,&H61,

EDIT: i have attached the files i'm using if it helps :)
« Last Edit: December 07, 2008 by bikerboy »


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Hello everyone :)
« Reply #59 on: December 07, 2008 »
Fixed, check the attached file below.

In the rar archive you will find a file called "Compile.bat" execute it to compile your intro with ufmod object file, you need this because fbide doesn't have a good way to do it.
Another problem that I found was with your xmas song, somehow it wasn't in fasttracker format, I just converted it to proper (.xm) format using "MOD2XM.EXE" that you can find on this site somewhere.

Also, I changed this line:
Code: [Select]
Loop until xText<((-len(a)*8)-16)to:
Code: [Select]
Loop until Inkey$() = Chr$(27)Which stop your intro when user press Escape key


Challenge Trophies Won: