Mercurial > repos > blastem
comparison gst.c @ 1120:e9369d6f0101
Somewhat broken implementation of Mode 4
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 27 Dec 2016 11:31:17 -0800 |
parents | 7ab7c8fb34ba |
children | 0928b68fef2a |
comparison
equal
deleted
inserted
replaced
1119:55ea7f9a4e92 | 1120:e9369d6f0101 |
---|---|
232 fputs("Failed to read CRAM from savestate\n", stderr); | 232 fputs("Failed to read CRAM from savestate\n", stderr); |
233 return 0; | 233 return 0; |
234 } | 234 } |
235 for (int i = 0; i < CRAM_SIZE; i++) { | 235 for (int i = 0; i < CRAM_SIZE; i++) { |
236 uint16_t value; | 236 uint16_t value; |
237 context->cram[i] = value = (tmp_buf[i*2+1] << 8) | tmp_buf[i*2]; | 237 write_cram(context, i, (tmp_buf[i*2+1] << 8) | tmp_buf[i*2]); |
238 context->colors[i] = color_map[value & 0xEEE]; | |
239 context->colors[i + CRAM_SIZE] = color_map[(value & 0xEEE) | FBUF_SHADOW]; | |
240 context->colors[i + CRAM_SIZE*2] = color_map[(value & 0xEEE) | FBUF_HILIGHT]; | |
241 } | 238 } |
242 if (fread(tmp_buf, 2, VSRAM_SIZE, state_file) != VSRAM_SIZE) { | 239 if (fread(tmp_buf, 2, VSRAM_SIZE, state_file) != VSRAM_SIZE) { |
243 fputs("Failed to read VSRAM from savestate\n", stderr); | 240 fputs("Failed to read VSRAM from savestate\n", stderr); |
244 return 0; | 241 return 0; |
245 } | 242 } |