Chrom-ART 2D hardware accelerator driver (DMA2D)

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by TexZK »

Finally, after a few days of headaches, I got the koolest splashscreen evah displayed on my STM32F429i-DISCO board, via DMA2D! 8-)

Wolf3D splash screen over the XOR-ed palette texture
Wolf3D splash screen over the XOR-ed palette texture
735858_204126666442309_1036396864.jpg (153.98 KiB) Viewed 7976 times


The dma2d branch is already available at:
https://github.com/TexZK/ChibiOS-RT-Community/tree/dma2d
(the ltdc branch was merged into this one)

There are a few things to test and adjust in the API, since some registers aren't very well documented in the Reference Manual, but at least the demo is working.
I also encounter some problems when launching sdram and erase commands via Chibi's shell, to write on the SDRAM. I'll open another thread for that anyway, because I don't know if my code for sleeping waits is wrong, or it's just an issue when mixing Chibi with ST's SDRAM code. I only know that the ISR counter or the scheduler get messed up... ugh! :oops:
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by Giovanni »

Cool!

Now it remains to port the rest of the game :-) and attach a joystick.

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by Tectu »

Well done! It's merged into the community repository by now.


~ Tectu
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Re: Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by TexZK »

D'oh, I fixed that stupid mistake that gave me threading troubles. I forgot to keep the default heap allocator boundaries inside the 112kB RAM bank, and instead it allocated the shell stack somewhere in the uninitialized SDRAM :o
Everything seems to work now :mrgreen:
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by Tectu »

Nice work - already merged!


~ Tectu
kenyee
Posts: 14
Joined: Fri Sep 20, 2013 8:27 pm

Re: Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by kenyee »

LOL...awesome. Would be hilarious if you can actually port that game over.
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Re: Chrom-ART 2D hardware accelerator driver (DMA2D)

Post by TexZK »

Oh well, I've been wondering about making a Wolf3D-like engine for 10 years, but: it requires way too much time, nobody will play it, every embedded platform needs its own port... So, despite my willpower and affection for that game (which was the kickstart of my computer-related career), I won't.

There's Wolf4SDL, but SDL needs to be ported for a generic ChibiOS-powered platform, and I think it would be very troublesome. Another way is to adapt SDL calls with a mini-SDL driver (like miniGL did).

I only hope somebody will use my DMA2D driver to speed up 2D stuff. Note: DMA2D doesn't output less than 16 bits per pixel, so it is totally useless for manipulating a palettized (8-bit) frame buffer, which must be handled by hand like the good old days.
Post Reply