Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!seismo!dimacs.rutgers.edu!rutgers!cbmvax!carolyn From: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: Format of superhires ILBMs? Keywords: Superhires ILBM IFF Message-ID: <22420@cbmvax.commodore.com> Date: 13 Jun 91 21:58:32 GMT References: <16955@darkstar.ucsc.edu> <22355@cbmvax.commodore.com> Reply-To: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Organization: Commodore, West Chester, PA Lines: 129 In article <22355@cbmvax.commodore.com> spence@cbmvax.commodore.com (Spencer Shanson) writes: >In article <16955@darkstar.ucsc.edu> davids@ucscf.UCSC.EDU (Dave Schreiber) writes: >> >> >>What is accepted way of specifying that an IFF ILBM file is a superhires >>(1280x200 or 1280x400) picture? Thanks. >You should be using the 2.0 LONGWORD ModeIds, and putting them in your CAMG >IFF hunk. > >You can find a ViewPort's modeid using the GetVPModeID() function. > >The LONG ModeIDs were designed so that if any IFF reader only uses the Low >word of the CAMG instead of the whole LONG, then you would get a ViewPort as >close to the intended mode as possible. For example, if you werre to save the >VGAPRODUCT_KEY as a LONG in the CAMG, and an IFF reader only read the low >Word, it would open a HIRES-LACE on a non-ECS machine, and a SUPERHIRES-LACE >on an ECS machine, using the default monitor type (NTSC or PAL). >--------------------------------------------------------------------------- >Spencer Shanson - Amiga Software Engineer | email: spence@commodore.COM In addition, you should be storing correct aspect information in the BMHD. The old EA code had a bug (recently discovered) which caused it to always store 10/11 as the aspect. (check the part of the code that sets the BMHD aspect - you'll see that it uses "=" rather than "==" when checking dimensions to decide what aspect to store. When running under 2.0, you should get the correct aspect information from the display database and store it in the BMHD. The display database aspect info not only covers new modes, but is also more correct for old modes. ;/* getaspect.c - Execute me to compile me with SAS C 5.10 LC -b1 -cfistq -v -y -j73 getaspect.c Blink FROM LIB:c.o,getaspect.o TO getaspect LIBRARY LIB:LC.lib,LIB:Amiga.lib quit */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef LATTICE int CXBRK(void) { return(0); } /* Disable Lattice CTRL/C handling */ int chkabort(void) { return(0); } /* really */ #endif #define MINARGS 1 UBYTE *vers = "\0$VER: getaspect 37.1"; UBYTE *Copyright = "getaspect v37.1\nCopyright (c) 1990 Commodore-Amiga, Inc. All Rights Reserved"; UBYTE *usage = "Usage: getaspect"; void bye(UBYTE *s, int e); void cleanup(void); struct Library *IntuitionBase; struct Library *GfxBase; void main(int argc, char **argv) { struct Screen *first; struct ViewPort *vp; struct DisplayInfo DI; ULONG modeid; if(((argc)&&(argcFirstScreen; vp = &first->ViewPort; modeid = GetVPModeID(vp); if(GetDisplayInfoData(NULL, (UBYTE *)&DI, sizeof(struct DisplayInfo), DTAG_DISP, modeid)) { printf("ModeID $%08lx\n",modeid); printf("PaletteRange is %ld\n",DI.PaletteRange); /* store these as BMHD xAspect and yAspect respectively */ printf("Resolution is %ld by %ld\n", DI.Resolution.x,DI.Resolution.y); } bye("",RETURN_OK); } void bye(UBYTE *s, int e) { cleanup(); exit(e); } void cleanup() { if(GfxBase) CloseLibrary(GfxBase); if(IntuitionBase) CloseLibrary(IntuitionBase); } -- ========================================================================== Carolyn Scheppner -- Tech. Mgr. CATS - Commodore Amiga Technical Support PHONE 215-431-9180 {uunet,rutgers}!cbmvax!carolyn carolyn@commodore.com Oh I'm a numberjack and I'm OK, I code all night and I work all day... ==========================================================================