Saturday, 10 September 2016

SEGA Should Resurrect the Dreamcast Brand

Yesterday, it was the 17th anniversary of the SEGA Dreamcast in the U.S. and the occasion caused Twitter and Faceback to fill with birthday greetings for the console that refuses to die. If you're reading this you are probably well aware of the stubborn and ever-growing “Dreamcast Scene”, but if this is news to you then I'll give you a quick overview.

After SEGA stopped supporting their last home console, homebrew developers made tools to create games for it, and every year more and more games created by indie developers are released. On top of that, the Dreamcast continues to gain more and more online multiplayer games as aspiring geniuses reverse engineer the old game servers. Just in the past year alone, Chu Chu Rocket, Toy Racer (dial up), PAL Quake 3 and The Next Tetris, have returned from the dead. On the horizon is Alien Front Online, and there are sure to be more to come. There are weekly game nights scheduled for both the U.S. and UK, and well over 100 people now regularly play online. Which is quite some achievement considering you have to actually do some soldering to get the dial-up Dreamcast to connect in a fibre-optic world.

In summary, the Dreamcast isn't dead, it's alive and well. Sure it doesn't compete with current gen consoles but no other console in history has had as much community support. Which brings me onto the main topic of the article; SEGA should bring the Dreamcast back.

Saturday, 14 May 2016

DreamPi 1.4 Released

This is a bug fix release.

  • New image. Fixes corruption issues with the previous release.
  • Improved Pi 3 support. This release is tested to work with the Pi 3.
  • Updated firmware. Includes the latest Raspbian updates (Linux kernel 4.4)
  • Improved IP allocation. This code has been completely rewritten to use the arping command and seems much more reliable and fixes several known issues.
You can download the release here.

Friday, 22 April 2016

Avoid C++ Typo-bugs with this One Cool Trick!

Recently I found an online quiz created by a company which develops some static code analysis tool. You were presented with buggy C++ code which the tool had detected and you had to click on where the bug in the code was.

The large majority of the bugs in the questions were down to typos. These normally occurred when someone had written the same line of code 3 or 4 times, but with different attributes (e.g. .x, .y and .z for a vec3)

