home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
comm
/
ykh121.zip
/
YKHSRC.ZIP
/
GRAPH.ASM
< prev
next >
Wrap
Assembly Source File
|
1992-10-07
|
6KB
|
433 lines
; 3C4h index 2 (r/W): Sequencer: Map Mask Register
; bit 0 Enable writes to plane 0 if set
; 1 Enable writes to plane 1 if set
; 2 Enable writes to plane 2 if set
; 3 Enable writes to plane 3 if set
;
; 3CEh index 4 (r/W): Graphics: Read Map Select Register
; bit 0-1 Number of the plane read Mode 0 will read from.
.286c
INT_10H MACRO
PUSH BP
INT 10H
POP BP
ENDM
INT_10HP MACRO
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH BP
PUSH DS
PUSH ES
PUSH SI
PUSH DI
INT 10H
POP DI
POP SI
POP ES
POP DS
POP BP
POP DX
POP CX
POP BX
POP AX
ENDM
VIDEOSEG EQU 0B800H
JISLIB_TEXT segment byte public 'CODE'
JISLIB_TEXT ends
DGROUP group _DATA,_BSS
assume cs:JISLIB_TEXT,ds:DGROUP
_DATA segment word public 'DATA'
_DATA ends
_BSS segment word public 'BSS'
_BSS ends
JISLIB_TEXT segment byte public 'CODE'
;
oldmode db ?
;
;int far jis_deinit();
;
_jis_deinit proc far
mov ax,3
int 10h
xor ax,ax
ret
_jis_deinit endp
;
;int far jis_init(unsigned scanlines,unsigned fg,unsigned bg,char far* filename);
;
_jis_init proc far
push bp
mov bp,sp
mov ax,3
int 10h
xor ax,ax
pop bp
ret
_jis_init endp
;
; void far jis_put(unsigned jis,unsigned scanline, unsigned column)
;
_jis_put proc far
push bp
mov bp,sp
push es
push di
mov ax,VIDEOSEG
mov es,ax
mov ax,160
mul word ptr [bp+8]
add ax,[bp+10]
add ax,[bp+10]
mov di,ax
mov ax,[bp+6] ;AL = JIS character code
mov al,ah
mov ah,15
stosw
mov al,[bp+6] ;AL = JIS character code
stosw
pop di
pop es
pop bp
ret
_jis_put endp
;
; void far ascii_put(unsigned ascii,unsigned scanline, unsigned column)
;
_ascii_put proc far
push bp
mov bp,sp
push es
push di
mov ax,VIDEOSEG
mov es,ax
mov ax,160
mul word ptr [bp+8]
add ax,[bp+10]
add ax,[bp+10]
mov di,ax
mov ax,[bp+6] ;AL = ascii character code
mov ah,15
stosw
pop di
pop es
pop bp
ret
_ascii_put endp
;
; void far jis_clear(unsigned scanline, unsigned column,
; unsigned scanlines, unsigned columns);
;
_jis_clear proc far
push bp
mov bp,sp
push es
push di
mov ax,VIDEOSEG
mov es,ax
mov ax,160
mul word ptr [bp+6]
add ax,[bp+8]
add ax,[bp+8]
mov di,ax
mov dx,[bp+12]
xor bx,bx
sub bx,dx
sub bx,dx
add bx,160
xor ax,ax
@@clr: mov cx,dx
rep stosw
add di,bx
dec word ptr [bp+10]
jnz @@clr
pop di
pop es
pop bp
ret
_jis_clear endp
;
; void far jis_set(unsigned scanline, unsigned column,
; unsigned scanlines, unsigned columns);
;
_jis_set proc far
push bp
mov bp,sp
push es
push di
mov ax,VIDEOSEG
mov es,ax
mov ax,160
mul word ptr [bp+6]
add ax,[bp+8]
add ax,[bp+8]
mov di,ax
mov dx,[bp+12]
xor bx,bx
sub bx,dx
sub bx,dx
add bx,160
mov ax,7fffh
jmp @@clr
;
; NO RET
;
_jis_set endp
;
; void far jis_xor(unsigned scanline, unsigned column,
; unsigned scanlines, unsigned columns);
;
_jis_xor proc far
push bp
mov bp,sp
push es
push di
mov ax,VIDEOSEG
mov es,ax
mov ax,160
mul word ptr [bp+6]
add ax,[bp+8]
add ax,[bp+8]
mov di,ax
mov dx,[bp+12]
xor bx,bx
sub bx,dx
sub bx,dx
add bx,160
@@clx: mov cx,dx
@@cly: xor byte ptr es:[di+1],7fh
add di,2
loop @@cly
add di,bx
dec word ptr [bp+10]
jnz @@clx
pop di
pop es
pop bp
ret
_jis_xor endp
;
; void far jis_gray(unsigned scanline, unsigned column,
; unsigned scanlines, unsigned columns);
;
_jis_gray proc far
ret
_jis_gray endp
;
; void far jis_bold8(unsigned scanline, unsigned column,
; unsigned scanlines, unsigned columns);
;
_jis_bold8 proc far
ret
_jis_bold8 endp
;
; void far jis_fcopy(unsigned srcy, unsigned srcx,
; unsigned desty, unsigned destx,
; unsigned height, unsigned width );
;
_jis_fcopy proc far
push bp
mov bp,sp
push ds ;save data and extra segments
push si ;
push es ;
push di ;
mov si,VIDEOSEG ;set up segments for video transfer
mov es,si ;
mov ds,si ;
mov ax,160
mul word ptr [bp+6]
add ax,[bp+8]
add ax,[bp+8]
mov si,ax
mov ax,160
mul word ptr [bp+10]
add ax,[bp+12]
add ax,[bp+12]
mov di,ax
mov dx,[bp+16]
mov bx,80
sub bx,dx
shl bx,1
cld
@@cop1: mov cx,dx
rep movsw
add si,bx
add di,bx
dec word ptr [bp+14]
jnz @@cop1
@@copend:
pop di
pop es
pop si
pop ds
pop bp
ret
_jis_fcopy endp
;
; void far jis_bcopy(unsigned srcy, unsigned srcx,
; unsigned desty, unsigned destx,
; unsigned height, unsigned width );
;
_jis_bcopy proc far
push bp
mov bp,sp
push ds ;save data and extra segments
push si ;
push es ;
push di ;
mov di,VIDEOSEG ;set up segments for video transfer
mov es,di ;
mov ds,di ;
mov ax,160
mul word ptr [bp+6]
add ax,[bp+8]
add ax,[bp+8]
mov si,ax
mov ax,160
mul word ptr [bp+10]
add ax,[bp+12]
add ax,[bp+12]
mov di,ax
mov ax,160
mul word ptr [bp+14]
sub ax,160
add ax,[bp+16]
add ax,[bp+16]
dec ax
dec ax
add si,ax
add di,ax
mov dx,[bp+16]
mov bx,80
sub bx,dx
shl bx,1
std
@@bcop1: mov cx,dx
rep movsw
sub si,bx
sub di,bx
dec word ptr [bp+14]
jnz @@bcop1
cld
pop di
pop es
pop si
pop ds
pop bp
ret
_jis_bcopy endp
;
JISLIB_TEXT ends
public _jis_init
public _jis_deinit
public _jis_put
public _ascii_put
public _jis_clear
public _jis_set
public _jis_xor
public _jis_gray
public _jis_bold8
public _jis_fcopy
public _jis_bcopy
end