WEBVTT
Kind: captions
Language: en

00:00:02.720 --> 00:00:07.200
So, I have made a habit of collecting&nbsp;
obscure underdog game systems.

00:00:07.200 --> 00:00:10.880
I have Sega's Holy Tragedy:&nbsp;
the Genesis, CD, and 32X,

00:00:10.880 --> 00:00:11.840
I have a 3DO,

00:00:11.840 --> 00:00:12.480
a Jaguar,

00:00:12.480 --> 00:00:15.440
and at one point had as many as three&nbsp;
different models of Sega Saturn.

00:00:15.440 --> 00:00:16.880
I only have one now.

00:00:16.880 --> 00:00:21.200
But probably the most obscure of my&nbsp;
collection are my four Philips CD-is.

00:00:21.200 --> 00:00:24.320
Some of these are so obscure that they&nbsp;
probably deserve videos all of their own,&nbsp;&nbsp;

00:00:24.320 --> 00:00:27.760
but to even get to that point,&nbsp;
we need to be able to play them.

00:00:27.760 --> 00:00:30.240
Many of these came with no controller at all,&nbsp;&nbsp;

00:00:30.240 --> 00:00:34.400
which isn't necessarily uncommon when scraping&nbsp;
the bottom of the barrel for old game consoles,&nbsp;&nbsp;

00:00:34.400 --> 00:00:38.880
but the ones that did come with a controller&nbsp;
usually came with something like this or this.

00:00:38.880 --> 00:00:41.600
Fine for something that's&nbsp;
point-and-click or mostly menuing,&nbsp;&nbsp;

00:00:41.600 --> 00:00:44.640
but nothing you'd ever want to&nbsp;
play an action platformer with.

00:00:44.640 --> 00:00:48.240
The CD-i did have real controllers,&nbsp;
but since Philips' pivot to video&nbsp;&nbsp;

00:00:48.240 --> 00:00:51.680
games happened relatively late in&nbsp;
the life cycle, long after anyone&nbsp;&nbsp;

00:00:51.680 --> 00:00:56.080
stopped giving a [censored] about the CD-i,&nbsp;
these things are rare and pretty expensive.

00:00:56.080 --> 00:00:58.240
As such, the CD-i community...

00:00:58.240 --> 00:00:59.760
...yes, that really exists...

00:00:59.760 --> 00:01:03.360
...has been forced to come up with alternatives&nbsp;
to get the most out of their systems.

00:01:03.360 --> 00:01:08.240
A notable example is the SNEStoCDi, which&nbsp;
does exactly what it says on the tin.

00:01:08.240 --> 00:01:13.440
There was a CD-i controller that pretty closely&nbsp;
resembles the SNES controller, so it makes sense.

00:01:13.440 --> 00:01:16.640
Also, the BlueRetro Project, which&nbsp;
is a whole suite that allows pairing&nbsp;&nbsp;

00:01:16.640 --> 00:01:20.800
a wide variety of Bluetooth controllers&nbsp;
with older systems, including the CD-i.

00:01:20.800 --> 00:01:23.040
The reason I didn't go with&nbsp;
either one of these was:&nbsp;&nbsp;

00:01:23.040 --> 00:01:26.960
one, I don't actually own any SNES controllers.

00:01:26.960 --> 00:01:28.160
Yeah, surprising, right?

00:01:28.160 --> 00:01:31.920
Somehow the Super Nintendo is like the&nbsp;
only mainstream console I've never owned.

00:01:31.920 --> 00:01:33.280
And it's worth reiterating...

00:01:33.280 --> 00:01:34.960
I own four CD-is.

00:01:34.960 --> 00:01:38.560
The BlueRetro Project is cool, but&nbsp;
the CD-i version suffers from a pretty&nbsp;&nbsp;

00:01:38.560 --> 00:01:42.800
annoying timing problem where the BlueRetro&nbsp;
needs to be switched on *before* the CD-i,&nbsp;&nbsp;

00:01:42.800 --> 00:01:46.320
and the only way it can do that&nbsp;
is by being powered externally.

00:01:46.320 --> 00:01:49.600
You know, by a whole separate brick.

00:01:49.600 --> 00:01:52.800
Instead, I decided to make my own&nbsp;
for the Genesis controller because&nbsp;&nbsp;

00:01:52.800 --> 00:01:56.800
not only do I have plenty of them thanks&nbsp;
to my aforementioned "Mount Sega," but it&nbsp;&nbsp;

00:01:56.800 --> 00:02:01.040
also very closely resembles the other&nbsp;
official CD-i game controller design.

00:02:01.040 --> 00:02:03.840
There are also other benefits like the&nbsp;
fact that the Genesis controller uses&nbsp;&nbsp;

00:02:03.840 --> 00:02:07.440
a simple DB-9 connector, which&nbsp;
is cheap and readily available.

