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

« back to all changes in this revision

Viewing changes to src/mame/video/carjmbre.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:
32
32
 
33
33
PALETTE_INIT( carjmbre )
34
34
{
 
35
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
35
36
        rgb_t *rgb;
36
37
 
37
38
        rgb = compute_res_net_all(machine, color_prom, &carjmbre_decode_info, &carjmbre_net_info);
42
43
 
43
44
 
44
45
 
45
 
WRITE8_HANDLER( carjmbre_flipscreen_w )
 
46
WRITE8_MEMBER(carjmbre_state::carjmbre_flipscreen_w)
46
47
{
47
 
        carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
48
48
 
49
 
        state->m_flipscreen = (data & 1) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
50
 
        space->machine().tilemap().set_flip_all(state->m_flipscreen);
 
49
        m_flipscreen = (data & 1) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
 
50
        machine().tilemap().set_flip_all(m_flipscreen);
51
51
}
52
52
 
53
 
WRITE8_HANDLER( carjmbre_bgcolor_w )
 
53
WRITE8_MEMBER(carjmbre_state::carjmbre_bgcolor_w)
54
54
{
55
 
        carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
56
55
        data = ~data & 0x3f;
57
56
 
58
 
        if (data != state->m_bgcolor)
 
57
        if (data != m_bgcolor)
59
58
        {
60
59
                int i;
61
60
 
62
 
                state->m_bgcolor = data;
 
61
                m_bgcolor = data;
63
62
                if (data & 3)
64
63
                        for (i = 0; i < 64; i += 4)
65
 
                                palette_set_color(space->machine(), i, palette_get_color(space->machine(), data));
 
64
                                palette_set_color(machine(), i, palette_get_color(machine(), data));
66
65
                else
67
66
                        // restore to initial state (black)
68
67
                        for (i = 0; i < 64; i += 4)
69
 
                                palette_set_color(space->machine(), i, RGB_BLACK);
 
68
                                palette_set_color(machine(), i, RGB_BLACK);
70
69
        }
71
70
}
72
71
 
73
 
WRITE8_HANDLER( carjmbre_8806_w )
 
72
WRITE8_MEMBER(carjmbre_state::carjmbre_8806_w)
74
73
{
75
74
        // unknown, gets updated at same time as carjmbre_bgcolor_w
76
75
}
77
76
 
78
 
WRITE8_HANDLER( carjmbre_videoram_w )
 
77
WRITE8_MEMBER(carjmbre_state::carjmbre_videoram_w)
79
78
{
80
 
        carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
81
79
 
82
 
        state->m_videoram[offset] = data;
83
 
        state->m_cj_tilemap->mark_tile_dirty(offset & 0x3ff);
 
80
        m_videoram[offset] = data;
 
81
        m_cj_tilemap->mark_tile_dirty(offset & 0x3ff);
84
82
}
85
83
 
86
84
 
131
129
        //--xx---- unused
132
130
        //----xxxx colour
133
131
        //+3       x pos
134
 
        for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4)
 
132
        for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
135
133
        {
136
134
                //before copying the sprites to spriteram the game reorders the first
137
135
                //sprite to last, sprite ordering is incorrect if this isn't undone
138
 
                troffs = (offs - 4 + state->m_spriteram_size) % state->m_spriteram_size;
 
136
                troffs = (offs - 4 + state->m_spriteram.bytes()) % state->m_spriteram.bytes();
139
137
 
140
138
                //unused sprites are marked with ypos <= 0x02 (or >= 0xfd if screen flipped)
141
139
                if (state->m_spriteram[troffs] > 0x02 && state->m_spriteram[troffs] < 0xfd)