home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 2 / FreeSoftwareCollection2pd199x-jp.img / yaru / vsync.asm < prev    next >
Assembly Source File  |  1990-06-14  |  4KB  |  214 lines

  1. ;------------------------------------------------------------------------------
  2. ;
  3. ;    題名    VSYNC.COM    Version 0.1 (1990.04.14)
  4. ;
  5. ;    作者    ヤルヤル (NAC01135)
  6. ;
  7. ;    内容    TBIOS.BINのVSYNCチェックを殺す
  8. ;
  9. ;    内訳    MOGUMOGUを読んで, メモリ上に既にローディングされている
  10. ;        TBIOS を, だぁ~っと, TBIOS.BIN のサイズ分だけ検索して
  11. ;        パッチを当てるべきコードが見つかったらパッチを当てる.
  12. ;        見つからない場合は, 何もいじらずに終了.
  13. ;
  14. ;    長い事様子を見ていたのですが, 誰も作りそうに無いのでUPしました.
  15. ;    [VINGBIOS.BIN]も[PAOBIOS.BIN ]も, 実はTBIOSが描画する前に
  16. ;    VSYNCを見る処理(描画時のノイズ対策?)を潰しているだけ!!
  17. ;    これで何十Kものファイルをダウンするのは電話代が勿体ない!!!!!!
  18. ;    で, TBIOS.SYSをチョロっと調べて作りました.
  19. ;
  20. ;    これでTBIOSで表示速度が非純正BIOS同等になると思います.
  21. ;
  22. ;    なお, これの使用による損害等に関しては, 私は責任は負いません.
  23. ;    他への転載等の前には, 一応僕に了解をとってください.
  24. ;
  25. ;------------------------------------------------------------------------------
  26.         .286c
  27.         assume cs:YARU_code
  28. YARU_code    segment
  29. ;------------------------------------------------------------------------------
  30. DEBUG        equ    0            ; デバッグ用のオプション
  31. ;------------------------------------------------------------------------------
  32. MOGUMOGU    equ    03b90h
  33. CHECK_LENGTH    equ    11
  34. ;------------------------------------------------------------------------------
  35. KILL_VSYNC    proc    near
  36.  
  37.         push    ds
  38.         push    es
  39.         push    ax
  40.         push    bx
  41.         push    cx
  42.         push    dx
  43.         push    si
  44.         push    di
  45. main:
  46.         mov    dx,MOGUMOGU        ; Read I/O Port
  47.         in    al,dx
  48.         mov    bl,al
  49.         add    dx,2
  50.         in    al,dx
  51.         mov    bh,al
  52.         add    dx,2
  53.         in    al,dx
  54. set_segment:
  55.         mov    dx,bx            ; Calc Segment & Offset
  56.         mov    cl,4
  57.         shr    dx,cl
  58.         shl    al,cl
  59.         or    dh,al
  60.         push    dx            ; segment
  61.         pop    es
  62.         push    cs            ; ds = cs
  63.         pop    ds
  64.         and    bx,000fh        ; offset
  65.         mov    di,bx
  66.         cld                ; direction flag clear
  67. set_checklength:
  68.         xor    cx,cx            ; Search Length Set
  69.         sub    cx,di
  70. check_before64k:
  71.         mov    si,offset Check_Data+100h
  72.         lodsb
  73.         repnz    scasb
  74.         jne    check_last
  75. if DEBUG;***************
  76.         call    msg1
  77. endif    ;***************
  78.         push    di
  79.         push    cx
  80.         mov    cx,CHECK_LENGTH
  81.         rep    cmpsb
  82.         test    cx,cx
  83.         pop    cx
  84.         pop    di
  85.         jz    patch_main
  86. if DEBUG;***************
  87.         call    msg3
  88. endif    ;***************
  89.         test    cx,cx
  90.         jnz    check_before64k
  91. check_last:
  92.         mov    ax,es
  93.         add    ax,1000h
  94.         mov    es,ax
  95.         xor    di,di
  96.         mov    cx,16384
  97.         add    cx,bx
  98. check_last16k:
  99.         mov    si,offset Check_Data+100h
  100.         lodsb
  101.         repnz    scasb
  102.         jne    exit
  103. if DEBUG;***************
  104.         call    msg1
  105. endif    ;***************
  106.         push    di
  107.         push    cx
  108.         mov    cx,CHECK_LENGTH
  109.         rep    cmpsb
  110.         test    cx,cx
  111.         pop    cx
  112.         pop    di
  113.         jz    patch_main
  114. if DEBUG;***************
  115.         call    msg3
  116. endif    ;***************
  117.         test    cx,cx
  118.         jnz    check_last16k
  119.         jmp    exit
  120. patch_main:
  121. if DEBUG;***************
  122.         call    msg2
  123. endif    ;***************
  124.         mov    al,0c3h            ; [in al,dx]を[ret] に書き換え
  125.         mov    es:[di-1],al        ; この書き換え方法の方が安全
  126. exit:
  127.         pop    di
  128.         pop    si
  129.         pop    dx
  130.         pop    cx
  131.         pop    bx
  132.         pop    ax
  133.         pop    es
  134.         pop    ds
  135.         mov    ax,4c00h
  136.         int    21h
  137.  
  138. KILL_VSYNC    endp
  139.  
  140. if DEBUG;***************
  141.         even;----------
  142. msg1        proc    near
  143.         push    ds
  144.         push    ax
  145.         push    dx
  146.         push    cs
  147.         pop    ds
  148.         mov    dx,offset debug_msg1+100h
  149.         mov    ah,9
  150.         int    21h
  151.         pop    dx
  152.         pop    ax
  153.         pop    ds
  154.         ret
  155. msg1        endp
  156.  
  157.         even;----------
  158. msg2        proc    near
  159.         push    ds
  160.         push    ax
  161.         push    dx
  162.         push    cs
  163.         pop    ds
  164.         mov    dx,offset debug_msg2+100h
  165.         mov    ah,9
  166.         int    21h
  167.         mov    ah,8
  168.         int    21h
  169.         pop    dx
  170.         pop    ax
  171.         pop    ds
  172.         ret
  173. msg2        endp
  174.  
  175.         even;----------
  176. msg3        proc    near
  177.         push    ds
  178.         push    ax
  179.         push    dx
  180.         push    cs
  181.         pop    ds
  182.         mov    dx,offset debug_msg3+100h
  183.         mov    ah,9
  184.         int    21h
  185.         mov    ah,8
  186.         int    21h
  187.         pop    dx
  188.         pop    ax
  189.         pop    ds
  190.         ret
  191. msg3        endp
  192. endif    ;***************
  193. ;------------------------------------------------------------------------------
  194. Check_Data    Label    Byte            ; この内容のデータを検索する
  195.                         ;1ST_CHECK:
  196.         db    0ech            ; in    al,dx
  197.         db    0a8h,001h        ; test    al,01h
  198.         db    075h,0fbh        ; jne    1ST_CHECK
  199.                         ;2ND_CHECK:
  200.         db    0ech            ; in    al,dx
  201.         db    0a8h,001h        ; test    al,01h
  202.         db    074h,0fbh        ; je    2ND_CHECK
  203.         db    0c3h            ; ret
  204.  
  205. if DEBUG;***************
  206. debug_msg1    db    "コードを発見しました    →  $"
  207. debug_msg2    db    "コードが一致します. パッチを当てました.",13,10,"$"
  208. debug_msg3    db    "コードが不一致でした. 検索を続行します.",13,10,"$"
  209. endif    ;***************
  210.  
  211. ;------------------------------------------------------------------------------
  212. YARU_code    ends
  213.         end
  214.