English Amiga Board    


Go Back   English Amiga Board > » Coders > Coders. Language

Reply
 
Thread Tools
Old 24 May 2012, 12:51   #1
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
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?
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 24 May 2012, 18:44   #2
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,132
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!
bippym is offline   Reply With Quote
Old 24 May 2012, 19:20   #3
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
Quote:
Originally Posted by bippym View Post

I would say not on your nellie!
Dammit

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.
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 24 January 2013, 23:01   #4
Shoonay
Global Caturator
 
Shoonay's Avatar
 
Join Date: Aug 2004
Location: Porando
Posts: 5,844
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?
__________________
"I used to be an Amiga user, then I took an arrow in the knee."
Shoonay is online now   Reply With Quote
Old 24 January 2013, 23:28   #5
demolition
Registered User
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 32
Posts: 797
Quote:
Originally Posted by bippym View Post
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.
__________________
A1200 : 030 33MHz 128MB fast RAM (ACA1232) : Indivision AGA MkII : 4GB CF : Ethernet
A600 no 1 : 020 16.66MHz 11.3MB fast RAM (ACA620) : 2MB chip : Indivision ECS : 4GB CF
A600 no 2 : 010 : 2MB chip : 4MB fast : 2MB SRAM : 2GB CF
A500 : 2.3MB RAM : to be upgraded
demolition is offline   Reply With Quote
Old 24 January 2013, 23:31   #6
Shoonay
Global Caturator
 
Shoonay's Avatar
 
Join Date: Aug 2004
Location: Porando
Posts: 5,844
Well, I was able to play (play, not listen to ) mp3 on a 030 in lowest quality and mono.
__________________
"I used to be an Amiga user, then I took an arrow in the knee."
Shoonay is online now   Reply With Quote
Old 25 March 2013, 00:44   #7
Ze Emulatron
Registered User
 
Join Date: Nov 2010
Location: Otorohanga, New Zealand
Posts: 133
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 ?

Last edited by Ze Emulatron; 25 March 2013 at 02:02.
Ze Emulatron is offline   Reply With Quote
Old 25 March 2013, 00:47   #8
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,132
if openfile(0,"test")

it should be a 0 (zero) not an O
bippym is offline   Reply With Quote
Old 25 March 2013, 02:05   #9
Ze Emulatron
Registered User
 
Join Date: Nov 2010
Location: Otorohanga, New Zealand
Posts: 133
Quote:
Originally Posted by bippym View Post
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
Ze Emulatron is offline   Reply With Quote
Old 30 March 2013, 23:09   #10
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 33
Posts: 924
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
__________________
My stuff on Aminet is here

All Square by Digital Dalmatian is here
Lonewolf10 is offline   Reply With Quote
Old 30 March 2013, 23:13   #11
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
had to pull my blitz manual out to double check this one.

Else is actually a valid statement


Quote:
Originally Posted by Lonewolf10 View Post
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
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 30 March 2013, 23:16   #12
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
Quote:
Originally Posted by Ze Emulatron View Post
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.
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 30 March 2013, 23:17   #13
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 33
Posts: 924
Quote:
Originally Posted by diablothe2nd View Post
had to pull my blitz manual out to double check this one.

Else is actually a valid statement
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
__________________
My stuff on Aminet is here

All Square by Digital Dalmatian is here

Last edited by Lonewolf10; 30 March 2013 at 23:19. Reason: Read Diablo's last post
Lonewolf10 is offline   Reply With Quote
Old 30 March 2013, 23:19   #14
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
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)
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 30 March 2013, 23:22   #15
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 33
Posts: 924
Quote:
Originally Posted by diablothe2nd View Post
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 View Post
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
__________________
My stuff on Aminet is here

All Square by Digital Dalmatian is here
Lonewolf10 is offline   Reply With Quote
Old 30 March 2013, 23:23   #16
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
Quote:
Originally Posted by Lonewolf10 View Post
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
- gunna test it out and report back in a min
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 30 March 2013, 23:27   #17
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,132
Re: Blitz Basic Questions

Else exists and works in blitz!!
bippym is offline   Reply With Quote
Old 30 March 2013, 23:29   #18
diablothe2nd
Registered User
 
diablothe2nd's Avatar
 
