English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   Blitz Basic Questions (https://eab.abime.net/showthread.php?t=64426)

diablothe2nd 24 May 2012 12:51

Blitz Basic Questions
 
Decided to keep the thread title non specific incase other's want to chime in and ask some too.

Is Blitz 2 able (with modules) to play an mp3 AND sound effects at the same time?

I'm guessing that the Mp3 if it was stereo would need two channels, leaving only two left for sound effects. Is that correct?

I realise the process of playing an mp3 is resource hungry though so I guess it's not feasible to do so in a game?

BippyM 24 May 2012 18:44

On an 040 1200 back in the day I was able to play MP2 but it struggled. MP3 was a no-no back then!

I would say not on your nellie!

diablothe2nd 24 May 2012 19:20

Quote:

Originally Posted by bippym (Post 819923)

I would say not on your nellie!

Dammit :guru

well it was a fleeting thought anyway. on my 060 i can play mp3's fine aslong as i dont run anything else. i thought about reducing the bitrate but methinks that wont be enough for the folks using ACA's.

Shoonay 24 January 2013 23:01

Just out of curiosity, how about an uncompressed file then?
Let's say a full song in WAV or IFF format.
Assuming there's enough space on the disk, can it buffer the whole song to the memory or just play from the disk buffering on the fly without huge performance issues?

demolition 24 January 2013 23:28

Quote:

Originally Posted by bippym (Post 819923)
On an 040 1200 back in the day I was able to play MP2 but it struggled. MP3 was a no-no back then!

I would say not on your nellie!

I know someone who 'back in the day' used to play mp3s on his A1200 with an 040 Blizzard accelerator. I think though that it was very low bitrate, like 96 kbps and probably only mono output.

Shoonay 24 January 2013 23:31

Well, I was able to play (play, not listen to ;)) mp3 on a 030 in lowest quality and mono.

Ze Emulatron 25 March 2013 00:44

Question

In Blitz Basic you can open a file for writing with

If OpenFile(0,"test")

This works fine when the disk is write enabled, when the disk is write protected in AMIGA mode it pops up a system request saying the disk is write protected retry cancel, but in BLITZ mode it freezes at that point in the program. I tried to use CatchDosErrs, but didn't know how to implement it when I have 2 bitmaps and 2 coplists on the screen, the example code in the Blitz 2 reference guide uses Screens.

I tried to use an if else,
If OpenFile(0,"test") = 0

else

end if

or

If OpenFile(0,"test") = -1

else

end if

but it still froze at the same part of the program.


Does someone know some code I can use in Blitz to check if the disk is write protected ?

BippyM 25 March 2013 00:47

if openfile(0,"test")

it should be a 0 (zero) not an O

Ze Emulatron 25 March 2013 02:05

Quote:

Originally Posted by bippym (Post 877300)
if openfile(0,"test")

it should be a 0 (zero) not an O

I fixed that in my post, It is a 0 in my code but I copied the command from the pdf and the OCR must have thought it was a O

Lonewolf10 30 March 2013 23:09

I'm no expert in Blitz (I'm an AMOS guy at heart :)), but I don't believe Blitz supports the Else instruction.
You may have to do something slightly uglier like...

Code:

TEST=OpenFile(0,"test")

If TEST = 0
... some code
end if

If TEST = -1
...some other code
end if


diablothe2nd 30 March 2013 23:13

had to pull my blitz manual out to double check this one.

Else is actually a valid statement:great


Quote:

Originally Posted by Lonewolf10 (Post 878543)
I'm no expert in Blitz (I'm an AMOS guy at heart :)), but I don't believe Blitz supports the Else instruction.
You may have to do something slightly uglier like...

Code:

TEST=OpenFile(0,"test")

If TEST = 0
... some code
end if

If TEST = -1
...some other code
end if



diablothe2nd 30 March 2013 23:16

Quote:

Originally Posted by Ze Emulatron (Post 877299)
Question

.....but in BLITZ mode it freezes at that point in the program.

to do any form of disk i/o i think you need to come out of blitz mode using QAMIGA, as the Blitz mode itself removes all os hooks etc for extra speed.

Lonewolf10 30 March 2013 23:17

Quote:

Originally Posted by diablothe2nd (Post 878544)
had to pull my blitz manual out to double check this one.

Else is actually a valid statement:great

Erm... just cause it says so in the manual, doesn't mean it does. Have you actually tried it?

If it really does work, then why does Ze Emulatron's code crash Blitz??

Edit:

Diablo's most recent post just answered my 2nd question :)

diablothe2nd 30 March 2013 23:19

why would they list it in the manual if it didn't exist? lol

see above for my thoughts on why it's crashing (sorry for double post)

Lonewolf10 30 March 2013 23:22

Quote:

Originally Posted by diablothe2nd (Post 878547)
why would they list it in the manual if it didn't exist? lol

Because they intended to put it in, but the coders behind it forgot to implement it or were forced to leave it out because of time constraints posed on them by their bosses.


Quote:

Originally Posted by diablothe2nd (Post 878547)
see above for my thoughts on why it's crashing (sorry for double post)

Yeah, just read that... see the edit on my previous post :lol

diablothe2nd 30 March 2013 23:23

Quote:

Originally Posted by Lonewolf10 (Post 878548)
Because they intended to put it in, but the coders behind it forgot to implement it or were forced to leave it out because of time constraints posed on them by their bosses.




Yeah, just read that... see the edit on my previous post :lol

:lol - gunna test it out and report back in a min

BippyM 30 March 2013 23:27

Re: Blitz Basic Questions
 
Else exists and works in blitz!!

diablothe2nd 30 March 2013 23:29

Quote:

Originally Posted by bippym (Post 878550)
Else exists and works in blitz!!

thanks for saving me the trouble :D :great

Lonewolf10 31 March 2013 01:15

Quote:

Originally Posted by bippym (Post 878550)
Else exists and works in blitz!!

Ok... so I was wrong :sad

BippyM 31 March 2013 05:26

The following is code taken from my SWOS Editor released in 1996, this shows the "ELSE" command working.

Code:

.load:
  RTEZSetPattern 0,"#?.CAR"

  fi$=""
  f$=RTEZLoadFile("Select Your Save Game file",fi$)
  If f$
    flength.l=Exists(f$)
    InitBank 1,flength,1
    aa.l=RTLockWindow (0)
    LoadBank 1,f$
    lo.l=BankLoc(1)
    RTUnlockWindow 0,aa.l
    ld=1

    JSR _enable
  Else
    body$="You MUST select a SWOS Game":ok$="_Retry|_Cancel":JSR _req
    Select ab
      Case 0 : If ld=0 : End:EndIf
              If ld=1 : Goto loop:EndIf
      Case 1 : JSR load
  End Select
  EndIf
  JSR checkver
JSR _peek
RTS



All times are GMT +2. The time now is 16:44.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.07001 seconds with 11 queries