English Amiga Board


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

 
 
Thread Tools
Old 14 October 2018, 13:29   #141
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,647
Shapes don't carry any palette information in themselves, so you would have to make them with your Workbench palette in mind or remap them at run-time.
idrougge is offline  
Old 14 October 2018, 21:53   #142
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,309
Heh, very good point. I skipped right over that step assuming that was already known.
Daedalus is offline  
Old 16 October 2018, 12:01   #143
amyren
Registered User

 
Join Date: Sep 2018
Location: Elsfjord / Norway
Posts: 9
Quote:
Originally Posted by idrougge View Post
Shapes don't carry any palette information in themselves, so you would have to make them with your Workbench palette in mind or remap them at run-time.
Ok, thanks
amyren is offline  
Old 19 October 2018, 12:27   #144
amyren
Registered User

 
Join Date: Sep 2018
Location: Elsfjord / Norway
Posts: 9
Quote:
Originally Posted by Daedalus View Post
That's very weird... XInclude is the same as Include except it only includes the requested file once, whereas Include will include it twice if it's used twice. It's bizarre that you're seeing that difference - if anything, Include should produce *larger* executables (and compile errors due to duplicated procedure labels). Are you sure you didn't change anything else in between, like turning off the debugger?
My first observation that my executables got smaller after using INCLUDE instead of XINCLUDE was actually correct. I managed to recreate that today.

But I found that it has nothing to do with the X or not. It is simply that if I compile the same source many times, the executable will get smaller each time.
If I launch AmiBlitz and compile the image load source it will create executable size like this, starting at the first compile:

294.480
228.856
200.740
189.916
181.972
180.712
180.284
175.084
170.704

I have to compile it 9 times in a row to get the smallest executable.
And I tested both using INCLUDE and XINCLUDE, and they both will create the exact same executable size after 9 compiles.
Quitting and restarting AmiBlitz, and the executable size will be big again.


But now I wanted to try to use that image load code in my own program.
I use no Includes in my program earlier, but now just by putting this at the top of my program it will generate compiler errors.
OPTIMIZE 5
XINCLUDE "image.include.ab3"

"compile error in line" 2 (that is the line with the include)
if I use the image.include.ab3 it will open the zlib.include.ab3 when the error is displayed with the message "marco/object not found, possibly wrong code starts here: autoexit{DeinitAB3ZLib}".
If I use my modifed image.include_mod.ab3, it will open the asl.include.ab3 and display "constant not found, possibly wrong code starts here: CYBRBIDTG_NominalWidth,scr_width,#CY ..".
amyren is offline  
Old 19 October 2018, 12:46   #145
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,309
That's interesting. I know that there's the "make smallest" option in Blitz's Compiler settings window that does some optimisation and takes a bit longer, but I didn't know it would also build on the previous compile. Does changing the code in between these progressive compiles make it bigger again, resetting the process?

I must also check to see if AB3 does the same thing with the Create Minimised Executable operation...

The Autoexit macros are pretty commonly used in most of the AB3 includes. It's included in the all.res resident file, so if you haven't added that to the Compiler settings, that would explain the error, and probably also the constant not found error.
Daedalus is offline  
Old 19 October 2018, 15:19   #146
amyren
Registered User

 
Join Date: Sep 2018
Location: Elsfjord / Norway
Posts: 9
Thank you again, I only had amigalibs.res as resident, with all.res it compiles ok.

Another question, how do I re-initialize a window without closing an opening i again?

I do put an image to my program main window and I can replace the image by blitting another image. But after opening another window within my program and closing it, it will exit with an error "Unititialized window" it I try to blit another image.

Oh, and changing the code does not reset the process, not by changing small bits of it anyway.

Edit: I do have the make smaller code enabled in compiler settings. Have not tested without it.

Last edited by amyren; 19 October 2018 at 17:13. Reason: Merged back to back posts
amyren is offline  
Old 19 October 2018, 17:44   #147
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,309
Quote:
Originally Posted by amyren View Post
Thank you again, I only had amigalibs.res as resident, with all.res it compiles ok.
Yeah, all.res contains amigalibs.res, a number of common macros and some other includes.

Quote:
I do put an image to my program main window and I can replace the image by blitting another image. But after opening another window within my program and closing it, it will exit with an error "Unititialized window" it I try to blit another image.
You don't need to reinitialise it as such. What happens is that Blitz has a currently used window. When you open a new window, it automatically becomes the currently used window, but when you close the window it doesn't go back to the previous one. Instead it simply has no currently used window, and so you get an error message (and a crash if you didn't have the debugger, since it would try to blit to the old window's address).

To fix this, you need to tell Blitz which window you want to use. This is simply:

Code:
Use Window 0
and can be used at any point, even if other windows are still open. This lets you blit to and draw on any window that your program has opened.

Quote:
Edit: I do have the make smaller code enabled in compiler settings. Have not tested without it.
Very interesting...

Last edited by Daedalus; 20 October 2018 at 19:05. Reason: Fix quote tags
Daedalus is offline  
Old 20 October 2018, 18:35   #148
amyren
Registered User

 
Join Date: Sep 2018
Location: Elsfjord / Norway
Posts: 9
Quote:
Originally Posted by Daedalus View Post
To fix this, you need to tell Blitz which window you want to use. This is simply:

Code:
Use Window 0
Thank you
I was trying windowoutput 0 to no use
amyren is offline  
Old 20 October 2018, 19:05   #149
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,309
No problem. WindowOutput will do the same thing but for text, so it's good to know both commands
Daedalus 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] How much amiga-blitz friendly is this? saimon69 Coders. Blitz Basic 104 29 November 2016 20:45
Blitz Basic (1) Retro1234 Coders. Blitz Basic 9 18 February 2016 17:54
Blitz basic 2 Help Havie Coders. Blitz Basic 30 08 September 2013 09:15
Blitz Basic 2 anyone? jobro request.Apps 12 28 November 2005 18:15
Blitz Basic 2 LaundroMat Retrogaming General Discussion 5 24 July 2001 08: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 01:03.


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