17 March 2019, 05:01 | #1 |
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. |
17 March 2019, 16:31 | #2 |
Moderator
|
I don't know if this might help you...it is just the structure of a shape..
|
17 March 2019, 19:18 | #3 |
Registered User
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. |
20 March 2019, 04:58 | #4 |
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? |
20 March 2019, 07:00 | #5 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
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.
|
20 March 2019, 07:04 | #6 |
Moderator
|
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. |
21 March 2019, 03:47 | #7 |
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
|
21 March 2019, 23:47 | #8 |
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 |
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 |
|
|