TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JAVIER KOHEN
from: SUNIR SHAH
date: 1997-07-20 03:08:00
subject: Graphics routines

To: Javier Kohen
Subject: Graphics routines
 JC>> This also draws from bottom to top, which is often faster than
 JK> Well, I was indirectely asking for code to try in my hardware config.
 JK> Sorry if I wasn't clear.
Off the top of my head . . . In C...
void BlitBackwards( char *Image, size_t Size, char far *Screen )
{
    while(Size--)
        Screen[Image] = Image[Size];
}
In asm, of which mine is very rusty,
        std                     ; Go backwards.
        lds     si,Image        ; Load image pointer
        mov     ax,0a000h       ; Load pointer to Video memory
        mov     es,ax
        mov     cx,Size         ; Number of bytes to blit
        mov     di,cx           ; Start at last byte position
        dec     di
        rep     movsb           ; GOOOOOOOOOOO!!!!!!!
Ofc, you would use movsd or something like that to speed things up.
SS
--- Maximus 3.01
---------------
* Origin: BitByters BBS, Rockland ON, Can. (613)446-7773 v34, (1:163/215)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.