00:02:07.440 --> 00:02:09.440
The Super Nintendo's connector can be acquired&nbsp;&nbsp;

00:02:09.440 --> 00:02:13.360
too, but it's proprietary and can't&nbsp;
as easily be used for things like...

00:02:13.360 --> 00:02:15.120
...repairing Guitar Hero controllers.

00:02:15.120 --> 00:02:19.120
The Genesis controller is also designed to&nbsp;
be compatible with the Atari joystick port,&nbsp;&nbsp;

00:02:19.120 --> 00:02:23.440
which was used by a ton of systems throughout&nbsp;
the 80s from Atari, Sega, and Commodore.

00:02:23.440 --> 00:02:24.800
This means by supporting one,&nbsp;&nbsp;

00:02:24.800 --> 00:02:28.080
it should theoretically support&nbsp;
all of those other controllers too.

00:02:28.080 --> 00:02:32.000
Not that I'll ever probably use any of&nbsp;
those, but it's nice to have regardless.

00:02:32.000 --> 00:02:33.680
So, with that, it's just a simple matter of&nbsp;&nbsp;

00:02:33.680 --> 00:02:37.600
converting the controller signals&nbsp;
from the Genesis to the CD-i.

00:02:37.600 --> 00:02:42.800
Both systems are fairly simple to understand,&nbsp;
however they do work fundamentally differently,&nbsp;&nbsp;

00:02:42.800 --> 00:02:46.240
requiring at least some kind of&nbsp;
microcontroller to do the conversion.

00:02:46.240 --> 00:02:49.440
Like I said, the Genesis controller,&nbsp;
and Master System for that matter,&nbsp;&nbsp;

00:02:49.440 --> 00:02:53.120
are extensions of the Atari standard,&nbsp;
which really couldn't be any simpler.

00:02:53.120 --> 00:02:56.240
The pinout looks something like&nbsp;
this, and all that the standard&nbsp;&nbsp;

00:02:56.240 --> 00:02:59.360
requires is that when a button is&nbsp;
pushed, it is shorted to ground.

00:02:59.360 --> 00:03:01.920
It doesn't make any other prescriptions than that.

00:03:01.920 --> 00:03:04.000
This made the controllers dead simple.

00:03:04.000 --> 00:03:06.480
They don't require any&nbsp;
actual electronic components,&nbsp;&nbsp;

00:03:06.480 --> 00:03:09.440
just physical buttons wired up in a specific way.

00:03:09.440 --> 00:03:12.720
Later variations by both Atari and&nbsp;
others would fill these remaining&nbsp;&nbsp;

00:03:12.720 --> 00:03:17.200
three pins with other things like&nbsp;
analog paddles and a formal 5V rail,&nbsp;&nbsp;

00:03:17.200 --> 00:03:21.200
but these were implemented inconsistently,&nbsp;
and there were inevitably incompatibilities&nbsp;&nbsp;

00:03:21.200 --> 00:03:25.360
that could range from not working at all&nbsp;
to straight up damaging your console.

00:03:25.360 --> 00:03:27.680
Sega wanted to squeeze the Genesis controller into&nbsp;&nbsp;

00:03:27.680 --> 00:03:31.440
this landscape while still making it&nbsp;
as backwards compatible as possible.

00:03:31.440 --> 00:03:34.720
A tall order, but what they came&nbsp;
up with was pretty interesting.

00:03:34.720 --> 00:03:36.960
The D-Pad is mapped how you would expect.

00:03:36.960 --> 00:03:40.640
As for the Atari's single "fire" button,&nbsp;
they mapped it to the Genesis' "B" button&nbsp;&nbsp;

00:03:40.640 --> 00:03:44.000
since it's the one your thumb most&nbsp;
naturally lands on when holding it.

00:03:44.000 --> 00:03:47.280
They also map button "C" to pin&nbsp;
9, which if it was used at all,&nbsp;&nbsp;

00:03:47.280 --> 00:03:51.120
was typically used for either analog&nbsp;
input or a second button anyway.

00:03:51.120 --> 00:03:54.000
By default, this is how the&nbsp;
Genesis controller behaves.

00:03:54.000 --> 00:03:59.520
It provides a very Atari-friendly layout with no&nbsp;
conflicts and no way to damage existing hardware.

00:03:59.520 --> 00:04:05.120
However, if 5 volts is provided to pin 5, which&nbsp;
at that point was historically the least used pin,&nbsp;&nbsp;

00:04:05.120 --> 00:04:08.720
an additional circuit activates&nbsp;
that starts listening on pin 7.

00:04:08.720 --> 00:04:12.240
If pin 7 is then pulled low, the buttons change.

00:04:12.240 --> 00:04:16.560
The "B" and "C" signals are swapped&nbsp;
out for "A" and "Start", respectively.

00:04:16.560 --> 00:04:19.840
The controller also makes "left" and&nbsp;
"right" appear to be pressed as a kind&nbsp;&nbsp;

