Skip to content

Commit

Permalink
[Reduction] #82-89: PC-98 escape sequences
Browse files Browse the repository at this point in the history
I don't know anything about ANSI/VT100/??? escape sequences, but after some
quick research, these sequences and their effect seem to be specific to the
PC-98 (although they're implemented as part of DOS, of course).
  • Loading branch information
nmlgc committed Aug 20, 2014
1 parent 8f6c28c commit eff9638
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 446 deletions.
117 changes: 117 additions & 0 deletions libs/master.lib/txesc.asm
@@ -0,0 +1,117 @@
; master library - PC-9801
;
; Description:
;
;
; Function/Procedures:
; int text_height( void ) ;
; int text_systemline_shown( void ) ;
; void text_25line(void) ;
; void text_20line(void) ;
; void text_cursor_show(void) ;
; void text_cursor_hide(void) ;
; void text_systemline_hide(void) ;
; void text_systemline_show(void) ;
;
; Parameters:
; none
;
; Returns:
;
;
; Binding Target:
; Microsoft-C / Turbo-C / Turbo Pascal
;
; Running Target:
; PC-9801
;
; Requiring Resources:
; CPU: 8086
;
; Notes:
;
;
; Assembly Language Note:
;
;
; Compiler/Assembler:
; TASM 3.0
; OPTASM 1.6
;
; Author:
; 恋塚昭彦
;
; Revision History:
; 92/11/19 Initial
; 93/ 2/ 4 on/off -> show/hideに名前変更

; テキスト画面の行数を得る
; ※ファンクションキー表示がされていると1だけ少ない値になる。
func TEXT_HEIGHT
xor AX,AX
mov ES,AX
mov AL,ES:[0712h]
inc AX
ret
EVEN
endfunc

; ファンクションキー表示状態を得る
func TEXT_SYSTEMLINE_SHOWN
xor AX,AX
mov ES,AX
mov AL,ES:[0711h]
ret
EVEN
endfunc

func TEXT_25LINE
mov DX,'3l'
jmp short putcmd
EVEN
endfunc

func TEXT_20LINE
mov DX,'3h'
jmp short putcmd
EVEN
endfunc

func TEXT_CURSOR_HIDE
mov DX,'5h'
jmp short putcmd
EVEN
endfunc

func TEXT_CURSOR_SHOW
mov DX,'5l'
jmp short putcmd
EVEN
endfunc

func TEXT_SYSTEMLINE_HIDE
mov DX,'1h'
jmp short putcmd
EVEN
endfunc

func TEXT_SYSTEMLINE_SHOW
mov DX,'1l'
jmp short putcmd
EVEN
endfunc

; In: DH = first byte, DL = second byte
putcmd proc CALLMODEL
mov AL,27 ; ESC
int 29h
mov AL,'[' ; '['
int 29h
mov AL,'>' ; '>'
int 29h
mov AL,DH
int 29h
mov AL,DL
int 29h
ret
putcmd endp
90 changes: 4 additions & 86 deletions th01_zunsoft.asm
Expand Up @@ -18,6 +18,7 @@
DGROUP group seg000

include libs/BorlandC/RULES.ASI
include libs/master.lib/func.inc

; ===========================================================================

Expand Down Expand Up @@ -62,8 +63,8 @@ sub_384 proc near
call sub_1344
call sub_958
call sub_AB6
call sub_8B8
call sub_8AC
call text_systemline_hide
call text_cursor_hide
call sub_155E
call sub_367
call sub_87A
Expand Down Expand Up @@ -738,90 +739,7 @@ sub_87A proc near
retn
sub_87A endp

; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_88C proc near
xor ax, ax
mov es, ax
mov al, byte ptr es:loc_711+1
inc ax
retn
sub_88C endp


; =============== S U B R O U T I N E =======================================


sub_896 proc near
xor ax, ax
mov es, ax
mov al, byte ptr es:loc_711
retn
sub_896 endp

; ---------------------------------------------------------------------------
nop
mov dx, 336Ch
jmp short loc_8C4
; ---------------------------------------------------------------------------
nop
mov dx, 3368h
jmp short loc_8C4
; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_8AC proc near
mov dx, 3568h
jmp short loc_8C4
sub_8AC endp

; ---------------------------------------------------------------------------
nop
mov dx, 356Ch
jmp short loc_8C4
; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_8B8 proc near
mov dx, 3168h
jmp short loc_8C4
; ---------------------------------------------------------------------------
nop
mov dx, 316Ch
jmp short loc_8C4
; ---------------------------------------------------------------------------
nop

loc_8C4:
mov al, 1Bh
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, 5Bh
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, 3Eh
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, dh
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, dl
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
retn
sub_8B8 endp

; ---------------------------------------------------------------------------
include libs/BorlandC/txesc.asm
db 0

; =============== S U B R O U T I N E =======================================
Expand Down
95 changes: 5 additions & 90 deletions th02_op.asm
Expand Up @@ -4591,92 +4591,7 @@ sub_2430 proc far
retf
sub_2430 endp

; ---------------------------------------------------------------------------
nop
xor ax, ax
mov es, ax
assume es:seg000
mov al, es:byte_712
inc ax
retf
; ---------------------------------------------------------------------------
xor ax, ax
mov es, ax
mov al, es:byte_711
retf
; ---------------------------------------------------------------------------
nop
mov dx, 336Ch
jmp short loc_247A
; ---------------------------------------------------------------------------
nop
mov dx, 3368h
jmp short loc_247A
; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_2462 proc far
mov dx, 3568h
jmp short loc_247A
sub_2462 endp

; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_2468 proc far
mov dx, 356Ch
jmp short loc_247A
sub_2468 endp

; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_246E proc far
mov dx, 3168h
jmp short loc_247A
sub_246E endp

; ---------------------------------------------------------------------------
nop

; =============== S U B R O U T I N E =======================================


sub_2474 proc far
mov dx, 316Ch
jmp short loc_247A
; ---------------------------------------------------------------------------
nop

loc_247A:
mov al, 1Bh
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, 5Bh ; '['
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, 3Eh ; '>'
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, dh
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
mov al, dl
int 29h ; DOS 2+ internal - FAST PUTCHAR
; AL = character to display
retf
sub_2474 endp

; ---------------------------------------------------------------------------
include libs/BorlandC/txesc.asm
db 0

; =============== S U B R O U T I N E =======================================
Expand Down Expand Up @@ -21425,8 +21340,8 @@ sub_AB28 proc far
push cs
call near ptr sub_B019
call sub_1BC6
call sub_2474
call sub_2468
call text_systemline_show
call text_cursor_show
pop bp
retf
sub_AB28 endp
Expand Down Expand Up @@ -22106,8 +22021,8 @@ loc_AFC4:
out dx, al ; Interrupt Controller #2, 8259A
call sub_2596
call sub_1BBA
call sub_246E
call sub_2462
call text_systemline_hide
call text_cursor_hide
call sub_71C
mov byte_D8B2, 12h
push ds
Expand Down

0 comments on commit eff9638

Please sign in to comment.