From 62b8f504b37414b20719d527dc6a56f7f9de26fe Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 6 Aug 2016 14:26:21 -0700 Subject: [PATCH] Added separate debugger/non-debugger machine configs for the PC8080 machines (like most PCx86 machines do) --- devices/pc8080/machine/invaders/README.md | 72 +-- .../machine/invaders/debugger/README.md | 73 ++- devices/pc8080/machine/vt100/README.md | 123 +---- .../pc8080/machine/vt100/debugger/README.md | 134 ++++++ .../pc8080/machine/vt100/debugger/machine.xml | 30 ++ devices/pc8080/machine/vt100/machine.xml | 4 +- versions/pc8080/1.23.3/pc8080-dbg.js | 419 +++++++++--------- versions/pc8080/1.23.3/pc8080.js | 146 +++--- 8 files changed, 532 insertions(+), 469 deletions(-) create mode 100644 devices/pc8080/machine/vt100/debugger/README.md create mode 100644 devices/pc8080/machine/vt100/debugger/machine.xml diff --git a/devices/pc8080/machine/invaders/README.md b/devices/pc8080/machine/invaders/README.md index d7792bc66..15b5864a5 100644 --- a/devices/pc8080/machine/invaders/README.md +++ b/devices/pc8080/machine/invaders/README.md @@ -11,7 +11,9 @@ Space Invaders (1978) --- This is a test of [PC8080](/modules/pc8080/), a new 8080-based machine emulator recently added to the -PCjs Project. It is currently playable only in desktop browsers and uses the following hard-coded key mappings: +PCjs Project. + +It is currently playable only in desktop browsers and uses the following hard-coded key mappings: - 1: One Player - 2: Two Player @@ -20,71 +22,7 @@ PCjs Project. It is currently playable only in desktop browsers and uses the fo - D: Move Right - L: Fire Missile -Assorted [Space Invaders Hardware Notes](#space-invaders-hardware-notes) are collected below. +See the [Debugger Configuration](/devices/pc8080/machine/invaders/debugger/) for more control of the machine, along +with assorted [Space Invaders Hardware Notes](/devices/pc8080/machine/invaders/debugger/#space-invaders-hardware-notes). {% include machine.html id="invaders" %} - -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 PCx86) 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 PCx86), 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/debugger/README.md b/devices/pc8080/machine/invaders/debugger/README.md index 7ea9b9947..9bc60c43f 100644 --- a/devices/pc8080/machine/invaders/debugger/README.md +++ b/devices/pc8080/machine/invaders/debugger/README.md @@ -12,8 +12,9 @@ Space Invaders (1978) with Debugger ----------------------------------- The [PC8080](/modules/pc8080/) machine below is configured to run [Space Invaders](/devices/pc8080/machine/invaders/) -with a Control Panel and Debugger. It is currently playable only in desktop browsers and uses the following hard-coded -key mappings: +with a Control Panel and Debugger. + +It is currently playable only in desktop browsers and uses the following hard-coded key mappings: - 1: One Player - 2: Two Player @@ -22,6 +23,72 @@ key mappings: - D: Move Right - L: Fire Missile -Click the "Run" button when you're ready to start the simulation. +Click the "Run" button to start the simulation. You'll also find assorted +[Space Invaders Hardware Notes](#space-invaders-hardware-notes) below. {% include machine.html id="invaders" %} + +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 PCx86) 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 PCx86), 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/vt100/README.md b/devices/pc8080/machine/vt100/README.md index a17fc49e0..6e40a91c0 100644 --- a/devices/pc8080/machine/vt100/README.md +++ b/devices/pc8080/machine/vt100/README.md @@ -11,121 +11,16 @@ machines: DEC VT100 Terminal ------------------ -This is a work-in-progress emulation of another 8080-based machine: the VT100 Terminal. +This is a PCjs work-in-progress emulation of another 8080-based machine: the VT100 Terminal. -Unlike other VT100 emulators, this is not simply an emulation of VT100 protocols. It is a simulation of the original VT100 +Unlike other VT100 emulators, it is not simply an emulation of VT100 protocols. It is a simulation of the original VT100 machine, running the [VT100 Firmware](/devices/pc8080/rom/vt100/) inside the [PC8080](/modules/pc8080/) CPU emulator. +Admittedly, terminals aren't that useful in isolation, since they're designed to be connected to other (host) machines. +But once this PCjs VT100 Terminal simulation is fully operational, you can expect to see it used in conjunction with a variety +of other PCjs machines. + +For now, play with the [Debugger Configuration](/devices/pc8080/machine/vt100/debugger/), which also provides information +about VT100 internals and links to other technical resources. + {% include machine.html id="vt100" %} - -VT100 Memory Usage ------------------- - -As described in the [Technical Manual (July 1982)](http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/terminal/vt100/EK-VT100-TM-003_VT100_Technical_Manual_Jul82.pdf), -p. 4-15, 8Kb (0x2000) of ROM is located at 0x0000, and 3Kb (0x0C00) of RAM immediately follows it at 0x2000. The ROM at -0x0000 contains all the VT100's 8080 code. The VT100 also contains a 2Kb character generator ROM, but that ROM is not -addressable by the CPU; it is used directly by the Video Processor. - -See [DEC VT100 ROMs](/devices/pc8080/rom/vt100/) for more information about the ROMs. - -[vt100romhax](http://vt100romhax.tumblr.com/post/90697428973/the-vt100-memory-map-and-8080-disassembly) -(aka [phooky](https://github.com/phooky) aka Adam Mayer) further explains VT100 memory usage: - - Start End Size Description - 0x0000 0x1fff 8K Basic ROM - 0x2000 0x2012 18B Blank lines for refresh (6 x 3B) - 0x2012 0x204f 61B Stack area (grows down from 0x204e) - 0x204f 0x22d0 641B Scratch Pad/Setup Area(?) - 0x22d0 0x2c00 2352B Screen RAM - -VT100 I/O Ports ---------------- - -From p. 4-17 of the Technical Manual: - - READ OR WRITE - 00H PUSART data bus - 01H PUSART command port - - WRITE ONLY (Decoded with I/O WR L) - 02H Baud rate generator - 42H Brightness D/A latch - 62H NVR latch - 82H Keyboard UART data input - A2H Video processor DC012 - C2H Video processor DC011 - E2H Graphics port - - READ ONLY (Decoded with I/O RD L) - 22H Modem buffer - 42H Flags buffer - 82H Keyboard UART data output - -The PC8080 ChipSet component deals with the ER1400's Non-volatile RAM (NVR) ports, the Flags buffer, and the -DC011 and DC012 circuits, while the Keyboard component deals with the Keyboard UART. - -You might wonder why the PC8080 Video component doesn't manage the DC011 and DC012. In fact, the above labels are misleading. -If you look at the Functional Diagram on p. 4-53 of the Technical Manual, you'll see that DC011 and DC012 are really -peripheral components providing inputs to the Video Processor. Moreover, they are not exclusive to the Video Processor. -For example, the LBA7 output of the DC011 is also used to clock the NVR chip. - -In most respects, the VT100 Technical Manual provides a phenomenal amount of detail. -However, documentation for some of the above ports is almost non-existent. It's only thanks to -[third parties](https://github.com/phooky/VT100-Hax/blob/master/Platform%20Notes.md) that we have, for example, the following -information about the Flags buffer (port 0x42): - - Bit Active? Description - 7 H KBD Transmit Buffer Empty - 6 H LBA 7(?) (It's a pin on the backplane connector...) - used to clock NVR - line buffer address - 5 H NVR DATA - 4 L EVEN FIELD (comes out of the video timing generator) - 3 H OPTION PRESENT (terminal output option???) - 2 L GRAPHICS FLAG (is VT52 graphics card present) [I think he meant VT125 -JP] - 1 L ADVANCED VIDEO (is AVO present) - 0 H XMIT FLAG - -VT100 Video Processor ---------------------- - -Normally, the PC8080 Video component allocates its own video buffer, based on the specified buffer address -(*bufferAddr*) and other dimensions (eg, *bufferCols* and *bufferRows*), but the VT100 is a little unusual: -it has a custom Video Processor that uses DMA to request character data from any region of RAM, one line at a time. -It always defaults to address 0x2000 for the first line of character data, but each line terminates with 3 bytes -containing the attributes and address of the next line, so the location of subsequent lines will vary, depending -on the type of line: - -- Single-wide characters (80 or 132 columns) -- Double-wide characters (40 or 66 columns) - -In addition to single-wide vs. double-wide, line attributes can also specify double-high, along with whether the -top or bottom halves of the double-high characters should be displayed, because double-high always implies double-wide -(ie, there is no support for double-high, single-wide characters). - -Conssequently, a VT100 [machine XML file](machine.xml) must set the Video component's *bufferRAM* property -to "true", indicating that existing RAM should be used, and a new property, *bufferFormat* must be set to "vt100", -enabling support for the VT100's line data format; eg: - - -