Tetris Duel with the Raspberry Pi

Tetris Duel

Building a multiplayer network game with multiple Raspberry Pis can be very difficult. Doing it in assembly is outright insane! This is exactly what a group of first year students at Imperial College London did; they created a network based multiplayer Tetris game for the Raspberry Pi.

[Han], [Piotr], [Michal], and [Utsav] have created this entire game from bare metal assembly, and it only consists of 4000 lines of code! The code is well documented, so be sure to look through their Github repository. This project is a great reference for those looking to learn bare metal assembly and networking. They even chose to use the old NES controllers, a very nice touch. While we have featured what seems like a million different Tetris games in the past, this is the first multiplayer version. See Tetris Duel in action in the video after the break!

This is a shout-out to all of you students out there. Take the time to create quality documentation for your class project, and upload it to the internet. Not only is it a great resume boost, but it could very well end up on Hackaday!

[Read more...]

Programming Pi Games With Bare Metal Assembly

pifoxWhile the most common use for a Raspberry Pi is probably a media center PC or retro game emulator, the Pi was designed as an educational computer meant to be an easy-to-use system in the hands of millions of students. Team 28 at Imperial College London certainly living up to the Raspberry Pi Foundation’s expectations with their bare metal assembly clone of Star Fox, aptly titled PiFox.

This isn’t the first time a college course has taken up the task of developing software for the Pi without an operating system; a few years ago, Cambridge University started that off with a series of bare metal tutorials for the Pi that included drawing graphics on the screen and playing around with USB keyboards. PiFox greatly expands on what those early tutorials could do, reading an NES joystick from the GPIO pins, sound with DMA, and rendering 3D objects.

If you’d like to build PiFox for yourself, or better yet, expand on the existing build, all the code is up on Github. There’s also a Raspberry Pi emulator for Linux, just in case you have an ARM assembly bug you just can’t scratch with a Raspberry Pi.

[Read more...]

Bare-metal Programming On The Teensy 3

Teensy

The Teensy 3.x series of boards are amazing pieces of work, with a tiny, breadboard-friendly  footprint, an improbable amount of IO pins, and a powerful processor, all for under $20. [Karl Lunt] loves nearly all the features of the Teensy 3, except for one: the Arduino IDE. Yes, the most terrible, most popular IDE in existence. To fix this problem, [Karl] set up a bare-metal development environment, and lucky us, he’s chosen to share it with us.

[Karl] is using CodeBench Lite for the compiler, linker, assembler, and all that other gcc fun, but the CodeSourcery suite doesn’t have an IDE. Visual Studio 2008 Express is [Karl]‘s environment of choice, but just about every other IDE out there will do the same job. Of course a make utility will be needed, and grabbing the docs for the Freescale K20 microcontroller wouldn’t be a bad idea, either.

The end result is [Karl] being able to develop for the Teensy 3.X with the IDE of his choice. He was able to quickly set up a ‘blink a LED’ program with the new toolchain, although uploading the files to the Teensy does require the Teensy Loader app.

 

Antares: One bare metal build system to rule all microcontrollers

antares-build-system

[Andrew Andrianov] has the same itch we do when it comes to the variety of inexpensive dev boards out there. They put hardware in your hands but when it comes to the IDE it tends to be a very mixed bag. Some offer hobbled copies of proprietary software, but in most cases you’re on your own for any kind of open source development environment support. He and a couple of friends are working to change that. What they’ve come up with is Antares: a single build system which can compile code for multiple microcontrollers.

The idea is to make the coding environment agnostic from the compile/burn process. This serves a few purposes; it lets you use the IDE you’re most comfortable with, be it Eclipse or emacs. It also seeks to ease the pain of writing libraries that will work with multiple different chips. So far the package supports several of the usual suspects: AVR, msp430, STM32 ARM chips, as well as AT89,and STC variants of 8051. Other chips can be added as more hands make light work (in other words, roll up your sleeves and help these guys out!). Right now development targets Linux dev platforms but OS X has been shown to work with some patches.

The link above is a rather daunting readme from the Github repo. If you need a better overview before diving in hit up the RC1 announcement on [Andrew's] blog.

Raspberry Pi plays MIDI without an operating system

For all the interesting DSP functions locked away in the Raspberry Pi, it’s still hard to imagine using the Raspberry Pi as an eminently capable software synthesizer, tracker, or sequencer. Running any of the usual Linux digital audio programs means – surprise – running Linux, and the performance penalty associated with that.

It would be much better if all these audio programs could run directly on the Raspberry Pi without an operating system, and [Joe]‘s project is right up that alley. He’s playing MIDI files without an operating system, in effect making the Raspberry Pi a very powerful embedded platform.

[Joe]‘s build is the first bare metal audio code for the Raspberry Pi. It’s actually an LV2 plugin host that will load audio plugins, read MIDI files, and shoot the resulting audio out over the 1/8″ jack on the Pi.  This work wouldn’t have been possible without a few Raspberry Pi bare metal tutorials put together by [David Welch].

Hopefully this won’t be the last we’ll see of [Joe] and his code; the Raspberry Pi has more than enough horsepower to be an amazing sampler, synth, beat machine, or the next generation of Akai MPC. All we need are a few brave coders to take up coding bare metal on the Raspberry Pi.