[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Hercules on ELKS / Microwindows
From: Jakob Eriksson ####@####.#### Date: 15 Sep 1999 21:00:13 -0000 Message-Id: <Pine.GSO.3.95.990915224947.22938A-100000@bilbo.mdh.se> Hi everybody and Thomas! Eh... Sorry for crossposting, but I am a little confused regarding which people would like to hear this... Since I have been too lazy/busy to do some hercules coding myself and others have already given it a try, I post here what I know. This is taken from a Microsoft Press book from 1987. It is a book full of asm examples, original title: "Programmers Guide to PC & PS/2 VIDEO SYSTEMS" I have the swedish version. The copyright says (from swedish): The contents of this book must not be in part or as a whole copied (xerox etc) or stored on machine-readable media without the copyrightholders (? dont know the legal term in english) written permission. But AFAIK in Sweden it is legal to copy a few pages of a book for educational purposes... (I am doing this in Sweden.) So if this educates someone, I guess it is just fine. :-) Does any of you know how this legal stuff works? Do companies expect to sell books containing source code and then no one typing it into their computers? (Machine readable media...) Or is it a silent agreement? Happy hacking. ByteOffsetShift EQU 3 PixelAddrHGC: HorizLineHGC: mov ax,ARGy1 mov bx,ARGx1 call PixelAddrHGC ; AH:= bitmask ; ES:BX -> videobuffer ; CL := number of bits leftshift ; ES:DI -> buffer mov di, bx mov dh,ah not dh mov d1,0FFh shl dh,cl not dh mov cx,ARG2x and cl,7 xor cl,7 shl dl,c1 mov cx,ARGx2 and cl,7 xor cl,7 shl dl,cl mov ax,ARGx2 mov bx,ARGx1 mov cl,ByteOffsetShift shr ax,cl shr bx,cl mov cx,ax sub cx,bx mov bx,offset DGROUP:PropagatedPixel mov al,ARGn xlat or dh,dh js L43 cr cx,cx jnz L42 and dl,dh jmp short L44 L42: mov ah,al and ah,dh not dh and es:[di],dh or es:[di],ah inc di dec cx L43: rep stosb ; This instruction does not work on 8088? L44: and al,dl not dl and es:[di],dl or es:[di],al jmp Lexit ... .... ... ....; vertical line draw etc. Lexit: pop di pop si mov sp,bp pop bp ret _PropagatedPixel DB 00000000b DB 11111111b ------------------------------------------------------------------ PS One can pageflip (hello doublebuffered microwin here I come!) between the 2 graphics frames on HGC. To write on page 0, use video segment B000H. To write on page 1, use video segment B800H. I have forgotten how to flip between the 2 frames, but I will post later when I have found it out. Oh, and here is PixelAddrHGC PROC near mov cl,bl shr ax,1 rcr bx,1 shr bx,1 mov ah,BytesPerLine (that is, 90 /comment) mul ah add bx,ax add bx,OriginOffset mov ax,VideoBufferSeg (you know, one of the buffers /comment) mov es,ax and cl,7 xor cl,7 mov ah,1 ret -------------------------------------- PS 2 These routines are so _neat_! Small and fast... I am impressed by the person(s) who thougt them out. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Hercules on ELKS / Microwindows
From: Perry Harrington ####@####.#### Date: 15 Sep 1999 22:14:26 -0000 Message-Id: <199909152207.PAA23465@alpha.apsoft.com> I happen to have source in C, C++ and asm available for free use, written by myself. There is also code for 640x480 B&W VGA there too. The tar file can be had at: ftp://ftp.apsoft.com/pub/user/perry/source/herc.tar.gz If you look at the VGA code, it demostrates the use of a lookup table for Y coordinate offsets. A lookup table for herc would be a big speed win on slow CPUs, just calculate the Y beginning offset at driver initialization. > > Since I have been too lazy/busy to do some hercules coding myself > and others have already given it a try, I post here what I know. > --Perry -- Perry Harrington Linux rules all OSes. APSoft () email: ####@####.#### Think Blue. /\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Hercules on ELKS / Microwindows
From: Jakob Eriksson ####@####.#### Date: 15 Sep 1999 22:53:28 -0000 Message-Id: <Pine.GSO.3.95.990916004233.25388A-100000@bilbo.mdh.se> On Wed, 15 Sep 1999, Perry Harrington wrote: > I happen to have source in C, C++ and asm available for free use, > written by myself. There is also code for 640x480 B&W VGA there too. Thanks a lot! This simplifies both coding and legalities. > The tar file can be had at: > > ftp://ftp.apsoft.com/pub/user/perry/source/herc.tar.gz > > If you look at the VGA code, it demostrates the use of a lookup table > for Y coordinate offsets. A lookup table for herc would be a big > speed win on slow CPUs, just calculate the Y beginning offset at > driver initialization. Hmm... interesting. I never thought of that. Probably the hercules can be really useful. Regards, Jakob | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |