Wednesday, August 18th, 2010
In the previous part of this series, the computer was introduced as a processing unit, which fetches its instructions from memory. In almost every case, a computer’s memory is not a simple contiguous region; the GameBoy is no exception in this regard. Since the GameBoy CPU can access 65,536 individual locations on its address bus, a “memory map” can be drawn of all the regions where the CPU has access.
In the third part Imran is now ready to actually draw things to the screen, using the Canvas tag:
Nintendo’s internal name for the GameBoy is “Dot Matrix Game”; its display is a pixel LCD of dimensions 160×144. If each pixel in the LCD is treated as a pixel in a HTML5
<canvas>, a direct mapping can be made to a canvas of width 160 and height 144. In order to directly address each pixel in the LCD, the contents of the canvas can be manipulated as a “framebuffer”: a single block of memory containing the entirety of the canvas, as a series of 4-byte RGBA values.
Next in the series will be a blog post on backgrounds and patterns.
Posted by Brad Neuberg at 6:00 am