Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
2.7 KiB

  1. EXTRN Ks2ChAddr : Word
  2. GenFont PROC Near
  3. ;
  4. ; Make Hangeul Font Pattern Completely.
  5. ;
  6. ; INPUT : DS = CS
  7. ; CX = Hangeul Code
  8. ; ES:DI = Buffer Pointer
  9. ;
  10. ; OUTPUT : N-Carry
  11. ; ES:DI = Buffer Pointer
  12. ;
  13. ; USES : ALL
  14. ;
  15. push bp
  16. push di
  17. mov ax, cx
  18. mov bp, di ; Save Buffer Offset to BP
  19. test [CodeStat], Chab
  20. jnz @f
  21. call [Ks2ChAddr]
  22. jnc @f
  23. jmp @gfEnd
  24. @@:
  25. mov di, bp
  26. mov cx, 16
  27. mov bx, ax ; Save Hangeul Code to DX
  28. xor ax, ax
  29. rep stosw ; Clear Image Buffer
  30. push bp
  31. mov cl, 5
  32. mov ax, 00111110b
  33. shl bx, 1
  34. mov bp, bx
  35. and bp, ax ; BP <- JONG Code
  36. shr bx, cl
  37. mov di, bx
  38. and di, ax ; DI <- JUNG Code
  39. shr bx, cl
  40. and bx, ax ; BX <- CHO Code
  41. pop cx ; CX <- Buffer Offset
  42. xor dh, dh
  43. mov si, _hfBaseCho[bx]
  44. cmp si, -1
  45. je @gfExit
  46. or si, si
  47. jz @f
  48. add si, _hfCnvJungCho[di]
  49. add si, ds:_hfCnvJongCho[bp]
  50. mov si, [si]
  51. add si, _hfBmpCho
  52. call ORingImage
  53. @@:
  54. mov si, _hfBaseJung[di]
  55. cmp si, -1
  56. je @gfExit
  57. or si, si
  58. jz @f
  59. add si, _hfCnvChoJung[bx]
  60. add si, ds:_hfCnvJongJung[bp]
  61. mov si, [si]
  62. add si, _hfBmpJung
  63. call ORingImage
  64. @@:
  65. mov si, ds:_hfBaseJong[bp]
  66. cmp si, -1
  67. je @gfExit
  68. or si, si
  69. jz @f
  70. add si, _hfCnvChoJong[bx]
  71. add si, _hfCnvJungJong[di]
  72. mov si, [si]
  73. add si, _hfBmpJong
  74. call ORingImage
  75. @@:
  76. clc
  77. @gfEnd:
  78. pop di
  79. pop bp
  80. ret
  81. @gfExit:
  82. stc
  83. jmp SHORT @gfEnd
  84. GenFont ENDP
  85. ORingImage PROC Near
  86. ;
  87. ; INPUT : DS = CS
  88. ; ES:CX = Buffer Pointer
  89. ; SI = Image Pointer
  90. ; DH = 0
  91. ;
  92. ; Must Reserve DI register
  93. ;
  94. push di
  95. mov di, cx
  96. lodsw
  97. cmp ax, -1
  98. je @oriTerm
  99. mov dl, al
  100. add di, dx
  101. mov dl, ah
  102. @@:
  103. lodsw
  104. or es:[di], ax
  105. add di, 2
  106. dec dl
  107. jnz @b
  108. @oriTerm:
  109. pop di
  110. ret
  111. ORingImage ENDP
  112. CharTbl LABEL Word
  113. INCLUDE hf.inc
  114. GenFontLng = $ - GenFont