English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 16 September 2012, 13:19   #1
Coagulus
Gets there in the end...

Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 662
Show free chip ram in Blitz2?

Hi all,

Hope this is the right place.

Is there a way in Blitz 2 to report the available chip ram? I would like it conditional that I load the music if there's enough memory.

Cheers.
Coagulus is offline  
Old 16 September 2012, 13:46   #2
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,238
Since Blitz supports inline ASM you could simply use Exec's AvailMem() function.
StingRay is offline  
Old 16 September 2012, 14:38   #3
Coagulus
Gets there in the end...

Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 662
Cheers stingray, I tried

_availmem
putreg d0,a
print a

it shows a figure but I can't seem to pass any attributes to availmem to report Chip ram.

[edit] ah, the underscore goes at the end! a=availmem_(requirements)

[edit2] a.l=AvailMem_(2) seems to do the trick in Blitz...

[edit3] found on aminet that a.l=AvailMem_($20002) is the same as a.l=ChipFree

Last edited by Coagulus; 16 September 2012 at 20:25. Reason: got it wrong! and more info
Coagulus is offline  
Old 21 September 2012, 14:56   #4
fishyfish
Banned
 
Join Date: Jul 2010
Location: Australia
Posts: 475
Ah, cool, that cleared up something for me too.
I'd just recently found a variation on this:

#any=0
#chip=2
#fast=4
#biggest=$20000
#total=$80000

nprint "ChipRAM: ",AvailMem_(#chip|#total)

I partway knew what was going on, but this filled in the blanks for me
fishyfish is offline  
Old 18 September 2019, 20:16   #5
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 44
Posts: 145
Just wanted to write my own avail function - this works fine.
Note that for just available ram (not total, and not largest(=biggest) you just don't add any constant.
So available chipram is just #$2

PS:
I looked into EXEC_MEMORY_H and searched for the constant to add for simple "available memory". There is none and that's the point.
Nightshft is offline  
Old 19 September 2019, 00:28   #6
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,880
You can also just call ChipFree (or FastFree).
idrougge is offline  
Old 22 September 2019, 17:32   #7
Nightshft
Registered User

Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Age: 44
Posts: 145
Yes thanks!

Found this 2 functions AFTER learning how to use the system calls (which is quite interesting). I didn't find these in the BB2 manual. Is there any documentation to additional commands out there?
Nightshft is offline  
Old 23 September 2019, 03:53   #8
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,880
The BUMs added commands continuosly and came with corresponding documentation in Amigaguide and paper format. All BUMs are included on the Ultimate Blitz CD.

Do also note that there are two different Blitz manuals. The later edition is in a ring-bind folder where you could add the BUM addenda.
idrougge is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 mb chip ram for A600 Krisu Hardware mods 143 25 September 2015 17:33
How 2MB chip ram with the Mini Megi Chip? Antti support.Hardware 6 04 June 2014 20:54
Chip ram sticks ? droopy support.Hardware 5 28 July 2013 22:08
Chip Ram Bug ZooL support.WinUAE 4 09 April 2013 08:14
[SAS/C] Making malloc() allocate in fast RAM instead of chip RAM? 8bitbubsy Coders. General 3 07 August 2011 07:06

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


All times are GMT +2. The time now is 02:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06748 seconds with 14 queries