comparison vdp.c @ 191:1b4d856b067a

Fixes for direct color dma stuff
author Mike Pavone <pavone@retrodev.com>
date Mon, 14 Jan 2013 20:23:17 -0800
parents 4cb8a3891e26
children d3266cee02c9
comparison
equal deleted inserted replaced
190:4cb8a3891e26 191:1b4d856b067a
913 //TODO: Figure out the exact behavior that reduces DMA slots for direct color DMA demos 913 //TODO: Figure out the exact behavior that reduces DMA slots for direct color DMA demos
914 return (linecyc == 37 || linecyc == 69 || linecyc == 102 || linecyc == 133 || linecyc == 165 || linecyc == 197 || linecyc >= 210 || (linecyc < 6 && (context->flags & FLAG_DMA_RUN) && ((context->dma_cd & 0xF) == CRAM_WRITE))); 914 return (linecyc == 37 || linecyc == 69 || linecyc == 102 || linecyc == 133 || linecyc == 165 || linecyc == 197 || linecyc >= 210 || (linecyc < 6 && (context->flags & FLAG_DMA_RUN) && ((context->dma_cd & 0xF) == CRAM_WRITE)));
915 } else { 915 } else {
916 linecyc = linecyc/20; 916 linecyc = linecyc/20;
917 //TODO: Figure out which slots are refresh when display is off in 32-cell mode 917 //TODO: Figure out which slots are refresh when display is off in 32-cell mode
918 //These numbers are guesses based on H40 numbers
919 return (linecyc == 24 || linecyc == 56 || linecyc == 88 || linecyc == 120 || linecyc == 152 || (linecyc < 5 && (context->flags & FLAG_DMA_RUN) && ((context->dma_cd & 0xF) == CRAM_WRITE)));
918 //The numbers below are the refresh slots during active display 920 //The numbers below are the refresh slots during active display
919 return (linecyc == 66 || linecyc == 98 || linecyc == 130 || linecyc == 162); 921 //return (linecyc == 66 || linecyc == 98 || linecyc == 130 || linecyc == 162);
920 } 922 }
921 } 923 }
922 924
923 void check_render_bg(vdp_context * context, int32_t line) 925 void check_render_bg(vdp_context * context, int32_t line)
924 { 926 {
935 } 937 }
936 } else { 938 } else {
937 linecyc /= 20; 939 linecyc /= 20;
938 if (linecyc >= 43 && linecyc < 171) { 940 if (linecyc >= 43 && linecyc < 171) {
939 uint32_t x = (linecyc-43)*2; 941 uint32_t x = (linecyc-43)*2;
940 start = context->framebuf + line * 256 + x; 942 start = context->framebuf + line * 320 + x;
941 end = start + 2; 943 end = start + 2;
942 } 944 }
943 } 945 }
944 uint16_t color = context->cram[context->regs[REG_BG_COLOR] & 0x3F]; 946 uint16_t color = context->cram[context->regs[REG_BG_COLOR] & 0x3F];
945 while (start != end) { 947 while (start != end) {