deater
Posts: 29
Joined: Fri Mar 11, 2016 3:58 pm
Location: 45N

"Pi On Fire" demo won 2nd prize at Demosplash 2019

Tue Nov 12, 2019 3:13 pm

In case there's any interest here, I wrote a (mostly) bare-metal demoscene demo on the Pi-1B that won 2nd prize in the Modern Demo competition at the Demosplash 2019 demo party.

http://www.deater.net/weave/vmwprod/pionfire/

I say mostly bare metal because it is running on top of the extremely minimal "vmwOS" that I wrote from scratch.

It's not really stressing the pi much, the graphics are just using the GPU mailbox framebuffer. The hard part (and the reason for writing the demo) was to see if I could get DMA driven PWM sound out the headphone jack.

Heater
Posts: 16832
Joined: Tue Jul 17, 2012 3:02 pm

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Wed Nov 13, 2019 7:28 am

Excellent!

If you wrote the OS underneath from scratch for yourself that counts as plenty bare metal enough in my book!
Memory in C++ is a leaky abstraction .

User avatar
Gavinmc42
Posts: 4833
Joined: Wed Aug 28, 2013 3:31 am

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Wed Nov 13, 2019 8:13 am

Is this the first Pi demoscene?
Not sure why there are not more, PI's are so much more powerful than Amigas, C64 etc

Going to be interesting once you get the GPU going.
I think Aran with his Spider OS has got shaders to work?

I have been messing around with GLSL shaders trying to figure out how to do them baremetal and live.
Mesa3D uses the GLSL compiler and I have been looking at QPU assemblers.
Embed a compiler or assembler into the OS?
Have a scripting OS and do procedural GPU code?

Well done with the sound.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

deater
Posts: 29
Joined: Fri Mar 11, 2016 3:58 pm
Location: 45N

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Wed Nov 13, 2019 7:11 pm

there have been Pi based demoscene submissions in the past but this might be the first bare-metal one that I am aware of.

Though there are some things such as "PiFox" that would have made a good demoscene production but weren't submitted to one.

I agree that I think the Raspberry Pi is an excellent target for the demoscene. Cheap, widely available, limited CPU but advanced graphics hardware if you know the right tricks, (mostly) stable hardware specs. I'm not sure why it hasn't caught on more.

Heater
Posts: 16832
Joined: Tue Jul 17, 2012 3:02 pm

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Wed Nov 13, 2019 9:59 pm

deater,
I'm not sure why it hasn't caught on more
That is a good question.

I'm not into the demo scene but I get the impression that historically it was about showing off ones ninja coding skills and getting a machine to do things that everyone thought was impossible for it to do.

Which is kind of tricky given the 10, 0000 peripheral registers of a SoC like the Pi and it's massively complex GPU.

With any luck you have sparked a fire of demo coding for the Pi!

See what I dd there?
Memory in C++ is a leaky abstraction .

User avatar
Gavinmc42
Posts: 4833
Joined: Wed Aug 28, 2013 3:31 am

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Thu Nov 14, 2019 1:15 am

Baremetal demoscene, anything else it too easy :D
Like I have said before we have a choice now Asm, C, C++, Rust, Pascal.

What would be interesting is interpreted versions, Basic, Python, Lua, JS....
BBC Basic looks like it could be modified.
Those would be like a small OS's.
And small OS's are nice for IoT stuff too.

For a year now I have been trying to figure out a CPU/GPU language that has native support for graphics.
Lots of SoC have GPUs of some sort, most use OpenGLES but need a Linux library.
Ultibo has shown it is possible use that method, but it is cheating a bit.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

LdB
Posts: 1645
Joined: Wed Dec 07, 2016 2:29 pm

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Thu Nov 14, 2019 7:20 am

The programming language is irrelevant, you keep dancing around the big white elephant in the room which is shaders to the VC pipeline.
All the samples Aran and I have done use hand written shader code which we bind. The other choice is as you note to bind the linux library.

Having recently done stuff on a mali it is so much easier when you have both an online and offline shader compiler available to you .. hint to pi foundation :-)

On your other comment what you have been trying to figure out has a number of versions out there probably the best currently
https://github.com/DiligentGraphics/DiligentEngine
You can connect it to a headless version of raspbian buster without to much issue.

User avatar
Gavinmc42
Posts: 4833
Joined: Wed Aug 28, 2013 3:31 am

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Thu Nov 14, 2019 7:44 am

The programming language is irrelevant,
That was my point, we have many languages choices now.
But none? are designed as computer/gpu languages.
Examples that are close are Oberon and TCL/TK

The interface to low level VC code is the bit that is missing.
On VC6 it is a OpenGL layer over OpenGLES.
In VC4 we can use the blobs.
But only a few have done what you guys have done, poke the hardware direct.

Diligent still needs the backend.
I'm not really interested in graphics that only run on Linux.
I want something smaller and simpler just to make simple GUIs for single purpose gadgets that use PI or one day other SoC PCBs.
But these SoC's come with shader capable hardware, no need to waste that.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

blippy
Posts: 68
Joined: Fri Nov 03, 2017 3:07 pm

Re: "Pi On Fire" demo won 2nd prize at Demosplash 2019

Sun Nov 17, 2019 12:04 pm

One word for you: AWESOME

Return to “Bare metal, Assembly language”