Mercurial > repos > blastem
comparison vdp.c @ 329:fd5f6577db9b
Implement first line/last line weirdness in VDP
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 13 May 2013 21:52:33 -0700 |
parents | bf7ed23efa40 |
children | 57453d3d8be4 |
comparison
equal
deleted
inserted
replaced
328:bf7ed23efa40 | 329:fd5f6577db9b |
---|---|
768 { | 768 { |
769 //sprite render to line buffer starts | 769 //sprite render to line buffer starts |
770 case 0: | 770 case 0: |
771 context->cur_slot = MAX_DRAWS-1; | 771 context->cur_slot = MAX_DRAWS-1; |
772 memset(context->linebuf, 0, LINEBUF_SIZE); | 772 memset(context->linebuf, 0, LINEBUF_SIZE); |
773 render_sprite_cells(context); | |
774 break; | |
775 case 1: | 773 case 1: |
776 case 2: | 774 case 2: |
777 case 3: | 775 case 3: |
778 render_sprite_cells(context); | 776 if (line == 0xFF) { |
777 external_slot(context); | |
778 } else { | |
779 render_sprite_cells(context); | |
780 } | |
779 break; | 781 break; |
780 //sprite attribute table scan starts | 782 //sprite attribute table scan starts |
781 case 4: | 783 case 4: |
782 render_sprite_cells( context); | 784 render_sprite_cells( context); |
783 context->sprite_index = 0x80; | 785 context->sprite_index = 0x80; |
920 { | 922 { |
921 //sprite render to line buffer starts | 923 //sprite render to line buffer starts |
922 case 0: | 924 case 0: |
923 context->cur_slot = MAX_DRAWS_H32-1; | 925 context->cur_slot = MAX_DRAWS_H32-1; |
924 memset(context->linebuf, 0, LINEBUF_SIZE); | 926 memset(context->linebuf, 0, LINEBUF_SIZE); |
925 render_sprite_cells(context); | |
926 break; | |
927 case 1: | 927 case 1: |
928 case 2: | 928 case 2: |
929 case 3: | 929 case 3: |
930 render_sprite_cells(context); | 930 if (line == 0xFF) { |
931 external_slot(context); | |
932 } else { | |
933 render_sprite_cells(context); | |
934 } | |
931 break; | 935 break; |
932 //sprite attribute table scan starts | 936 //sprite attribute table scan starts |
933 case 4: | 937 case 4: |
934 render_sprite_cells( context); | 938 render_sprite_cells( context); |
935 context->sprite_index = 0x80; | 939 context->sprite_index = 0x80; |
1124 uint32_t intcyc = context->latched_mode & BIT_H40 ? VINT_SLOTS_H40 * MCLKS_SLOT_H40 : VINT_SLOTS_H32 * MCLKS_SLOT_H32; | 1128 uint32_t intcyc = context->latched_mode & BIT_H40 ? VINT_SLOTS_H40 * MCLKS_SLOT_H40 : VINT_SLOTS_H32 * MCLKS_SLOT_H32; |
1125 if (linecyc == intcyc) { | 1129 if (linecyc == intcyc) { |
1126 context->flags2 |= FLAG2_VINT_PENDING; | 1130 context->flags2 |= FLAG2_VINT_PENDING; |
1127 } | 1131 } |
1128 } | 1132 } |
1129 if (line < active_lines && context->regs[REG_MODE_2] & DISPLAY_ENABLE) { | 1133 if ((line < active_lines || (line == active_lines && linecyc < (context->latched_mode & BIT_H40 ? 64 : 80))) && context->regs[REG_MODE_2] & DISPLAY_ENABLE) { |
1130 //first sort-of active line is treated as 255 internally | 1134 //first sort-of active line is treated as 255 internally |
1131 //it's used for gathering sprite info for line | 1135 //it's used for gathering sprite info for line |
1132 line = (line - 1) & 0xFF; | 1136 line = (line - 1) & 0xFF; |
1133 | 1137 |
1134 //Convert to slot number | 1138 //Convert to slot number |