Mercurial > repos > blastem
comparison vdp.c @ 190:4cb8a3891e26
Small fix to bg drawing that yields the proper res for direct color DMA
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 14 Jan 2013 02:13:14 -0800 |
parents | 806c3b7a6f2a |
children | 1b4d856b067a |
comparison
equal
deleted
inserted
replaced
189:806c3b7a6f2a | 190:4cb8a3891e26 |
---|---|
927 uint16_t * start = NULL, *end = NULL; | 927 uint16_t * start = NULL, *end = NULL; |
928 uint32_t linecyc = (context->cycles % MCLKS_LINE); | 928 uint32_t linecyc = (context->cycles % MCLKS_LINE); |
929 if (context->latched_mode & BIT_H40) { | 929 if (context->latched_mode & BIT_H40) { |
930 linecyc /= 16; | 930 linecyc /= 16; |
931 if (linecyc >= 50 && linecyc < 210) { | 931 if (linecyc >= 50 && linecyc < 210) { |
932 uint32_t x = ((linecyc-50)&(~0x1))*2; | 932 uint32_t x = (linecyc-50)*2; |
933 start = context->framebuf + line * 320 + x; | 933 start = context->framebuf + line * 320 + x; |
934 end = start + 4; | 934 end = start + 2; |
935 } | 935 } |
936 } else { | 936 } else { |
937 linecyc /= 20; | 937 linecyc /= 20; |
938 if (linecyc >= 43 && linecyc < 171) { | 938 if (linecyc >= 43 && linecyc < 171) { |
939 uint32_t x = ((linecyc-48)&(~0x1))*2; | 939 uint32_t x = (linecyc-43)*2; |
940 start = context->framebuf + line * 256 + x; | 940 start = context->framebuf + line * 256 + x; |
941 end = start + 4; | 941 end = start + 2; |
942 } | 942 } |
943 } | 943 } |
944 uint16_t color = context->cram[context->regs[REG_BG_COLOR] & 0x3F]; | 944 uint16_t color = context->cram[context->regs[REG_BG_COLOR] & 0x3F]; |
945 while (start != end) { | 945 while (start != end) { |
946 *start = color; | 946 *start = color; |