Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "OpenEngine.h"
- #include "OpenGraphics.h"
- #include "OpenInput.h"
- #include "my_tiles.h"
- #include "my_map.c"
- void loop();
- const unsigned short *myMapData = (unsigned short*)my_map;
- void main() {
- int tile_setCharBaseBlock = 1;
- volatile unsigned short *tileData = (unsigned short*)( 0x06000000 + (tile_setCharBaseBlock * 0x4000) );
- int my_mapScreenBaseBlock = 28;
- volatile unsigned short *tileMap = (unsigned short*) ( 0x6000000 + (my_mapScreenBaseBlock*0x800) );
- setmode(DCNT_MODE0, DCNT_BG2);
- int i;
- //cargamos la paleta de los tiles
- for(i = 0; i < 256; i++) {
- SCREENBUFFER[i] = my_tilespal[i];
- }
- //cargamos los tiles
- for(i = 0; i < (my_tiles_WIDTH * my_tiles_HEIGHT) / 2; i++) {
- tileData[i] = my_tilesdata[i];
- }
- //cargamos el mapa
- for(i = 0; i < (31 * 31) / 2; i++) {
- tileMap[i] = myMapData[i];
- }
- REG_BG2CNT = (tile_setCharBaseBlock << 2) | (my_mapScreenBaseBlock << 8) | 0x80 | 0x8000;
- loop();
- }
- void loop() {
- while(1) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment