Thursday, January 17, 2013

Hacking An Atari Lynx

Update 13.0214:
My niece gave me a bunch of old PC boards, one being a ISA bus sound card. And - it had a 74LS245 on it, although not a DIP package. Well, that works for me - I wired it in to the design (instead of a 540) and only to /CE0. I will wire both /CE0 and /CE1 when I find a 74LS08. Well, I may be able to wiring in both using diodes, but I need to do some research.

 The 74LS245 hot glued to the interface board and
blue wires attached to the 'B' side of the chip.

  The 74LS245 fully wired into the design.

Success! This is T-Tris, running on the new setup.

So, with the 74LS245 incorporated, I don't have to do a bunch of weird 'bus switching' code in the PIC. It simplifies the code dramatically, which is needed. Next is to incorporate either the USB for reading game images from a thumb drive, or an SD Card slot. OR figure out how to increase the storage capacity of the PIC some other way (right now it's 32K bytes minus 256 bytes for code and 64 bytes for a header).

Games running so far:
1) Pong1K
2) Karri's PONG
3) Centipede
4) T-Tris

I still haven't managed to get the BLL loader working. BUT - I _can_ load either pure cart images, 'LYNX' header images (for emulators) and 'BS93' images (again, for emulators).

Update 13.0131:

New ROM Emulator schematics, V1.01 (5 pages). Now I need to find the parts - how am I going to find a 74LS540 and a 74LS08 around here? Time to scrounge at the local repair shops.

Update 13.0131:
I need to add a tri-state buffer to the data lines, that is enabled when either CE0/ or CE1/ go low. Right now the PIC drives the data lines continuously and this messes with the buttons - and who knows what else. There is a tristate (TRISD) for the data port (PORTD), but I can't switch it around fast enough to present the data to the Lynx. GRRRR. I have a timeout method for tri-stating the data port, but I'm unsure if I am messing up anything else in the system before it tri-states. GRRRRR. Oh well, what's a 20pin part amongst friends?

Update 13.0130:
Two things: a new Game Cartridge document and a schematic for a cartridge that will allow you to emulate whatever ROM you want, plus read ROM images from a USB thumb drive.

Note: The previous versions of the Game Cartridge document have been removed as they were flawed and presented incorrect information. There's enough bad information out there, I don't want to add to the confusion.

Also note: the ROM emulator hardware is not fully tested yet, not has all of the software been written. That will come in the future.

Here's the ROM emulator schematic V1.00 (5 pages):

And here's the new Game Cartridge document - V1.02 (10 pages):



Previous updates and the original post below the break.

Update 13.0129:
SUCCESS!! Well, not the bootloader - I think there may be a problem with that image. But I loaded the mini-PONG (pong1k.lyx, for hardware) into the 'ROM' and -- it boots!

More in a bit - I have to update the Atari Lynx Game Cartridges document and finish up the ROM emulator document. And clean up the PIC18F4550 code for posting.
Update 13.0122:
The compact flash is not going to work. It doesn't just present data like an EPROM - it needs commands written to it first. And I don't have a micro to stick between it and the Lynx interface. Oh, well - at least I didn't start soldering wires on those tiny pins yet. I think I'm stuck with using an EPROM - which sucks, because I don't have the means to erase or program an EPROM.

Uh, on second thought - I'm going to wire up the PIC18F4550 demo board so it can act like an EPROM. I want to just get the BLL loader booting first - about 8K. After that - the PIC18F4550 can do I2C or SPI, to a serial EEPROM or an SD card. We'll see - BLL loader first...

Update 13.0121:
The decision has been made. I found a 256MB compact flash card floating around in the massive piles of junk spare parts I have in the MadLab. I also found two media readers, both of which take CF cards. So.... I am going to remove the CF connector from one reader and wire it in to my adapter board for the Lynx. I will use the other reader to write ROM images to the compact flash card. I am going to start out with CF card wired as a 256 block/1024 bytes per block device - which I think is a 256K ROM.

Wish me luck - I'm going in...

Update 13.0120:
I've been busy redrawing the schematics for Atari Lynx game cartridges. I've included my best attempts at schematics for the OTHELLO cartridge PCB, the ALPINE GAMES cartridge PCB, and a PCB design by a Polish guy named Pasiu (I think). Here are the original photos/drawings I worked from:

