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

« back to all changes in this revision

Viewing changes to src/mame/video/starshp1.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:
85
85
}
86
86
 
87
87
 
88
 
READ8_HANDLER( starshp1_rng_r )
 
88
READ8_MEMBER(starshp1_state::starshp1_rng_r)
89
89
{
90
 
        starshp1_state *state = space->machine().driver_data<starshp1_state>();
91
 
        int width = space->machine().primary_screen->width();
92
 
        int height = space->machine().primary_screen->height();
93
 
        int x = space->machine().primary_screen->hpos();
94
 
        int y = space->machine().primary_screen->vpos();
 
90
        int width = machine().primary_screen->width();
 
91
        int height = machine().primary_screen->height();
 
92
        int x = machine().primary_screen->hpos();
 
93
        int y = machine().primary_screen->vpos();
95
94
 
96
95
        /* the LFSR is only running in the non-blank region
97
96
       of the screen, so this is not quite right */
100
99
        if (y > height - 1)
101
100
                y = height - 1;
102
101
 
103
 
        return state->m_LSFR[x + (UINT16) (512 * y)];
 
102
        return m_LSFR[x + (UINT16) (512 * y)];
104
103
}
105
104
 
106
105
 
107
 
WRITE8_HANDLER( starshp1_ssadd_w )
 
106
WRITE8_MEMBER(starshp1_state::starshp1_ssadd_w)
108
107
{
109
 
        starshp1_state *state = space->machine().driver_data<starshp1_state>();
110
108
        /*
111
109
     * The range of sprite position values doesn't suffice to
112
 
     * move the zoomed spaceship sprite over the top and left
 
110
     * move the zoomed &spaceship sprite over the top and left
113
111
     * edges of the screen. These additional values are used
114
112
     * to compensate for this. Technically, they cut off the
115
 
     * first columns and rows of the spaceship sprite, but in
 
113
     * first columns and rows of the &spaceship sprite, but in
116
114
     * practice they work like offsets in zoomed pixels.
117
115
     */
118
116
 
119
 
        state->m_ship_voffset = ((offset & 0xf0) >> 4);
120
 
        state->m_ship_hoffset = ((offset & 0x0f) << 2) | (data & 3);
 
117
        m_ship_voffset = ((offset & 0xf0) >> 4);
 
118
        m_ship_hoffset = ((offset & 0x0f) << 2) | (data & 3);
121
119
}
122
120
 
123
121
 
124
 
WRITE8_HANDLER( starshp1_sspic_w )
 
122
WRITE8_MEMBER(starshp1_state::starshp1_sspic_w)
125
123
{
126
 
        starshp1_state *state = space->machine().driver_data<starshp1_state>();
127
124
        /*
128
125
     * Some mysterious game code at address $2CCE is causing
129
126
     * erratic images in the target explosion sequence. The
131
128
     */
132
129
 
133
130
        if (data != 0x87)
134
 
                state->m_ship_picture = data;
 
131
                m_ship_picture = data;
135
132
}
136
133
 
137
134
 
138
 
WRITE8_HANDLER( starshp1_playfield_w )
 
135
WRITE8_MEMBER(starshp1_state::starshp1_playfield_w)
139
136
{
140
 
        starshp1_state *state = space->machine().driver_data<starshp1_state>();
141
 
        if (state->m_mux != 0)
 
137
        if (m_mux != 0)
142
138
        {
143
139
                offset ^= 0x1f;
144
 
                state->m_playfield_ram[offset] = data;
145
 
                state->m_bg_tilemap->mark_tile_dirty(offset);
 
140
                m_playfield_ram[offset] = data;
 
141
                m_bg_tilemap->mark_tile_dirty(offset);
146
142
        }
147
143
}
148
144