src/mess/video/odyssey2.c
| r1698 | r1699 | |
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | | INLINE void odyssey2_draw(UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id) |
| 344 | INLINE 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) |
| 345 | 345 | { |
| 346 | 346 | int m,x1,y1; |
| 347 | 347 | for (m=0x80; m>0; m>>=1, x+=scale_x) |
| r1698 | r1699 | |
| 351 | 351 | for (y1=0; y1<scale_y; y1++) |
| 352 | 352 | { |
| 353 | 353 | for (x1 = 0; x1 < scale_x; x1++) |
| 354 | { |
| 354 | 355 | bg[y+y1][x+x1] |= collision_id; |
| 356 | *BITMAP_ADDR16(bitmap, y+y1, x+x1) = col; |
| 357 | } |
| 355 | 358 | } |
| 356 | 359 | } |
| 357 | 360 | } |
| 358 | 361 | } |
| 359 | 362 | |
| 360 | 363 | // different bit ordering, maybe I should change rom |
| 361 | | INLINE void odyssey2_draw_sprite(UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id) |
| 364 | INLINE 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) |
| 362 | 365 | { |
| 363 | 366 | int m,x1,y1; |
| 364 | 367 | |
| r1698 | r1699 | |
| 369 | 372 | for (y1=0; y1<scale_y; y1++) |
| 370 | 373 | { |
| 371 | 374 | for (x1 = 0; x1 < scale_x; x1++) |
| 375 | { |
| 372 | 376 | bg[y+y1][x+x1] |= collision_id; |
| 377 | *BITMAP_ADDR16(bitmap, y+y1, x+x1) = col; |
| 378 | } |
| 373 | 379 | } |
| 374 | 380 | } |
| 375 | 381 | } |
| r1698 | r1699 | |
| 421 | 427 | { |
| 422 | 428 | int n, i; |
| 423 | 429 | int offset = ptr | ((color & 1) << 8); |
| 430 | UINT32 col = Machine->pens[16 + ( ( color & 0xe ) >> 1 )]; |
| 424 | 431 | |
| 425 | 432 | 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)]; */ |
| 430 | 433 | |
| 431 | 434 | // don't ask me about the technical background, but also this height thingy is needed |
| 432 | 435 | // invaders aliens (!) and shoot (-) |
| r1698 | r1699 | |
| 440 | 443 | if (y + i * 2 >= bitmap->height ) |
| 441 | 444 | break; |
| 442 | 445 | |
| 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); |
| 447 | 447 | offset=(offset+1) & 0x1ff; |
| 448 | 448 | } |
| 449 | 449 | } |
| r1698 | r1699 | |
| 488 | 488 | |
| 489 | 489 | for (i=0; i<ARRAY_LENGTH(o2_vdc.s.sprites); i++) |
| 490 | 490 | { |
| 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)]; |
| 495 | 492 | |
| 496 | 493 | y=o2_vdc.s.sprites[i].y; |
| 497 | 494 | x=o2_vdc.s.sprites[i].x; |
| r1698 | r1699 | |
| 502 | 499 | { |
| 503 | 500 | if (y+4*j>=bitmap->height) |
| 504 | 501 | 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 */ |
| 509 | 503 | } |
| 510 | 504 | |
| 511 | 505 | else |
| 512 | 506 | { |
| 513 | 507 | if (y+j*2>=bitmap->height) |
| 514 | 508 | 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 */ |
| 519 | 510 | } |
| 520 | 511 | } |
| 521 | 512 | } |