Mercurial > repos > blastem
comparison vdp.c @ 1032:679137a0e78e
Fix bug in vflip implementation when in double resolution interlace mode
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 15 May 2016 16:22:45 -0700 |
parents | 4263dc9cf86d |
children | fa6fe03f218a |
comparison
equal
deleted
inserted
replaced
1031:219de1d64aa1 | 1032:679137a0e78e |
---|---|
824 } | 824 } |
825 | 825 |
826 void render_map(uint16_t col, uint8_t * tmp_buf, uint8_t offset, vdp_context * context) | 826 void render_map(uint16_t col, uint8_t * tmp_buf, uint8_t offset, vdp_context * context) |
827 { | 827 { |
828 uint16_t address; | 828 uint16_t address; |
829 uint8_t shift, add; | 829 uint16_t vflip_base; |
830 if (context->double_res) { | 830 if (context->double_res) { |
831 address = ((col & 0x3FF) << 6); | 831 address = ((col & 0x3FF) << 6); |
832 shift = 1; | 832 vflip_base = 60; |
833 add = context->framebuf != context->oddbuf ? 1 : 0; | |
834 } else { | 833 } else { |
835 address = ((col & 0x7FF) << 5); | 834 address = ((col & 0x7FF) << 5); |
836 shift = 0; | 835 vflip_base = 28; |
837 add = 0; | |
838 } | 836 } |
839 if (col & MAP_BIT_V_FLIP) { | 837 if (col & MAP_BIT_V_FLIP) { |
840 address += 28 - 4 * context->v_offset/*((context->v_offset << shift) + add)*/; | 838 address += vflip_base - 4 * context->v_offset; |
841 } else { | 839 } else { |
842 address += 4 * context->v_offset/*((context->v_offset << shift) + add)*/; | 840 address += 4 * context->v_offset; |
843 } | 841 } |
844 uint16_t pal_priority = (col >> 9) & 0x70; | 842 uint16_t pal_priority = (col >> 9) & 0x70; |
845 int32_t dir; | 843 int32_t dir; |
846 if (col & MAP_BIT_H_FLIP) { | 844 if (col & MAP_BIT_H_FLIP) { |
847 offset += 7; | 845 offset += 7; |