From: kiku@yuichi.ee.sophia.ac.jp (kikuchi akira)
Newsgroups: fj.sys.ibmpc
Subject: NNANSI modification for DOS/V
Date: 20 Nov 92 15:38:55 GMT
Distribution: fj
Organization: Electrical Electronic Engineering Dept., Sophia Univ., Tokyo,
	Japan

NNANSI $B$N(B 9/92 version $B$r(B DOS/V $B$G;H$($k$h$&$K$9$k$?$a$N(B patch $B$G$9!#(B

$B9TA^F~$d9T:o=|$,$G$-(B$B$k(B ANSI console driver $B$K$D$$$F$O!"$b$O$d(B FAQ $B$H(B
$B$J$j$D$D$"$j$^$9$,!"$=$l$KBP$9$k2sEz$N0l$D$G$9!#(B
$B$H!"(B$B3J9%$r$D$1$F$O$_$^$7$?$,!"(BDOS/V $B>e$GF0:n$5$;$k$?$a$N:GDc8B$NJQ99$7(B
$B$+9T$J$C$F$$$J$$$N$G!"$^$@$^$@2~NI(B$B$NM>CO$O$"$j$^$9!#(B

$B:FG[I[$N>r7o$H$7$F$O!"(Bpatch $B$NFbMF$KJQ99$r2C$($J$$8B$j!"<+M3$H$7$^$9!#(B
$BB>$X$NE>:\(B$B$K$D$$$F$b@)8B$7$^$;$s!#$J$k$Y$/B?$/$N?M$,6/NO$J(B console
driver $B$r(B DOS/V $B>e$G;H$($k$h$&$K6(NO$7$F$$$?(B$B$@$1$l$P9,$$$G$9!#(B

$B$?$@$7!"$3$N(B patch $B$OL5J]>Z$G$9!#$3$N(B patch $B$rEv$F$?(B NNANSI $B$r;HMQ$7$?(B
$B$3$H$K$h$j(B$B@8$8$?$$$+$J$kLdBj$KBP$7$F0l@Z$N@UG$$O$*$o$J$$$3$H$r$"$i$+$8(B
$B$a$*CG$j$7$F$*$-$^$9!#$H$$$C$F$b!"(BBug $B$r(B$B8+$D$1$?>l9g$K$OJs9p$7$F$$$?$@(B
$B$1$l$P!"$G$-$k$@$1$NBP1~$O$7$?$$$H;W$$$^$9!#(B

NNANSI $B$N:n<T(B Tom Almy $B$K(B DOS/V $B$H$=$N$?$a$NJQ99$K$D$$$F@bL@$7$?$H$3$m!"(B
$B<!2s$N(B release $B$G$O(B option $B$N0l$D$H$7$F2C$($k$3$H$,$G(B$B$-$k$+$bCN$l$J$$(B
$B$H8@$C$F$-$^$7$?!#(B

PS/55note + DOS/V J5.02 $B$*$h$S(B PS/55 5501-W + OS/2 J2.0 (VDM DOS/V)
$B$G$NF0:n$O3NG'$7$F$$$^$9!#(B

$B$=$l$+$i(B Tom Almy $B$b8@$C$F$$$^$9$,!"(BNNANSI $B$N(B base $B$H$J$C$?(B NANSI $B$N(B
$B:n<T(B Daniel Kegel $B$X$N(B donation $B$b$G$-$k$@$16(NO$r$*4j$$$7$^$9!#(B


					DOS/V $B$r$5$i$K;H$$$d$9$/$9$k$?(B$B$a$K(B
								kiku

----- cut here ----- cut here ----- cut here ----- cut here -----
*** orig/nnansi.asm	Mon Sep  7 23:41:48 1992
--- nnansi.asm	Sat Nov 21 00:10:11 1992
***************
*** 80,85 ****
--- 80,87 ----
  ;           which most of the recent changes would have been impossible****
  ; Sept 1992:  Minor bug fixes. Changes as noted below
  
+ ; Nov  1992   Support DOS/V by Akira Kikuchi (kiku@yuichi.ee.sophia.ac.jp)
+ 
  page
  TRUE	equ	1
  FALSE	equ	0
***************
*** 246,251 ****
--- 248,257 ----
  	endif
  	db	13, 10
  	db	'by Tom Almy based on code (C) 1986 Daniel Kegel.'
+ if DOSV
+ 	db	13, 10
+ 	db	'Modified for DOS/V by Akira Kikuchi.'
+ endif
  	db	13, 10, 26
  
  	even
***************
*** 314,321 ****
--- 320,331 ----
  escvector	dw	0	; state vector of ESCape sequencor
  if DESQVIEW
  disppage	dw	0b800h	; address of display page
+ if DOSV
+ dvactive	db	1	; to put NNANSI on its good behavior
+ else
  dvactive	db	0	; is desqview active?
  endif
+ endif
  brkkeybuf	db	3	; control C
  wrap_flag	db	1	; 0 = no wrap past line end
  cur_attrib	db	7	; current char attributes
***************
*** 1082,1088 ****
--- 1092,1102 ----
  	cmp	al, 28			; is it a control char?
  	jb	f_control		;  maybe...
  f_t_nctl:
+ if DOSV
+ 	call	putchar
+ else
  	STOSW				; Put Char! (es:[di++] = ax)
+ endif
  	dec	dx			; count down to end of line
  	loopnz	f_t_cloop		; and go back for more.
  	jnz	f_loopdone		; finished execution
***************
*** 1564,1570 ****
--- 1578,1612 ----
  ; Moves screen up 1 line, fills the last line with blanks.
  ; Attribute of blanks is the current attribute sans blink and underline.
  
+ if DOSV
  scroll_up	proc	near
+ 		push_all
+ 		push	ds
+ 
+ 		mov	ax, ABS40	; address low mem via ds
+ 		mov	ds, ax
+ 		assume	ds:ABS40
+ 
+ 		mov	bh, cs:cur_attrib
+ 		mov	dh, byte ptr ega_rows
+ 					; Get max rows of display
+ 		mov	dl, byte ptr crt_cols
+ 		dec	dl		; lower right in dx
+ 
+ 		xor	cx, cx		; upper left of the screen
+ 		mov	al, 1		; 1 line scroll
+ 		mov	ah, 06h		; Scroll up
+ 
+ 		call_video
+ 
+ 		assume	ds:nothing
+ 		pop	ds
+ 		pop_all
+ 		ret
+ scroll_up	endp
+ 
+ else					; DOSV
+ scroll_up	proc	near
  	push_all
  
  	cmp	cs:gmode_flag,0
***************
*** 1750,1755 ****
--- 1792,1799 ----
  	jmp	scrret
  
  scroll_up	endp
+ endif                                   ; DOSV
+ 
  page
  ;-----move_back --------------------------------------------
  ; This routine moves the display to offset zero.
***************
*** 3295,3300 ****
--- 3339,3348 ----
  	db	13,10
  	db	'535 E. Mendocino St, Altadena, CA 91001, USA.'
  	db	13, 10, 13, 10
+ if DOSV
+ 	db	'Modified for DOS/V by Akira Kikuchi.'
+ 	db	13, 10, 13, 10
+ endif
  	db	'NNANSI driver loaded at '
  Ident1	db	'XXXX:0000'
  	db	13, 10, 27, '[0m'
*** orig/config.inc	Tue Sep  8 00:33:34 1992
--- config.inc	Sat Nov 21 00:09:42 1992
***************
*** 8,17 ****
--- 8,23 ----
  
  ; Author: Tom Almy, except as noted.
  ; Card id printout idea by Arend van den Brug.
+ ; DOS/V support by Akira Kikuchi.
  
  
  ; Note: I haven't tried all combinations.
  
+ ; If you want to use NNANSI under DOS/V, make following symbol TRUE.
+ ; It disables EGA, quick_char, fast29, bios_write_tty and cheap_pc
+ ; options (DOS/V requires 80286 or higher), and enables DESQVIEW
+ ; and DOS/V support code.                             Akira Kikuchi
+ DOSV		equ	TRUE
  
  ; Define both of these TRUE is display type is unknown.
  ; Otherwise define FALSE what your display isn't.
***************
*** 25,32 ****
--- 31,42 ----
  VGA	equ	TRUE    ; define TRUE for VGA, defining as FALSE eliminates
  			; 50 line mode code. (43 line mode will run with 50
  			; lines like older nansi and nnansi drivers
+ if DOSV
+ EGA	equ	FALSE
+ else
  EGA	equ	TRUE	; define TRUE for EGA for best results on EGA.
  			; defining as FALSE eliminates 43 line cursor fix code
+ endif
  
  
  
***************
*** 55,61 ****
--- 65,75 ----
  ;           with this version of NNANSI.
  
  
+ if DOSV
+ DESQVIEW equ	TRUE
+ else
  DESQVIEW equ	FALSE
+ endif
  
  
  ; VESA Compatibility -- ONLY SET IF YOUR DISPLAY CONTROLLER IS VESA
***************
*** 96,102 ****
--- 110,120 ----
  ; want to use the driver with an 8088/6. Define as FALSE for 
  ; processors >=80186 for best performance and smallest size.
  
+ if DOSV
+ cheap_pc	equ	FALSE
+ else
  cheap_pc	equ	TRUE	; no fancy instructions if true
+ endif
  
  
  
***************
*** 109,125 ****
--- 127,155 ----
  init_buf_size	equ	256	; size of keyboard redefinition buffer 
  	; and parameter buffer when key_redef TRUE. You may want to change 
  	; the size, if you use this feature. Don't make it <100.
+ if DOSV
+ quick_char	equ	FALSE
+ else
  quick_char	equ	TRUE ; quick graphic characters in modes 10 and 12
+ endif
  	; quick_char should be "TRUE" unless 
  	; you have an incompatible display card.
  	; And I don't know of any that are.
+ if DOSV
+ fast29		equ	FALSE
+ else
  fast29		equ	TRUE	; 15 % faster operation (overall)
  	;  of int29 calls (costs 100 bytes)
+ endif
+ if DOSV
+ bios_write_tty	equ	FALSE
+ else
  bios_write_tty	equ	TRUE	; take over BIOS write_tty if true
  	; NOTE: if bios_write_tty is true, the color rendition of text may 
  	; change, but performance will improve and ANSI control codes can 
  	; be used. This feature can be enabled/disabled at runtime as
  	; long as it is assembled (TRUE)
+ endif
  gbackground	equ	TRUE	; generate non-black graphic backgrounds
  	; This option may cause problems for software not expectings its
  	; existance. Also you must specify quick_char to use gbackground.
----- cut here ----- cut here ----- cut here ----- cut here -----
Newsgroups: fj.sys.ibmpc