Join Date: Dec 2011
Location: Northampton, UK
Age: 31
Posts: 899
Quote:
Originally Posted by bippym View Post
Else exists and works in blitz!!
thanks for saving me the trouble
__________________
View my Amiga CD1200 Project here: http://eab.abime.net/showthread.php?t=66510
http://www.eliteforever.co.uk/images/Banner6.jpg
diablothe2nd is offline   Reply With Quote
Old 31 March 2013, 01:15   #19
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 33
Posts: 924
Quote:
Originally Posted by bippym View Post
Else exists and works in blitz!!
Ok... so I was wrong
__________________
My stuff on Aminet is here

All Square by Digital Dalmatian is here
Lonewolf10 is offline   Reply With Quote
Old 31 March 2013, 05:26   #20
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,132
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
bippym is offline   Reply With Quote
Old 16 April 2013, 00:23   #21
Ze Emulatron
Registered User
 
Join Date: Nov 2010
Location: Otorohanga, New Zealand
Posts: 133
This is the kind of code I was talking about. It works fine on a write enabled disk but when the disk is write protected it seems to stop at the first line of red code (If OpenFile(0,"high.score") = -1), and doesn't execute anymore, If you change QAMIGA to AMIGA I believe that it would work and open up the popup window that says the disk is write protected, but I don't want to leave BLITZ and QAMIGA modes.

Code:
WBStartup

BLITZ
BlitzKeys On

; Setup Variables
#bitmapw = 672  ; Width of the bitmap, level width in pixels, extra column each side to setup bits to scroll to
#bitmaph = 480  ; Height of the bitmap, level height in pixels, extra row each side to setup bits to scroll to

#screenw = 224   ; With of the bitmap to display
#screenh = 160   ; Height of the bitmap to display, 160px so fit on NTSC display

#screenm = 4     ; Screen mode max of 3, 8 colours for 512+512 config, number of bitplanes

BitMap 0,#bitmapw,#bitmaph,#screenm    ; Create main game bitmap
BitMap 1,320,60,#screenm    ; Create Score panel

If DispHeight = 200
  InitCopList 0,34,#screenh,$00014,8,2^#screenm,0
  InitCopList 1,34+3+#screenh,60,$00014,8,2^#screenm,0
Else
  InitCopList 0,44+25,#screenh,$00014,8,2^#screenm,0
  InitCopList 1,44+28+#screenh,60,$00014,8,2^#screenm,0
End If

DisplayAdjust 0,0,0,0,48,-48
CreateDisplay 0,1

DisplayBitMap 0,0,-49,0
Use BitMap 0

DisplayBitMap 1,1,-1,0
Use BitMap 1

Cls 1

Use BitMap 0

Cls 2
VWait 50
QAMIGA

If OpenFile(0,"high.score") = -1
  Cls 1
Else
  Use BitMap 1
  Cls 2
End If

VWait 50
For i = 0 To 5
  VWait 10
  Cls i
Next

CloseFile 0

VWait 250
Cls 0
BLITZ

; set palette

VWait 50
Cls 1

End

I had a different thought about checking the write protect status of a disk is it possible to access the trackdisk device and check TD_PROTSTATUS in Blitz ?
Ze Emulatron is offline   Reply With Quote
Old 16 April 2013, 08:43   #22
Graham Humphrey
Moderator
 
Graham Humphrey's Avatar
 
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 26
Posts: 9,674
Hmm, I am sure I have used OpenFile successfully in the past.

Maybe try it so it returns a value in a variable. eg:

dummy=OpenFile(0,"high.score")

If dummy=-1
...

And so on. Don't know if that makes a difference. I will go through some of my old code if I get time.
Graham Humphrey is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blitz Basic 2.1 + CD ROM musashi5150 MarketPlace 3 08 July 2009 08:53
blitz basic petza request.Apps 11 08 April 2007 01:49
Blitz Basic 2 anyone? jobro request.Apps 12 28 November 2005 18:15
Blitz Basic StopCD32 Tony Landais Coders. General 2 08 May 2003 22:51
Blitz Basic 2 LaundroMat Retrogaming General Discussion 5 24 July 2001 08:10


All times are GMT +2. The time now is 09:19.

-->

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Page generated in 0.29624 seconds with 9 queries