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

« back to all changes in this revision

Viewing changes to src/mame/video/tehkanwc.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
#include "includes/tehkanwc.h"
16
16
 
17
17
 
18
 
WRITE8_HANDLER( tehkanwc_videoram_w )
19
 
{
20
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
21
 
        state->m_videoram[offset] = data;
22
 
        state->m_fg_tilemap->mark_tile_dirty(offset);
23
 
}
24
 
 
25
 
WRITE8_HANDLER( tehkanwc_colorram_w )
26
 
{
27
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
28
 
        state->m_colorram[offset] = data;
29
 
        state->m_fg_tilemap->mark_tile_dirty(offset);
30
 
}
31
 
 
32
 
WRITE8_HANDLER( tehkanwc_videoram2_w )
33
 
{
34
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
35
 
        state->m_videoram2[offset] = data;
36
 
        state->m_bg_tilemap->mark_tile_dirty(offset / 2);
37
 
}
38
 
 
39
 
WRITE8_HANDLER( tehkanwc_scroll_x_w )
40
 
{
41
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
42
 
        state->m_scroll_x[offset] = data;
43
 
}
44
 
 
45
 
WRITE8_HANDLER( tehkanwc_scroll_y_w )
46
 
{
47
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
48
 
        state->m_bg_tilemap->set_scrolly(0, data);
49
 
}
50
 
 
51
 
WRITE8_HANDLER( tehkanwc_flipscreen_x_w )
52
 
{
53
 
        flip_screen_x_set(space->machine(), data & 0x40);
54
 
}
55
 
 
56
 
WRITE8_HANDLER( tehkanwc_flipscreen_y_w )
57
 
{
58
 
        flip_screen_y_set(space->machine(), data & 0x40);
59
 
}
60
 
 
61
 
WRITE8_HANDLER( gridiron_led0_w )
62
 
{
63
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
64
 
        state->m_led0 = data;
65
 
}
66
 
WRITE8_HANDLER( gridiron_led1_w )
67
 
{
68
 
        tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
69
 
        state->m_led1 = data;
 
18
WRITE8_MEMBER(tehkanwc_state::tehkanwc_videoram_w)
 
19
{
 
20
        m_videoram[offset] = data;
 
21
        m_fg_tilemap->mark_tile_dirty(offset);
 
22
}
 
23
 
 
24
WRITE8_MEMBER(tehkanwc_state::tehkanwc_colorram_w)
 
25
{
 
26
        m_colorram[offset] = data;
 
27
        m_fg_tilemap->mark_tile_dirty(offset);
 
28
}
 
29
 
 
30
WRITE8_MEMBER(tehkanwc_state::tehkanwc_videoram2_w)
 
31
{
 
32
        m_videoram2[offset] = data;
 
33
        m_bg_tilemap->mark_tile_dirty(offset / 2);
 
34
}
 
35
 
 
36
WRITE8_MEMBER(tehkanwc_state::tehkanwc_scroll_x_w)
 
37
{
 
38
        m_scroll_x[offset] = data;
 
39
}
 
40
 
 
41
WRITE8_MEMBER(tehkanwc_state::tehkanwc_scroll_y_w)
 
42
{
 
43
        m_bg_tilemap->set_scrolly(0, data);
 
44
}
 
45
 
 
46
WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_x_w)
 
47
{
 
48
        flip_screen_x_set(data & 0x40);
 
49
}
 
50
 
 
51
WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_y_w)
 
52
{
 
53
        flip_screen_y_set(data & 0x40);
 
54
}
 
55
 
 
56
WRITE8_MEMBER(tehkanwc_state::gridiron_led0_w)
 
57
{
 
58
        m_led0 = data;
 
59
}
 
60
WRITE8_MEMBER(tehkanwc_state::gridiron_led1_w)
 
61
{
 
62
        m_led1 = data;
70
63
}
71
64
 
72
65
static TILE_GET_INFO( get_bg_tile_info )
137
130
        UINT8 *spriteram = state->m_spriteram;
138
131
        int offs;
139
132
 
140
 
        for (offs = 0;offs < state->m_spriteram_size;offs += 4)
 
133
        for (offs = 0;offs < state->m_spriteram.bytes();offs += 4)
141
134
        {
142
135
                int attr = spriteram[offs + 1];
143
136
                int code = spriteram[offs] + ((attr & 0x08) << 5);
147
140
                int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
148
141
                int sy = spriteram[offs + 3];
149
142
 
150
 
                if (flip_screen_x_get(machine))
 
143
                if (state->flip_screen_x())
151
144
                {
152
145
                        sx = 240 - sx;
153
146
                        flipx = !flipx;
154
147
                }
155
148
 
156
 
                if (flip_screen_y_get(machine))
 
149
                if (state->flip_screen_y())
157
150
                {
158
151
                        sy = 240 - sy;
159
152
                        flipy = !flipy;