Handmade Hero » Forums » Code » Raspberry Pi 2
marcn
Marc Novakowski
12 posts
#2401 Raspberry Pi 2
2 years, 7 months ago

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)
  • mmozeiko
    Mārtiņš Možeiko
    1477 posts
    1 project
    #2403 Raspberry Pi 2
    2 years, 7 months ago

    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) :)
    JohnL
    John Lorre
    26 posts
    #2426 Raspberry Pi 2
    2 years, 7 months ago

    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.
    marcn
    Marc Novakowski
    12 posts
    #2437 Raspberry Pi 2
    2 years, 7 months ago

    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!
    mmozeiko
    Mārtiņš Možeiko
    1477 posts
    1 project
    #2441 Raspberry Pi 2
    2 years, 7 months ago

    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
    marcn
    Marc Novakowski
    12 posts
    #2444 Raspberry Pi 2
    2 years, 7 months ago

    Ah yes - now THAT would be cool!
    cmuratori
    Casey Muratori
    803 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.

    #2452 Raspberry Pi 2
    2 years, 7 months ago

    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
    Siegward
    Thomas Frase
    12 posts
    #2453 Raspberry Pi 2
    2 years, 7 months ago

    I always wanted to see someone implement an USB stack from scratch. (Assuming HH will support joysticks/keyboard/mouse/etc. on the RPi)
    mmozeiko
    Mārtiņš Možeiko
    1477 posts
    1 project
    #2454 Raspberry Pi 2
    2 years, 7 months ago

    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.
    Siegward
    Thomas Frase
    12 posts
    #2455 Raspberry Pi 2
    2 years, 7 months ago

    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.
    mmozeiko
    Mārtiņš Možeiko
    1477 posts
    1 project
    #2457 Raspberry Pi 2
    2 years, 7 months ago Edited by Mārtiņš Možeiko on Feb. 6, 2015, 4:10 a.m.

    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.
    cmuratori
    Casey Muratori
    803 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.

    #2459 Raspberry Pi 2
    2 years, 7 months ago

    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
    fcatalan
    Juan Felipe Garcia Catalan
    7 posts
    #2460 Raspberry Pi 2
    2 years, 7 months ago

    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 ;)
    cmuratori
    Casey Muratori
    803 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.

    #2461 Raspberry Pi 2
    2 years, 7 months ago

    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
    ThadeuMelo
    25 posts
    #2469 Raspberry Pi 2
    2 years, 7 months ago

    We could go real "pig mode" and build our own cpu/gpu combo and run it on a FPGA board.