~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/mame/video/firetrk.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
262
262
}
263
263
 
264
264
 
265
 
static void firetrk_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int which, int flash)
 
265
static void firetrk_draw_car(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int flash)
266
266
{
267
267
        int gfx_bank, code, color, flip_x, flip_y, x, y;
268
268
 
287
287
                y = 104;
288
288
        }
289
289
 
290
 
        drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0);
 
290
        drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, 0);
291
291
}
292
292
 
293
293
 
294
 
static void superbug_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int flash)
 
294
static void superbug_draw_car(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int flash)
295
295
{
296
296
        int gfx_bank = (*firetrk_car_rot & 0x10) ? 4 : 3;
297
297
        int code = ~*firetrk_car_rot & 0x03;
299
299
        int flip_x = *firetrk_car_rot & 0x04;
300
300
        int flip_y = *firetrk_car_rot & 0x08;
301
301
 
302
 
        drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104, cliprect, TRANSPARENCY_PEN, 0);
 
302
        drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104, 0);
303
303
}
304
304
 
305
305
 
306
 
static void montecar_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int which, int is_collision_detection)
 
306
static void montecar_draw_car(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int is_collision_detection)
307
307
{
308
308
        int gfx_bank, code, color, flip_x, flip_y, x, y;
309
309
 
328
328
                y = 104;
329
329
        }
330
330
 
331
 
        drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0);
 
331
        drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, 0);
332
332
}
333
333
 
334
334
 
335
 
static void draw_text(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *alpha_ram,
 
335
static void draw_text(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, UINT8 *alpha_ram,
336
336
                                          int x, int count, int height)
337
337
{
338
338
        int i;
339
339
 
340
340
        for (i = 0; i < count; i++)
341
 
                drawgfx(bitmap, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height, cliprect, TRANSPARENCY_NONE, 0);
 
341
                drawgfx_opaque(bitmap, cliprect, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height);
342
342
}
343
343
 
344
344
 
363
363
 
364
364
VIDEO_UPDATE( firetrk )
365
365
{
366
 
        tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
 
366
        tilemap_mark_all_tiles_dirty_all(screen->machine);
367
367
        tilemap_set_scrollx(tilemap1, 0, *firetrk_scroll_x - 37);
368
368
        tilemap_set_scrollx(tilemap2, 0, *firetrk_scroll_x - 37);
369
369
        tilemap_set_scrolly(tilemap1, 0, *firetrk_scroll_y);
371
371
 
372
372
        bitmap_fill(bitmap, cliprect, 0);
373
373
        tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0);
374
 
        firetrk_draw_car(screen->machine->gfx, bitmap, &playfield_window, 0, firetrk_flash);
375
 
        firetrk_draw_car(screen->machine->gfx, bitmap, &playfield_window, 1, firetrk_flash);
376
 
        draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
377
 
        draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
 
374
        firetrk_draw_car(bitmap, &playfield_window, screen->machine->gfx, 0, firetrk_flash);
 
375
        firetrk_draw_car(bitmap, &playfield_window, screen->machine->gfx, 1, firetrk_flash);
 
376
        draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
 
377
        draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
378
378
 
379
379
        if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
380
380
        {
381
381
                tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0);
382
382
 
383
383
                bitmap_fill(helper2, &playfield_window, 0xff);
384
 
                firetrk_draw_car(screen->machine->gfx, helper2, &playfield_window, 0, FALSE);
 
384
                firetrk_draw_car(helper2, &playfield_window, screen->machine->gfx, 0, FALSE);
385
385
                check_collision(0);
386
386
 
387
387
                bitmap_fill(helper2, &playfield_window, 0xff);
388
 
                firetrk_draw_car(screen->machine->gfx, helper2, &playfield_window, 1, FALSE);
 
388
                firetrk_draw_car(helper2, &playfield_window, screen->machine->gfx, 1, FALSE);
389
389
                check_collision(1);
390
390
 
391
391
                *firetrk_blink = FALSE;
397
397
 
398
398
VIDEO_UPDATE( superbug )
399
399
{
400
 
        tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
 
400
        tilemap_mark_all_tiles_dirty_all(screen->machine);
401
401
        tilemap_set_scrollx(tilemap1, 0, *firetrk_scroll_x - 37);
402
402
        tilemap_set_scrollx(tilemap2, 0, *firetrk_scroll_x - 37);
403
403
        tilemap_set_scrolly(tilemap1, 0, *firetrk_scroll_y);
405
405
 
406
406
        bitmap_fill(bitmap, cliprect, 0);
407
407
        tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0);
408
 
        superbug_draw_car(screen->machine->gfx, bitmap, &playfield_window, firetrk_flash);
409
 
        draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
410
 
        draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
 
408
        superbug_draw_car(bitmap, &playfield_window, screen->machine->gfx, firetrk_flash);
 
409
        draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10);
 
410
        draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x10,   8, 0x10, 0x10);
411
411
 
412
412
        if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
413
413
        {
414
414
                tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0);
415
415
 
416
416
                bitmap_fill(helper2, &playfield_window, 0xff);
417
 
                superbug_draw_car(screen->machine->gfx, helper2, &playfield_window, FALSE);
 
417
                superbug_draw_car(helper2, &playfield_window, screen->machine->gfx, FALSE);
418
418
                check_collision(0);
419
419
 
420
420
                *firetrk_blink = FALSE;
426
426
 
427
427
VIDEO_UPDATE( montecar )
428
428
{
429
 
        tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
 
429
        tilemap_mark_all_tiles_dirty_all(screen->machine);
430
430
        tilemap_set_scrollx(tilemap1, 0, *firetrk_scroll_x - 37);
431
431
        tilemap_set_scrollx(tilemap2, 0, *firetrk_scroll_x - 37);
432
432
        tilemap_set_scrolly(tilemap1, 0, *firetrk_scroll_y);
434
434
 
435
435
        bitmap_fill(bitmap, cliprect, 0x2c);
436
436
        tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0);
437
 
        montecar_draw_car(screen->machine->gfx, bitmap, &playfield_window, 0, FALSE);
438
 
        montecar_draw_car(screen->machine->gfx, bitmap, &playfield_window, 1, FALSE);
439
 
        draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 24, 0x20, 0x08);
440
 
        draw_text(screen->machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x20, 16, 0x20, 0x08);
 
437
        montecar_draw_car(bitmap, &playfield_window, screen->machine->gfx, 0, FALSE);
 
438
        montecar_draw_car(bitmap, &playfield_window, screen->machine->gfx, 1, FALSE);
 
439
        draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x00, 24, 0x20, 0x08);
 
440
        draw_text(bitmap, cliprect, screen->machine->gfx, firetrk_alpha_num_ram + 0x20, 16, 0x20, 0x08);
441
441
 
442
442
        if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
443
443
        {
444
444
                tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0);
445
445
 
446
446
                bitmap_fill(helper2, &playfield_window, 0xff);
447
 
                montecar_draw_car(screen->machine->gfx, helper2, &playfield_window, 0, TRUE);
 
447
                montecar_draw_car(helper2, &playfield_window, screen->machine->gfx, 0, TRUE);
448
448
                check_collision(0);
449
449
 
450
450
                bitmap_fill(helper2, &playfield_window, 0xff);
451
 
                montecar_draw_car(screen->machine->gfx, helper2, &playfield_window, 1, TRUE);
 
451
                montecar_draw_car(helper2, &playfield_window, screen->machine->gfx, 1, TRUE);
452
452
                check_collision(1);
453
453
        }
454
454