diff options
| -rw-r--r-- | src/main.c | 8 | ||||
| -rw-r--r-- | src/ppu.c | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -135,6 +135,14 @@ int main(int argc, char **argv) { } } if (raw_tty) tcsetattr(STDIN_FILENO, TCSANOW, &saved_tio); + if (shot_frames >= 0) { // --headless --shot FILE: dump final LCD + FILE *pf = fopen(shot_path, "wb"); + fprintf(pf, "P6\n%d %d\n255\n", SCREEN_W, SCREEN_H); + for (int y = 0; y < SCREEN_H; y++) + for (int x = 0; x < SCREEN_W; x++) + fwrite(gb->ppu.fb[y][x], 1, 3, pf); + fclose(pf); + } cart_free(&gb->cart); free(gb); return 0; } @@ -1,3 +1,4 @@ +#include <stdio.h> #include "ppu.h" #include <string.h> |
