Handmade Hero»Forums»Code
Marc Novakowski
12 posts
Raspberry Pi 2
Since the Rasbperry Pi is often mentioned in the stream as a potential "minimal hardware" platform for the game, I thought it might be interesting to bring up the latest news... a new version of the RPi has been released with significant upgrades to CPU and memory:

http://www.raspberrypi.org/raspberry-pi-2-on-sale/

Notably:
  • A 900MHz quad-core ARM Cortex-A7 CPU (~6x performance)
  • 1GB LPDDR2 SDRAM (2x memory)
  • Mārtiņš Možeiko
    2559 posts / 2 projects
    Raspberry Pi 2
    These news were discussed in yesterdays pre-stream :)

    But yeah, these are pretty nice news. Especially that price will stay the same - 35$
    And using ARMv7 + Neon instructions are really nice change.

    Maybe we don't need to port Handmade Hero to RPI at all? Just port to WinRT and run it under Windows 10 on RPi2 (free for developers) :)
    John Lorre
    26 posts
    Raspberry Pi 2
    I always understood Casey that the idea to port to Raspberry is to go as close to the hardware as you can get.
    So not 'another' Windows/Linux version, but one that drives the hardware itself.
    Marc Novakowski
    12 posts
    Raspberry Pi 2
    Yeah Microsoft has said that Windows 10 for Pi will be VERY pared down (part of their Internet of Things platform). If it has a UI at all, it will be very minimal. Probably best to keep the Raspberry Pi port as a linux port. Fewer layers of O/S cruft to get in the way!
    Mārtiņš Možeiko
    2559 posts / 2 projects
    Raspberry Pi 2
    Of course I was joking about HH for Win10 on RPi2.

    As for RPi port - I don't think that is same as Linux port. Of course you'll be able to run Linux port more or less directly on RPi. Just install your favorite distribution and compile HH with compiler that supports ARM linux target (and hope Linux port won't depend on x86 intrinsics).

    But I think Casey wants more bare metal approach. Where RPi will boot directly to game, without any OS. Something like this: https://github.com/dwelch67/raspberrypi
    Marc Novakowski
    12 posts
    Raspberry Pi 2
    Ah yes - now THAT would be cool!
    Casey Muratori
    801 posts / 1 project
    Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
    Raspberry Pi 2
    Yes, or RPi (or RPi2) port will use nothing at all besides the "fixed" boot loader that is undocumented (and thus we can't replace it). But there will be no operating system running, just Handmade Hero!

    - Casey
    Thomas Frase
    12 posts
    Raspberry Pi 2
    I always wanted to see someone implement an USB stack from scratch. (Assuming HH will support joysticks/keyboard/mouse/etc. on the RPi)
    Mārtiņš Možeiko
    2559 posts / 2 projects
    Raspberry Pi 2
    Here is small USB stack written specially for Raspberry Pi: https://github.com/rsta2/uspi
    It can handle keyboard, mouse, gamepad/joystick, usb mass storage and ethernet.
    Thomas Frase
    12 posts
    Raspberry Pi 2
    For suitable definitions of "small". I knew of this one, it has about 12k lines of code. That's about 3.5x the size of the current handmade hero codebase :D

    And that's just to get peripherals and network. No sound, no graphics.

    Of all the platforms, I think this one will be the most interesting/challenging.
    Mārtiņš Možeiko
    2559 posts / 2 projects
    Raspberry Pi 2
    Edited by Mārtiņš Možeiko on
    Small in terms that it is pretty readable. You can start reading it without being totally lost. Compare for example how much source you need to read to get some understanding from Linux kernel (without previous experience with that codebase).

    Sure, I expect HH RPi usb stack will be a lot smaller. That uspi is a library, it offers at lot of things that won't be needed for HH and can be removed reducing code size. For example, compare size of libSDL windows video module to size of win32_handmade.cpp file.

    I'm not an expert on RPi, but I expect sound and graphics doesn't require usb stack :) That's a different code.
    Casey Muratori
    801 posts / 1 project
    Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
    Raspberry Pi 2
    I don't know if we'll support USB on the Pi, because we might go _even more handmade_ on there and demand that you wire an old-school joystick directly into the GPIO board :P

    And no, I'm not kidding.

    - Casey
    Juan Felipe Garcia Catalan
    7 posts
    Raspberry Pi 2
    Much easier in fact than dealing with the USB. In fact you could just stick a few potentiometers and buttons on the breadboard you'll have already around for led-blink based debugging ;)
    Casey Muratori
    801 posts / 1 project
    Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
    Raspberry Pi 2
    Yeah, and I think it will be fun to have a joystick that doesn't go through USB, because it would presumably be super-low-latency, I would think? Although who knows :)

    - Casey
    25 posts
    None
    Raspberry Pi 2
    We could go real "pig mode" and build our own cpu/gpu combo and run it on a FPGA board.