Whereas games often render tiles that happen to end up off screen or covered by other tiles.Īlso, most games are loading and overriding tiles and palettes in chunks ("tilesets"), even if only some of them end up actually getting used, This results in a way of rendering a scene to look the same as the original footage,īut is generally more efficient, because it uses several optimizations that the original game doesn't use.įor one, it only renders a tile only if it will actually be visible on the screen at some point during the scene, That makes a total of 912*154 = 140448 cycles spent per frame, resulting in a frame rate of 8388608 Hz/140448 = ~59.72 fps. The rest of the time is spent in Mode 0 (also called HBlank), in which the LCD is inactive.Īfter all 144 lines are rendered that way, 10 more sets of 912 cycles are spent with the LCD inactive in Mode 1 (also called VBlank). It is followed by Mode 3, in which the data to render is sent to the LCD controller, and which can take anywhere from ~344 to ~592 cycles, depending on a lot of factors, like the number of sprites on that line. The first phase is Mode 2, in which the LCD controller searches through the sprites to render, and which lasts for 160 cycles. These 912 cycles are split up into 3 phases, called Modes. The time spent on each line is constant, exactly 912 cycles each (All listed cycle counts assume double-speed mode, single speed cycles counts are halved). The screen has 144 lines, with 160 pixels each. The Gameboy renders its screen line by line, one at a time.Įach line is largely treated independently from the others. So a single tile can be used with different palettes in different places. Palettes are not bound to individual tiles, but to the place in the background, window or sprite where they are used, In addition to tiles, there are color palettes, which define which of the 4 colors of a tile corresponds to which RGB color (15bit color depth). They are used for anything that moves on the background. Lastly, the Sprites are either single (8x8) or double (8x16) tiles, that can be places anywhere on the screen and can be semi-transparent. They are often used for menus, dialogs, splashscreens, etc. The Window uses the same tile grids as be background, but is not scrollable and rendered over the background. The Background is a 32x32 tile grid (actually two of them that you can choose one of to use) that can be smoothly scrolled around on, and is often used for background images. These tiles can be rendered on the screen in three different ways: Background, Window and Sprites. All graphics are based on 8x8 pixel tiles with 2bpp depth (i.e.
0 Comments
Leave a Reply. |