src/mess/video/odyssey2.c
| r1817 | r1818 | |
| 359 | 359 | /* Regular foreground objects */ |
| 360 | 360 | for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.foreground ); i++ ) { |
| 361 | 361 | int y = o2_vdc.s.foreground[i].y; |
| 362 | | int height = 8; |
| 362 | int height = 8 - ( ( ( y >> 1 ) + o2_vdc.s.foreground[i].ptr ) & 7 ); |
| 363 | 363 | |
| 364 | 364 | if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) { |
| 365 | 365 | UINT16 color = machine->pens[ 16 + ( ( o2_vdc.s.foreground[i].color & 0x0E ) >> 1 ) ]; |
| r1817 | r1818 | |
| 397 | 397 | int j; |
| 398 | 398 | |
| 399 | 399 | for ( j = 0; j < ARRAY_LENGTH( o2_vdc.s.quad[0].single ); j++, x += 8 ) { |
| 400 | | UINT16 color = machine->pens[ 16 + ( ( o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 ) ]; |
| 401 | | int offset = ( o2_vdc.s.quad[i].single[j].ptr | ( ( o2_vdc.s.quad[i].single[j].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 ); |
| 402 | | UINT8 chr = ((char*)o2_shape)[ offset & 0x1FF ]; |
| 403 | | UINT8 m; |
| 404 | | |
| 405 | | for ( m = 0x80; m > 0; m >>= 1, x++ ) { |
| 406 | | if ( chr & m ) { |
| 407 | | if ( x >= 0 && x < 160 ) { |
| 408 | | /* Check if we collide with an already drawn source object */ |
| 409 | | if ( collision_map[ x ] & o2_vdc.s.collision ) { |
| 410 | | collision_status |= COLLISION_CHARACTERS; |
| 400 | int char_height = 8 - ( ( ( y >> 1 ) + o2_vdc.s.quad[i].single[j].ptr ) & 7 ); |
| 401 | if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + char_height * 2 ) { |
| 402 | UINT16 color = machine->pens[ 16 + ( ( o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 ) ]; |
| 403 | int offset = ( o2_vdc.s.quad[i].single[j].ptr | ( ( o2_vdc.s.quad[i].single[j].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 ); |
| 404 | UINT8 chr = ((char*)o2_shape)[ offset & 0x1FF ]; |
| 405 | UINT8 m; |
| 406 | for ( m = 0x80; m > 0; m >>= 1, x++ ) { |
| 407 | if ( chr & m ) { |
| 408 | if ( x >= 0 && x < 160 ) { |
| 409 | /* Check if we collide with an already drawn source object */ |
| 410 | if ( collision_map[ x ] & o2_vdc.s.collision ) { |
| 411 | collision_status |= COLLISION_CHARACTERS; |
| 412 | } |
| 413 | /* Check if an already drawn object would collide with us */ |
| 414 | if ( COLLISION_CHARACTERS & o2_vdc.s.collision && collision_map[ x ] ) { |
| 415 | collision_status |= collision_map[ x ]; |
| 416 | } |
| 417 | collision_map[ x ] |= COLLISION_CHARACTERS; |
| 418 | *BITMAP_ADDR16( tmp_bitmap, vpos, I824X_START_ACTIVE_SCAN + x ) = color; |
| 411 | 419 | } |
| 412 | | /* Check if an already drawn object would collide with us */ |
| 413 | | if ( COLLISION_CHARACTERS & o2_vdc.s.collision && collision_map[ x ] ) { |
| 414 | | collision_status |= collision_map[ x ]; |
| 415 | | } |
| 416 | | collision_map[ x ] |= COLLISION_CHARACTERS; |
| 417 | | *BITMAP_ADDR16( tmp_bitmap, vpos, I824X_START_ACTIVE_SCAN + x ) = color; |
| 418 | 420 | } |
| 419 | 421 | } |
| 422 | } else { |
| 423 | x += 8; |
| 420 | 424 | } |
| 421 | 425 | } |
| 422 | 426 | } |