OTHELLO cartridge:

ALPINES GAMES cartridge:

PASIU cartridge PCB:

And here's my schematics. There's lots of information in the notes - I tried to coalesce all of the information I have found on the web into this document. There's 9 pages - a LOT of information.


Update 13.0119: So - the Othello cartridge looks like this:

I'm not quite sure why they are using the AUDIN line as (apparently) an address line. This isn't a 2MB part - in fact it looks like a 512KB part. Maybe actually a 1MB part and they are 'hiding' the upper 512KB? If anyone knows the answer, fill me in please.

In the process of generating this schematic for Othello, I found some ERRORS in the pin outs that are commonly found on the web (J1 in my comments refer to the game cartridge connector in the Lynx):

J1-31 is NOT just VCC - it is a VCC feed for the 4069 in the power on/off circuit inside of the Lynx. This MUST be connected to VCC (J1-33) in order for the Lynx to be able to power up. I jumped J1-31 and J1-33 on my system I am hacking on and now I can turn the unit on and off without a cartridge.
J1-3 and J1-4 are swapped. J1-3 should be ROMD2 and J1-4 should be ROMD4.
Everyone refers to A11 (ROMA11) being 'missing'. It's not 'missing' - it just wasn't required in the ROM access scheme that the Lynx uses.

The schematics I posted before are incorrect - they have ROMD2/ROMD4 swapped. I will correct them and repost ASAP.

I'm still trying to figure out what to use as a storage medium. I don't think using the PIC18F4550 will work - not enough memory inside that part. I have a Compact Flash card somewhere around here that I may use.

Update 13.0119:
And I thought I have built some crazy stuff before:

This is from the Hand Held Museum. Interesting stuff. I wonder how useful this "register viewer" was to software developers.

I also just found these pictures of the Othello game cartridge:

I'm going to kill my eyes and see if my schematics from yesterday match up with this cart. Stay tuned!

Update 13.0118:
I've taken a stab at generating schematics for what I think 128K, 256K and 512K game cartridges look like. Please correct me if I am wrong. I found the Atari Lynx game cartridge connector pin out information here, but I haven't been able to find a proper schematic of an actual game cartridge. I have read that the game cartridge is powered down during the 6502 sleep, which is why all of the devices on the carts are connected to SWVCC.

This exercise is just to allow me to wrap my head around the game cartridge architecture, so I can continue to brainstorm a replacement media.

Update 13.0117:
Done with wiring up the connector and the case is put back together. Now to brainstorm a storage medium of some sort...

Update 13.0117:
Here's some links for your informational / utility needs:

Atari Lynx BOOT ROM image: NitroROMs
Atari Lynx game cart images: AtariAge
Atari Lynx emulator for Windows: Handy Emulator
Atari Lynx developers documentation: AtariAge
Atari Lynx schematics: AtariAge (note that some information is missing where page meets page)
Atari Lynx history: CyberiaPC
Atari Lynx history: Wikipedia
Atari cartridge consoles summary: Atari

I'm still looking for development software that can be used on the PC running Windows XP (or even a DOS box).

And here's a snapshot of my wiring progress so far. Yeah, I'm slooooow...

Update 13.0117:
I've decided to just go with a 34 pin BERG connector for the Lynx game cart external connection. That way I can put a 34 pin BERG header on a perf board and build up the cart emulator hardware. So - two wires of 34 soldered - this is going to take a while.

 Two wires out of 34. Slow but steady...

I'm trying to decide on whether to go with interfacing to a Compact Flash card in 8-bit I/O mode, or to a PIC18F4550 development board I have. I don't know if the compact flash will work - but it's mainly hardware (I _will_ have to program the CF properly). If I use the PIC devel board, I will need to gen up some firmware for it. BUT - I will then have a USB interface to use to program the image. Decisions, decisions...

Update 13.0117:
I've removed the shields that cover Mikey and Suzy (the names are stamped on the parts). Well, lookie there - they are VLSI chips! I used to work for them - 8 years as a matter of fact, from 1992 until 2000, when Philips bought them. Then I worked for Philips in the PC Audio group (Thunderbird!) until 2004. I worked in Tempe, Arizona - Mikey and Suzy were probably made in San Jose, California. There's a couple of PALs near the chips, which doesn't surprise me. Probably to fix silicon bugs with the chips, which VLSI was notorious for doing. (My bad - these two chips are actually the 64K memory chips). I read in the Lynx docs that there are also a few bugs that weren't fixed and that the software developers would have to work around. I've been there and done that with VLSI chips, too.

