PDA

View Full Version : Best way to draw tiles to QGL from the memory



leonardo2204
11th March 2012, 04:08
Hey guys, my first post here !
Well, what I'm doing is: I'm developing a GBC emulator in C++ using Qt.
So, as you probably figured (or not), all you do is basically read the GBC ROM into the memory (dinamically), so everything that runs on the GBC (sound, videos, I/O) is somewhere in there.
That said, I have a part of the memory that is designed to video only. Quoting GBC docs, we have:
This area is also known as Tile RAM, since it holds tiles. Each tile is 8x8 pixels of 2-bit color, which makes each tile 16 bytes long. This area is also divided up into two modes of tiles, signed and unsigned. In unsigned mode, tiles are numbered from 0-255 at $8000-$9000. In signed mode, tiles are numbered in two's complement from -127 to 128 at $87FF-$97F.
So I'm using OpenGL to do the drawing in a Widget (promoted to QGLWidget).
What would be the best way to draw all the stuff in this Widget ?

Thanks !

leonardo2204
12th March 2012, 17:24
Any help would be appreciated !

Thanks !

leonardo2204
14th March 2012, 18:02
Nobody ?

Thanks !