options.s
上传用户:andy_li
上传日期:2007-01-06
资源大小:1019k
文件大小:2k
源码类别:

压缩解压

开发平台:

MultiPlatform

  1. *****************************************
  2. * *
  3. * TwentyOne.x 乽偲偅偉偵偂傢傫乿 *
  4. * patch for human Ver 2.02,2.03 *
  5. * *
  6. *****************************************
  7. *
  8. * file name: options.s
  9. * author: 俤倶倲 (T.Kawamoto)
  10. * last modify: 92/3/1
  11. * 92/3/17 thanks YUU(HARUKA)
  12. *
  13. blpeek: macro
  14. moveq.l #$84,d0
  15. trap #15
  16. endm
  17. *
  18. getpdb: macro
  19. dc.w $ff51
  20. endm
  21. *
  22. .xdef _TwentyOneOptions
  23. *
  24. .text
  25. *
  26. _TwentyOneOptions:
  27. movem.l a0-a2,-(sp)
  28. bsr search_memory_blindly
  29. tst.l d0
  30. bne return
  31. bsr search_device_blindly
  32. return:
  33. movem.l (sp)+,a0-a2
  34. rts
  35. *
  36. search_device_blindly:
  37. lea $00006800,a1
  38. search_NUL_device_loop:
  39. cmp.l #$00020000,a1
  40. bcc sd_not_found
  41. blpeek
  42. cmp.l #'NUL ',d0
  43. beq found_NUL_device
  44. * lea 4(a1),a1 * 埲壓偺梫椞傛傝
  45. * 偙偙偱僀儞僋儕儊儞僩偡傞昁梫偼
  46. * 偁傝傑偣傫 1992.03.17 YUU(HARUKA).
  47. cmp.w #'NU',d0
  48. bne search_NUL_device_loop
  49. lea -2(a1),a1
  50. bra search_NUL_device_loop
  51. *
  52. found_NUL_device:
  53. * lea -14(a1),a1 * 仼 偙偙偑偍偐偟偄
  54. lea -18(a1),a1 * IOCS B_LPEEK 偺栠傝抣 a1
  55. * 偼 d0 偺抣傪庢摼偟偨傾僪儗僗 + 4
  56. * 側偺偱師偺僨僶僀僗傊偺傾僪儗僗偼
  57. * -18(a1) 偲側傝傑偡 1992.03.17 YUU.
  58. search_device:
  59. blpeek
  60. sd_loop:
  61. move.l d0,a0
  62. lea $000E(a0),a2
  63. bsr check_TW
  64. tst.l d0
  65. bne sd_end
  66. lea.l (a0),a1
  67. blpeek
  68. cmp.l #$ffffffff,d0
  69. bne sd_loop
  70. sd_not_found:
  71. moveq.l #0,d0
  72. sd_end:
  73. rts
  74. *
  75. search_memory_blindly:
  76. getpdb
  77. move.l d0,a1
  78. lea -16(a1),a1
  79. search_top_loop:
  80. lea 4(a1),a1
  81. blpeek
  82. tst.l d0
  83. beq found_top
  84. move.l d0,a1
  85. bra search_top_loop
  86. *
  87. found_top:
  88. lea -8(a1),a1 * 側偤偐偙偺峴偑僐儊儞僩峴偵側偭偰偄傑偟偨
  89. * lea 8(a1),a1 * 懡暘偙偭偪偑僐儊儞僩峴偩偲巚偄傑偡
  90. * 1992.03.17 YUU(HARUKA).
  91. search_memory:
  92. lea 12(a1),a1
  93. blpeek
  94. sm_loop:
  95. move.l d0,a0
  96. lea $010E(a0),a2
  97. bsr check_TW
  98. tst.l d0
  99. bne sm_end
  100. lea $000C(a0),a1
  101. blpeek
  102. tst.l d0
  103. bne sm_loop
  104. moveq.l #0,d0
  105. sm_end:
  106. rts
  107. *
  108. check_TW:
  109. lea (a2),a1
  110. blpeek
  111. cmp.l #'?Twe',d0
  112. beq check_new
  113. cmp.l #'*Twe',d0
  114. bne check_error
  115. check_old:
  116. lea $0004(a2),a1
  117. blpeek
  118. cmp.l #'nty*',d0
  119. bne check_error
  120. moveq.l #-1,d0
  121. rts
  122. *
  123. check_new:
  124. lea $0004(a2),a1
  125. blpeek
  126. cmp.l #'nty?',d0
  127. beq check_new_E
  128. cmp.l #'ntyE',d0
  129. bne check_error
  130. check_new_E:
  131. lea $0008(a2),a1
  132. blpeek
  133. rts
  134. *
  135. check_error:
  136. moveq.l #0,d0
  137. rts
  138. *
  139. dc.b 'TwentyOne Option Checker Ver 1.00 '
  140. dc.b 'Copyright 1991,92 俤倶倲 (俿.俲awamoto)',0
  141. *
  142. .end