Programming °æ (¾«»ªÇø)
·¢ÐÅÈË: lansh (²×º£Ò»ËÚ), ÐÅÇø: Programming
±ê Ìâ: Allegro ÓÎÏ·³ÌÐò¿â (ͼÐÎģʽ)
·¢ÐÅÕ¾: ¹þ¹¤´ó×϶¡Ïã (2002Äê09ÔÂ11ÈÕ20:03:37 ÐÇÆÚÈý), Õ¾ÄÚÐżþ
·¢ÐÅÈË: cloudwu (ÔÆ·ç), ÐÅÇø: GAME_Designer
±ê Ìâ: Allegro ÓÎÏ·³ÌÐò¿â (ͼÐÎģʽ)
·¢ÐÅÕ¾: BBS ˮľÇ廪վ (Wed May 13 08:37:43 1998)
______ ___ ___
/\ _ \ /\_ \ /\_ \
\ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
\ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
\ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
\ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
\/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
/\____/
\_/__/ 3.0 °æ
Ò»¸öÓÎÏ·³ÌÐò¿â
By Shawn Hargreaves, 1994/97
ÔÆ·ç Òë
http://www.nease.net/~cloudwu
E-mail: cloudwu@nease.net
========================================
============ ͼÐÎģʽ ============
========================================
void set_color_depth(int depth);
ÉèÖõãµÄ¸ñʽÀ´ÓÉËæºóµ÷Óà set_gfx_mode() ºÍ create_bitmap() ʱ
ʹÓÃ. ÓÐЧµÄÑÕÉ«Éî¶ÈÓÐ 8 (ȱʡֵ), 15, 16, 24, ºÍ 32 λ.
int set_gfx_mode(int card, int w, int h, int v_w, int v_h);
Çл»Í¼ÐÎģʽ. ²ÎÊý card ±ØÐëÊÇÒÔÏÂÖµÖеÄÒ»¸ö:
GFX_TEXT - ·µ»ØÎı¾Ä£Ê½
GFX_AUTODETECT - Èà Allegro Ñ¡ÔñÒ»¸öºÏÊʵÄͼÐÎÇý¶¯³ÌÐò
GFX_VGA - Ñ¡Ôñ VGA ģʽ 13h (320x200 »ò 320x100)
GFX_MODEX - Ñ¡ÔñƽÃæŤתµÄ(plannar tweaked) VGA ģʽ
GFX_VESA1 - ʹÓà VESA 1.x Çý¶¯³ÌÐò
GFX_VESA2B - ʹÓà VBE 2.0 ·ÖҳģʽÇý¶¯³ÌÐò
GFX_VESA2L - ʹÓà VBE 2.0 ÏßÐÎÒ³Ã滺³åÇý¶¯³ÌÐò
GFX_VBEAF - ʹÓà VBE/AF ¼ÓËÙÆ÷ API (δÍê³É)
GFX_XTENDED - ʹÓöÏÁ´Ê½(unchained) 640x400 ģʽÇý¶¯³ÌÐò
GFX_ATI - ʹÓà ATI 18800/28800 Çý¶¯³ÌÐò
GFX_MACH64 - ʹÓà ATI mach64 Çý¶¯³ÌÐò
GFX_CIRRUS64 - ʹÓà Cirrus 64xx Çý¶¯³ÌÐò
GFX_CIRRUS54 - ʹÓà Cirrus 54xx Çý¶¯³ÌÐò
GFX_PARADISE - ʹÓà Paradise Çý¶¯³ÌÐò
GFX_S3 - ʹÓà S3 Çý¶¯³ÌÐò
GFX_TRIDENT - ʹÓà Trident Çý¶¯³ÌÐò
GFX_ET3000 - ʹÓà Tseng ET3000 Çý¶¯³ÌÐò
GFX_ET4000 - ʹÓà Tseng ET4000 Çý¶¯³ÌÐò
GFX_VIDEO7 - ʹÓà Video-7 Çý¶¯³ÌÐò
²ÎÊý w ºÍ h Ö¸¶¨ÁËÄãÏëÒªµÄ ÁÄ»·Ö±æÂÊ. ¿ÉÄܵÄģʽÓÐ:
VGA 13h ģʽ, ´óСΪ 320x200 (256 É«), ʹÓà GFX_VGA Çý
¶¯³ÌÐò.Õâ¸öÔÚÈκΠVGA ϶¼Äܹ¤×÷, µ«ÊDz»Ö§³Ö´óµÄÐéÄâÆÁ
Ä»ºÍÓ²¼þ¹öÆÁ. Õâ¸öÇý¶¯³ÌÐò»¹ÌṩÁËË«Ïß 320x100 ģʽ,Ëü
ÄÜÔÚÕû¸ö 320x200 µÄÐéÄâÆÁÄ»Öйö¶¯.
Mode-X, ʹÓà GFX_MODEX Çý¶¯³ÌÐò. Õâ¸öÄܹ»ÔÚÈκΠVGA ¿¨
ÉϹ¤×÷, ÌṩÁËŤתµÄ(tweaked) ·Ö±æÂÊºÍ 256 ÖÖ²»Í¬µÄÑÕÉ«.
Îȶ¨µÄ mode-X ·Ö±æÂÊ:
Õý·½ÐÎÍâ¹ÛµÄ±ÈÀý: 320x240
³¤·½ÐÎÍâ¹ÛµÄ±ÈÀý: 256x224, 256x240, 320x200, 320x400,
320x480, 320x600, 360x200, 360x240,
360x360, 360x400, 360x480
ÕâЩÎÒÔÚËùÓеÄÏÔ¿¨µÄÏÔʾÆ÷É϶¼²âÊÔͨ¹ýÁË.
²»Îȶ¨µÄ mode-X ·Ö±æÂÊ:
Õý·½ÐÎÍâ¹ÛµÄ±ÈÀý: 360x270, 376x282, 400x300
³¤·½ÐÎÍâ¹ÛµÄ±ÈÀý: 256x200, 256x256, 360x600, 376x308,
376x564, 400x150, 400x600
ÕâЩֻÄÜÔÚ²¿·ÖÏÔʾÆ÷ÉϹ¤×÷. ËüÃÇ¿ÉÒÔÔÚÎÒµÄÀÏ
»úÆ÷ÉϹ¤×÷, µ«ÊÇÔÚÎÒµÄÐÂÏÔʾÆ÷ÉϹ¤×÷µÄ²»ÄÇôºÃ. Èç¹û
Äãµ£ÐÄʹÓÃÕâЩģʽ»á¶ÔÄãµÄÏÔʾÆ÷¿ÉÄÜÔì³ÉÉ˺¦, ÄÇô´ó
¿É²»±Ø. µ±È»ÎÒ²»ÄÜÏòÕâ¸öÌṩÈκεĵ£±£, Ò²ÐíÄãµÄÓ²¼þ
»¹ÊÇÉÕµôÁË,µ«ÊÇÎÒÏàÐÅÕâһϵÁÐ tweak ģʽ²»»áÔì³ÉÈκÎ
ΣÏÕ. Robert Schmidt µÄ TWEAK ³ÌÐòÎı¾ÀïдµÀ:
"һЩʱ¼äÒÔÇ°, ÏòÏÔ¿¨¼Ä´æÆ÷ÀïÖÃһЩ·Ç·¨»òÊDz»±»Ö§
³ÖµÄÖµ»ò×éºÏ¿ÉÄܶÔÄãµÄÏÔʾÆ÷ºÍÄãµÄ½¡¿µ¶¼ÊÇÒ»ÖÖð
ÏÕ. ÎÒ *´ÓÀ´Ã»ÓÐ* ÉùÃ÷Èç¹ûÄãʹÓà TWEAK ²»»áÓÐʲô
»µµÄÊÂÇé·¢Éú,È»¶øÎÒºÜÀÖÒâÏàÐŲ»»áÓÐ. ÎÒ´ÓÀ´Ã»ÓÐÌý
˵ÔÚÊÔ×ÅʹÓà TWEAK ÒÔÍâ»òÒ»°ãµÄ VGA Ťת(tweaking)
ʱÓÐʲôΣÏÕµÄÊÂÇé·¢Éú."
ÒòΪ¸´ÔӵķÖҳλͼ×éÖ¯·½Ê½, ËùÓÐµÄ mode-x »æͼº¯Êý¶¼±È
13h ģʽÂý, µ«ÊÇÕû¿éµÄÇøÓòÌî³äºÍƽÃæµ÷Õû·½Ê½µÄ´ÓÏÔ´æµÄ
Ò»²¿·Öµ½ÁíÒ»²¿·ÖµÄÒƶ¯Äܹ»¸ü¿ìµã, ÓÈÆäÊÇÔÚÀϵÄÓ²¼þÉÏ.
Mode-X ÄÜÑ°Ö· VGA RAM µÄÕû¸ö 256k ¿Õ¼ä, Òò´ËÓ²¼þ¹öÆÁºÍ
¶àÒ³Ãæת»»¾Í°ìµÄµ½ÁË, ËüÒ²¿ÉÒԷָÆÁÄ»À´ÊµÏÖÉϲ¿ÏÔʾ
²¿·ÖµÄ¹ö¶¯,¶øϲ¿·ÖÈ´¾²Ö¹ÓÃÀ´ÏÔʾһ¸ö״̬Ìõ.
»ù±¾ SVGA ģʽ, 640x480, 800x600, ºÍ 1024x768. ÕâЩÄÜ
¹»ÔÚÈκΠSVGA ¿¨ÉÏʹÓÃ: Èç¹û²»ÄÜÓÃ, ¾Í¸ãÌ× UniVBE ¿´¿´
ÄÜ·ñÓÃÁË. ÑÕÉ«µÄÉî¶ÈÒÀÀµÓÚÄãµÄÓ²¼þ. ËùÓеĿ¨¶¼Ö§³Ö 15
ºÍ 16 λµÄÑÕÉ«, µ«ÊÇÎÒ½¨ÒéÄã×îºÃÊÇÁ½¸ö¶¼È¥Ö§³Ö (Õâ²¢²»
ÄÑ...) ÒòΪÓпÉÄÜÓÐÒ»ÖÖ¿ÉÄܲ»ÄÜÓÃ. һЩ¿¨¶Ô 24 ºÍ 32
λÕæ²ÊÉ«¶¼ÌṩÁË, ÕâÑùÄã¾ÍÓÐ 24 (½ÚÔ¼ÄÚ´æ) ºÍ 32 (¸ü¿ì
һЩ) Á½ÖÖÑ¡Ôñ, µ«ÊÇÐí¶àÀÏ¿¨Ã»ÓÐ 32 λģʽ¶øһЩп¨È´
²»Ö§³Ö 24 λģʽ.ʹÓà VESAINFO ²âÊÔ³ÌÐòÀ´¿´¿´ÄãµÄ VESA
Çý¶¯³ÌÐòÌṩÁËÄÄЩģʽ. Ðí¶àÏÔ¿¨»¹Ö§³Ö 640x400,
1280x1024, ºÍ 1600x1200, µ«ÊÇÕâЩ²»ÊÇÔÚÈκεط½¶¼ÄÜÓÃ
µÄ, ±ÈÈç S3 оƬ¾ÍûÓÐ 640x400 ģʽ. ÆäËüµÄÆæÒìµÄ·Ö±æ
ÂÊÒ²ÓÐ, ±ÈÈç, һЩ Tseng °å¿ÉÒÔʵÏÖ 540x350, »¹ÓÐ
Avance Logic ÓÐ 512x512 ģʽ.
Xtended ģʽ, ÓÉ PCGPE µÄ Mark Feldman ÃèÊö, ´óСÊÇ
640x400 (256 É«) ʹÓà GFX_XTENDED Çý¶¯³ÌÐò. Õâ¸öʹÓÃ
VESA À´Ñ¡Ôñ SVGA ģʽ (ËùÒÔËüÖ»ÄÜÔÚÖ§³Ö VESA 640x400
·Ö±æÂʵĿ¨ÉϹ¤×÷), È»ºóÏó mode-X ÄÇÑù½« VGA Ó²¼þ×ö¶ÏÁ´
½Ó´¦Àí (unchain). ÕâʹµÃÕû¸öÆÁÄ»²»ÐèÒªÒ³Çл»Ñ°Ö·, µ«ÊÇ
Ó²¼þ¹öÆÁºÍ¶àÒ³Ãæת»»°ì²»µ½. Õâ¸öÇý¶¯³ÌÐòÓÀÔ¶²»»á±»×Ô¶¯
¼ì²âµ½ (È¡¶ø´úÖ®µÄÊÇÕý³£µÄ VESA 640x400 ģʽ),Òò´ËÈç¹û
ÄãÏëʹÓÃËü¾Í±ØÐëÃ÷È·µÄÏò set_gfx_mode() ´«Èë²ÎÊý
GFX_XTENDED.
UniVBE ÌṩÁËÒ»¸ö¿É¹öÆÁµÄµÍ·Ö±æÂʲ»Í¬ÑÕÉ«Éî¶ÈµÄģʽ
(320x200, 320x240, 320x400, 320x480, 360x200, 360x240,
360x400, ºÍ 360x480 ¶¼¿ÉÒÔÔÚÎÒµÄ ET4000 ÉÏÒÔÿµã 8,15,
»ò 16 λ ¹¤×÷). ÕâЩºÜ¿É°®, ÈÃÎÒÃDz»±ØʹÓø´ÔÓµÄmode-X
ƽÃæÉèÖþͿÉÒÔʵÏÖ¹ö¶¯ºÍ¶àÒ³ÃæÇл». ¿ÉϧµÄÊÇËüÃDz»ÊÇ»ù
±¾Ä£Ê½, ËùÒÔÄãÐèÒª UniVBE À´Ê¹ÓÃËüÃÇ.
VBE/AF ÊÇ VBE 2.0 »ù±¾Ä£Ê½µÄ³¬¼¯, ËüÌṩÁËÒ»¸ö API À´
ÀûÓÃÓ²¼þ¼ÓËÙÌØÐÔ. VBE/AF ÏÖÔÚÖ»Äܱ» UniVBE Ö§³Ö, ¶øÇÒ
SciTech ÏÖÔÚÖ»ÔÚ Mach64 оƬÉÏʵÏÖÕâ¸ö¹¦ÄÜ. Allegro¾¡
¿ÉÄܵÄÖ§³ÖÎÒÔÚ×Ô¼ºµÄ»úÆ÷ÉϲâÊÔÁ˵Ļù±¾²¿·Ö, ¼´Ã»ÓмÓ
ËٵĻæͼģʽ. ÎÒÕæµÄºÜÏëÈÃÕâ¸öÇý¶¯³ÌÐòÖ§³Ö¼ÓËÙº¯Êý,µ«
ÊÇÖ»ÓÐµÈ SciTech ÔÚ Matrox Mystique ÉϼÓÈëÕâ¸ö¹¤¾ßÁË,
»òÕßÓÐÈËΪÎÒÂò¿é Mach64 (½¨Òé ½¨Òé :-)
²ÎÊý v_w ºÍ v_h Ö¸¶¨ÁË×îСÐéÄâÆÁÄ»µÄ´óС, ÒòΪÄãÐèÒªÒ»¸ö´ó
µÄÐéÄâÆÁÄ»À´×öÓ²¼þ¹öÆÁ»ò¶àÒ³ÃæÇл». Èç¹ûÄã²»ÔÚºõÐéÄâÆÁÄ»µÄ
´óС¾ÍÓ¦¸Ã½«ËüÃÇÉèΪÁã. ÐéÄâÆÁÄ»»ØÔì³ÉÐí¶à»ìÂÒ, µ«ÊÇËüÃÇÕæ
µÄºÜ¼òµ¥. ÁôÉñ: ¼¼Êõ˵Ã÷À´ÁË, ËùÒÔÄã¿ÉÒÔÌø¹ýÕâÒ»¶ÎµÄʣϲ¿
·Ö :-) ½«ÏÔʾÄÚ´æÏëÏó³ÉÒ»ÕžØÐεÄÖ½, ͨ¹ýÒ»¸öÉÏÃæÓÐÒ»¸öС
¶´(ÄãµÄÏÔʾÆ÷)µÄ¿¨Æ¬À´¿´Ëü. ¼ÈȻֽ±È¶´Òª´ó, ÄãÔÚÈκÎʱºò¾Í
Ö»ÄÜ¿´¼ûÖ½µÄÒ»²¿·Ö, µ«ÊÇÒƶ¯¿¨Æ¬Äã¾ÍÄܸı俴µ½µÄ¾°Ïó. ÄãÄÜ
½«¶´·ÅÔÚÒ»¸öµØµã¶ø¸±ÂÔÏÔʾÄÚ´æÆäËü¿´²»¼ûµÄ²¿·Ö, µ«ÊÇÄã¿ÉÒÔ
ÀûÓÃÒƶ¯ÆÁÄ»´°¿ÚÀ´ÊµÏÖÐí¶àÓÐÓõÄЧ¹û, »òÕß¿ÉÒÔÔÚÏÔ´æÒþ²ØµÄ
²¿·ÖÏÈ»ºÃͼƬȻºóÇл»¹ýÈ¥À´ÏÔʾËüÃÇ. ¾Ù¸öÀý×Ó, ÄãÑ¡ÔñÁËÒ»
¸öÐéÄâÆÁĻΪ 1024x1024 µÄ 640x480 ģʽ, È»ºó¿ÉÒÔÔÚÕâ¸ö´óÇø
ÓòÉÏÒƶ¯¿ÉÊӵIJ¿·Ö. ³õʼ»¯Ê±, ¿ÉÊÓ²¿·ÖÔÚÏÔ´æµÄ×óÉϽÇ, Õâ¸ö
ÉèÖÿ´ÆðÀ´ÏóÕâÑù:
(0,0)------------(640,0)----(1024,0)
| | |
| ¿ÉÊÓÆÁÄ»²¿·Ö | |
| | |
(0,480)----------(640,480) |
| |
| ÏÔ´æµÄÆäËü²¿·Ö |
| |
(0,1024)--------------------(1024,1024)
ÕâÊÇʲô? ÄãÕýÔÚÓÃÏà³ÆµÄ×ÖÌåÀ´ÏÔʾ? ºÇºÇ.
µ±Äãµ÷Óà set_gfx_mode() ʱ, v_w ºÍ v_h ²ÎÊýÌṩÄãµÄ³ÌÐòÄÜ
¹»½ÓÊܵÄ×îСÐéÄâÆÁÄ»µÄ´óС.´óСµÄ·¶Î§Í¨³£ºÜÊÜÏÞÖÆ,Allegro
Ò»°ã×îÖջᴴ½¨Ò»¸ö±ÈÄãÒªÇóÒª´óµÄ¶àµÄÐéÄâÆÁÄ».ÔÚ SVGA ¿¨ÉÏ
Ò»Õ×µÄÏÔ´æÄܹ»ÈÃÄã´´½¨ 1024x1024 µÄÐéÄâÆÁÄ» (256 É«) »òÊÇ
1024x512 (15 »ò 16 bpp), ¶ø 512k ÏÔ´æÄã¿ÉÒԵõ½ 1024x512
(256 É«). ÆäËüµÄ´óС¿ÉÄÜ»ò²»¿ÉÄܵõ½: ²»Òª¼Ù¶¨ËüÃÇÄܹ¤×÷.
ÔÚ mode-X ÏÂÐéÄâÆÁÄ»µÄ¿í¶È¿ÉÒÔÊÇÎïÀíÆÁÄ»¿í¶ÈµÄ 8X ±¶»òÊÇ
ÓëÖ®Ïàͬ, ÓÚÊÇÄ£Äâ¸ß¶È¾Í±»ÏàÓ¦µÄÉèÖÃÁË ( VGA ÓÐ 256K ÏÔ´æ,
ËùÒÔÐéÄâ¸ß¶È½«ÊÇ 256*1024/ÐéÄâ¿í¶È). ÔÚÄãÑ¡ÔñÒ»¸öͼÐÎģʽ
ÒÔºó, ÎïÀíµÄºÍÐéÄâµÄÆÁÄ»´óС¿ÉÒÔÓúê SCREEN_W(),
SCREEN_H(), VIRTUAL_W(),ºÍ VIRTUAL_H()À´²âµÃ.Èç¹û Allegro
²»ÄÜÑ¡ÔñÒ»¸öºÏÊʵÄģʽ, set_gfx_mode() ½«·µ»ØÒ»¸ö¸ºÊý²¢ÇÒ
½«ÎÊÌâµÄÃèÊö´¢´æÔÚ allegro_error Àï. ·ñÔòËü·µ»ØÁã.
int scroll_screen(int x, int y);
³¢ÊÔÓ²¼þ¹ö¶¯ÆÁÄ»À´ÏÔʾÐéÄâÆÁÄ»µÄ²»Í¬²¿·Ö (³õʼ»¯Ê±Î»ÖÃÔÚ
0,0, ¾ÍÊÇ×óÉϽÇ). ³É¹¦Ôò·µ»ØÁã: Èç¹ûͼÐÎÇý¶¯³ÌÐò²»ÄÜ×öÓ²
¼þ¹öÆÁ»òÕßÐéÄâÆÁÄ»²»¹»´óÔòËü¿ÉÄܳö´í. Èç¹ûͼÐο¨ÐèÒªÕâ¸ö
º¯Êý½«µÈ´ý´¹Ö±»Øɨ, Òò´ËÄã²»±Ø×Ô¼ºµ÷Óà vsync(). Äã¿ÉÒÔʹ
ÓÃÕâ¸öÀ´°ÑÄãµÄÆÁÄ»ÔÚ´óµÄÐéÄâÆÁÄ»ÖÐÒƶ¯, »òÕßÔÚÐéÄâÆÁÄ»µÄ
Á½¸ö²»ÖصþµÄ²¿·Ö¼ä½øÐÐÒ³Çл». ×¢ÒâÔÚÆÁĻλͼÉϳ¬³öÔʼ×ø
±ê×÷»Ê±, Äã±ØÐë¸Ä±ä¼ô²Ã¾ØÐÎ: ¼ûºó. Mode-X ¹öÆÁÊÇ¿ÉÐŵÄ,
Ëü¿ÉÒÔÔÚÈκο¨ÉϹ¤×÷. ¿ÉϧÐí¶à VESA ¹¤¾ß (°üÀ¨ UniVBE!)
Ö»ÄÜ´¦ÀíˮƽÉ쵀 4 µãµÝÔö¹ö¶¯, ËùÒÔƽ»¬µÄˮƽ¹ö¶¯ÊDz»¿É
ÄܵÄ. ÕâÕæÊDzÑÀ¢, µ«ÊÇÎÒûÓа취½â¾öËü. ´ó¶àÊý VESA ¹¤¾ß
ËƺõÔÚÕæ²ÊģʽϵĹö¶¯¶¼Óзdz£¶àµÄ bug, Òò´ËÎÒ½¨ÒéÄã²»Òª
ÒÀÀµÕâ¸öÀý³ÌÀ´ÕýÈ·µÄ½øÐÐÕæ²ÊģʽϵĹöÆÁ,³ý·ÇÄãÈ·ÈÏ
UniVBE ÒѾ¼ÓÔØÁË.Allegro ½«ÔÚ¹ö¶¯ÆÁĻʱ½øÐбØÒªµÄ´¹Ö±»Ø
ɨͬ²½, Òò´ËÄã²»±ØÔÚÌõÓÃÇ°Ãæµ÷Óà vsync(). ÕâÒâζ×Å
scroll_screen() ºÍ vsync() Ôì³ÉµÄÑÓʱʱ¼äÏàͬ.
void request_modex_scroll(int x, int y);
Õâ¸öº¯ÊýÖ»ÄÜÔÚ mode-X ÏÂʹÓÃ, ´¹Ö±»ØɨÖжÏÄ£ÄâÆ÷Òª±»¼¤»î.
ËüÇëÇóÓ²¼þ¹öÆÁµ½Ö¸¶¨Î»ÖÃ, µ«ÊÇÂíÉÏ·µ»Ø¶ø²»ÊǵȴýÒ»´Î»Øɨ.
Õâ¸ö¹ö¶¯½«ÔÚÏ´δ¹Ö±»ØɨÖб»ÊµÏÖ. Õâ¸öº¯Êý×÷Èý»º³åʱºÜÓÐ
ÓÃ (¼û examples/ex20.c).
int poll_modex_scroll();
Õâ¸öº¯ÊýÖ»ÄÜÔÚ´¹Ö±»ØɨÖжÏÄ£ÄâÆ÷±»¼¤»îʱʹÓÃÔÚ mode-X
ÉÏ. Èç¹ûÓ²¼þ¹öÆÁÔÚ֮ǰ±» request_modex_scroll() ÉèÖöø»¹
ÔڵȴýʵÏÖËü½«·µ»Ø·ÇÁãÖµÈç¹ûÒѾ¹ö¶¯ÒѾ·¢ÉúÔò·µ»ØÁã.
void split_modex_screen(int line);
Õâ¸öº¯ÊýÖ»ÔÚ mode-X ÏÂÓÐЧ. Ëü½«ÔÚÖ¸¶¨Ðн« VGA µÄÏÔʾ·Ö
³ÉÁ½¸ö²¿·Ö. ÆÁÄ»ÉÏÃæµÄ²¿·Ö¿ÉÒÔÀûÓà scroll_screen() º¯Êý
±»¹ö¶¯µ½ÏÔ´æµÄÈÎÒⲿ·Ö,¶øÖ¸¶¨ÐÐÏÂÃæµÄ²¿·Ö½«±»±£Áô²¢ÇÒÖØ
ÆÁĻλͼµÄ×ø±ê (0,0) ¿ªÊ¼ÏÔʾ. ÔÚ·Ö¸îÆÁÄ»ÒÔºóÄãÒ»°ãÏë¹ö
¶¯ËùÒÔÉÏÃæµÄ²¿·ÖÊÇ´Ó½ÓÏÂÀ´µÄÏԴ濪ʼÏòÏÔ´æºóÃæÑÓÉì,È»ºó
´´½¨Á½¸ö×ÓλͼÀ´¿ØÖÆÕâÁ½¸ö²¿·Ö (¼û examples/ex19.c ¿´¿´
ÕâЩÊÇÔõÑùÔË×÷µÄÑÝʾ). ¹Øµô·Ö¸îÓà split_modex_screen(0).
--
http://www.nease.net/~cloudwu
http://computer.igd.edu.cn/~cloud
E-mail: cloudwu@163.net
--
ÈËÉúµÃÒâÐ辡»¶£¬ÄªÊ¹½ðé׿նÔÔ¡£
ÌìÉúÎҲűØÓÐÓã¬Ç§½ðÉ¢¾¡»¹¸´À´¡£
¡ù À´Ô´:¡¤¹þ¹¤´ó×϶¡Ïã bbs.hit.edu.cn¡¤[FROM: hitsat.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
Ò³ÃæÖ´ÐÐʱ¼ä£º205.472ºÁÃë