diff --git a/src/video/vid_c&t_69000.c b/src/video/vid_c&t_69000.c index e35f28227..b2cd62f07 100644 --- a/src/video/vid_c&t_69000.c +++ b/src/video/vid_c&t_69000.c @@ -133,6 +133,7 @@ typedef struct chips_69000_t { /* Byte counter for BitBLT port writes. */ uint8_t bytes_written; + uint32_t bytes_counter; uint8_t bytes_port[4]; } bitblt_running; @@ -418,6 +419,18 @@ chips_69000_do_rop_8bpp_patterned(uint8_t *dst, uint8_t src, uint8_t nonpattern_ case 0x0F: *dst = ~src; break; + case 0x1A: + *dst = src ^ (*dst | (src & nonpattern_src)); + break; + case 0x2A: + *dst = *dst & (~(nonpattern_src & src)); + break; + case 0x3A: + *dst = nonpattern_src ^ (src | (*dst ^ nonpattern_src)); + break; + case 0x4A: + *dst = *dst ^ (src & (nonpattern_src | *dst)); + break; case 0x50: *dst = src & ~(*dst); break; @@ -430,6 +443,18 @@ chips_69000_do_rop_8bpp_patterned(uint8_t *dst, uint8_t src, uint8_t nonpattern_ case 0x5F: *dst = ~src | ~(*dst); break; + case 0x6A: + *dst = *dst ^ (src & nonpattern_src); + break; + case 0x7A: + *dst = *dst ^ (src & (nonpattern_src | (~*dst))); + break; + case 0x8A: + *dst = *dst & (nonpattern_src | (~src)); + break; + case 0x9A: + *dst = *dst ^ (src & (~nonpattern_src)); + break; case 0xB8: *dst = (((src ^ *dst) & nonpattern_src) ^ src); break; @@ -444,6 +469,18 @@ chips_69000_do_rop_8bpp_patterned(uint8_t *dst, uint8_t src, uint8_t nonpattern_ case 0xAF: *dst |= ~src; break; + case 0xBA: + *dst |= (src & ~nonpattern_src); + break; + case 0xCA: + *dst ^= (src & (nonpattern_src ^ *dst)); + break; + case 0xDA: + *dst ^= src & (~(nonpattern_src & *dst)); + break; + case 0xEA: + *dst |= src & nonpattern_src; + break; case 0xF0: *dst = src; break; @@ -479,6 +516,18 @@ chips_69000_do_rop_16bpp_patterned(uint16_t *dst, uint16_t src, uint16_t nonpatt case 0x0F: *dst = ~src; break; + case 0x1A: + *dst = src ^ (*dst | (src & nonpattern_src)); + break; + case 0x2A: + *dst = *dst & (~(nonpattern_src & src)); + break; + case 0x3A: + *dst = nonpattern_src ^ (src | (*dst ^ nonpattern_src)); + break; + case 0x4A: + *dst = *dst ^ (src & (nonpattern_src | *dst)); + break; case 0x50: *dst = src & ~(*dst); break; @@ -491,6 +540,18 @@ chips_69000_do_rop_16bpp_patterned(uint16_t *dst, uint16_t src, uint16_t nonpatt case 0x5F: *dst = ~src | ~(*dst); break; + case 0x6A: + *dst = *dst ^ (src & nonpattern_src); + break; + case 0x7A: + *dst = *dst ^ (src & (nonpattern_src | (~*dst))); + break; + case 0x8A: + *dst = *dst & (nonpattern_src | (~src)); + break; + case 0x9A: + *dst = *dst ^ (src & (~nonpattern_src)); + break; case 0xB8: *dst = (((src ^ *dst) & nonpattern_src) ^ src); break; @@ -505,6 +566,18 @@ chips_69000_do_rop_16bpp_patterned(uint16_t *dst, uint16_t src, uint16_t nonpatt case 0xAF: *dst |= ~src; break; + case 0xBA: + *dst |= (src & ~nonpattern_src); + break; + case 0xCA: + *dst ^= (src & (nonpattern_src ^ *dst)); + break; + case 0xDA: + *dst ^= src & (~(nonpattern_src & *dst)); + break; + case 0xEA: + *dst |= src & nonpattern_src; + break; case 0xF0: *dst = src; break; @@ -542,6 +615,18 @@ chips_69000_do_rop_24bpp_patterned(uint32_t *dst, uint32_t src, uint32_t nonpatt case 0x0F: *dst = ~src; break; + case 0x1A: + *dst = src ^ (*dst | (src & nonpattern_src)); + break; + case 0x2A: + *dst = *dst & (~(nonpattern_src & src)); + break; + case 0x3A: + *dst = nonpattern_src ^ (src | (*dst ^ nonpattern_src)); + break; + case 0x4A: + *dst = *dst ^ (src & (nonpattern_src | *dst)); + break; case 0x50: *dst = src & ~(*dst); break; @@ -554,6 +639,18 @@ chips_69000_do_rop_24bpp_patterned(uint32_t *dst, uint32_t src, uint32_t nonpatt case 0x5F: *dst = ~src | ~(*dst); break; + case 0x6A: + *dst = *dst ^ (src & nonpattern_src); + break; + case 0x7A: + *dst = *dst ^ (src & (nonpattern_src | (~*dst))); + break; + case 0x8A: + *dst = *dst & (nonpattern_src | (~src)); + break; + case 0x9A: + *dst = *dst ^ (src & (~nonpattern_src)); + break; case 0xB8: *dst = (((src ^ *dst) & nonpattern_src) ^ src); break; @@ -568,6 +665,18 @@ chips_69000_do_rop_24bpp_patterned(uint32_t *dst, uint32_t src, uint32_t nonpatt case 0xAF: *dst |= ~src; break; + case 0xBA: + *dst |= (src & ~nonpattern_src); + break; + case 0xCA: + *dst ^= (src & (nonpattern_src ^ *dst)); + break; + case 0xDA: + *dst ^= src & (~(nonpattern_src & *dst)); + break; + case 0xEA: + *dst |= src & nonpattern_src; + break; case 0xF0: *dst = src; break; @@ -796,6 +905,7 @@ chips_69000_setup_bitblt(chips_69000_t* chips) chips->bitblt_running.actual_destination_height = chips->bitblt.destination_height; chips->bitblt_running.count_x = chips->bitblt_running.count_y = 0; chips->bitblt_running.bytes_written = 0; + chips->bitblt_running.bytes_counter = 0; if (chips->bitblt.bitblt_control & (1 << 23)) { chips->bitblt_running.bytes_per_pixel = 1 + ((chips->bitblt.bitblt_control >> 24) & 3); @@ -892,6 +1002,10 @@ chips_69000_bitblt_write(chips_69000_t* chips, uint8_t data) { if (!chips->engine_active) return; + + chips->bitblt_running.bytes_counter++; + if (chips->bitblt_running.bytes_counter <= (chips->bitblt_running.bitblt.source_addr & 7)) + return; chips->bitblt_running.bytes_port[chips->bitblt_running.bytes_written++] = data; if (chips->bitblt_running.bytes_written == chips->bitblt_running.bytes_per_pixel) { uint32_t source_pixel = chips->bitblt_running.bytes_port[0];