00:04:19.840 --> 00:04:23.600
of signal to the game that it's heard&nbsp;
pin 7 go low and has made this swap,&nbsp;&nbsp;

00:04:23.600 --> 00:04:28.000
since holding left and right at the same time&nbsp;
would be physically impossible to do normally.

00:04:28.000 --> 00:04:29.680
By switching pin 7 back and forth,&nbsp;&nbsp;

00:04:29.680 --> 00:04:33.280
Genesis games can get the state of&nbsp;
all four buttons on the controller.

00:04:33.280 --> 00:04:38.000
Meanwhile, for other systems, some of which only&nbsp;
powered pin 7, but most of which didn't power&nbsp;&nbsp;

00:04:38.000 --> 00:04:42.640
either, the Genesis controller will automatically&nbsp;
fall back to standard Atari joystick mode.

00:04:42.640 --> 00:04:45.920
It's pretty clever and means the Genesis&nbsp;
and its controller are interchangeable&nbsp;&nbsp;

00:04:45.920 --> 00:04:49.200
with a huge variety of consoles and controllers.

00:04:49.200 --> 00:04:52.480
Not all of them, mind you,&nbsp;
there are a few rare edge cases,&nbsp;&nbsp;

00:04:52.480 --> 00:04:55.440
even with some games in Sega's&nbsp;
own Master System library.

00:04:55.440 --> 00:04:58.480
But the vast majority of the&nbsp;
time, it indeed just works,&nbsp;&nbsp;

00:04:58.480 --> 00:05:01.120
which is about as good as&nbsp;
they could have hoped for.

00:05:01.120 --> 00:05:02.240
Now, what the hell is this?

00:05:02.240 --> 00:05:03.600
A six-button controller?

00:05:03.600 --> 00:05:06.080
How are we going to fit another four buttons in?

00:05:06.080 --> 00:05:08.800
Well, here it gets a little more complicated.

00:05:08.800 --> 00:05:12.400
On there, if you pulse the select&nbsp;
pin three times in quick succession,&nbsp;&nbsp;

00:05:12.400 --> 00:05:16.160
and on the third pulse, all of the&nbsp;
D-Pad buttons appear to be pressed,&nbsp;&nbsp;

00:05:16.160 --> 00:05:19.200
then the game knows it's talking&nbsp;
to a six-button controller.

00:05:19.200 --> 00:05:21.120
And the next time you pull the select pin high,&nbsp;&nbsp;

00:05:21.120 --> 00:05:24.240
it'll now give you the status of&nbsp;
those additional four buttons.

00:05:24.240 --> 00:05:27.760
After which, it'll go back to normal&nbsp;
until you pulse three times again.

00:05:27.760 --> 00:05:30.880
This remains backwards compatible... mostly.

00:05:30.880 --> 00:05:33.920
You have to pulse very quickly to&nbsp;
see the additional buttons - faster&nbsp;&nbsp;

00:05:33.920 --> 00:05:36.000
than once per frame, like most games would.

00:05:36.000 --> 00:05:38.560
So, chances are a game that&nbsp;
isn't designed for six-button&nbsp;&nbsp;

00:05:38.560 --> 00:05:41.120
controllers will never see these extra buttons.

00:05:41.120 --> 00:05:44.960
But some games *did* pulse too&nbsp;
quickly, because of course they did.

00:05:44.960 --> 00:05:49.520
These games could suffer anything from&nbsp;
subtle control issues to instant game overs.

00:05:49.520 --> 00:05:52.320
But not to worry, Sega did provide a fallback.

00:05:52.320 --> 00:05:56.160
If you hold the mode button while powering&nbsp;
on the console, the controller disables all&nbsp;&nbsp;

00:05:56.160 --> 00:06:00.640
of that functionality, behaving identically&nbsp;
to an ordinary three-button controller again.

00:06:00.640 --> 00:06:03.680
The mode button was also available&nbsp;
as a regular button during gameplay.

00:06:03.680 --> 00:06:06.720
So, they did about everything they could&nbsp;
to reach the same number of buttons as a&nbsp;&nbsp;

00:06:06.720 --> 00:06:11.440
Super Nintendo without breaking everything,&nbsp;
but there was only so much they could do.

00:06:11.440 --> 00:06:15.440
Overall, the Genesis controller is pretty&nbsp;
straightforward to read. For the most part,&nbsp;&nbsp;

00:06:15.440 --> 00:06:18.400
it's just looking at the state&nbsp;
of some pins on the connector.

00:06:18.400 --> 00:06:23.200
But the CD-i, on the other&nbsp;
hand, is a very different story.

00:06:23.200 --> 00:06:25.680
If you look at the pinout&nbsp;
of a CD-i controller port,&nbsp;&nbsp;

00:06:25.680 --> 00:06:30.800
there are no buttons directly exposed, just&nbsp;
pins for receiving data and transmitting data.

