News for hackers. Stuff that matters.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by userbinator on Saturday June 21, 2014 @09:07PM (#7926536)
Great work, it's always nice to see more Asm projects!

"Bare Metal" - does this mean the RPi can run blob-free?

A possible improvement I suggest is to gfx_draw_line in gfx.s - using a fixed-point algorithm could be simpler and faster: http://hbfs.wordpress.com/2009/07/28/faster-than-bresenhams-...

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by pjc50 on Sunday June 22, 2014 @03:49AM (#7927198)
That depends on what you mean by "blob free"; this code doesn't use the GPU other than to setup the frame buffer. From then on it's software 3D.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by lnandor on Sunday June 22, 2014 @03:57AM (#7927208)
Thanks for the feedback!

Even though the game does not need an operating system, it still requires bootcode.bin and start.elf.

The fixed point version of Bresenham's algorithm looks really nice on x86, but it uses integer division, so implementing it on an ARMv6 (no div instruction) would be quite painful.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by userbinator on Sunday June 22, 2014 @06:51AM (#7927503)
In other words, this is comparable to booting a PC with a BIOS, and then the rest of the code that runs is yours. That's still pretty awesome.

Consider participating in the demoscene, this is the sort of skills that would be great for that.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by scotty79 on Sunday June 22, 2014 @06:47AM (#7927494)
That reminds me of good old days of 6502 assembly and implementing bitshift based multiplication and division yourself.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by mobiuscog on Monday June 23, 2014 @08:14AM (#7931463)
Absolutely. I'm surprised that having to work around no 'div' is seen as painful compared to writing the rest of the game using 3D in assembly !

Learning on 6502/Z80 meant most everything was from first principles, and although I'd hate to regress so far today (head would hurt) it really was a great way to start.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by pjmlp on Sunday June 22, 2014 @06:01AM (#7927406)
Like the good old Amiga days. :)

Place floppy on drive, press Ctrl+Amiga+Amiga and up you go.

Congratulations.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by samwilliams on Saturday June 21, 2014 @06:21PM (#7926222)
This is extremely impressive - well done all!

There is a bare metal chess game [0] for the Pi that was presumably another teams entry for the same assignment (they are both from Imperial).

[0] https://github.com/xu-ji/assembly_chess/

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by lukegb on Sunday June 22, 2014 @06:06AM (#7927411)
Yes, it looks like it - they would have completed the assignment last year.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by thisisnkp on Saturday June 21, 2014 @04:58PM (#7926046)
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by retroencabulato on Saturday June 21, 2014 @09:15PM (#7926557)
I'm impressed first year students can write such clean assembly. Also that they can write both driver code and a higher level rasterizer.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by pjmlp on Sunday June 22, 2014 @06:07AM (#7927414)
Why so? I was already looking at Assembly listing at the age of 12.

When I was 16, I enjoyed using higher level languages but the real fun was doing Assembly.

Kids these days real need to get some of this exploratory desire back.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by timthorn on Sunday June 22, 2014 @12:27PM (#7928290)
Fully agree - children have amazing capacity to learn complex things. It's one reason why I'm nervous about code clubs using Scratch; the children can cope with more, so why limit them?
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by userbinator on Sunday June 22, 2014 @06:43AM (#7927486)
Indeed, a lot of demosceners are in this age range too, and look what they can do...
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by xupybd on Sunday June 22, 2014 @02:42AM (#7927103)
Yeah clearly not your average first year.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by kator on Saturday June 21, 2014 @06:35PM (#7926261)
Wow that brings back memories of building games on a TRS-80 Model I in z80 assembly!

Good show, I've often felt low level was a dying art, perhaps I'm wrong and stuff like this will push people to learn what a register is and what "flags" are.. :-)

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by marcosscriven on Saturday June 21, 2014 @10:50PM (#7926732)
Very impressive. How things have changed - we did nothing quite so fun and practical in first year computing at Imperial back in 1995! Plus, now I feel old :)
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by JamesAn on Sunday June 22, 2014 @02:28AM (#7927079)
A welcome return to the Acorn/RISC OS days where "100% ARM assembler" was a back-of-the-box boast for many games and applications (Sibelius).
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by pjmlp on Sunday June 22, 2014 @06:09AM (#7927417)
Not only Acorn/RISC OS, but all 8 and 16 bit home systems.

The main issue is of course portability, but I had lots of fun with Assembly during that timeframe.

Do you know how RISC OS fares in the Raspberry PI?

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by JamesAn on Saturday June 28, 2014 @01:49PM (#7958779)
I haven't used it yet, but it seems to be faring okay.

http://riscpi.co.uk/sales-riscospi/?doing_wp_cron=1403977657...

You can also download RiscPC or Archimedes emulators, e.g.

http://www.marutan.net/rpcemu/

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by slipstream- on Monday June 23, 2014 @05:12AM (#7930933)
Oh wow. This is awesome.

And here I am sitting here, with little x86 asm and z80 asm knowledge, reversing windows binaries and messing with Pokémon arbitrary code execution exploits. (optimizing my payloads for the 8F/"ws m" exploit is fun though!)

Been meaning to learn ARM asm for some time, but haven't got around to it.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @05:50AM (#7927391)
Looks like there's a tiny little emulator for this, too.

https://github.com/ICTeam28/PiEmu

I've got as far as installing the SDL headers (you're looking for SDL.h from SDL 1.2) and running cmake . but not much further.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by lnandor on Sunday June 22, 2014 @06:16AM (#7927428)
Hello,

I have added a more informative README and fixed a couple of issues that prevented the game from running. In case you need any more help, could we move this discussion to GitHub issues?

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @06:17AM (#7927431)
Just replied to someone else before you posted this. Thanks!
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by serialvelocity on Sunday June 22, 2014 @05:57AM (#7927402)
Hey, I'm part of the team who wrote this. What platform are you running on? and what errors are you getting?
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @06:16AM (#7927429)
Hey, congrats on this project.

Mainly I was waiting to reboot into Linux to try to build this.

You may want to add some instructions for building the game/emulator.

For the emulator, I'd never used cmake before (sort of) so I didn't know to run cmake .

Then the error about SDL (needed libsdl-dev package or similar)

For the game, I'm currently downloading a Linaro ARM toolchain on a slow connection but I don't anticipate any further issues.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by serialvelocity on Sunday June 22, 2014 @06:23AM (#7927444)
Thanks! It currently only works on Linux, so depending on your distro, you need to install the SDL package. If you're using Debian or Ubuntu (or derivatives), it will be sufficient to install the libsdl-dev and cmake packages using apt-get. Then create a build directory and use CMake to generate makefiles then build the emulator with make.

To set up the build environment, follow these instructions:

   cd /dir/to/PiEmu/
   mkdir build
   cd build
   cmake ..
   make
These instructions are also on the README.md for PiEmu in-case anyone else is wondering how to get it building.
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @07:00AM (#7927522)
To add to this, the latest "official" Raspberry Pi toolchain is at https://github.com/raspberrypi/tools. You probably want the one without hf in the name.

serialvelocity - am I correct in assuming you're building for softfp?

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @07:06AM (#7927535)
I sit corrected. I'm currently having lots of trouble building the game because my cross compiler doesn't match the name of yours in the makefiles.

> make[2]: arm-linux-gnueabi-as: Command not found

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by jnbiche on Sunday June 22, 2014 @01:25PM (#7928505)
Nice project! Did you use JTAG or some other (more painful) work flow?
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by lukegb on Sunday June 22, 2014 @06:01AM (#7927405)
I have to say, this assignment in general has been my favourite part of first year (my group extended our assembler to look enough like GNU as that we could assemble the output of GCC, so we could compile CSUD).

Nice work - love it (might play it at some point to see if I'm any good).

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @07:31AM (#7927562)
Looking at this project, I feel very very very dumb. I've been using computers for 2 decades and programming for 1 and I can't even imagine doing something like this!
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by BenDaglish on Sunday June 22, 2014 @04:23PM (#7929066)
Reading this comment made me very very sad. I've been programming computers for over 3 decades, and this is how we started off in my day. The "MyComputerification" of IT education during the 90's has a lot to answer for...
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by voltagex_ on Sunday June 22, 2014 @10:13PM (#7929873)
Don't worry, I'm currently writing a FAT32 reader from scratch and slowly making my way through a Peter Norton assembly tutorial from the 80s...

My day job, on the other hand is nearly all web dev and admin work.

Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by parley on Saturday June 21, 2014 @05:45PM (#7926159)
Nicely done! I remember getting the original game for Christmas one year as a kid, and it was lots of fun. This brings back memories. Kudos!
Re:Bare Metal Assembly Raspberry Pi Starfox Tribute by SSilver2k2 on Saturday June 21, 2014 @06:28PM (#7926240)
This is amazing! -Shea