ir413
Posts: 3
Joined: Sat Jun 21, 2014 7:45 pm

PiFox - Bare Metal 3D rail shooter written in ARM assembly

Sat Jun 21, 2014 8:23 pm

Hi all,

As part of our first year computing project at Imperial College London we have written a 3D game in ARM assembly, without an operating system. It consists of several core modules, namely a 3D software rasterizer, sound library, NES controller driver and a math library. It also supports 2D and text rendering. If you want to hack on it, you can find the project on github.

We have also written an emulator in C that can run the game (without sound).

You can also watch it here.

Please have a look and let us know what you think :)

Cheers!


Siekmanski
Posts: 8
Joined: Mon Apr 28, 2014 11:14 pm
Location: Netherlands

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Sun Jun 22, 2014 7:28 am

Very impressive !! 8-)

krom
Posts: 61
Joined: Wed Dec 05, 2012 9:12 am
Contact: Website

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Sun Jun 22, 2014 6:52 pm

Well done! I am very happy to see the NES pad input being put to good use =D

m3ntal7
Posts: 12
Joined: Sun Mar 09, 2014 9:17 am

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Sun Jun 22, 2014 9:43 pm

Very well written. My Sprite Fight game/example (released January) uses exactly the same names and similar design: setup.player, setup.enemy, draw.sprites, reset.sprites, update.sound, update.input, etc.

(PS: New "Smart-Move" 32BIT, PC Relative Load, LDR=I for FASMARM)

HEX_addict
Posts: 14
Joined: Wed Jun 11, 2014 12:40 pm
Location: Romania

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Sun Jun 22, 2014 11:30 pm

Just by curiosity, at Imperial College London... there is somebody who knows programming Raspberry Pi in HEX? :(

ghans
Posts: 7871
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Mon Jun 23, 2014 6:45 am

@ir413
Really cool.
A small not-really-related question : Where is the cover of the Corneria Theme at the end of your Youtube video from ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

ir413
Posts: 3
Joined: Sat Jun 21, 2014 7:45 pm

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Tue Jun 24, 2014 8:58 am

Thanks for the feedback!
@ghans
The cover of the Corneria Theme at the end of our Youtube video is from here :)

ghans
Posts: 7871
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Tue Jun 24, 2014 9:10 am

Thanks.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5317
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Wed Jun 25, 2014 11:43 am

ir413 wrote:Please have a look and let us know what you think :)
I think it's pretty awesome.

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Fri Jun 27, 2014 1:57 pm

Great work ir413.
Batteries not included, Some assembly required.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23362
Joined: Sat Jul 30, 2011 7:41 pm

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Fri Jun 27, 2014 2:34 pm

HEX_addict wrote:Just by curiosity, at Imperial College London... there is somebody who knows programming Raspberry Pi in HEX? :(
Not hex, they used ARM assembler. (almost) No-one writes in hex any more, the instruction sets are too complicated!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

speewave
Posts: 5
Joined: Sun Jan 26, 2014 3:51 am

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Sun Jul 13, 2014 5:09 am

This is awesome. Seriously, this is a lot of great work and effort in my opinion, Kudos to you guys.

Gotta say i love how clean and documented your code\libraries are. Seriously, i'm very new to ARM Assembly, and while i may understand asm outside of the most basic concepts - i can actually get the gist of what the heck is going on in there, probably the first time i looked at ASM code and didn't feel totally lost... i think with a bit more commenting your code could honestly act like a tutorial ....

Also love the modularity of the code - seems very easy to grab something from your project to implement somewhere else, Honestly, if you guys wanted to you could really make a easy to use rendering API with docs for teaching people how to use Bare-metal Pi as a viable gaming option (something that's not far from how games were done on early consoles), you've got some really cool stuff going on here. Seriously if you went through with that - i think it would help more people understand and learn Assembly and the Pi by immersion. something that gets you quick results, but isn't bloated and can be modified so others can learn and improve off the code!

Few questions:

* How long did it take to do this - Seriously, the fact that you got through this is a testament to your schools program and your teams skill and work ethic , I was astonished that you made all these functions of the game happen, let alone the game, the engine, AND an emulator written in C

* Out of curiosity - have you tried to compare your math lib with the GNU C one to say which is faster in terms of performance

Thats it really. this inspired me to try ASM Coding on the Pi again, so thanks for that, and honestly, this is a job well done guys, seriously this is mind-blowing to me

ir413
Posts: 3
Joined: Sat Jun 21, 2014 7:45 pm

Re: PiFox - Bare Metal 3D rail shooter written in ARM assemb

Thu Jul 17, 2014 1:59 pm

Thank you all! :)

@speewave
I'm glad you find the code readable since we tried to make it as clean as possible, in some cases we even opted for readability over performance. Thanks for the suggestion, that's definitely something we'll consider, provided that we get some free time to do it :P We haven't compared the math library with the GNU C one. It took us four weeks to finish the project and all of us were working all the time xD I'm happy you got inspired by PiFox, good luck and have fun with learning ASM! :)

Return to “Bare metal, Assembly language”