Sunday, March 2, 2014

A Hypothesis of the Tandy 1000 Parallel Ports

The Tandy 1000s, until the RL and TL/3, have a built in parallel port.  It does not use a standard DB-25 parallel port connector.  It uses a 34-pin card edge connector, and Tandy usually supplied adapter cables to connect to a Centronics 36-pin connector at the printer.  However, there are some very useful devices that use the parallel port as a generic input and output port.  Parallel port floppy drives, CD-ROMs, Zip drives, the Disney Sound Source and Network Adapters could in theory and with an adapter use these card edge ports.  What is unknown is whether Tandy 1000 ports can support any kind of standardized (and I mean that loosely) data input.  To begin the exploration of the Tandy parallel ports, first I will need to discuss a standard IBM PC printer port.

Unidirectional Printer Ports

The first parallel printer port for the IBM PC had eight data lines, five status lines and four control lines.  The data lines allowed the computer to send eight bits of data to the printer.  The four control bits would send control information to the printer, which could send five bits back to the PC on the status bits.  Thus, the parallel port has three registers, and in a system without a monochrome display adapter parallel port, their addresses are these :

0378 - Data Port
0379 - Status Port
037A - Control Port

The status port is read only, and the data and control ports are read and write capable.  If the data or control port is read, the computer will read the bits last sent to the port.  IBM warned against a printer or other external device trying to use the parallel port to write data on the lines meant for the data or control ports.  Thus these ports are designated as output only ports.  Officially, a printer communicated to the computer through the use of the status port.  This port is designated as an input only port.

The bit assignments for the status and control ports become important to the discussion below :

Line Name IBM Pin Active Low Direction Function Bit
Strobe 1 Yes Out Control Port 37A C0
Data 0 2 No Out Data Port 378 D0
Data 1 3 No Out Data Port 378 D1
Data 2 4 No Out Data Port 378 D2
Data 3 5 No Out Data Port 378 D3
Data 4 6 No Out Data Port 378 D4
Data 5 7 No Out Data Port 378 D5
Data 6 8 No Out Data Port 378 D6
Data 7 9 No Out Data Port 378 D7
Ack 10 Yes In Status Port 379 S6
Busy 11 No In Status Port 379 S7
Paper-Out 12 No In Status Port 379 S5
Select (Input) 13 No In Status Port 379 S4
Auto Linefeed XT 14 Yes Out Control Port 37A C1
Error 15 Yes In Status Port 379 S3
Init 16 Yes Out Control Port 37A C2
Select-In (Output) 17 Yes Out Control Port 37A C3
Ground           18-25




Strobe - The strobe signal is sent to the printer to alert it that there is valid data byte on the data output lines.  This signal is active low and held for at least 0.5uS.  AKA STB,
Ack - The acknowledge signal is sent from the printer to tell the computer that the printer has received the data byte and ready to accept more data.  This line is tied to IRQ7 through the IRQ enable bit, Control Port C4.  This signal is typically held low for 5uS.  AKA ACKNLG, PACK
Busy - The busy signal is sent from the printer to tell the computer, when high, that it cannot process data at the present time.  This is typically when the printer is busy processing data, printing data, when it is offline or has reported an error.
Paper Out - The out of paper signal is sent from the printer and, when high, tells the computer that the printer is out of paper.  AKA End of Form, P. End, PE, PAEM, Out of Paper
Select Printer (Status Port) - The printer selected signal is sent from the printer to indicate to the PC that, when high, the printer considers itself selected and on-line.  AKA Printer Selected, SLCT, SEL
Auto Linefeed XT - The auto linefeed signal is sent to the printer to tell it, when low, to advance the printer a line after a carriage return.  AKA AUTO FEED XT, AF
Error - The error signal is sent from the printer to the computer to alert the computer of a fault at the printer's end.  This is typically when the printer is offline, out of paper or has some error condition.  AKA FAULT
Init - The initialize printer signal is sent to the printer to tell it to reset itself and clear its printer buffer.  This signal must be held low for 50uS for it to be effective.  AKA PRIME
Select-Input (Control Port) - The printer select signal is sent to the printer to tell it that, when low, it has been selected and should be ready to receive data.  AKA SLCT IN, Select-In

One thing to note about these bits is that of the Control Port signals, the Strobe, Auto Linefeed and Select-In (Output) are all inverted as they are output from their register to the connector.  Since these are active Low, you must set these bits High (1) to activate these signals.  Also, the Busy signal, as it comes from the printer, is also inverted at the Status Port.  Since Busy is active High, a Low (0) bit means the Printer is Busy.

Not all bits are used by all printers.  Most printers have a dipswitch to set the printer to the Auto Linefeed mode, since this usually desired.  It is hard to imagine today that a printer or typewriter would not automatically advance to the next line after pressing the Carriage Return/Enter key.

IBM's Graphics Printer, essentially the standard of the day, had a dipswitch to always set Select Printer (which from the printer's perspective it is an output line) to the active state.

C5 is used as an Interrupt Enable line.  It is active High, so when a (1) is written to the bit, IRQ7 will be sent when the Ack signal becomes active.  The intended use for this signal is that the printer program, when the IRQ was sent, would know without having to waste time polling the Status Port that it could send the next byte to the printer.

Nibble Mode

Before the introduction of the PS/2 Bidrectional Mode, the Nibble mode was the only compatible way to read data from an external device connected to the parallel port.  The external device would drive its data onto the status port.  The high four bits of the port would be the easiest to use, which in this case would be the Busy, Ack, Paper Out and Select bits.  This would form a 4-bit nibble, and two nibbles would form a byte.  As the Busy signal is inverted, code would need to consider that in obtaining the right data nibble.

The Status Port is a 5-bit port, and if read eight times could be reformed into five bytes by including the Error bit in the read.

PS/2 Bidirectional Mode

In 1987, IBM released the PS/2 and it boasted of a bidirectional parallel port mode that would allow an external device attached to the parallel port to send eight bits of data to the computer via the data port.  TTL-based parallel ports for the IBM PC family, including IBM's, could easily be modified to do this.  In this case, Control Port C5, when set (1), would change the data output port to a data input port.  The default behavior was that C5 was not set (0).  When in data input mode, a read on the data port will give the value sent by the external device.  A write to the port would do nothing.

IBM's PS/2 and PS/1 family had more advanced bidirectional capabilities involving new registers outside the parallel port I/O space, but the basic functionality described in the previous paragraph is all that could be assumed on a regular PC compatible.

Tandy 1000

While there are the later EPP and ECP parallel ports, this post is primarily based on what the built-in ports of the Tandy 1000 are capable of, and none of them are capable of such advanced functionality.

Tandy 1000 printer ports are based off the pre-IBM Centronics standard and have some differences. Tandy marketed many, many printers, and they were designed to work with all its computer lines, including the TRS-80, the Color Computer and the Tandy 1000, 2000, 1200, 3000 & 4000.  Early printers did not use all the control and status lines of the IBM parallel printer port.  The two handshaking signals, strobe and ack, are the most important for any printer.

The Select signals are not used on Tandy printers.  Auto Linefeed is not used by some Tandy printers, the Init signal is not used by all Tandy printers and they provide an active low as well as an active high Busy signal on two separate pins.  Some Tandy printers also provide +5v on their Centronics connector at pin 18, you will want disconnect this pin at the DB-25 end of the cable if you use one of these printers.  Fortunately, pin 18 is unconnected on standard Centronics 36-pin male to DB-25 male printer cables.  Tandy Centronics connectors put Init, when used, at Pin 33, whereas it is on Pin 31 on IBM Centronics connectors.  This is the functional difference between Tandy Type A and B Card-edge to Centronics cables and Type C and D DB-25 to Centronics cables.

The Tandy 1000/A/HD have a 40-pin Parallel Port Array IC, it differs slightly from the later Array used on the SX, HX, EX and TX.  The technical reference implies that it is capable of bidirectional operation.  One difference is that the Auto Linefeed signal is on pin 32 of the 1000/A/HD card edge.  On later machines this signal is found on pin 27.  The Tandy 1000/A/HD connector leaves pin 34 unconnected, but later Tandys connect it to +5v.

The EX, HX, SX and TX all share the same Parallel Port Array IC and their ports are wired identically. While the IC has a pin (16) for the Select-Input (Control Port) line, it is not connected to any of the lines on the card edge.   Additionally, all five Status Port lines are connected from the card edge to the IC, so theoretically the port is capable of nibble transfers.  However, the Select Printer (Status Port) line usually needs to be connected via jumper to the Array IC because Tandy's printers do not use it).

Also, in theory, you could connect the Select-Input (Control Port) to the card edge and then to a parallel device by a custom adapter.  However, you would need a pullup resistor and a capacitor as the other lines have.

