88
READ8_HANDLER( starshp1_rng_r )
88
READ8_MEMBER(starshp1_state::starshp1_rng_r)
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();
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)
103
return state->m_LSFR[x + (UINT16) (512 * y)];
102
return m_LSFR[x + (UINT16) (512 * y)];
107
WRITE8_HANDLER( starshp1_ssadd_w )
106
WRITE8_MEMBER(starshp1_state::starshp1_ssadd_w)
109
starshp1_state *state = space->machine().driver_data<starshp1_state>();
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.
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);
124
WRITE8_HANDLER( starshp1_sspic_w )
122
WRITE8_MEMBER(starshp1_state::starshp1_sspic_w)
126
starshp1_state *state = space->machine().driver_data<starshp1_state>();
128
125
* Some mysterious game code at address $2CCE is causing
129
126
* erratic images in the target explosion sequence. The
133
130
if (data != 0x87)
134
state->m_ship_picture = data;
131
m_ship_picture = data;
138
WRITE8_HANDLER( starshp1_playfield_w )
135
WRITE8_MEMBER(starshp1_state::starshp1_playfield_w)
140
starshp1_state *state = space->machine().driver_data<starshp1_state>();
141
if (state->m_mux != 0)
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);