00:06:30.800 --> 00:06:34.160
This is because rather than exposing the&nbsp;
hardware buttons straight on the connector,&nbsp;&nbsp;

00:06:34.160 --> 00:06:39.120
the CD-i controllers digitize the data themselves&nbsp;
and send it over as a sequence of bytes.

00:06:39.120 --> 00:06:41.840
This is known as a serial connection.

00:06:41.840 --> 00:06:45.360
In fact, if you put the pinout of&nbsp;
an old PC serial port side-by-side,&nbsp;&nbsp;

00:06:45.360 --> 00:06:47.760
you'll see they share a lot of similarities.

00:06:47.760 --> 00:06:51.440
And ironically, those ports also used to use DB-9.

00:06:51.440 --> 00:06:53.840
However, just because it shares&nbsp;
a connector doesn't mean it's&nbsp;&nbsp;

00:06:53.840 --> 00:06:55.920
compatible with the Atari joystick standard.

00:06:55.920 --> 00:06:58.880
And just because the pinout looks&nbsp;
very similar to the CD-i's doesn't&nbsp;&nbsp;

00:06:58.880 --> 00:07:01.200
mean it's compatible with that interface either.

00:07:01.200 --> 00:07:04.000
Sending bytes is obviously a&nbsp;
little more complicated than&nbsp;&nbsp;

00:07:04.000 --> 00:07:06.800
making the buttons directly&nbsp;
accessible on the connector.

00:07:06.800 --> 00:07:10.640
Both sides need to agree to a speed and&nbsp;
time their communications precisely so&nbsp;&nbsp;

00:07:10.640 --> 00:07:14.400
that the receiver reads a bit at the&nbsp;
same time the sender has written it.

00:07:14.400 --> 00:07:17.120
On the flip side, our wiring can be a lot simpler.

00:07:17.120 --> 00:07:21.200
While the Genesis requires all 9 pins to&nbsp;
be wired up, all of our communication here&nbsp;&nbsp;

00:07:21.200 --> 00:07:26.160
happens over a single wire: the CD-i's&nbsp;
"receive data" pin, also known as RXD.

00:07:26.160 --> 00:07:28.560
We'll also take 5 volts power from the CD-i,&nbsp;&nbsp;

00:07:28.560 --> 00:07:32.400
conveniently exactly what we need to run&nbsp;
both an Arduino and a Genesis controller.

00:07:32.400 --> 00:07:36.560
And last but not least, we need to listen&nbsp;
for the CD-i's "request to send" signal.

00:07:36.560 --> 00:07:38.880
This is a standard part of serial communication.

00:07:38.880 --> 00:07:43.600
The CD-i holds this pin "high" when it's finished&nbsp;
powering on and is ready to receive data from us.

00:07:43.600 --> 00:07:47.920
It expects the controller to identify itself&nbsp;
within a certain time frame of the RTS signal,&nbsp;&nbsp;

00:07:47.920 --> 00:07:52.320
which is actually why the BlueRetro needs&nbsp;
to be powered on before the CD-i powers on.

00:07:52.320 --> 00:07:54.960
It needs slightly more time&nbsp;
to load its firmware and&nbsp;&nbsp;

00:07:54.960 --> 00:07:57.600
initialize than the CD-i is willing to give it.

00:07:57.600 --> 00:07:58.720
Unlucky.

00:07:58.720 --> 00:08:01.040
But yeah, those are all the wires we need - less&nbsp;&nbsp;

00:08:01.040 --> 00:08:04.080
than half of the connections we&nbsp;
need for the Genesis controller.

00:08:04.080 --> 00:08:08.480
The other benefit of serial communication is&nbsp;
that you can kind of send whatever you want.

00:08:08.480 --> 00:08:11.120
You're not limited on pin count&nbsp;
like you are on the Genesis,&nbsp;&nbsp;

00:08:11.120 --> 00:08:14.320
you can have a theoretically&nbsp;
infinite number of buttons.

00:08:14.320 --> 00:08:19.040
Which is ironic because CD-i&nbsp;
controllers never had more than two.

00:08:19.040 --> 00:08:19.920
Yeah, two.

00:08:19.920 --> 00:08:22.160
And that includes any kind of pause button.

00:08:22.160 --> 00:08:26.480
You might think you're seeing three buttons&nbsp;
here, or four buttons there, but you're not.

00:08:26.480 --> 00:08:30.640
All of these are either button 1,&nbsp;
button 2, or both at the same time,&nbsp;&nbsp;

00:08:30.640 --> 00:08:33.600
which some games use to fudge a third button.

00:08:33.600 --> 00:08:38.560
It seems like for the most part, everything on the&nbsp;
CD-i is actually internally simulating a mouse.

00:08:38.560 --> 00:08:41.520
Whether it's the IR remote,&nbsp;
a game controller, or...

00:08:41.520 --> 00:08:42.640
...the CD-i mouse.