The TL and SL use the Jacksboro version of the PSSJ chip to implement a parallel port.  This chips does not have a pin for the Select-Input (Control Port) line at all.  Ditto for the TL/2, SL/2 and RL, even though they use the more advanced Bonanza PSSJ.  The number of pins on either version of the chip are the same.  Like the earlier devices, the Select Printer (Status Port) needs to be enabled via jumper.  On the TL/2 and RL, there are no jumper standoffs, so the jumper pins will need to be shorted.

The TL/3, RLX and RSX use the Hensdale version of the PSSJ, which has more pins and have a regular, bidirectional DB-25 parallel port.  The Select-Input (Control Port) and Select Printer (Status Port) lines are present on the connector.

Contructing a Converter Cable


Line Name        IBM Pin                    Tandy Pin
Strobe 1 1
Data 0 2 3
Data 1 3 5
Data 2 4 7
Data 3 5 9
Data 4 6 11
Data 5 7 13
Data 6 8 15
Data 7 9 17
Ack 10 19
Busy 11 21
Paper-Out 12 23
Select Input 13 25
Linefeed 14 32/27
Error 15 28
Init 16 30
Select-In Output 17
Ground            18-25                    see below

Fortunately, the 34-pin card edge connector used by the Tandy was also used by 5.25" floppy drives.  The Tandy printer card edge connector is not keyed while the floppy connectors usually are, so you will need to get an unkeyed connector or cut the plastic inside.  A short ribbon cable and a DB-25 female port connector is all that is required.  As you can see, the cable is very straightforward until IBM pin 15.  Never connect the card edge pin 34 to anything on a DB-25 connector. Pins 14, 26 and 32 are often grounded or unconnected, you can use one of the unconnected pins you try to connect Select In (Output).  Pins 2, 4, 6, 8, 10, 12, 16, 18, 20, 22, 24, 31 and 33 are connected to ground, but one Tandy ground wire for each DB-25 ground pin should be fine.

Covox Speech Thing & Disney Sound Source

The Disney Sound Source is an 8-bit D/A converter that is housed in a parallel port dongle and connected to a speaker.  The circuitry inside the dongle is powered by a 9V battery in the speaker, and a 4-pin wire with an RJ-11 jack connects the dongle to the speaker.  It does not require a bidirectional parallel port, but it does have a problem with the Tandy card edge port.

The problem is that the Sound Source, in addition to the eight data lines, uses the Ack, Init and Select-Input (Control Port) lines to control the D/A converter.  As the card edge does not include the Select-Input (Control Port)  line, the adapter will not work correctly in a Tandy.  Disney indicated that with a special adapter, the Auto Linefeed line could be used instead, but this would require a small modification to the code needed to run the Sound Source.

The Covox Speech Thing is a simpler device that does not use anything other than the data port, which is connected to a purely-passive resistor network to an audio jack.  The Tandy PSSJ DAC can emulate a Covox device using a program called Setdac, assuming the Covox-supporting program obeys DOS LPT address assignments.

Xircom PE3 Series Parallel Port Ethernet Adapters
Iomega Parallel Port Zip-100 Drives
MediaVision Audioport

Will only work with the ports in the TL3, RLX and RSX.  It is possible it may work in a TX or older if the Select-Input (Control Port)  line is brought to the connector.

Digital Joystick Adapters

The parallel port can be used as an adapter for simple, Atari-style digital joysticks.  This requires the game have specific support for this method.  Dyna Blaster is an example of a game that came with such an adapter.  In this case, the adapter had two DE-9 ports for Atari joysticks.  As you may recall from a prior post, there are many, many devices that are compatible with the Atari port.  For a game released in 1992 like Dyna Blaster, the user could use a spare Sega Master System or Mega Drive (Genesis) controller.

The maker of the adapter generally would not assume that the user would know the type of parallel port he had (unidirectional, bidirectional, EPP or ECP) or its setting.  Using the basic unidirectional port, five inputs bits are available on the status port.  Coincidentally, the basic Atari CX-40 joystick has four directional contacts and one button.  Each one can use one status bit to signal whether the directional or button has been pressed.  More buttons cannot be supported in this manner without activating some kind of multiplexer in the joystick.

Each button and joystick position hovers over an open switch.  The switch is closed when the user presses the joystick in a direction or the button down.  One contact of each switch is connected to a separate wire on the cable, and the other half of every switch is connected to a common wire.  Using one of the four control or eight data bits for the common wire, twelve joysticks could be controlled in this way.  The joystick essentially becomes a loop connector.

The Atari joystick has no chips inside it, nor does a Sega Master System or Atari 7800 controller, but the Genesis, NES and SNES controllers all have a logic chip or two that requires +5v.  Fortunately, the Tandy card edge provides +5v on pin 34 (except for the 1000/A/HD)  Using a dedicated line is much easier on the port than trying to combine the power with parallel port data pins as the NES and SNES adapters used by SNESkey do.

Parallel to SCSI Adapters

I take no credit for this discovery, that goes to my friend Cloudschatze, but there does exist a parallel port to Shuttle SCSI adapter that apparently works with the Tandy card-edge port to transfer data in both directions.  Shuttle made an adapter with a driver that will work in a pure bidirectional mode and overlook the lack of a Select-Input (Control Port) line, unlike other adapters.  Therefore, with the card edge to DB-25 converter, the Shuttle adapter and a SCSI storage device, it is quite possible to get the parallel port to transfer data to the Tandy, at least the *X or better models.

LapLink Cable

It is quite possible to get the MS-DOS program Interlnk to work with the Tandy 1000s and their parallel ports, see here for details :

http://nerdlypleasures.blogspot.com/2014/09/tandy-1000s-and-interlnk-and-laplink.html

Saturday, March 1, 2014

Evolution of 8088 PCs

From the first IBM PCs, there was a steady stream of innovation and improvements to PC compatible computers using an 8088 CPU.  However, there were also some bumps along the way.  In this entry, I will try to identify many of the positive and negative features of the main 8088 members of the IBM PC and Tandy 1000 families.

1.  IBM PC Model 5150 First Version

IBM PC BIOS 1st & 2nd Revision - The original PC BIOS was the byword for compatibility.  

Chassis - two full height drive bays, unique system board mounting, 13" maximum expansion board length, PC cone speaker.  

System Board & Expansion Cards - Use of off the shelf components or TTL logic chips, configuration by two rows of dipswitches.

Power Supply - The form factor would be the same for the IBM PC/XT and this established a standard "AT Power Connector", passthrough port for monochrome monitor

Expansion Slots - The 8-bit PC or XT slot was introduced.  Five slots were better than most other home computers at the time.  However, the floppy disk controller, the video card and memory cards each took up a slot, so expansion was limited.  

Cassette Interface - Important for saving programs in Cassette BASIC, used in Music Construction Set.  5-pin DIN connector, used TRS-80 cassette cables

Diskette Drive Adapter - Standard equipment, supports all double density drives, 34-pin card edge connector.

Diskette Drive (Single Sided) - Tandon TM100-1s were used in the beginning, supporting 160KB or 180KB per side.  4-pin molex connector used.

System Board Memory - 16-64KB on the motherboard, 16KB minimum, expandable to 544KB via expansion slot memory upgrades, first bank soldered, remaining three banks socketed.

System ROM - 6 x 8KB sockets, five used for BASIC and BIOS.  Empty socket, but requires an adapter for EPROMs.

IBM PC-DOS 1.0 - Included Disk BASIC and Advanced BASIC, loads COMMAND.COM, IBMIO.COM and IBMDOS.COM.  

Asychronous Communications Adapter - 8250B UART serial port, switchable between COM1 and COM2, DB-25 male connector.  Most can work in XT Slot 8.

Printer Adapter - Printer port, 378H (or 278H with modification), DB-25 connector female connector

Game Control Adapter - DA-15 female connector, joystick support (third party), four axes and four buttons.

Monochrome Display and Printer Adapter - DE-9 female display connector, 80-column text, 9x14 character cell, TTL monochrome displays only

IBM PC Display Model 5151 - Display for the above adapter and later Hercules Graphics Card, powered through PC power supply, long persistence phosphor, monochrome green screen, brightness and contrast controls.

Color/Graphics Adapter - CGA, 16 colors selectable, 4-color palettes, 40 & 80 column text mode, composite color output, artifact color, 320x200 and 640x200 graphics modes, RCA composite video jack, light pen support, RF switchbox (third party) support

Math Coprocessor - Unidentified at first, empty 40-pin socket for 8087 upgrade.  

IBM PC Keyboard - 83-key first standard keyboard, Function keys on side, buckling spring technology, 5-pin DIN connector

IBM Graphics Printer Model 5152 - Epson MX-80 clone, parallel printer, dot matrix printer

2.  IBM PC Second Version

IBM PC BIOS 3rd Revision - Fixed bugs, added support for 640KB of memory, bootable option ROMs

IBM PC-DOS 1.1 - Double sided disk drive support, used Tandon TM100-2As.

Double sided disk drives - 320K and 360K per disk supported

System Board Memory - 64KB to 256KB on system board, now expandable to 640KB via expansion slot upgrades

