home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************
- * The hardware INdependent skeletons for the hardware dependent
- * low level routines. This file is included by the file gr_low.c
- * once for each different graphics card.
- **********************************************************************
- This file is part of
-
- STK -- The sprite toolkit -- version 1.1
-
- Copyright (C) Jari Karjala 1991
-
- The sprite toolkit (STK) is a FreeWare toolkit for creating high
- resolution sprite graphics with PCompatible hardware. This toolkit
- is provided as is without any warranty or such thing. See the file
- COPYING for further information.
-
- **********************************************************************/
-
-
- /**********************************************************************
- * ADDR
- * Return the address of the given (x,y) coordinate pair in the
- * given graphics page.
- *
- * x,y X,Y coordinates
- * page The graphics page (0/1)
- *
- * Return: far pointer into the screen.
- **********************************************************************/
- BYTE far *ADDR(WORD x, WORD y, BYTE page)
- {
- return (BYTE far *)MK_FP(SCR_SEG+page*SCR_PAGE_2_SEG, SCR_OFS(x,y));
- }
-
-
- /**********************************************************************
- * PUTCH
- *
- * Put character 'c' at the given address. Use OVERWRITE mode.
- **********************************************************************/
- void PUTCH(BYTE far *addr, BYTE chr)
- {
- #ifdef C_VER
-
- BYTE far *font = gr_font_addr + 8*chr;
- int i;
-
- for (i=0; i<8; i++) {
- *addr = *font++;
- NEXT_SCAN_LINE(addr,0);
- }
- #else
- /***** Assembler version is about 2 to 3 times faster *****/
- asm push ds
- asm push es
- asm cld
- /** fetch parameters **/
- asm les di, addr
- asm lds si, gr_font_addr
- asm mov al, chr
- asm xor ah, ah
- asm mov cl, 3
- asm shl ax, cl
- asm add si, ax
- asm mov cx, 8
- CHAR_LOOP:
- asm lodsb
- asm mov es:[di],al
- ASM_NEXT_SCAN_LINE(di)
- asm loop CHAR_LOOP
- asm pop es
- asm pop ds
-
- #endif
- }
-
-
- /** Undefine hardware dependent macros to make later redefinition easier **/
-
- #undef ADDR
- #undef PUTCH
- #undef NEXT_SCAN_LINE
- #undef ASM_NEXT_SCAN_LINE
- #undef SCR_OFS
- #undef SCR_SEG
- #undef SCR_PAGE_2_SEG
-