Posted on — Leave a comment

A new hardware project for the Sam Coupe

Recently, I have been experimenting with Claude AI to see what sort of things it is capable of. One of those experiments involved hooking up a Tang Nano 20k FPGA board to the Sam Coupe.

After a load of wiring, I got to the point where the Sam had the means of sending signals out from its euroconnector and into the FPGA board.

The next question was, what can I actually do with it? So I started chucking some suggestions at Claude. First up, could we make it act as a 4MB memory expansion? After a few iterations and a lot of testing and tweaking, the answer was yes!

So this process continued, each phase came with some hardware tweaks and a ton of testing of each feature. But each time, we added additional functionality to the board without impacting the ones we had already implemented.

My next questions were:

Could we implement the Atom Lite SD Card interface? Yes!
How about real-time clock support? Yes!
An AY Sound chip to allow Spectrum 128k games to run (Most of them, anyway)? Yes!
Could we implement the Paula Sound chip from the Amiga to play MOD Files more accurately? Yes!
The Blue Alpha Speed Synthesiser? Yes!
With an ESP32 hooked up, could we connect to Wi-Fi and have a web server so we can manage the Sam from a browser? Yes!
Could that ESP32 also be used as a modem for the Sam to allow it to connect to BBSs and IRC with a custom written terminal emulator? Yes!
Could we link up an OLED display to show what the interface is doing and display a graphic equaliser when playing music? Yes!
Could we use it to load ROM files into the Sam from the browser page? Yes!

I think that is the stage we are at now, but there is a chance I might have forgotten something! All of this work has been achieved in around 2 weeks of development, which is quite frankly amazing!

Yes, it doesn’t look very pretty at the moment, but it is functional!

I’ve still got a few small features to add and then go back and tidy up the web front end etc. But the fact that this now exists is awesome.

If you are interested in what some of these features look like, then head over to my YouTube channel as I’ve been posting some quick show and tell videos on there over the last week.

North Devon Retro Archive – YouTube Channel

Posted on — Leave a comment

Project: Arcade Cabinet Build

As you may have guessed from my previous post, I’m embarking on my next project of building a full-size arcade cabinet. I’ve decided to replicate a cabinet that used the original control panel that I was given.

I’ve created this in the projects section of my site and will be keeping a diary of the build progress along the way. I’ll also put up a post when updates are made so that anyone who has subscribed will get an email alert.

This is going to be a fun one! Head over to the projects section now, or click continue reading below.

Posted on — Leave a comment

CPS1 – Street Fighter II Repair – Part 1

About 1 year ago, I was gifted a couple of arcade boards and an arcade control panel by a friend of mine. Sadly, this friend has recently passed away, so I have now promoted a couple of projects involving these parts to the top of my priority list.

I started by connecting up the two arcade boards (Street Fighter II and Caveman Ninja) to see what we get out of them. The Caveman Ninja board had no output at all, but the Streetfighter II board actually had output to the screen, so I decided to start with this board as I figured it would be the easier repair (Yeah, right!).

Upon powering up the board, the game ran through the RAM tests, which all passed. But then it just hung on that screen.

I figured I’d start off with giving the board a good clean up, removing all of the socketed chips, sanding down the pins and giving them all a dose of de-oxit.

The only change in behavior was that the board no longer worked. At this point, I realised my rookie mistake where I had put one of the PAL chips the wrong way around. The writing printed on the chip was upsidedown compared to the others, and I just didn’t check the notch. Very disappointing, but luckily not unrecoverable.

