Beispiel #1
0
void consoleSetLineColor(int line, int color) {
    u16* map = BG_MAP_RAM_SUB(22);
    for (int i=0; i<32; i++) {
        map[line*32+i] &= ~TILE_PALETTE(15);
        map[line*32+i] |= TILE_PALETTE(color);
    }
}
Beispiel #2
0
void iprintfColored(int palette, const char *format, ...) {
    va_list args;
    va_start(args, format);

    PrintConsole* console = getPrintConsole();
    int x = console->cursorX;
    int y = console->cursorY;

    char s[100];
    vsiprintf(s, format, args);

    u16* dest = BG_MAP_RAM_SUB(22)+y*32+x;
    for (uint i=0; i<strlen(s); i++) {
        if (s[i] == '\n') {
            x = 0;
            y++;
        }
        else {
            *(dest++) = s[i] | TILE_PALETTE(palette);
            x++;
            if (x == 32) {
                x = 0;
                y++;
            }
        }
    }
    console->cursorX = x;
    console->cursorY = y;
    //iprintf(s);
}
Beispiel #3
0
	//-------------------------------------------------------------------------------------------------
	Map::Map(Graphics::BackgroundMemory* backgroundMemory, int index) : index(index), size(32, 32), BackgroundMemory(backgroundMemory) 
	{
		sassert(backgroundMemory, "Error: Background memory cannot be null");
		location = BackgroundMemory->IsMain() ? BG_MAP_RAM(index) : BG_MAP_RAM_SUB(index);
		Clear();
	}
Beispiel #4
0
void consoleSetPosColor(int x, int y, int color) {
    u16* map = BG_MAP_RAM_SUB(22);
    map[y*32+x] &= ~TILE_PALETTE(15);
    map[y*32+x] |= TILE_PALETTE(color);
}