I removed the knob wheel from the volume control potentiometer so that I can get a decent sized access hole to run the wires from the cart connector to external hardware. Progress!

The first shield to be removed - the copper plate on the button side
of the circuit board. I don't really need to remove the shields, but
I'm interested to get a glimpse of the MIKEY and SUZY chips.

The copper plate shield removed. Nothing really interesting, except
it looks like there are DIP part footprints under it. Are MIKEY
and SUZY DIP parts?

The next shield to be removed - a large 'tin can' type around MIKEY
and SUZY on the component side of the circuit board.

Tin can removed - and there's MIKEY and SUZY - and they are
VLSI parts?!? I used to work for VLSI. These are date stamped
1989, 3 years before I worked there. The tin can pretty much
encapsulates the main guts of the design.

I was going to unsolder the volume control potentiometer and hard
wire it for full volume - so I can clear access through the hole for
the knob. I need someplace to pass through blue wires, without cutting
a new hole in the plastics. HOWEVER - the circuit board seems to
have a beefy ground plane and I started lifting traces when attempting
to unsolder the part. So - new tact...

Instead of removing the potentiometer, I'm going to just remove the
plastic knob, since it has a handy screw holding it in place.

The volume control knob has been removed to allow the passage of
blue wires out of the case, without cutting any extra holes.

VLSI chips! Mikey on the left, Suzy on the right. Note the two PALs
that seem to interconnect the chips - there must have been a pretty
hefty bug in the two parts. Adding PALs to a design, when you
already have two custom chips, isn't cheap. (my bad - those two
chips are actually the 64K memory chips)

Oops. I removed the wrong knob before. _This_ is the volume control,
sans knob. The other was the contrast/brightness control.

The circuit board placed back in the bottom case.

There! The top case is placed and there's plenty of room
to run blue wires...

I have two old Atari handheld gaming systems - an original Lynx (top) and a Lynx II (bottom). Unfortunately, I don't have a single game cart for them (I used to own a lot, but that's another lifetime and a long story ago). So - I need to be able to get games on the system. The hack is going to be patching into the 33 pin cart socket to some sort of hardware that I can load games onto. And I may upgrade the florescent tube backlight to LEDs. We'll see. First, the tear down of the Lynx I:

Top view of the Lynx I before I crack open the case.
LCD, game pad (left), buttons (right), speaker (right).

Bottom view of the Lynx I before I crack open the case.
Labels and battery compartment.

Top edge of the Lynx I, with the power, COMLYNX, and
headphones connectors, plus the volume control knob.

Right side buttons.

Bottom edge, showing the brightness control knob.

Left side, with the 4 way game pad and the power buttons.

The compartment where the game cart is inserted.

The case is opened! This is the inside of the top part of the case.

The battery compartment opened. Oy, 6 'AA' batteries required.
Maybe we will do something about that, also.

The inside of the Lynx I - button pads, LCD, and speaker.
There's LOTS of shielding inside this unit.

Circuit board lifted out of the bottom half of the case.
Cart connector to the left, LCD backlight in the middle, speaker to the right.

Closer view of the right side of the circuit board. The backlight power supply is
a separate board mounted on the main circuit board.

Closer view of the left side of the circuit board. Game cart connector and
LCD backlight housing. Volume and brightness control knobs are visible,
plus all of the I/O connectors. Under that metal shield reside Mickey and
Suzie, the two specialized chips that are the heart of the system.

The game cart connector, solder side. This is where most of the action
will take place. I just need to figure out how to route all of the blue wires
I will add so I don't need to hack up the plastic case.

Closer view of the right side of the circuit board, button pad side.

1 comment:

  1. Just found this and I feel stupid for not having found it earlier. I was looking into cartridge and pins layout, because my homemade cartridge reader (for Batronix Batupo II) seems to be quirky. I didn't built it, so was reading up on the information. This will help. It's a whole lot of info.
    Did you ever mention this on the Atari Age Lynx forums?