Bootable ROM - Devices can have a boot ROM and the BIOS will allow the device to install its own boot handler, booting directly to a hard drive now possible.  EGA and VGA support possible.

3.  IBM PC/XT Model 5160

System Board - Configuration now only by one bank of dipswitches.  Memory autodetected, tested and counted at bootup.  Faster bootup compared with PC.

Cassette Interface - Eliminated, making Cassette BASIC vestigial for programs that require it

IBM PC Color Display Model 5153 - Official CGA monitor (.31 dot pitch), 16 color support (intensity bit not properly supported on some third party monitors), color #6 brown, 14/13" viewable screen, vertical hold and size controls.  

IBM Expansion Unit Model 5161 - Adds seven more ISA slots, and official method to add hard disk drive to PC (whose power supply was not considered to output sufficient power to supply hard drive requirements)

IBM Graphics Printer Model 2 - Printer capable of supporting all IBM Extended ASCII characters.  Earlier printer did not.

Expansion Slots - Standard 8 expansion slots, distance between slots standardized for what would become known as ISA slots.  Slot 8 is on custom bus and only works with special cards (like the Async card).  Only 6 slots can support full length cards due to the case.  

Revised Expansion Card Brackets - Early PC brackets are black and color and are wider than later silver brackets.  This can be a problem using cards side by side in later systems.

Power Supply - 130W, sufficient to support a hard drive and more

Fixed Disk Adapter - Built around Xebec chips, standardized XT hard drive controllers, including XT-IDE drives, supports two MFM drives, slow 6:1 interleave.    

Fixed Disk - 10MB Seagate ST-412, Cylinder/Head/Sector addressing, MFM, Full Height.

System Board Memory - Same four banks as IBM PC, but all four banks socketed

IBM PC-DOS 2.0 - 9 sector floppy disks supported for 180KB per side or 360KB per disk, device driver support, revised file handling system, hard disk support (15MB maximum)

ROM Sockets - Support Standard 32KB EPROMS for 64KB ROM (only 40KB used on XT first BIOS)

Secret Memory Expansion - By adding a 74LS158 chip to socket U84, jumpering E2 and replacing the 64Kx1 RAM chips in banks 0 and 1 with 256Kx1 chips, you can have 640KB on the motherboard.  Later XTs come with the mod.

4.  IBM PC Portable

Composite Monochrome Monitor - 5" amber screen, composite connection to CGA card

Half-Height Diskette Drive - Two supported

Portability - For 1983, this meant a sturdy handle, a slightly modified keyboard that could attach to the chassis, and a power plug.  System weighed almost 40 pounds.  Only two full length cards supported

5.  IBM PCjr. Model 4860

Cartridge Slots - For games and software, up to 64KB for each cartridge, two supported.  Also used for Cartridge BASIC.  Only appears on PCjr. and JX.  

Sidecar Expansion Bus - Attach expansion boards without having to open computer, including parallel port and memory expansions.  It lengthens the physical footprint of the system.

Cordless Keyboard - IR keyboard powered by 4xAA batteries and allowing for cordless operation 20-feet away, line of sight must be maintained, keyboard cord optional.  

Internal Modem - 300 baud Novation non-Hayes compatible modem.  Special internal slot connector, standard RJ-45 port.

System Board Memory - 64KB on motherboard, 64KB via internal expansion card, up to 736KB total via sidecar.  System designed for 128KB, program must support extra RAM (Flight Simulator 2.0) or DOS must have a device driver to load more RAM

Enhanced CGA - Adds 160x200x16, 320x200x16 and 640x200x4 modes, but only BIOS level CGA compatibility

IBM PCjr. 3-Voice Sound - 3 square wave channels plus noise, 11-bit frequency selection, 4-bit volume control per channel, periodic and white noise selectable at four frequencies.  Requires external speaker of some kind

System Configuration - Totally jumperless and dipswitchless, internal expansion cards and external IBM expansions automatically detected, memory detected (up to 640KB) and configured via software

Diskette Drive Controller - Only one drive supported, accessed at different ports, uses 34-pin header

Proprietary Expansion - External ports use unique BERG connectors.  

Cassette Interface - Last PC compatible system to include a cassette interface.  Only official IBM cassette cable is for the PCjr.

TV Connector - Only official IBM RF switchbox is for the PCjr.

Joysticks - Gameport on systemboard, supports two joysticks without a y-adapter.  Only official IBM Joystick of the PC line is for the PCjr.  Joysticks function the same as PC joysticks, just have a different connector.

Serial Port - Includes 8250B Serial Port, official IBM DB-25 adapter available.  Uses COM2 resources, 278H/03I, but BIOS calls it COM1 if internal modem is not installed.

Power & Cooling - 33W power card came first, followed by 45W card.  45W sufficient to power three sidecars.  Only system here able to be run silently without risking overheating the power supply since the fan cools the disk inside the disk drive.  

IBM PCjr. Color Display Model 4863 - Higher dot pitch (.42) than the PC Color Display, but also includes a speaker and uses the PCjr. video connector.

IBM Compact Printer - IBM's official serial printer, uses PCjr. serial connector, can use an adapter for any serial port, low cost thermal printer, surprisingly decent.  

IBM PCjr. Speech Attachment - IBM's implementation of TI's Speak and Spell technology and more. Built in vocabulary.  Capable of recording and playback of digitized sound.  Later emulated by many devices.  

Compatibility - Compatible with most IBM software, but notable exceptions include Microsoft Decathalon, 101 Monochrome Mazes and Microsoft Flight Simulator 1.x.  Usually not so compatible with 3rd party software not written to take the PCjr. into consideration.  

IBM PC-DOS 2.1 - Adds full BASIC support for PCjr's advanced graphics and sound, but requires Cartridge BASIC to work at all.

6.  Tandy 1000 Model 25-1000

Expansion Slots - 3 standard XT slots, but only 10" cards or shorter supported

PCjr. Features - Brought over the Enhanced CGA and 3-Voice sound from the PCjr.

Compatibility Improvements - Unlike the PCjr., the Tandy 1000 could run most PC software that accessed the hardware directly.  

Tandy 1000 Keyboard - 90 keys, including separate cursor keys and F11 and F12 keys, but support for these keys was hit or miss.  

DMA & Memory Upgrades - Upgradeable to 384KB and DMA with one Board, 640KB with a second board.  Full DMA support compared to PCjr (which only allowed DMA for floppy, and available via 3rd party upgrades only)

Printer Port - Built in, but limited and uses card edge connector

Power Supply - 54W, considered adequate for two drives and three expansion cards

Tandy CM-2 High Resolution RGBI Color Monitor - Later known as the CM-10 and CM-11, this was the Tandy equilavent of the IBM PC Color Display, although the dot pitch (.43) is not quite as sharp as IBM's (.31)

Tandy MS-DOS 2.11 - GW-BASIC supports enhanced graphics and sound of the Tandy 1000s, no FDISK to partition hard drive.

7.  Tandy 1000A Model 25-1000A

Coprocessor - Adds 8087 Math Coprocessor Support

286 Express Upgrade - Compatible without special daughter board the plain 1000 requires.

8.  Tandy 1000HD Model 25-1000HD

Fixed Disk Drive - 10MB half-height model and Xebec controller that could use IRQ2.  IRQ5 is standard on XTs, but the Tandy uses it for a vertical retrace interrupt.

DMA & Memory - Came with one board that gave DMA and allowed you to upgrade to 640KB with one board, also supplied a PLUS connector (see below) to add another expansion device like a serial card without taking up another slot.  

Tandy CM-4 RGBI Color Monitor - Low cost RGBI monitor with a large dot pitch (.62).  Not recommended for 640x200 graphics.  

9.  IBM PC/XT Revised

101-Key Keyboard - IBM made Model M keyboards work quite reliably on an XT with 2nd and 3rd BIOS.  On a first BIOS XT or any PC, the odds are much lower that it will work at all.

Improved Drive Support - BIOS support in 2nd and 3rd BIOS for 3.5" double density and 5.25" high density drives, but a third party floppy controller is required for the latter.  

System Board Memory - Supports 640KB on the motherboard without modification.

Mounting Hardware - IBM supplied late XTs in a dual half-height floppy configuration and included mounting hardware to fit them inside a full height bay.  

10.  IBM PC Convertible Model 5140

LCD Display - Simulates something like a 2-color CGA display, but in 320x200 (stretched to double width) can manage four intensities of color.  Also can emulate the MDA.  

Diskette Drives - IBM's introduction of 3.5" double density disk drives.  Would take until the PS/2 for 3.5" disks to fully catch on.  

Keyboard - 78 key keyboard, functions similar to PCjr. keyboard but improved by using IRQ1 for keyboard interrupt and not using CPU to deserialize scancodes.  

Internal Modem - Slot inside for 1200 baud version of PCjr. modem, may or may not be Hayes compatible.

Expansion Bus - XT bus with multiplexed address and data lines.  

