ãšãã¥ã¬ãŒã¿ãäœæããéçšã§ãã ãžã£ãã¯ã¢ãŒã±ãŒããã·ã³ã«ã€ããŠåŠãã ããš
æè¿ãäž»ã«ãããã®æåã®8ãããã¢ãŒã±ãŒããã·ã³ã8ãããã®ããŒã ã³ã³ãã¥ãŒã¿ãŒãšãã¶ã€ã³ãã©ã®ããã«ç°ãªãããç解ããããã«ãå°åã®ãã ãžã£ãã¯ãã·ã³ãšãã¥ã¬ãŒã¿ãŒãäœæããŸããã
åŸã§ããã£ãããã«ãç§ã®æ é·ã§ã®å€ã®ãã§ã¢ã§ã®ãã ãžã£ãã¯ã®ãããªã¢ãŒã±ãŒããã·ã³ãšã®ããŒãã£ã³ã°ã¯ãç§ã®éåœãå€ããç¬éã®äžã€ã§ããã éåžžã®å€ã®æ¥ã«ãã³ã€ã³ã®ãã¹ãŠã®äŸçµŠãã¢ãŒã±ãŒããã·ã³ã«è²»ãããŠããã家ã«æ»ããé ã¯è±ãšå¹æé³ã§ãã£ã±ãã«ãªããŸããã ãããã®ã²ãŒã ã®ä»çµã¿ãç解ããããšããŸããã ãããŠã幎ã®çµãããŸã§ãç§ã¯æŸèª²åŸãã£ãšèªå® ã®ã³ã³ãã¥ãŒã¿ãŒã§ãããã®ã¢ãŒã±ãŒãã²ãŒã ã®ããªãè²ãããã³ããŒãäœæããããšã«æéãè²»ãããŸããã ç§ã¯ã¹ãã£ãã¯ããã¢ã¡ãªã«è»ã®ã©ãžãªå±ãäœãããã£ã倪平æŽè«žå³¶ã®ã«ãŒãŽã«ã«ãã®ãã¡ã³ã®ããã«èŠããŸããã
ç§ã®æåã®é ã¯ã Pengoãšãã¥ã¬ãŒã¿ãäœæããããšãèããŸãããããã¯ã10代ã®è³ãBomb Jackããããã®ã²ãŒã ã®ã»ãããã£ãšå°è±¡çã ã£ãããã§ãïŒã¡ãªã¿ã«ãç§ã®è²šç©ã®ã«ã«ãããŒãžã§ã³ã®Pengoã§ã ïŒã ããããPengoã¢ãŒã±ãŒãæ©åšã«ã¯ãµãŠã³ããšãããªçšã®æ°ããããããšãã¥ã¬ãŒã¿ãŒãäœæããå¿ èŠããããBomb Jackã«ã¯æ¢ã«æã£ãŠããååãªéšåã§ããããšãå€æããŸããïŒCPUãšããŠã®Z80ãšãµãŠã³ãçšã®AY-3-8910ïŒããããã£ãŠãBomb JackãåããŠäœ¿çšããŸããã
ããã«ãBomb Jackã¯ãZ80ãšãã¥ã¬ãŒã¿ã«NMIïŒãã¹ã¯äžèœå²ã蟌ã¿ïŒãµããŒããæçµçã«è¿œå ãã絶奜ã®æ©äŒã§ããã 以åã«ãšãã¥ã¬ãŒãããZ80ããŒã¹ã®ãã·ã³ã¯ããããNMIã䜿çšããŠããªãã£ãããããã®æ©èœãåäœæããããšã«ã¯ããŸãæå³ããããŸããã§ããããŸã åäœã確èªã§ããŸããã§ããã
Bomb Jackãäœã§ãããããããªãå Žåããã®ã²ãŒã ã¯æ¬¡ã®ããã«ãªããŸããïŒæ£ããã¢ã¹ãã¯ãæ¯ãéžæãããã©ããã¯ããããŸããïŒã
WebAssemblyã®ãšãã¥ã¬ãŒã¿ãŒã®ããŒãžã§ã³ã¯ã次ã®å Žæã«ãããŸãã
https://floooh.github.io/tiny8bit/bombjack.html
ããŒãæé ãå®äºãããã€ã¹ã³ã¢ããŒãã«ã衚瀺ããããã 1ãæŒããŠã³ã€ã³ããããããã Enter ïŒãŸãã¯ç¢å°ãšã¹ããŒã¹ããŒãé€ãä»ã®ããŒïŒãæŒããŠã²ãŒã ãéå§ããŸãã
ã²ãŒã å ã§ã ç¢å°ããŒã䜿çšããŠæ¹åãå€æŽãã ã¹ããŒã¹ããŒã䜿çšããŠãžã£ã³ãããŸãã 空äžã«ã¹ããŒã¹ããŒãæŒããšãèœäžé床ãé ããªããŸãã
ãœãŒã¹ã³ãŒãã¯æ¬¡ã®ãšããã§ãã
https://github.com/floooh/chips-test/blob/master/examples/sokol/bombjack.c
ãããããããŒã䜿çšããŠZ80ããã³AY-3-8910ã®ãšãã¥ã¬ãŒã·ã§ã³ãæäŸãã sokolããããŒãã¯ãã¹ãã©ãããã©ãŒã ã©ãããŒïŒã¢ããªã±ãŒã·ã§ã³ã®å ¥åãã¬ã³ããªã³ã°ãå ¥åããµãŠã³ãçšïŒãšããŠæäŸããŸãã
ã¹ããã1ïŒèª¿æ»
ãç 究ããšããèšèã¯é·ãããŸããGoogleã®ãBombjackã¢ãŒã±ãŒãããŒããŠã§ã¢ã®ä»æ§ãããããããŸããã
人æ°ã®ãã80幎代ã®å®¶åºçšã³ã³ãã¥ãŒã¿ãŒïŒãŸãã¯ããŸã 掻çºãªã³ãã¥ããã£ããã°ãã°ååšããç¥ç§çãªæ±ãšãŒãããã®ã³ã³ãã¥ãŒã¿ãŒã§ããïŒãšæ¯èŒãããšãã€ã³ã¿ãŒãããäžã®ãã ãžã£ãã¯ã«é¢ããæ å ±ã¯ã»ãšãã©ãããŸããã
ãã·ã³ã®åè·¯å³ãšããã¡ããMAMEãšãã¥ã¬ãŒã¿ãŒã®ãœãŒã¹ã³ãŒããšãã 2ã€ã®éåžžã«éèŠãªæ å ±ãèŠã€ããŸããã
ãŸããåè·¯å³ã«ãªã詳现ãèŠã€ããããšãã§ããVHDLãœãŒã¹ããã FGPAã«Bomb Jackãå®è£ ãããããžã§ã¯ãããããŸãã
ã¢ãŒã±ãŒããã·ã³ãšãã¥ã¬ãŒã¿ãŒã¯éåžžãæ©åšã®ããŸããŸãªéšåãã©ã®ããã«çžäºäœçšããããèšè¿°ããåãªããã¯ãã®éãŸãã§ããã ãœãŒã¹ã³ãŒãã®å€ãã§ã¯ãªããããMAMEãœãŒã¹ãç解ããããšã¯å°é£ã§ã ã
ããã«ãããããããæ©åšã®ãã¯ãèšè¿°ãç¹ã«ã³ã¡ã³ãã¯ãããŒããŠã§ã¢ã®åäœãç解ããã®ã«éåžžã«æçšã§ããããšãå€æããŸããããããŠãããããããŸãã«ãæå·åãããå ŽæïŒããšãã°ã ãããªã®ãã³ãŒãã®éšå ïŒãè©Šè¡é¯èª€ã®æ¹æ³ã ãã§ãªããååã§ããã³ã³ã»ããã®è©³çŽ°ãªç 究ã
ããŒããŠã§ã¢ã®æŠèŠ
Bomb JackããŒããŠã§ã¢ã®æãèå³æ·±ãç¹ã¯ãå®éã«ã¯é»æ°ããŒãã§æ¥ç¶ããã2å°ã®ã³ã³ãã¥ãŒã¿ãŒã§ãããšããããšã§ããZ80CPUãšãããªãã³ãŒãè£ çœ®ãåããã¡ã€ã³ããŒããšãç¬èªã®Z80 CPUãš3å°ã®ãµãŠã³ãã«ãŒã ïŒã¯ãã 3ïŒïŒãµãŠã³ããããAY-3-8910ã
ãããªãã³ãŒãè£ çœ®ã¯éç©åè·¯ãšããŠå®è£ ãããŠããŸãã-ããã¯ãå€ãã®å°ããªæ±çšãããã§ãïŒãã®åè·¯ã¯ãããã€ã¹ã®åè·¯å³ã®10ããŒãžã®ãã¡6ã€ãå æããŸãïŒã ãšãã¥ã¬ãŒã¿ãŒãäœæãããšããç§ã¯ç°¡åãªæ¹æ³ã«é²ãããšã«ããŸããïŒãããªãã³ãŒãæ©åšã®åã ã®éšåããšãã¥ã¬ãŒããã代ããã«ããã®åäœã®ã¿ããšãã¥ã¬ãŒãããå ¥åããŒã¿ãã察å¿ããåºåãäœæããæ©åšèªäœãçãäžã«ã©ã®ããã«æ©èœããããæ¬åœã«å¿é ããŸããã§ããã
ãã®ãããªåçŽåããããœãªã¥ãŒã·ã§ã³ã¯ã1ã€ã®ããã°ã©ã ã®ã¿ãå®è¡ããããã«èšèšãããåå¥ã®ã¢ãŒã±ãŒããã·ã³ã«éåžžã«é©ããŠããŸãã ã²ãŒã ãèµ·åããŠæ£ããåäœããå Žåããšãã¥ã¬ãŒã·ã§ã³ã¯ãååã«è¯ãããšèŠãªãããšãã§ããŸãã
ããã«ããã®åçŽåãããã¢ãããŒãã¯ãã»ãšãã©ã®å®¶åºçšã³ã³ãã¥ãŒã¿ãŒã®ãšãã¥ã¬ãŒã·ã§ã³ãšã®éèŠãªéãã§ãïŒããšãã°ãC64ãAmstrad CPCãªã©ã®ãã·ã³ã§ã¯ãã¯ããã¯ãµã€ã¯ã«ãŸã§éåžžã«æ£ç¢ºãªãšãã¥ã¬ãŒã·ã§ã³ãå¿ èŠãªãããäžéšã®ã²ãŒã ãã°ã©ãã£ãã¯ã®ãããªã·ã¹ãã ã¯ããã¢ã¯æ£åžžã«æ©èœããŸããã
ãŸããæ¢è£œã®CPUããã³ãµãŠã³ãããããšãã¥ã¬ãŒã¿ãŒã¯å®éã«ã¯Bomb Jackã«ã¯äžèŠã§ããããšãã°ããã·ã³ãµã€ã¯ã«ã®åæ°ã®å®è£ ã§Z80 CPUãæäœããã®ã¯éå°ã§ãããåœä»€ã¬ãã«ã§ã®ããåçŽã§é«éãªæçåã§ååã§ãã
ã¡ã€ã³ããŒã
éåžžãæ°ãããšãã¥ã¬ãŒã¿ãäœæãããšãã«æåã«èŠã€ããããšããã®ã¯ãã¡ã¢ãªå²ãåœãŠã¹ããŒã ã§ãïŒROMãšRAMããããªã¡ã¢ãªãç¹å¥ãªã¢ãã¬ã¹ããŸãã¯å ¥åºåããŒãã®é åïŒã
Bomb Jackã¡ã€ã³ããŒãã«ã¯ã4 MHzã§åäœããZ80 CPUãšãããèå³æ·±ãããããã1ã€ã ããããŸãã ã¡ã€ã³ããŒãã®æ®ãã®ãã¹ãŠã®é åã¯ããããªãã³ãŒãè£ çœ®ã§å ããããŠããŸãïŒRAMããããšROMãããã®ãã¢ãé€ãïŒã
16ãããã®ã¢ãã¬ã¹ç©ºéã¯æ¬¡ã®ãšããã§ãã
- 0000..7FFF ïŒ32 KB ROM
- 8000..8FFF ïŒ4 KBã®æ±çšRAM
- 9000..93FF ïŒ1 KBã®ãããªã¡ã¢ãª
- 9400..97FF ïŒ1 KBã®ã«ã©ãŒRAM
- 9820..987F ïŒ96ãã€ãã®ã¹ãã©ã€ãRAM
- 9C00..9CFF ïŒ256ãã€ãã®RAMã«ã©ãŒãã¬ãã
- 9E00ãB000..B005ãB800 ïŒå ¥åºåããŒã
- C000..DFFF ïŒ8 Kãã€ãROM
I / OããŒãé åã¯æ¬¡ã®ãšããã§ãã äžéšã®ããŒãã¯æžã蟌ã¿å°çšã§ãããäžéšã¯èªã¿åãå°çšã§ãããäžéšã®ããŒãã¯èªã¿åãããã³æžã蟌ã¿æã«ç°ãªãæ©èœãæã¡ãŸãã
- 9E00 ïŒæžã蟌ã¿ïŒçŸåšã®èæ¯ç»åçªå·ãèªã¿åãïŒ-
- B000 ïŒèªã¿åãïŒãã¬ãŒã€ãŒ1ã®ãžã§ã€ã¹ãã£ãã¯ã®ç¶æ ãæžã蟌ã¿ïŒNMIãã¹ã¯ã®æå¹å/ç¡å¹å
- B001 ïŒèªã¿åãïŒãã¬ãŒã€ãŒ2ãžã§ã€ã¹ãã£ãã¯ã®ç¶æ ãæžã蟌ã¿ïŒ-
- B002 ïŒèªã¿åãïŒã³ã€ã³ãšã¹ã¿ãŒããã¿ã³ãæžã蟌ã¿ïŒ-
- B003 ïŒèªã¿åãïŒCPUãŠã©ããããã°ãæžã蟌ã¿ïŒ???
- B004 ïŒèªã¿åãïŒãã£ããã¹ã€ãã1ãæžã蟌ã¿ïŒç»é¢ã®åãæ¿ã
- B005 ïŒèªã¿åãïŒãã£ããã¹ã€ãã2ãæžã蟌ã¿ïŒ-
- B800 ïŒæžã蟌ã¿ïŒã³ãã³ããµãŠã³ãã«ãŒããèªã¿åãïŒ-
以äžã¯ãããã§èšåãã䟡å€ããããŸãã
- ããã€ã¹ã«ã¯ãããããã®ROMïŒ40 Kãã€ãïŒãšããããããªRAMïŒçŽ7 Kãã€ãããã®ãã¡ã®4 Kãã€ãã®ã¿ããæ±çšRAMãïŒããããŸãã
- ããã£ã¹ãã¬ã€ã®RAMãã«ã¯2Kãã€ãã®ã¿ãå²ãåœãŠããã1Kãã€ãã®2ã€ã®ãã©ã°ã¡ã³ãã«åå²ãããŸããããã¯256x256ãã«ã«ã©ãŒãã£ã¹ãã¬ã€ã§ã¯éåžžã«å°ããèŠããŸãããè²ã¯ãã¯ã»ã«ããšã«èšå®ãããŠããããã§ã
- ããã¯ãã¡ã¢ãªå²ãåœãŠæ¹åŒã®I / Oã·ã¹ãã ã§ãïŒ
Z80ã®ç¹åŸŽã®1ã€ã¯ãããã€ã¹I / Oã®åå¥ã®16ãããã¢ãã¬ã¹ç©ºéã§ãããããã¡ã¢ãªå²ãåœãŠã¹ããŒã ã®I / Oã¯Z80ãæèŒãããã·ã³ã§ã¯å°ãç°åžžã§ãã ããã¯ã貎éãªã¡ã¢ãªã¢ãã¬ã¹ç©ºéãç¯çŽããããã«è¡ãããŸãã ã¡ã¢ãªå²ãåœãŠã¹ããŒã ã®I / Oã¯ãéåžž6502ããã»ããµãæèŒããã³ã³ãã¥ãŒã¿ãŒã§èŠãããŸãã
åè·¯å³ãèŠããšããã確èªã§ããŸããã¡ã€ã³ããŒãã®CPUã§IORQãã³ã¯æ€åºããããMREQãã³ã®ã¿ãæ¥ç¶ãããŠããŸãïŒã¡ã¢ãªãžã®èªã¿åããŸãã¯æžã蟌ã¿ã®åæåã«äœ¿çšãããŸãïŒã
ããã¯ããšãã¥ã¬ãŒã¿ãŒã®ã¡ã€ã³ããŒãã®CPUã¿ã€ããŒæ©èœã«å¯ŸããI / OèŠæ±ãå¿é ããå¿ èŠã¯ãªããã¡ã¢ãªèŠæ±ã®ã¿ãåŠçããããšãæå³ããŸãã
åè·¯å³ã調ã¹ããšãããã¡ã€ã³ããŒãã®CPUã«é¢ããå¥ã®èå³æ·±ã詳现ãèŠã€ããŸããã
NMIãã³ã®ã¿ãæ¥ç¶ãããINTãã³ã¯åžžã«é«ã¬ãã«ã®ã¯ããã¯ä¿¡å·ãç¶æããéã¢ã¯ãã£ãã®ãŸãŸã§ãïŒã€ãŸãããéåžžã®ããã¹ã¯ãããå²ã蟌ã¿ã¯å®è¡ãããããã¹ã¯ãããŠããªãå²ã蟌ã¿ã®ã¿ãçºçããŸãïŒã
ããã¯ãZ80ãæèŒããè»ã«ãšã£ãŠãéåžžã«çããããšã§ãã ç§ãæ±ã£ãŠãããã¹ãŠã®Z80ããŒã¹ã®ããŒã ã³ã³ãã¥ãŒã¿ãŒã§ã¯ãéã®ããšãåœãŠã¯ãŸããŸããããã¹ã¯å¯èœãªå²ã蟌ã¿ã®ã¿ã䜿çšãããã¹ã¯äžå¯èœãªå²ã蟌ã¿ã¯äœ¿çšããŸããã§ããã ãã¹ã¯ãããå²ã蟌ã¿Z80ã¯ããäžæ£ãªç¶èŠªãã§ããIntel 8080ãŸãã¯ç«¶åä»ç€Ÿã§ããMOS 6502ã®ããªããã£ãå²ã蟌ã¿ã·ã¹ãã ãšæ¯èŒããŠãéåžžã«æè»ã§æ·±å»ãªæ¹åã§ãããããããã®æè»æ§ã®åäžã¯ãåæã«ïŒå²ã蟌ã¿ã®ãœãŒã¹ãšããŠã®å Žåãé€ãã Z80ãã¡ããªã®ä»ã®ãããã䜿çšãããŸãããã®ãããã«ã¯ããã¹ã§æ¥ç¶ããããšãã«ããã§ã«è€éãªå²ã蟌ã¿ãããã³ã«ãçµã¿èŸŒãŸããŠããŸãã
ãŸããæ©åšã«ã€ããŠã®ååãªè©³çŽ°ã¯ããšãã¥ã¬ãŒã¿ã«ç§»ããŸãããïŒ
èµ·åæé
ã¡ã¢ãªæ§æã決å®ããåŸã®æ¬¡ã®ã¹ãããã¯ããšãã¥ã¬ãŒããããCPUããšãã¥ã¬ãŒããããã¡ã¢ãªå²ãåœãŠã¹ããŒã ã«æ¥ç¶ãããããªã¡ã¢ãªã®å 容ã®äœããã®èŠèŠåãèšé²ããCPUãµã€ã¯ã«ãéå§ããããšã§ãã
é©ãã¹ãããšã«ããã®ãããªå€§ãŸããªã¢ãããŒãã¯ãããŒãæé ãå®è¡ããŠç»é¢ã«äœãã衚瀺ããã®ã«ååã§ãã Bomb Jackãšãã¥ã¬ãŒã¿ãèšèšãããšãã0x9000ã0x93FFã®ç¯å²ã®1KBãããªã¡ã¢ãªã®å 容ã32x32ãã€ããããªãã¯ã¹ãšããŠååŸããŸããã ãã€ãã0ã®ãšããé»ãã¯ã»ã«ã®ãããã¯ã8x8ã§ã¬ã³ããªã³ã°ãããã以å€ã®å Žåã¯çœãã¯ã»ã«ã®ãããã¯ãã¬ã³ããªã³ã°ããŸããã
次ã«ããšãã¥ã¬ãŒããããCPUãå®è¡ããæé«ã®çµæãæåŸ ããŸããã èŠãïŒ ããçš®ã®èªã¿ãããç»åãçŸããŸããïŒ
äžã®ç»åã¯èµ·åæã®ããŒããŠã§ã¢ãã¹ãç»é¢ã®ããã«èŠããäžã®ç»åã¯èµ·åæé ãå®äºããåŸã«è¡šç€ºãããã¹ã³ã¢èšé²ç»é¢ã®ããã«èŠããŸãã
...ãããã90床å転ããŸããïŒããã¯è«ççã§ãããªããªããã¢ãŒã±ãŒããã·ã³ã®ç»é¢ã¯å€ãã®å ŽåãåçŽã®ã瞊ãåãã§ãã£ãããã§ãïŒã
çŽ æŽããããå§ãŸãã¯ææã§ãïŒ
次ã®ã¹ãããã¯ããããã®çœããããã¯ãã«ã©ãŒãã¯ã»ã«ã«å€æããæ¹æ³ãç解ããããšã§ãïŒããã¯å€§ããªã¹ãããã§ãã詳现ã«ã€ããŠã¯ããããªã®ãã³ãŒãã«é¢ããã»ã¯ã·ã§ã³ã§èª¬æããŸãïŒã
æåã¯ãã¹ãŠãéåžžã«è¿ éã«è¡ããããã¹ãç»é¢ã§ã¯ãèªã¿èŸŒã¿äžã«ãã¯ã»ã«ãšè²ã衚瀺ãããŸããïŒåŸã§ãè²ã®ãã³ãŒããå®å šã«ééã£ãŠããããšã«æ°ã¥ããŸãã...ïŒïŒ
ããããèšé²ç»é¢ã衚瀺ããããšãé»ãç»é¢ã衚瀺ãããŸããã ãé»ãã§ã¯ãªãããã«èæ¯è²ãããã¯ãããšããã¯ã»ã«ã¯ã¬ã³ããªã³ã°ãããŸãããã«ã©ãŒãã¬ããå šäœãé»ã§ããããšãããããŸããã ããŒã...
ãã®ç»é¢ãæ°åéèŠãŠããã€ã¹ã³ã¢ç»é¢ã®è²ã®äžéšãã¢ãã¡ãŒã·ã§ã³åãããŠããããšãæãåºããŸãããã¢ãã¡ãŒã·ã§ã³ãããå Žåã¯ãäœããã®ã¿ã€ããŒãããã¯ãã§ãã ãã®æ©åšæ§æã®æéã®è«ççãªãœãŒã¹ã¯ããã£ã¹ãã¬ã€ã®VSYNCä¿¡å·ãããã³CPUã®NMIãã³ã«æ¥ç¶ãããVSYNCã§ãïŒVSYNCã§ã¯ãªããVBLANKãVSYNCä¿¡å·ãšå·Šäžé ã«ç§»åããé°æ¥µç·ããŒã ã®éã®çãç¬éã§ãïŒã
ãããŠãç§ã¯ãŸã ãã®ãã¹ãŠãå®è£ ããŠããŸãã...
ç¿å€ãNMIåŠçã®æåã®ããŒãžã§ã³ãZ80ãšãã¥ã¬ãŒã·ã§ã³ã«è¿œå ãããããã¡ã€ã³ããŒãã®CPUã¿ã€ããŒæ©èœã®æåã®ã«ãŠã³ã¿ãŒvsync / vblankã«æ¥ç¶ãããšãçªç¶å€ãã®ããšãèµ·ããå§ããŸããïŒ
ãŸããè²ãã¬ã³ãŒãç»é¢ã«è¡šç€ºããããã®ãã¡ã®ããã€ããã¢ãã¡ãŒã·ã§ã³åãããŸããã
æ°ç§åŸãããã«ãšããµã€ãã£ã³ã°ãªããšãå§ãŸããŸããïŒ ãã€ã¹ã³ââã¢ãæ¶ããæåã®ãããã®å¥åŠãªèŠèŠåã衚瀺ãããŸããã ããã泚ç®ãéããããã®ã¢ãŒã±ãŒããã·ã³ã®ãã¢ã¢ãŒãã§ããããšã¯æããã§ãããæ¶ç©ºã®ãã ãžã£ãã¯ããããã®ç匟ãéããå°å³ã«ãžã£ã³ããããšæ¶ããã«ã©ãŒã¢ãã¡ãŒã·ã§ã³ã®ç匟ãããã€ãèŠãããŸããã
è²ã¯ãŸã å®å šã«ééã£ãŠããŸãããããŸã é²è¡äžã§ãïŒ
æ®ãã®ãããªãã³ãŒããè¡ãã®ã«é©åãªã¿ã€ãã³ã°ã§ãã
ãããªã¢ã€ãã³
Bomb Jackã®ãããªåŠçæ©åšã¯ã1984幎ã®8ããããã·ã³ã§éåžžã«åŒ·åã«èŠããŸããïŒ256x256ãã¯ã»ã«ã®è§£å床ã«ããããããã128ïŒ4096ïŒè²ãåæã«è¡šç€ºããæ倧24åã®ããŒããŠã§ã¢ã¹ãã©ã€ãïŒ16x16ãµã€ãºïŒãã¬ã³ããªã³ã°ã§ããŸãããŸãã¯32x32ïŒãã¯ã»ã«ããšã®è²ã§ã
åœæã®8ãããã®å®¶åºçšã³ã³ãã¥ãŒã¿ãŒã®ãã£ã¹ãã¬ã€è§£å床ã¯ã»ãŒåãã§ããããå€ãã®è²ã®å¶éããããŸããã ZX Spectrumããã³Amstrad CPCã®Bomb JackããŒãžã§ã³ãã¢ãŒã±ãŒããã·ã³ã®ããŒãžã§ã³ãšæ¯èŒãããšããããã®å¶éã¯éåžžã«æ確ã«è¡šç€ºãããŸãã
ZX Spectrumã®ããŒãžã§ã³ã¯ããã¯ã»ã«è§£å床ã¯éåžžã«è¯å¥œïŒ256x192ïŒã§ããããè²ã¯éåžžã«å°ãªããSpectrumã®å žåçãªãè²ã®ç«¶åãå¹æããããŸããïŒãã ããéçºè ã¯ç®ç«ããªãããã«åªåããŸããïŒã
Amstrad CPCã®ããŒãžã§ã³ã¯ãã«ã«ã©ãŒã§ãããããå€ãã®è²ãååŸããããã«ãéçºè ã¯äœè§£å床衚瀺ã¢ãŒãïŒ160x200ïŒã«åãæ¿ããå¿ èŠããããŸããã ãã®çµæããžã£ãã¯ãšã¢ã³ã¹ã¿ãŒã¯å€èªã§ããªããã¯ã»ã«ã®æã«å€ãããŸããã
ããããã¢ãŒã±ãŒããã·ã³ã®ããŒãžã§ã³ãšæ¯èŒããŠãã ãããã¢ãŒã±ãŒããã·ã³ã¯ãZX Spectrumãšåããã¯ã»ã«è§£å床ã§ããããã¯ããã«å€ãã®è²ãšãã¯ã»ã«ããšã®è²è§£å床ãåäžããŠããŸããã
ããã§èå³æ·±ãã®ã¯ãã¢ãŒã±ãŒãããŒãžã§ã³ã®ã°ã©ãã£ãã¯ãåªããŠããããšã§ãããã匷åãªããŒããŠã§ã¢ã§åäœããããïŒã°ã©ãã£ãã¯ããŒã¿ãæ ŒçŽããããã®ROMãå¢ããŸããããã³ã³ãã¥ãŒãã£ã³ã°ãã¯ãŒãã¯ã»ãŒåãã§ãïŒããããã€ã¹ã®éçºè ãéäžã§ããããã§ãããç¹å®ã®çš®é¡ã®ã²ãŒã å°çšã®ãã·ã³ã補é ããŠãããæ±çšã®æ±çšããŒã ã³ã³ãã¥ãŒã¿ãŒãäœæããå¿ èŠã¯ãããŸããã§ããã
ãã£ã¹ãã¬ã€ããŒããŠã§ã¢ã®åäœã¯æ¬¡ã®ãšããã§ãïŒå°ãªããšãç§ã®é«ã¬ãã«ã®è§£éã§ã¯ïŒã
3å±€ã®ãã£ã¹ãã¬ã€
å®æãããã ãžã£ãã¯ã®ãããªä¿¡å·ã¯ã3ã€ã®ã¬ã€ã€ãŒïŒèæ¯ã¬ã€ã€ãŒãããã³ãã¬ã€ã€ãŒãã¹ãã©ã€ãã¬ã€ã€ãŒïŒããçµåãããŸãã
ãã®ãããªã¬ã€ã€ãŒã·ã¹ãã ã«ã¯ãäž»ã«2ã€ã®å©ç¹ããããŸãã
- ããŒããŠã§ã¢ããŒã¹ã®ããããªãããŒãªç»åå§çž®ãå®è£ ããŠãããå°éã®ããŒã¿ãããé«è§£å床ãã®ãã«ã«ã©ãŒç»åãçæããŸãã
- åçãªç»é¢èŠçŽ ãæŽæ°ããããã«å¿ èŠãªCPUäœæ¥éãå€§å¹ ã«åæžããŸãïŒåšæ³¢æ°ã4 MHzã§ãã8ãããCPUã¯åšæ³¢æ°ã60 Hzã®256x256ãã£ã¹ãã¬ã€äžã®ãã®ãããªæ°ã®ãªããžã§ã¯ãã移åããã®ã«ååãªé»åãæã¡ãŸããïŒ
ãããªã¢ã€ãã³ã¯ã8ãããã®å®¶åºçšã³ã³ãã¥ãŒã¿ã§èŠããã®ãšã¯ãŸã£ããç°ãªããŸãããMAMEã§ã¯ãã®ã¿ã€ãã®æ©åšã®äžè¬åãããè£å©ã¯ã©ã¹ãå®è£ ãããŠãããããã¢ãŒã±ãŒããã·ã³ã§ã¯éåžžã«äžè¬çã§ãããšæšæž¬ã§ããŸãã
èæ¯ã¬ã€ã€ãŒ
èæ¯ã¬ã€ã€ãŒã¯ãROMã«åã蟌ãŸãã5ã€ã®èæ¯ç»åã®ãã¡1ã€ãã¬ã³ããªã³ã°ã§ããŸãã èæ¯ç»åã¯ãã¢ãã¬ã¹0x9E00ã«1ã5ã®å€ãæžã蟌ãããšã§éžæãããŸãïŒå€0ã¯ç¹å¥ã§ãå®å šã«é»ãèæ¯ãã¬ã³ããªã³ã°ããããã§ãïŒã
å®éããã®æ©åšã¯7çš®é¡ã®ç»åãã¬ã³ããªã³ã°ã§ããããã«èŠããŸãããã²ãŒã ã§ã¯5çš®é¡ãã䜿çšã§ããŸãããã²ããã«ãROMã§ä»¥åã«æ€åºãããªãã£ãç»åããŒã¿ãèŠã€ããããšæã£ãŠããŸããã ããããæ²ããããªã圌ãã¯ããã«ããŸããïŒã¯ããç§ã¯åœŒããããã«æ¢ãæåã®äººã§ã¯ãªããšæããŸãïŒã
ä»ã®2ã€ã®ã¬ã€ã€ãŒããªãå Žåã®æåã®ãããã®èæ¯ã¬ã€ã€ãŒã¯æ¬¡ã®ãšããã§ãã
èæ¯ã¬ã€ã€ãŒã¯16x16ãã¯ã»ã«ã®ã¿ã€ã«ããçµã¿ç«ãŠãããŸãã
ã¿ã€ã«ããèæ¯ç»åãäœæããå©ç¹ã¯ãåãã¿ã€ã«ãè€æ°å䜿çšã§ãããããROMã«ä¿åã§ããããŒã¿ãå°ãªããªãããšã§ãã éã空ããã©ãããã®äžéšããã©ãããã®äžã®ç ãåãã¿ã€ã«ã䜿çšããŠããããšã«æ³šæããŠãã ããã
ã¡ã¢ãªãç¯çŽããããã«ãèæ¯ã¬ã€ã€ãŒã®æ©åšã¯ããã«å¥ã®ããªãã¯ãå®è£ ããŠããŸã-ã¿ã€ã«ãæ°Žå¹³æ¹åã«å転ãããããšãã§ããŸãã ãœãããŠã§ã¢ããã®ããŒããŠã§ã¢æ©èœã䜿çšããªããšä»®å®ãããããå®è£ ã§ãããã»ãšãã©èŠéããŸãããã3çªç®ã®ã«ãŒãã®èæ¯ã«å°ããªãã°ãããããšã«æ°ä»ããŸããã
5çªç®ã®ãããã§ãåãããªãã¯ã䜿çšããŸããããäœãæ¢ãã¹ããããããªãå Žåãæ°ä»ãã®ãå°ãé£ãããªããŸãã
ããã³ãã¬ã€ã€ãŒïŒ
èæ¯ã¬ã€ã€ãŒã®äžã«ãããããã³ãã¬ã€ã€ãŒãã¯ãç»é¢ã®ãã¹ãŠã®åºå®éšåãã¬ã³ããªã³ã°ããŸãããCPUã«ãã£ãŠæŽæ°ããå¿ èŠããããŸãïŒäž»ã«ããã¹ãããã©ãããã©ãŒã ãç匟ïŒã ã¬ã€ã¢ãŠãã¯ãRAMïŒ1 KB RAMãš1 KBã«ã©ãŒRAMã®ãã©ã°ã¡ã³ãïŒããèªã¿åãããŸãã
æåã®ãããã®åé¢ãããããã³ãã¬ã€ã€ãŒã¯æ¬¡ã®ããã«ãªããŸãã
ããã³ãã¬ã€ã€ãŒãã¿ã€ã«ïŒããã³èæ¯ïŒã§æ§æãããŸãããããå°ããª8x8ã¿ã€ã«ã䜿çšããŸãã
èæ¯ãšåé¢ãå¥ã ã®ã¬ã€ã€ãŒã«åå²ããäž»ãªå©ç¹ã¯ãåé¢èŠçŽ ãäœæãŸãã¯åé€ãããšãã«ãCPUãèæ¯ãã¯ã»ã«ã®ä¿åãšåŸ©å ãå¿é ããå¿ èŠããªãããšã§ãã
ã¹ãã©ã€ãã¬ã€ã€ãŒ
æåŸã«ãããŒããŠã§ã¢ã¹ãã©ã€ããããã³ãã¬ã€ã€ãŒäžã«ã¬ã³ããªã³ã°ãããŸãã ç»é¢å ã移åãããã®ã¯ãã¹ãŠã¹ãã©ã€ãã«å®è£ ãããŠããŸããBomb Jackæ©åšã¯æ倧24åã®ã¹ãã©ã€ããã¬ã³ããªã³ã°ã§ããåã¹ãã©ã€ãã®ãµã€ãºã¯16x16ãŸãã¯32x32ãã¯ã»ã«ã§ããåæã«ãã¹ãã©ã€ãã¯ãã¯ã»ã«åäœã®ç²ŸåºŠã§é 眮ã§ããŸãã
8x8ã¿ã€ã«ãã³ãŒããŒ
ãããªãã³ãŒãè£ çœ®ã®äžå¿ã«ã¯ã128èŠçŽ ã®ã«ã©ãŒãã¬ãããš8x8ãã¯ã»ã«ã®ã¿ã€ã«ãã³ãŒããŒããããŸããã¿ã€ã«ãã³ãŒããŒã®ã¿ã¹ã¯ã¯ãã¿ã€ã«ã®64ãã¯ã»ã«ã®ããããã«å¯ŸããŠ7ãããã«ã©ãŒãã¬ããã€ã³ããã¯ã¹ãçæããããšã§ãã
ãããã®8x8ã¿ã€ã«ã¯ã16x16ããã¯ã°ã©ãŠã³ãã¿ã€ã«ã8x8ããã³ãã¬ã€ã€ãŒã¿ã€ã«ã16x16ãŸãã¯32x32ããŒããŠã§ã¢ã¹ãã©ã€ããªã©ãç»é¢äžã®ãã¹ãŠã®æ§æèŠçŽ ã§ãã
ããã³ãã¬ã€ã€ãŒãã¬ã³ããªã³ã°ããããã®ãã®8x8ã¿ã€ã«ãã³ãŒããŒã®ãããã¯å³ã次ã«ç€ºããŸãïŒç解ãããšããïŒã
ãããããŠã³ãããã¯å³ã®èª¬æïŒ
- « » ( 32x32 ) ( 32x32). , , . 8x8 .
- . ( ). , , ( ).
- 8 , 8 ( ). , , 8x8 24 (3 ).
- 64 7- . 3 , 4 â . , , 16 «», 8 . 8 .
- ãããã¬ã€ã€ãŒãšã¿ã€ã«ã«ã©ãŒå€ããã³ã³ãã€ã«ããããã®7ãããã€ã³ããã¯ã¹ã¯ãã«ã©ãŒãã¬ãããã12ãããRGBã«ã©ãŒå€ãèŠã€ããããã«äœ¿çšãããŸãïŒã«ã©ãŒãã£ãã«ããšã«4ãããïŒãã«ã©ãŒãã¬ããã¯RAMã«ãããCPUã¯ããã䜿çšã§ããŸãïŒç§ãèŠãéãã§ã¯ããããªRAMãè²ãããã³ãã¬ããã¯èšé²ã®ã¿ã«äœ¿çšãããŸããå°ãªããšãCPUã¯ãããã®é åãžã®èªã¿åãã¢ã¯ã»ã¹ãå®è¡ããŸããïŒã
ããã¯ã3ã€ã®è¡šç€ºã¬ã€ã€ãŒã®ããããã§äœ¿çšãããäžè¬çãªã¿ã€ã«ãã³ãŒãã¹ããŒã ã§ãããåã¬ã€ã€ãŒã®ãã³ãŒãã¯å°ãç°ãªããŸãã
- 512 8x8. 9- , 8 . «» ( 4 , 4 ). 3 8x8 , , «» .
- 16x16, 16x16=256 256 (512 ). , 16x16 8x8, . , ; «» : 7 , .
- 16x16 32x32 , 4 16 8x8 . , 16x16 96 , 32x32 â 384 . , 3 , .
ã¿ã€ã«ãããã¬ã€ã€ãŒã®å€èŠ³ãããããç解ããããã«ãROMãã©ã€ãã¿ã€ã«ãPNGããã¡ã€ã«ã«å€æããŠãå°ãããªCã¹ãŒããããã°ã©ã ãäœæããŸãããïŒãã¯ã»ã«ããã3ãããã8ã°ã¬ãŒã¹ã±ãŒã«ã¬ãã«ã«å€æïŒã
以äžã«ãããã³ãã¬ã€ã€ãŒã®ROMãã©ã€ãã¿ã€ã«ç€ºããŸããæ°åãšããã¹ããã©ã³ãããã©ãããã©ãŒã ã¿ã€ã«ãç匟ïŒååã«åå²ïŒããã³ãžã£ãã¯ã¹ã¯ãªãŒã³ã»ãŒããŒã®ããŽã®äžéšãããã³ç»é¢äžéšã«è¡šç€ºãããã¹ã³ã¢ä¹æ°ã®ããŒã¿ã衚瀺ãããŸãïŒã¡ãªã¿ã«ãç»é¢å šäœãå転ããããããã¹ãŠã90床å転ããŸãïŒïŒ
次ã«ãèæ¯ã®ROMã¿ã€ã«ãæ€èšããŸããå®éã«ã¯ã16Ã16ã¿ã€ã«ã8Ã8ã¿ã€ã«ã«ãã³ãŒãããŠãããããããŸãã¯ã£ããããŠããŸãããå16Ã16ã¿ã€ã«ã¯ã4ã€ã®é£æ¥ãã8Ã8ã¿ã€ã«ããªãäœæãããããŸãã ãã ããããã2ããã®ãªã·ã£ç¥æ®¿ã®äžéšãããã3ããåãããã4ããé«å±€ãã«ãèªèã§ããŸãã
ãããŠæåŸã«ãROMã¹ãã©ã€ãã¿ã€ã«ã16x16ã¹ãã©ã€ããäžååãå ãã32x32ã¹ãã©ã€ããäžååãå ããŸãã
Bomb Jackã¹ã¯ãªãŒã³ã»ãŒããŒã®èå³æ·±ãããã¯ã¯ãããŽãåé¢ã®ã¿ã€ã«ãšã¹ãã©ã€ãããçµã¿ç«ãŠãããŠããããšã§ããéçºè ã¯ããã³ãã¿ã€ã«ROMã䜿ãæãããŠãããšæããŸãããã¹ãã©ã€ãROMã«ã¯ããŸãã¹ããŒã¹ãæ®ã£ãŠããŸããã
ã¹ãã©ã€ãæ©åš
ç匟ãžã£ãã¯ã®ã¹ãã©ã€ãè£ çœ®ã¯ãåœæã®å®¶åºçšã³ã³ãã¥ãŒã¿ãŒã§äœ¿çšãããŠãããã®ãšæ¯èŒããŠéåžžã«åŒ·åã§ãã
- æ倧24åã®ããŒããŠã§ã¢ã¹ãã©ã€ããã¬ã³ããªã³ã°ã§ããŸããã¹ãã£ã³ã©ã€ã³ããšã®ã¹ãã©ã€ãã®æ°ã«å¶éã¯ãªãã£ãããã§ãã
- ã¹ãã©ã€ãã®ãµã€ãºã¯16x16ãã¯ã»ã«ãŸãã¯32x32ãã¯ã»ã«ã«ããããšãã§ããŸã
- åã¹ãã©ã€ãã¯ãå ±éã®ã«ã©ãŒãã¬ããã§8è²ã®16ã¹ãããã®ãããããéžæã§ããŸãã
- ã¹ãã©ã€ãã®ãã¯ã»ã«ããšã®è²è§£å床ããããŸããã
- åã¹ãã©ã€ãã¯åçŽãŸãã¯æ°Žå¹³ã«å転ã§ããŸã
- åã¹ãã©ã€ãã¯ãROMã«ãã©ãã·ã¥ããã128åã®ã¹ãã©ã€ãã€ã¡ãŒãžã®ãããããéžæã§ããŸãã
ã¹ãã©ã€ãã·ã¹ãã ã®ãã¯ã»ã«ãšã¹ãã©ã€ãããã³ãŒãããå Žåãèæ¯ããã³ããã³ãã¬ã€ã€ãŒãšåã8x8ããŒã¹ã¿ã€ã«ã䜿çšãããŸãã
ã¹ãã©ã€ãå±æ§ã¯ã0x9820ãã0x987Fã®ã¢ãã¬ã¹ç¯å²ã«ãããŸã-96ãã€ããã¹ãã©ã€ãããšã«4ãã€ããç§ãèŠãéãããã®ãšãªã¢ã¯é²é³å°çšã§ããå°ãªããšãCPUã¯ããã®ã¡ã¢ãªç¯å²ãžã®èªã¿åãã¢ã¯ã»ã¹ãå®è¡ããŸããã
åã¹ãã©ã€ãã¯4ãã€ãã§èšè¿°ãããŸãïŒ
- ãã€ã0ïŒ
- ããã7ïŒèšå®ãããŠããå Žåãããã¯32x32ã¹ãã©ã€ããããã§ãªãå Žåã¯16x16
- ããã6..0ïŒROMã¿ã€ã«å ã®ã¹ãã©ã€ãã€ã¡ãŒãžã®ãããã¬ã€ã€ãŒã®æ€çŽ¢ã«äœ¿çšãããã¹ãã©ã€ãã¿ã€ã«ã®ã³ãŒããèšå®ããããã®7ãããã
- ãã€ã1ïŒ
- ããã7ïŒèšå®ããå Žåãã¹ãã©ã€ãã¯æ°Žå¹³æ¹åã«å転ããŸã
- ããã6ïŒèšå®ããå Žåãã¹ãã©ã€ãã¯åçŽã«å転ããŸã
- ããã3..0ïŒã¿ã€ã«ãã³ãŒããŒã®ã«ã©ãŒå€ãèšå®ããããã®4ããã
- ãã€ã2ïŒç»é¢äžã®X軞ã®ã¹ãã©ã€ãã®äœçœ®
- ãã€ã3ïŒY軞ã«æ²¿ã£ãç»é¢äžã«ããã¹ãã©ã€ãã®äœçœ®
ãã€ã1ã®ããã4ãš5ãäœãããã®ãã¯æ確ã§ã¯ãããŸãããMAMEã®ã³ã¡ã³ãã¯æ¬¡ã®ããã«è¿°ã¹ãŠããŸãã
e ? (, )
f ? (, (B)?)
ã¡ã¢ãªI / OããŒã
ã¡ã€ã³ããŒãã®å ¥å/åºåããŒãã«é¢ããããã€ãã®æ³šæã äžèšã®ããã«ãI / OããŒãã¯æ¬¡ã®ããã«ãªããŸãã
- 9E00 ïŒæžã蟌ã¿ïŒçŸåšã®èæ¯ç»åçªå·ãèªã¿åãïŒ-
- B000 ïŒèªã¿åãïŒãã¬ãŒã€ãŒ1ã®ãžã§ã€ã¹ãã£ãã¯ã®ç¶æ ãæžã蟌ã¿ïŒNMIãã¹ã¯ã®æå¹å/ç¡å¹å
- B001 ïŒèªã¿åãïŒãã¬ãŒã€ãŒ2ãžã§ã€ã¹ãã£ãã¯ã®ç¶æ ãæžã蟌ã¿ïŒ-
- B002 ïŒèªã¿åãïŒã³ã€ã³ãšã¹ã¿ãŒããã¿ã³ãæžã蟌ã¿ïŒ-
- B003 ïŒèªã¿åãïŒCPUãŠã©ããããã°ãæžã蟌ã¿ïŒ???
- B004 ïŒèªã¿åãïŒãã£ããã¹ã€ãã1ãæžã蟌ã¿ïŒç»é¢ã®åãæ¿ã
- B005 ïŒèªã¿åãïŒãã£ããã¹ã€ãã2ãæžã蟌ã¿ïŒ-
- B800 ïŒæžã蟌ã¿ïŒã³ãã³ããµãŠã³ãã«ãŒããèªã¿åãïŒ-
äžèšã§æ¢ã«æ€èšããã¢ãã¬ã¹0x9E00ïŒèæ¯ç»åã®éžæïŒãããã³ã¢ãã¬ã¹0xB800ïŒã³ãã³ããµãŠã³ãã«ãŒãïŒã¯æ¬¡ã®ã»ã¯ã·ã§ã³ã§æ€èšããŸãã 0xB000ãã0xB005ã®ã¢ãã¬ã¹ã®ãŸãŸïŒ
ã¢ãã¬ã¹0xB000ããã³0xB001ããèªã¿åããšã2ã€ã®ãžã§ã€ã¹ãã£ãã¯ã®çŸåšã®ç¶æ ãè¿ãããŸãã ããªã»ãããã€ãã¯ãéãããããžã§ã€ã¹ãã£ãã¯ã¹ã€ããã瀺ããŸãã
- ããã0 ïŒæ£ããæ¹å
- ããã1 ïŒå·Šæ¹å
- ããã2 ïŒäžæ¹å
- ããã3 ïŒäžæ¹å
- ããã4 ïŒãžã£ã³ããã¿ã³ãæŒããã
æ®ãã®3ãããã¯ç¡èŠãããŸãã
0xB002ããèªã¿åããšãã³ã€ã³ã¢ã¯ã»ãã¿ãŒãš[ã¹ã¿ãŒã]ãã¿ã³ã®ã¹ããŒã¿ã¹ãè¿ãããŸãã
- ããã0 ïŒãã¬ã€ã€ãŒ1ã®ã³ã€ã³ãæããããŸã
- ããã1 ïŒãã¬ã€ã€ãŒ2ã®ã³ã€ã³ãæããããŸã
- ããã2 ïŒãã¬ãŒã€ãŒ1ã®ã¹ã¿ãŒããã¿ã³
- ããã3 ïŒãã¬ãŒã€ãŒ2ã®ã¹ã¿ãŒããã¿ã³
ã¢ãã¬ã¹0xB004ããã³0xB005ããèªã¿åããšãã¢ãŒã±ãŒããã·ã³ã®åäœãæ§æããããã«äœ¿çšããããã£ããã¹ã€ããã®ç¶æ ãè¿ãããŸãã
- B004 ïŒ
- ããã0ã1 ïŒ1ã€ã®ã³ã€ã³ã«äžãããããã²ãŒã ãã®æ°ïŒ1ã2ã3ããŸãã¯5ïŒ
- ããã2,3 ïŒãã¬ãŒã€ãŒ2ã§ãåã
- ããã4ã5 ïŒã²ãŒã ããšã®ã©ã€ãæ°ïŒ3ã4ã5ãŸãã¯2ïŒ
- ããã6 ïŒã¢ãŒã±ãŒããã·ã³ã®å ŽæïŒãã«ã¯ãã«ããŒãã«ããŸãã¯ãåçŽãã
- ããã7 ïŒã¹ã¿ã³ãã€ã¢ãŒãã§ãµãŠã³ããåçãããã©ãã
- B005 ïŒ
- ããã3.4 ïŒé£æ床1ïŒé³¥ã®é床ïŒ
- ããã5,6 ïŒé£æ床2ïŒæµã®æ°ãšé床ïŒ
- ããã7 ïŒç¹å®ã®ã³ã€ã³ã®çºçé »åºŠ
æåŸã«ãã¢ãã¬ã¹B003ããã®èªã¿åãã«ããããœãããŠã§ã¢ãŠã©ããããã°ãå®è£ ãããŸãã CPUã¯ãã°ãã°ãã®ã¢ãã¬ã¹ããèªã¿åãå¿ èŠããããŸããããããªããšãã¢ãŒã±ãŒããã·ã³ãããŒããŠã§ã¢ãªã»ãããå®è¡ããŸãã äœããã®çç±ã§ã²ãŒã ãã¯ã©ãã·ã¥ããå Žåãæ©åšã¯èªåçã«åèµ·åããŸãã
ããã€ãã®I / OããŒãã¢ãã¬ã¹ã«æžã蟌ãããšãã§ããŸãã
- B000 ïŒvblankã®éã«NMIãçæããå¿ èŠããããã©ããã èµ·åæé äžã®ã¿ç¡å¹ã«ãªã£ãŠããããã§ã
- B004 ïŒç»é¢å šäœãå転ããŸãã ãã®æ©èœã®äœ¿çšã«äŒã£ãããšã¯ãããŸããããããã«ã€ããŠã®çè«ããããŸãïŒä»¥äžãåç §ïŒ
ã²ãŒã ããã¬ã€ãããšããç§ã¯ãã®äœ¿çšãèŠãããšããªãã®ã§ãç»é¢å転æ©èœã¯å°ãæ··ä¹±ããŠããŸãã ããããç§ã¯åœŒãäœãããŠããã®ãã«ã€ããŠã®äºæããããŸãããããã確èªããã«ã¯ãã³ãŒããæžãå¿ èŠããããŸãã ã¢ãŒã±ãŒããã·ã³ããã«ã¯ãã«ããŒãã«ãæ§æã®å Žåã2人ã®ãã¬ã€ã€ãŒãåããåã£ãŠåº§ããŸãã ãããã£ãŠãã²ãŒã ããã¬ãŒã€ãŒ1ãããã¬ãŒã€ãŒ2ã«åãæ¿ãããšããã®é¢æ°ã¯ç»é¢ãå転ãããããšãææ¡ããŸããã ãã ãããšãã¥ã¬ãŒã¿ã«2ãã¬ã€ã€ãŒã¢ãŒãããŸã å®è£ ããŠããŸããã
ãµãŠã³ãããŒã
ãµãŠã³ãã«ãŒãèªäœã¯ãZ80 CPUïŒ3 MHzã®åšæ³¢æ°ã§åäœïŒã3ã€ã®ãµãŠã³ããããïŒ1.5 MHzã®åšæ³¢æ°ã§åäœããAY-38910ïŒãããã³RAMãšROMãåãããã«æ©èœã®ã³ã³ãã¥ãŒã¿ãŒã§ãã ãµãŠã³ãã«ãŒãã®ã¡ã¢ãªå²ãåœãŠã¹ããŒã ã¯éåžžã«åçŽã«èŠããŸãã
- 0000..2000 ïŒ8 Kãã€ãã®ROM
- 4000..4400 ïŒ1 KBã®RAM
- 6000 ïŒã¡ã€ã³ããŒãããã®ãµãŠã³ãã³ãã³ã
0x8000ã¢ãã¬ã¹ããäžã®ã¡ã¢ãªå²ãåœãŠã¹ããŒã ã«ã¯èå³æ·±ããã®ããªããããCPUã®æäžäœã¢ãã¬ã¹ã³ã³ã¿ã¯ãã¯æ¥ç¶ãããŠããŸããã
ç¹å¥ãªã¢ãã¬ã¹0x6000ã¯ãã¡ã¢ãªã«ããI / OããŒãïŒ8ãããã©ããïŒã§ãããå®éã®RAMã«å¯Ÿå¿ããŠããŸããã ããã¯ãã¡ã€ã³ããŒãã®0xB800ã«ããããŒããšåãã§ãã ããã¯ãã¡ã€ã³ã«ãŒããšãµãŠã³ãã«ãŒãã®éã®éä¿¡ãã£ãã«ã§ãã
3ã€ã®ãµãŠã³ããããã¯ãã¡ã¢ãªããŒãã§ã¯ãªãããããã®Z80åºååœä»€ã«ãã£ãŠå¶åŸ¡ãããŸãã AY-3-8910ã¯2ã€ã®I / OããŒãã®ã¿ãéããŠãããæåã®ããŒãã¯ã¬ãžã¹ã¿çªå·ã®ä¿åã«äœ¿çšããã2çªç®ã®ããŒãã¯æåã®ããŒãã§æå®ãããã¬ãžã¹ã¿ã®å 容ã®æžã蟌ã¿ãŸãã¯èªã¿åãã«äœ¿çšãããŸãã
I / Oåè·¯ã¯æ¬¡ã®ãšããã§ãã
- 0x00 ïŒæåã®ãµãŠã³ããããïŒã¬ãžã¹ã¿éžæ
- 0x01 ïŒæåã®ãµãŠã³ããããïŒéžæããã¬ãžã¹ã¿ãžã®ã¢ã¯ã»ã¹
- 0x10 ïŒ2çªç®ã®ãµãŠã³ããããïŒã¬ãžã¹ã¿éžæ
- 0x11 ïŒ2çªç®ã®ãµãŠã³ããããïŒéžæããã¬ãžã¹ã¿ãžã®ã¢ã¯ã»ã¹
- 0x80 ïŒ3çªç®ã®ãµãŠã³ããããïŒã¬ãžã¹ã¿éžæ
- 0x81 ïŒ3çªç®ã®ãµãŠã³ããããïŒéžæããã¬ãžã¹ã¿ãžã®ã¢ã¯ã»ã¹
ãµãŠã³ããããAY-3-8910ã«é¢ããããã€ãã®èšèïŒ
ããã¯ããªãæšæºçãªããã€ã¹ã§ãããåœæã®å®¶åºçšã³ã³ãã¥ãŒã¿ãŒïŒããšãã°ãAmstrad CPCãZX Spectrum 128ãMSXã³ã³ãã¥ãŒã¿ãŒãªã©ïŒã§éåžžã«äººæ°ããããŸãã AY-3-8910ã¯å€ãã®ããªãšãŒã·ã§ã³ãšã¯ããŒã³ãçã¿åºããŸããïŒããšãã°ãYamaha YM2149ã¯ãããèªäœããã匷åãªãµãŠã³ããããã®ãã¡ããªãŒå šäœã®åºç€ãšãªããŸããïŒã
AY-3-8910ã«ã¯ã3ãã£ã³ãã«ã®æ¹åœ¢ä¿¡å·ã1ãã£ã³ãã«ã3ãã£ã³ãã«ãšããã¯ã¹ã§ãããã€ãºãžã§ãã¬ãŒã¿ãŒãããã³1ãšã³ãããŒããžã§ãã¬ãŒã¿ãŒããããŸãã 3ã€ã®ãã£ã³ãã«ãã¹ãŠã«ãšã³ãããŒããžã§ãã¬ãŒã¿ãŒã1ã€ãããªãã£ããããç¹ã«æçšã§ã¯ãªããã»ãšãã©ã®ã²ãŒã ã¯CPUã䜿çšããŠããŒã³ãšããªã¥ãŒã ãå€èª¿ããŸããã
ããã¯ãAY-3-8910ããããé«å質ã®ãµãŠã³ããäœæããããã«ããå€ãã®CPUä»å ¥ãå¿ èŠãšããããšãæå³ããŸãïŒããšãã°ãC64ã³ã³ãã¥ãŒã¿ãŒã®ã¹ã¿ã³ãã¢ãã³SIDããããšã¯ç°ãªããŸãïŒã
3ã€ã®ããªãã·ã³ãã«ãªãµãŠã³ãããããšããããå¶åŸ¡ããCPUã§äœãã§ããããèŠãã®ã¯é©ãã¹ãããšã§ãã Bomb Jackã®é³æ¥œãšå¹æé³ã¯ãã»ãšãã©ã®å®¶åºçšã³ã³ãã¥ãŒã¿ãŒã²ãŒã ã§èãããããã¯ããã«è±ãã§ãã
ãã®ãµãŠã³ãã«ãŒãã§æ¬åœã«èå³æ·±ãã®ã¯ãã¡ã€ã³ããŒãããã³ãã³ããåãåãæ¹æ³ã ãã§ãã
ãµãŠã³ãã³ãã³ãã©ãã
ããµãŠã³ãã©ãããã¯ãã¡ã€ã³ã«ãŒããšãµãŠã³ãã«ãŒãã«å ±éã®ã·ã³ã°ã«ãã€ãã¹ãã¬ãŒãžïŒ8ãããã©ããïŒã§ãã ã©ããã¯ãã¡ã€ã³ããŒãã®ã¢ãã¬ã¹0xB800ãšãµãŠã³ãã«ãŒãã®ã¢ãã¬ã¹0x6000ã«çµã³ä»ããããŠããŸãã
VSYNCã䜿çšããŠNMIå²ã蟌ã¿ããªã³ã«ãªããšããµãŠã³ãã«ãŒãã¯éåžžã«ç°¡åãªå²ã蟌ã¿ãµãŒãã¹æé ãå®è¡ããããŒããŠã§ã¢ã©ãããèªã¿åããéåžžã®ã¡ã¢ãªã¢ãã¬ã¹ã«æžã蟌ã¿ããä¿¡å·ãããããèšå®ããŸããããã«ããããã¡ã€ã³ã«ãŒããã«æ°ãããµãŠã³ãã³ãã³ããåä¿¡ãããããšãéç¥ããŸãã
ex af,af' ;0066 exx ;0067 ld hl,04390h ;0068 set 0,(hl) ;006b ld a,(06000h) ;006d ld (04391h),a ;0070 exx ;0073 ex af,af' ;0074 retn ;0075
NMIã³ã³ã¿ã¯ãã®ã¢ã¯ãã£ããŒã·ã§ã³æ¹æ³ã¯ãã¡ã€ã³ããŒãã®æ¹æ³ãšãããã«ç°ãªããŸãã
ã¡ã€ã³ããŒãã§ã¯ãVBLANKã®å®è¡äžã«NMIãã³ãã¢ã¯ãã£ãã«ãªããŸãã
ãã ãããµãŠã³ãã«ãŒãã§ã¯ãVSYNCãããªã¬ãŒããããšNMIãã¢ã¯ãã£ãã«ãªããVBLANKã®éã§ã¯ãªããå²ã蟌ã¿ãµãŒãã¹ããã·ãŒãžã£ã0x6000ã®ã©ããããããŒã¿ãèªã¿åããŸã§ã¢ã¯ãã£ãã®ãŸãŸã«ãªããŸãã
æ©åšãã¢ãã¬ã¹0x6000ããã®èªã¿åããèªèãããšãããŒãã³ãŒãããã2ã€ã®æäœãå®è¡ããŸãã
- ãµãŠã³ãã¯ãªããã®å 容ã0ã«ãªã»ãã
- NMIã³ã³ã¿ã¯ããéã¢ã¯ãã£ãã«ãªããŸã
å®éãããã¯æ¥è§ŠããŠã³ã¹ã®åçŽãªé€å»ã§ããã1ã€ã®ãµãŠã³ãã³ãã³ãã2åå®è¡ããããšã¯ã§ããŸããã
å¯äžã®çåãæ®ããŸããã¡ã€ã³ããŒããã©ã®ãããã®é »åºŠã§æ°ããã³ãã³ããæžã蟌ããã§ãïŒ2ã€ã®ããŒãã®ãšãã¥ã¬ãŒã·ã§ã³ãå®è£ ããæ¹æ³ã¯ããã«äŸåããããïŒã
printfã§ãããã°ããåŸãã¡ã€ã³ããŒãã60 Hzãã¬ãŒã ããšã«1ã€ã®ãµãŠã³ãã³ãã³ãããèšé²ããªãããšãããããŸããã ããã«ããããšãã¥ã¬ãŒã¿ã®ãã¡ã€ã³ãµã€ã¯ã«ãã®æ§é ãå€§å¹ ã«ç°¡çŽ åãããŸããã
çžäºã«ããŒã¿ã亀æããªããã°ãªããªã2å°ã®ãšãã¥ã¬ãŒããããã³ã³ãã¥ãŒã¿ãŒã®å ±åäœæ¥ã®åé¡ã¯ã1å°ã®ã³ã³ãã¥ãŒã¿ãŒã®ãšãã¥ã¬ãŒã·ã§ã³ãå¹²æžãªãã§äžåºŠã«å€ãã®ãµã€ã¯ã«ãå®è¡ã§ããå Žåã«ã®ã¿æå¹ã§ããããšã§ãã
ããšãã°ãææªã®å Žåã¯æ¬¡ã®ããã«ãªããŸãã
- ã³ã³ãã¥ãŒã¿ãŒ1ã§1ã€ã®åœä»€ãå®è¡ããŸã
- ã³ã³ãã¥ãŒã¿ãŒ2ã§1ã€ã®åœä»€ãå®è¡ããŸã
- ç¹°ãè¿ã...
ç§ã®Z80ãšãã¥ã¬ãŒã¿ãŒã¯ãååœä»€ã®ãšãã¥ã¬ãŒã·ã§ã³ãçµäºããã³éå§ããããã«æé©åãããŠããŸããããã®å Žåãã¡ã¢ãªãŒã«ãã©ãã·ã¥ããååœä»€ã®éå§ããã³çµäºæã«CPUã®ç¶æ ãã¡ã¢ãªãŒããããŒãããå¿ èŠãããããã§ãã CPUãå¹²æžããã«å€ãã®åœä»€ãåŠçã§ããå ŽåãCPUã®ç¶æ ïŒã»ãšãã©ïŒãã¬ãžã¹ã¿ã«ä¿åããæåŸã®åœä»€ã§ç¶æ ãã¡ã¢ãªã«ãªã»ããã§ããŸãã
ã€ãŸããçæ³çãªç¶æ³ã¯æ¬¡ã®ããã«ãªããŸãïŒãã¹ãã·ã¹ãã ã®ãã¬ãŒã å šäœã§å¹²æžãªãã«ãšãã¥ã¬ãŒããããã·ã¹ãã ãå®è¡ããŸãïŒåšæ³¢æ°ã4 MHzã§60 Hzã®CPUã®å Žåãããã¯ãã¬ãŒã ãããçŽ6äž7åãµã€ã¯ã«ããŸãã¯3åãã1äž6åæ瀺Z80ïŒã
Bomb Jackã䜿çšããå ŽåããµãŠã³ãã«ãŒããæåŸã®ã³ãã³ããèªã¿åãåã«ãã¡ã€ã³ããŒããæ°ããã³ãã³ããèšé²ããªãããã«ããå¿ èŠããããŸããã ã¡ã€ã³ããŒãããã¬ãŒã ããšã«1ã€ã®ã³ãã³ãããèšé²ããªãããšãç¥ãåã«ãã¡ã€ã³ããŒãã®ãµãŠã³ãã©ããã®èšé²ãã€ã³ã¿ãŒã»ãããããµã€ã¯ã«çªå·ãšã³ãã³ããã€ãããã¥ãŒã«ä¿åããã³ãã³ãã®è€éãªãã¥ãŒãäœæããå¿ èŠããããšèããŸããã
次ã«ããµãŠã³ãã«ãŒãããã¬ãŒã ãå®è¡ããŠãããšãã«ãã³ãã³ãã®ãµã€ã¯ã«æ°ã«éãããšãã³ãã³ããã¥ãŒããæ°ããã³ãã³ããååŸããŸãã
ãã®ãããªã·ã¹ãã ã¯æ©èœãããæ£ãããããã³ãŒãã®è€éããå€§å¹ ã«å¢å ãããã ããã
æçµçã«ãç§ã¯ãã¥ãŒã®ãªãã¯ããã«åçŽãªãœãªã¥ãŒã·ã§ã³ã䜿çšããããšã«ããŸããã ã¡ã€ã³ããŒãã«ã¯ãã¬ãŒã ããšã«1ã€ã®ã³ãã³ãããèšé²ãããªãããã2å°ã®ã³ã³ãã¥ãŒã¿ãŒã§å®è¡ã亀äºã«è¡ããããããããã¬ãŒã ããšã«2ã€ã®ã¿ã€ã ã¹ã©ã€ã¹ãå®è¡ããããã«ããŸããã
- ã¡ã€ã³ããŒãã®ãã¬ãŒã ã®ååãå®è¡ããŸã
- ãµãŠã³ãã«ãŒãã§ãã¬ãŒã ã®ååãå®è¡ããŸã
- ã¡ã€ã³ããŒãã§ãã¬ãŒã ã®åŸåãå®è¡ããŸã
- ãµãŠã³ãã«ãŒãã§ãã¬ãŒã ã®åŸåãå®è¡ããŸã
ããã«ããããµãŠã³ãã«ãŒãã¯ã¡ã€ã³ããŒãã«ãã£ãŠèšé²ããããã¹ãŠã®ã³ãã³ããæ£ããèªèããåæã«åãšãã¥ã¬ãŒã·ã§ã³ãæ°åãµã€ã¯ã«å®è¡ã§ããŸãã
ãã¡ããããã¹ãã·ã¹ãã ã60 Hzã®ãã¬ãŒã ã¬ãŒãã§åäœãããšããäºå®ã¯éåžžã«å€§èãªä»®å®ã§ã:)
ãããŠæåŸã®...
WebAssemblyã®ãšãã¥ã¬ãŒã¿ããŒãžã§ã³ã«é¢ããæåŸã®èå³æ·±ãäºå®ïŒ
WebAssemblyã§ãšãã¥ã¬ãŒã¿ãŒãå®è¡ããŠãããšãã®ããŠã³ããŒãããããã¹ãŠã®ãã¡ã€ã«ã®å§çž®ãµã€ãº
ããã113 Kãã€ãã«çããïŒ
- HTMLãCSSãããã³ãææžããJSã®å Žåã¯çŽ2.5 Kãã€ã
- Emscriptenã©ã³ã¿ã€ã JSãã¡ã€ã«ããã26.8 kb
- .wasmãã¡ã€ã«ããã83.7 KB
WASMãã¡ã€ã«ã«ã¯ãã¢ãŒã±ãŒããã·ã³ã®çµã¿èŸŒã¿ROMãå«ãŸããŠããŸãã
å§çž®ãããŠããªããããã®ROMã¯112 Kãã€ããå æããŸãã
ã€ãŸããçµ±åROMãåããå§çž®ãšãã¥ã¬ãŒã¿å šäœã¯ãéå§çž®ROMãšã»ãŒåãããªã¥ãŒã ãå æããŸã:)
112ãããã€ãã®ROMã¯çŽ57 KBã«å§çž®ãããŠããŸããã€ãŸããROMããŒã¿ã®ãªãWASMã®å§çž®ã³ãŒãã®å®éã®ãµã€ãºã¯30 KBïŒ84ã57ïŒæªæºã§ãã
8ãããã·ã¹ãã ã®å®å šãªãšãã¥ã¬ãŒã¿ãŒã«ã¯ããªãè¯ãããã§ã;ïŒ