00:08:42.640 --> 00:08:46.240
The specification refers to all&nbsp;
three as "pointing devices."

00:08:46.240 --> 00:08:50.000
CD-i controllers don't report whether&nbsp;
"left" or "right" is being pressed or not.

00:08:50.000 --> 00:08:55.440
Instead, they send a sequence of bytes that says&nbsp;
"move left by 8 pixels" or "move right by 16."

00:08:55.440 --> 00:08:58.880
That means it's actually up to us how&nbsp;
fast we want the cursor to move around.

00:08:58.880 --> 00:09:03.200
And some controllers even had a speed setting&nbsp;
letting players choose for themselves.

00:09:03.200 --> 00:09:06.560
It also theoretically means you can&nbsp;
implement a kind of analog control&nbsp;&nbsp;

00:09:06.560 --> 00:09:09.760
by telling it to move more or less&nbsp;
based on the position of a joystick.

00:09:09.760 --> 00:09:14.160
However, I'm not aware of any CD-i controller&nbsp;
or game that ever took advantage of this.

00:09:14.160 --> 00:09:16.000
Instead, it becomes kind of awkward because,&nbsp;&nbsp;

00:09:16.000 --> 00:09:20.000
in a sidescroller like Zelda, it's not&nbsp;
responding to a button being held down.

00:09:20.000 --> 00:09:24.240
It's responding to being told over and&nbsp;
over to move by a certain amount of pixels.

00:09:24.240 --> 00:09:27.440
This system probably made sense&nbsp;
for the CD-i's original intended&nbsp;&nbsp;

00:09:27.440 --> 00:09:29.920
use case of mostly point-and-click software.

00:09:29.920 --> 00:09:34.320
In fact, when it was originally announced in&nbsp;
1986, it was probably fairly forward-thinking.

00:09:34.320 --> 00:09:37.200
At the time, it was rare to see a&nbsp;
mouse with more than one button.

00:09:37.200 --> 00:09:40.400
Hell, it was rare to see a mouse&nbsp;
at all on most personal computers.

00:09:40.400 --> 00:09:42.000
But, as with most things CD-i,&nbsp;&nbsp;

00:09:42.000 --> 00:09:45.920
this had fallen well behind by the time&nbsp;
the hardware was actually available.

00:09:45.920 --> 00:09:50.000
Especially by the mid-90s, I mean compare&nbsp;
this to the PlayStation 1 for God's sake.

00:09:50.000 --> 00:09:53.360
I'm convinced that limitations like&nbsp;
the two-button control scheme were&nbsp;&nbsp;

00:09:53.360 --> 00:09:58.320
a major contributing factor as to why no&nbsp;
truly great games ever came to the CD-i.

00:09:58.320 --> 00:10:02.720
But to be fair, had the CD-i been a success, we&nbsp;
probably wouldn't be talking about it right now,&nbsp;&nbsp;

00:10:02.720 --> 00:10:05.040
so let's get this controller protocol implemented.

00:10:05.040 --> 00:10:10.160
The CD-i spec defines rates of 1,200 and&nbsp;
9,600 bits per second, but in practice,&nbsp;&nbsp;

00:10:10.160 --> 00:10:12.880
only 1,200 baud devices ever got released.

00:10:12.880 --> 00:10:18.400
Well, to do something 1,200 times a second&nbsp;
means doing it roughly every 833 microseconds.

00:10:18.400 --> 00:10:20.880
So, let's set up a timer for roughly that amount.

00:10:20.880 --> 00:10:23.680
The CD-i doesn't require&nbsp;
you to be microsecond-exact.

00:10:23.680 --> 00:10:28.960
And whenever the timer pings, you pull a pin low&nbsp;
or high to send either a 1 or 0 to the console.

00:10:28.960 --> 00:10:29.920
What's in the bits?

00:10:29.920 --> 00:10:35.120
Well, for a so-called "pointing device"&nbsp;
like this, it uses three sets of seven bits.

00:10:35.120 --> 00:10:38.400
The first bit denotes whether&nbsp;
that set is the first set or not.

00:10:38.400 --> 00:10:42.160
Then, the next two bits of the first&nbsp;
set are the state of the two buttons.

00:10:42.160 --> 00:10:46.160
Then, the amount of X and Y movement&nbsp;
is transmitted as two 8-bit values,&nbsp;&nbsp;

00:10:46.160 --> 00:10:49.040
six bits of which go into the second&nbsp;
and third set, with the remaining&nbsp;&nbsp;

00:10:49.040 --> 00:10:53.280
two bits of each just squeezing into&nbsp;
the left over space in the first set.

00:10:53.280 --> 00:10:55.920
Yep, it's about as compact as it could be.

00:10:55.920 --> 00:11:00.960
Then, to make it clear where the data starts and&nbsp;
stops, we slap on a start bit and two stop bits.

