0
\$\begingroup\$

I would like to load a background image which I currently have saved as a .bmp into the DE2-115's SDRAM. I would then like to display this background image on a VGA-monitor (640x480). I will then be drawing additional images overlaid to this background image.

I am using NIOS II by the way.

I have implemented games using a VGA controller such as brick breaker but they simply had solid colors which I would draw in .sv code quite easily.

If I want to draw this .bmp to the monitor what steps should I take? Should I draw it from software in C or from hardware using a vga controller and reading from memory? Lastly how should I upload the .bmp to the SDRAM?

Thank you.

UPDATE!!: I should probably explain more of the project. So I'm trying to develop a texas hold em game. The fixed background image is a poker table and in fixed locations on the table I want to overlay the card's of 2 players, as well as the 5 common cards. The poker table will be a .bmp as well as each card. Based on the current game we will be displaying different cards. We will have to display several cards at once.

So effectively what I wanted to know is how I should deal with displaying all of the above for a given game. I have the game all setup, I know just have to determine how I will store all these .bmp's in memory and read them and display them during a game. I have a VGA controller setup and a color mapper but they were used for a brick breaker game which didn't require reading from memory for drawing.

\$\endgroup\$
2
  • \$\begingroup\$ Does this need to be able to rapidly display multiple .bmp's? If not, I'd say you can do it in software. Are you asking how to create an RGB signal that fits within VGA specifications? I don't know much about this FPGA's capabilities, so I don't want to answer yet. But if you want to know how to make VGA signals, I can help. \$\endgroup\$
    – Wyatt Ward
    Commented Nov 28, 2015 at 1:31
  • \$\begingroup\$ @Wyatt8740 Hi Wyatt. I updated the question with a project summary to give you some more info regarding what troubles I am having. \$\endgroup\$ Commented Nov 28, 2015 at 2:18

1 Answer 1

2
\$\begingroup\$

You need something like a video memory like the one found on casual graphic cards.

Change the VGA controller, so that it is reading the pixels repeatedly from the video memory. Update this video memory by the NIOS-II program according to your game, e.g., by copying the bitmap from the SDRAM to the video memory at the desired location.

The video memory will require two ports, one for the VGA controller and one for the NIOS-II. For the first step, you can use the one-chip block memory of the FPGA which offers two ports. But the available memory is rather small (just ~0.5 MB on the FPGA of your board), so if you start with 640x480 then you would have only few bits per color per pixel. Another option would be a video memory with a resolution of 320x240 pixels and then outputting each pixel four-times to get 640x480.

For higher (color) resolutions, you typically need external SRAM (but only 2 MB available your FPGA board). But if this is already occupied by the NIOS-II, you can statically allocate some part of it for the video memory. To allow reading from the memory by the VGA controller, the bus connection the NIOS-II with the memory must be extended to some sort of multi-master bus.

Further notes: To upload the image there are several possibilities: SD card, Gigabit Ethernet, RS232 port.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.