~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        0x01    = Scroll MSB
16
16
*/
17
17
 
18
 
WRITE8_HANDLER( battlane_palette_w )
 
18
WRITE8_MEMBER(battlane_state::battlane_palette_w)
19
19
{
20
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
21
20
        int r, g, b;
22
21
        int bit0, bit1, bit2;
23
22
 
37
36
 
38
37
        /* blue component */
39
38
 
40
 
        bit0 = (~state->m_video_ctrl >> 7) & 0x01;
 
39
        bit0 = (~m_video_ctrl >> 7) & 0x01;
41
40
        bit1 = (~data >> 6) & 0x01;
42
41
        bit2 = (~data >> 7) & 0x01;
43
42
        b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
44
43
 
45
 
        palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
46
 
}
47
 
 
48
 
WRITE8_HANDLER( battlane_scrollx_w )
49
 
{
50
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
51
 
        state->m_bg_tilemap->set_scrollx(0, ((state->m_video_ctrl & 0x01) << 8) + data);
52
 
}
53
 
 
54
 
WRITE8_HANDLER( battlane_scrolly_w )
55
 
{
56
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
57
 
        state->m_bg_tilemap->set_scrolly(0, ((state->m_cpu_control & 0x01) << 8) + data);
58
 
}
59
 
 
60
 
WRITE8_HANDLER( battlane_tileram_w )
61
 
{
62
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
63
 
        state->m_tileram[offset] = data;
64
 
        //state->m_bg_tilemap->mark_tile_dirty(offset);
65
 
}
66
 
 
67
 
WRITE8_HANDLER( battlane_spriteram_w )
68
 
{
69
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
70
 
        state->m_spriteram[offset] = data;
71
 
}
72
 
 
73
 
WRITE8_HANDLER( battlane_bitmap_w )
74
 
{
75
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
 
44
        palette_set_color(machine(), offset, MAKE_RGB(r, g, b));
 
45
}
 
46
 
 
47
WRITE8_MEMBER(battlane_state::battlane_scrollx_w)
 
48
{
 
49
        m_bg_tilemap->set_scrollx(0, ((m_video_ctrl & 0x01) << 8) + data);
 
50
}
 
51
 
 
52
WRITE8_MEMBER(battlane_state::battlane_scrolly_w)
 
53
{
 
54
        m_bg_tilemap->set_scrolly(0, ((m_cpu_control & 0x01) << 8) + data);
 
55
}
 
56
 
 
57
WRITE8_MEMBER(battlane_state::battlane_tileram_w)
 
58
{
 
59
        m_tileram[offset] = data;
 
60
        //m_bg_tilemap->mark_tile_dirty(offset);
 
61
}
 
62
 
 
63
WRITE8_MEMBER(battlane_state::battlane_spriteram_w)
 
64
{
 
65
        m_spriteram[offset] = data;
 
66
}
 
67
 
 
68
WRITE8_MEMBER(battlane_state::battlane_bitmap_w)
 
69
{
76
70
        int i, orval;
77
71
 
78
 
        orval = (~state->m_video_ctrl >> 1) & 0x07;
 
72
        orval = (~m_video_ctrl >> 1) & 0x07;
79
73
 
80
74
        if (!orval)
81
75
                orval = 7;
84
78
        {
85
79
                if (data & 1 << i)
86
80
                {
87
 
                        state->m_screen_bitmap.pix8(offset % 0x100, (offset / 0x100) * 8 + i) |= orval;
 
81
                        m_screen_bitmap.pix8(offset % 0x100, (offset / 0x100) * 8 + i) |= orval;
88
82
                }
89
83
                else
90
84
                {
91
 
                        state->m_screen_bitmap.pix8(offset % 0x100, (offset / 0x100) * 8 + i) &= ~orval;
 
85
                        m_screen_bitmap.pix8(offset % 0x100, (offset / 0x100) * 8 + i) &= ~orval;
92
86
                }
93
87
        }
94
88
}
95
89
 
96
 
WRITE8_HANDLER( battlane_video_ctrl_w )
 
90
WRITE8_MEMBER(battlane_state::battlane_video_ctrl_w)
97
91
{
98
 
        battlane_state *state = space->machine().driver_data<battlane_state>();
99
 
        state->m_video_ctrl = data;
 
92
        m_video_ctrl = data;
100
93
}
101
94
 
102
95
static TILE_GET_INFO( get_tile_info_bg )
182
175
                        flipx = attr & 0x04;
183
176
                        flipy = attr & 0x02;
184
177
 
185
 
                        if (!flip_screen_get(machine))
 
178
                        if (!state->flip_screen())
186
179
            {
187
180
                                sx = 240 - sx;
188
181
                                sy = 240 - sy;
225
218
 
226
219
                        if (data)
227
220
                        {
228
 
                                if (flip_screen_get(machine))
 
221
                                if (state->flip_screen())
229
222
                                        bitmap.pix16(255 - y, 255 - x) = data;
230
223
                                else
231
224
                                        bitmap.pix16(y, x) = data;