home *** CD-ROM | disk | FTP | other *** search
- /*
- SG C Tools 1.1
-
- (C) 1993 Steve Goldsmith
- All Rights Reserved
-
- Compiled with HI-TECH C 3.09 (CP/M-80).
- */
-
- #include <stdlib.h>
- #include <hitech.h>
- #include <vdc.h>
-
- /* alloc buffer and copy vdc mem into it */
-
- uchar * memtobufvdc(ushort VidMem, ushort CopyLen)
- {
- ushort I;
- uchar *BufPtr;
-
- BufPtr = (uchar *) malloc(CopyLen);
- if (BufPtr != NULL)
- {
- outvdc(vdcUpdAddrHi,(uchar) (VidMem >> 8));
- outvdc(vdcUpdAddrLo,(uchar) VidMem);
- for(I = 0; I < CopyLen; I++)
- BufPtr[I] = invdc(vdcCPUData);
- }
- return(BufPtr);
- }
-
- /* copy buffer to vdc mem */
-
- void buftomemvdc(uchar *BufPtr, ushort VidMem, ushort CopyLen)
- {
- ushort I;
-
- if (BufPtr != NULL)
- {
- outvdc(vdcUpdAddrHi,(uchar) (VidMem >> 8));
- outvdc(vdcUpdAddrLo,(uchar) VidMem);
- for(I = 0; I < CopyLen; I++)
- outvdc(vdcCPUData,BufPtr[I]);
- }
- }
-