Previous 15994 Revisions Next

r1816 Saturday 1st March, 2008 at 10:15:23 UTC by Wilbert Pol
[ODYSSEY2] Fix off-by-one bug in the character drawing code.
[src/mess/video]odyssey2.c

src/mess/video/odyssey2.c
r1815r1816
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 = 7;
362            int   height = 8;
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 ) ];
366               int      offset = ( o2_vdc.s.foreground[i].ptr | ( ( o2_vdc.s.foreground[i].color & 0x01 ) << 8 ) ) + ( ( vpos - start_vpos ) >> 1 );
366               int      offset = ( o2_vdc.s.foreground[i].ptr | ( ( o2_vdc.s.foreground[i].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 );
367367               UINT8   chr = ((char*)o2_shape)[ offset & 0x1FF ];
368368               int      x = o2_vdc.s.foreground[i].x;
369369               UINT8   m;
r1815r1816
390390         /* Quad objects */
391391         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.quad ); i++ ) {
392392            int y = o2_vdc.s.quad[i].single[0].y;
393            int height = 7;
393            int height = 8;
394394
395395            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
396396               int   x = o2_vdc.s.quad[i].single[0].x;
r1815r1816
398398
399399               for ( j = 0; j < ARRAY_LENGTH( o2_vdc.s.quad[0].single ); j++, x += 8 ) {
400400                  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 ) ) + ( ( vpos - start_vpos ) >> 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 );
402402                  UINT8   chr = ((char*)o2_shape)[ offset & 0x1FF ];
403403                  UINT8   m;
404404

Previous 15994 Revisions Next


© 1998-2018 The MESS Team