Previous 15994 Revisions Next

r1818 Saturday 1st March, 2008 at 14:42:33 UTC by Wilbert Pol
[ODYSSEY2] Added support for displaying partial character objects.
[src/mess/video]odyssey2.c

src/mess/video/odyssey2.c
r1817r1818
359359         /* Regular foreground objects */
360360         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.foreground ); i++ ) {
361361            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 );
363363
364364            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
365365               UINT16   color = machine->pens[ 16 + ( ( o2_vdc.s.foreground[i].color & 0x0E ) >> 1 ) ];
r1817r1818
397397               int j;
398398
399399               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;
411419                           }
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;
418420                        }
419421                     }
422                  } else {
423                     x += 8;
420424                  }
421425               }
422426            }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team