Mercurial > repos > blastem
comparison vdp.c @ 1632:cc699c4966b1
Fix order bytes of a word are written into VRAM from the FIFO. Fixes ticket 36, the graphical glitch in Road Rash 3
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 05 Nov 2018 00:30:44 -0800 |
parents | c4ba3177b72d |
children | e397766c3028 |
comparison
equal
deleted
inserted
replaced
1631:c4ba3177b72d | 1632:cc699c4966b1 |
---|---|
894 { | 894 { |
895 case VRAM_WRITE: | 895 case VRAM_WRITE: |
896 if ((context->regs[REG_MODE_2] & (BIT_128K_VRAM|BIT_MODE_5)) == (BIT_128K_VRAM|BIT_MODE_5)) { | 896 if ((context->regs[REG_MODE_2] & (BIT_128K_VRAM|BIT_MODE_5)) == (BIT_128K_VRAM|BIT_MODE_5)) { |
897 vdp_check_update_sat(context, start->address, start->value); | 897 vdp_check_update_sat(context, start->address, start->value); |
898 write_vram_word(context, start->address, start->value); | 898 write_vram_word(context, start->address, start->value); |
899 } else if (start->partial == 3) { | |
900 vdp_check_update_sat_byte(context, start->address ^ 1, start->value); | |
901 write_vram_byte(context, start->address ^ 1, start->value); | |
899 } else if (start->partial) { | 902 } else if (start->partial) { |
900 //printf("VRAM Write: %X to %X at %d (line %d, slot %d)\n", start->value, start->address ^ 1, context->cycles, context->cycles/MCLKS_LINE, (context->cycles%MCLKS_LINE)/16); | 903 //printf("VRAM Write: %X to %X at %d (line %d, slot %d)\n", start->value, start->address ^ 1, context->cycles, context->cycles/MCLKS_LINE, (context->cycles%MCLKS_LINE)/16); |
901 uint8_t byte = start->partial == 2 ? start->value >> 8 : start->value; | 904 uint8_t byte = start->value >> 8; |
902 if (start->partial > 1) { | 905 if (start->partial > 1) { |
903 vdp_check_update_sat_byte(context, start->address ^ 1, byte); | 906 vdp_check_update_sat_byte(context, start->address, byte); |
904 } | 907 } |
905 write_vram_byte(context, start->address ^ 1, byte); | 908 write_vram_byte(context, start->address, byte); |
906 } else { | 909 } else { |
907 //printf("VRAM Write High: %X to %X at %d (line %d, slot %d)\n", start->value >> 8, start->address, context->cycles, context->cycles/MCLKS_LINE, (context->cycles%MCLKS_LINE)/16); | 910 //printf("VRAM Write High: %X to %X at %d (line %d, slot %d)\n", start->value >> 8, start->address, context->cycles, context->cycles/MCLKS_LINE, (context->cycles%MCLKS_LINE)/16); |
908 vdp_check_update_sat(context, start->address, start->value); | 911 vdp_check_update_sat(context, start->address, start->value); |
909 write_vram_byte(context, start->address, start->value >> 8); | 912 write_vram_byte(context, start->address ^ 1, start->value); |
910 start->partial = 1; | 913 start->partial = 1; |
911 //skip auto-increment and removal of entry from fifo | 914 //skip auto-increment and removal of entry from fifo |
912 return; | 915 return; |
913 } | 916 } |
914 break; | 917 break; |