123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|693|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Raspberry Pi Zero Bare Metal Fun!

Sun, 08 May 2016, 11:35
Krakatomato
When I was reading up on the Spectrum Next, I found that they were using a Raspberry Pi Zero for HDMI connectivity. I'd previously thought of this using a standard Raspberry Pi for the 6502 project that's a bit on-and-off. The problem I had was that the standard Pi is a bit expensive, and big. It also has an operating system - it takes time to come up and if you take the power away from it without shutting down properly you risk trashing the SD card contents. Bare metal seemed a bit too much at the time.

But the Pi Zero? Hmm - now there was a challenge. It's small and cheap enough. Time to look into bare metal programming.

In just a few days, I've got programs running up the instant you provide power to the device. A framebuffer to which I have direct access and can throw whatever I want at it.

So the basics are all there to get data from my 6502 and other projects and dump graphical information directly to the framebuffer. Sweet.

At 640x480 resolution, I'm getting roughly 30fps. Not bad. If I implement DMA then that should go up some more - more than enough for what I want!

This is like being back in the 80's and coding straight to the Atari using assembler. So much fun - I highly recommend it

Attached pic is nothing to write home about - just a simple 128x128 sprite sheet being displayed in the upper corner of my 27" monitor. But little things like this certainly bring a smile to your face after hours of screaming and shouting



//Andy
Sun, 08 May 2016, 11:36
Jayenkai
Sounds like a lot of fun.
The idea of having instant-on gaming.. Mmmm....

-=-=-
''Load, Next List!''
Sun, 08 May 2016, 11:47
Krakatomato
It's great. No more linux woes. Turn it on, and it's there. Turn it off and it doesn't care (although may be a bit sad)
Sun, 08 May 2016, 11:57
9572AD
Modern "gamers" could care less, I'm sure, but this just puts a big grin on my face. Not in my spectrum of know-how, unfortunately.

-=-=-
All the raw, animal magnetism of a rutabaga.
Sun, 08 May 2016, 14:08
steve_ancell
Krakatomato you dark horse!, I gotta get me into this bare metal stuff.
Mon, 09 May 2016, 04:09
cyangames
So, is this all ASM then? Or some other beasty? Either way, that's so damn cool Krakamoto!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 09 May 2016, 04:17
steve_ancell
You can do it in C, or so I read somewhere.
Mon, 09 May 2016, 04:22
cyangames
That's cool. Also, just noticed my broken images and found out that the guys I left in charge of my domains didn't bother to renew it...ffs!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 09 May 2016, 09:36
Krakatomato
I'm no pro in assembler, so it's mostly C. There has to be some ASM for various things - not least starting things up, but once done you can pretty much ignore that.

Currently working on USB and SD Card support. Others have done it, but way cooler learning it all yourself
Mon, 09 May 2016, 14:00
steve_ancell
Not sure if this will be useful to anyone but I'll post a link anyway.

Linkage!
Mon, 09 May 2016, 14:14
Krakatomato
I used the Valvers stuff as a basis along with David Welch's github.com/dwelch67/raspberrypi. Both are great resources, although the Valvers stuff uses CMake which I find confuses things somewhat.

I like to keep it simple and only include the bare bones - which is pretty much what David does.

There's also the USPi stuff github.com/rsta2/uspi if you like to avoid working things out. I'm trying to avoid it at the moment, but do have a feeling I may have to refer for some things as USB really does suck arse

//Andy
Tue, 05 Jul 2016, 22:10
spinal
Might look into this...