home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
yaru
/
vsync.asm
< prev
next >
Wrap
Assembly Source File
|
1990-06-14
|
4KB
|
214 lines
;------------------------------------------------------------------------------
;
; 題名 VSYNC.COM Version 0.1 (1990.04.14)
;
; 作者 ヤルヤル (NAC01135)
;
; 内容 TBIOS.BINのVSYNCチェックを殺す
;
; 内訳 MOGUMOGUを読んで, メモリ上に既にローディングされている
; TBIOS を, だぁ~っと, TBIOS.BIN のサイズ分だけ検索して
; パッチを当てるべきコードが見つかったらパッチを当てる.
; 見つからない場合は, 何もいじらずに終了.
;
; 長い事様子を見ていたのですが, 誰も作りそうに無いのでUPしました.
; [VINGBIOS.BIN]も[PAOBIOS.BIN ]も, 実はTBIOSが描画する前に
; VSYNCを見る処理(描画時のノイズ対策?)を潰しているだけ!!
; これで何十Kものファイルをダウンするのは電話代が勿体ない!!!!!!
; で, TBIOS.SYSをチョロっと調べて作りました.
;
; これでTBIOSで表示速度が非純正BIOS同等になると思います.
;
; なお, これの使用による損害等に関しては, 私は責任は負いません.
; 他への転載等の前には, 一応僕に了解をとってください.
;
;------------------------------------------------------------------------------
.286c
assume cs:YARU_code
YARU_code segment
;------------------------------------------------------------------------------
DEBUG equ 0 ; デバッグ用のオプション
;------------------------------------------------------------------------------
MOGUMOGU equ 03b90h
CHECK_LENGTH equ 11
;------------------------------------------------------------------------------
KILL_VSYNC proc near
push ds
push es
push ax
push bx
push cx
push dx
push si
push di
main:
mov dx,MOGUMOGU ; Read I/O Port
in al,dx
mov bl,al
add dx,2
in al,dx
mov bh,al
add dx,2
in al,dx
set_segment:
mov dx,bx ; Calc Segment & Offset
mov cl,4
shr dx,cl
shl al,cl
or dh,al
push dx ; segment
pop es
push cs ; ds = cs
pop ds
and bx,000fh ; offset
mov di,bx
cld ; direction flag clear
set_checklength:
xor cx,cx ; Search Length Set
sub cx,di
check_before64k:
mov si,offset Check_Data+100h
lodsb
repnz scasb
jne check_last
if DEBUG;***************
call msg1
endif ;***************
push di
push cx
mov cx,CHECK_LENGTH
rep cmpsb
test cx,cx
pop cx
pop di
jz patch_main
if DEBUG;***************
call msg3
endif ;***************
test cx,cx
jnz check_before64k
check_last:
mov ax,es
add ax,1000h
mov es,ax
xor di,di
mov cx,16384
add cx,bx
check_last16k:
mov si,offset Check_Data+100h
lodsb
repnz scasb
jne exit
if DEBUG;***************
call msg1
endif ;***************
push di
push cx
mov cx,CHECK_LENGTH
rep cmpsb
test cx,cx
pop cx
pop di
jz patch_main
if DEBUG;***************
call msg3
endif ;***************
test cx,cx
jnz check_last16k
jmp exit
patch_main:
if DEBUG;***************
call msg2
endif ;***************
mov al,0c3h ; [in al,dx]を[ret] に書き換え
mov es:[di-1],al ; この書き換え方法の方が安全
exit:
pop di
pop si
pop dx
pop cx
pop bx
pop ax
pop es
pop ds
mov ax,4c00h
int 21h
KILL_VSYNC endp
if DEBUG;***************
even;----------
msg1 proc near
push ds
push ax
push dx
push cs
pop ds
mov dx,offset debug_msg1+100h
mov ah,9
int 21h
pop dx
pop ax
pop ds
ret
msg1 endp
even;----------
msg2 proc near
push ds
push ax
push dx
push cs
pop ds
mov dx,offset debug_msg2+100h
mov ah,9
int 21h
mov ah,8
int 21h
pop dx
pop ax
pop ds
ret
msg2 endp
even;----------
msg3 proc near
push ds
push ax
push dx
push cs
pop ds
mov dx,offset debug_msg3+100h
mov ah,9
int 21h
mov ah,8
int 21h
pop dx
pop ax
pop ds
ret
msg3 endp
endif ;***************
;------------------------------------------------------------------------------
Check_Data Label Byte ; この内容のデータを検索する
;1ST_CHECK:
db 0ech ; in al,dx
db 0a8h,001h ; test al,01h
db 075h,0fbh ; jne 1ST_CHECK
;2ND_CHECK:
db 0ech ; in al,dx
db 0a8h,001h ; test al,01h
db 074h,0fbh ; je 2ND_CHECK
db 0c3h ; ret
if DEBUG;***************
debug_msg1 db "コードを発見しました → $"
debug_msg2 db "コードが一致します. パッチを当てました.",13,10,"$"
debug_msg3 db "コードが不一致でした. 検索を続行します.",13,10,"$"
endif ;***************
;------------------------------------------------------------------------------
YARU_code ends
end