Inlined ppu_read
This commit is contained in:
parent
3fb4d40eb0
commit
cc6f2c8b29
|
@ -84,19 +84,12 @@ ppu_redraw(Ppu *p, Uint32 *screen)
|
||||||
{
|
{
|
||||||
Uint16 x, y;
|
Uint16 x, y;
|
||||||
for(y = 0; y < p->height; ++y)
|
for(y = 0; y < p->height; ++y)
|
||||||
for(x = 0; x < p->width; ++x)
|
for(x = 0; x < p->width; ++x) {
|
||||||
screen[x + y * p->width] = p->palette[ppu_read(p, x, y)];
|
|
||||||
p->reqdraw = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint8
|
|
||||||
ppu_read(Ppu *p, Uint16 x, Uint16 y)
|
|
||||||
{
|
|
||||||
if(x < p->width && y < p->height) {
|
|
||||||
Uint32 row = (x + y * p->width);
|
Uint32 row = (x + y * p->width);
|
||||||
return p->fg[row] ? p->fg[row] : p->bg[row];
|
Uint8 color = p->fg[row] ? p->fg[row] : p->bg[row];
|
||||||
|
screen[x + y * p->width] = p->palette[color];
|
||||||
}
|
}
|
||||||
return 0x0;
|
p->reqdraw = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue