English Amiga Board


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

 
 
Thread Tools
Old 16 December 2017, 00:37   #41
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 35
Posts: 607
AGA Hi-res overscan and Color Cycling

Is flag $100 in initcoplist everything that is needed to open hi-res screen?

I get the black screen with the code beneath. If I leave out $100 half of the picture is displayed.

And the color cycling cycles only through first 16? colors, it doesn't do the full cycle. Does CyclePalette supports AGA at all?
And has anyone fiddled with this cycling. I did before and as I remember I had to use DPaint 3 cause as I noticed CycleColor reads only CCRT chunk and won't read CRNG.

Code:
BitMap 0,720,282,8:LoadBitMap 0,"boot.iff",0
InitCopList 0,13,282,$10108,8,256,0
DisplayBitMap 0,0
BitMapOutput 0

VWait 50
BLITZ
CreateDisplay 0

Repeat
VWait
DisplayPalette 0,0
CyclePalette 0
Until Joyb(0)
End
edit:
Hm.. I can open hi-res screen with 4 bitplanes. Everything above opens black screen.

Last edited by Cobe; 16 December 2017 at 01:45.
Cobe is offline  
Old 16 December 2017, 02:30   #42
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,506
4 bitplanes in high resolution is the limit of ECS... It looks like you're not using a high enough fetch mode. Try adding a $1000 flag to the InitCoplist line and see if it helps. There's something funky about initialising bitmaps in Blitz as they need to be 32-bit or 64-bit aligned for the higher fetch modes. See if it works anyway...
Daedalus is offline  
Old 16 December 2017, 02:59   #43
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 35
Posts: 607
$1000 works! But if pic is not wider then 640.. If it is than its appropriately scrambled in all fetch modes. I guess now I have to use displayadjust... easier said than done...

But it still doesnt cycle all colors...
Cobe is offline  
Old 16 December 2017, 20:05   #44
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 313
Does anyone know how to detect the available chipram in Blitz?

Last edited by gazj82; 16 December 2017 at 20:12.
gazj82 is offline  
Old 16 December 2017, 20:30   #45
Coagulus
Gets there in the end...

Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 624
Quote:
Originally Posted by gazj82 View Post
Does anyone know how to detect the available chipram in Blitz?
In timebomb i used:

Code:
mem.l =AvailMem_(2)

If mem>524288
   <do stuff for more than 512K CHIP>
Else
   <do stuff for less than 512K CHIP>
End If
Coagulus is offline  
Old 16 December 2017, 22:05   #46
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 313
Quote:
Originally Posted by Coagulus View Post
In timebomb i used:

Code:
mem.l =AvailMem_(2)

If mem>524288
   <do stuff for more than 512K CHIP>
Else
   <do stuff for less than 512K CHIP>
End If
Works great. Thankyou
gazj82 is offline  
Old 11 January 2018, 11:18   #47
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
Since the title says: Blitz Basic Questions so I'm sure mine fits in here.

I just decided to give it a try and installed BlitzBasic2 few days ago.
Found some examples to learn faster but there are few (eg. BlitzAndPieces on Aminet) that do not run (I get: TYPE NOT FOUND error)

For example:
Code:
; jamesboyd@all-hail.freeserve.co.uk

; lists open public screens

Dim scr$(500)                     ; just to be on the safe side ;)

*scrs.List=LockPubScreenList_ ()  ; lock all screens

  *mynode.Node=*scrs\lh_Head      ; list o' screens

  count.w=0
  While *mynode\ln_Succ
    count+1
    scr$(count)=Peek$(*mynode\ln_Name) ; screen name
    *mynode=*mynode\ln_Succ
  Wend

UnlockPubScreenList_              ; unlock screens

For a=1 To count                  ; list 'em
  NPrint scr$(a)
Next a

MouseWait
End
How to make it work?
Thanks.
peceha is offline  
Old 11 January 2018, 13:57   #48
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,506
Type not found means there's a Newtype definition missing. These are essentially the same as structs in C, and are used extensively when using the OS directly, including the .List and .Node types that this example uses. The structs for most OS purposes are already defined and stored in an external "resident" file, which means you just have to add that file to your compiler settings and all those definitions will automatically be available. To do this:

- Open Compiler settings (or Compiler options, depending on your editor)
- Enter a new line in the Residents list containing Blitzlibs:amigalibs.res

Save your file, recompile and it should work. If it doesn't work, there may be some other definitions file that you're missing, but that should be documented in the readme for the source.
Daedalus is offline  
Old 11 January 2018, 14:19   #49
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
Thank you. That worked.
Is there a way to make the Resident List permanetnt?
(I'm using blitzBasic2 <release 2.1> and everytime I open the program and enter Compiler Options, the Residents List is empty)

EDIT
OK, I have it
Just need to save what is in editor as *.bb2

Thanks
peceha is offline  
Old 11 January 2018, 15:46   #50
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,506
Yep, the Residents list (and other things like Debugger settings etc.) are saved along with a project, where .bb2 is the source and .xtra is the settings. So if you're moving the source file, just remember to move the matching .xtra file too and it will keep the same settings.
Daedalus is offline  
Old 11 January 2018, 22:03   #51
E-Penguin
Banana

 
Join Date: Jul 2016
Location: Darmstadt
Posts: 678
BlitColl - I thought it could be set for odd or even colours but I can't find anything about it in the user manual. Any hints? Am I better off creating a 1-bitplane bitmap of the colour I want to check and using that?
E-Penguin is offline  
Old 11 January 2018, 23:13   #52
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,506
Yep, that might be a better way of doing it alright, if you can afford the extra blitting time. As far as I'm aware it's only sprite collisions that can be set to trigger on odd colours.
Daedalus is offline  
Old 12 January 2018, 19:39   #53
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
Hi, it is me again.
Why the code in post #47 generates a list of only 2 screens when there are 4 screens open?

The script gives me:
WB
TED

but in addition there are:
multiview
blitz debugger screen

See the picture


Thanks.
peceha is offline  
Old 12 January 2018, 22:29   #54
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
Just another question:

is there a way to stop such program:
Code:
Repeat
  WaitEvent
Forever
I know it doesn't make much sense but I just cannot stop it.

Pressing STOP in debugger window does nothing.
Choosing QUIT from menu -> same as above
Only PANIC button seems to work but then I just cannot close debugger window (and Blitz's CLI window on WB screen stays there forever) - and I get Guru after a moment
peceha is offline  
Old 13 January 2018, 15:16   #55
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,506
For your first question, the screens missing from the list probably aren't public - it wouldn't make sense to let other programs open their windows on screens that might need to be closed again soon, or where all the pens are used up, as in Multiview's case. Private screens won't show up on the public screens list.

And the second question - the program is stuck at the WaitEvent command and isn't actually running, which is why the debugger can't stop it. WaitEvent suspends the program and waits for an event from the OS, so if there's a window on your program, you can trigger an event by clicking a gadget, moving it, whatever, and then the Stop from the debugger will take effect. Without that however, it's a dead process and you can't do much about it.
Daedalus is offline  
Old 13 January 2018, 17:40   #56
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,679
It makes sense to use e=Event() instead of WaitEvent inside the loop until you've made sure your event handling actually works. Don't keep it that way, though, since it will eat up CPU cycles.
idrougge is offline  
Old 13 January 2018, 17:54   #57
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
Thank you for the explanation - I do appreciate it.
peceha is offline  
Old 13 January 2018, 18:00   #58
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
Quote:
Originally Posted by idrougge View Post
It makes sense to use e=Event() instead of WaitEvent inside the loop until you've made sure your event handling actually works. Don't keep it that way, though, since it will eat up CPU cycles.
I'm not going to use it that way - I only wanted to ask the question "how to stop it from within debugger" - and Daedalus explained it in very simple way.

Thanks
peceha is offline  
Old 13 January 2018, 18:10   #59
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 42
Posts: 132
and.. me again.

Just checking some examples and again there is something I don't understand.
I found something like this:
Code:
...
 *IntuiBase = OpenLibrary_( ?INTUITION,36)
....
....
....
Even
INTUITION
Dc.b "intuition.library",0,0
....
I replaced ?INTUITION with "intuition.library" and the program ran as expected.

Could you explain to me what all that "magic" in original version means?

Thanks.
peceha is offline  
Old 14 January 2018, 04:11   #60
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,679
The "magic" is an assembler directive that stores the string "intuition.library" followed by a terminating zero. The location is given the label "INTUITION".

In Blitz, the question mark operator gives the address of a label.

Since it worked for you with a plain string literal instead, the only technical reason I can think of doing it this way is that earlier Blitz versions didn't terminate strings with a zero, which is expected by the OS calls.

(Oh, and Even means that the label starts at an even address (on a 16-bit boundary). This is needed for a lot of 68000 instructions.)
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
Blitz basic 2 Help Havie Coders. Blitz Basic 30 08 September 2013 10:15
blitz basic petza request.Apps 11 08 April 2007 02:49
Blitz Basic 2 anyone? jobro request.Apps 12 28 November 2005 19:15
Blitz Basic StopCD32 Tony Landais Coders. General 2 08 May 2003 23:51
Blitz Basic 2 LaundroMat Retrogaming General Discussion 5 24 July 2001 09:10

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 09:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.09478 seconds with 16 queries