home *** CD-ROM | disk | FTP | other *** search
- ifndef ??version
- ?debug macro
- endm
- publicdll macro name
- public name
- endm
- $comm macro name,dist,size,count
- comm dist name:BYTE:count*size
- endm
- else
- $comm macro name,dist,size,count
- comm dist name[size]:BYTE:count
- endm
- endif
- ?debug S "vr.c"
- ?debug C E93B7D6D170476722E63
- ?debug C E900104D1615453A5C42435C494E434C5544455C737464696F2E68
- ?debug C E900104D1616453A5C42435C494E434C5544455C7374646C69622E+
- ?debug C 68
- ?debug C E900104D1613453A5C42435C494E434C5544455C646F732E68
- _TEXT segment byte public 'CODE'
- _TEXT ends
- DGROUP group _DATA,_BSS
- assume cs:_TEXT,ds:DGROUP
- _DATA segment word public 'DATA'
- d@ label byte
- d@w label word
- _DATA ends
- _BSS segment word public 'BSS'
- b@ label byte
- b@w label word
- _BSS ends
- _TEXT segment byte public 'CODE'
- ;
- ; main()
- ;
- assume cs:_TEXT
- _main proc near
- push bp
- mov bp,sp
- ;
- ; {
- ; fontread(fontblock);
- ;
- mov ax,offset DGROUP:_fontblock
- push ax
- call near ptr _fontread
- pop cx
- ;
- ; fontwrite(fontblock);
- ;
- mov ax,offset DGROUP:_fontblock
- push ax
- call near ptr _fontwrite
- pop cx
- ;
- ; return;
- ;
- jmp short @1@50
- @1@50:
- ;
- ; }
- ;
- pop bp
- ret
- _main endp
- ;
- ; fontread(unsigned *chunk)
- ;
- assume cs:_TEXT
- _fontread proc near
- push bp
- mov bp,sp
- sub sp,4
- push si
- ;
- ; {
- ; unsigned far *screen;
- ; int cnt;
- ;
- ; outportb (0x3ce, 5); // Mode Ragister (index 5)
- ;
- mov dx,974
- mov al,5
- out dx,al
- ;
- ; outportb (0x3cf, 0); // disable O/E bit for sequential addressing
- ;
- mov dx,975
- mov al,0
- out dx,al
- ;
- ;
- ; outportb (0x3c4, 4);
- ;
- mov dx,964
- mov al,4
- out dx,al
- ;
- ; outportb (0x3c5, 6);
- ;
- mov dx,965
- mov al,6
- out dx,al
- ;
- ;
- ; outportb (0x3ce, 4);
- ;
- mov dx,974
- mov al,4
- out dx,al
- ;
- ; outportb (0x3cf, 2);
- ;
- mov dx,975
- mov al,2
- out dx,al
- ;
- ;
- ; screen = MK_FP(0xb800, 0x0000);
- ;
- mov word ptr [bp-2],47104
- mov word ptr [bp-4],0
- ;
- ; for (cnt = 0; cnt < 0x2000; cnt++)
- ;
- xor si,si
- jmp short @2@98
- @2@50:
- ;
- ; chunk[cnt] = screen[cnt];
- ;
- mov ax,si
- shl ax,1
- les bx,dword ptr [bp-4]
- add bx,ax
- mov ax,word ptr es:[bx]
- mov dx,si
- shl dx,1
- mov bx,word ptr [bp+4]
- add bx,dx
- mov word ptr [bx],ax
- inc si
- @2@98:
- cmp si,8192
- jl short @2@50
- ;
- ;
- ; outportb (0x3ce, 4);
- ;
- mov dx,974
- mov al,4
- out dx,al
- ;
- ; outportb (0x3cf, 0);
- ;
- mov dx,975
- mov al,0
- out dx,al
- ;
- ;
- ; outportb (0x3c4, 4);
- ;
- mov dx,964
- mov al,4
- out dx,al
- ;
- ; outportb (0x3c5, 2);
- ;
- mov dx,965
- mov al,2
- out dx,al
- ;
- ;
- ; outportb (0x3ce, 5); // Mode Ragister (index 5)
- ;
- mov dx,974
- mov al,5
- out dx,al
- ;
- ; outportb (0x3cf, 16); // disable O/E bit for sequential addressing
- ;
- mov dx,975
- mov al,16
- out dx,al
- ;
- ;
- ; return;
- ;
- jmp short @2@146
- @2@146:
- ;
- ; }
- ;
- pop si
- mov sp,bp
- pop bp
- ret
- _fontread endp
- ;
- ; fontwrite(unsigned *chunk)
- ;
- assume cs:_TEXT
- _fontwrite proc near
- push bp
- mov bp,sp
- sub sp,4
- push si
- ;
- ; {
- ; unsigned far *screen;
- ; int cnt;
- ;
- ; outportb (0x3c4, 4); // Memory Mode (index 4)
- ;
- mov dx,964
- mov al,4
- out dx,al
- ;
- ; outportb (0x3c5, 6); // enable O/E Bit for sequential addressing
- ;
- mov dx,965
- mov al,6
- out dx,al
- ;
- ;
- ; outportb (0x3ce, 5); // Mode Ragister (index 5)
- ;
- mov dx,974
- mov al,5
- out dx,al
- ;
- ; outportb (0x3cf, 0); // disable O/E bit for sequential addressing
- ;
- mov dx,975
- mov al,0
- out dx,al
- ;
- ;
- ; outportb (0x3c4, 2); // Map mask for write mode 0 (index 2)
- ;
- mov dx,964
- mov al,2
- out dx,al
- ;
- ; outportb (0x3c5, 4); // Plane mask, 4 = 0100 = plane 2
- ;
- mov dx,965
- mov al,4
- out dx,al
- ;
- ;
- ; screen = MK_FP(0xb800, 0x0000);
- ;
- mov word ptr [bp-2],47104
- mov word ptr [bp-4],0
- ;
- ; for (cnt = 0; cnt < 0x2000; cnt++)
- ;
- xor si,si
- jmp short @3@98
- @3@50:
- ;
- ; screen[cnt] = chunk[cnt];
- ;
- mov ax,si
- shl ax,1
- mov bx,word ptr [bp+4]
- add bx,ax
- mov ax,word ptr [bx]
- mov dx,si
- shl dx,1
- les bx,dword ptr [bp-4]
- add bx,dx
- mov word ptr es:[bx],ax
- inc si
- @3@98:
- cmp si,8192
- jl short @3@50
- ;
- ;
- ; outportb (0x3c4, 2); // Map mask for write mode 0 (index 2)
- ;
- mov dx,964
- mov al,2
- out dx,al
- ;
- ; outportb (0x3c5, 3); // Plane mask, 3 = 0011 = planes 0 and 1
- ;
- mov dx,965
- mov al,3
- out dx,al
- ;
- ;
- ; outportb (0x3ce, 5); // Mode Ragister (index 5)
- ;
- mov dx,974
- mov al,5
- out dx,al
- ;
- ; outportb (0x3cf, 16); // disable O/E bit for sequential addressing
- ;
- mov dx,975
- mov al,16
- out dx,al
- ;
- ;
- ; outportb (0x3c4, 4); // Memory Mode (index 4)
- ;
- mov dx,964
- mov al,4
- out dx,al
- ;
- ; outportb (0x3c5, 2); // disable O/E Bit for odd/even addressing
- ;
- mov dx,965
- mov al,2
- out dx,al
- ;
- ;
- ; return;
- ;
- jmp short @3@146
- @3@146:
- ;
- ; }
- ;
- pop si
- mov sp,bp
- pop bp
- ret
- _fontwrite endp
- _TEXT ends
- _BSS segment word public 'BSS'
- _fontblock label word
- db 16384 dup (?)
- ?debug C E9
- _BSS ends
- _DATA segment word public 'DATA'
- s@ label byte
- _DATA ends
- _TEXT segment byte public 'CODE'
- _TEXT ends
- public _main
- public _fontwrite
- public _fontblock
- public _fontread
- end