Path: utzoo!utgpu!attcan!uunet!mcvax!ukc!dcl-cs!bath63!pes From: pes@ux63.bath.ac.uk (Smee) Newsgroups: comp.sys.atari.st Subject: Re: Questions about ST Video Ram Message-ID: <2884@bath63.ux63.bath.ac.uk> Date: 4 Aug 88 09:26:12 GMT References: <535@skywest.UUCP> Reply-To: pes@ux63.bath.ac.uk (Smee) Organization: AUCC c/o University of Bath Lines: 13 In article <535@skywest.UUCP> brenes@skywest.UUCP (Erasmo Brenes) writes: >... If the Shifter expects the video ram to start at 32K boundaries, >then how do I get MWC, or any C program to allocate a 32Kb buffer starting in >a 32Kb boundary in an efficient manner? An initial thought was to use Malloc() >to allocate 64Kb and then only use the 32Kb which start in a 32Kb boundary, >but this method is too wasteful. There's got to be a better way, isn't there? You've got the concept right, but not the detail. The video buffer must start at a location which is 0 mod 256 (or is it 512, and I'm wrong again? anyway, doesn't matter, fits into 32K regardless). The video buffer is 32000 (exactly, decimal) bytes long. So, allocate 32K (32768 decimal) and then start your buffer at the first location therein which is 0 mod 256. Tiny bit of waste, but...