View unanswered posts | View active topics It is currently Wed Apr 23, 2014 11:46 am



Reply to topic  [ 2 posts ] 
 Hex values from images 
Author Message

Joined: Fri Aug 20, 2010 8:38 am
Posts: 23
Location: Australia
Post Hex values from images
Hi guys!

So like I've said in some other posts I'm making a hand held game console thingy using an FPGA and a microcontroller. I'm using ROMs in the FPGA to draw the different objects. The trouble is getting the images in to the roms. Plotting them in by hand pixel by pixel is way to much work and ridiculous unefficient. It would be nice if you could get the hex code for each line from an image using photoshop. Does anyone have any experience with this? I use three ROMs containing red green blue for each image.

Thanks,
Q-bert


Sat May 14, 2011 8:30 am
Profile
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 279
Post Re: Hex values from images
Well, this is very easy. What I suggest is this, simply format your engine to take 8x8, 16x16, 32x32, whatever format bitmaps, then template them as outlined in my books and everyone elses. Now, you take that bitmap file and turn it into a stream of bitmaps in RGB format (whatever yours is), so that its one single stream of bytes, but since you know each image is 16x16 pixels, and each pixel is 1,2,3 bytes, then you know everything. Now, store that in a SD card and with your processor load the bitmap data into the FPGA's RAM during run time.

OR... IF you want these bitmaps in the FPGA FLASH rom, then this is easy as well, all FPGA tools quartus and xilinx both can load the FLASH with a binary file. Thus, on your HD you have a file for each bitmap, or the stream or the template and load it directly into the FPGA, then your verilog code can use a pointer to the base of the bitmap, and you know the data stride, line stride, and bitmap stride, this you know everything again.

So your tool chain pipelines might be:

1. Artist -> photoshop-> BMP/PNP, etc. -> convert to simple RGB or indexed bitmap (TGA, PCX, RAW), now dump files on SD, and with processor load into FPGA RAM during runtime.

2. Artist -> photoshop-> BMP/PNP, etc. -> convert to simple RGB or indexed bitmap (TGA, PCX, RAW), now dump files INTO FPGA along with verilog as a program block binary where you know the start address of the data in FLASH, etc.

Problem is you want users to be able to do this, and 1 in 10000000000 people know how to use a FPGA you need to have a tool chain and data pipeline that at worst users can just dump simple files on an SD card, they get loaded (with a convention for format, pixel size, mxn bitmap size, etc.) into your system.

In other words, you really need to make sure the FPGA is a GPU that doesn't use FLASH for data, it uses external SRAM or its internal SRAM, either way there is a way to get it into this during run time, not a program time, so users can write games without a silicon compiler.

Andre'


Sun May 15, 2011 5:00 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.