Subject: Re: Q:GSoft & MemManager Path: lobby!newstf02.news.aol.com!portc03.blue.aol.com!news.compuserve.com!news-master.compuserve.com!newsfeed.enteract.com!feeder.via.net!newshub1.home.com!news.home.com!news1.rdc2.on.home.com.POSTED!not-for-mail From: CUTblakeney@home.com (Jeff Blakeney) Newsgroups: comp.sys.apple2.programmer Organization: Shaw@Home Reply-To: CUTblakeney@home.com (Jeff Blakeney) Message-ID: <38629540.18230078@news> References: <83ti5t$a9u$1@sylvester.vcn.bc.ca> X-Newsreader: Forte Free Agent 1.1/32.230 Lines: 71 Date: Thu, 23 Dec 1999 21:55:12 GMT NNTP-Posting-Host: 24.66.22.77 X-Complaints-To: abuse@home.net X-Trace: news1.rdc2.on.home.com 945986112 24.66.22.77 (Thu, 23 Dec 1999 13:55:12 PST) NNTP-Posting-Date: Thu, 23 Dec 1999 13:55:12 PST On 23 Dec 1999 16:21:17 GMT, Al Crout wrote: > DIM MEM AS LONG > MEM(1) = $00E19E00:! COLOR PALETTE 0 > MEM(2) = $00E19E20:! COLOR PALETTE 1 > MEM(3) = $00000005:! MOVE $20 BYTES > > BLOCKMOVE (@MEM(1), @MEM(2), MEM(3)) Well, the first problem I see is that you are using two different variables. MEM is a long and MEM(x) is an array of integers (I think that is the default type). If you wanted to use the MEM array in the BlockMove command you will need to change the DIM line to: DIM MEM(3) AS LONG. However, that still doesn't make this program work. In the BlockMove command you are sending the address of where MEM(1) and MEM(2) are stored in memory instead of the values that those variables contain which is what you are trying to do. I think this is why you are getting the type mismatch error because you are going to get a pointer to integer in your current case and a pointer to long if you make the change I suggested above. If you look at the GSoftTools.int file you will see that BlockMove is expecting a ptr, ptr and long to be passed to it. Looking further up in the GSoftTools.int file you will also see that ptr is defined as a pointer to byte so you are sending the wrong type of data. To fix these two problems, remove the @'s and force the variables you are passing to be type cast appropriately by changing the BlockMove command to: BLOCKMOVE(PTR(MEM(1)), PTR(MEM(2)), MEM(3)) Now your program should work. However, I'm curious as to why you are using an array to hold the values and why you aren't using more descriptive name. If I were to have a routine like this it would look more like this: DIM SourcePtr as ptr, DestinationPtr as ptr DIM NumBytesToMove as long SourcePtr = ptr($00E19E00) DestinationPtr = ptr($00E1920) NumBytesToMove = 5 BlockMove(SourcePtr, DestinationPtr, NumBytesToMove) Oh, and is there any reason why you are only moving 5 bytes when your comment says that you are moving 32 ($20)? If you meant to move 32 bytes then change you MEM(3) line to: MEM(3) = $00000020:! MOVE $20 BYTES or change my NumBytesToMove line to: NumBytesToMove = 32 or if you prefer to use hexadecimal numbers: NumBytesToMove = $20 I hope this clears things up. As I prefer to program in assembly, type casting is always something that I screw up so I can understand why you were having problems. It took me a few tries before I figured out how to fix your program. :-) +------------------------------------------------------------------------+ | Jeff Blakeney - Dean of the Apple II University in A2Pro on Delphi | | Delphi Apple II Forums Web Pages | | A2: http://www.delphi.com/apple2 A2Pro: http://www.delphi.com/a2pro | +------------------------------------------------------------------------+