Well, here's a neat trick that will allow you to avoid such typos. In the following example I recalculate the min/max values of a bounding box given a vector (pos):

            /* Iterate the X, Y and Z attributes and assign them if necessary */
            auto attrs = { &Vec3::x, &Vec3::y, &Vec3::z };

            for(auto& attr: attrs) {
                if(pos.*attr < bounding_box.min.*attr) bounding_box.min.*attr = pos.*attr;
                if(pos.*attr > bounding_box.max.*attr) bounding_box.max.*attr = pos.*attr;

By using C++11 initializer lists, and auto, you can elegantly create a list of pointers to member attributes. C++11 range-for loops allow you to iterate them easily without a bunch of type definitions, and then you can just apply the pointers to the two vectors. This ensures that you never accidentally check the value of .y against .x or something like that. It's also fewer lines of code than repeating the if checks (4 vs 6). You could also tidy it up more if you create some extra reference variables in the loop. Win.

Saturday, 16 April 2016

DreamPi 1.3 Released!

This is a minor release which simply updates the Raspberry Pi firmware on the image. This should mean that the Pi 3 is supported, but I don't have one to test that!

You can download the new release here!

Being Spread Too Thin

It's come to my attention that I have way too many projects on the go. This post is going to summarize what needs to be done to each of them in a kind of semi-apology for why things you are waiting for might take a while...

It's also worth remembering I can only work on some of these projects in certain locations. DreamPi stuff must happen at home where I have a Dreamcast and a DreamPi set up. Electronics stuff needs to happen near electronics kit, SDL 2 needs a PC with a Dreamcast emulator, access to a Dreamcast and KallisitiOS which I only have at home. Most of my computer time happens on the train, so... yeah.


The DreamPi software image has been a huge success. pcwzrd13 of Dreamcast Live recently reported the most active online Dreamcast game session ever as a result of more people getting their Dreamcast connected. Even though the software works, here's a list of things that are still left to do:
  • Better IP address allocation, what is there now is incredibly buggy
  • Cutting down the image, and swapping the init system for systemd then writing a proper systemd service file
  • Detecting modem hotplugging and handling it gracefully
  • Hanging up and reconnecting every 5 minutes or so when generating the dial-tone to workaround the modem apparently going to sleep
  • Speeding up the connection process by removing excess AT commands
  • Upgrading the image to support the Pi 3
  • Coming up with a way to easily configure Wifi dongles


Dreamcast Now 

Connected, but separate, Dreamcast Now has become a useful tool, here are the things I'd like to fix:
  • Add more game domain hashes (e.g. Toy Racer)
  • Add Dreamcast Live and Dreamcast-talk versions of the listing so that those sites can iframe them in

DC-Pheonix (DreamArena)


This is working amazingly well considering I hammered it out in a few hours. Still left to do though:

  • Add Quake 3 PAL support
  • Add a clone of the DreamArena registration site so users can register with DreamKey 1.0
  • Database-backed user registration so that the entire process works as it did back in the day

Serial Connector / Link Cable 

I'd like to design and manufacture these, but this is on hold until I have some line voltage inducers made. The whole process for making a PCB is pretty time consuming so don't expect this stuff soon!

Line Voltage Adapters

I have 3 prototype PCBs. I need to manually hot-plate solder the components, and then 3D print cases for them. At that point I can decide whether I have the time to sell them and whether it's worth it. This can only be done when I'm at my work's electronics club which unfortunately I can only make occasionally. Don't expect these any time soon either :(

Also, I need to fix some bugs in Fritzing (the PCB software) to make these PCBs export correctly without me manually fixing up the Gerber export files.

Dreamcast SDL 2 Port

This is about 70% done. It needs testing and fixing. I'll get around to this when I start porting my game engine to the Dreamcast....

My Game Engine (KGLT)

This is the main project I really want to focus on. Here's what I intend to do:
  • Improve rendering performance
  • Fix Quake 2 BSP lightmap loading
  • Add an OpenGL 1.x renderer for Dreamcast support
  • Port to the Dreamcast
  • Write a game for the Dreamcast

As you can see, I have a lot going on, and that's ignoring all the support requests / questions I get about the Dreampi and all the other things I'm helping individuals with. It also ignores the non-Dreamcast related stuff that I already have out there.

So, if you are waiting for something, I apologise, but all of my code is open source, I'd appreciate the help if you can contribute!

Thursday, 7 April 2016

Toy Racer Back Online for Everyone!

I'm excited to announce that an experimental replacement server for Dreamarena is now online and as a result, Toy Racer is back online for everyone, even if you don't have a BBA!

DreamPi users have this support right now, just try it! Anyone else on dial-up will need to point their DNS at to use the new server.

As I said, this server is HIGHLY EXPERIMENTAL. It will likely crash, not work, behave weirdly etc. the server will keep improving as I gain more understanding of the authentication protocol.

Quake 3 PAL doesn't work at the moment, but that support is coming soon too!

Special thanks go to Jonas Karlsson who did the hard job of deciphering the protocol!

Monday, 22 February 2016

Debugging Issues with your DreamPi

Sometimes despite your best efforts, your DreamPi setup just isn't working. This blog post will summarize some of the things you can do to debug the issue!

SSH is Your Friend

The first thing you need to do is to be able to connect to your DreamPi to see what is going on. Now you could do this by connecting a keyboard, then connecting it to the TV and switching between outputs. This works, but it's fiddly, if you do this you can't really see in real-time what is going on.

SSH is a protocol for allowing you to remotely connect to a machine and run commands as if you were directly logged in. If you use Windows you'll want to use Putty, if you use another (more sensible :p) operating system SSH should be built in or easily installable and usable from the built-in terminal.

If you do use Putty, there is a tutorial here for setting it up. The key thing is that you are connected to the same network as your DreamPi, and the hostname you use to connect is "dreampi.local". The username must be "pi" and the password is "raspberry". Once connected you will be dropped to a Linux command shell. If you want to disconnect press CTRL+D at the same time.

Watch the Logs!

Whether you're directly connected to the Pi or over SSH the next thing you'll need to do is run a Linux command. This one:

sudo tail -f /var/log/syslog

I'll break it down so you know what it's doing:
  • sudo - runs the command as an admin, you'll be asked for the password again
  • tail - the "tail" command shows the end of a file
  • -f - this flag tells the tail command to stream the file in real-time 
  • /var/log/syslog - this is the file we're watching
Now, that's all you need to do. Now if you connect your Dreamcast you can see the output from the DreamPi software but also from the PPP service which is responsible for routing the connection.