English Amiga Board Amiga Lore


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

 
 
Thread Tools
Old 11 May 2017, 08:59   #1
Graham Humphrey
Moderator
Graham Humphrey's Avatar
 
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 30
Posts: 10,905
Displaying multiple CopLists at once

Just at the beginning of a little project and I'm trying to get three CopLists on the screen at once, one is the main game area (coplist 0) and the other two are status panels which will contains score and lives info for the two players.

So I have:

Code:
InitCopList 0,60,224,$00005,8,32,0    ; main game display
InitCopList 1,44,12,$00005,8,32,0     ; p1 panel
InitCopList 2,288,12,$00005,8,32,0    ; p2 panel

Bitmap 0,320,224,5:Bitmap 1,320,224,5 ; main game display
Bitmap 2,320,16,5:Bitmap 3,320,16,5    ; panel displays

[Placeholder tile gfx blit onto bitmaps 0 and 1]
[Print "p1 test" and "p2 test" text onto bitmaps 2 and 3]

CreateDisplay 1,0,2

Repeat
 Vwait
 DisplayBitmap 0,db
 DisplayBitmap 1,2:DisplayBitmap 2,3
 db=1-db
 UnBuffer db
 Use Bitmap db
Until RawStatus($45):End
The main game area displays as expected, but for some reason I only seem to get the bottom CopList and not the top one. I NPrint text to both the bitmaps for CopLists 1 and 2, but they both appear on the bottom coplist and the top one is blank (and the second line of text is cut off as the CopList isn't high enough to display both properly).

Any ideas? On other projects, I can have two CopLists displaying fine, but any more than two and I run into problems
Graham Humphrey is offline  
AdSense AdSense  
Old 11 May 2017, 10:30   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,048
Hmmm... It sounds to me like you're actually printing the text to the same bitmap since the text is appearing below the other text - are you doing a BitmapOutput command before the first NPrint? Output will default to the last bitmap created unless you tell it otherwise.

If you pop out of Blitz mode (or initialise your bitmaps in Amiga mode), you can save the bitmaps to RAM: in order to see if they really contain what you expect:

Code:
SaveBitmap 0, "RAM:bitmap0.iff"
SaveBitmap 1, "RAM:bitmap1.iff"
Delay_ 50 ; Just to let file access finish before shutting down multitasking.
I can't remember using 3 coplists myself, but the code *looks* fine to me.
Daedalus is offline  
Old 11 May 2017, 11:51   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 2,976
Not that it has anything to do with your NPrint problem (which Daedalus points out above), but I think you need a few blank lines between your coplists.
idrougge is offline  
Old 12 May 2017, 08:56   #4
Graham Humphrey
Moderator
Graham Humphrey's Avatar
 
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 30
Posts: 10,905
Thanks chaps for the help.

Well, what do you know - it was the BitmapOutput command. What I was doing was using BitmapOutput on both bitmaps 2 and 3, and then using Use Bitmap before using NPrint, but that had no effect - the last bitmap referenced for BitmapOutput was 3, so all text was printed to that.

The reason I came to the conclusion I initially did (which was mad, I know) is that I've experimented with multiple CopLists in the past and always had problems getting them to display properly (not text-wise, just in general), so I automatically thought I was missing something. As idrougge points out, on those occasions it might well have been too few blank lines between CopLists but I took care on this occasion to ensure there was a gap of four lines between each one.

Anyway, up and running now, so a big thanks to you both for putting me on the right track
Graham Humphrey is offline  
Old 12 May 2017, 11:12   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 2,976
Quote:
Originally Posted by Graham Humphrey View Post
As idrougge points out, on those occasions it might well have been too few blank lines between CopLists but I took care on this occasion to ensure there was a gap of four lines between each one.
It's been to long since I made a coplist-based Display, I didn't notice that you specified the panels to be only 12 pixels high.
idrougge is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen not displaying on 2.6.1 Akira support.WinUAE 4 25 August 2013 17:50
CDTV without picture displaying ?? haynor666 support.Hardware 34 18 February 2013 05:26
Displaying images Tiddlypeeps Coders. Tutorials 40 30 August 2012 10:11
Displaying sprites Hewitson Coders. General 18 27 April 2011 16:35
A1200 not displaying correct colours Magno Boots support.Hardware 6 09 September 2008 13:40

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 19:52.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.12298 seconds with 12 queries