00:11:00.960 --> 00:11:05.280
That's the CD-i pointing device specification in a&nbsp;
nutshell, and if it sounds familiar to any of you&nbsp;&nbsp;

00:11:05.280 --> 00:11:09.600
who have looked into serial devices before, that's&nbsp;
because it was pretty much lifted verbatim from&nbsp;&nbsp;

00:11:09.600 --> 00:11:16.080
how serial PC mice worked at the time, using that&nbsp;
same DB-9 serial connector I mentioned earlier.

00:11:16.080 --> 00:11:19.280
It's not hard to see where Philips&nbsp;
drew most of their inspiration from,&nbsp;&nbsp;

00:11:19.280 --> 00:11:21.920
as well as who they saw as their main competition.

00:11:21.920 --> 00:11:24.720
Not game consoles, but PCs.

00:11:24.720 --> 00:11:26.320
Anyways, back to the adapter.

00:11:26.320 --> 00:11:30.480
Even though with all this understanding, I could&nbsp;
have written an adapter from scratch, I ultimately&nbsp;&nbsp;

00:11:30.480 --> 00:11:34.800
decided to use off-the-shelf libraries for the&nbsp;
CD-i and Genesis parts of the communication.

00:11:34.800 --> 00:11:37.920
I figured why risk the inevitable&nbsp;
bugs and mistakes of writing code&nbsp;&nbsp;

00:11:37.920 --> 00:11:41.840
from scratch when presumably&nbsp;
well-tested code already exists.

00:11:41.840 --> 00:11:44.640
So, at that point, I basically&nbsp;
just had to write the glue,&nbsp;&nbsp;

00:11:44.640 --> 00:11:48.720
receiving data from the Genesis library&nbsp;
and sending it to the CD-i library.

00:11:48.720 --> 00:11:51.920
I flashed it onto the cheapest&nbsp;
Arduino I had, the Pro Micro,&nbsp;&nbsp;

00:11:51.920 --> 00:11:57.520
which actually has just enough pins to handle&nbsp;
two Genesis controllers and two CD-i controllers.

00:11:57.520 --> 00:12:02.320
And so that's how I wired this monstrosity&nbsp;
up, which served as my initial prototype.

00:12:02.320 --> 00:12:04.960
Despite how it looks, it did work perfectly.

00:12:04.960 --> 00:12:07.360
However, there's really no defending this.

00:12:07.360 --> 00:12:10.160
It was just begging to fall apart and break.

00:12:10.160 --> 00:12:13.920
I knew I had to make it more&nbsp;
user-friendly and less fragile.

00:12:14.800 --> 00:12:17.760
So, I designed a PCB, which&nbsp;
is actually extremely simple&nbsp;&nbsp;

00:12:17.760 --> 00:12:19.760
because there are no other components on it.

00:12:19.760 --> 00:12:22.480
Everything we need is already&nbsp;
on the Arduino, we just&nbsp;&nbsp;

00:12:22.480 --> 00:12:25.360
etched all of those spaghetti&nbsp;
wires onto a board instead.

00:12:25.360 --> 00:12:29.040
The board does add some bulk though&nbsp;
that we'll have to put somewhere.

00:12:29.040 --> 00:12:30.960
There are a few different&nbsp;
approaches I thought about.

00:12:30.960 --> 00:12:33.600
You could just fit it all&nbsp;
into a box with plugs on it.

00:12:33.600 --> 00:12:37.200
That's probably the simplest way to build&nbsp;
it, though I worried about just having a&nbsp;&nbsp;

00:12:37.200 --> 00:12:40.880
box in the middle of the room that&nbsp;
someone could step on or trip over.

00:12:40.880 --> 00:12:45.120
Alternatively I could try to stuff all&nbsp;
of the electronics into the CD-i plug.

00:12:45.120 --> 00:12:49.280
Then it's almost like the Genesis controller&nbsp;
is plugged straight into the CD-i.

00:12:49.280 --> 00:12:54.320
My concern with this is it might be a lot of&nbsp;
rigid mass to have sitting right in the port.

00:12:54.320 --> 00:12:58.240
If someone bumped it, it could&nbsp;
genuinely cause damage internally.

00:12:58.240 --> 00:13:01.040
So ultimately, I decided for something in between:&nbsp;&nbsp;

00:13:01.040 --> 00:13:05.280
have the electronics in a small box&nbsp;
attached directly to a short flexible cable.

00:13:05.280 --> 00:13:09.520
Essentially, it's a dongle, and I know&nbsp;
there are lot of reasons to hate dongles,&nbsp;&nbsp;

00:13:09.520 --> 00:13:12.480
but in this scenario I felt&nbsp;
it made the most sense.

00:13:12.480 --> 00:13:14.320
But honestly, none of these approaches are wrong&nbsp;&nbsp;

00:13:14.320 --> 00:13:17.040
and I could see the argument&nbsp;
for preferring any of them.

