DRAW10H.PAS 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {$G+}
  2. unit Draw10H;
  3. {ˆá¯®«ì§ã¥áâáï ¤«ï ¡ëáâண® à¨á®¢ ­¨ï �Ž�Œ€‹œ�›• ®¡ê¥ªâ®¢ (ä३¬®¢)}
  4. INTERFACE
  5. VAR
  6. CurPage : byte Absolute $40:$62;
  7. VmemLen : word Absolute $40:$4c;
  8. CONST
  9. PlaneMaskingPort = $03CE;
  10. SelectPlanePort = $03C4;
  11. Procedure DrawSprite12H(xpos,ypos,xsize,ysize:word;Page:byte;BitPlane : pointer);
  12. {�¨áã¥âáï á¯à ©â, «¥¦ é¨© ¯®  ¤à. BitPlane à §¬¥à®¬ xsize x ysize, ⮫쪮
  13. ªà â­ë 8. �¨ª ª¨å ¯à®¢¥à®ª ­¥â. ‘¯à ©â - 4 ¡¨â®¢ë¥ ¯«®áª®á⨠B G R A}
  14. IMPLEMENTATION
  15. {-----------------------------------------}
  16. Procedure DrawSprite12H;assembler;
  17. var
  18. Beg : pointer;
  19. cool : word;
  20. asm
  21. push ds
  22. mov ax, word ptr BitPlane+2
  23. mov cool, ax
  24. xor ax, ax
  25. mov al, page
  26. push 40h
  27. pop es
  28. mov bx, es:[4ch]
  29. mul bx
  30. shr ax, 4
  31. mov bx, 0A000h
  32. add bx, ax
  33. mov ax, ypos {Calculate ypos}
  34. push ax
  35. shl ax, 2
  36. add bx, ax {y*(640/8)/16 = y*5 - segment}
  37. pop cx
  38. add bx, cx
  39. shr xpos, 3
  40. shr xsize, 3
  41. mov ax, xpos {Calcualte xpos}
  42. mov word ptr Beg, ax
  43. mov word ptr Beg+2, bx
  44. mov ax, 0005h {Set GDC Register for writing}
  45. mov dx, 03CEh
  46. out dx, ax
  47. INC DX
  48. xor ax, ax
  49. out dx, ax
  50. mov bx, 1
  51. mov si, word ptr BitPlane
  52. @1:
  53. mov dx, 03C4h {ˆ­¤¥ªá ᨭåà®­¨§ â®à }
  54. mov al, 2
  55. out dx, al {�¥¦¨¬ ¢ë¡®à  á«®ï}
  56. inc dx
  57. mov al, bl {‚ë¡®à ⥪ã饣® á«®ï}
  58. out dx, al
  59. shl bl, 1 {‚ë¡®à ­®¢®£® á«®ï}
  60. les di, Beg
  61. mov cx, ysize
  62. @2:
  63. push cx
  64. mov cx, xsize
  65. push ds
  66. mov ds, cool
  67. repe movsb
  68. pop ds
  69. add di, 80
  70. sub di, xsize
  71. pop cx
  72. loop @2
  73. cmp bl, 0010000b
  74. jne @1
  75. mov dx, 3C4H
  76. mov ax, 02
  77. out dx, al
  78. inc dx
  79. mov al, 0Fh {Select default plane}
  80. out dx, al
  81. pop ds
  82. end;{DrawSprite12H}
  83. {-----------------------------------------}
  84. end.