Á¦¸ñ : Ç㸣¹Ì ÇÑ±Û ¶óÀ̺귯¸® 2.0 [6] ¾È³çÇϼ¼¿ä Ç㸣¹ÌÀÔ´Ï´Ù. ¿À´ÃÀÇ °­Á¿¡¼­´Â .. ½ºÅ©·Ñ ·çƾÀ» ¼³°è Çغ¸µµ·Ï ÇÏ°ÚÀ¾´Ï´Ù. ÀÌ¹Ì Àú¹ø Ver 1.0 ¿¡ ´ëÇÑ °­Á¿¡¼­ ½ºÅ©·Ñ ¾÷ /´Ù¿î/¿Þ/¿À¸¥ ÀÇ ¾Ë°í¸®Áò°ú ±¸ÇöÀ» ¸ðµÎ ´Ù·é ¹Ù°¡ ÀÖÀ¾´Ï´Ù. À̹ø °­Á¿¡¼­ ¸»ÇÏ´Â ½ºÅ©·Ñ µµÆ® ¾÷/´Ù¿î ¸ðµâÀº ¾÷/´Ù¿îÀ» µµÆ®´ÜÀ§·Î ÇÒ ¼ö ÀÖ´Ù´Â ¶æ¸¸À» °¡Áø °ÍÀÌ ¾Æ´Ï°í °¡·Î¸¦ µµÆ®´ÜÀ§·Î Á¦ÇÑÇÏ¿© ½ºÅ©·Ñ ÇÒ ¼ö ÀÖ´Ù´Â ¶æÀÔ´Ï´Ù. ½ºÅ©·Ñ ¿Þ/¿À¸¥ ¿¡ ´ëÇؼ­´Â ÀÓÀÇÀÇ µµÆ®¸¸Å­ ½ºÅ©·Ñ ÇÏ´Â ¾Ë°í¸®ÁòÀ» ¾ÆÁ÷ ¸¸µéÁö ¸øÇ߱⠶§¹®¿¡ ¾÷/´Ù¿î ¿¡ ´ëÇؼ­¸¸ »ý°¢ÇØ º¸µµ·Ï ÇÏ°ÚÀ¾´Ï´Ù. ÀÌÀü¿¡ ¼³¸íÇß´ø ¸ðµâÀ» ±×´ë ·Î ¾²°í ÀÖÀ¸¹Ç·Î ¾à°£ÀÇ ¼öÁ¤µÈ ºÎºÐ¸¸À» º¸À̵µ·Ï ÇÏ°ÚÀ¾´Ï´Ù. ½ºÅ© ·ÑÀÇ ¿ø¸®¿¡ ´ëÇÑ °ÍÀ̶ó¸é Àú¹ø Ver 1.0 ¿¡ ´ëÇÑ °­Á¸¦ Âü°íÇϼ¼¿ä. ±×·³ »ç¿ëÀÚ°¡ È£ÃâÇÏ´Â ÇÔ¼ö¸¦ º¾½Ã´Ù. void hgVScrUp(int x1,int y1,int x2,int y2,int lines,int bkcolor) { int xs=x1/8+1; int xe=x2/8-1; unsigned char rmask=~get_mask(x2+1); if (!rmask) rmask=0xff; outport(0x3ce,0x0ff08); vgascrup(xs,y1,xe,y2,lines,bkcolor); outportb(0x3ce,8); outportb(0x3cf,get_mask(x1)); vgascrup(xs-1,y1,xs-1,y2,lines,bkcolor); outportb(0x3ce,8); outportb(0x3cf,rmask); vgascrup(xe+1,y1,xe+1,y2,lines,bkcolor); outport(0x3ce,0xff08); } ÇÔ¼ö¸¦ ÀÚ¼¼È÷ º¸¸é vgascrup À̶õ ÇÔ¼ö¸¦ ¼¼¹ø È£ÃâÇÏ°í ÀÖ´Ù´Â °ÍÀ» ¾Ë ¼ö ÀÖÀ¾´Ï´Ù. óÀ½¿¡´Â ¹ÙÀÌÆ® ´ÜÀ§ÀÇ °¡¿îµ¥ ºÎºÐ(Bit mask ´Â 0xff) .. ±×´ÙÀ½Àº ¿ÞÂÊ mask ¸¦ °è»êÇÑÈÄ ¿ÞÂʺκР½ºÅ©·Ñ.±×¸®°í ¿À ¸¥ÂÊ..ÀÇ ¼ø¼­·Î ½ºÅ©·Ñ ÇÏ°í ÀÖÀ¾´Ï´Ù. ¶È°°Àº ½ºÅ©·Ñ ·çƾÀ» ¾²°í´Â ÀÖÁö¸¸ ºñÆ®¸¶½ºÅ©¸¦ ´Ù¸£°Ô ¾²°í ÀÖÀ¾´Ï´Ù. ¸¶Áö¸·¿¡´Â ºñÆ®¸¶½ºÅ©¸¦ ÃʱâÈ­ÇÏ°í ÀÖÁÒ.. ±×·¸´Ù¸é vgascrup ÇÔ¼ö ÀÚü¿¡¼­´Â ºñÆ®¸¶½ºÅ©¸¦ °Çµå·Á¼­´Â ¾ÈµË´Ï´Ù. ÀÌÁ¤µµÀÇ ¼öÁ¤¸¸ °¡ÇØÁö¸é ½ºÅ©·Ñ ¾÷/´Ù¿îÀ» °¡ ·ÎµµÆ®Á¦ÇÑ ÇÒ ¼ö ÀÖÀ¾´Ï´Ù. ½ºÅ©·Ñ ÇÔ¼ö³»¿¡¼­´Â ¾²±â¸ðµå 1 ¹øÀ» ÀÌ ¿ëÇϴµ¥ ÀÌ ¸ðµå´Â ÀÓÀÇÀÇ À§Ä¡¸¦ ÀÐÀ¸¸é ·¡Ä¡¿¡ ¸ðµÎ µé¾î¿À°í,¾²¸é ·¡Ä¡¿¡ ÀÖ´Â °ÍÀÌ ½áÁö¹Ç·Î ½ºÅ©·Ñ Çϴµ¥ ¾²±â °¡Àå Æí¸®ÇÕ´Ï´Ù. ÀÌ ¸ðµå¿¡¼­µµ ºñÆ® ¸¶½ºÅ©´Â À¯È¿ÇÑ °ÍÀ̶ó´Â °ÍÀ» ±â¾ïÇϼ¼¿ä. ±×·³ vgascrup ÇÔ¼ö¸¦ º¼±î¿ä.. void vgascrup(int x1,int y1,int x2,int y2,int lines,int bkcolor) { unsigned x_width=x2-x1+1; unsigned y_width; y_width=80*lines; /* Src ¿Í Dest ÀÇ Byte Â÷ÀÌ */ _CX=y2-y1-lines+1; /* Àü¼Û ¶óÀμö */ asm push ds asm push es asm mov ax,0a000h asm mov es,ax asm mov ds,ax asm mov ax,WORD PTR y1 asm mov dx,80 asm mul dx asm mov bx,ax asm add bx,WORD PTR x1 /* bx=y1*80+x1 */ asm mov dx,3ceh asm mov ax,0105h /* write mode 1 */ asm out dx,ax uplp2: asm push cx _CX=x_width; asm mov di,bx asm mov si,di asm add si,y_width asm cld asm REP movsb /* Block Àü¼Û! */ asm add bx,80 asm pop cx asm loop uplp2 asm mov ax,0205h /* Write mode 2 */ asm out dx,ax asm mov al,BYTE PTR bkcolor /* bkcolor */ _CX=lines; uplp: asm push cx _CX=x_width; asm mov di,bx asm REP stosb /* Block Ä¥Çϱâ */ asm pop cx asm add bx,80 /* ÇÑÄ­ ³»¸² */ asm loop uplp asm mov ax,0005h /* ¾²±â¸ðµå Initializing */ asm out dx,ax asm pop es asm pop ds } Èì..±×·¯¸é ½ºÅ©·Ñ ´Ù¿îÀÇ °æ¿ì¸¦ »ìÆ캾½Ã´Ù. ¸¶Âù°¡Áö´Ï±î ¼Ò½ºÁß¿¡ ¼­ ¼³¸íÇÏ°ÚÀ¾´Ï´Ù. void vgascrdown(int x1,int y1,int x2,int y2,int lines,int bkcolor) { unsigned x_width=x2-x1+1; unsigned y_width; y_width=80*lines; _CX=y2-y1-lines+1; asm push ds asm push es asm mov ax,0a000h asm mov es,ax asm mov ds,ax asm mov ax,WORD PTR y2 asm mov dx,80 asm mul dx asm mov bx,ax asm add bx,WORD PTR x1 /* bx=y2*80+x1 */ asm mov dx,3ceh asm mov ax,0105h asm out dx,ax dnlp2: asm push cx _CX=x_width; asm mov di,bx /* di = destination offset.. */ asm mov si,di /* si = source offset .. */ asm sub si,y_width /* si=di-y_width */ asm cld asm REP movsb asm sub bx,80 /* bx is offset..bx=bx-80 */ asm pop cx asm loop dnlp2 asm mov dx,3ceh /* ÀÌÇϴ ĥÇϱ⠷çƾ.. */ asm mov ax,0205h asm out dx,ax asm mov al,BYTE PTR bkcolor _CX=lines; dnlp: asm push cx _CX=x_width; asm mov di,bx asm REP stosb asm pop cx asm sub bx,80 asm loop dnlp asm mov ax,0005h asm out dx,ax asm pop es asm pop ds } void hgVScrDown(int x1,int y1,int x2,int y2,int lines,int bkcolor) { int xs=x1/8+1; int xe=x2/8-1; unsigned char rmask=~get_mask(x2+1); if (!rmask) rmask=0xff; /* Ư¼öó¸® */ outport(0x3ce,0x0ff08); vgascrdown(xs,y1,xe,y2,lines,bkcolor); outportb(0x3ce,8); outportb(0x3cf,get_mask(x1)); vgascrdown(xs-1,y1,xs-1,y2,lines,bkcolor); outportb(0x3ce,8); outportb(0x3cf,rmask); vgascrdown(xe+1,y1,xe+1,y2,lines,bkcolor); outport(0x3ce,0xff08); } Á¶±Ý Á¤¸®¸¦ Çغ¸¸é ½ºÅ©·Ñ ¾÷ÀÇ °æ¿ì È­¸éÀ» À§·Î ¿Ã¸®´Â °Å´Ï±î DI=y1*80+x1.. SI=DI+lines*80 ·Î ³õ°í ÀÏ´Ü ÀúÀåÇÑÈÄ x_width ¸¸Å­ Áõ°¡Àü¼ÛÇÏ°í.. DI ¿Í SI ¸¦ º¹±ÍÇÑÈÄ 80 ¾¿ ´õÇØÁÝ´Ï´Ù. ÀÌ»óÀÇ ÀÏÀ» lines ¸¸Å­ ¹Ýº¹ÇÕ´Ï´Ù. ±×¸®°í ½ºÅ©·Ñ µÈ ºÎºÐÀ» ¹è°æ»öÀ¸·Î Ä¥ÇØÁÝ ´Ï´Ù. ½ºÅ©·Ñ ´Ù¿îÀÇ °æ¿ì È­¸éÀ» ¾Æ·¡·Î ³»·Á¾ß ÇϹǷΠDI=y2*80+x1..SI=DI-lines *80 À̶ó°í µÎ°í ÀÏ´ÜÀúÀåÇÏ°í Áõ°¡Àü¼ÛÇÕ ´Ï´Ù.±×¸®°í º¹±ÍÇÑÈÄ 80 ¾¿ »©ÁÝ´Ï´Ù. ÀÌ»óÀÇ ÀÏÀ» lines ¸¸Å­ ¹Ýº¹ ÇÏ¸é ½ºÅ©·ÑÀº ³¡³ª°í ³ª¸ÓÁö¸¦ ¹è°æ»öÀ¸·Î Ä¥ÇØÁÖ¸é µÇ°ÚÁÒ. ÈìÈì.. ±×·¯¸é ½ºÅ©·Ñ ¾÷/´Ù¿îµµ ³¡³µ³×¿ä.. ½ºÅ©·Ñ ÀÚü¿¡ ´ëÇÑ ¼³¸íÀº ¿¹Àü °­Á¸¦ ÂüÁ¶Çϼ¼¿ä... ±×·³..Ç㸣¹Ì!