The code for all of the PALs has been reverse-engineered for this board (https://wiki.pldarchive.co.uk/index.php?title=Street_Fighter_2_Champion_Edition), so after I had ordered some GAL16V8s, I programmed one of them with the code and was finally back to square one.

So where do we go from here? Ideally, I need to know what the board is actually trying to do at the point it is crashing. It was at this point that I had an idea. Everybody has surely heard of MAME (Multi Arcade Machine Emulator), which allows you to run Arcade ROMs on many different platforms. However, it also has some advanced features that most people would not have used before, one of which is an internal debugger, which allows you to disassemble the ROM code and also step through the code one instruction at a time, whilst also setting breakpoints and monitoring for specific conditions.

Running the ROM file in MAME, I could see that after the RAM tests, the screen goes blank and then changes the text to Street Fighter II. My board doesn’t get this far, so I needed to concentrate on the code that runs after the last RAM check, but before the screen blanks.

After a bit of playing around, I found a nice breakpoint to set at address 754. This is a loop in the code that prints a character to the screen. So with a breakpoint set here, every time I start the emulator running, it will print one more character to the screen and then pause. This will allow me to step through until the last OK message is written to the screen and then see what happens next.

I could see that during the RAM tests, all it was doing was writing a character into RAM and then reading it back and comparing it. I don’t think this is the most conclusive RAM test, but I guess it’s good enough to find basic RAM issues. I did do a quick check here and manually modified the area of memory so the compare would fail. It responded by marking that RAM test as “NG” (Not Good), and then froze the game. I didn’t need to do this bit as all the tests were passing, but I thought it was interesting.

The next thing I wanted to do was to try to find out where my board was stopping. I had a thought that if I could insert a reboot command into the actual ROM code at various points, I could then burn this to an EPROM and stick it in my board. If my board went into a reboot loop, then I would know that it was getting as far as executing that command.

68000 Assembly is not a speciality of mine, so I used AI to help here (sometimes it does actually have some uses!). My first attempts used a jump instruction to jump to address 0 and reset the board, but this had one small issue in that the opcode was 3 words long (6 bytes). The issue with this is that I could only insert it where another 6-byte opcode existed; otherwise, I would be overwriting other code. Asking AI for another way of rebooting the board, it suggested the opcode “ILLEGAL” which has a hex code of 4AFC. With this being 1 word long, I could insert it anywhere in the ROM without breaking anything.

I gave it a quick test and confirmed that my board did indeed reboot when it hit this command. I continued going through the code in chunks and added my reboot at various points to see how far my code was executing.

I eventually homed in on the exact part of the code where the board was stopping.

The culprit was an opcode stored at the address 1A0:

MOVE $2000, SR

Giving AI another chance to show its uses. I asked what this command did. It turns out this command essentially changes the Status Registers on the CPU. With the value of $2000, it would achieve the following:

  • Set the CPU to Supervisor mode
  • Enables interrupts
  • Clears all condition flags
  • Disabled Trace mode.

Out of those options, I already had a hunch of which one to concentrate on. Going back to the MAME debugger, after the command at 1A0, the next instruction executed was at address 5C6. But there was no jump instruction, so why did it suddenly jump to that address? One logical answer is that an interrupt was triggered.

A bit more research showed that on the 68K CPU, when an interrupt is triggered, it will jump to the address held in the interrupt vector relating to that interrupt. These values are located in the address range 60 to $7C, and looking at that area in the ROM file, I could see 05C6 listed, which confirmed to me that an interrupt was indeed being triggered that was causing the code to jump to address 5C6. The problem now is that my board never triggers that interrupt.

The 68k CPU has 3 interrupt pins, which are inputs. Each one of these can either be high or low, giving us 3 binary bits, and a total of 8 possible combinations.

According to the schematics for the CPS1 board, one of these interrupts is tied to 5V, which I confirmed with my scope. That left two other interrupt pins. I monitored both of these on my scope, and both of them remained permanently high.

The interrupt signal is an active low signal, so with all these staying high, no interrupt would ever be triggered, and my board would just sit there waiting for this signal. I traced the Interrupt pins on my board back to a 74LS74, which is a dual positive-edge-triggered flip-flop. I took a look at the datasheet for this IC and probed the input pins. One of the pins had a regular pulse to it, and looking at the schematics, this signal was the vertical blank signal.

With this input being triggered, the output pin going to the CPU should also be triggered. So it looks like the first issue to be identified is actually a faulty 74LS chip.

One last thing I could try before wrapping up this part of the repair was to replicate the interrupt being triggered. I could do this by simply shorting this signal to ground. Since the vertical blank signal was a continuous pulse. I replicated this by just tapping a ground wire onto the interrupt pin. With this, I was able to “run” the game frame by frame.

There is another issue in that the background graphics are corrupted. But that will be a problem for another day, after I have got the board at least running the code.

Stay tuned for part 2 once the new 74LS74 chips have arrived

Posted on — Leave a comment

Yamaha DX-7 Repair

Recently, a colleague at work contacted me and asked if I wanted some old computer stuff, including a 19″ CRT monitor and a colour Dot Matrix printer. This donation was gladly accepted, and whilst collecting my new toys, we found ourselves discussing various retro tech.

During this conversation, he mentioned that he had a Yamaha DX7 synthesiser that he had purchased, but it had a fault. It is very common for the batteries to die on these, which then leads to corrupted content in the RAM. In this case, though, the battery had already been replaced, but it didn’t fix the issue.

I did a quick Google search for the schematics, and essentially what I saw were the schematics of an 8-bit microcomputer. I said I’d take it back with me and take a look to see what was going wrong. Occasionally, the keyboard would appear to boot up, but would then hang, other times, the display would be garbled and completely unresponsive.

I knew the CPU was trying to run code because the display was occasionally showing correct text. Just to rule out a ROM chip issue, I downloaded the ROM file from the internet and compared it with the ROM stored on this chip. All looked ok, but I wrote the ROM to a new chip anyway and tested with the same result.

I then grabbed my scope and started probing the pins on the ROM chip to see what the address bus and data buses looked like. It was with the scope that I saw the issue, or at least the first issue. The data bus pins were all looking good with nice strong 5V peak-to-peak signals. But the first 8 address bus pins (0 to 7) were all a lot lower. Address bus pins 8-15 were all working as expected.

I dragged out the schematics and did a quick glance around for something that was only connected to the first 8 address bus pins. There was one very obvious candidate, a 74LS374 transparent latch IC that sat between the address bus and the ROM chip. Looking at the inputs of this IC showed they were nice and strong with no issues, but all the outputs were low, as shown in the picture above.

I suspected that this chip was faulty, but it could still be another IC on the board pulling the outputs low. So to test for that, I snipped one of the output pins so it was floating, then measured again. Exactly the same issue. At this point, I then removed the IC from the board, ready for the replacement chip to arrive.

Now off the board, I tested the chip in my chip tester just out of curiosity. It did indeed state that the device was faulty. I will be testing the new ones when they arrive, as I’ve not used this chip tester before, so not sure how much trust to put into it yet.

All I need to do now is await the delivery of the new IC and hopefully, this classic synth will be back up and running again. I will of course update everyone with the result, and hopefully this is the only fault 🙂

Posted on — 1 Comment

An ambitious and not 100% successful repair attempt – Epson HX20 LCD Board rebuild

I decided I wanted to pick up an Epson HX20. The fact that it has a built-in dot matrix printer seemed like it would be a pretty cool thing to mess around with.

After a bit of research, I discovered the main issue is that they came with a Ni-Cad battery installed, which usually leaks and causes damage to the computer. But a bad trace or two should be a simple enough fix, right?

So I trawled eBay and found a spares and repair unit for a cheap price. After all, I didn’t want to spend much on a computer that has a high chance of not working. And the majority of these computers are sold as untested or spares and repairs for that very reason.

Well, the device turned up, and upon unpacking it, I could already smell the leaking battery, but this was expected, so I took it apart to check out the LCD board, which normally takes most of the damage. I gave it a quick inspection to see if any damage was visible. And, well, yes, there was some visible damage lol.

From what I could see, a large number of traces were destroyed. So let this be a warning to anyone who is going to take a chance on one of these, if it’s “untested”, this is probably the state of it!

I downloaded the schematics and started testing the connections and marking off which ones were not connected. After a while of doing this, it became apparent that this board was pretty much destroyed. But I didn’t instantly give up (Although I probably should have).

I wanted to try one other thing: could I actually remake the board from scratch? This was a very ambitious project, and I didn’t really hold out much hope, but I think on the first attempt, I actually got a lot further than I expected.

I spent quite some time designing the PCB and re-creating some of the components in Easy EDA, as they weren’t in any of the libraries. The LCD screen for example, needed to be measured precisely and drawn manually.

Eventually, I ended up with this:

I had to manually route quite a lot of the connections, as the auto routers just couldn’t work it out, even on a 4-layer PCB.

But eventually, I ended up with a PCB that said all traces were connected. So I took the plunge and placed an order with JLCPCB. When they arrived, I then had the next challenge of unsoldering all the original parts and re-fitting them to my new PCB.

It was then time to give it a test. Would I see anything? Would lots of smoke pour from the display?

Well, to my surprise, it actually kind of worked. The main issue I had though, was that the alignment and fitment of the LCD screen wasn’t perfect, and I think the pin spacing was also very slightly out.

So, to be fair, I think I did a pretty good job and probably went above and beyond what anyone else would do to try and recover one of these computers.

I have proved that the actual computer itself is working fine, but I didn’t test the printer or tape drive on this unit. Now I have one of the boards made up, which I can directly compare against the original board, I can see some errors that if corrected, may actually get this working again 100%.

The problem is, changing these parts means a complete re-route of all the PCB traces again, which was quite time-consuming the first time around.

For now, I took the coward’s way out and purchased another HX20, which is nearly fully working and the only issue is with the cassette drive, which I think I can handle! I also tested the expansion unit from the old machine and tested it with the new one, so confirmed that it works fine.

So here is the new machine in all it’s glory!

I think I may give the LCD board another go, as it would probably be useful to the community to recover from this common fault on the HX20s. But, I also think I may take a break for a little while first, as my dreams have been haunted by routing PCB traces