Previous 15994 Revisions Next

r1699 Wednesday 20th February, 2008 at 20:20:52 UTC by Wilbert Pol
[ODYSSEY2] Fixed 0.118u5 regression. (bug #1402)
[src/mess/video]odyssey2.c

src/mess/video/odyssey2.c
r1698r1699
341341    }
342342}
343343
344INLINE void odyssey2_draw(UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id)
344INLINE void odyssey2_draw(mame_bitmap *bitmap, UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id, UINT32 col)
345345{
346346    int m,x1,y1;
347347    for (m=0x80; m>0; m>>=1, x+=scale_x)
r1698r1699
351351         for (y1=0; y1<scale_y; y1++)
352352         {
353353            for (x1 = 0; x1 < scale_x; x1++)
354            {
354355               bg[y+y1][x+x1] |= collision_id;
356               *BITMAP_ADDR16(bitmap, y+y1, x+x1) = col;
357            }
355358         }
356359      }
357360    }
358361}
359362
360363// different bit ordering, maybe I should change rom
361INLINE void odyssey2_draw_sprite(UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id)
364INLINE void odyssey2_draw_sprite(mame_bitmap *bitmap, UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id, UINT32 col)
362365{
363366    int m,x1,y1;
364367
r1698r1699
369372         for (y1=0; y1<scale_y; y1++)
370373         {
371374            for (x1 = 0; x1 < scale_x; x1++)
375            {
372376               bg[y+y1][x+x1] |= collision_id;
377               *BITMAP_ADDR16(bitmap, y+y1, x+x1) = col;
378            }
373379         }
374380      }
375381    }
r1698r1699
421427{
422428    int n, i;
423429    int offset = ptr | ((color & 1) << 8);
430   UINT32 col = Machine->pens[16 + ( ( color & 0xe ) >> 1 )];
424431
425432    offset=(offset + (y >> 1)) & 0x1ff;
426   /* 7-Sep-2007 - whomever wrote this crap code was dynamically remapping
427    * the color table, a vile gross hack.  Doesn't look like this is going
428    * to survive the 0.118u5 transition */
429   /* Machine->gfx[0]->colortable[1]=Machine->pens[16 + ((color & 0xe) >> 1)]; */
430433
431434    // don't ask me about the technical background, but also this height thingy is needed
432435    // invaders aliens (!) and shoot (-)
r1698r1699
440443        if (y + i * 2 >= bitmap->height )
441444            break;
442445
443        odyssey2_draw(bg, ((char*)o2_shape)[offset], x, y+i*2, 1, 2, COLLISION_CHARACTERS);
444        drawgfxzoom(bitmap, Machine->gfx[0], ((char*)o2_shape)[offset],0,
445                0,0,x,y+i*2,
446                0, TRANSPARENCY_PEN,0, 0x10000, 0x20000);
446      odyssey2_draw(bitmap, bg, ((char*)o2_shape)[offset], x, y+i*2, 1, 2, COLLISION_CHARACTERS, col);
447447        offset=(offset+1) & 0x1ff;
448448    }
449449}
r1698r1699
488488
489489      for (i=0; i<ARRAY_LENGTH(o2_vdc.s.sprites); i++)
490490      {
491         /* 7-Sep-2007 - whomever wrote this crap code was dynamically remapping
492          * the color table, a vile gross hack.  Doesn't look like this is going
493          * to survive the 0.118u5 transition */
494         /* machine->gfx[0]->colortable[1]=machine->pens[16+((o2_vdc.s.sprites[i].color>>3)&7)]; */
491         UINT32 col = machine->pens[16+((o2_vdc.s.sprites[i].color>>3)&7)];
495492
496493         y=o2_vdc.s.sprites[i].y;
497494         x=o2_vdc.s.sprites[i].x;
r1698r1699
502499            {
503500               if (y+4*j>=bitmap->height)
504501                        break;
505               odyssey2_draw_sprite(bg, o2_vdc.s.shape[i][j], x, y+j*4, 2, 4, 1<<i);    /* 1 << i is sprite collision index */
506               drawgfxzoom(bitmap, machine->gfx[1], o2_vdc.s.shape[i][j],0,
507                  0,0,x,y+j*4,
508                  0, TRANSPARENCY_PEN,0,0x20000, 0x40000);
502               odyssey2_draw_sprite(bitmap, bg, o2_vdc.s.shape[i][j], x, y+j*4, 2, 4, 1<<i, col);    /* 1 << i is sprite collision index */
509503            }
510504
511505            else
512506            {
513507               if (y+j*2>=bitmap->height)
514508                        break;
515               odyssey2_draw_sprite(bg, o2_vdc.s.shape[i][j], x, y+j*2, 1, 2, 1<<i);    /* 1 << i is sprite collision index */
516               drawgfxzoom(bitmap, machine->gfx[1], o2_vdc.s.shape[i][j],0,
517                  0,0,x,y+j*2,
518                  0, TRANSPARENCY_PEN,0, 0x10000, 0x20000);
509               odyssey2_draw_sprite(bitmap, bg, o2_vdc.s.shape[i][j], x, y+j*2, 1, 2, 1<<i, col);    /* 1 << i is sprite collision index */
519510            }
520511         }
521512      }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team