English Amiga Board


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

 
 
Thread Tools
Old 17 March 2019, 05:01   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Documentation for Blitz Basic SaveShapes (and SaveSprites etc) format?

Is there any documentation available for the SaveShapes format? eg, something similar to the documentation available online for AMOS Sprites

If not, I'll spend a little time reverse engineering it.
earok is offline  
Old 17 March 2019, 16:31   #2
Joe Maroni
Moderator
 
Joe Maroni's Avatar
 
Join Date: Feb 2003
Location: Germany
Age: 44
Posts: 1,303
Send a message via MSN to Joe Maroni
I don't know if this might help you...it is just the structure of a shape..
Attached Thumbnails
Click image for larger version

Name:	IMG_20190317_162825.jpg
Views:	115
Size:	981.0 KB
ID:	62505  
Joe Maroni is offline  
Old 17 March 2019, 19:18   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Yeah, there's a bit of information in some versions of the manuals on internal data structures. These are available in the bb2objtypes.res resident file, the source code of which might be of help too.

the same information is also available on AmigaCoding.com.
Daedalus is offline  
Old 20 March 2019, 04:58   #4
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Ah, that makes sense. Thanks guys!

I'm assuming that the cookie pointer is always zero (since SaveShapes doesn't save cookies?) and the data pointer is a pointer to the bitplane data within the file?
earok is offline  
Old 20 March 2019, 07:00   #5
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Quote:
Originally Posted by earok View Post
Ah, that makes sense. Thanks guys!

I'm assuming that the cookie pointer is always zero (since SaveShapes doesn't save cookies?) and the data pointer is a pointer to the bitplane data within the file?
I don't know about the cookie counter but you are probably right. This is the comment for _data.l : "pointer to graphic data - Plane1, Plane2...", so I guess you assume correctly.
MickGyver is offline  
Old 20 March 2019, 07:04   #6
Joe Maroni
Moderator
 
Joe Maroni's Avatar
 
Join Date: Feb 2003
Location: Germany
Age: 44
Posts: 1,303
Send a message via MSN to Joe Maroni
I would try this:

Create a 2 bitplane shape and save it with command "SaveShape".
Create a second 2 bitplane shape and save both shapes with "SaveShapes".
Now look inside both creates files with a hexeditor and see what changed from file1 to file2.
Just compare them.
With enough knowledge i think you can then see how command "Saveshape" save the shapes in one file.
Joe Maroni is offline  
Old 21 March 2019, 03:47   #7
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
I have an ARexx script for decoding and analysing shapes files: https://github.com/idrougge/ShapesInfo
idrougge is offline  
Old 21 March 2019, 23:47   #8
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Thanks guys!

I uh, ended up writing my own format of sorts.

It's a bit rough, currently hardcoded to 5BP and I'm not totally sure the EBWIDTH and BLTSIZE calculations are totally correct, but it seems to work.

Code:
    ShapeID=0
    for i = 0 to *Project\FrameCount-1

        *f.Scorpion_Frame = *Project\FrameList[i]
        *s.shape = Addr Shape(ShapeID)

        FullWidth = (*f\Width / 16)*16
        if *f\Width mod 16
            FullWidth + 16
        endif

        *s\_ebwidth = FullWidth/8
        *s\_pixwidth = *f\Width
        *s\_pixheight = *f\Height
        *s\_depth = 5    
        *s\_bltsize = ((*f\Height) lsl 6) or ((*s\_ebwidth / 2) + 1)

        *s\_xhandle = 0
        *s\_yhandle = 0
        *s\_data = Address
        *s\_onebpmem = (FullWidth * *f\Height) / 8
        *s\_onebpmemx = *s\_onebpmem + (2 * *f\Height)
        *s\_allbpmem = *s\_onebpmem * *s\_depth
        *s\_allbpmemx = *s\_onebpmemx * *s\_depth

        Address + *s\_allbpmem
        *s\_cookie = Address
        Address + *s\_onebpmem

        HandleX(ShapeID) = -*f\HandleX
        HandleY(ShapeID) = -*f\HandleY

        ShapeID+ 1

    next
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
[blitz basic] How much amiga-blitz friendly is this? saimon69 Coders. Blitz Basic 105 21 April 2022 19:45
Amiga Format: Blitz Basic competition games earok request.Old Rare Games 64 03 January 2021 12:20
Looking for Amiga GFA Basic Documentation voxel request.Apps 2 30 August 2011 00:42
online documentation of AmigaDos/Basic? phil321 New to Emulation or Amiga scene 1 05 March 2006 12:52
Blitz Basic 2.x (AmiBlitz, now?) in ADF format? Unregistered Amiga scene 1 30 November 2001 10:46

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 00:47.

Top

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