~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/mame/video/cbuster.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
   Crude Buster Video emulation - Bryan McPhail, mish@tendril.co.uk
4
 
 
5
 
***************************************************************************/
6
 
 
7
 
#include "emu.h"
8
 
#include "includes/cbuster.h"
9
 
#include "video/deco16ic.h"
10
 
#include "video/decospr.h"
11
 
 
12
 
/******************************************************************************/
13
 
 
14
 
/* maybe the game should just use generic palette handling, and have a darker palette by design... */
15
 
 
16
 
static void update_24bitcol( running_machine &machine, int offset )
17
 
{
18
 
        UINT8 r, g, b; /* The highest palette value seems to be 0x8e */
19
 
 
20
 
        r = (UINT8)((float)((machine.generic.paletteram.u16[offset]  >> 0) & 0xff) * 1.75);
21
 
        g = (UINT8)((float)((machine.generic.paletteram.u16[offset]  >> 8) & 0xff) * 1.75);
22
 
        b = (UINT8)((float)((machine.generic.paletteram2.u16[offset] >> 0) & 0xff) * 1.75);
23
 
 
24
 
        palette_set_color(machine, offset, MAKE_RGB(r, g, b));
25
 
}
26
 
 
27
 
WRITE16_HANDLER( twocrude_palette_24bit_rg_w )
28
 
{
29
 
        COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
30
 
        update_24bitcol(space->machine(), offset);
31
 
}
32
 
 
33
 
WRITE16_HANDLER( twocrude_palette_24bit_b_w )
34
 
{
35
 
        COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
36
 
        update_24bitcol(space->machine(), offset);
37
 
}
38
 
 
39
 
 
40
 
/******************************************************************************/
41
 
 
42
 
 
43
 
/******************************************************************************/
44
 
 
45
 
VIDEO_START( twocrude )
46
 
{
47
 
        machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
48
 
}
49
 
 
50
 
SCREEN_UPDATE( twocrude )
51
 
{
52
 
        cbuster_state *state = screen->machine().driver_data<cbuster_state>();
53
 
        UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
54
 
 
55
 
        flip_screen_set(screen->machine(), !BIT(flip, 7));
56
 
 
57
 
        screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16_buffer, 0x400);
58
 
 
59
 
 
60
 
        deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
61
 
        deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
62
 
 
63
 
        /* Draw playfields & sprites */
64
 
        deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
65
 
        screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff);
66
 
        screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff);
67
 
 
68
 
        if (state->m_pri)
69
 
        {
70
 
                deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
71
 
                deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0);
72
 
        }
73
 
        else
74
 
        {
75
 
                deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0);
76
 
                deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
77
 
        }
78
 
 
79
 
        screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff);
80
 
        screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff);
81
 
        deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
82
 
        return 0;
83
 
}