00:13:17.040 --> 00:13:21.200
With that, it was time to get these boards&nbsp;
manufactured, and who else would I choose?

00:13:21.200 --> 00:13:23.360
That's right, it's PCBWay.

00:13:23.360 --> 00:13:27.680
I've been to PCBWay's factory&nbsp;
in-person and it's a massive operation.

00:13:27.680 --> 00:13:31.920
PCBs look simple but there are so&nbsp;
many steps and levels to making them.

00:13:31.920 --> 00:13:34.240
So many materials and chemicals that I've never&nbsp;&nbsp;

00:13:34.240 --> 00:13:37.280
heard of in my life but that&nbsp;
these guys are experts in.

00:13:37.280 --> 00:13:40.800
I would have assumed that the process was&nbsp;
all robots and machines, and the equipment&nbsp;&nbsp;

00:13:40.800 --> 00:13:45.680
they have is very impressive, but it's all being&nbsp;
driven by a remarkable amount of human beings,&nbsp;&nbsp;

00:13:45.680 --> 00:13:50.320
working hard every step of the way to ensure&nbsp;
the PCBs come out correctly every single time.

00:13:50.320 --> 00:13:55.200
And with just a couple clicks on pcbway.com,&nbsp;
your design embarks on this huge journey.

00:13:55.200 --> 00:13:57.680
I'll never get tired of going&nbsp;
from an idea and a couple of&nbsp;&nbsp;

00:13:57.680 --> 00:14:00.960
lines on the computer to holding&nbsp;
the physical boards in my hands.

00:14:00.960 --> 00:14:03.200
Thanks to PCBWay for sponsoring this video and&nbsp;&nbsp;

00:14:03.200 --> 00:14:06.000
making these high quality&nbsp;
boards just how I imagined.

00:14:06.000 --> 00:14:08.160
Now back to the funny meme console...

00:14:08.160 --> 00:14:10.400
With that, let's start putting this together.

00:14:10.400 --> 00:14:13.200
At first, I was a little annoyed&nbsp;
because it seemed like the DB-9&nbsp;&nbsp;

00:14:13.200 --> 00:14:16.560
plugs I had didn't quite fit the&nbsp;
footprint I'd used in my design.

00:14:16.560 --> 00:14:20.640
But then I realized I could just bend the outer&nbsp;
pins a little and then they fit perfectly.

00:14:20.640 --> 00:14:24.560
Soldering the Arduino in was perfectly&nbsp;
straightforward, as was soldering in the cable.

00:14:24.560 --> 00:14:26.400
Though I did have to make notes as far as which&nbsp;&nbsp;

00:14:26.400 --> 00:14:30.080
color wires corresponded to which&nbsp;
pin because it was not intuitive.

00:14:30.080 --> 00:14:33.920
As for the other wires, I just trimmed them&nbsp;
down so they wouldn't cause any problems.

00:14:33.920 --> 00:14:36.560
Eagle-eyed viewers may notice&nbsp;
that this version only handles&nbsp;&nbsp;

00:14:36.560 --> 00:14:39.600
one controller instead of&nbsp;
two like the prototype did.

00:14:39.600 --> 00:14:42.080
Once again, it really just came&nbsp;
down to feeling like it would&nbsp;&nbsp;

00:14:42.080 --> 00:14:45.920
be cleaner to have an adapter for each&nbsp;
controller rather than one between two,&nbsp;&nbsp;

00:14:45.920 --> 00:14:50.000
especially since on some CD-i models, the&nbsp;
second controller port is on the back.

00:14:50.000 --> 00:14:54.480
This is subjective for sure, I can see the&nbsp;
argument for having two in one since we can,&nbsp;&nbsp;

00:14:54.480 --> 00:14:57.120
but this just felt like the better move to me.

00:14:57.120 --> 00:14:59.760
After soldering those in and&nbsp;
confirming it all still worked,&nbsp;&nbsp;

00:14:59.760 --> 00:15:02.080
there was one last thing we had to do.

00:15:02.080 --> 00:15:04.560
We can't just have a bare PCB floating around,&nbsp;&nbsp;

00:15:04.560 --> 00:15:07.280
especially hanging off&nbsp;
these fairly delicate wires.

00:15:07.280 --> 00:15:10.880
What we would need is some kind of case.

00:15:10.880 --> 00:15:14.480
Ironically, this ended up being the most&nbsp;
complicated part of the entire project.

00:15:14.480 --> 00:15:18.560
The board obviously dictated most of the design,&nbsp;
but even for something as simple as this, it took&nbsp;&nbsp;

00:15:18.560 --> 00:15:23.040
a tremendous amount of time and concentration to&nbsp;
make sure the case would fit everything perfectly.

00:15:23.040 --> 00:15:26.160
My plan was to have four screws&nbsp;
securing it all together.

