A small game console directly programmable in Python. I always wanted to make this, and after my work on #PewPew FeatherWing I finally decided that I'm ready.
The first version may be a bit of a stretch — I tried to make it as small as possible, fitting in the 5x5cm limit of PCB manufacturers, so that it will be cheap to make the PCBs. Using the cheap ST7735 TFT display, and a cheap ATSAMD21E chip. I also tried to put all the components on one side of the board.
Of course the hard part is writing a game library, and the actual games. There is already one simple platformer game written as a demo, and the software library is getting new features added as needed.
It took less than two weeks, and all the µGames 10 are sold. I am both a bit surprised with how fast it went, and very grateful to everyone who bought one (a lot of them went to my friends). I don't plan on making any more of them for the next few weeks, at least until the Lunar New Year ends. I am now focusing on support of the devices that have their new owners, and on updating the firmware.
Speaking of support, I already got some really valuable feedback. @Frank Buss seems to have a knack for finding all the rough edges, and his suggestions already improved the documentation and resulted in some ideas about improving the firmware. Jell also reported some issues, which have been added to the docs. I expect to receive even more feedback as the devices arrive and their owners start experimenting with them seriously.
I'm also going to work on making an emulator for this device — even if it's not going to emulate all of its limitations, it should allow easier development and debugging. You will still need to test against a real device to make sure that there is enough memory and that the speed is acceptable, though — it's not going to be a "real" emulator, just a version of the Stage library that runs on regular Python.
I've been asked about the dimensions of µGame 10, hole sizes and placement, etc. — so I decided to sit down and update the OpenSCAD model that I made some time ago for µGame 6. I have put it in the repository at https://github.com/python-ugame/ugame-10-hardware
You should be able to import it into most 3D modelling software, and from there you can use it to design cases and all sort of other things.
nGame (nano-game) is the tiny little brother of µGame that I made just to see if I can do it. It's a little bit bigger than an inch on a side. I got the hardware working, but I didn't have any program to test it with, since all the games I've written so far were too big to fit on the chip's flash (unlike µGame, nGame doesn't have a separate flash chip for the filesystem). When I was picking the projects to send to FOSDEM to be shown at the MicroPython table, I thought I could include nGame, and I realized that the bouncing ball demo that I added recently should fit just fine. So I quickly uploaded that, and it worked out of the box, except for the wrong colors (RGB vs. BGR) and different screen size (160×80 instead of 128×128). But I didn't have time to fix it, so I sent it like that.
Today evening I finally had some time to sit down and do it properly — I just needed to fix the display driver, and fix the code where I hard-coded the screen size.
Today the package from China arrived: 50 shiny new devices. There was a small number of faulty ones that failed testing — it turned out to be a bad speaker, which fortunately was easily replaced. One board didn't flash at all — that turned out to be a faulty reset button. This one I didn't fix, but instead I will be using it as the demo unit (because during troubleshooting I had to de-solder some parts, and it doesn't look brand-new anymore).
It merely scratches the surface — I will need more documentation, in particular, I will need topic guides explaining some of the most useful techniques for writing the games. But this is at least a start.
I also went and cleaned up the repositories a little bit. All relevant repositories now live under a single organization at https://github.com/python-ugame. I also separated the final µGame 10 designs from all the other prototypes, so you can easily find all the information in one place, and not wonder which parts of it are obsolete.
I started adding some code examples for the documentation. The simplest sprite demo there can be is the bouncing ball. I took some liberties in making the graphics look a little bit like something familiar:
Then I added two more balls, and the final code looks something like this:
The LIR2032 coin cell batteries that I used with this device so far are not the perfect solution. Sure, they are easy to get and replace, don't look nearly as scary as the aluminium pouch of the LiPo batteries, and actually have enough electricity to play for almost an hour, but they also have down sides: they are very slow to charge, 40 minutes of play time is not nearly enough for the more boring travels, and they don't look very well on the back of the device.
So I looked around for a different battery. I has to be:
standard, so that I can tell users what battery they need to get,
larger and capable of faster charging,
easily obtainable and cheap,
protected from over-discharge,
flat and roughly the same size as the device,
That actually narrows the possibilities considerably, but I had an idea: let's use a battery from a cellphone — not a smartphone battery, those are too big and expensive, but a battery from one of the popular dumb phones. Nokia used to be a popular brand, so I'm sure there are a lot of cheap Nokia batteries I could use!
Looking around I found the "Cellphone Knowledge Base" wiki, and there I found the two battery models that fit: BL-5B and BL-4S. I ordered one of each, and they arrived recently. The bigger and older one, BL-5B, arrived first:
It's a bit of a tight fit, exactly the same height as the µGame. But the connector it uses let's me improvise something from goldpins, so it works pretty well:
You can see the holes are not exactly right (I didn't have the dimensions when I designed the PCB) but they are close enough for this to work. Today the second battery arrived, and I actually like it a bit more. It's smaller but thicker, and it doesn't cover the mounting holes:
The connector is a bit more tricky — I think I will simply solder it to the battery pads, after attaching the battery with 2-sided tape. It's supposed to be a prototype kit anyways.
@MatejEusk is working on designing a 3D-printed case for this, it might work a little bit better with those batteries then.
The version 8 PCBs arrived from Aisler, together with the stencil, and it looks great this time!
Please especially note the smooth edges of the board, without any trace of the panelization tabs. Of course I immediately assembled one of the boards and tested it:
It works great. Please note the much nicer alignment of the chips, and the fact that there are no parts under your fingers. One of the buttons had to be moved a little to the side, but it's actually better that way.
Of course there were still changes needed, but they are so small, that I can confidently send the gerber files to the fab without ordering one more test board. The changes included adding one more debug pad for connecting VCC, adding holes to the debug pads so that it's easier to connect probes to them, moving some of the resistors a little to make them easier to solder, and fixing the stencil to include the pads for the USB port, and exclude the holes of the power switch (workarounds for Fritzing's weirdness).
I also wrote the step-by-step testing instructions, and made a test program:
So everything is ready for fabrication. I will now send all that to the fab house, and see what they think about it.