1
0

Implement BGLOAD

This commit is contained in:
otya128
2016-12-14 21:34:43 +09:00
parent 430aed0264
commit d9965931bd
2 changed files with 58 additions and 0 deletions

View File

@@ -199,4 +199,22 @@ class BG
}
}
}
void load(T)(int x, int y, int w, int h, T[] array, int charoff)
if (is(T == int) || is(T == double))
{
int srci;
for (int i = x; i < x + w; i++)
{
for (int j = y; j < y + h; j++)
{
srci++;
int index = i + j * width;
if (index < 0)
continue;
auto scr = cast(int)array[srci - 1];
auto chr = ((scr & 0xFFF) + charoff) & /*mask?*/0xFFF;
chip[index].screenData = (scr & 0xF000) | chr;
}
}
}
}