ã±ã€ããã«ãã³ãšã¶ãã¯ããŒãã¯ãã²ãŒã ã¹ã¿ãžãªã¶ãã¯ãããã¯ã¹ã®éçºè ã§ãã 25æ³ã®ã³ã³ãã¥ãŒã¿ãŒåãã®ã²ãŒã äœæã«é¢ããè€éãªæè¡èšäºãã奜ããªãã SpaceChem ã Infinifactory ã TIS-100ãããã³SHENZHEN I / Oã® ããºã«ã²ãŒã ããå§ãããŸã ã
éãã
ã®ã¬ãã€ãã®RAMãšãã«ã«ã©ãŒHDãã£ã¹ãã¬ã€ãåããææ°ã®ã³ã³ãã¥ãŒã¿ãŒçšã®ã²ãŒã ãäœæããããšã«æ £ããŠãã2人ã®ããã°ã©ããŒã¯ãã²ãŒã ãMS-DOSã«ç§»æ€ã§ããŸããïŒ ç§ãã¡ã®èª°ããã®ãããªå€ãæ©åšã®éçºçµéšã¯ãããŸããã§ãããã人工çã«å¶éãããã·ã¹ãã ã§ã®äœæ¥ã¯Zachtronicsã²ãŒã ãã¶ã€ã³ã®åºç€ã§ãããããè©Šããªããã°ãªããŸããã§ããïŒ
ãã®ãããžã§ã¯ãã¯ãZackãSHENZHEN I / Oã²ãŒã ïŒ ã¹ã¿ã³ãã¢ãã³ã²ãŒã ãšããŠã販売ïŒã®ãœãªãã£ã¢ããã²ãŒã ã§ããSHENZHEN SOLITAIREã¬ã€ã¢ãŠããäœæããããšããå§ãŸããŸããã 256è²VGAãã£ã¹ãã¬ã€ã§ãœãªãã£ã¢ãã©ã®ããã«èŠãããã次ã«ç€ºããŸãã
90幎代åæã®PCç»é¢ã§èŠãããšãã§ããã²ãŒã ã®ããã«èŠããŸãïŒ ããã§ãã³ãŒããäœæããã ãã§ãã
éçºç°å¢
æåã«ãå€ä»£ã®DOSã³ã³ãã¥ãŒã¿ãŒã§å®è¡ã§ããããã°ã©ã ã®æžãæ¹ãç解ããå¿ èŠããããŸãã ã¿ãŒã²ããæ©åšã¯ãZachã³ã¬ã¯ã·ã§ã³ã®ãã³ããŒãžIBMäºæPCã§ãã
- åšæ³¢æ°20 MHzã®Intel 80386SXããã»ããµ
- 5 MBã®RAM
- VGAã«ãŒã
- 3.5ã€ã³ããã©ã€ã
- ã·ãªã¢ã«ããŠã¹
- MS-DOSããŒãžã§ã³6.22
ãã®æ代ã®ãã·ã³ã®ããã°ã©ãã³ã°èšèªã®å¯äžã®åŠ¥åœãªããŒãžã§ã³ã¯Cã§ããã²ãŒã å šäœãx86ã¢ã»ã³ããªèšèªã§æžãã€ããã¯ãããŸããã§ããïŒ äœæ¥ããŒã«ã®ããŸããŸãªãªãã·ã§ã³ã«ã€ããŠèããåŸã1992幎ã«ãªãªãŒã¹ãããBorland C ++ 3.1ã«æ±ºããŸããã DOSBoxã§èµ·åBorland C ++ã¯ãã¿ãŒã²ãããã·ã³ã®äŸ¿å©ã§æ£ç¢ºãªãšãã¥ã¬ãŒã·ã§ã³ãæäŸããŸããã
ã°ã©ãã£ãã¯ã¹
VGAã°ã©ãã£ãã¯ã¹ãæèŒããã³ã³ãã¥ãŒã¿ãŒã«ã¯ãããã€ãã®ã¬ã³ããªã³ã°ã¢ãŒãããããŸããã 人æ°ã®ããã·ã³ãã«ãªãªãã·ã§ã³ã¯ã ã¢ãŒã13hã§ããã解å床320 x 200ãã¯ã»ã«ã256è²ã ããé£ãããªãã·ã§ã³ã¯ãéå ¬åŒã®Mode Xã¢ãŒãã§ã解å床ã¯320 x 240ãã¯ã»ã«ã§ããã ã€ã³ã¿ãŒãããã®ã¢ãŒã13hã«ã¯å€ãã®ããã¥ã¢ã«ãããããã®ããã°ã©ãã³ã°ã¯éåžžã«ç°¡åã§ãã320x200ãã¯ã»ã«ã¯64,000ãã€ãã®é åã§è¡šãããåãã€ãã¯1ãã¯ã»ã«ãè¡šããŸãã ã¢ãŒãXã¯ããäžæè°ã§äœ¿ãã«ããã§ãããæãããªå©ç¹ããããŸãã320x 240ã®è§£å床ãæ£æ¹åœ¢ãã¯ã»ã«ã®æ°å°ãªãVGA解å床ã®1ã€ã§ãã ãŸãããã¬ããããéžæããã256è²ã§ã®ã¬ã³ããªã³ã°ããµããŒãããŠããŸãã ã»ãšãã©ã®è²ã¯ãã©ã®VGAã¢ãŒãã§ã䜿çšã§ããŸãã ç§ãã¡ã¯ã°ã©ãã£ãã¯ã¹ãããè¯ãããä»äºãè€éã«ãããã£ãã®ã§ãããªããªããããã倧奜ãã ããã§ãã ãããã£ãŠãã¢ãŒãXã䜿çšããããšã«ããŸããã
ãã®ãããå€ãã®ãã¯ã»ã«ãšè²ã®ã°ã©ãã£ãã¯ã¢ãŒãããããŸãïŒåœæã®ã³ã³ãã¥ãŒã¿ãŒçšïŒã äœãæç»ããŸããïŒ æãéèŠãªèŠçŽ ã¯æ¬¡ã®ãšããã§ãã
- ãã«ã¹ã¯ãªãŒã³ã®èæ¯ïŒãã¹ã¯ãããã®å£çŽãã°ãªãŒã³ã«ãŒãããŒãã«ïŒ
- ã«ãŒãïŒå°å³ã¢ã€ã³ã³ãš3è²ã®ã«ãŒãäžã®æ°åãå«ãïŒ
- ããã¹ãïŒãã¿ã³ãšã©ãã«çšïŒ
ãªãªãžãã«ã®SHENZHEN SOLITAIREããŒãžã§ã³ããããããã¹ãŠã®ãªãœãŒã¹ã®é«è§£å床ãã«ã«ã©ãŒããŒãžã§ã³ãæ¢ã«ãããŸããããã¯ããã«äœã解å床ã«å€æããåèšã§256è²ä»¥äžã§äœ¿çšããå¿ èŠããããŸãã ããã€ãã®ããªãã¯ã«ãã£ãŠããã®ãããªå€æã¯äžå¯èœã§ãããPhotoshopã§ã®ããããã·ã³ãã«ãã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ã®æååæç»ã解å床ã®ã¹ã±ãŒãªã³ã°ãããã³èæ¯ã®ã«ã©ãŒãã¬ããã䜿çšããŠæ°æéäœæ¥ããã ãã§ããã
ããã§ãã¢ãŒãXã®äž»ãªæ¬ ç¹ãéèŠã«ãªããŸãã320x 240ãã¯ã»ã«ãè¡šçŸããã«ã¯ã76 800ãã€ããå¿ èŠã§ãã VGAã«ãŒãã«ã¯åèš256ãããã€ãã®ãããªã¡ã¢ãªããããŸããããããã64 kBã®4ã€ã®ããã¬ãŒã³ãã«åå²ãããŠããŸãã äžåºŠã«ã¢ã¯ã»ã¹ã§ããã®ã¯ãã®ãã¡ã®1ã€ã ãã§ã*ã ããã¯ã64,000ãã€ãããå¿ èŠãšããªãã¢ãŒã13hã«éåžžã«é©ããŠããŸãããã¢ãŒãXã§ã¯ããããªããŒã¿ãè€æ°ã®ãã¬ãŒã³ã«åå²ããå¿ èŠããããŸãã
*ãã¹ãŠãå°ãè€éã§ããã¢ãŒã13hãå«ãäžéšã®VGAã¢ãŒãã§ã¯ãè€æ°ã®ãã¬ãŒã³ã«åæã«ã¢ã¯ã»ã¹ã§ããŸããããã®ã¢ãããŒãã«ã¯æ¬ ç¹ããããŸãã ã¢ãŒãXã§ã¯ãããã°ã©ãã¯äžåºŠã«1ã€ã®ãã¬ãŒã³ã«ããã¢ã¯ã»ã¹ã§ããŸããã
ãã®æç¹ã§ãã°ã©ãã£ãã¯ã³ãŒãã¯è€éã«èŠãå§ãããããVGAã«é¢ããæé«ã®ç¥èæºã§ããMichael Abrashã®ã°ã©ãã£ãã¯ããã°ã©ãã³ã°ãã©ãã¯ããã¯ã«ç®ãåããŸããã Black Bookã説æããŠããããã«ãã¢ãŒãXã¯ãã¯ã»ã«ããŒã¿ã4ã€ã®ãã¬ãŒã³ã«åå²ããŸãã åãã¬ãŒã³ã«ã¯ããã¯ã»ã«ã®4åã®1ã亀äºã®ãã¿ãŒã³ã§æ ŒçŽãããŸãã ãã¬ãŒã³0ã§ã¯ããã¯ã»ã«0ã4ã8ã12ãªã©ãæ ŒçŽãããŸãã ãã¬ãŒã³1ã«ã¯ããã¯ã»ã«1ã5ã9ã13ãªã©ãæ ŒçŽãããŸãã
ããã¯ã²ãŒã ããã°ã©ãã³ã°ã®å€å žçãªç¶æ³ã§ããäœæããå¿ èŠãããåºåãããã£ãŠãããããå ¥åããŒã¿ïŒãã®å Žåã¯ç»åïŒã®æ§é åæ¹æ³ã®éžæã¯ãã¬ã³ããªã³ã°ã³ãŒãã®è€éããšé床ã«å€§ããªåœ±é¿ãäžããŸãã 幞ããªããšã«ãAbrashã®æ¬ã«ã¯ãã¢ãŒãXã§ã®å¹ççãªã¬ã³ããªã³ã°ã®ããã®äŸ¿å©ãªãã³ãããããããããŸããç»é¢å šäœã4ã€ã®ãã¬ãŒã³ã«åå²ãããŠããããããã¬ãŒã³éã®åãæ¿ãã¯æ¯èŒçé ããæã䟿å©ã§ãïŒãããŠé«éã§ãïŒ ïŒãªãã·ã§ã³-åç»åã4ã€ã®ããŒã¿ãããã¯ã«åå²ããåãã¬ãŒã³ã®ããŒã¿éšåã1ã€ã®é£æ¥ãããã©ã°ã¡ã³ãã«å«ãŸããããã«ããŸãã ããã«ãããã³ãŒãã¯ä¿¡ããããªãã»ã©ã·ã³ãã«ã§ãå¯èœãªéãé«éã«ãªããŸãã 以äžã¯ããã«ã¹ã¯ãªãŒã³ïŒ320 x 240ïŒç»åãVGAã¡ã¢ãªã«ã¬ã³ããªã³ã°ããã³ãŒãã§ãã
// : VGA void far *vgaMemory = MAKE_FAR_POINTER(0xA000, 0x0000); short bytesPerPlane = (320 / 4) * 240; for (plane = 0; plane < 4; plane++) { SetCurrentVgaPlane(plane); _fmemcpy(vgaMemory, imageData, bytesPerPlane); imageData += bytesPerPlane; }
ãã®ã³ãŒãã¯ã16ãããDOSããã°ã©ã ãäœæããéã«å¯ŸåŠããªããã°ãªããªãå¥åŠãªç¹ãããã€ã瀺ããŠããŸãã 16ããããã€ã³ã¿ãŒã䜿çšãããšã64 KBã®ã¡ã¢ãªã®ã¿ã«çŽæ¥ã¢ã¯ã»ã¹ã§ããŸãã ïŒãããã¯ãè¿ãã®ããã€ã³ã¿ãŒã§ããïŒãã ããã»ãšãã©ã®DOSããŒã¹ã®ã³ã³ãã¥ãŒã¿ãŒã«ã¯ããã«å€ãã®ã¡ã¢ãªããããVGAã¡ã¢ãªã«é¢é£ããã¢ãã¬ã¹ã¯æ¢ã«64 kBãå æããŠããŸãã ã¢ã»ã³ãã©ã§ã¯ããã®åé¡ã¯ã»ã°ã¡ã³ãã¬ãžã¹ã¿ã䜿çšããŠåŠçãããŸãã Cã¯éåžžãããã¡ãŒãã€ã³ã¿ãŒããã€ãŸã1ã¡ã¬ãã€ããžã®ã¢ã¯ã»ã¹ãèš±å¯ãã32ãããã¿ã€ãã®ãã€ã³ã¿ãŒã䜿çšããŸãã ïŒ32ãããããã»ããµã®ç»å Žã«ãããã»ã°ã¡ã³ãã¬ãžã¹ã¿ãæ°ã«ããã«4 GBã®ã¡ã¢ãªã«ã¢ã¯ã»ã¹ã§ããããã«ãªã£ãããã人çã¯ãã£ãšæ¥œã«ãªããŸãããïŒ
幞ããªããšã«ã64 kBã¯éåžžã«å€ããã²ãŒã å šäœã®ã»ãšãã©ããã®ãã¬ãŒã ã¯ãŒã¯ã«é©åããŠããŸãã é·ããã€ã³ã¿ã®äœ¿çšãå¿ èŠãªã³ãŒãã¯2ã€ã ãã§ãã æåã«è¿°ã¹ããšãããVGAã¡ã¢ãªã¯ã¢ãã¬ã¹0xA0000ãã64ãããã€ãã®ç¯å²å šäœã«ãããŸãã 2çªç®ã®ãã©ã°ã¡ã³ãã¯ç»åããŒã¿ã§ãã ãã¹ãŠã®ã°ã©ãã£ãã¯ã¹ã1ãã¯ã»ã«ããã1ãã€ãã§äœè§£å床ã«å€æãããšã1ã€ã®å€§ããªãã¡ã€ã«ã«çŽ250 KBã®ç»åããŒã¿ãä¿åãããŸãã ããã¯64 kBãè¶ ãããããé·ããã€ã³ã¿ãŒãå¿ èŠã§ããã ããã«ããã®éšåã¯ãåçã¡ã¢ãªå²ãåœãŠã䜿çšããã³ãŒãå ã®å¯äžã®éšåã§ããã
ã¡ã¢ãªç®¡ç
å€ãã®Cããã°ã©ã ã®ãšã©ãŒãšè€éãã®äž»ãªåå ã¯ãåçã«å²ãåœãŠãããã¡ã¢ãªç®¡çã§ãã æ·±Shenzhenãœãªãã£ã¢ã§ã¯ããã¹ãŠãã·ã³ãã«ã«ããŸããã远跡ããå¿ èŠãããã«ãŒãã®æ°ãæ£ç¢ºã«ç¥ã£ãŠãããããäºåã«ã¡ã¢ãªãå²ãåœãŠãŸããã ã³ãŒãã«ãšã©ãŒãåŒãèµ·ããå¯èœæ§ã®ãã
malloc()
åŒã³åºãã¯ãããŸããããŸããå¿ããããšã®ã§ãã
free()
åŒã³åºãã¯ãããŸããã ïŒã²ãŒã ã®æ®ãã®ç¶æ ã«ãåãæŠç¥ãé©çšãããŸããïŒãœãªãã£ã¢ãšã³ãžã³ã®ç¶æ ã¯æ¬¡ã®ããã«ãªããŸãã
// : struct CardOrCell { byte Suit; byte Value; byte CellType; struct CardOrCell *Parent; struct CardOrCell *Child; }; CardOrCell Cards[NUM_CARDS]; CardOrCell FreeCells[NUM_FREE_CELLS]; CardOrCell FoundationCells[NUM_FOUNDATION_CELLS]; CardOrCell TableauCells[NUM_TABLEAU_CELLS]; CardOrCell FlowerCell; CardOrCell *DraggedCard;
åè¿°ããããã«ããã®æŠç¥ã䜿çšã§ããªãã£ãã®ã¯ç»åããŒã¿ã®ã¿ã§ãã64kBãã¯ããã«è¶ ããŠããããã§ãã ãããã£ãŠããã¹ãŠã®ç»åã1ã€ã®å€§ããªãã¡ã€ã«ã«ä¿åãïŒäžèšã§èª¬æããããã«ãç»åããŒã¿ã¯4ã€ã®ãã¬ãŒã³ã«åå²ãããŸããïŒãã²ãŒã ãããŒããããšãã«ããŒãããŒã衚瀺ããŠããŒãããŸããã
// : // , // , . FILE *f = fopen("SHENZHEN.IMG", "rb"); assert(f); long size = GetSizeOfFile(f); ImageData = farmalloc(size); assert(ImageData); long loaded = 0; byte huge *dest = ImageData; while (loaded < size) { long result = fread(dest, 1, 1024, f); assert(result != 0); loaded += result; dest += result; // ( ) } fclose(f);
ããã°ã©ã å šäœã§äœ¿çšãããããç»åããŒã¿ã«å²ãåœãŠãããã¡ã¢ãªã¯æ±ºããŠè§£æŸãããŸããã
ããŒãã³ãŒãã«ã¯é¢çœã詳现ããããŸããããŒãããã»ã¹ã®ããŒã®äžã«ããããŒãç»é¢ã«ãããŒãããŽãæç»ããŸãã ãã ããç»åããŒã¿ãèªã¿èŸŒãåã«èªã¿èŸŒã¿ç»é¢ãæç»ããŸãïŒ ãã®åŸªç°äŸåã«å¯ŸåŠããããã«ãç¹å¥ãªã«ãŒã«ãã€ã¡ãŒãžããŒã¿ããã±ãŒãžããã°ã©ã ã«è¿œå ããŸããããŸããããŒãããŽã®ã€ã¡ãŒãžããŒã¿ãé 眮ããŸãã ã²ãŒã éå§åŸãæåã®1ã2ç§ã§èªã¿èŸŒãŸããæ®ãã®èµ·åããã»ã¹äžã«è¡šç€ºãããŸãã
// : bool logoDrawn = false; while (loaded < size) { ... // : if (!logoDrawn && loaded > ImageOffsets[IMG_BOOT_BACKGROUND + 1]) { Blit(IMG_BOOT_BACKGROUND, 101, 100); logoDrawn = true; } }
ç»åã®ååŠç
ã¬ã³ããªã³ã°æã«ç»åããŒã¿ãèŠã€ããŠäœ¿çšããã«ã¯ã©ãããã°ããã§ããïŒ ã²ãŒã ã§äœ¿çšããããã¹ãŠã®ç»åã¯ãææ°ã®ãœãããŠã§ã¢ã§äœæãããPNGãã¡ã€ã«ã«ä¿åãããŸããã ãããã®PNGã¯ãç¹å¥ãªã³ã³ãã³ãã®ããŒãã³ã°ããã°ã©ã ã§åŠçãããŸããã ã³ã³ãã³ããã£ã¹ã¿ãŒã¯ãPNGã16ãããDOSããã°ã©ã ã§ç°¡åã«åŠçã§ãã圢åŒã«å€æããŸããã ãã®å Žåã3ã€ã®ãã¡ã€ã«ãäœæãããŸããïŒãã¬ããã€ã³ããã¯ã¹ã®åœ¢åŒã§ãã¹ãŠã®ãã¯ã»ã«ããŒã¿ãå«ã倧ããªãã€ããªãã¡ã€ã«ããã¹ãŠã®ç»åã«å ±éã®256è²ãã¬ãããå«ãå°ããªãã€ããªãã¡ã€ã«ãããã³ç»åã«ååãä»ããŠããŒã¿ãæ€åºã§ããã¡ã¿ããŒã¿ãå«ãCããããŒãã¡ã€ã«ã ã¡ã¿ããŒã¿ã¯æ¬¡ã®ããã«ãªããŸãã
// : , // #define IMG_BUTTON 112 #define IMG_BUTTON_HOVER 113 #define IMG_CARD_FRONT 114 // ID ... long ImageOffsets[] = { 0L, 4464L, 4504L, 4544L, ... }; short ImageWidths[] = { 122, 5, 5, 5, ... }; short ImageHeights[] = { 36, 5, 5, 5, ... }; byte huge *ImageData = /* */
ã³ã³ãã³ããã£ã¹ã¿ãŒã«ãã£ãŠåŠçãããåPNGãã¡ã€ã«ã«å¯ŸããŠãIDïŒIMG_CARD_FRONTãªã©ïŒãå²ãåœãŠãããŒã¿ã®å¹ ãé«ããããã³å Žæãèšé²ããŸãã ç»åãæç»ããã«ã¯ãããšãã°BlitïŒIMG_CARD_FRONTãxãyïŒãªã©ã®æç»é¢æ°ãåŒã³åºããŸãã 次ã«ãã¬ã³ããªã³ã°é¢æ°ã¯ImageInfoïŒIMG_CARD_FRONTã...ïŒãåŒã³åºããŠãç»åããŒã¿ãšã¡ã¿ããŒã¿ãååŸããŸãã
// : void ImageInfo(short imageID, short *w, short *h, byte huge **image) { assert(imageID >= 0 && imageID < IMAGE_COUNT); *w = ImageWidths[imageID]; *h = ImageHeights[imageID]; *image = ImageData + ImageOffsets[imageID]; }
äœã¬ãã«ã®æé©åïŒå°ãã®ã¢ã»ã³ãã©ãŒ
ã°ã©ãã£ãã¯ã¹ã䜿çšããäœæ¥ã®å®è£ ãå®äºããåŸããœãªãã£ã¢ã²ãŒã ãã¬ã€ã®ããžãã¯ãè¿ éã«å®äºããéåžžã«é ããã®ã®ããã¹ãŠãçŸããèŠããŸããã ãã€ãã®ããã«ãå¹æçã«æé©åããå¯äžã®æ¹æ³ã¯ã³ãŒãã®ãããã¡ã€ãªã³ã°ã§ãã Borland C ++ã«ã¯ã25æ³ã§ããããšãèãããšãéåžžã«äŸ¿å©ãªãããã¡ã€ã©ãŒã§ããTurbo Debuggerãå«ãŸããŠããŸãã
ç§ãã¡ã®å Žåããããã¡ã€ãªã³ã°ã®çµæã¯é©ãããšã§ã¯ãããŸããã§ããã ãã®ããã°ã©ã ã¯ã»ãšãã©ãã¹ãŠã®æéãã¬ã³ããªã³ã°æé ã«è²»ãããç»åããŒã¿ãVGAã¡ã¢ãªã«ã³ããŒããŸããã 20 MHzã®åšæ³¢æ°ã§æ¯ç§æ°åäžãã¯ã»ã«ã386ã«ã³ããŒããã®ã¯éåžžã«å°é£ãªããã»ã¹ã§ãïŒ Borlandã³ã³ãã€ã©ã«ãã£ãŠçæãããã¢ã»ã³ãã©ã³ãŒãã調ã¹ããšãã¬ã³ããªã³ã°ããã·ãŒãžã£ã®å éšãµã€ã¯ã«ãé ãããå€ãã®ãªãŒããŒããããããããšãæããã«ãªããŸããã
Cãæ倧éã«äœ¿çšããããšããŸããããã¢ã»ã³ããªèšèªãã¬ã³ããªã³ã°ããã·ãŒãžã£ã®éèŠãªå éšãµã€ã¯ã«ãæé©åããªããšã§ããªãããšã¯æããã§ããã ã¢ã»ã³ããªèšèªã¯ãããã»ããµãé ããã³ã³ãã€ã©ã®æé©åãããã»ã©å¹ççã§ã¯ãªãã£ã90幎代ã®ããã°ã©ãã³ã°ã²ãŒã ã§ãã䜿çšãããŠããŸããã ãããã£ãŠãçµã¿èŸŒã¿ã¢ã»ã³ãã©ã³ãŒãã®ã¬ã³ããªã³ã°é¢æ°ã®å éšéšåã®ã¿ãæžãçŽããŸããã ããã¯ãã»ãšãã©ã®ã²ãŒã ã¬ã³ããªã³ã°ããã»ã¹ã§äœ¿çšãããBlitïŒïŒé¢æ°å ã®çµã¿èŸŒã¿ã¢ã»ã³ãã©ã³ãŒãã§ãã
// : byte far *vgaPtr = /* VGA */; byte far *imgPtr = /* */; asm PUSHA asm PUSH DS asm LES DI, vgaPtr asm LDS SI, imgPtr asm MOV BX, h asm CLD each_row: asm MOV CX, lineWidth asm REP MOVSB // ! asm ADD DI, dstSkip asm ADD SI, srcSkip asm DEC BX asm JNZ each_row asm POP DS asm POPA
ãã®ã¢ã»ã³ãã©ã³ãŒãã®åã«ã¯ãæç»ããå Žæãç»åããŒã¿ã®èªã¿åãå ãæç»ãããç»åã衚瀺é åã«æ¿å ¥ããæ¹æ³ãèšç®ããCã³ãŒãããããããããŸãããå®è¡æéã®å€§éšåã¯REP MOVSBã³ãã³ãã«è²»ããããŸãã ãã®ã³ãã³ãã¯Cã®memcpyïŒïŒã«äŒŒãŠããŸãããx86ããã»ããµã§ãã€ãã£ãã«ãµããŒããããŠããã386ãªã©ã®ä»¥åã®x86ããã»ããµã§ã¡ã¢ãªãã³ããŒããæéã®æ¹æ³ã§ããmemcpyïŒïŒãšåæ§ïŒã¬ãžã¹ã¿ãŒå ïŒããã®åŸãããã»ããµãŒã¯å¿ èŠãªéã®ããŒã¿ãã«ãŒãã§èªåçã«ã³ããŒããŸãã
MS-DOSçšã®æ·±ã»ã³ãœãªãã£ã¢ã¯ãçµã¿èŸŒã¿ã®ã¢ã»ã³ãã©ãŒèšèªã3ã€ã®ã³ãŒãã ãã§äœ¿çšãããããã¯ãã¹ãŠãã®ã³ãŒãã«éåžžã«äŒŒãŠããŸãã ãããã®éèŠãªã¬ã³ããªã³ã°é¢æ°ã§çµã¿èŸŒã¿ã¢ã»ã³ãã©ã䜿çšãããšããããã®é¢æ°ã®é床ã5ã10åã«ãªããŸããã ã²ãŒã å ã§å®è¡ãããã«ã¹ã¿ãã€ãºã³ãŒãããã®ä»ã®ã³ãŒãã®å€ãã®è¡ã«ãããããããã»ãšãã©ã®CPUæéã¯åçŽã«ãã€ãã®ã³ããŒã«è²»ããããŸããã
*å®éãREP MOVSWãŸãã¯REP MOVSDã¯ã1ã€ã§ã¯ãªããäžåºŠã«2ãŸãã¯4ãã€ããã³ããŒãããããããã«é«éã«ãªããŸãã ãã ããBorland C ++ã®ããŒãžã§ã³ã§ã¯16ãããã³ãã³ãã®ã¿ããµããŒããããŠãããããMOVSDã䜿çšã§ããŸããã§ããã MOVSWã䜿çšããããšããŸãããããã®æ£ããæäœã«åé¡ããããŸããã REP MOVSWãã¬ã³ããªã³ã°ããã»ã¹ãååã«å éãããšããŠããããã¯ãé«ã¬ãã«ã®ããã©ãŒãã³ã¹ã®åé¡ã解決ããã®ã«ååã§ã¯ãããŸããã
ããã«ãããã¡ãªã³ã°
次ã«è§£æ±ºãã¹ãåé¡ã¯ã¡ãã€ãã§ããã
ã¢ãŒãXã¢ãŒãã§ã¯ããã«ã¹ã¯ãªãŒã³ã°ã©ãã£ãã¯ã¹ãèšè¿°ããããã«75 kBã®VGAã¡ã¢ãªãå¿ èŠã§ãã ãããã256 KBã®VGAã¡ã¢ãªã¯ãåæã«3ã€ã®ãã¹ã¯ãªãŒã³ããä¿åããã®ã«ååã§ããã ã³ãŒãã§ã¯ãããããã¡ã³ã¿ã«çã«Screen 0ãScreen 1ãããã³Screen 2ãšåŒã³ãŸããããããŸã§ã¯ãScreen 0ã®ã¿ã䜿çšããŸãããããã«ãããã¡ãªã³ã°ãå®è£ ããã«ã¯ãScreen 0ããã³1ã䜿çšããŸããã 2ã€ç®ã¯ãããã¯ãããã¡ãŒããšããŠäœ¿çšãããŸãããããã¯ãã²ãŒã ãæ°ããèŠçŽ ãŸãã¯å€æŽãããèŠçŽ ãæç»ããé åã§ãã ã°ã©ãã£ãã¯ã®æ°ãããã¬ãŒã ã衚瀺ããæºåãã§ããããã¡ã¢ãªã®è¡šç€ºãããéšåãå³åº§ã«å€æŽããVGAæ©èœã§ãããããŒãžãªãã¬ã¯ã·ã§ã³ããå®è¡ããŸãã
ããã«ãããã¡ãªã³ã°ã¯ã¡ãã€ãã®åé¡ã解決ããŸããããã²ãŒã ã¯ãŸã é ãããŸããã äœã¬ãã«ã®ã¬ã³ããªã³ã°ã³ãŒããç·šéããã ãã§ã¯äžååã§ãã ãã€ãã®ããã«ãã¢ãã©ãã·ã¥ã¯ãããäºèŠããŸããã ã°ã©ãã£ãã¯ããã°ã©ãã³ã°ãã©ãã¯ããã¯ã®äž»ãªã¡ãã»ãŒãžã¯ãé©åãªã¢ã«ãŽãªãºã ã®éžæãšãäœã¬ãã«ã®ã¢ã»ã³ãã©ãŒããªãã¯ãããããã©ãŒãã³ã¹ãåäžãããããã°ã©ã ã®é«ã¬ãã«ã®èšèšã§ãã
é«ã¬ãã«ã®æé©åïŒéçããã¯ã°ã©ãŠã³ã
æåã«ãç»é¢ã®ã»ãšãã©ãã»ãšãã©åžžã«åããŸãŸã§ããã¬ãŒã ããšã«å€åããªãããšã«æ°ä»ããŸããã
éåžžãããŠã¹ã«ãŒãœã«ã¯ç»é¢äžãåããããã€ãã®ã«ãŒãããã©ãã°ãããããšããããŸãããèæ¯ãšã»ãšãã©ã®ã«ãŒãã¯å®å šã«å€æŽãããŸããã ãããå©çšããããã«ãæåŸã®ãã«ã¹ã¯ãªãŒã³VGAã¹ã¯ãªãŒã³2ã¡ã¢ãªããéçèæ¯ããšããŠæå®ããŸããã ã»ãšãã©å€æŽãããŠããªããã¹ãŠã®ã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ïŒã€ãŸããããŠã¹ã«ãŒãœã«ãé€ãã»ãšãã©ãã¹ãŠïŒãç»é¢2ã«æç»ãå§ããŸãããã€ãŸããåãã¬ãŒã ãã¬ã³ããªã³ã°ããæé ã¯é垞次ã®ããã«ãªããŸããã
- éçèæ¯ãããã¯ãããã¡ãŒã«ã³ããŒããŸãã
- ããŠã¹ïŒããã³ãã¹ãŠã®ãã©ãã°å¯èœãªã«ãŒãïŒãããã¯ãããã¡ãŒã«æç»ããŸãã
- ããã¯ãããã¡ãŒã衚瀺ããŸãã
ããã«ãããã»ãšãã©ã®ãã¬ãŒã ã§äœæ¥ã®åºäœéšåãåãé€ãããšãã§ããŸããããéçãªèæ¯å šäœãã³ããŒããããšã¯äŸç¶ãšããŠå€ãã®äœæ¥ã§ããã ããã«æªãããšã«ã¯ãéçãªèæ¯ãå€æŽããããšããããšãã°ããŠã¹ã§å°å³ãæã¡äžãããšããæåã«å¥ã®ãã¬ãŒã ããšã®äœæ¥ã«å ããŠéçãªèæ¯ãå®å šã«åæç»ããå¿ èŠããããŸããã ããã¯éåžžãã²ãŒã ãã¹ã ãŒãºã«æ©èœããããšãæå³ããŠããŸããããã«ãŒããŸãã¯ãã¿ã³ãã¯ãªãã¯ãããšãç®ç«ã£ãŠèš±å®¹ã§ããªããã¬ãŒããããããŸããã
éçºã®ãã®æ®µéã§ã¯ãäž»ã«2ã€ã®ããã©ãŒãã³ã¹ã³ã¹ãããããŸãããéçããã¯ã°ã©ãŠã³ãã®åæç»ïŒæã ïŒãšéçããã¯ã°ã©ãŠã³ãã®ããã¯ãããã¡ãŒãžã®ã³ããŒïŒåãã¬ãŒã ïŒã§ãã èæ¯ãåæç»ããã³ã¹ããåæžããç°¡åãªè§£æ±ºçãèŠã€ããŸãããã«ãŒãã®åã¹ã¿ãã¯ã«ã¯ç»é¢äžã«ç¬èªã®é åããããéåžžããã¬ãŒã ããšã«1ã€ãŸãã¯2ã€ã®ã¹ã¿ãã¯ã ããåæç»ããå¿ èŠããããŸãã ã€ãŸããéçãªèæ¯ã®10ã20ïŒ ãåæç»ããã ãã§æžã¿ãããã«æ¯äŸããŠæéãããããŸããã
é«ã¬ãã«ã®æé©åïŒæ±ããé·æ¹åœ¢
ã²ãŒã ã蚱容å¯èœãªãã¬ãŒã ã¬ãŒãã§åäœããããšã劚ããæåŸã®åé¡ã¯ãéçãªèæ¯ãã³ããŒããããšã§ãããããã¯ãã¹ãŠã®ãã¬ãŒã ã§çºçããŸããã ç§ãã¡ã®ãœãªã¥ãŒã·ã§ã³ã¯ãããŒããŠã§ã¢ã°ã©ãã£ãã¯ã¹ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ãç»å Žããåã®æ代ããã®ãã1ã€ã®å€å žçãªææ³ã§ãããæ±ããé·æ¹åœ¢ã®è¿œè·¡ã§ãã Windows 95ã§ã¯ãããã°ã©ã ãããªãŒãºãããšããã®ãããªç¶æ³ãé »ç¹ã«çºçãããããŒãã£ãªåè§åœ¢ããèŠããŠããŸãã ããã°ã©ã ãã¯ã©ãã·ã¥ãããšãããŠãŒã¶ãŒã¯ã空ã«ãªããã°ã©ãã£ãã¯ã®ãŽãã§èŠããããŸã§ããã³ã°ããããã°ã©ã ã®ãŠã£ã³ããŠäžã«å¥ã®ãŠã£ã³ããŠããã©ãã°ã§ããŸããã ãŠãŒã¶ãŒããŠã£ã³ããŠããã©ãã°ããŠåæç»ããŠããé åã¯ãããŒãã£ãã§ããã ãã³ã°ããããã°ã©ã ã¯ããŠãŒã¶ãŒããã©ã¢ã°ã©ãŠã³ãã§ãŠã£ã³ããŠãåé€ãããšããã«åæç»ããå¿ èŠããããŸãã
ããŒãã£ãªé·æ¹åœ¢ãåæ§ã®æ¹æ³ã§äœ¿çšããŸããã ãã¬ãŒã€ãŒãããŠã¹ãåãããããéçãªèæ¯ã®äžéšãå€æŽãããšããã®é åãããŒãã£ãªåè§åœ¢ã®ãªã¹ãã«è¿œå ããŸãã 次ã«ãéçèæ¯å šäœãããã¯ãããã¡ãŒã«ã³ããŒãã代ããã«ãããŒãã£ãªåè§åœ¢ã®ã¿ãã³ããŒããŸãã ã³ããŒãããã¯ã»ã«æ°ãæžãããšããã¬ãŒã ã®ã¬ã³ããªã³ã°ã«ãããââæéãçããªãããã¬ãŒã ã¬ãŒããåäžããŸãã
ãã®æ¹åã«ãããã²ãŒã ã¯ãããããã¹ããã·ã³ã§ã¹ã ãŒãºã«åäœããããã«ãªããŸããã VGAã«ãŒããæèŒããã»ãšãã©ã®ã³ã³ãã¥ãŒã¿ãŒã¯ã386ããã»ããµãŒãæèŒãã20 MHzã®ãã¬ãŒããã·ã³ãããåªããä»æ§ã§ãããšå€æãããããã²ãŒã ã®ããã©ãŒãã³ã¹ã¯ã²ãŒã ããªãªãŒã¹ããã®ã«ååé«ããšç¢ºä¿¡ããŸããã
å ¥ã
ã°ã©ãã£ãã¯ãšæ¯èŒããŠãã²ãŒã ã®ä»ã®ãã¹ãŠã®åŽé¢ã¯éåžžã«ã·ã³ãã«ã§ããã IBMäºæã³ã³ãã¥ãŒã¿ãŒã§ã¯ãå¿ èŠãªåºæ¬ãµãŒãã¹ã®ã»ãšãã©ã¯ãå²ã蟌ã¿ããŒã¹ã®APIã䜿çšããŠBIOSãšDOSã«ãã£ãŠæäŸãããŸãã ãããã®ãµãŒãã¹ã«ã¯ãããŒããŒããšããŠã¹ã®ããŒã¿ã®èªã¿åãããã£ã¹ã¯ã®èªã¿åããšæžã蟌ã¿ããã¡ã€ã«ã®ãªãŒãã³ãã¡ã¢ãªã®å²ãåœãŠãå«ãŸããŸãã æ·±Shenzhenãœãªãã£ã¢ã§äœ¿çšããå²ã蟌ã¿ã®äžéšã次ã«ç€ºããŸãã
- INT 16hïŒããŒããŒãAPI
- INT 21hïŒDOSã·ã¹ãã ã³ãŒã«
- INT 33hïŒããŠã¹API
ãããã®APIã¯ã次ã®ãããªã¢ã»ã³ããªã³ãŒããã䜿çšããå¿ èŠããããŸãã
// : BIOS // INT 16h, 1h . mov AL, 16h mov AH, 01h int 16h // . jnz no_key_pressed // ⊠no_key_pressed: // ...
ããŠã¹ã®ç¶æ ã®èªã¿åãã¯ãåæ§ã®æ¹æ³ã§å®è¡ãããŸããINT33hã3hãåŒã³åºããŠãããŠã¹ã®çŸåšã®äœçœ®ãšãã¿ã³ã®ç¶æ ãååŸããŸãã ããŒããŠã§ã¢ãžã®çŽæ¥ã¢ã¯ã»ã¹ããŸãã¯ææ°ã®OSã®APIã䜿çšããå Žåãšæ¯èŒããŠããããã¯éåžžã«ç°¡åã§ãã
é³
å¹æé³ã¯ã²ãŒã ã®éèŠãªéšåã§ãããéåžžã«å€ãPCã§é³æ¥œãšãµãŠã³ããåçããã®ã¯é£ããäœæ¥ã§ãã ãã¹ãŠã®IBMäºæPCã§å©çšã§ããæãåçŽãªãªãã·ã§ã³ã¯ãPCã¹ããŒã«ãŒã§ãã ãã®ã¹ããŒã«ãŒã¯ããã¶ãŒããŒãäžã®åçŽãªã¿ã€ããŒãããã«ãã£ãŠå¶åŸ¡ãããŸãã ã€ãŸããã¹ããŒã«ãŒã¯ãäžå®ã®åšæ³¢æ°ã§é³ãé£ç¶çã«åçããããã«èšå®ããã®ãéåžžã«ç°¡åã§ãã äžéšã®PCã«ã¯ç¹æ®ãªãµãŠã³ãã«ãŒãããããŸããã䜿çšããã®ãã¯ããã«é£ãããåžžã«ã·ã¹ãã ã«ãããšã¯éããŸããã
PCã¹ããŒã«ãŒã®å¶éã«ãããã²ãŒã ã®ç¹å®ã®æç¹ïŒã²ãŒã ã®éå§æãçµäºæãããã³åå©åŸïŒã§çããé³æ¥œããã©ã°ã¡ã³ãã®ã¿ãåçããŸããã 386ããã»ããµã®PCæ代ã§ã¯ãæ£ç¢ºãªæé枬å®ã®æ©äŒã¯ã»ãšãã©ãªããä»ã®ããšãããªããPCã¹ããŒã«ãŒããåçŽãªé³æ¥œãåçããããšã¯å°é£ã§ãã ãããã£ãŠãåã³æãåçŽãªãªãã·ã§ã³ãéžæããŸãããé³æ¥œã®æçã¯éåžžã«çããããã²ãŒã ã1ã2ç§ãã€ãŸãé³æ¥œå¹æã®æç¶æéã ãåæ¢ããŸãã ãã®ãããªãã©ã°ã¡ã³ããèšå®ããã³åçããããã®ã³ãŒãã¯éåžžã«ç°¡åã§ãã
void PlayStartupMusic(void) { sound(73); delay(220); sound(110); delay(220); sound(165); delay(220); sound(98); delay(220); sound(110); delay(220); sound(147); delay(440); nosound(); }
é³æ¥œã®æçã«å ããŠãã²ãŒã ãããç©ççã«æããããããã«ãã«ãŒããåããé 眮ãããµãŠã³ãå¹æãè¿œå ãããã£ãã®ã§ãã ãŸããã¿ã€ããŒããŒã¹ã®èªåãµãŠã³ããžã§ãã¬ãŒã¿ãŒãäžæçã«ç¡å¹ã«ããæåã§ãªã³ãšãªããåãæ¿ããŠçããã¯ãªãã¯ããäœæããããšã«ãããPCã¹ããŒã«ãŒãä»ããŠå®è£ ãããŸããã
ã²ãŒã ããªãªãŒã¹ããŸãïŒ
æ·±ã»ã³ãœãªãã£ã¢ã®MS-DOSãžã®ç§»æ€ã¯ãäºæ³ãããç°¡åã§è€éãªããšãããããŸããã ã¿ãŒã²ããæ©åšïŒåšæ³¢æ°20 MHzã®ã·ã³ã°ã«ã³ã¢Intel 80386SXïŒãšéåžžã®æ©åšïŒåšæ³¢æ°3500 MHzã®4ã³ã¢Intel Core i7-4770KïŒã®ããã»ããµãŒã®åŠçèœåã®å€§ããªéãã«ãããããããæé©åãããŠããªãã²ãŒã ãã¬ã€ããžãã¯ã¯éåžžã«é«éã§åäœããããã©ãŒãã³ã¹ã«ã¯ã»ãšãã©åœ±é¿ããŸããã§ããã ããããæ¬ ç¹ã¯ãç»é¢ã«ãã¹ãŠã®ãã¯ã»ã«ãæç»ããã®ã«ã»ãŒ150ããªç§ããããšããã¹ãŠãé«éã«èŠããããšã§ãïŒ ãã®éçšã§ãã³ã³ãã¥ãŒã¿ãŒã®ã¢ãŒããã¯ãã£ãŒã«ã€ããŠå€ãã®ããšãåŠã³ãŸãããã³ã³ãã¥ãŒã¿ãŒã®ã¢ãŒããã¯ãã£ãŒã¯ãéå§è ã ããç解ã§ãããšèããããšãã§ããŸãã æçã§èå³æ·±ãããã»ã¹ã«ãããããããå°æ¥ã®Zachtronicsã²ãŒã ã§ã»ã°ã¡ã³ãã¬ãžã¹ã¿ã䜿çšããããšã¯ã»ãšãã©ãããŸããã ç§ãã¡ã¯ããŸããµãã£ã¹ãã£ãã¯ã§ã¯ãããŸããïŒ
æ·±ã»ã³ãœãªãã£ã¢ã®ç§»æ€çãMS-DOSã§ãã¬ã€ãã2017幎9æ12æ¥ãŸã§ãã®èšäºãèªã¿ããå Žåã¯ãKickstarterã§ãããžã§ã¯ããè©äŸ¡ãããããããŒã®ã¿ã®ãªãªãŒã¹ã®äžéšãšããŠã²ãŒã ã®ã³ããŒã泚æããŠãã ããã å®å šãªãœãŒã¹ã³ãŒããå«ãŸããŠããŸãïŒ