Source programs and GFX tools http://cgdn.net/gba/tutor/m0bg.zip This section we primarily take a look at the image of the map background under MODE0. In actual production, Mode 0 is our preferred, we can use BG0, BG1, BG2, BG3 four movable / zoom / rotating background layers and OAM (Elves), but are all based on the tile mode. Suitable for the production of RPG and general action games. We originally explain some applications in the map mode, here added, specifically, for the source program. From here, we will put some of the most basic definitions in the mygba.h file under the lib directory, and then put your usual functions such as initialization into your custom H file, you need to call it, this can be reduced The code of the main program makes it easier to read. However, the premise is that your function naming rules must be easy to understand, and do it well, so you can make your own GBA development package. For the shortcomings, I temporarily use Air.h as the header file of the development kit, some basic application functions will be placed here. 1. Initialization, set to MODE 0, use BG0, support the basic properties of OAM and BG0. // - initialization function display ---- void Air_Core_Init () {// Mode 0, Background 0, Sprites, 1D Mapping SetMode (MODE_0 | BG0_ENABLE | OBJ_ENABLE | OBJ_MAP_1D); // Background 0 REG_BG0CNT = CHAR_BASE (1) | BG_MOSAIC_ENABLE | Bg_color_256;} 2. Put our tile image (palette and pixel) and tile arrangement combination data separately to the specified address. Because Mode 0 is a single buffer, and the routine paint point mode is slow, so use DMA to complete data transmission, you can try the speed difference of DMA and paint point method in Mode 3 (I am on the simulator Try, very significant speed difference. I don't know what will be burnt on GBA). // Background Tool Tile Data, length 128 Word (256 bytes) DMA3 (Paldata, BGPalettemem, 128); // Background Tile Data, 64 * 64 pixels DMA3 (Chardata, BackgroundMem, 64 * 64/2); // Background Tile Combination Data DMA3 (Mapdata, VideoBuffer, 32 * 32/2); Paldata, Chardata, Mapdata from a 256 * 256 size map.bmp image, there is a GFXCVT The tool set, its role is to convert a BMP image into background files in the drawing mode (including the tile palette data, Figure block pixel data, block combination data), please take a look at the GFCVT directory The Make.bat file is under. There is another way to generate a GBA background file is to find a map editor for GBA, draw the map you want, http: //gbadev.org/files/gbameditbeta4.zip, this gadget is not bad, It is easy to use. OK, now look at what we compile. The compiler I used was ARM SDT, with GCC's brothers could change void c_entry () to int main (), and then change Make.Bat.