00:15:26.160 --> 00:15:31.200
Two that screwed through the PCB and two that&nbsp;
screwed straight into the DB-9 connector,&nbsp;&nbsp;

00:15:31.200 --> 00:15:35.360
taking advantage of the fact that&nbsp;
the DB-9 connector has screw holes.

00:15:35.360 --> 00:15:38.000
My first attempt, I sized perfectly for the PCB,&nbsp;&nbsp;

00:15:38.000 --> 00:15:41.040
but forgot the DB-9 connector&nbsp;
juts out a little bit.

00:15:41.040 --> 00:15:45.040
My second attempt was pretty good, though I&nbsp;
realized I wanted the top case to slide in&nbsp;&nbsp;

00:15:45.040 --> 00:15:49.600
between the connector and bottom case to secure&nbsp;
it, and I hadn't left enough space for that.

00:15:49.600 --> 00:15:52.640
And while the hole at the back was&nbsp;
the perfect size for just the cable,&nbsp;&nbsp;

00:15:52.640 --> 00:15:56.560
I wanted to add some bend protection, which&nbsp;
would require it to be a little bigger.

00:15:56.560 --> 00:15:58.400
The third attempt was really close.

00:15:58.400 --> 00:16:01.040
It had the bend protection&nbsp;
and everything fit nicely.

00:16:01.040 --> 00:16:05.840
This is also when I made the first top piece, and&nbsp;
just look how nicely that slides in and lines up.

00:16:05.840 --> 00:16:08.320
But then I realized how clean&nbsp;
it could be if I countersunk&nbsp;&nbsp;

00:16:08.320 --> 00:16:10.880
the screws instead of just having them jut out.

00:16:10.880 --> 00:16:15.280
So I replaced the screw holes with some&nbsp;
cone shapes, and this is the final result.

00:16:15.280 --> 00:16:17.360
Not bad, if I do say so myself.

00:16:17.360 --> 00:16:19.360
It's all nicely secured and protected.

00:16:19.360 --> 00:16:22.960
The cable has bend protection and is&nbsp;
even reinforced with a little hot glue&nbsp;&nbsp;

00:16:22.960 --> 00:16:26.880
to ensure pulling on the cable doesn't tug&nbsp;
on the delicate connections to the board.

00:16:26.880 --> 00:16:28.880
So overall, I was really happy with it.

00:16:28.880 --> 00:16:33.280
It was clean, looked pretty professional,&nbsp;
and was easy to build; apart from the PCB,&nbsp;&nbsp;

00:16:33.280 --> 00:16:36.400
it’s composed entirely of&nbsp;
homemade or off-the-shelf parts.

00:16:36.400 --> 00:16:37.600
If you want to build one yourself,&nbsp;&nbsp;

00:16:37.600 --> 00:16:41.280
the whole project is on GitHub,&nbsp;
including the board and case.

00:16:41.280 --> 00:16:45.520
Now, it did occur to me that if I ditched the&nbsp;
Arduino and instead put just the components&nbsp;&nbsp;

00:16:45.520 --> 00:16:49.840
I needed directly onto the board, I could&nbsp;
probably make the whole thing a lot smaller.

00:16:49.840 --> 00:16:53.920
I mentioned this on Patreon, but said it probably&nbsp;
wouldn’t be worth the additional time and money.

00:16:53.920 --> 00:16:57.280
After all, it’s not like CD-i gear&nbsp;
is gonna be a big seller or anything,&nbsp;&nbsp;

00:16:57.280 --> 00:17:02.320
so assuming it was just for me, it made sense&nbsp;
to use off-the-shelf easy-to-solder parts.

00:17:02.320 --> 00:17:06.880
But as soon as I said that, viewer VoxelTek&nbsp;
did indeed design a much smaller board,&nbsp;&nbsp;

00:17:06.880 --> 00:17:10.000
while mentioning that it could&nbsp;
be even smaller than this.

00:17:10.000 --> 00:17:14.320
Indeed, it would have required working with&nbsp;
small surface mount parts, or paying a factory to&nbsp;&nbsp;

00:17:14.320 --> 00:17:18.720
assemble it for you, but it proved my hypothesis&nbsp;
that this could be really, really small.

00:17:18.720 --> 00:17:22.000
In fact, it occurred to me that with small&nbsp;
enough components, you could fit the whole&nbsp;&nbsp;

00:17:22.000 --> 00:17:27.040
thing into one of those DIY DB-9 connectors. Then&nbsp;
you wouldn't even have to make a case at all.

00:17:27.040 --> 00:17:29.760
Again, maybe overkill if I&nbsp;
was just making a few for me,&nbsp;&nbsp;

00:17:29.760 --> 00:17:33.680
but if I ever build another batch of these,&nbsp;
I might try doing it that way instead.

00:17:33.680 --> 00:17:36.640
Anyways thanks for watching, and&nbsp;
I'll see you all in the next one.

00:17:36.640 --> 00:17:38.320
Bye guys.

