diff options
author | aiju <devnull@localhost> | 2014-02-23 11:55:29 +0100 |
---|---|---|
committer | aiju <devnull@localhost> | 2014-02-23 11:55:29 +0100 |
commit | 662fff51f01f1886d52ece8ae55d6d6d422d5a52 (patch) | |
tree | 5432b31a7de9a2032e3d844733b1abef50f6a40a /sys/src/games/nes/ppu.c | |
parent | 0201795805f22e3d8d0b347d06c39d934c8b6866 (diff) |
games/nes: added oflag
Diffstat (limited to 'sys/src/games/nes/ppu.c')
-rw-r--r-- | sys/src/games/nes/ppu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/src/games/nes/ppu.c b/sys/src/games/nes/ppu.c index 09b875851..14926a2cf 100644 --- a/sys/src/games/nes/ppu.c +++ b/sys/src/games/nes/ppu.c @@ -257,22 +257,26 @@ flush(void) extern Mousectl *mc; Mouse m; Point p; + int h; + h = 240; + if(oflag) + h -= 16; while(nbrecv(mc->c, &m) > 0) ; if(nbrecvul(mc->resizec) > 0){ if(getwindow(display, Refnone) < 0) sysfatal("resize failed: %r"); p = divpt(addpt(screen->r.min, screen->r.max), 2); - picr = (Rectangle){subpt(p, Pt(scale * 128, scale * 120)), addpt(p, Pt(scale * 128, scale * 120))}; + picr = (Rectangle){subpt(p, Pt(scale * 128, scale * h/2)), addpt(p, Pt(scale * 128, scale * h/2))}; bg = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0xCCCCCCFF); draw(screen, screen->r, bg, nil, ZP); } if(tmp){ - loadimage(tmp, tmp->r, pic, 256*240*4*scale*scale); + loadimage(tmp, tmp->r, pic + oflag*8*256*4*scale*scale, 256*h*4*scale*scale); draw(screen, picr, tmp, nil, ZP); }else - loadimage(screen, picr, pic, 256*240*4*scale*scale); + loadimage(screen, picr, pic + oflag*8*256*4*scale*scale, 256*h*4*scale*scale); flushimage(display, 1); memset(pic, sizeof pic, 0); } |