Battery Operation - Uses CMOS 8088 CPU, SRAM to save power and allow for battery operation, system can be suspended indefinitely.   

Attachable Printer - Thermal printer, more advanced than PC Compact Printer.

Display Slice - Provides full CGA compatibility to external RGBI monitor.  Connector supports IBM PCjr. Display or IBM PC Convertible Color Display Model 5145.  RCA jack can be used with color composite monitor.  IBM also introduced the 9" IBM PC Convertible Monochrome Display with green phosphor.  

Portability - Although still large and bulky by modern standards, this is a true laptop.

Convertibility - Can remove LCD to place unit underneath standalone monitor.  

11.  Tandy 1000 EX Model 25-1050

Dual Speed CPU - 7.16MHz/4.77MHz, selectable at bootup or via Tandy MS-DOS Mode command.

Slimline - Takes up less desk space and the keyboard is built into the system unit just like an Apple IIc.  (Does not apply to SX) 

Selectable Boot Drive - You could boot to the internal 5.25" floppy drive on an external 3.5" floppy drive 

Expansion Bus - Uses a 62-pin version of the XT expansion bus, cards (called PLUS cards) stack onto each other, but must be short.  (Does not apply to SX)

DMA and RAM Expansion - One PLUS card upgrades system to DMA and allows for 640KB

External Drive Connector - For connecting a second 5.25" floppy drive or a 3.5" floppy drive

Earphone Connector and Volume control - When you want a quiet PC (not on SX)

12.  Tandy 1000 SX Model 25-1051, 1052, 1054

Dual Floppy Drives - 2x360KB Floppy drives on Model 25-1051 and 1054, boot floppy can be selected on bootup.

Expansion Slots - Five expansion slots provided without any need for memory expansion

Memory Expansion - Upgrade from 384KB to 640KB with 8 x 256Kx1 chips

DMA - Included on all machines (optional on EX and HX)

286 Express - Official 286 speed upgrade, 8KB cache that can be disabled, supports 80287 coprocessor.  Software controlled. 8088 still available for programs that will not run on a 286 or on the faster speed

Tandy MS-DOS 3.2 - Supports 3.5" drives, FDISK partitioning, 3 extra 32MB DOS partitions using MLPART (non-standard)

Power Supply - 65W, considered adequate for two drives and five expansion cards

13.  Tandy 1000 HX Model 25-1053 (all the EX features plus) :

Boot Speed and Menu - Nearly instant boot to an optional menu where you can select the boot device (floppy, DOS, Deskmate)

EEPROM - Save settings permanently without dipswitches or jumpers.

DOS-in-ROM - Enough DOS 2.11 is on the system that you will not usually need to insert a DOS disk when loading programs off floppies.  Disabled if a hard drive is installed.  Also supports 3.5" disk drives natively, which regular DOS 2.11 cannot.

Power-in-drive cable - No separate molex or mini-molex connector required.  A headache for wanting to use standard drives.

IBM PCjr. Exclusive Games - ScubaVenture & Mouser

The IBM PCjr. had eight cartridge games, and of them, two are exclusive to the system.  They don't exist for anything other than a PCjr. and since they came on cartridges, they are not designed to work with any other computer.  These games are ScubaVenture and Mouser.

ScubaVenture and Mouser, both programmed by Nasir Gebelli, are very minimalist, enigmatic games.  As Gebelli only had 8,192 bytes to fit the program in (they use 8KB cartridges), you can understand why they lack anything beyond the minimum necessary to make playable games.

Gebelli himself is something of an enigma, as he began programming games for the Apple II, then he did these PCjr. games and some years later worked for Square in Japan programming Rad Racer, Final Fantasy 1-3 and Secret of Mana.  Thereafter, he quit video games altogether and has not returned to them, despite his obvious talents.

Gebelli's PCjr. games lack polish, which is very unusual as IBM released them and shipped them on expensive cartridges.  ScubaVenture has some very impressive smooth vertical scrolling and supports two player simultaneous play.  Mouser is more of a puzzle game requiring a fair bit of strategy.  Both use the PCjr.'s 160x200x16c mode for colorful low resolution graphics and 3-voice sound.

Common Controls

Press F1 for one player and F2 for two player (That is Fn and 1 or 2 on the PCjr. keyboard).  If left untouched, the programs will enter a demo mode.  Both games use the keyboard by default.  They can use joysticks by pressing the J key on the keyboard.   You can return to the keyboard by pressing the K key on the keyboard.  Press Esc to pause.  Each uses the cursor control keys and the spacebar or the joystick positions and button 1 on the joystick.  When your game is over, you will not be returned to the title screen, so press F1 or F2 to start a new game.

ScubaVenture

Title Screen
The object of ScubaVenture is to collect treasures while swimming to avoid the eel on the bottom of the screen.  If you touch the eel, you are stuck on the bottom of the screen.  Press spacebar/button1 to launch a new diver.  Once your third diver is eaten, the game is over.

Divers, Eel, Score, Fish
You will come across yellow keys, each looking different.  Touch the key to take it, and if you touch another key, you will take that.  Soon you will see some "treasure boxes", and each corresponds to the shape of one key.  If you touch the box with the right key, you will earn points.  You will also earn points if you touch the red fish.  Obstacles include seaweed, seahorses and the yellow "walls" on the sides of the screen.  If you touch one of these obstacles, you will not be able to move forward and must try to find a way to move around or you will be eaten by the eel.  In the one player game, a white diver will randomly swim across the screen and can block you and can take fish.  He can swim through the yellow walls and the eel will not eat him.

Keys and more Keys
Eventually, the tunnel will loop around.  This will allow you to try to obtain a(nother) treasure.  The cavern will loop until you have obtained all the treasures or have lost all your lives.  Once you have obtained all the treasures, you will move onto a different tunnel.  

Treasure Boxes
In the two player game, each player will have three divers and compete on points.  If you are using the keyboard, player one will use the regular keys and player two will use the AWSZ to move Left, Up, Right and Down.  The Tab key will release another diver for player two.  Player one's divers wear a green suit, player two's divers wear a red suit.  When one player loses all of his divers, his diver will turn white and move randomly, just like the one player game.

Obstacles
Starting the game is a bit confusing.  When you press F1 or F2, the title screen will seem to reset itself.  If you keep pressing F1 or F2, the title screen will continue to reset.  Let the music play until the ScubaVenture and NASIR text begin to flash.  When that is finished, the game will start.

More Obstacles
Two Player Mode
Mouser

Title Screen
The object of Mouser is to trap all the mice in each of the nine rooms.  In each room there are walls that you can push clockwise or counterclockwise.  The nine rooms are laid out in a 3x3 arrangement, and you can exit the rooms using the passages indicated.  Each room is laid out in a 9x5 grid.

Starting Out
To trap a mouse, you must box it in on all four sides by walls.  You cannot leave it any space to move.  If you trap a mouse, the cat will eat it when you leave the screen.  The cats are useless otherwise.  If the mouse can move a square, then he isn't trapped.  If one of the sides of the trap is the cat, the mouse will not be eaten when you leave the screen and you can't win the game.  If you trap a mouse, a special sound will be heard and you will receive the points for trapping a mouse.  Sometimes you will enter a screen and the mouse will already be trapped and you earn the points automatically.  The time will also be reset.

I trapped a mouse!
To push a wall clockwise around a pivot, walk into it.  To push a wall counterclockwise, push the spacebar/button 1 as you walk into it.  The wall will turn 90 degrees on the pivot, and you can use the directions to move the walls to where you need them in the room.  If you push one wall onto another, the wall will turn white and the next time you push that wall, one of the walls will be pushed forward in that direction one space.  You cannot push a wall if it would go through a space occupied by a mouse, a cat, the cheese or a wall. Nor can you push a white wall onto a white wall.  Sometimes when pushing a wall, there is some residue of it left behind, enough to block your character from that direction, but the mice can chew their way through it.

The Flashlight
In some rooms, there are pieces of cheese.  If a male (light red) mouse touches the cheese, he will eat it and the cheese will appear elsewhere on the screen.  If a female (light magenta) mouse eats the cheese, it will spawn another male mouse.  Male mice are stupid and walk back and forth in a pattern, but female mice can walk in a much less restricted fashion and are more likely to chase the player.

Dark Rooms and a Female Mouse
Some rooms are dark and require a flashlight to illuminate.  You can find a flashlight in one of the rooms.  The flashlight will only illuminate a circular space around the character, but as you enter and leave the room you can see the full layout for a second.

Two players alternate in trying to clear their rooms.  If the player touches a mouse or runs out of time, he loses a life.  Each player has three lives and the rooms are supposedly randomized every time the system boots the cartridge.  When you start a new game, the same room layouts are used.

Conclusion

ScubaVenture was probably intended for younger players, as the game is much more simple than Mouser. While River Raid probably influenced the game's development, it quickly becomes repetitive in a way that River Raid does not. Each time you complete a section in River Raid, a new section appears.  In ScubaVenture, each time you complete the section, the same section appears until you get all the treasures.

Mouser reminds me of Clu Clu Land for the NES, although Mouser came first.  It is a very frustrating game due to the way the game moves the walls.  You have to think about the direction the wall moves and hope you actually get it to move in the direction you want.  The mice always seem to move in a pattern just one square away from being trapped.  The timer runs down very quickly while you painstakingly try to manipulate the mice into your traps.  Mouser is also buggy in that you can die upon entering a screen where a mouse happens to be in the same place as the entrance.

Thursday, February 20, 2014

Monochrome & Hercules Graphics Aspect Ratio and Scaling

The IBM Monochrome Display and Printer Adapter output 80-column text with a 9x14 cell size.  This gives 720x350 pixels.  The Hercules Graphics Card is a clone which adds a 720x348 graphics mode.  The aspect ratio of the graphics mode, with perfectly square pixels, is 2.07 : 1.  However, the IBM Personal Computer (Monochrome) Display 5151 has a less horizontally rectangular tube that measures about 9.5 inches by 6.5 inches from one edge of the screen to the other.  The diagonal display measures about 11.5 inches.  This would give an aspect ratio of 1.46 : 1.

The active display area does not reach the edges of the monitor.  I measure it to be about 8.75 inches by 5.5 inches.  This gives an aspect ratio of 1.59 : 1.  The graphics mode loses two lines and thus the aspect ratio is a sliver wider.  Coincidentally, this is the square pixel ratio of CGA 320x200. There are no horizontal or vertical size or hold adjustment knobs on the monitor, only brightness and contrast.  Here is a screenshot showing, somewhat faintly, the visible screen area on a 5151 :


DOSBox can take screenshots of the Hercules Graphics mode.  Here is one such screenshot, untouched : 


While it is a bit squashed, doubling the vertical resolution (720x696), as some Mobygames screenshots do, is just not appropriate.  If you do that, you will have an aspect ratio of 1.03 :1.  As you can see from the image of the real monitor, the visible screen area is not a nearly-perfect square or anything near it.  

While it is not perfect, the best compromise is to increase the vertical size of a screenshot by 25% using nearest neighbor interpolation.  If you resize the screenshot to 720x435, you get this result :


This gives a 1.66 : 1 aspect ratio, which is far, far closer to the ideal ratio while keeping upscaling artifacts to a minimum.  

Starflight's effective resolution is 160x200, which is fairly common with older games.  If you use a game that has a native 320x200 resolution, the artifacts can be a little more visible : 

Maniac Mansion Enhanced Version - Original
Maniac Mansion Enhanced Version - Resized
Leisure Suit Larry 3 - Original
Leisure Suit Larry 3 - Resized
One issue to note is that most PC games use a native 320x200 resolution, and their Hercules drivers often leave noticeably large borders.  Many, if not most games use double the horizontal resolution to 640 pixels, using an algorithm similar to what they would use for 640x200 CGA graphics.  Starflight's effective resolution with Hercules is 640x200.  The regular 16-color resolution of Maniac Mansion's graphics window is 320x128, so with Hercules they simply doubled it to 640x256.  The text size remains 8x8, so there is an unused section at the bottom of the frame.  Sierra did something similar with their AGI games.  Their graphics window is 320x168, so with Hercules they doubled that to 640x336 and used the extra 12 lines for the status bar.  Instead of keeping the 8x8 font, they used an 8x12 font unique to the Hercules driver.  Typing pauses the action like SCI games, whereas it does not in all other graphics modes.

For Leisure Suit Larry 3 and other SCI0 games, the native graphics area is 320x190 in 16-color modes with the status bar taking up the remaining 10 lines. They could not double up on the graphics because they only have 348 lines to use.  What Sierra did here is to increase the horizontal resolution of the whole screen to 640 and the vertical resolution to 300, effecting a 150% increase in the vertical resolution (including the status bar).  Every other line is repeated.  This may not give the nicest look, this was probably the simplest approach to take, which was important when dealing with taxed 8086 and 286 machines.  Also, there is is no way to decrease the brightness of each individual lit pixel, so traditional filtering techniques will not work.

Here are a few more screenshots showing how non-native Hercules games fit within the screen :





Good Bits

Hex nut driver bits can be very useful for opening up vintage PCs and not quite so vintage, especially those made by IBM.  Here are some bits and the screws they can more easily unscrew in most instances than a standard slotted screwdriver.

3/16" - Expansion card retention screws for IBM PC, XT and probably the AT, XT/286 and Portable, Expansion card retention screws for the Tandy 1000/A/HD/SX.  Drive mount and system board retention screws for IBM PC & XT, probably others.

7/32" - IBM Model M Keyboard screws, probably Unicomp Keyboards as well.  Needs a long barrel bit to fit inside the three of the four holes for the screws.

1/4"- External case screws for the IBM PC, XT and probably the AT, XT/286 and Portable, Internal case screws for Tandy 1000s.  IBM Model F PC and probably AT screws.  System board screws for Tandy 1000s.  Floppy disk drive mounting screws for IBM PCjr.

Later, more generic PC cases can still use the 1/4" and 3/16" bits, even though they have Phillips-screw heads, as they are still using hex heads.  Sometimes in-between bits like 5mm and 6mm can also come in handy, the former especially when trying to screw in port standoffs.  

Sunday, February 16, 2014

Patching DOSBox by a Beginner for Beginners

In order to apply a patch to DOSBox, you must first be able to compile DOSBox from its source.  Start with this tutorial :

http://www.dosbox.com/wiki/Building_DOSBox_with_Visual_C_2008_Express

The link for Visual C++ 2008 Express given in that tutorial is out of date, you can obtain the downloader from here :

http://go.microsoft.com/?linkid=7729279

When you can compile a binary using the current SVN, then you are ready to begin patching DOSBox.

Patching DOSBox means you are making changes in the existing source code and recompiling DOSBox with those changes into a new binary.  First you need a copy of the source code you are modifying.  DOSBox is written in C++ and the source code is in almost plain text.  You can find the latest source here : http://source.dosbox.com/dosboxsvn.tgz.  Decompress it with a program like 7zip (it is doubly compressed), and look at the files.  The .cpp files contain most of the code you may be modifying.  

Next you need a good text editor, preferably one that supports line numbers.  Notepad just does not support enough of the formatting these files need.  Wordpad does, but you would do better with an editor like EditPad Lite 7, which supports line numbering.  Line numbering is very useful to determine which lines of code you need to modify.  

Finally, you need a patch file.  Patch files often use the .diff extension because they show the differences between two files or two sets of files.  If the patch is just code posted in a forum, you should copy and paste it into a new file opened in Wordpad or EditPad or something similar.  Maintaining the spacing in these files is important.  

Here is a sample patch file against the current DOSBox SVN (r3858) :  

