From ac3dc76285f6649e1aa53c78e11de01cd5765146 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 30 Apr 2016 14:11:29 -0700 Subject: [PATCH 01/32] DIsk updates --- apps/pc/1981/visicalc/manifest.xml | 2 +- apps/pc/1982/esuite/manifest.xml | 2 +- apps/pc/1985/rogue/manifest.xml | 2 +- apps/pc/1987/thinktank/manifest.xml | 2 +- apps/pc/1988/moria/manifest.xml | 2 +- apps/pc/1992/moria/manifest.xml | 2 +- disks/pc/compiled/library.xml | 24 +++++++++---------- disks/pc/compiled/samples.xml | 2 +- .../unix/microport/system-v/2.3/manifest.xml | 14 +++++------ modules/pc8080/README.md | 2 +- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/pc/1981/visicalc/manifest.xml b/apps/pc/1981/visicalc/manifest.xml index 4823e9b66..27871b0d5 100644 --- a/apps/pc/1981/visicalc/manifest.xml +++ b/apps/pc/1981/visicalc/manifest.xml @@ -13,7 +13,7 @@ Lotus Development - Demo: VisiCalc (1981) + VisiCalc (1981) VC.COM README.md VisiCalc License diff --git a/apps/pc/1982/esuite/manifest.xml b/apps/pc/1982/esuite/manifest.xml index 762c444d8..de0607cf3 100644 --- a/apps/pc/1982/esuite/manifest.xml +++ b/apps/pc/1982/esuite/manifest.xml @@ -9,7 +9,7 @@ 1982 - Demo: Executive Suite (1982) + Executive Suite (1982) ESUITE.COM GAME.DAT MobyGames diff --git a/apps/pc/1985/rogue/manifest.xml b/apps/pc/1985/rogue/manifest.xml index a49221705..d04aa21fe 100644 --- a/apps/pc/1985/rogue/manifest.xml +++ b/apps/pc/1985/rogue/manifest.xml @@ -13,7 +13,7 @@ Jon Lane Michael Toy - Demo: Rogue (1985) + Rogue (1985) MKOPT.EXE ROGUE.COM ROGUE.EXE diff --git a/apps/pc/1987/thinktank/manifest.xml b/apps/pc/1987/thinktank/manifest.xml index e7d2232a6..09ca05171 100644 --- a/apps/pc/1987/thinktank/manifest.xml +++ b/apps/pc/1987/thinktank/manifest.xml @@ -8,7 +8,7 @@ Living Videotext September 25, 1987 - Demo: ThinkTank (1987) + ThinkTank (1987) AUTOEXEC.BAT READ_ME.DB READ_ME.SAV diff --git a/apps/pc/1988/moria/manifest.xml b/apps/pc/1988/moria/manifest.xml index bc0771df1..537552ea7 100644 --- a/apps/pc/1988/moria/manifest.xml +++ b/apps/pc/1988/moria/manifest.xml @@ -15,7 +15,7 @@ MSDOS port - Demo: Moria 4.872 (1988) + Moria 4.872 (1988) CONFIG.DOC GOD MADNESS1 diff --git a/apps/pc/1992/moria/manifest.xml b/apps/pc/1992/moria/manifest.xml index 23d6e182b..0967ea257 100644 --- a/apps/pc/1992/moria/manifest.xml +++ b/apps/pc/1992/moria/manifest.xml @@ -93,7 +93,7 @@ Macintosh port for Think C - Demo: Moria 5.5 (1992) + Moria 5.5 (1992) EXP.DOC MORIA.CNF MORIA1.TXT diff --git a/disks/pc/compiled/library.xml b/disks/pc/compiled/library.xml index e6ccfa3a3..7ed57a354 100644 --- a/disks/pc/compiled/library.xml +++ b/disks/pc/compiled/library.xml @@ -298,14 +298,14 @@ UNIX System V Runtime (Disk 1) UNIX System V Runtime (Disk 2) UNIX System V Runtime (Disk 3) - UNIX System V Runtime Utility Disk - UNIX System V Runtime System Vision + UNIX System V Runtime Utilities + UNIX System V Runtime System UNIX System V Runtime Link Kit - UNIX System V Software Dev (Disk 1) - UNIX System V Software Dev (Disk 2) - UNIX System V Software Dev (Disk 3) - UNIX System V Software Dev (Disk 4) - UNIX System V Software Dev Upgrade + UNIX System V Software (Disk 1) + UNIX System V Software (Disk 2) + UNIX System V Software (Disk 3) + UNIX System V Software (Disk 4) + UNIX System V Software Upgrade UNIX System V Text Prep (Disk 1) UNIX System V Text Prep (Disk 2) UNIX System V Text Prep (Disk 3) @@ -503,11 +503,11 @@ Wolfenstein 3D 1.4 MS Flight Simulator (1982) MS Flight Simulator (1984) - Demo: VisiCalc (1981) - Demo: Executive Suite (1982) - Demo: Rogue (1985) - Demo: ThinkTank (1987) - Demo: Moria 5.5 (1992) + VisiCalc (1981) + Executive Suite (1982) + Rogue (1985) + ThinkTank (1987) + Moria 5.5 (1992) Book: DOS Internals Book: The Undocumented PC Book: Undocumented DOS (Disk 1) diff --git a/disks/pc/compiled/samples.xml b/disks/pc/compiled/samples.xml index 792102076..3add95300 100644 --- a/disks/pc/compiled/samples.xml +++ b/disks/pc/compiled/samples.xml @@ -7,7 +7,7 @@ PC-DOS 2.00 (Disk 1) PC-DOS 2.00 (Disk 2) Microsoft Adventure - Demo: VisiCalc (1981) + VisiCalc (1981) Load Save diff --git a/disks/pc/unix/microport/system-v/2.3/manifest.xml b/disks/pc/unix/microport/system-v/2.3/manifest.xml index 6c39cc267..41d52c215 100644 --- a/disks/pc/unix/microport/system-v/2.3/manifest.xml +++ b/disks/pc/unix/microport/system-v/2.3/manifest.xml @@ -15,28 +15,28 @@ UNIX System V Runtime (Disk 3) - UNIX System V Runtime Utility Disk + UNIX System V Runtime Utilities - UNIX System V Runtime System Vision + UNIX System V Runtime System UNIX System V Runtime Link Kit - UNIX System V Software Dev (Disk 1) + UNIX System V Software (Disk 1) - UNIX System V Software Dev (Disk 2) + UNIX System V Software (Disk 2) - UNIX System V Software Dev (Disk 3) + UNIX System V Software (Disk 3) - UNIX System V Software Dev (Disk 4) + UNIX System V Software (Disk 4) - UNIX System V Software Dev Upgrade + UNIX System V Software Upgrade UNIX System V Text Prep (Disk 1) diff --git a/modules/pc8080/README.md b/modules/pc8080/README.md index 7ff058655..8a86ab9c0 100644 --- a/modules/pc8080/README.md +++ b/modules/pc8080/README.md @@ -12,7 +12,7 @@ Overview PC8080 is an 8080-based Machine Emulation Module. The code is derived from [PCjs](/modules/pcjs/), the IBM PC Emulation Module. -It is still a work-in-progress, so it likely contains code that will be removed from the finished version. +It is still a work-in-progress. The only demo currently available is this [8080 Test Machine](/devices/pc8080/machine/test/). PC8080 is currently comprised of the following non-shared components, as listed in [package.json](../../package.json) (see the *pc8080Files* property): From 8c5ab8d73bd3df9e481b252a1a0737d870557f7c Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sun, 1 May 2016 10:13:43 -0700 Subject: [PATCH 02/32] Clean up the CPU/ChipSet interface, and get the PC8080 Video component ready to actually do something --- _posts/2016-04-30-the-intel-8080-cpu.md | 10 +- devices/pc8080/machine/invaders/README.md | 59 ++ devices/pc8080/machine/invaders/machine.xml | 3 +- docs/pcjs/examples/components.xsl | 64 +- docs/pcjs/examples/pc-dbg.js | 726 ++++++++++---------- docs/pcjs/examples/pc.js | 614 ++++++++--------- modules/pc8080/lib/chipset.js | 56 +- modules/pc8080/lib/cpu.js | 4 +- modules/pc8080/lib/cpuops.js | 4 +- modules/pc8080/lib/cpusim.js | 12 + modules/pc8080/lib/debugger.js | 11 +- modules/pc8080/lib/video.js | 18 +- modules/pcjs/lib/chipset.js | 32 +- modules/pcjs/lib/cpu.js | 4 +- modules/pcjs/lib/video.js | 5 +- modules/shared/templates/components.xsl | 69 +- versions/pc8080/1.21.7/components.xsl | 64 +- versions/pc8080/1.21.7/pc8080-dbg.js | 314 ++++----- versions/pc8080/1.21.7/pc8080.js | 134 ++-- 19 files changed, 1210 insertions(+), 993 deletions(-) diff --git a/_posts/2016-04-30-the-intel-8080-cpu.md b/_posts/2016-04-30-the-intel-8080-cpu.md index 417f587bf..9b0199f61 100644 --- a/_posts/2016-04-30-the-intel-8080-cpu.md +++ b/_posts/2016-04-30-the-intel-8080-cpu.md @@ -46,11 +46,11 @@ The idea is to make [PC8080](/modules/pc8080/) sufficiently configurable so that [Space Invaders](/devices/pc8080/machine/invaders/)), as well as simpler terminal-based systems, like the CP/M-based systems of old. -In fact, as soon as Space Invaders is working, my next planned adaptation is a DEC VT100 terminal emulator (itself -an 8080-based machine) which can then be "wired up" to other PCjs machine simulations. This will not be yet-another -VT100-compatible emulation -- which, like 8080 emulators, has been done to death -- but rather a simulation -of the original VT100 hardware, building on [Adam Mayer's](https://github.com/phooky) work -[reverse-engineering the VT100](https://github.com/phooky/VT100-Hax). +In fact, as soon as [Space Invaders](/devices/pc8080/machine/invaders/) is working, my next planned adaptation +is a DEC VT100 terminal emulator (itself an 8080-based machine) which can then be "wired up" to other PCjs machine +simulations. This will not be yet-another VT100-compatible emulation -- which, like 8080 emulators, has been done to +death -- but rather a simulation of the original VT100 hardware, building on [Adam Mayer's](https://github.com/phooky) +work [reverse-engineering the VT100](https://github.com/phooky/VT100-Hax). *[@jeffpar](http://twitter.com/jeffpar)* *April 30, 2016* diff --git a/devices/pc8080/machine/invaders/README.md b/devices/pc8080/machine/invaders/README.md index 4415cce63..abe8e5e21 100644 --- a/devices/pc8080/machine/invaders/README.md +++ b/devices/pc8080/machine/invaders/README.md @@ -24,5 +24,64 @@ Assorted [Space Invaders Hardware Notes](#space-invaders-hardware-notes) are col Space Invaders Hardware Notes --- +### Memory Map + + 0000-1FFF r ROM code + 2000-23FF rw RAM + 2400-3FFF rw bitmapped screen (224x256) + +### I/O Map + + 00 r + 01 r control inputs + bit 7 + bit 6 right + bit 5 left + bit 4 fire + bit 3 + bit 2 1 player start + bit 1 2 player start + bit 0 coin slot + 02 r control inputs + bit 7 0=display coin info + bit 6 right 2 + bit 5 left 2 + bit 4 fire 2 + bit 3 bonus (1500,1000) / preset mode + bit 2 1=tilt + bit 0-1 initial lives (3,4,5,6) / (3,4) + 02 w shift count (0-7) + 03 r shifted value (low then high) + 03 w sound + bit 4 bonus base + bit 3 invader hit + bit 2 base hit + bit 1 base fire + bit 0 saucer + 04 w value to shift + 05 w sound + bit 5 flip video + bit 4 saucer hit + bit 3 invader movement 4 + bit 2 invader movement 3 + bit 1 invader movement 2 + bit 0 invader movement 1 + 06 w watchdog timer clear + +Note that, unlike most emulators, PC8080 (like PCjs) has a *[Bus](/modules/pc8080/lib/bus.js)* architecture, +allowing components to "plug in" different kinds of memory or memory-mapped devices at different addresses, +and to register specific functions for specific I/O ports. + +For example, Space Invaders has 8Kb of ROM at addresses 0x0000 through 0x1FFF, which means that if any 8080 code +attempts to write to those addresses, nothing should happen. Unfortunately, most emulators treat the entire address +space as one contiguous array of bytes. Which means either that the ROM is susceptible to corruption *or* that every +write operation must check the address to determine its validity, which hurts the performance of *all* writes. + +In PC8080 (and PCjs), all writes are equally fast, and all ROMs are fully protected. An exception is made for the +Debugger, which allows you to use the "e" command to modify ("patch") ROM code on the fly, but that is completely +outside and independent of the 8080 code being emulated. + +### Other Online References + See [Computer Archeology](http://www.computerarcheology.com/Arcade/SpaceInvaders/) for an excellent collection of materials on the original Space Invaders, including commented ROM disassemblies. diff --git a/devices/pc8080/machine/invaders/machine.xml b/devices/pc8080/machine/invaders/machine.xml index 2a511465d..260258b52 100644 --- a/devices/pc8080/machine/invaders/machine.xml +++ b/devices/pc8080/machine/invaders/machine.xml @@ -9,7 +9,8 @@ -