English Amiga Board


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

 
 
Thread Tools
Old 23 September 2018, 00:29   #1
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 912
Problems with displaying a screen!

Help - problem driving me mad!

I am simply trying to display a background (320x200 16 colours) on a double buffered screen. When I run the program - it works first time but when it ends I get an error (#80000020) or if I leave it a while it just crashes. If I reload and rerun the program it just crashes and seems to be trying to display the bitmap in different parts of the memory (if that makes sense). If after running once, I reload the bitmap into Deluxe Paint and re-save it then the program runs and crashes again. Whatever is happening initially seems to be corrupting my iff file.

I'm probably doing something stupid - help. Here is the code:

Code:
WBStartup

LoadShape 50,"Background/level1"
LoadPalette 0,"Graphics/palette.pal"

BLITZ

;set up bitmap...
;
BitMap 0,320+16,200,4
BitMap 1,320+16,200,4

InitCopList 0,44,200,$14,8,32,0
DisplayPalette 0,0
CreateDisplay 0

DisplayBitMap 0,0

db=0

Use BitMap 0: Blit 50,0,0
Use BitMap 1: Blit 50,0,0

;while mouse button not hit

While RawStatus(69)=0

	VWait
	Displaybitmap 0, db

	db=1-db

Wend
Havie is offline  
Old 23 September 2018, 01:48   #2
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 38
Posts: 809
Well if you already enabled smooth scrolling I think you'd be better of using extended Displaybitmap 0,db,0,0.
Though I find Blitz unexplainable from time to time so if its something else I'd like to know.
Cobe is offline  
Old 23 September 2018, 02:09   #3
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 912
Thanks - but gives the same error.
Havie is offline  
Old 23 September 2018, 02:21   #4
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 38
Posts: 809
then I'd go with unexplainabel.. Did you try loadshape 0 instead 50? And is your picture 16 or 32 colors? You're setting 4 bitplanes then setting 32 colors..
Cobe is offline  
Old 23 September 2018, 02:26   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,976
Is "level1" a shape or an IFF ILBM picture?
idrougge is online now  
Old 23 September 2018, 13:16   #6
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,003
There can be issues with memory corruption when shapes are too large. Try loading a smaller shape for Level1 and see if that helps. If so, you can perhaps load it in chunks, or else use LoadBitmap to load the background instead.
Daedalus is offline  
Old 23 September 2018, 19:51   #7
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 912
Quote:
Originally Posted by Daedalus View Post
There can be issues with memory corruption when shapes are too large. Try loading a smaller shape for Level1 and see if that helps. If so, you can perhaps load it in chunks, or else use LoadBitmap to load the background instead.
After 3 days of trying I was coming to the same conclusion. Will try loading bitmap instead!
Havie is offline  
Old 23 September 2018, 22:59   #8
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 912
As usual your are right D - was definitely something to do with memory issues. Loading the bitmap directly does the job.

Thanks again!
Havie is offline  
Old 23 September 2018, 23:02   #9
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 912
Quote:
Originally Posted by Cobe View Post
then I'd go with unexplainabel.. Did you try loadshape 0 instead 50? And is your picture 16 or 32 colors? You're setting 4 bitplanes then setting 32 colors..
Colours are 16 - correct but as I am using sprites I need a 32 colour palette in the copper list hence the 16 colour screen and 32 colours in the Initcop command. I'm finally getting a handle on this sprite thing! Everyone should use them as you can have 16 colours independent of your main game colours which doubles your colours for no effort...
Havie is offline  
Old 24 September 2018, 09:34   #10
carrion
Registered User

carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 99
Do you have End command at the end of source code?
You always have to end your code with statement:

End
carrion is offline  
Old 25 September 2018, 21:22   #11
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 912
Quote:
Originally Posted by carrion View Post
Do you have End command at the end of source code?
You always have to end your code with statement:

End
Yes - there was an End. The issue was trying to use too big a shape. Loading straight to the screen sorted it.
Havie 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
A500 Displaying only a Turquoise Screen Skyfox support.Hardware 11 13 August 2018 18:19
Screen not displaying on 2.6.1 Akira support.WinUAE 4 25 August 2013 18:50
New WinUAE's and screen displaying problem Sloppy Elf support.WinUAE 3 26 January 2007 15:18
1084S screen problems T_hairy_bootson support.Hardware 4 21 October 2003 21:27
Screen refresh problems tomcat666 support.WinFellow 3 26 December 2001 18:42

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 17:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.11479 seconds with 13 queries