--- adlib.cpp.old   2013-01-15 12:10:04 +0000
+++ adlib.cpp   2014-01-19 19:54:06 +0000
@@ -227,10 +227,10 @@
       Bitu i, val;
       /* Check the registers to add */
       for (i=0;i<256 font="" i="">
-         //Skip the note on entries
-         if (i>=0xb0 && i<=0xb8) 
-            continue;
          val = (*cache)[ i ];
+         //Silence the note on entries
+         if (i>=0xb0 && i<=0xb8) 
+            val &= ~0x20;
          if (val) {
             AddWrite( i, val );
          }

The first two lines identify the source file that was modified, in this case adlib.cpp.  Find and open adlib.cpp using your text editor in the DOSBox source directory.  It can be found in \dosbox\src\hardware.  This is what the existing source code looks like :

Bitu i, val;
/* Check the registers to add */
for (i=0;i<256 font="" i="">
//Skip the note on entries
if (i>=0xb0 && i<=0xb8) 
continue;
val = (*cache)[ i ];
if (val) {
AddWrite( i, val );
}

The next line in the patch file, @@ -227,10 +227,10 @@ pinpoints the lines in adlib.cpp that were modified.  Look for line 227 in the source code file or search   Sometimes, depending on the patcher's working source, the line number may not line up exactly with the DOSBox source, but it should be very close to the line.  Sometimes code looks similar, if you are unsure whether you have the right code, then copy as much of the code from the patch file as you can into a find box and search the source code file until you are sure you have the right lines.  

The lines with blank space in front of them show the existing code that will not be modified.  This is important to know where you will begin to modify and where you will end.  Lines beginning a - indicate that that line was deleted by the patch.  Conversely, lines beginning with a + indicate that that line was added by the patch.  From our example above, these lines were deleted : 

-         //Skip the note on entries
-         if (i>=0xb0 && i<=0xb8) 
-            continue;

In the original source file, highlight and delete them.  Remove the lines entirely so the code looks like this :

       Bitu i, val;
       /* Check the registers to add */
       for (i=0;i<256 font="" i="">
          val = (*cache)[ i ];

Now add these lines after val = (*cache)[ i ]; :

          //Silence the note on entries
          if (i>=0xb0 && i<=0xb8) 
             val &= ~0x20;

Copying and pasting usually gives better results than retyping.  Make sure the code fits where it is indicated and does not overwrite any lines without a - in front of them.  Also make sure, since your text editor must be using a fixed-width font, that the lines line up vertically as shown in the patch.  Do not forget the { and }.  The + characters also should be removed, and add an extra space to the line to preserve the code's position on the line.  Here is the code as it should look in the patched adlib.cpp file :

       Bitu i, val;
       /* Check the registers to add */
       for (i=0;i<256 font="" i="">
          val = (*cache)[ i ];
          //Silence the note on entries
          if (i>=0xb0 && i<=0xb8) 
             val &= ~0x20;
          if (val) {
             AddWrite( i, val );
          }

Once you are done, save the modified .cpp file.  There may be more than one place in the .cpp file to patch, so go to the next line indicator, which looks like @@ -227,10 +227,10 @@ and continue patching. .diff files can include more than one source code file to patch, so make sure you patch all source code files indicated by the .diff.  

Go back into Visual C++ 2008 Express Edition, open the DOSBox solution, and build a new binary.  If you have previously built a binary, then it will not take long as only the changes made by the patch need to be recompiled.  

While there are utilities that can do this for you, I have never gotten one to work properly and sometimes the line numbers do not match and you need to manually patch the code.  

More complex patches may require substantial modifications to the code, or may also require adding completely new code files.  They may also require new libraries and includes files, which are beyond the scope of this tutorial.  

Influences of the PCjr. - the IBM PC Convertible

The IBM PC Convertible, Model 5140, was IBM's first attempt at a battery-powered laptop.  Of course, it was thick, had a small screen, and expansions made it longer.  However, it does share more than a few similarities with an earlier of the PC family, the IBM PCjr.  While it took ideas from the PCjr. and improved on them in many respects, the system was not a great success due to its own issues, namely its high price and less-than impressive specifications compared with competitor's products of the time.  The introduction of the 3.5" disk drive on this system, when all software had previously been released on 5.25" disks, meant that it took time for the market to release PC compatible software for the machine.  Also, if the chicklet keyboard was the Achilles Heel of the PCjr, the Convertible's initial low-contrast LCD gave it a bad reputation.  Later machines used a super twist LCD and a backlit LCD, both offering much improved readability, but like the PCjr., it was too little, too late.

Keyboard - The original IBM PC Keyboard used 83 keys.  The PCjr. Cordless Keyboards use 62 keys and the PC Convertible uses 78 keys (U.S. style).  The fewer keys make handling these keyboards with low-level routines quite different from the IBM PC keyboard.  Both the PC Convertible and the PCjr. use the Non-Maskable Interrupt to generate IBM PC Keyboard compatible scan codes.

In an IBM PC, serial data from the keyboard is sent to the system unit, deserialized by a shift register and then placed in I/O port 60, the 8255 PPI Port A0.  IRQ1 is used to signal the CPU that there is a key to be read.  A program can read the raw scancode directly or execute INT 09H/INT16H to obtain an extended ASCII scancode.

In the IBM PCjr., serial data sent from the keyboard is sent to bit 6 of I/O Port 62, 8255 PPI Port C0.   The NMI is generated to alter the CPU that there is a key to be serviced and the CPU deserializes the data stream, then INT 48H is executed to translate the raw scancode into codes compatible with INT 09H/INT16H.  IRQ1 is never used, but the translated scancodes appear at I/O port 60.

In the PC Convertible, the raw scancode is placed in I/O Port 07D.  An NMI is generated and the NMI handler will translate the raw scancode into a compatible scancode and stores the result in I/O Port 60 and generates IRQ1 and the key can be read with INT 09H/INT16H.  While obviously derived from the PCjr., this is an obvious improvement over the PCjr.'s slow routine and should be much more compatible with programs expecting PC keyboard handling.

Memory Expansion - Neither the PC Convertible nor the PCjr. were intended by IBM to reach 640KB, both were intended to max out with 512KB.  Memory expansions for both machines came in 128KB.  IBM officially only supported the Memory Expansions for the PCjr. (128KB in system unit + 3 x 128KB expansions), but the fourth expansion was easy enough to add.  IBM only physically supported four memory modules in the PC Convertible, each with 128KB, and the system always came with two installed from the factory.  Third party expansions were required for the PC Convertible to reach 640KB and recommended for the PCjr. to reach 640KB.

Feature Expansion - Both machines were expanded by hardware attachments, the PCjr. via sidecars that fit onto a connector on the right side of the machine, the PC Convertible by a connector on the rear of the machine.  IBM released five PCjr. attachment options, parallel, power, memory, speech and cluster, and four for the PC Convertible, serial/parallel, CRT display, speech and portable printer.  If customers did not particularly care for adding onto the length of the PCjr. they must have positively detested the added weight and length that the add-ons for the Convertible added.

Modem - IBM included a modem slot in the PCjr.  It sold a modem based on the Novation Smart 103 modem for the PCjr, which could run at 110 or 300 baud.  It did not sell well because it was not Hayes compatible.  IBM also included an internal modem socket in the PC Convertible.  Apparently ignoring the market again, IBM used the same style of modem for the PC Convertible internal modem upgrade.  This time the modem could also support 1200 baud.

The COM ports were similarly assigned on both systems.  The PCjr. had a serial port built in and it was assigned to COM1, but the resources were at 278/03.  Once the modem was installed, the serial port became COM2 and the modem COM1 at 3F8/04.  The PC Convertible Internal Modem always used 3F8/04 and would be assigned to COM1 when it was installed.  This time, IBM knew enough that not everyone would install the internal modem, so the PC Convertible had a serial adapter that could be set to COM1 3F8/04 if no internal modem was installed or COM2 2F8/03 if it was

CGA Support - The PCjr. had only basic, BIOS CGA support since it did not implement the crucial Color Select and Mode Control registers.  Although the PC Convertible uses a CGA-friendly 640x200 LCD resolution, the built in video is not particularly CGA compatible either.  Color text-mode attributes were not supported on the monochromeLCD, it was either normal video, reverse video or no display.  320x200 graphics would display three shades of gray plus black, but the graphics take up the whole screen, meaning they are twice as wide as they should be.   The built in LCD does not distinguish between 640x200 and 320x200 in this instance.  The MC6845 was only emulated enough for the basic modes, the color select register is not present and the mode control register has missing bits compared to real CGA.

The built-in display adapter can also be configured to emulate a MDA card.  When the CRT Display adapter is attached to the PC Convertible, it will function like an MDA card and the CRT Display adapter should provide 100% CGA compatibility.  The Display adapter has three video output ports, a Direct Drive port using an 18-pin BERG connector with pinouts identical to the PCjr's Direct Drive video port (except no audio).  The adapter can connect directly to the PCjr. Color Display, Model 4863 or the PC Convertible Color Display, Model 5145.  It can connect to an IBM PC Color Display, Model 5153 or IBM PC Enhanced Color Display, Model 5154 or any other compatible display via the PCjr. 18-BERG to 9-pin DE-9 adapter.  It also has a composite video output like the PCjr. and a 6-pin BERG connector for an RF adapter.  The BERG connector has a compatible pinout with the PCjr. RF switch.

Printer - Both systems had a printer designed specifically for it, the IBM PC Compact Printer for the PCjr. and the IBM Portable Printer for the PC Convertible.  Both are unidirectional thermal serial printers operating at a maximum of 1200 baud and have a 2K buffer.  Both use a transmission format of 1 start bit, 8 data bits and 2 stop bits.  The Convertible's character set includes text-drawing characters at ASCII 176-223 which the Compact Printer does not.  The PC Compact Printer can print in standard, condensed, double-wide and underline styles and 480-bit graphics, while the Portable Printer adds emphasized, superscript and subscript styles and 960 and 1920 bit graphic modes.  The Portable Printer supports virtually all the control codes of the Compact Printer plus some more for its enhanced features.

Speech Attachment - The Convertible's Speech Attachment is supposed to be functionally identical to the PCjr's.

Saturday, February 8, 2014

Introduction to the PCjr., or How NOT to Destroy It!

IBM PCjr. Startup Screen - Maximum RAM Count (but you can have more)
Congratulations!  You have just won a PCjr off ebay, scored one off craigslist, took one from the recycling center or was given one by Uncle and Aunt Lots-o'-Stuff in the Attic.  Its just arrived, you open the box, unwrap all the pieces, now what do you do with it?

First Things First : To use a PCjr., you need, at a minimum the system unit, the keyboard and the power cable.  If you are missing any one of these three, the PCjr. is useless.  I am going to go through each in terms of simple to complex :

The External Power Adapter: This is a large black power converter.  It has wires on either end.  One the end of one wire is a three-pronged plug.  On the other end is a rectangular three pin connector that connects to the back of the system unit.  The port is in between the A and the C ports.  On early bricks, the cable with the three-pronged plug is detachable from the large brick.  A standard three-pronged computer power cable should fit into the brick.  The brick only supports 120v/60Hz AC power, so in Europe you will need a step-down converter.  It outputs AC power, the AC to DC conversion is done inside the system unit.  The power cable can fit into the system either way (polarity is irrelevant for AC).

The Cordless Keyboard : The original Cordless Keyboard, later known by everybody, even IBM as the "chicklet" keyboard is the less common of the two IBM PCjr. Cordless Keyboards, especially after IBM offered a free trade in to the non-chicklet keyboard.  IBM called the replacement keyboard the "Freeboard", presumably because it offered some freedom from the frustration of the chicklet and was a free replacement for PCjr. owners who hated the chicklet keyboard.  Internally, they function identically.

The PCjr. Cordless Keyboards use rubber-dome technology and can feel stiff yet squishy.  The keyboard communicates with the system via an infrared sensor or via an optional keyboard cable.  It takes 4 x AA batteries, and you should check the battery compartment to see if there are old corroded batteries.  If there are, you should clean the contacts with cotton swabs or Q-tips with apple cider vinegar or lemon juice and follow it up with baking soda.  You may need to unscrew the board to inspect for leakage on the PCB.  The infrared can work up to twenty feet away according to IBM, but line of sight must be maintained and the sensor on the keyboard should be as perpendicular as possible to the sensor on the computer.  Rechargeable batteries may or may not provide reliable power for the keyboard.

The System Unit : The computer is inside on a large system board.  Most PCjr's you will find these days are the Enhanced Model, which come with a 5.25" diskette (floppy disk) drive and a 64KB memory expansion.  These have 128KB of RAM total, not counting any extra memory added via sidecar.  The Basic Model did not come with a diskette drive or the 64KB memory expansion.  If you are getting a boxed unit, it should come with all the above and two books, the first being the PCjr. Guide to Operations and the second being the "Hands On BASIC for the IBM PCjr."  A complete unit should also come with a plastic plate to cover the sidecar expansion and a Basic Model also comes with a plastic cutout to cover the floppy bay hole.

Checking for damage : The expansion ports on the rear of the PCjr. use BERG-style connectors, which little more than pins bent at right angles sticking out from the system board.  These are more prone to damage than connectors set in a D-shell, but it was cheaper for IBM to implement them in this way.  Check for any bent, broken or pushed in pins.  Most of the connectors have a missing "key pin", so check below to discover pins that are supposed to be missing.  Gently straighten or pull out any pins with a small pair of pliers or tweezers.  Expansion cables are held in the port by friction alone, so do not try yanking cables out. Similarly, the sidecar expansion port also uses pins, but at least these are cased in a plastic connector like an IDE port.

Opening the case : The case top is held down by friction and tabs, there are no screws to deal with.  Using a small screwdriver, insert it into each of the three indentations at top rear edge and gently pop that portion of the case off.

Inside the case : There are up to four internal expansion boards.  Fortunately each can only fit one way.  There are no jumpers or dipswitches inside or on the internal expansion board.  IBM did not use jumpers (officially) on its sidecar expansion board either.  Everything is configured in software, which was rather progressive for the time and technology.  If you want a true definition of plug and play, here it is!

On the left side of the unit (with the cartridge ports facing you), is the power board, which is always present.  The power board comes in either a 33W short card or a 45W long card.  If the power card is about 2/3rds the length of the case, it is the short card.  If it extends nearly to the front of the case, it is the long card.  There is a 2-pin staking connector which the power board must be inserted into when it is put back in its slot.  There are grooves in the case to stabilize the card, make sure the card fits into them.

The second board is the 64KB Memory and Display Option.  As its name suggests, this adds 64KB to the 64KB on the motherboard for a total of 128KB inside the System Unit.  Early memory boards are covered in a metal shield, later boards are just a bare PCB.  If this board is not present, you will only have 64KB of RAM in the system and a big hole if any sidecar memory expansions exist.

The third board is the PCjr. Internal Modem Option, and as it was always an optional upgrade, it probably won't be present in your average PCjr. System Unit.  IBM's modem was not very popular since it only communicated at 300 baud and did not use the industry standard Hayes command set.  Third party Hayes-compatible modems were also made to fit in this slot.  Like the power board, this card connects to a 2-pin staking connector and grooves in addition to its slot.  This is the only internal upgrade not to come automatically bundled with the PCjr. System Unit.

The fourth board is the PCjr. Diskette Adapter.  This connects to the Diskette Drive via a 34-pin ribbon cable with a pin header on one end and a card edge connector on the other.  It only supports the one internal drive.  Note the side of the cable with the colored wire, that side must correspond to pin 1 on the board if the diskette drive is going to work properly.  Pin 5 is missing on the adapter pin header as a key pin to prevent wrongful insertion.

The diskette drive is mounted on a unique plastic drive support.  It is connected to the board by two standoffs that push through the bottom of the case.  To remove the drive support mechanism (and the drive itself), first unplug the cables for the diskette drive power connector and the fan power connector from the power board.  Next, disconnect the drive data cable.  Next, with a pair of pliers, squeeze the tabs in and push upwards on the standoffs until the constrict and pop up from the bottom of the case.  These are not screws, so do not twist a screwdriver in them.  Finally, pull up on the back of the diskette drive and it should be able to be lifted out of the system with no further difficulty.

If you have removed all the internal boards and the diskette drive support, you will have complete access to the interior of the PCjr.  Check for any signs of damage and be prepared to dust.  There is a raised metal box on a small PCB, that is the Infrared Receiver.  Make sure it is firmly seated on its slot.  The receiver is connected to the System Unit by its connector and two plastic standoffs, so you won't be able to remove it without removing the System Unit itself.  The System Unit can be removed from the case by unscrewing four screws at the rear of the system, at least one screw holding down the cartridge ports and removing whatever sidecars are attached.

Rear Expansion Ports :

Except for the RCA ports for video and audio and the modem port (if one is installed), there is nothing standard about the PCjr.'s expansion ports.  However, the hardware that the PCjr. is designed to connect to is standard with one exception.  Looking at the rear of the machine, the ports are lettered as follows :

J   J   L   K   LP    T             V      M   D         S        C      P    A

J = Joystick - There are two joystick ports in the PCjr., with the first port,  sometimes called the right joystick being closest to the edge of the System Unit.  The inner port is sometimes called the left joystick.  These connect to the PCjr. Joystick, which functions just like a standard PC joystick.  The PCjr. joystick just uses a different connector.  River Raid, Demon Attack and Microsurgeon will not work without a joystick connected.  8-pins, with Pin 1 missing as the key pin.

L = Spare - These pins are not connected to anything on the system board. 6-pins, with pin 4 missing as the key pin.

K = Keyboard - For the optional Keyboard Connector.  The keyboard connector has a phone jack on one end and a large RFI ferrite choke.  It plugs into the PCjr. keyboard and allows you to use the keyboard without IR and batteries.  Third party keyboard replacements also plug into this port, but must be specifically designed for the PCjr.  If there is anything plugged into this port, then the system unit will not receive the input from the IR receiver, even if its just an unconnected wire.  6-pins, with pin 1 missing as the key pin.

LP =  Light Pen - IBM never marketed a light pen with a PCjr. style connector, but PC Enterprises did.  6-pins with pin 6 missing as the key pin.

T = Television - For the TV Connector, an RF switchbox to connect to an antenna screw terminal on a TV.  You may need a 300 to 75 Ohm balun connector.  External Audio can be heard from this connector. 6-pins, with pin 2 missing as the key pin.

M = Modem - A standard RJ-11 phone jack connector will be found here if you have an internal modem installed, otherwise it is just a hole.

V = Video - RCA Composite Video jack, better than RF, but not as sharp as :

D = Direct Drive Video - This connector supplies a CGA-compatible video signal and a mono audio signal.  The standard IBM PC Color Display Model 5153 or IBM Enhanced Color Display Model 5154 or compatible monitors can connect to it via a 9-pin adapter.  IBM released one because its PCjr. Color Display was not available at launch.  The IBM PCjr. Color Display Model 4863 has a connector that plugs directly into this port.  The IBM PCjr. Color Display has a built-in speaker with a volume control wheel for the external audio output.  The IBM PC Convertible Color Display Model 5145 also uses the same connector as the PCjr. Color display, but may or may not have a speaker for the external audio.  18-pins.  An adapter exists to allow the PCjr. and Convertible displays to work with a 9-pin D-shell port.

S = Serial - Any serial device can use this port with a proper adapter, such as from IBM.  The only device I know of that has the connector for this port is the IBM PC Compact Printer.  An adapter exists to allow the Compact Printer to be used with a standard serial port.  16-pins.

C = Cassette - IBM made a cable to interface with cassette drives and cassettes for data storage and retrieval.  It has two mini-jacks and one micro-jack.  The cassette interface is functionally identical to the interface in the IBM PC Model 5150.  8-pins, with pin 5 missing as the key pin.

P = Power Connector - See above

A = Audio - RCA Mono Audio Jack, necessary to hear sounds from the external audio unless you are using the TV Connector or the 4863 PCjr. Color Display.

Cartridge Ports :

On the front of the machine, there are two cartridge slots.  These slots are functionally identical.  Like any cartridge slot, they can accumulate dust and should be cleaned with a Q-tip and 99% Isophropyl Alcohol.  The most common cartridge that can be found is the BASIC cartridge (IBM Cartridge BASIC).  This cartridge is intended to supplement the Cassette BASIC already in the system ROM and add support for the advanced sound and video capabilities of the PCjr. and diskette drive support.  Game cartridges are generally rare, especially the good ones from Activision and Imagic.  Lotus 1-2-3 is a rare example of a cartridge program with a cartridge for both slots.

Sidecar Port :

On the side of the PCjr., there is the expansion port of the system, the sidecar port.  If there are no sidecars installed, there may be a plastic faceplate, which snaps into two holes and can be easily pried off with a screw driver or fingers.  Sidecars are pushed onto the pins, then screwed into system unit or the next sidecar with a flat head screwdriver.  You can extend the length of your system quite considerably with expansion sidecars.

Most PCjr.s have at least an IBM Parallel Printer sidecar attached, as the PCjr. did not provide a parallel port in the system unit.  The Printer sidecar provides one unidirectional parallel port using the standard DB-25 connector.

Many PCjr.s also have a Memory Expansion Attachment sidecar, from IBM or a third party company.  These sidecars add at least 128KB of RAM to the system.  Few self-booting programs will recognize more than 128KB of RAM in a PCjr.  The memory expansion's device driver must be loaded in DOS for DOS to report more than 128KB available to programs.    A device driver called JRCONFIG will work with any memory expansion.

If you have a 33W power board in the system unit and use more than two sidecars, you will need the IBM PCjr. Power Attachment sidecar, which provides more power for sidecars.  This sidecar must be inserted before any sidecars it needs to power (closer to the system unit) and has a separate power supply identical to the PCjr. system unit power supply.  They use the same connector.  With a 45W power board, you can use three sidecars comfortably.

Turning the System On :

When you turn on the screen, you will immediately see, if the system is working at all, the IBM logo and the fifteen RGBI colors that a CGA monitor can display in addition to black.  The memory will be counted and tested.  Once the memory has been counted, the screen will change to a blinking cursor, the diskette drive will seek and try to boot a disk in the drive.  Any expansions with a bootable ROM, like a hard drive or SCSI expansion interface, will attempt to boot at this time.  If neither the diskette drive nor any bootable interface is available or functioning properly, then the PCjr. will boot a cartridge, and if no cartridge is inserted, then Cassette BASIC.

Fan and Heat :

The fan inside the system blows cool air on the floppy drive and diskette.  IBM felt this was necessary to prevent a disk from melting inside the drive after heavy usage.  The fan is not intended to cool the system, that is what all the vents are for.  You can disconnect the fan without immediate apparent issue if you do not often use the disk drive, but the fan improves airflow inside the case.  This should help the Power Module (the hottest element in the system by far) and the chips underneath the floppy drive (including the CPU).  Although you may be tempted by the prospect of silent operation, leave the fan on.

Keyboard Adventure and System Diagnostics :

The PCjr. has a built-in program called Keyboard Adventure.  This can be loaded by pressing the Esc key just after Cartridge or Cassette BASIC has loaded.  You cannot have pressed any other key before pressing the Esc key.  This program was made to help introduce first-time computer users to the keyboard, and can be used to test the keyboard.  A full description of the program can be found in the PCjr. Guide to Operations manual, which came with every system.  Press Ctrl + Alt + Del to exit and reboot the system.

To start system diagnostics, any time after the PC has booted, whether to BASIC or to a disk, press Ctrl + Alt + Ins.  This will appear to reboot the system, but the memory will be counted and you will be shown a screen with several ASCII graphics and numbers underneath them.   The tests are rather cryptic and are fully explained in the Guide to Operations with the exception of  Test Tags H, I, L, M, N, O & P.  Here are a list of the Test Tags and what they test :

Test Tag 1 - Diskette Drive (requires spare floppy disk)

Test Tag 4 - 40-Column Display modes and 16KB graphics modes

Test Tag 8 - 80-Column Display modes and 32KB graphics modes (requires IBM PCjr. 64KB Memory and Display Expansion Option)

Test Tag 5 - Light Pen

Test Tag 6 - Joysticks

Test Tag 9 - internal PC Speaker and 3-voice sound (external speaker, TV Connector or PCjr. Color Monitor required)

Test Tag J & K - Cordless Keyboard  (Test Tag J treats the keyboard as a 62-key keyboard, Test Tag K treats the keyboard as if it were an IBM PC 83-key keyboard and allows you to use key combinations for the missing keys)

Test Tag G - IBM PCjr. Internal Modem

Test Tag H - IBM PC Compact Printer

Test Tag I - RS-232 (with loopback Plug)

Test Tag L & M - IBM PCjr. Cluster Adapter Attachment

Test Tag N, O & P - IBM PCjr. Speech Adapter Attachment

To escape from any test, press Fn + Break.  Press Ctrl + Alt + Del to exit and reboot the system.

Error Messages :

If you are unfortunate, you may encounter an error message.  Error messages are assigned a letter, here are a list of error messages and possible solutions :

Error A - Memory Problem, remove memory expansion sidecars and internal memory option to try to isolate which one is causing the program.  Will cause the system to hang.

Error B - Keyboard Problem, move the keyboard away from any extremely bright light source, replace the batteries, move the keyboard closer to the system if using IR and do not press any keys during the bootup process.  May cause system to hang.

Error C - Cassette Problem, press Enter to continue booting without using the cassette.  Usually caused when the cassette motor relay goes bad.

Error D - Serial Port Problem, may hang system.  Unplug any device from the serial port.

Error E - Modem Problem, press enter to continue booting without using the Modem.  Make sure the modem is properly inserted.

Error G - Cartridge Problem, may hang system if cartridge is inserted, remove cartridge.

Error H - Diskette Problem, press enter to continue booting without using the Diskette Drive.  Make sure the diskette drive adapter card is properly plugged into the system, the diskette drive is properly connected via the cable to the diskette drive adapter, the diskette drive is plugged into the power connector.

Error X - Unknown, may hang system.  May not actually exist.

Video and Audio Connections :

The PCjr. is very video friendly in that it has a composite video output jack that can connect to almost any modern TV.  You do not need a hard to find CGA compatible monitor to get video output.  The colors may not be as pure, the pixels may not be as distinct, but graphics should be visible.  If you boot to DOS and you see 80-column color fringed text, use the DOS command MODE BW80 to switch the text to black and white.  If you want more legible text, then use MODE BW40 to use a 40-column text mode.

If you find that your PCjr.'s display is off center or partially cut off, press Alt Left Arrow  to shift the visible display to the left and Alt Right Arrow to shift the visible display to the right.  You can also enable or disable the keyboard audio click by pressing Ctrl + Alt + Caps Lock

The internal beeper inside the PCjr system unit will only generate PC Speaker sounds.  If you want to hear sounds from the 3-voice chip, the PCjr. Speech Adapter or from the Cassette Port, you will need to connect the PCjr. to an amplified speaker via the RCA audio output jack, to a TV using the TV Connector switchbox, or to a 4863 PCjr. Color Display.

COM and LPT assignment.

The built in serial port is assigned to COM1 and LPT1 in the BIOS if there is no Internal Modem or Parallel Printer Attachment installed.  However, the resources used by the serial port are I/O 278H and IRQ3, which are generally assigned to COM2.  The Internal Modem uses I/O 3F8 and IRQ4, the BIOS assigns the Modem to COM1 if it is installed and the serial port becomes COM2.  If the Parallel Printer Attachment is installed, it becomes LPT1 and you may need to redirect LPT1 to COM1 or COM2 to print to the serial-based Compact Printer.

Recommended Programs :

Most DOS programs will require a 256KB PCjr., so if you don't have one you are probably going to be limited to self-booting (PC Booter) programs.  King's Quest I & II, The Black Cauldron and Below the Root are excellent adventure games that take advantage of the enhanced graphics and sound features of the PCjr.  Super Boulderdash and Jumpman are solid ports of these classic games with PCjr. features.  Microsoft Flight Simulator 2.0 looks best on the PCjr. and can take advantage of a 256KB PCjr.

The Device Driver JRCONFIG is a must if you are running a 256KB or more PCjr. in DOS.  The PCjr. was released with PC-DOS 2.1, and was officially last supported in PC-DOS 4.0.  DOS 5.0 and above require patching via DEBUG to run on the PCjr.  While DOS 3.3 and below can run in a 128KB PCjr., DOS 4.0 and above are not likely to leave much memory left for programs unless 256KB or more is in the system.