English Amiga Board


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

 
 
Thread Tools
Old 22 May 2017, 11:37   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Structure of CopList object?

I can't seem to find a list of the contents of the "CopList" structure anywhere, even on http://www.amigacoding.com/index.php/Blitz:Object_types

I've reverse engineered enough of it to keep going, but having a fully labelled version of it would be useful for future, cheers.
earok is offline  
Old 22 May 2017, 12:48   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Hmmm, that is strange - it's not in the source of bb2objtypes.res either, which is where it should be... So I don't know where it's declared. Perhaps you could add what you've determined to the Blitz Object Types page to help others - partial information is better than none at all! Or send it to me and I can add it for you.

I don't know if you've already looked at it, but the AB3 object browser lets you at least see the names and types of the fields in a structure - it might be worth a look.
Daedalus is offline  
Old 22 May 2017, 12:57   #3
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Daedalus View Post
Hmmm, that is strange - it's not in the source of bb2objtypes.res either, which is where it should be... So I don't know where it's declared. Perhaps you could add what you've determined to the Blitz Object Types page to help others - partial information is better than none at all! Or send it to me and I can add it for you.

I don't know if you've already looked at it, but the AB3 object browser lets you at least see the names and types of the fields in a structure - it might be worth a look.
Ah cheers.. I haven't looked at AB3 at all.

In any case.. here's what I came up with. I'm 99% sure there's more fields than just this, this was as far as I dug into it (I only wanted to poke the custom copper commands).

Quote:
NEWTYPE .CopList
unknown.l ;*shrug*
copperlistaddress.l ;Address to the root of the copper list
copperlistaddress_palette.l ;Address to the start of the palette section
copperlistaddress_sprite.l ;Address to the start of the sprite section
copperlistaddress_bplcon.l ;Address to the BPL registers section
copperlistaddress_bitplanes.l ;Address to the Bitplanes settings here
copperlistaddress_topofscreen.l ;Address to the top of screen delay
copperlistaddress_custom.l ;Address to the custom copper commands
End NEWTYPE
earok is offline  
Old 22 May 2017, 13:02   #4
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Cool, I'll add them anyway and have a look myself. I haven't ever looked at the structure itself so never noticed it was missing (or at least hidden away elsewhere). I'll have a dig through it when I'm in front of my machine at home later on and see what I can find.
Daedalus is offline  
Old 22 May 2017, 18:33   #5
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
It's in bb2objtypes.res, also in the sourcecode of this precompiled include:
Code:
NEWTYPE .coplist
  size.l            ;0 = not initialised
  coppos.l          ;location in chipmem
  colors.l
  sprites.l
  bpcons.l
  bplanes.l
  dot.l
  customs.l
  dob.l
  numbp.w:colpokes.w                  ;limits
  fetchwid.w:xand:xshift              ;for show calculations (3 words)
  ypos.w:height:res
  numsprites.w:numcols:numcustoms
  aga.w                               ;24bit=$8000 fetch = $00,$10,$20,$30
  resshift.w                          ;lo,hi,shi = 2 1 0
  setup.w                             ;lines taken for setup
  cblow.w                             ;if custom goes below 256
  sfetch.w:spres:spif:spwid:sspwid    ;sprite mode for display
End NEWTYPE
Cylon is offline  
Old 23 May 2017, 00:55   #6
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Ah, interesting... It doesn't appear to be in either the AB3 version of bb2objtypes.res or the BB2 version I have here. I've added it anyway to the AmigaCoding list.

Be careful here though, and remember that lower-case Newtypes are generally Blitz internal objects, whereas CamelCase Newtypes are generally OS structs as defined in amigalibs.res (and prepended with an underscore in all.res). I was a little confused about that earlier, and it's the OS struct that earok appears to be using in his code.

The attachment is the AB3 definition of the .CopList Newtype (the OS-defined one), which is the one you appear to be using earok. It matches the struct defined in the Amiga SDK (includes/graphics/copper.h), but just like for other objects, is different to the Blitz internal .coplist Newtype.
Attached Thumbnails
Click image for larger version

Name:	Grab_Definition Browser_22-May-17_000.png
Views:	208
Size:	28.4 KB
ID:	53194  
Daedalus is offline  
Old 23 May 2017, 03:33   #7
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
ah, thanks guys. Much appreciated
earok is offline  
Old 23 May 2017, 23:13   #8
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
It's also not in my bb2objtypes, which I used for adding the other objects to the Amigacoding wiki.
idrougge is offline  
Old 29 August 2018, 00:02   #9
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Is there a place where the complete bb2objtypes.res (with coplist) can be downloaded?
earok is offline  
Old 29 August 2018, 22:19   #10
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Not that I know of. You could download the latest source for it from the AmiBlitz SourceForge site, add the extra definitions needed and compile your own...

Maybe Cylon knows where he got his version?
Daedalus is offline  
Old 22 June 2019, 05:37   #11
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
There seems to be an odd issue with the coplist structure as defined here, there appears to be a missing word (or perhaps there's word that should have been defined as a long)

size.l ;0 = not initialised
coppos.l ;location in chipmem
colors.l
sprites.l
bpcons.l
bplanes.l
dot.l
customs.l
dob.l
numbp.w:colpokes.w ;limits
fetchwid.w:xand:xshift ;for show calculations (3 words)
padding.w ;<- I've added this to correct offsets of ypos etc
ypos.w:height:res
numsprites.w:numcols:numcustoms
aga.w ;24bit=$8000 fetch = $00,$10,$20,$30
resshift.w ;lo,hi,shi = 2 1 0
setup.w ;lines taken for setup
cblow.w ;if custom goes below 256
sfetch.w:spres:spif:spwid:sspwid ;sprite mode for display


If I don't add that "padding.w" field (and I'm not totally sure where it should go), the YPOS is in Height, Height is in Res, Res in NumSprites etc.
earok 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
Resource and Structure.offs copse Coders. General 4 23 December 2013 23:56
Question for someone that understands disk structure Djay support.Other 5 20 February 2011 16:04
Bitmap Font File Structure ant512 Coders. General 7 20 October 2007 08:33

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:46.

Top

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